Skip to content

Commit

Permalink
feat: separate dynamic info (ks, partnerid) from configuration info (…
Browse files Browse the repository at this point in the history
…client tag, endpointUrl)
  • Loading branch information
esakal committed May 22, 2017
1 parent 1920bcc commit 12bf78e
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/kaltura-clients/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { KalturaBrowserHttpClient } from './kaltura-browser-http-client';
export { KalturaClientBase } from './kaltura-client-base';
export { KalturaHttpClientBase } from './kaltura-http-client-base';
export * from './kaltura-browser-http-client';
export * from './kaltura-client-base';
export * from './kaltura-http-client-base';
9 changes: 7 additions & 2 deletions src/kaltura-clients/kaltura-browser-http-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@ import { KalturaRequest } from '../kaltura-request';
import { KalturaMultiRequest } from '../kaltura-multi-request';
import { KalturaMultiResponse } from '../kaltura-multi-response';
import { CancelableAction } from '../utils/cancelable-action';
import { KalturaHttpClientBase } from './kaltura-http-client-base';
import { KalturaHttpClientBase, KalturaHttpClientBaseConfiguration } from './kaltura-http-client-base';
import { KalturaAPIException } from '../kaltura-api-exception';


export interface KalturaBrowserHttpClientConfiguration extends KalturaHttpClientBaseConfiguration
{
}

export class KalturaBrowserHttpClient extends KalturaHttpClientBase {


constructor(config : { endpointUrl : string, clientTag : string, ks? : string, partnerId? : number}) {
constructor(config : KalturaBrowserHttpClientConfiguration) {
super(config);
}

Expand Down
10 changes: 7 additions & 3 deletions src/kaltura-clients/kaltura-client-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,21 @@ import { KalturaAPIException } from '../kaltura-api-exception';
import { KalturaUploadRequest } from '../kaltura-upload-request';
import { CancelableAction } from '../utils/cancelable-action';

export interface KalturaClientBaseConfiguration
{
clientTag : string;

}

export abstract class KalturaClientBase {

ks : string;
partnerId : number;
public clientTag : string;

constructor(config : { clientTag : string, ks? : string, partnerId? : number})
constructor(config : KalturaClientBaseConfiguration)
{
this.clientTag = config.clientTag;
this.ks = config.ks;
this.partnerId = config.partnerId;
}

protected abstract _transmitFileUploadRequest(request): CancelableAction;
Expand Down
9 changes: 7 additions & 2 deletions src/kaltura-clients/kaltura-http-client-base.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import { CancelableAction } from '../utils/cancelable-action';
import { KalturaClientBase } from './kaltura-client-base';
import { KalturaClientBase, KalturaClientBaseConfiguration } from './kaltura-client-base';

export interface KalturaHttpClientBaseConfiguration extends KalturaClientBaseConfiguration
{
endpointUrl : string;
}

export abstract class KalturaHttpClientBase extends KalturaClientBase {

public endpointUrl: string;


constructor(config : { endpointUrl : string, clientTag : string, ks? : string, partnerId? : number}) {
constructor(config : KalturaHttpClientBaseConfiguration) {
super(config);
this.endpointUrl = config.endpointUrl;
}
Expand Down

0 comments on commit 12bf78e

Please sign in to comment.