@playkit-js/playkit-js-providers 2.40.3 → 2.40.4-canary.0-b3e5269

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,390 @@
1
+ export declare type AdapterDataConfig = {
2
+ [key: string]: {
3
+ value: string;
4
+ objectType?: string;
5
+ };
6
+ };
7
+
8
+ export declare type CaptionType = {
9
+ [type: string]: string;
10
+ };
11
+
12
+ declare class DocumentSource {
13
+ /**
14
+ * @member - media source id
15
+ * @type {string}
16
+ */
17
+ id: string;
18
+ /**
19
+ * @member - media source url
20
+ * @type {string}
21
+ */
22
+ url: string;
23
+ /**
24
+ * @member - thumbnail url
25
+ * @type {string}
26
+ */
27
+ thumbnailUrl: string;
28
+ /**
29
+ * @member - media source mimetype
30
+ * @type {string}
31
+ */
32
+ mimetype: string;
33
+ constructor(entry: any);
34
+ }
35
+
36
+ export declare interface ILoader {
37
+ requests: Array<RequestBuilder>;
38
+ response: any;
39
+ isValid(): boolean;
40
+ }
41
+
42
+ declare class ImageSource {
43
+ /**
44
+ * @member - media source id
45
+ * @type {string}
46
+ */
47
+ id: string;
48
+ /**
49
+ * @member - media source url
50
+ * @type {string}
51
+ */
52
+ url: string;
53
+ /**
54
+ * @member - media source mimetype
55
+ * @type {string}
56
+ */
57
+ mimetype: string;
58
+ constructor(entry: any);
59
+ /**
60
+ * Extract the base thumbnail url.
61
+ * @param {string} url - dataUrl.
62
+ * @returns {string} - The base thumbnail url.
63
+ */
64
+ static extractBaseThumbnailUrl(url: string): string;
65
+ }
66
+
67
+ declare type loggerFunctionType = {
68
+ VERSION: string;
69
+ DEBUG: LogLevelObject;
70
+ ERROR: LogLevelObject;
71
+ INFO: LogLevelObject;
72
+ OFF: LogLevelObject;
73
+ TIME: LogLevelObject;
74
+ TRACE: LogLevelObject;
75
+ WARN: LogLevelObject;
76
+ createDefaultHandler: () => any;
77
+ debug: () => any;
78
+ enabledFor: () => any;
79
+ error: () => any;
80
+ get: () => any;
81
+ getLevel: () => any;
82
+ info: () => any;
83
+ log: () => any;
84
+ setHandler: () => any;
85
+ setLevel: () => any;
86
+ time: () => any;
87
+ timeEnd: () => any;
88
+ trace: () => any;
89
+ useDefaults: () => any;
90
+ warn: () => any;
91
+ };
92
+
93
+ declare type LoggerType = {
94
+ getLogger: loggerFunctionType;
95
+ LogLevel: LogLevelType;
96
+ };
97
+
98
+ declare type LogLevelObject = {
99
+ value: number;
100
+ name: string;
101
+ };
102
+
103
+ declare type LogLevelType = {
104
+ [level: string]: LogLevelObject;
105
+ };
106
+
107
+ export declare type OTTProviderMediaInfoObject = OVPProviderMediaInfoObject & {
108
+ mediaType: string;
109
+ contextType: string;
110
+ protocol?: string;
111
+ fileIds?: string;
112
+ streamerType?: string;
113
+ urlType?: string;
114
+ adapterData?: AdapterDataConfig;
115
+ assetReferenceType?: string;
116
+ formats?: Array<string>;
117
+ };
118
+
119
+ export declare type OVPProviderMediaInfoObject = {
120
+ entryId?: string;
121
+ referenceId?: string;
122
+ ks?: string;
123
+ };
124
+
125
+ export declare type PKExternalCaptionObject = {
126
+ url: string;
127
+ label: string;
128
+ language: string;
129
+ default?: boolean;
130
+ type?: string;
131
+ };
132
+
133
+ export declare interface Poster {
134
+ width: number;
135
+ height: number;
136
+ url: string;
137
+ }
138
+
139
+ export declare type ProviderDrmDataObject = {
140
+ licenseUrl: string;
141
+ scheme: string;
142
+ certificate?: string;
143
+ };
144
+
145
+ export declare type ProviderEntryListObject = {
146
+ entries: Array<ProviderMediaInfoObject>;
147
+ ks?: string;
148
+ };
149
+
150
+ export declare type ProviderEnvConfigObject = {
151
+ serviceUrl: string;
152
+ cdnUrl?: string;
153
+ analyticsServiceUrl?: string;
154
+ useApiCaptions?: boolean;
155
+ replaceHostOnlyManifestUrls?: boolean;
156
+ };
157
+
158
+ export declare type ProviderFilterOptionsObject = {
159
+ redirectFromEntryId?: boolean;
160
+ };
161
+
162
+ export declare type ProviderMediaConfigMetadataObject = {
163
+ name: string;
164
+ description?: string;
165
+ mediaType?: string;
166
+ contextType?: string;
167
+ metas?: any;
168
+ tags?: any;
169
+ epgId?: string;
170
+ recordingId?: string;
171
+ updatedAt?: number;
172
+ creatorId?: string;
173
+ views?: number;
174
+ };
175
+
176
+ export declare type ProviderMediaConfigObject = {
177
+ session: ProviderMediaConfigSessionObject;
178
+ sources: ProviderMediaConfigSourcesObject;
179
+ plugins: {
180
+ [plugin: string]: any;
181
+ };
182
+ };
183
+
184
+ export declare type ProviderMediaConfigSessionObject = {
185
+ partnerId: number;
186
+ uiConfId?: number;
187
+ ks?: string;
188
+ isAnonymous?: boolean;
189
+ };
190
+
191
+ export declare type ProviderMediaConfigSourcesObject = {
192
+ dash: Array<ProviderMediaSourceObject>;
193
+ hls: Array<ProviderMediaSourceObject>;
194
+ progressive: Array<ProviderMediaSourceObject>;
195
+ image: Array<ImageSource>;
196
+ document: Array<DocumentSource>;
197
+ duration?: number;
198
+ type: string;
199
+ id?: string;
200
+ poster?: string | Array<any>;
201
+ dvr: boolean;
202
+ vr?: any;
203
+ metadata: ProviderMediaConfigMetadataObject;
204
+ captions?: Array<PKExternalCaptionObject>;
205
+ downloadUrl?: string;
206
+ };
207
+
208
+ export declare type ProviderMediaEntryObject = {
209
+ id?: string;
210
+ name?: string;
211
+ sources: ProviderMediaSourcesObject;
212
+ duration?: number;
213
+ dvrStatus?: number;
214
+ status?: number;
215
+ metadata: any;
216
+ type: string;
217
+ poster?: string | Poster[];
218
+ downloadUrl?: string;
219
+ assetReferenceType?: string;
220
+ };
221
+
222
+ export declare type ProviderMediaFormatType = {
223
+ name: string;
224
+ mimeType: string;
225
+ pathExt: string;
226
+ };
227
+
228
+ export declare type ProviderMediaInfoObject = OVPProviderMediaInfoObject | OTTProviderMediaInfoObject;
229
+
230
+ export declare type ProviderMediaSourceObject = {
231
+ id: string;
232
+ url: string;
233
+ mimetype: string;
234
+ bandwidth?: number;
235
+ width?: number;
236
+ height?: number;
237
+ label?: string;
238
+ drmData?: Array<ProviderDrmDataObject>;
239
+ };
240
+
241
+ export declare type ProviderMediaSourcesObject = {
242
+ progressive: Array<ProviderMediaSourceObject>;
243
+ dash: Array<ProviderMediaSourceObject>;
244
+ hls: Array<ProviderMediaSourceObject>;
245
+ image: Array<ImageSource>;
246
+ document: Array<DocumentSource>;
247
+ captions?: Array<PKExternalCaptionObject>;
248
+ };
249
+
250
+ export declare type ProviderNetworkRetryParameters = {
251
+ async: boolean;
252
+ timeout?: number;
253
+ maxAttempts?: number;
254
+ };
255
+
256
+ export declare type ProviderOptionsObject = {
257
+ partnerId: number;
258
+ widgetId?: string;
259
+ logger?: LoggerType;
260
+ ks?: string;
261
+ uiConfId?: number;
262
+ env?: ProviderEnvConfigObject;
263
+ networkRetryParameters?: ProviderNetworkRetryParameters;
264
+ filterOptions?: ProviderFilterOptionsObject;
265
+ ignoreServerConfig?: boolean;
266
+ loadThumbnailWithKs?: boolean;
267
+ };
268
+
269
+ export declare type ProviderPlaybackContextOptions = {
270
+ mediaProtocol?: string;
271
+ assetFileIds?: string;
272
+ context?: string;
273
+ streamerType?: string;
274
+ urlType?: string;
275
+ adapterData?: AdapterDataConfig;
276
+ };
277
+
278
+ export declare type ProviderPlaylistInfoObject = {
279
+ playlistId: string;
280
+ ks?: string;
281
+ };
282
+
283
+ declare type ProviderPlaylistItemObject = {
284
+ sources: ProviderMediaConfigSourcesObject;
285
+ };
286
+
287
+ export declare type ProviderPlaylistMetadataObject = {
288
+ name: string;
289
+ description: string;
290
+ };
291
+
292
+ export declare type ProviderPlaylistObject = {
293
+ id: string;
294
+ metadata: ProviderPlaylistMetadataObject;
295
+ poster: string;
296
+ items: Array<ProviderPlaylistItemObject>;
297
+ playlistLastEntryId?: string;
298
+ };
299
+
300
+ declare class RequestBuilder {
301
+ /**
302
+ * @member - Service name
303
+ * @type {string}
304
+ */
305
+ service: string;
306
+ /**
307
+ * @member - Service action
308
+ * @type {string}
309
+ */
310
+ action: string;
311
+ /**
312
+ * @member - Service params
313
+ * @type {any}
314
+ */
315
+ params: any;
316
+ /**
317
+ * @memberof - Service headers
318
+ * @type {Map<string, string>}
319
+ */
320
+ headers: Map<string, string>;
321
+ /**
322
+ * @memberof - Service URL
323
+ * @type {string}
324
+ */
325
+ url: string;
326
+ /**
327
+ * @memberof - Service method (POST,GET,DELETE etc..)
328
+ * @type {string}
329
+ */
330
+ method: string;
331
+ /**
332
+ * @memberof - Service tag
333
+ * @type {string}
334
+ */
335
+ tag: string;
336
+ /**
337
+ * @memberof - the response headers of the arra
338
+ * @type {Array<string>}
339
+ */
340
+ responseHeaders: Array<string>;
341
+ /**
342
+ * @description network retry configuration
343
+ * @memberof RequestBuilder
344
+ * @type {ProviderNetworkRetryParameters}
345
+ */
346
+ retryConfig: ProviderNetworkRetryParameters;
347
+ /**
348
+ * @description number of xhr attempts for the same multi - request.
349
+ * @memberof RequestBuilder
350
+ * @type {number}
351
+ * @private
352
+ */
353
+ private _attemptCounter;
354
+ /**
355
+ * @description hold the promise result of the XHR request(s) - if all tries fails, it rejects with the error.
356
+ * @memberof RequestBuilder
357
+ * @type {Object}
358
+ * @private
359
+ */
360
+ private _requestPromise;
361
+ /**
362
+ * @constructor
363
+ * @param {Map<string, string>} headers The request headers
364
+ */
365
+ constructor(headers?: Map<string, string>);
366
+ /**
367
+ * Builds restful service URL
368
+ * @function getUrl
369
+ * @param {string} serviceUrl - The service base URL
370
+ * @returns {string} The service URL
371
+ */
372
+ getUrl(serviceUrl: string): string;
373
+ /**
374
+ * Executes service
375
+ * @function doHttpRequest
376
+ * @returns {Promise.<any>} Service response as promise
377
+ */
378
+ doHttpRequest(): Promise<any>;
379
+ private _createXHR;
380
+ private _getResponseHeaders;
381
+ private _handleError;
382
+ private _createError;
383
+ }
384
+
385
+ export declare type RequestLoader = {
386
+ loader: ILoader;
387
+ params: any;
388
+ };
389
+
390
+ export { }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playkit-js/playkit-js-providers/ott-provider",
3
3
  "main": "../dist/playkit-ott-provider.js",
4
- "types": "../dist/index.d.ts",
4
+ "types": "../dist/ott-provider.d.ts",
5
5
  "sideEffects": false
6
6
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playkit-js/playkit-js-providers/ovp-provider",
3
3
  "main": "../dist/playkit-ovp-provider.js",
4
- "types": "../dist/index.d.ts",
4
+ "types": "../dist/ovp-provider.d.ts",
5
5
  "sideEffects": false
6
6
  }
package/package.json CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "name": "@playkit-js/playkit-js-providers",
3
- "version": "2.40.3",
3
+ "version": "2.40.4-canary.0-b3e5269",
4
4
  "description": "",
5
- "types": "./dist/index.d.ts",
6
5
  "files": [
7
6
  "dist/**/*",
8
7
  "src/**/*",
@@ -11,21 +10,29 @@
11
10
  "bookmark-service/*",
12
11
  "ott-provider/*",
13
12
  "ovp-provider/*",
14
- "stats-service/*"
13
+ "stats-service/*",
14
+ "types/*"
15
15
  ],
16
16
  "exports": {
17
17
  "./ovp-provider": "./dist/playkit-ovp-provider.js",
18
18
  "./ott-provider": "./dist/playkit-ott-provider.js",
19
19
  "./analytics-service": "./dist/playkit-analytics-service.js",
20
20
  "./stats-service": "./dist/playkit-stats-service.js",
21
- "./bookmark-service": "./dist/playkit-bookmark-service.js"
21
+ "./bookmark-service": "./dist/playkit-bookmark-service.js",
22
+ "./types": "./dist/types.d.ts"
22
23
  },
23
24
  "scripts": {
24
25
  "serve": "webpack serve --open --mode=development",
25
26
  "build:dev": "webpack --mode=development",
26
27
  "build:prod": "webpack --mode=production --node-env=production",
27
28
  "build": "yarn run build:prod && yarn run build:types",
28
- "build:types": "tsc --build tsconfig-lib.json && mkdir -p lib && api-extractor run --local",
29
+ "build:types": "yarn run build:types:ovp && yarn run build:types:ott && yarn run build:types:analytics && yarn run build:types:bookmark && yarn run build:types:stats && yarn run build:types:types",
30
+ "build:types:ovp": "tsc --build tsconfig-lib.json && mkdir -p lib && api-extractor run --config api-extracor-config/api-extractor-ovp-provider.json --local",
31
+ "build:types:ott": "tsc --build tsconfig-lib.json && mkdir -p lib && api-extractor run --config api-extracor-config/api-extractor-ott-provider.json --local",
32
+ "build:types:analytics": "tsc --build tsconfig-lib.json && mkdir -p lib && api-extractor run --config api-extracor-config/api-extractor-analytics-service.json --local",
33
+ "build:types:bookmark": "tsc --build tsconfig-lib.json && mkdir -p lib && api-extractor run --config api-extracor-config/api-extractor-bookmark-service.json --local",
34
+ "build:types:stats": "tsc --build tsconfig-lib.json && mkdir -p lib && api-extractor run --config api-extracor-config/api-extractor-stats-service.json --local",
35
+ "build:types:types": "tsc --build tsconfig-lib.json && mkdir -p lib && api-extractor run --config api-extracor-config/api-extractor-types.json --local",
29
36
  "type-check": "tsc --noEmit",
30
37
  "type-check:watch": "npm run type-check -- --watch",
31
38
  "watch": "webpack --mode=development --watch",
@@ -43,8 +50,8 @@
43
50
  "@babel/plugin-transform-runtime": "^7.22.15",
44
51
  "@babel/preset-env": "^7.21.5",
45
52
  "@babel/preset-typescript": "^7.22.15",
46
- "@microsoft/api-extractor": "^7.38.0",
47
- "@playkit-js/browserslist-config": "^1.0.8-canary.0-f5791c1",
53
+ "@microsoft/api-extractor": "^7.39.4",
54
+ "@playkit-js/browserslist-config": "1.0.8",
48
55
  "@typescript-eslint/eslint-plugin": "^6.7.2",
49
56
  "@typescript-eslint/parser": "^6.7.2",
50
57
  "babel-eslint": "^10.1.0",
@@ -24,11 +24,3 @@ export * from './playlist-info'
24
24
  export * from './provider-options'
25
25
  export * from './request-loader'
26
26
  export * from './poster'
27
-
28
- export { ProviderParser, RequestBuilder, ResponseTypes} from '../k-provider/ovp'
29
- export { ContextType, MediaType} from '../k-provider/ott'
30
- import {BaseProvider} from '../k-provider/common/base-provider'
31
- import OTTProvider from '../k-provider/ott/provider'
32
- import OVPProvider from '../k-provider/ovp/provider'
33
- export {OTTProvider, OVPProvider, OTTProvider as Provider, BaseProvider}
34
- export type IProvider = OTTProvider | OVPProvider;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playkit-js/playkit-js-providers/stats-service",
3
3
  "main": "../dist/playkit-stats-service.js",
4
- "types": "../dist/index.d.ts",
4
+ "types": "../dist/stats-service.d.ts",
5
5
  "sideEffects": false
6
6
  }
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "@playkit-js/playkit-js-providers/types",
3
+ "types": "../dist/types.d.ts",
4
+ "sideEffects": false
5
+ }