@svta/cml-cmcd 1.0.0 → 1.0.2
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.
- package/dist/index.d.ts +96 -148
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +86 -126
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -10,8 +10,7 @@ import { Request, ValueOf, ValueOrArray } from "@svta/cml-utils";
|
|
|
10
10
|
* revisions to this specification. Clients SHOULD use a reverse-DNS
|
|
11
11
|
* syntax when defining their own prefix.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
* @beta
|
|
13
|
+
* @public
|
|
15
14
|
*/
|
|
16
15
|
type CmcdCustomKey = `${string}-${string}`;
|
|
17
16
|
//#endregion
|
|
@@ -19,14 +18,13 @@ type CmcdCustomKey = `${string}-${string}`;
|
|
|
19
18
|
/**
|
|
20
19
|
* Common Media Client Data Object Type
|
|
21
20
|
*
|
|
22
|
-
*
|
|
23
|
-
* @beta
|
|
21
|
+
* @public
|
|
24
22
|
*
|
|
25
23
|
* @enum
|
|
26
24
|
*/
|
|
27
25
|
declare const CmcdObjectType: typeof CmObjectType;
|
|
28
26
|
/**
|
|
29
|
-
* @
|
|
27
|
+
* @public
|
|
30
28
|
*/
|
|
31
29
|
type CmcdObjectType = CmObjectType;
|
|
32
30
|
//#endregion
|
|
@@ -37,11 +35,11 @@ type CmcdObjectType = CmObjectType;
|
|
|
37
35
|
*
|
|
38
36
|
* @enum
|
|
39
37
|
*
|
|
40
|
-
* @
|
|
38
|
+
* @public
|
|
41
39
|
*/
|
|
42
40
|
declare const CmcdStreamType: typeof CmStreamType;
|
|
43
41
|
/**
|
|
44
|
-
* @
|
|
42
|
+
* @public
|
|
45
43
|
*/
|
|
46
44
|
type CmcdStreamType = CmStreamType;
|
|
47
45
|
//#endregion
|
|
@@ -52,11 +50,11 @@ type CmcdStreamType = CmStreamType;
|
|
|
52
50
|
*
|
|
53
51
|
* @enum
|
|
54
52
|
*
|
|
55
|
-
* @
|
|
53
|
+
* @public
|
|
56
54
|
*/
|
|
57
55
|
declare const CmcdStreamingFormat: typeof CmStreamingFormat;
|
|
58
56
|
/**
|
|
59
|
-
* @
|
|
57
|
+
* @public
|
|
60
58
|
*/
|
|
61
59
|
type CmcdStreamingFormat = CmStreamingFormat;
|
|
62
60
|
//#endregion
|
|
@@ -64,8 +62,7 @@ type CmcdStreamingFormat = CmStreamingFormat;
|
|
|
64
62
|
/**
|
|
65
63
|
* CMCD Value
|
|
66
64
|
*
|
|
67
|
-
*
|
|
68
|
-
* @beta
|
|
65
|
+
* @public
|
|
69
66
|
*/
|
|
70
67
|
type CmcdValue = CmcdObjectType | CmcdStreamingFormat | CmcdStreamType | string | string[] | number | number[] | boolean | symbol | SfToken | SfItem | SfItem[];
|
|
71
68
|
//#endregion
|
|
@@ -75,8 +72,7 @@ type CmcdValue = CmcdObjectType | CmcdStreamingFormat | CmcdStreamType | string
|
|
|
75
72
|
*
|
|
76
73
|
* @see {@link https://cdn.cta.tech/cta/media/media/resources/standards/pdfs/cta-5004-final.pdf|CMCD Spec}
|
|
77
74
|
*
|
|
78
|
-
*
|
|
79
|
-
* @beta
|
|
75
|
+
* @public
|
|
80
76
|
*/
|
|
81
77
|
type Cmcd = {
|
|
82
78
|
/**
|
|
@@ -281,8 +277,7 @@ type Cmcd = {
|
|
|
281
277
|
/**
|
|
282
278
|
* CMCD event mode variable name.
|
|
283
279
|
*
|
|
284
|
-
*
|
|
285
|
-
* @beta
|
|
280
|
+
* @public
|
|
286
281
|
*/
|
|
287
282
|
declare const CMCD_EVENT_MODE = "event";
|
|
288
283
|
//#endregion
|
|
@@ -290,20 +285,10 @@ declare const CMCD_EVENT_MODE = "event";
|
|
|
290
285
|
/**
|
|
291
286
|
* CMCD request mode variable name.
|
|
292
287
|
*
|
|
293
|
-
*
|
|
294
|
-
* @beta
|
|
288
|
+
* @public
|
|
295
289
|
*/
|
|
296
290
|
declare const CMCD_REQUEST_MODE = "request";
|
|
297
291
|
//#endregion
|
|
298
|
-
//#region src/CMCD_RESPONSE_MODE.d.ts
|
|
299
|
-
/**
|
|
300
|
-
* CMCD response mode variable name.
|
|
301
|
-
*
|
|
302
|
-
*
|
|
303
|
-
* @beta
|
|
304
|
-
*/
|
|
305
|
-
declare const CMCD_RESPONSE_MODE = "response";
|
|
306
|
-
//#endregion
|
|
307
292
|
//#region src/CmcdReportingMode.d.ts
|
|
308
293
|
/**
|
|
309
294
|
* CMCD reporting mode types.
|
|
@@ -311,7 +296,7 @@ declare const CMCD_RESPONSE_MODE = "response";
|
|
|
311
296
|
*
|
|
312
297
|
* @enum
|
|
313
298
|
*
|
|
314
|
-
* @
|
|
299
|
+
* @public
|
|
315
300
|
*/
|
|
316
301
|
declare const CmcdReportingMode: {
|
|
317
302
|
/**
|
|
@@ -319,16 +304,12 @@ declare const CmcdReportingMode: {
|
|
|
319
304
|
*/
|
|
320
305
|
readonly REQUEST: typeof CMCD_REQUEST_MODE;
|
|
321
306
|
/**
|
|
322
|
-
* Response mode
|
|
323
|
-
*/
|
|
324
|
-
readonly RESPONSE: typeof CMCD_RESPONSE_MODE;
|
|
325
|
-
/**
|
|
326
307
|
* Event mode
|
|
327
308
|
*/
|
|
328
309
|
readonly EVENT: typeof CMCD_EVENT_MODE;
|
|
329
310
|
};
|
|
330
311
|
/**
|
|
331
|
-
* @
|
|
312
|
+
* @public
|
|
332
313
|
*/
|
|
333
314
|
type CmcdReportingMode = ValueOf<typeof CmcdReportingMode>;
|
|
334
315
|
//#endregion
|
|
@@ -336,8 +317,7 @@ type CmcdReportingMode = ValueOf<typeof CmcdReportingMode>;
|
|
|
336
317
|
/**
|
|
337
318
|
* Options for formatting CMCD data values.
|
|
338
319
|
*
|
|
339
|
-
*
|
|
340
|
-
* @beta
|
|
320
|
+
* @public
|
|
341
321
|
*/
|
|
342
322
|
type CmcdFormatterOptions = {
|
|
343
323
|
/**
|
|
@@ -362,8 +342,7 @@ type CmcdFormatterOptions = {
|
|
|
362
342
|
*
|
|
363
343
|
* @returns The formatted value.
|
|
364
344
|
*
|
|
365
|
-
*
|
|
366
|
-
* @beta
|
|
345
|
+
* @public
|
|
367
346
|
*/
|
|
368
347
|
type CmcdFormatter = (value: CmcdValue, options: CmcdFormatterOptions) => number | ValueOrArray<string> | ValueOrArray<SfItem>;
|
|
369
348
|
//#endregion
|
|
@@ -371,10 +350,9 @@ type CmcdFormatter = (value: CmcdValue, options: CmcdFormatterOptions) => number
|
|
|
371
350
|
/**
|
|
372
351
|
* Keys that are excluded from CMCD event mode.
|
|
373
352
|
*
|
|
374
|
-
*
|
|
375
|
-
* @beta
|
|
353
|
+
* @public
|
|
376
354
|
*/
|
|
377
|
-
type CmcdEventExcludedKeys = "
|
|
355
|
+
type CmcdEventExcludedKeys = "bsd" | "d" | "dl" | "nor" | "ot" | "rtp" | "sid" | "su";
|
|
378
356
|
//#endregion
|
|
379
357
|
//#region src/CmcdEventType.d.ts
|
|
380
358
|
/**
|
|
@@ -383,7 +361,7 @@ type CmcdEventExcludedKeys = "bs" | "bsd" | "cmsdd" | "cmsds" | "d" | "dl" | "no
|
|
|
383
361
|
*
|
|
384
362
|
* @enum
|
|
385
363
|
*
|
|
386
|
-
* @
|
|
364
|
+
* @public
|
|
387
365
|
*/
|
|
388
366
|
declare const CmcdEventType: {
|
|
389
367
|
/**
|
|
@@ -422,9 +400,13 @@ declare const CmcdEventType: {
|
|
|
422
400
|
* The player view was collapsed.
|
|
423
401
|
*/
|
|
424
402
|
readonly PLAYER_COLLAPSE: "pc";
|
|
403
|
+
/**
|
|
404
|
+
* The receipt of a response.
|
|
405
|
+
*/
|
|
406
|
+
readonly RESPONSE_RECEIVED: "rr";
|
|
425
407
|
};
|
|
426
408
|
/**
|
|
427
|
-
* @
|
|
409
|
+
* @public
|
|
428
410
|
*/
|
|
429
411
|
type CmcdEventType = ValueOf<typeof CmcdEventType>;
|
|
430
412
|
//#endregion
|
|
@@ -435,7 +417,7 @@ type CmcdEventType = ValueOf<typeof CmcdEventType>;
|
|
|
435
417
|
*
|
|
436
418
|
* @enum
|
|
437
419
|
*
|
|
438
|
-
* @
|
|
420
|
+
* @public
|
|
439
421
|
*/
|
|
440
422
|
declare const CmcdPlayerState: {
|
|
441
423
|
/**
|
|
@@ -480,7 +462,7 @@ declare const CmcdPlayerState: {
|
|
|
480
462
|
readonly PRELOADING: "d";
|
|
481
463
|
};
|
|
482
464
|
/**
|
|
483
|
-
* @
|
|
465
|
+
* @public
|
|
484
466
|
*/
|
|
485
467
|
type CmcdPlayerState = ValueOf<typeof CmcdPlayerState>;
|
|
486
468
|
//#endregion
|
|
@@ -488,8 +470,7 @@ type CmcdPlayerState = ValueOf<typeof CmcdPlayerState>;
|
|
|
488
470
|
/**
|
|
489
471
|
* Common Media Client Data (CMCD) is a standardized set of HTTP request header fields and query string parameters.
|
|
490
472
|
*
|
|
491
|
-
*
|
|
492
|
-
* @beta
|
|
473
|
+
* @public
|
|
493
474
|
*/
|
|
494
475
|
type CmcdRequest = Omit<Cmcd, "nrr"> & {
|
|
495
476
|
/**
|
|
@@ -715,8 +696,7 @@ type CmcdRequest = Omit<Cmcd, "nrr"> & {
|
|
|
715
696
|
* Common Media Client Data (CMCD) version 2 specification. It encapsulates
|
|
716
697
|
* the reporting event token.
|
|
717
698
|
*
|
|
718
|
-
*
|
|
719
|
-
* @beta
|
|
699
|
+
* @public
|
|
720
700
|
*/
|
|
721
701
|
type CmcdEvent = Omit<CmcdRequest, CmcdEventExcludedKeys> & {
|
|
722
702
|
/**
|
|
@@ -758,8 +738,7 @@ type CmcdEvent = Omit<CmcdRequest, CmcdEventExcludedKeys> & {
|
|
|
758
738
|
*
|
|
759
739
|
* Defines the keys for the CMCD (Common Media Client Data) v2 Response group.
|
|
760
740
|
*
|
|
761
|
-
*
|
|
762
|
-
* @beta
|
|
741
|
+
* @public
|
|
763
742
|
*/
|
|
764
743
|
type CmcdResponse = CmcdRequest & {
|
|
765
744
|
/**
|
|
@@ -840,8 +819,7 @@ type CmcdResponse = CmcdRequest & {
|
|
|
840
819
|
/**
|
|
841
820
|
* All CMCD data types combined.
|
|
842
821
|
*
|
|
843
|
-
*
|
|
844
|
-
* @beta
|
|
822
|
+
* @public
|
|
845
823
|
*/
|
|
846
824
|
type CmcdData = Cmcd & CmcdRequest & CmcdEvent & CmcdResponse;
|
|
847
825
|
//#endregion
|
|
@@ -849,8 +827,7 @@ type CmcdData = Cmcd & CmcdRequest & CmcdEvent & CmcdResponse;
|
|
|
849
827
|
/**
|
|
850
828
|
* A CMCD key.
|
|
851
829
|
*
|
|
852
|
-
*
|
|
853
|
-
* @beta
|
|
830
|
+
* @public
|
|
854
831
|
*/
|
|
855
832
|
type CmcdKey = keyof CmcdData;
|
|
856
833
|
//#endregion
|
|
@@ -858,8 +835,7 @@ type CmcdKey = keyof CmcdData;
|
|
|
858
835
|
/**
|
|
859
836
|
* A map of CMCD keys to format functions.
|
|
860
837
|
*
|
|
861
|
-
*
|
|
862
|
-
* @beta
|
|
838
|
+
* @public
|
|
863
839
|
*/
|
|
864
840
|
type CmcdFormatterMap = Record<CmcdKey, CmcdFormatter>;
|
|
865
841
|
//#endregion
|
|
@@ -867,8 +843,7 @@ type CmcdFormatterMap = Record<CmcdKey, CmcdFormatter>;
|
|
|
867
843
|
/**
|
|
868
844
|
* CMCD object header name.
|
|
869
845
|
*
|
|
870
|
-
*
|
|
871
|
-
* @beta
|
|
846
|
+
* @public
|
|
872
847
|
*/
|
|
873
848
|
declare const CMCD_OBJECT = "CMCD-Object";
|
|
874
849
|
//#endregion
|
|
@@ -876,8 +851,7 @@ declare const CMCD_OBJECT = "CMCD-Object";
|
|
|
876
851
|
/**
|
|
877
852
|
* CMCD request header name.
|
|
878
853
|
*
|
|
879
|
-
*
|
|
880
|
-
* @beta
|
|
854
|
+
* @public
|
|
881
855
|
*/
|
|
882
856
|
declare const CMCD_REQUEST = "CMCD-Request";
|
|
883
857
|
//#endregion
|
|
@@ -885,8 +859,7 @@ declare const CMCD_REQUEST = "CMCD-Request";
|
|
|
885
859
|
/**
|
|
886
860
|
* CMCD session header name.
|
|
887
861
|
*
|
|
888
|
-
*
|
|
889
|
-
* @beta
|
|
862
|
+
* @public
|
|
890
863
|
*/
|
|
891
864
|
declare const CMCD_SESSION = "CMCD-Session";
|
|
892
865
|
//#endregion
|
|
@@ -894,8 +867,7 @@ declare const CMCD_SESSION = "CMCD-Session";
|
|
|
894
867
|
/**
|
|
895
868
|
* CMCD status header name.
|
|
896
869
|
*
|
|
897
|
-
*
|
|
898
|
-
* @beta
|
|
870
|
+
* @public
|
|
899
871
|
*/
|
|
900
872
|
declare const CMCD_STATUS = "CMCD-Status";
|
|
901
873
|
//#endregion
|
|
@@ -906,7 +878,7 @@ declare const CMCD_STATUS = "CMCD-Status";
|
|
|
906
878
|
*
|
|
907
879
|
* @enum
|
|
908
880
|
*
|
|
909
|
-
* @
|
|
881
|
+
* @public
|
|
910
882
|
*/
|
|
911
883
|
declare const CmcdHeaderField: {
|
|
912
884
|
/**
|
|
@@ -927,7 +899,7 @@ declare const CmcdHeaderField: {
|
|
|
927
899
|
readonly STATUS: typeof CMCD_STATUS;
|
|
928
900
|
};
|
|
929
901
|
/**
|
|
930
|
-
* @
|
|
902
|
+
* @public
|
|
931
903
|
*/
|
|
932
904
|
type CmcdHeaderField = ValueOf<typeof CmcdHeaderField>;
|
|
933
905
|
//#endregion
|
|
@@ -935,8 +907,7 @@ type CmcdHeaderField = ValueOf<typeof CmcdHeaderField>;
|
|
|
935
907
|
/**
|
|
936
908
|
* A map of CMCD header fields to CMCD keys.
|
|
937
909
|
*
|
|
938
|
-
*
|
|
939
|
-
* @beta
|
|
910
|
+
* @public
|
|
940
911
|
*/
|
|
941
912
|
type CmcdHeaderMap = Record<CmcdHeaderField, CmcdKey[]>;
|
|
942
913
|
//#endregion
|
|
@@ -944,8 +915,7 @@ type CmcdHeaderMap = Record<CmcdHeaderField, CmcdKey[]>;
|
|
|
944
915
|
/**
|
|
945
916
|
* Options for encoding CMCD values.
|
|
946
917
|
*
|
|
947
|
-
*
|
|
948
|
-
* @beta
|
|
918
|
+
* @public
|
|
949
919
|
*/
|
|
950
920
|
type CmcdEncodeOptions = {
|
|
951
921
|
/**
|
|
@@ -980,6 +950,10 @@ type CmcdEncodeOptions = {
|
|
|
980
950
|
* The base URL to use for relative URLs.
|
|
981
951
|
*/
|
|
982
952
|
baseUrl?: string;
|
|
953
|
+
/**
|
|
954
|
+
* Array of event names to filter.
|
|
955
|
+
*/
|
|
956
|
+
events?: string[];
|
|
983
957
|
};
|
|
984
958
|
//#endregion
|
|
985
959
|
//#region src/appendCmcdHeaders.d.ts
|
|
@@ -992,8 +966,7 @@ type CmcdEncodeOptions = {
|
|
|
992
966
|
*
|
|
993
967
|
* @returns The headers with the CMCD header shards appended.
|
|
994
968
|
*
|
|
995
|
-
*
|
|
996
|
-
* @beta
|
|
969
|
+
* @public
|
|
997
970
|
*
|
|
998
971
|
* @example
|
|
999
972
|
* {@includeCode ../test/appendCmcdHeaders.test.ts#example}
|
|
@@ -1010,8 +983,7 @@ declare function appendCmcdHeaders(headers: Record<string, string>, cmcd: Cmcd,
|
|
|
1010
983
|
*
|
|
1011
984
|
* @returns The URL with the CMCD query args appended.
|
|
1012
985
|
*
|
|
1013
|
-
*
|
|
1014
|
-
* @beta
|
|
986
|
+
* @public
|
|
1015
987
|
*
|
|
1016
988
|
* @example
|
|
1017
989
|
* {@includeCode ../test/appendCmcdQuery.test.ts#example}
|
|
@@ -1022,8 +994,7 @@ declare function appendCmcdQuery(url: string, cmcd: Cmcd, options?: CmcdEncodeOp
|
|
|
1022
994
|
/**
|
|
1023
995
|
* Defines the common keys for CMCD (Common Media Client Data) version 2.
|
|
1024
996
|
*
|
|
1025
|
-
*
|
|
1026
|
-
* @beta
|
|
997
|
+
* @public
|
|
1027
998
|
*/
|
|
1028
999
|
declare const CMCD_COMMON_KEYS: readonly ["ab", "bg", "bl", "br", "bs", "bsd", "cdn", "cid", "cs", "df", "ec", "lab", "lb", "ltc", "msd", "mtp", "pb", "pr", "pt", "sf", "sid", "sn", "st", "sta", "tab", "tb", "tbl", "tpb", "ts", "v"];
|
|
1029
1000
|
//#endregion
|
|
@@ -1031,8 +1002,7 @@ declare const CMCD_COMMON_KEYS: readonly ["ab", "bg", "bl", "br", "bs", "bsd", "
|
|
|
1031
1002
|
/**
|
|
1032
1003
|
* The default time interval in secondswhen using using event mode
|
|
1033
1004
|
*
|
|
1034
|
-
*
|
|
1035
|
-
* @beta
|
|
1005
|
+
* @public
|
|
1036
1006
|
*/
|
|
1037
1007
|
declare const CMCD_DEFAULT_TIME_INTERVAL = 30;
|
|
1038
1008
|
//#endregion
|
|
@@ -1040,8 +1010,7 @@ declare const CMCD_DEFAULT_TIME_INTERVAL = 30;
|
|
|
1040
1010
|
/**
|
|
1041
1011
|
* Defines the event-specific keys for CMCD (Common Media Client Data) version 2.
|
|
1042
1012
|
*
|
|
1043
|
-
*
|
|
1044
|
-
* @beta
|
|
1013
|
+
* @public
|
|
1045
1014
|
*/
|
|
1046
1015
|
declare const CMCD_EVENT_KEYS: readonly ["e"];
|
|
1047
1016
|
//#endregion
|
|
@@ -1049,8 +1018,7 @@ declare const CMCD_EVENT_KEYS: readonly ["e"];
|
|
|
1049
1018
|
/**
|
|
1050
1019
|
* The default formatters for CMCD values.
|
|
1051
1020
|
*
|
|
1052
|
-
*
|
|
1053
|
-
* @beta
|
|
1021
|
+
* @public
|
|
1054
1022
|
*/
|
|
1055
1023
|
declare const CMCD_FORMATTER_MAP: Record<string, CmcdFormatter>;
|
|
1056
1024
|
//#endregion
|
|
@@ -1058,8 +1026,7 @@ declare const CMCD_FORMATTER_MAP: Record<string, CmcdFormatter>;
|
|
|
1058
1026
|
/**
|
|
1059
1027
|
* CMCD `headers` transmission mode.
|
|
1060
1028
|
*
|
|
1061
|
-
*
|
|
1062
|
-
* @beta
|
|
1029
|
+
* @public
|
|
1063
1030
|
*/
|
|
1064
1031
|
declare const CMCD_HEADERS = "headers";
|
|
1065
1032
|
//#endregion
|
|
@@ -1067,8 +1034,7 @@ declare const CMCD_HEADERS = "headers";
|
|
|
1067
1034
|
/**
|
|
1068
1035
|
* CMCD `json` transmission mode.
|
|
1069
1036
|
*
|
|
1070
|
-
*
|
|
1071
|
-
* @beta
|
|
1037
|
+
* @public
|
|
1072
1038
|
*
|
|
1073
1039
|
* @deprecated JSON transmission mode is deprecated and will be removed in future versions.
|
|
1074
1040
|
*/
|
|
@@ -1078,8 +1044,7 @@ declare const CMCD_JSON = "json";
|
|
|
1078
1044
|
/**
|
|
1079
1045
|
* A list of all CMCD keys.
|
|
1080
1046
|
*
|
|
1081
|
-
*
|
|
1082
|
-
* @beta
|
|
1047
|
+
* @public
|
|
1083
1048
|
*/
|
|
1084
1049
|
declare const CMCD_KEYS: CmcdKey[];
|
|
1085
1050
|
//#endregion
|
|
@@ -1087,8 +1052,7 @@ declare const CMCD_KEYS: CmcdKey[];
|
|
|
1087
1052
|
/**
|
|
1088
1053
|
* CMCD parameter name.
|
|
1089
1054
|
*
|
|
1090
|
-
*
|
|
1091
|
-
* @beta
|
|
1055
|
+
* @public
|
|
1092
1056
|
*/
|
|
1093
1057
|
declare const CMCD_PARAM = "CMCD";
|
|
1094
1058
|
//#endregion
|
|
@@ -1096,8 +1060,7 @@ declare const CMCD_PARAM = "CMCD";
|
|
|
1096
1060
|
/**
|
|
1097
1061
|
* CMCD `query` transmission mode.
|
|
1098
1062
|
*
|
|
1099
|
-
*
|
|
1100
|
-
* @beta
|
|
1063
|
+
* @public
|
|
1101
1064
|
*/
|
|
1102
1065
|
declare const CMCD_QUERY = "query";
|
|
1103
1066
|
//#endregion
|
|
@@ -1105,8 +1068,7 @@ declare const CMCD_QUERY = "query";
|
|
|
1105
1068
|
/**
|
|
1106
1069
|
* Defines the request-specific keys for CMCD (Common Media Client Data) version 2.
|
|
1107
1070
|
*
|
|
1108
|
-
*
|
|
1109
|
-
* @beta
|
|
1071
|
+
* @public
|
|
1110
1072
|
*/
|
|
1111
1073
|
declare const CMCD_REQUEST_KEYS: readonly ["d", "dl", "nor", "ot", "rtp", "su"];
|
|
1112
1074
|
//#endregion
|
|
@@ -1114,17 +1076,23 @@ declare const CMCD_REQUEST_KEYS: readonly ["d", "dl", "nor", "ot", "rtp", "su"];
|
|
|
1114
1076
|
/**
|
|
1115
1077
|
* CMCD v2 - Response-only and timing keys.
|
|
1116
1078
|
*
|
|
1117
|
-
*
|
|
1118
|
-
* @beta
|
|
1079
|
+
* @public
|
|
1119
1080
|
*/
|
|
1120
1081
|
declare const CMCD_RESPONSE_KEYS: readonly ["cmsdd", "cmsds", "rc", "smrt", "ttfb", "ttfbb", "ttlb", "url"];
|
|
1121
1082
|
//#endregion
|
|
1083
|
+
//#region src/CMCD_RESPONSE_MODE.d.ts
|
|
1084
|
+
/**
|
|
1085
|
+
* CMCD response mode variable name.
|
|
1086
|
+
*
|
|
1087
|
+
* @public
|
|
1088
|
+
*/
|
|
1089
|
+
declare const CMCD_RESPONSE_MODE = "response";
|
|
1090
|
+
//#endregion
|
|
1122
1091
|
//#region src/CMCD_V1.d.ts
|
|
1123
1092
|
/**
|
|
1124
1093
|
* CMCD Version 1
|
|
1125
1094
|
*
|
|
1126
|
-
*
|
|
1127
|
-
* @beta
|
|
1095
|
+
* @public
|
|
1128
1096
|
*/
|
|
1129
1097
|
declare const CMCD_V1 = 1;
|
|
1130
1098
|
//#endregion
|
|
@@ -1132,8 +1100,7 @@ declare const CMCD_V1 = 1;
|
|
|
1132
1100
|
/**
|
|
1133
1101
|
* Defines the keys for CMCD (Common Media Client Data) version 1.
|
|
1134
1102
|
*
|
|
1135
|
-
*
|
|
1136
|
-
* @beta
|
|
1103
|
+
* @public
|
|
1137
1104
|
*/
|
|
1138
1105
|
declare const CMCD_V1_KEYS: readonly ["bl", "br", "bs", "cid", "d", "dl", "mtp", "nor", "nrr", "ot", "pr", "rtp", "sf", "sid", "st", "su", "tb", "v"];
|
|
1139
1106
|
//#endregion
|
|
@@ -1141,8 +1108,7 @@ declare const CMCD_V1_KEYS: readonly ["bl", "br", "bs", "cid", "d", "dl", "mtp",
|
|
|
1141
1108
|
/**
|
|
1142
1109
|
* CMCD Version 2
|
|
1143
1110
|
*
|
|
1144
|
-
*
|
|
1145
|
-
* @beta
|
|
1111
|
+
* @public
|
|
1146
1112
|
*/
|
|
1147
1113
|
declare const CMCD_V2 = 2;
|
|
1148
1114
|
//#endregion
|
|
@@ -1153,7 +1119,7 @@ declare const CMCD_V2 = 2;
|
|
|
1153
1119
|
*
|
|
1154
1120
|
* @enum
|
|
1155
1121
|
*
|
|
1156
|
-
* @
|
|
1122
|
+
* @public
|
|
1157
1123
|
*/
|
|
1158
1124
|
declare const CmcdTransmissionMode: {
|
|
1159
1125
|
/**
|
|
@@ -1172,7 +1138,7 @@ declare const CmcdTransmissionMode: {
|
|
|
1172
1138
|
readonly HEADERS: typeof CMCD_HEADERS;
|
|
1173
1139
|
};
|
|
1174
1140
|
/**
|
|
1175
|
-
* @
|
|
1141
|
+
* @public
|
|
1176
1142
|
*/
|
|
1177
1143
|
type CmcdTransmissionMode = ValueOf<typeof CmcdTransmissionMode>;
|
|
1178
1144
|
//#endregion
|
|
@@ -1183,7 +1149,7 @@ type CmcdTransmissionMode = ValueOf<typeof CmcdTransmissionMode>;
|
|
|
1183
1149
|
*
|
|
1184
1150
|
* @enum
|
|
1185
1151
|
*
|
|
1186
|
-
* @
|
|
1152
|
+
* @public
|
|
1187
1153
|
*
|
|
1188
1154
|
* @deprecated Use {@link CmcdTransmissionMode} instead.
|
|
1189
1155
|
*
|
|
@@ -1191,7 +1157,7 @@ type CmcdTransmissionMode = ValueOf<typeof CmcdTransmissionMode>;
|
|
|
1191
1157
|
*/
|
|
1192
1158
|
declare const CmcdEncoding: typeof CmcdTransmissionMode;
|
|
1193
1159
|
/**
|
|
1194
|
-
* @
|
|
1160
|
+
* @public
|
|
1195
1161
|
*/
|
|
1196
1162
|
type CmcdEncoding = ValueOf<typeof CmcdEncoding>;
|
|
1197
1163
|
//#endregion
|
|
@@ -1199,8 +1165,7 @@ type CmcdEncoding = ValueOf<typeof CmcdEncoding>;
|
|
|
1199
1165
|
/**
|
|
1200
1166
|
* The default formatters for CMCD values.
|
|
1201
1167
|
*
|
|
1202
|
-
*
|
|
1203
|
-
* @beta
|
|
1168
|
+
* @public
|
|
1204
1169
|
*
|
|
1205
1170
|
* @deprecated Use `CMCD_FORMATTER_MAP` instead.
|
|
1206
1171
|
*/
|
|
@@ -1210,8 +1175,7 @@ declare const CmcdFormatters: Record<string, CmcdFormatter>;
|
|
|
1210
1175
|
/**
|
|
1211
1176
|
* A map of CMCD header fields to CMCD keys.
|
|
1212
1177
|
*
|
|
1213
|
-
*
|
|
1214
|
-
* @beta
|
|
1178
|
+
* @public
|
|
1215
1179
|
*
|
|
1216
1180
|
* @deprecated Use `CmcdHeaderMap` instead.
|
|
1217
1181
|
*/
|
|
@@ -1221,8 +1185,7 @@ type CmcdHeadersMap = Record<CmcdHeaderField, CmcdKey[]>;
|
|
|
1221
1185
|
/**
|
|
1222
1186
|
* A CMCD report target configuration.
|
|
1223
1187
|
*
|
|
1224
|
-
*
|
|
1225
|
-
* @beta
|
|
1188
|
+
* @public
|
|
1226
1189
|
*/
|
|
1227
1190
|
type CmcdReportTarget = {
|
|
1228
1191
|
/**
|
|
@@ -1267,8 +1230,7 @@ type CmcdReportTarget = {
|
|
|
1267
1230
|
*
|
|
1268
1231
|
* @returns The decoded CMCD object.
|
|
1269
1232
|
*
|
|
1270
|
-
*
|
|
1271
|
-
* @beta
|
|
1233
|
+
* @public
|
|
1272
1234
|
*
|
|
1273
1235
|
* @example
|
|
1274
1236
|
* {@includeCode ../test/decodeCmcd.test.ts#example}
|
|
@@ -1284,8 +1246,7 @@ declare function decodeCmcd<T extends CmcdData = CmcdData>(cmcd: string): T;
|
|
|
1284
1246
|
*
|
|
1285
1247
|
* @returns The encoded CMCD string.
|
|
1286
1248
|
*
|
|
1287
|
-
*
|
|
1288
|
-
* @beta
|
|
1249
|
+
* @public
|
|
1289
1250
|
*
|
|
1290
1251
|
* @example
|
|
1291
1252
|
* {@includeCode ../test/encodeCmcd.test.ts#example}
|
|
@@ -1300,8 +1261,7 @@ declare function encodeCmcd(cmcd: CmcdData, options?: CmcdEncodeOptions): string
|
|
|
1300
1261
|
*
|
|
1301
1262
|
* @returns The decoded CMCD data.
|
|
1302
1263
|
*
|
|
1303
|
-
*
|
|
1304
|
-
* @beta
|
|
1264
|
+
* @public
|
|
1305
1265
|
*
|
|
1306
1266
|
* @example
|
|
1307
1267
|
* {@includeCode ../test/fromCmcdHeaders.test.ts#example}
|
|
@@ -1316,8 +1276,7 @@ declare function fromCmcdHeaders(headers: Record<string, string> | Headers): Cmc
|
|
|
1316
1276
|
*
|
|
1317
1277
|
* @returns The decoded CMCD data.
|
|
1318
1278
|
*
|
|
1319
|
-
*
|
|
1320
|
-
* @beta
|
|
1279
|
+
* @public
|
|
1321
1280
|
*
|
|
1322
1281
|
* @example
|
|
1323
1282
|
* {@includeCode ../test/fromCmcdQuery.test.ts#example}
|
|
@@ -1332,8 +1291,7 @@ declare function fromCmcdQuery(query: string | URLSearchParams): Cmcd;
|
|
|
1332
1291
|
*
|
|
1333
1292
|
* @returns The decoded CMCD data.
|
|
1334
1293
|
*
|
|
1335
|
-
*
|
|
1336
|
-
* @beta
|
|
1294
|
+
* @public
|
|
1337
1295
|
*
|
|
1338
1296
|
* @example
|
|
1339
1297
|
* {@includeCode ../test/fromCmcdUrl.test.ts#example}
|
|
@@ -1349,8 +1307,7 @@ declare function fromCmcdUrl(url: string): Cmcd;
|
|
|
1349
1307
|
*
|
|
1350
1308
|
* @returns The CMCD header shards.
|
|
1351
1309
|
*
|
|
1352
|
-
*
|
|
1353
|
-
* @beta
|
|
1310
|
+
* @public
|
|
1354
1311
|
*/
|
|
1355
1312
|
declare function groupCmcdHeaders(cmcd: CmcdData, customHeaderMap?: Partial<CmcdHeaderMap>): Record<CmcdHeaderField, CmcdData>;
|
|
1356
1313
|
//#endregion
|
|
@@ -1362,8 +1319,7 @@ declare function groupCmcdHeaders(cmcd: CmcdData, customHeaderMap?: Partial<Cmcd
|
|
|
1362
1319
|
*
|
|
1363
1320
|
* @returns `true` if the key is a custom key, `false` otherwise.
|
|
1364
1321
|
*
|
|
1365
|
-
*
|
|
1366
|
-
* @beta
|
|
1322
|
+
* @public
|
|
1367
1323
|
*/
|
|
1368
1324
|
declare function isCmcdCustomKey(key: CmcdKey): boolean;
|
|
1369
1325
|
//#endregion
|
|
@@ -1375,8 +1331,7 @@ declare function isCmcdCustomKey(key: CmcdKey): boolean;
|
|
|
1375
1331
|
*
|
|
1376
1332
|
* @returns `true` if the key is a valid CMCD event key, `false` otherwise.
|
|
1377
1333
|
*
|
|
1378
|
-
*
|
|
1379
|
-
* @beta
|
|
1334
|
+
* @public
|
|
1380
1335
|
*
|
|
1381
1336
|
* @example
|
|
1382
1337
|
* {@includeCode ../test/isCmcdEventKey.test.ts#example}
|
|
@@ -1391,15 +1346,14 @@ declare function isCmcdEventKey(key: string): key is keyof CmcdEvent;
|
|
|
1391
1346
|
*
|
|
1392
1347
|
* @returns `true` if the key is a valid CMCD request key, `false` otherwise.
|
|
1393
1348
|
*
|
|
1394
|
-
*
|
|
1395
|
-
* @beta
|
|
1349
|
+
* @public
|
|
1396
1350
|
*
|
|
1397
1351
|
* @example
|
|
1398
1352
|
* {@includeCode ../test/isCmcdRequestKey.test.ts#example}
|
|
1399
1353
|
*/
|
|
1400
1354
|
declare function isCmcdRequestKey(key: string): key is keyof CmcdRequest;
|
|
1401
1355
|
//#endregion
|
|
1402
|
-
//#region src/
|
|
1356
|
+
//#region src/isCmcdResponseReceivedKey.d.ts
|
|
1403
1357
|
/**
|
|
1404
1358
|
* Check if a key is a valid CMCD response key.
|
|
1405
1359
|
*
|
|
@@ -1407,13 +1361,14 @@ declare function isCmcdRequestKey(key: string): key is keyof CmcdRequest;
|
|
|
1407
1361
|
*
|
|
1408
1362
|
* @returns `true` if the key is a valid CMCD request key, `false` otherwise.
|
|
1409
1363
|
*
|
|
1364
|
+
* @group CMCD
|
|
1410
1365
|
*
|
|
1411
|
-
* @
|
|
1366
|
+
* @public
|
|
1412
1367
|
*
|
|
1413
1368
|
* @example
|
|
1414
|
-
* {@includeCode
|
|
1369
|
+
* {@includeCode ../../test/cmcd/isCmcdResponseReceivedKey.test.ts#example}
|
|
1415
1370
|
*/
|
|
1416
|
-
declare function
|
|
1371
|
+
declare function isCmcdResponseReceivedKey(key: string): key is keyof CmcdResponse;
|
|
1417
1372
|
//#endregion
|
|
1418
1373
|
//#region src/isCmcdV1Key.d.ts
|
|
1419
1374
|
/**
|
|
@@ -1423,8 +1378,7 @@ declare function isCmcdResponseKey(key: string): key is keyof CmcdResponse;
|
|
|
1423
1378
|
*
|
|
1424
1379
|
* @returns `true` if the key should be included, `false` otherwise.
|
|
1425
1380
|
*
|
|
1426
|
-
*
|
|
1427
|
-
* @beta
|
|
1381
|
+
* @public
|
|
1428
1382
|
*
|
|
1429
1383
|
* @example
|
|
1430
1384
|
* {@includeCode ../test/isCmcdV1Key.test.ts#example}
|
|
@@ -1438,8 +1392,7 @@ declare function isCmcdV1Key(key: string): key is keyof Cmcd;
|
|
|
1438
1392
|
* @param obj - The CMCD object to process.
|
|
1439
1393
|
* @param options - Options for encoding.
|
|
1440
1394
|
*
|
|
1441
|
-
*
|
|
1442
|
-
* @beta
|
|
1395
|
+
* @public
|
|
1443
1396
|
*/
|
|
1444
1397
|
declare function prepareCmcdData(obj: Record<string, any>, options?: CmcdEncodeOptions): CmcdData;
|
|
1445
1398
|
//#endregion
|
|
@@ -1452,8 +1405,7 @@ declare function prepareCmcdData(obj: Record<string, any>, options?: CmcdEncodeO
|
|
|
1452
1405
|
*
|
|
1453
1406
|
* @returns The CMCD header shards.
|
|
1454
1407
|
*
|
|
1455
|
-
*
|
|
1456
|
-
* @beta
|
|
1408
|
+
* @public
|
|
1457
1409
|
*
|
|
1458
1410
|
* @example
|
|
1459
1411
|
* {@includeCode ../test/toCmcdHeaders.test.ts#example}
|
|
@@ -1469,8 +1421,7 @@ declare function toCmcdHeaders(cmcd: CmcdData, options?: CmcdEncodeOptions): Rec
|
|
|
1469
1421
|
*
|
|
1470
1422
|
* @returns The CMCD JSON.
|
|
1471
1423
|
*
|
|
1472
|
-
*
|
|
1473
|
-
* @beta
|
|
1424
|
+
* @public
|
|
1474
1425
|
*
|
|
1475
1426
|
* @deprecated Sending CMCD as JSON objects is deprecated. Use `toCmcdUrl` to create an array of url strings instead.
|
|
1476
1427
|
*/
|
|
@@ -1485,8 +1436,7 @@ declare function toCmcdJson(cmcd: Cmcd, options?: CmcdEncodeOptions): string;
|
|
|
1485
1436
|
*
|
|
1486
1437
|
* @returns The CMCD query arg.
|
|
1487
1438
|
*
|
|
1488
|
-
*
|
|
1489
|
-
* @beta
|
|
1439
|
+
* @public
|
|
1490
1440
|
*
|
|
1491
1441
|
* @example
|
|
1492
1442
|
* {@includeCode ../test/toCmcdQuery.test.ts#example}
|
|
@@ -1502,8 +1452,7 @@ declare function toCmcdQuery(cmcd: Cmcd, options?: CmcdEncodeOptions): string;
|
|
|
1502
1452
|
*
|
|
1503
1453
|
* @return A CMCD report object
|
|
1504
1454
|
*
|
|
1505
|
-
*
|
|
1506
|
-
* @beta
|
|
1455
|
+
* @public
|
|
1507
1456
|
*
|
|
1508
1457
|
* @example
|
|
1509
1458
|
* {@includeCode ../test/toCmcdReport.test.ts#example}
|
|
@@ -1521,10 +1470,9 @@ declare function toCmcdReport(data: CmcdData, target: CmcdReportTarget): Request
|
|
|
1521
1470
|
*
|
|
1522
1471
|
* @returns The URL encoded CMCD data.
|
|
1523
1472
|
*
|
|
1524
|
-
*
|
|
1525
|
-
* @beta
|
|
1473
|
+
* @public
|
|
1526
1474
|
*/
|
|
1527
1475
|
declare function toCmcdUrl(cmcd: Cmcd, options?: CmcdEncodeOptions): string;
|
|
1528
1476
|
//#endregion
|
|
1529
|
-
export { CMCD_COMMON_KEYS, CMCD_DEFAULT_TIME_INTERVAL, CMCD_EVENT_KEYS, CMCD_EVENT_MODE, CMCD_FORMATTER_MAP, CMCD_HEADERS, CMCD_JSON, CMCD_KEYS, CMCD_OBJECT, CMCD_PARAM, CMCD_QUERY, CMCD_REQUEST, CMCD_REQUEST_KEYS, CMCD_REQUEST_MODE, CMCD_RESPONSE_KEYS, CMCD_RESPONSE_MODE, CMCD_SESSION, CMCD_STATUS, CMCD_V1, CMCD_V1_KEYS, CMCD_V2, Cmcd, CmcdCustomKey, CmcdData, CmcdEncodeOptions, CmcdEncoding, CmcdEvent, CmcdEventExcludedKeys, CmcdEventType, CmcdFormatter, CmcdFormatterMap, CmcdFormatterOptions, CmcdFormatters, CmcdHeaderField, CmcdHeaderMap, CmcdHeadersMap, CmcdKey, CmcdObjectType, CmcdPlayerState, CmcdReportTarget, CmcdReportingMode, CmcdRequest, CmcdResponse, CmcdStreamType, CmcdStreamingFormat, CmcdTransmissionMode, CmcdValue, appendCmcdHeaders, appendCmcdQuery, decodeCmcd, encodeCmcd, fromCmcdHeaders, fromCmcdQuery, fromCmcdUrl, groupCmcdHeaders, isCmcdCustomKey, isCmcdEventKey, isCmcdRequestKey,
|
|
1477
|
+
export { CMCD_COMMON_KEYS, CMCD_DEFAULT_TIME_INTERVAL, CMCD_EVENT_KEYS, CMCD_EVENT_MODE, CMCD_FORMATTER_MAP, CMCD_HEADERS, CMCD_JSON, CMCD_KEYS, CMCD_OBJECT, CMCD_PARAM, CMCD_QUERY, CMCD_REQUEST, CMCD_REQUEST_KEYS, CMCD_REQUEST_MODE, CMCD_RESPONSE_KEYS, CMCD_RESPONSE_MODE, CMCD_SESSION, CMCD_STATUS, CMCD_V1, CMCD_V1_KEYS, CMCD_V2, Cmcd, CmcdCustomKey, CmcdData, CmcdEncodeOptions, CmcdEncoding, CmcdEvent, CmcdEventExcludedKeys, CmcdEventType, CmcdFormatter, CmcdFormatterMap, CmcdFormatterOptions, CmcdFormatters, CmcdHeaderField, CmcdHeaderMap, CmcdHeadersMap, CmcdKey, CmcdObjectType, CmcdPlayerState, CmcdReportTarget, CmcdReportingMode, CmcdRequest, CmcdResponse, CmcdStreamType, CmcdStreamingFormat, CmcdTransmissionMode, CmcdValue, appendCmcdHeaders, appendCmcdQuery, decodeCmcd, encodeCmcd, fromCmcdHeaders, fromCmcdQuery, fromCmcdUrl, groupCmcdHeaders, isCmcdCustomKey, isCmcdEventKey, isCmcdRequestKey, isCmcdResponseReceivedKey, isCmcdV1Key, prepareCmcdData, toCmcdHeaders, toCmcdJson, toCmcdQuery, toCmcdReport, toCmcdUrl };
|
|
1530
1478
|
//# sourceMappingURL=index.d.ts.map
|