@svta/cml-cmcd 2.1.2 → 2.3.0
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 +574 -25
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1066 -134
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -4,11 +4,11 @@ import { ExclusiveRecord, HttpRequest, HttpResponse, ValueOf, ValueOrArray } fro
|
|
|
4
4
|
//#region src/CmcdEventType.d.ts
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* CMCD event type for the '
|
|
7
|
+
* CMCD event type for the 'bc' key (bitrate change).
|
|
8
8
|
*
|
|
9
9
|
* @public
|
|
10
10
|
*/
|
|
11
|
-
declare const CMCD_EVENT_BITRATE_CHANGE: "
|
|
11
|
+
declare const CMCD_EVENT_BITRATE_CHANGE: "bc";
|
|
12
12
|
/**
|
|
13
13
|
* CMCD event type for the 'ps' key (play state change).
|
|
14
14
|
*
|
|
@@ -108,9 +108,10 @@ declare const CMCD_EVENT_CUSTOM_EVENT: "ce";
|
|
|
108
108
|
/**
|
|
109
109
|
* CMCD event types for the 'e' key (event mode).
|
|
110
110
|
*
|
|
111
|
-
*
|
|
112
111
|
* @enum
|
|
113
112
|
*
|
|
113
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#event | CTA-5004-A Event}
|
|
114
|
+
*
|
|
114
115
|
* @public
|
|
115
116
|
*/
|
|
116
117
|
declare const CmcdEventType: {
|
|
@@ -214,6 +215,8 @@ type CmcdCustomValue = string | SfItem<string> | (string | SfItem<string>)[] | n
|
|
|
214
215
|
* @public
|
|
215
216
|
*
|
|
216
217
|
* @enum
|
|
218
|
+
*
|
|
219
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#object-type | CTA-5004-A Object Type}
|
|
217
220
|
*/
|
|
218
221
|
declare const CmcdObjectType: {
|
|
219
222
|
/**
|
|
@@ -274,6 +277,8 @@ type CmcdObjectTypeList = (number | SfItem<number, ExclusiveRecord<CmcdObjectTyp
|
|
|
274
277
|
* @enum
|
|
275
278
|
*
|
|
276
279
|
* @public
|
|
280
|
+
*
|
|
281
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#state | CTA-5004-A State}
|
|
277
282
|
*/
|
|
278
283
|
declare const CmcdPlayerState: {
|
|
279
284
|
/**
|
|
@@ -328,6 +333,8 @@ type CmcdPlayerState = ValueOf<typeof CmcdPlayerState>;
|
|
|
328
333
|
*
|
|
329
334
|
* @enum
|
|
330
335
|
*
|
|
336
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#stream-type | CTA-5004-A Stream Type}
|
|
337
|
+
*
|
|
331
338
|
* @public
|
|
332
339
|
*/
|
|
333
340
|
declare const CmcdStreamType: {
|
|
@@ -353,9 +360,10 @@ type CmcdStreamType = ValueOf<typeof CmcdStreamType>;
|
|
|
353
360
|
/**
|
|
354
361
|
* Common Media Client Data Streaming Format
|
|
355
362
|
*
|
|
356
|
-
*
|
|
357
363
|
* @enum
|
|
358
364
|
*
|
|
365
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#streaming-format | CTA-5004-A Streaming Format}
|
|
366
|
+
*
|
|
359
367
|
* @public
|
|
360
368
|
*/
|
|
361
369
|
declare const CmcdStreamingFormat: {
|
|
@@ -388,7 +396,7 @@ type CmcdStreamingFormat = ValueOf<typeof CmcdStreamingFormat>;
|
|
|
388
396
|
* A standardized set of HTTP request header fields and query string parameters
|
|
389
397
|
* for communicating media playback metrics in request mode.
|
|
390
398
|
*
|
|
391
|
-
* @see {@link https://
|
|
399
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#request-mode | CTA-5004-A Request Mode}
|
|
392
400
|
*
|
|
393
401
|
* @public
|
|
394
402
|
*/
|
|
@@ -407,6 +415,8 @@ type CmcdRequest = {
|
|
|
407
415
|
* the encoded bitrate is known.
|
|
408
416
|
*
|
|
409
417
|
* Inner list of integer kbps with token identifiers
|
|
418
|
+
*
|
|
419
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#aggregate-encoded-bitrate | CTA-5004-A Aggregate Encoded Bitrate}
|
|
410
420
|
*/
|
|
411
421
|
ab?: CmcdObjectTypeList;
|
|
412
422
|
/**
|
|
@@ -416,6 +426,8 @@ type CmcdRequest = {
|
|
|
416
426
|
* be sent if it is TRUE. If the visibility state of the player is not known this key SHOULD NOT be reported.
|
|
417
427
|
*
|
|
418
428
|
* Boolean
|
|
429
|
+
*
|
|
430
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#backgrounded | CTA-5004-A Backgrounded}
|
|
419
431
|
*/
|
|
420
432
|
bg?: boolean;
|
|
421
433
|
/**
|
|
@@ -424,6 +436,8 @@ type CmcdRequest = {
|
|
|
424
436
|
* The buffer length associated with the media object being requested. This value SHOULD be rounded to the nearest 100 ms.
|
|
425
437
|
*
|
|
426
438
|
* Inner list of integer milliseconds with token identifiers
|
|
439
|
+
*
|
|
440
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#buffer-length | CTA-5004-A Buffer Length}
|
|
427
441
|
*/
|
|
428
442
|
bl?: CmcdObjectTypeList;
|
|
429
443
|
/**
|
|
@@ -435,6 +449,8 @@ type CmcdRequest = {
|
|
|
435
449
|
* If the playlist declares both peak and average bitrate values, the peak value MUST be transmitted.
|
|
436
450
|
*
|
|
437
451
|
* Inner list of integer kbps with token identifiers
|
|
452
|
+
*
|
|
453
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#encoded-bitrate | CTA-5004-A Encoded Bitrate}
|
|
438
454
|
*/
|
|
439
455
|
br?: CmcdObjectTypeList;
|
|
440
456
|
/**
|
|
@@ -445,6 +461,8 @@ type CmcdRequest = {
|
|
|
445
461
|
* new CDN, then this key might initially report buffering caused by the prior CDN. This key SHOULD NOT be reported if it is FALSE.
|
|
446
462
|
*
|
|
447
463
|
* Boolean
|
|
464
|
+
*
|
|
465
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#buffer-starvation | CTA-5004-A Buffer Starvation}
|
|
448
466
|
*/
|
|
449
467
|
bs?: boolean;
|
|
450
468
|
/**
|
|
@@ -454,6 +472,8 @@ type CmcdRequest = {
|
|
|
454
472
|
* to rebuffering. Token identifier MAY be omitted if the cause of the rebuffering is unknown.
|
|
455
473
|
*
|
|
456
474
|
* Inner list of integers with optional token identifiers
|
|
475
|
+
*
|
|
476
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#buffer-starvation-absolute | CTA-5004-A Buffer Starvation Absolute}
|
|
457
477
|
*/
|
|
458
478
|
bsa?: CmcdObjectTypeList;
|
|
459
479
|
/**
|
|
@@ -463,6 +483,8 @@ type CmcdRequest = {
|
|
|
463
483
|
* once per reporting mode and report destination. Token identifier MAY be omitted if the cause of the rebuffering is unknown.
|
|
464
484
|
*
|
|
465
485
|
* Inner list of integer milliseconds with optional token identifiers
|
|
486
|
+
*
|
|
487
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#buffer-starvation-duration | CTA-5004-A Buffer Starvation Duration}
|
|
466
488
|
*/
|
|
467
489
|
bsd?: CmcdObjectTypeList;
|
|
468
490
|
/**
|
|
@@ -472,6 +494,8 @@ type CmcdRequest = {
|
|
|
472
494
|
* rebuffering is unknown.
|
|
473
495
|
*
|
|
474
496
|
* Inner list of integer milliseconds with optional token identifiers
|
|
497
|
+
*
|
|
498
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#buffer-starvation-duration-absolute | CTA-5004-A Buffer Starvation Duration Absolute}
|
|
475
499
|
*/
|
|
476
500
|
bsda?: CmcdObjectTypeList;
|
|
477
501
|
/**
|
|
@@ -480,6 +504,8 @@ type CmcdRequest = {
|
|
|
480
504
|
* A string identifying the current delivery network from which the player is retrieving content. Maximum length is 128 characters.
|
|
481
505
|
*
|
|
482
506
|
* String
|
|
507
|
+
*
|
|
508
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#cdn-id | CTA-5004-A CDN ID}
|
|
483
509
|
*/
|
|
484
510
|
cdn?: string;
|
|
485
511
|
/**
|
|
@@ -489,6 +515,8 @@ type CmcdRequest = {
|
|
|
489
515
|
* sessions and devices and is defined and updated at the discretion of the service provider.
|
|
490
516
|
*
|
|
491
517
|
* String
|
|
518
|
+
*
|
|
519
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#content-id | CTA-5004-A Content ID}
|
|
492
520
|
*/
|
|
493
521
|
cid?: string;
|
|
494
522
|
/**
|
|
@@ -498,6 +526,8 @@ type CmcdRequest = {
|
|
|
498
526
|
* to the content. For example, this field may be used to transmit the C2PA signature associated with the content being viewed.
|
|
499
527
|
*
|
|
500
528
|
* String
|
|
529
|
+
*
|
|
530
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#content-signature | CTA-5004-A Content Signature}
|
|
501
531
|
*/
|
|
502
532
|
cs?: string;
|
|
503
533
|
/**
|
|
@@ -509,6 +539,8 @@ type CmcdRequest = {
|
|
|
509
539
|
* This value MUST NOT be sent for objects which do not have an object type of 'a', 'v', 'av', 'tt', 'c', or 'o'.
|
|
510
540
|
*
|
|
511
541
|
* Integer milliseconds
|
|
542
|
+
*
|
|
543
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#object-duration | CTA-5004-A Object Duration}
|
|
512
544
|
*/
|
|
513
545
|
d?: number;
|
|
514
546
|
/**
|
|
@@ -519,6 +551,8 @@ type CmcdRequest = {
|
|
|
519
551
|
* beneficial if accompanied by the playhead time 'pt' key to allow for correct interpretation.
|
|
520
552
|
*
|
|
521
553
|
* Integer
|
|
554
|
+
*
|
|
555
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#dropped-frames-absolute | CTA-5004-A Dropped Frames Absolute}
|
|
522
556
|
*/
|
|
523
557
|
dfa?: number;
|
|
524
558
|
/**
|
|
@@ -529,6 +563,8 @@ type CmcdRequest = {
|
|
|
529
563
|
* player's remaining buffer length.
|
|
530
564
|
*
|
|
531
565
|
* Integer milliseconds
|
|
566
|
+
*
|
|
567
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#deadline | CTA-5004-A Deadline}
|
|
532
568
|
*/
|
|
533
569
|
dl?: number;
|
|
534
570
|
/**
|
|
@@ -539,6 +575,8 @@ type CmcdRequest = {
|
|
|
539
575
|
* Even if only one error code is being specified, the list notation MUST still be used.
|
|
540
576
|
*
|
|
541
577
|
* Inner list of strings
|
|
578
|
+
*
|
|
579
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#player-error-code | CTA-5004-A Player Error Code}
|
|
542
580
|
*/
|
|
543
581
|
ec?: string[];
|
|
544
582
|
/**
|
|
@@ -550,6 +588,8 @@ type CmcdRequest = {
|
|
|
550
588
|
* sent if the lowest encoded bitrate is known.
|
|
551
589
|
*
|
|
552
590
|
* Inner list of integer kbps with token identifiers
|
|
591
|
+
*
|
|
592
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#lowest-aggregated-encoded-bitrate | CTA-5004-A Lowest Aggregated Encoded Bitrate}
|
|
553
593
|
*/
|
|
554
594
|
lab?: CmcdObjectTypeList;
|
|
555
595
|
/**
|
|
@@ -561,6 +601,8 @@ type CmcdRequest = {
|
|
|
561
601
|
* requests for audio objects MUST specify the lowest audio bitrate.
|
|
562
602
|
*
|
|
563
603
|
* Inner list of integer kbps with token identifiers
|
|
604
|
+
*
|
|
605
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#lowest-encoded-bitrate | CTA-5004-A Lowest Encoded Bitrate}
|
|
564
606
|
*/
|
|
565
607
|
lb?: CmcdObjectTypeList;
|
|
566
608
|
/**
|
|
@@ -570,6 +612,8 @@ type CmcdRequest = {
|
|
|
570
612
|
* accuracy of this estimate is dependent on synchronization between the packager and the player clocks.
|
|
571
613
|
*
|
|
572
614
|
* Integer milliseconds
|
|
615
|
+
*
|
|
616
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#live-stream-latency | CTA-5004-A Live Stream Latency}
|
|
573
617
|
*/
|
|
574
618
|
ltc?: number;
|
|
575
619
|
/**
|
|
@@ -582,6 +626,8 @@ type CmcdRequest = {
|
|
|
582
626
|
* This key MUST only be sent once per Session ID and MUST be sent for each reporting mode which is active within the player.
|
|
583
627
|
*
|
|
584
628
|
* Integer milliseconds
|
|
629
|
+
*
|
|
630
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#media-start-delay | CTA-5004-A Media Start Delay}
|
|
585
631
|
*/
|
|
586
632
|
msd?: number;
|
|
587
633
|
/**
|
|
@@ -597,6 +643,8 @@ type CmcdRequest = {
|
|
|
597
643
|
* since the prior interval report.
|
|
598
644
|
*
|
|
599
645
|
* Inner list of integer kbps with token identifiers
|
|
646
|
+
*
|
|
647
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#measured-throughput | CTA-5004-A Measured Throughput}
|
|
600
648
|
*/
|
|
601
649
|
mtp?: CmcdObjectTypeList;
|
|
602
650
|
/**
|
|
@@ -616,6 +664,8 @@ type CmcdRequest = {
|
|
|
616
664
|
* The player SHOULD NOT depend upon any pre-fetch action being taken - it is merely a request for such a pre-fetch to take place.
|
|
617
665
|
*
|
|
618
666
|
* Inner list of strings
|
|
667
|
+
*
|
|
668
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#next-object-request | CTA-5004-A Next Object Request}
|
|
619
669
|
*/
|
|
620
670
|
nor?: (string | SfItem<string, {
|
|
621
671
|
r: string;
|
|
@@ -626,6 +676,8 @@ type CmcdRequest = {
|
|
|
626
676
|
* True when the content being retrieved by a player is not rendered as audio or video. The key SHOULD only be sent when it is TRUE.
|
|
627
677
|
*
|
|
628
678
|
* Boolean
|
|
679
|
+
*
|
|
680
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#non-rendered | CTA-5004-A Non Rendered}
|
|
629
681
|
*/
|
|
630
682
|
nr?: boolean;
|
|
631
683
|
/**
|
|
@@ -647,6 +699,8 @@ type CmcdRequest = {
|
|
|
647
699
|
* This key is also used as a token parameter for other keys.
|
|
648
700
|
*
|
|
649
701
|
* Token
|
|
702
|
+
*
|
|
703
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#object-type | CTA-5004-A Object Type}
|
|
650
704
|
*/
|
|
651
705
|
ot?: CmcdObjectType;
|
|
652
706
|
/**
|
|
@@ -655,6 +709,8 @@ type CmcdRequest = {
|
|
|
655
709
|
* The encoded bitrate of the media object(s) being shown to the end user.
|
|
656
710
|
*
|
|
657
711
|
* Inner list of integer kbps with token identifiers
|
|
712
|
+
*
|
|
713
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#playhead-bitrate | CTA-5004-A Playhead Bitrate}
|
|
658
714
|
*/
|
|
659
715
|
pb?: CmcdObjectTypeList;
|
|
660
716
|
/**
|
|
@@ -663,6 +719,8 @@ type CmcdRequest = {
|
|
|
663
719
|
* 1.0 if real-time, 2.0 if double speed, 0 if not playing. SHOULD only be sent if not equal to 1.0.
|
|
664
720
|
*
|
|
665
721
|
* Decimal
|
|
722
|
+
*
|
|
723
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#playback-rate | CTA-5004-A Playback Rate}
|
|
666
724
|
*/
|
|
667
725
|
pr?: number;
|
|
668
726
|
/**
|
|
@@ -671,6 +729,8 @@ type CmcdRequest = {
|
|
|
671
729
|
* The playhead time, expressed in milliseconds, which is being rendered to the viewer when the report is made.
|
|
672
730
|
*
|
|
673
731
|
* Integer milliseconds
|
|
732
|
+
*
|
|
733
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#playhead-time | CTA-5004-A Playhead Time}
|
|
674
734
|
*/
|
|
675
735
|
pt?: number;
|
|
676
736
|
/**
|
|
@@ -680,6 +740,8 @@ type CmcdRequest = {
|
|
|
680
740
|
* nearest 100kbps.
|
|
681
741
|
*
|
|
682
742
|
* Integer kbps
|
|
743
|
+
*
|
|
744
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#requested-maximum-throughput | CTA-5004-A Requested Maximum Throughput}
|
|
683
745
|
*/
|
|
684
746
|
rtp?: number;
|
|
685
747
|
/**
|
|
@@ -694,6 +756,8 @@ type CmcdRequest = {
|
|
|
694
756
|
* - `o` = other
|
|
695
757
|
*
|
|
696
758
|
* Token
|
|
759
|
+
*
|
|
760
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#streaming-format | CTA-5004-A Streaming Format}
|
|
697
761
|
*/
|
|
698
762
|
sf?: CmcdStreamingFormat;
|
|
699
763
|
/**
|
|
@@ -705,6 +769,8 @@ type CmcdRequest = {
|
|
|
705
769
|
* UUID specification.
|
|
706
770
|
*
|
|
707
771
|
* String
|
|
772
|
+
*
|
|
773
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#session-id | CTA-5004-A Session ID}
|
|
708
774
|
*/
|
|
709
775
|
sid?: string;
|
|
710
776
|
/**
|
|
@@ -714,6 +780,8 @@ type CmcdRequest = {
|
|
|
714
780
|
* zero on the start of a new session-id. Sequence numbers increase independently per each combination of mode and target.
|
|
715
781
|
*
|
|
716
782
|
* Integer
|
|
783
|
+
*
|
|
784
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#sequence-number | CTA-5004-A Sequence Number}
|
|
717
785
|
*/
|
|
718
786
|
sn?: number;
|
|
719
787
|
/**
|
|
@@ -724,6 +792,8 @@ type CmcdRequest = {
|
|
|
724
792
|
* - `ll` = low latency LIVE
|
|
725
793
|
*
|
|
726
794
|
* Token
|
|
795
|
+
*
|
|
796
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#stream-type | CTA-5004-A Stream Type}
|
|
727
797
|
*/
|
|
728
798
|
st?: CmcdStreamType;
|
|
729
799
|
/**
|
|
@@ -742,6 +812,8 @@ type CmcdRequest = {
|
|
|
742
812
|
* - `d` - preloading: the player is loading, or has loaded, assets ahead of starting in order to provide a fast startup. The expectation is that playback will commence at a future time.
|
|
743
813
|
*
|
|
744
814
|
* Token - one of [s,p,k,r,a,e,f,q,d]
|
|
815
|
+
*
|
|
816
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#state | CTA-5004-A State}
|
|
745
817
|
*/
|
|
746
818
|
sta?: CmcdPlayerState;
|
|
747
819
|
/**
|
|
@@ -751,6 +823,8 @@ type CmcdRequest = {
|
|
|
751
823
|
* reports this key as true until its buffer first reaches the target buffer for stable playback.
|
|
752
824
|
*
|
|
753
825
|
* Boolean
|
|
826
|
+
*
|
|
827
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#startup | CTA-5004-A Startup}
|
|
754
828
|
*/
|
|
755
829
|
su?: boolean;
|
|
756
830
|
/**
|
|
@@ -762,6 +836,8 @@ type CmcdRequest = {
|
|
|
762
836
|
* sent if the top encoded bitrate is known.
|
|
763
837
|
*
|
|
764
838
|
* Inner list of integer kbps with token identifiers
|
|
839
|
+
*
|
|
840
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#top-aggregated-encoded-bitrate | CTA-5004-A Top Aggregated Encoded Bitrate}
|
|
765
841
|
*/
|
|
766
842
|
tab?: CmcdObjectTypeList;
|
|
767
843
|
/**
|
|
@@ -773,6 +849,8 @@ type CmcdRequest = {
|
|
|
773
849
|
* specify the top video bitrate and requests for audio objects MUST specify the top audio bitrate.
|
|
774
850
|
*
|
|
775
851
|
* Inner list of integer kbps with token identifiers
|
|
852
|
+
*
|
|
853
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#top-encoded-bitrate | CTA-5004-A Top Encoded Bitrate}
|
|
776
854
|
*/
|
|
777
855
|
tb?: CmcdObjectTypeList;
|
|
778
856
|
/**
|
|
@@ -782,6 +860,8 @@ type CmcdRequest = {
|
|
|
782
860
|
* to the nearest 100 ms.
|
|
783
861
|
*
|
|
784
862
|
* Inner list of integer milliseconds with token identifiers
|
|
863
|
+
*
|
|
864
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#target-buffer-length | CTA-5004-A Target Buffer Length}
|
|
785
865
|
*/
|
|
786
866
|
tbl?: CmcdObjectTypeList;
|
|
787
867
|
/**
|
|
@@ -800,6 +880,8 @@ type CmcdRequest = {
|
|
|
800
880
|
* of 'a', 'v', 'av' or 'c'.
|
|
801
881
|
*
|
|
802
882
|
* Inner list of integer kbps with token identifiers
|
|
883
|
+
*
|
|
884
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#top-playable-bitrate | CTA-5004-A Top Playable Bitrate}
|
|
803
885
|
*/
|
|
804
886
|
tpb?: CmcdObjectTypeList;
|
|
805
887
|
/**
|
|
@@ -810,6 +892,8 @@ type CmcdRequest = {
|
|
|
810
892
|
* if the version is not 1.
|
|
811
893
|
*
|
|
812
894
|
* Integer
|
|
895
|
+
*
|
|
896
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#version | CTA-5004-A Version}
|
|
813
897
|
*/
|
|
814
898
|
v?: number;
|
|
815
899
|
};
|
|
@@ -821,6 +905,8 @@ type CmcdRequest = {
|
|
|
821
905
|
* Extends {@link CmcdRequest} with event-specific keys for reporting events
|
|
822
906
|
* according to the CMCD version 2 specification.
|
|
823
907
|
*
|
|
908
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#event-mode | CTA-5004-A Event Mode}
|
|
909
|
+
*
|
|
824
910
|
* @public
|
|
825
911
|
*/
|
|
826
912
|
type CmcdEvent = CmcdRequest & {
|
|
@@ -832,6 +918,8 @@ type CmcdEvent = CmcdRequest & {
|
|
|
832
918
|
* a custom value associated with this event. The names chosen SHOULD associate the custom event name with the custom key name.
|
|
833
919
|
*
|
|
834
920
|
* String
|
|
921
|
+
*
|
|
922
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#custom-event-name | CTA-5004-A Custom Event Name}
|
|
835
923
|
*/
|
|
836
924
|
cen?: string;
|
|
837
925
|
/**
|
|
@@ -861,6 +949,8 @@ type CmcdEvent = CmcdRequest & {
|
|
|
861
949
|
* - `um` - unmute
|
|
862
950
|
*
|
|
863
951
|
* Token
|
|
952
|
+
*
|
|
953
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#event | CTA-5004-A Event}
|
|
864
954
|
*/
|
|
865
955
|
e?: CmcdEventType;
|
|
866
956
|
/**
|
|
@@ -869,6 +959,8 @@ type CmcdEvent = CmcdRequest & {
|
|
|
869
959
|
* A string identifying the current hostname from which the player is retrieving content. Maximum length is 128 characters.
|
|
870
960
|
*
|
|
871
961
|
* String
|
|
962
|
+
*
|
|
963
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#hostname | CTA-5004-A Hostname}
|
|
872
964
|
*/
|
|
873
965
|
h?: string;
|
|
874
966
|
/**
|
|
@@ -881,6 +973,8 @@ type CmcdEvent = CmcdRequest & {
|
|
|
881
973
|
* This key MUST be included with all Event reports.
|
|
882
974
|
*
|
|
883
975
|
* Integer milliseconds
|
|
976
|
+
*
|
|
977
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#timestamp | CTA-5004-A Timestamp}
|
|
884
978
|
*/
|
|
885
979
|
ts?: number;
|
|
886
980
|
};
|
|
@@ -892,6 +986,8 @@ type CmcdEvent = CmcdRequest & {
|
|
|
892
986
|
* Extends {@link CmcdRequest} with response-specific keys for reporting
|
|
893
987
|
* response data according to the CMCD version 2 specification.
|
|
894
988
|
*
|
|
989
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#response-mode | CTA-5004-A Response Mode}
|
|
990
|
+
*
|
|
895
991
|
* @public
|
|
896
992
|
*/
|
|
897
993
|
type CmcdResponse = CmcdRequest & {
|
|
@@ -902,6 +998,8 @@ type CmcdResponse = CmcdRequest & {
|
|
|
902
998
|
* events of type `rr` (response received).
|
|
903
999
|
*
|
|
904
1000
|
* String
|
|
1001
|
+
*
|
|
1002
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#cmsd-dynamic-header | CTA-5004-A CMSD Dynamic Header}
|
|
905
1003
|
*/
|
|
906
1004
|
cmsdd?: string;
|
|
907
1005
|
/**
|
|
@@ -911,6 +1009,8 @@ type CmcdResponse = CmcdRequest & {
|
|
|
911
1009
|
* events of type `rr` (response received).
|
|
912
1010
|
*
|
|
913
1011
|
* String
|
|
1012
|
+
*
|
|
1013
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#cmsd-static-header | CTA-5004-A CMSD Static Header}
|
|
914
1014
|
*/
|
|
915
1015
|
cmsds?: string;
|
|
916
1016
|
/**
|
|
@@ -922,6 +1022,8 @@ type CmcdResponse = CmcdRequest & {
|
|
|
922
1022
|
* This key MUST only be reported on events of type `rr` (response received).
|
|
923
1023
|
*
|
|
924
1024
|
* Integer
|
|
1025
|
+
*
|
|
1026
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#response-code | CTA-5004-A Response Code}
|
|
925
1027
|
*/
|
|
926
1028
|
rc?: number;
|
|
927
1029
|
/**
|
|
@@ -931,6 +1033,8 @@ type CmcdResponse = CmcdRequest & {
|
|
|
931
1033
|
* only be reported on events of type `rr` (response received).
|
|
932
1034
|
*
|
|
933
1035
|
* String
|
|
1036
|
+
*
|
|
1037
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#smrt-data-header | CTA-5004-A SMRT-Data Header}
|
|
934
1038
|
*/
|
|
935
1039
|
smrt?: string;
|
|
936
1040
|
/**
|
|
@@ -940,6 +1044,8 @@ type CmcdResponse = CmcdRequest & {
|
|
|
940
1044
|
* was received. This key MUST only be reported on events of type `rr` (response received).
|
|
941
1045
|
*
|
|
942
1046
|
* Integer milliseconds
|
|
1047
|
+
*
|
|
1048
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#time-to-first-byte | CTA-5004-A Time to First Byte}
|
|
943
1049
|
*/
|
|
944
1050
|
ttfb?: number;
|
|
945
1051
|
/**
|
|
@@ -949,6 +1055,8 @@ type CmcdResponse = CmcdRequest & {
|
|
|
949
1055
|
* are received. This key MUST only be reported on events of type `rr` (response received).
|
|
950
1056
|
*
|
|
951
1057
|
* Integer milliseconds
|
|
1058
|
+
*
|
|
1059
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#time-to-first-body-byte | CTA-5004-A Time to First Body Byte}
|
|
952
1060
|
*/
|
|
953
1061
|
ttfbb?: number;
|
|
954
1062
|
/**
|
|
@@ -958,6 +1066,8 @@ type CmcdResponse = CmcdRequest & {
|
|
|
958
1066
|
* This key MUST only be reported on events of type `rr` (response received).
|
|
959
1067
|
*
|
|
960
1068
|
* Integer milliseconds
|
|
1069
|
+
*
|
|
1070
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#time-to-last-byte | CTA-5004-A Time to Last Byte}
|
|
961
1071
|
*/
|
|
962
1072
|
ttlb?: number;
|
|
963
1073
|
/**
|
|
@@ -967,6 +1077,8 @@ type CmcdResponse = CmcdRequest & {
|
|
|
967
1077
|
* MUST be reported on events of type `rr` (response received).
|
|
968
1078
|
*
|
|
969
1079
|
* String
|
|
1080
|
+
*
|
|
1081
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#request-url | CTA-5004-A Request URL}
|
|
970
1082
|
*/
|
|
971
1083
|
url?: string;
|
|
972
1084
|
};
|
|
@@ -1022,6 +1134,30 @@ declare const CmcdReportingMode: {
|
|
|
1022
1134
|
*/
|
|
1023
1135
|
type CmcdReportingMode = ValueOf<typeof CmcdReportingMode>;
|
|
1024
1136
|
//#endregion
|
|
1137
|
+
//#region src/CMCD_V1.d.ts
|
|
1138
|
+
/**
|
|
1139
|
+
* CMCD Version 1
|
|
1140
|
+
*
|
|
1141
|
+
* @public
|
|
1142
|
+
*/
|
|
1143
|
+
declare const CMCD_V1: 1;
|
|
1144
|
+
//#endregion
|
|
1145
|
+
//#region src/CMCD_V2.d.ts
|
|
1146
|
+
/**
|
|
1147
|
+
* CMCD Version 2
|
|
1148
|
+
*
|
|
1149
|
+
* @public
|
|
1150
|
+
*/
|
|
1151
|
+
declare const CMCD_V2: 2;
|
|
1152
|
+
//#endregion
|
|
1153
|
+
//#region src/CmcdVersion.d.ts
|
|
1154
|
+
/**
|
|
1155
|
+
* The version of the CMCD specification.
|
|
1156
|
+
*
|
|
1157
|
+
* @public
|
|
1158
|
+
*/
|
|
1159
|
+
type CmcdVersion = typeof CMCD_V1 | typeof CMCD_V2;
|
|
1160
|
+
//#endregion
|
|
1025
1161
|
//#region src/CmcdFormatterOptions.d.ts
|
|
1026
1162
|
/**
|
|
1027
1163
|
* Options for formatting CMCD data values.
|
|
@@ -1032,7 +1168,7 @@ type CmcdFormatterOptions = {
|
|
|
1032
1168
|
/**
|
|
1033
1169
|
* The version of the CMCD specification to use.
|
|
1034
1170
|
*/
|
|
1035
|
-
version:
|
|
1171
|
+
version: CmcdVersion;
|
|
1036
1172
|
/**
|
|
1037
1173
|
* The reporting mode to use.
|
|
1038
1174
|
*/
|
|
@@ -1196,6 +1332,12 @@ declare const CmcdHeaderField: {
|
|
|
1196
1332
|
* @public
|
|
1197
1333
|
*/
|
|
1198
1334
|
type CmcdHeaderField = ValueOf<typeof CmcdHeaderField>;
|
|
1335
|
+
/**
|
|
1336
|
+
* All CMCD header fields as an array.
|
|
1337
|
+
*
|
|
1338
|
+
* @public
|
|
1339
|
+
*/
|
|
1340
|
+
declare const CMCD_HEADER_FIELDS: readonly CmcdHeaderField[];
|
|
1199
1341
|
//#endregion
|
|
1200
1342
|
//#region src/CmcdHeaderMap.d.ts
|
|
1201
1343
|
/**
|
|
@@ -1217,7 +1359,7 @@ type CmcdEncodeOptions = {
|
|
|
1217
1359
|
*
|
|
1218
1360
|
* @defaultValue `1`
|
|
1219
1361
|
*/
|
|
1220
|
-
version?:
|
|
1362
|
+
version?: CmcdVersion;
|
|
1221
1363
|
/**
|
|
1222
1364
|
* The reporting mode to use.
|
|
1223
1365
|
*
|
|
@@ -1264,6 +1406,8 @@ type CmcdEncodeOptions = {
|
|
|
1264
1406
|
*
|
|
1265
1407
|
* @example
|
|
1266
1408
|
* {@includeCode ../test/appendCmcdHeaders.test.ts#example}
|
|
1409
|
+
*
|
|
1410
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#header-field-definition | CTA-5004-A Header Field Definition}
|
|
1267
1411
|
*/
|
|
1268
1412
|
declare function appendCmcdHeaders(headers: Record<string, string>, cmcd: Cmcd, options?: CmcdEncodeOptions): Record<string, string>;
|
|
1269
1413
|
//#endregion
|
|
@@ -1281,6 +1425,8 @@ declare function appendCmcdHeaders(headers: Record<string, string>, cmcd: Cmcd,
|
|
|
1281
1425
|
*
|
|
1282
1426
|
* @example
|
|
1283
1427
|
* {@includeCode ../test/appendCmcdQuery.test.ts#example}
|
|
1428
|
+
*
|
|
1429
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#query-argument-definition | CTA-5004-A Query Argument Definition}
|
|
1284
1430
|
*/
|
|
1285
1431
|
declare function appendCmcdQuery(url: string, cmcd: Cmcd, options?: CmcdEncodeOptions): string;
|
|
1286
1432
|
//#endregion
|
|
@@ -1320,6 +1466,10 @@ type CmcdRequestKey = keyof CmcdRequest | "nrr";
|
|
|
1320
1466
|
/**
|
|
1321
1467
|
* The map of CMCD keys to their appropriate header shard.
|
|
1322
1468
|
*
|
|
1469
|
+
* Note: Event-only keys (e, ts, cen, h) and response-received keys
|
|
1470
|
+
* (rc, ttfb, ttlb, url, etc.) are intentionally absent. They are
|
|
1471
|
+
* transmitted via the event-mode POST body, not HTTP headers.
|
|
1472
|
+
*
|
|
1323
1473
|
* @public
|
|
1324
1474
|
*/
|
|
1325
1475
|
declare const CMCD_HEADER_MAP: Record<CmcdRequestKey | "nrr", CmcdHeaderField>;
|
|
@@ -1332,6 +1482,14 @@ declare const CMCD_HEADER_MAP: Record<CmcdRequestKey | "nrr", CmcdHeaderField>;
|
|
|
1332
1482
|
*/
|
|
1333
1483
|
declare const CMCD_KEYS: CmcdKey[];
|
|
1334
1484
|
//#endregion
|
|
1485
|
+
//#region src/CMCD_MIME_TYPE.d.ts
|
|
1486
|
+
/**
|
|
1487
|
+
* CMCD MIME type for event report payloads.
|
|
1488
|
+
*
|
|
1489
|
+
* @public
|
|
1490
|
+
*/
|
|
1491
|
+
declare const CMCD_MIME_TYPE = "application/cmcd";
|
|
1492
|
+
//#endregion
|
|
1335
1493
|
//#region src/CMCD_PARAM.d.ts
|
|
1336
1494
|
/**
|
|
1337
1495
|
* CMCD parameter name.
|
|
@@ -1356,37 +1514,163 @@ declare const CMCD_REQUEST_KEYS: readonly ["ab", "bg", "bl", "br", "bs", "bsa",
|
|
|
1356
1514
|
*/
|
|
1357
1515
|
declare const CMCD_RESPONSE_KEYS: readonly ["cmsdd", "cmsds", "rc", "smrt", "ttfb", "ttfbb", "ttlb", "url"];
|
|
1358
1516
|
//#endregion
|
|
1359
|
-
//#region src/
|
|
1517
|
+
//#region src/CMCD_V1_KEYS.d.ts
|
|
1360
1518
|
/**
|
|
1361
|
-
* CMCD
|
|
1519
|
+
* Defines the keys for CMCD (Common Media Client Data) version 1.
|
|
1362
1520
|
*
|
|
1363
1521
|
* @public
|
|
1364
1522
|
*/
|
|
1365
|
-
declare const
|
|
1523
|
+
declare const CMCD_V1_KEYS: readonly ["bl", "br", "bs", "cid", "d", "dl", "mtp", "nor", "nrr", "ot", "pr", "rtp", "sf", "sid", "st", "su", "tb", "v"];
|
|
1366
1524
|
//#endregion
|
|
1367
|
-
//#region src/
|
|
1525
|
+
//#region src/CmcdData.d.ts
|
|
1368
1526
|
/**
|
|
1369
|
-
*
|
|
1527
|
+
* CMCD version 1 data.
|
|
1528
|
+
*
|
|
1529
|
+
* Overrides keys whose types differ in version 1 (e.g., `bl` and `br`
|
|
1530
|
+
* are plain integers instead of inner lists).
|
|
1370
1531
|
*
|
|
1371
1532
|
* @public
|
|
1372
1533
|
*/
|
|
1373
|
-
|
|
1534
|
+
type CmcdV1Data = Omit<CmcdRequest, keyof CmcdV1 | "v"> & CmcdV1 & {
|
|
1535
|
+
v?: 1;
|
|
1536
|
+
};
|
|
1537
|
+
/**
|
|
1538
|
+
* CMCD version 2 data.
|
|
1539
|
+
*
|
|
1540
|
+
* Includes all request, event, and response mode keys with version 2
|
|
1541
|
+
* types.
|
|
1542
|
+
*
|
|
1543
|
+
* @public
|
|
1544
|
+
*/
|
|
1545
|
+
type CmcdV2Data = Omit<Cmcd, "v"> & {
|
|
1546
|
+
v: 2;
|
|
1547
|
+
};
|
|
1548
|
+
/**
|
|
1549
|
+
* A CMCD data object that is either version 1 or version 2.
|
|
1550
|
+
*
|
|
1551
|
+
* The `v` property acts as a discriminator:
|
|
1552
|
+
*
|
|
1553
|
+
* - When `v` is `2`, the type narrows to {@link CmcdV2Data} with
|
|
1554
|
+
* inner-list values and event/response keys.
|
|
1555
|
+
* - When `v` is `1` or absent, the type narrows to {@link CmcdV1Data}
|
|
1556
|
+
* with scalar values.
|
|
1557
|
+
*
|
|
1558
|
+
* @example
|
|
1559
|
+
* ```ts
|
|
1560
|
+
* function process(data: CmcdData) {
|
|
1561
|
+
* if (data.v === 2) {
|
|
1562
|
+
* // data.bl is CmcdObjectTypeList | undefined
|
|
1563
|
+
* } else {
|
|
1564
|
+
* // data.bl is number | undefined
|
|
1565
|
+
* }
|
|
1566
|
+
* }
|
|
1567
|
+
* ```
|
|
1568
|
+
*
|
|
1569
|
+
* @public
|
|
1570
|
+
*/
|
|
1571
|
+
type CmcdData = CmcdV1Data | CmcdV2Data;
|
|
1374
1572
|
//#endregion
|
|
1375
|
-
//#region src/
|
|
1573
|
+
//#region src/CmcdValidationSeverity.d.ts
|
|
1376
1574
|
/**
|
|
1377
|
-
* CMCD
|
|
1575
|
+
* CMCD validation severity level: error.
|
|
1378
1576
|
*
|
|
1379
1577
|
* @public
|
|
1380
1578
|
*/
|
|
1381
|
-
declare const
|
|
1579
|
+
declare const CMCD_VALIDATION_SEVERITY_ERROR: "error";
|
|
1580
|
+
/**
|
|
1581
|
+
* CMCD validation severity level: warning.
|
|
1582
|
+
*
|
|
1583
|
+
* @public
|
|
1584
|
+
*/
|
|
1585
|
+
declare const CMCD_VALIDATION_SEVERITY_WARNING: "warning";
|
|
1586
|
+
/**
|
|
1587
|
+
* CMCD validation severity level.
|
|
1588
|
+
*
|
|
1589
|
+
* @public
|
|
1590
|
+
*/
|
|
1591
|
+
declare const CmcdValidationSeverity: {
|
|
1592
|
+
readonly ERROR: typeof CMCD_VALIDATION_SEVERITY_ERROR;
|
|
1593
|
+
readonly WARNING: typeof CMCD_VALIDATION_SEVERITY_WARNING;
|
|
1594
|
+
};
|
|
1595
|
+
/**
|
|
1596
|
+
* CMCD validation severity level.
|
|
1597
|
+
*
|
|
1598
|
+
* @public
|
|
1599
|
+
*/
|
|
1600
|
+
type CmcdValidationSeverity = ValueOf<typeof CmcdValidationSeverity>;
|
|
1382
1601
|
//#endregion
|
|
1383
|
-
//#region src/
|
|
1602
|
+
//#region src/CmcdValidationIssue.d.ts
|
|
1384
1603
|
/**
|
|
1385
|
-
*
|
|
1604
|
+
* Describes a single validation issue found in a CMCD payload.
|
|
1386
1605
|
*
|
|
1387
1606
|
* @public
|
|
1388
1607
|
*/
|
|
1389
|
-
type
|
|
1608
|
+
type CmcdValidationIssue = {
|
|
1609
|
+
/**
|
|
1610
|
+
* The CMCD key associated with the issue, or undefined for
|
|
1611
|
+
* structural issues.
|
|
1612
|
+
*/
|
|
1613
|
+
key?: string;
|
|
1614
|
+
/**
|
|
1615
|
+
* A human-readable description of the issue.
|
|
1616
|
+
*/
|
|
1617
|
+
message: string;
|
|
1618
|
+
/**
|
|
1619
|
+
* The severity of the issue.
|
|
1620
|
+
*/
|
|
1621
|
+
severity: CmcdValidationSeverity;
|
|
1622
|
+
};
|
|
1623
|
+
//#endregion
|
|
1624
|
+
//#region src/CmcdValidationResult.d.ts
|
|
1625
|
+
/**
|
|
1626
|
+
* The result of validating a CMCD payload.
|
|
1627
|
+
*
|
|
1628
|
+
* @public
|
|
1629
|
+
*/
|
|
1630
|
+
type CmcdValidationResult = {
|
|
1631
|
+
/** Whether the payload is valid. True if there are zero errors
|
|
1632
|
+
* (warnings are acceptable).
|
|
1633
|
+
*/
|
|
1634
|
+
valid: boolean;
|
|
1635
|
+
/**
|
|
1636
|
+
* The list of validation issues found.
|
|
1637
|
+
*/
|
|
1638
|
+
issues: CmcdValidationIssue[];
|
|
1639
|
+
};
|
|
1640
|
+
//#endregion
|
|
1641
|
+
//#region src/CmcdDataValidationResult.d.ts
|
|
1642
|
+
/**
|
|
1643
|
+
* The result of validating a single CMCD payload (headers or query).
|
|
1644
|
+
*
|
|
1645
|
+
* Extends {@link CmcdValidationResult} with the decoded {@link CmcdData}.
|
|
1646
|
+
*
|
|
1647
|
+
* @public
|
|
1648
|
+
*/
|
|
1649
|
+
type CmcdDataValidationResult = CmcdValidationResult & {
|
|
1650
|
+
/**
|
|
1651
|
+
* The decoded CMCD data.
|
|
1652
|
+
*/
|
|
1653
|
+
data: CmcdData;
|
|
1654
|
+
};
|
|
1655
|
+
//#endregion
|
|
1656
|
+
//#region src/CmcdDecodeOptions.d.ts
|
|
1657
|
+
/**
|
|
1658
|
+
* Options for decoding CMCD data.
|
|
1659
|
+
*
|
|
1660
|
+
* @public
|
|
1661
|
+
*/
|
|
1662
|
+
type CmcdDecodeOptions = {
|
|
1663
|
+
/**
|
|
1664
|
+
* When `true`, up-converts version 1 data to version 2 format by wrapping
|
|
1665
|
+
* scalar values in arrays for inner-list keys (e.g., `bl`, `br`, `mtp`).
|
|
1666
|
+
*
|
|
1667
|
+
* This ensures a consistent data shape regardless of the source version,
|
|
1668
|
+
* mirroring the down-conversion that occurs during encoding.
|
|
1669
|
+
*
|
|
1670
|
+
* @defaultValue false
|
|
1671
|
+
*/
|
|
1672
|
+
convertToLatest?: boolean;
|
|
1673
|
+
};
|
|
1390
1674
|
//#endregion
|
|
1391
1675
|
//#region src/CmcdReportConfig.d.ts
|
|
1392
1676
|
/**
|
|
@@ -1453,6 +1737,22 @@ type CmcdEventReportConfig = CmcdReportConfig & {
|
|
|
1453
1737
|
batchSize?: number;
|
|
1454
1738
|
};
|
|
1455
1739
|
//#endregion
|
|
1740
|
+
//#region src/CmcdEventsValidationResult.d.ts
|
|
1741
|
+
/**
|
|
1742
|
+
* The result of validating a multi-line CMCD event payload.
|
|
1743
|
+
*
|
|
1744
|
+
* Extends {@link CmcdValidationResult} with an array of decoded
|
|
1745
|
+
* {@link CmcdData} objects, one per event line.
|
|
1746
|
+
*
|
|
1747
|
+
* @public
|
|
1748
|
+
*/
|
|
1749
|
+
type CmcdEventsValidationResult = CmcdValidationResult & {
|
|
1750
|
+
/**
|
|
1751
|
+
* The decoded CMCD data, one entry per event line.
|
|
1752
|
+
*/
|
|
1753
|
+
data: CmcdData[];
|
|
1754
|
+
};
|
|
1755
|
+
//#endregion
|
|
1456
1756
|
//#region src/CmcdHeaderKey.d.ts
|
|
1457
1757
|
/**
|
|
1458
1758
|
* A CMCD header key.
|
|
@@ -1577,6 +1877,8 @@ type CmcdRequestReport<D = unknown> = HttpRequest & {
|
|
|
1577
1877
|
/**
|
|
1578
1878
|
* The CMCD reporter.
|
|
1579
1879
|
*
|
|
1880
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#reporting-modes-when-we-send-data | CTA-5004-A Reporting Modes}
|
|
1881
|
+
*
|
|
1580
1882
|
* @public
|
|
1581
1883
|
*/
|
|
1582
1884
|
declare class CmcdReporter {
|
|
@@ -1600,6 +1902,10 @@ declare class CmcdReporter {
|
|
|
1600
1902
|
}>);
|
|
1601
1903
|
/**
|
|
1602
1904
|
* Starts the CMCD reporter. Called by the player when the reporter is enabled.
|
|
1905
|
+
*
|
|
1906
|
+
* Note: This fires an initial time-interval event immediately (synchronously)
|
|
1907
|
+
* before the first interval elapses. Ensure CMCD data (sid, cid, etc.) is
|
|
1908
|
+
* populated before calling start().
|
|
1603
1909
|
*/
|
|
1604
1910
|
start(): void;
|
|
1605
1911
|
/**
|
|
@@ -1682,7 +1988,7 @@ declare class CmcdReporter {
|
|
|
1682
1988
|
* Creates a new request with the CMCD request report data applied. Called by the player
|
|
1683
1989
|
* before sending the request.
|
|
1684
1990
|
*
|
|
1685
|
-
* @param
|
|
1991
|
+
* @param request - The request to apply the CMCD request report to.
|
|
1686
1992
|
* @param data - The data to apply to the request. This data only
|
|
1687
1993
|
* applies to this request report. Persistent data
|
|
1688
1994
|
* should be updated using `update()`.
|
|
@@ -1708,20 +2014,44 @@ declare class CmcdReporter {
|
|
|
1708
2014
|
private resetSession;
|
|
1709
2015
|
}
|
|
1710
2016
|
//#endregion
|
|
2017
|
+
//#region src/CmcdValidationOptions.d.ts
|
|
2018
|
+
/**
|
|
2019
|
+
* Options for CMCD validation functions.
|
|
2020
|
+
*
|
|
2021
|
+
* @public
|
|
2022
|
+
*/
|
|
2023
|
+
type CmcdValidationOptions = {
|
|
2024
|
+
/**
|
|
2025
|
+
* Explicit CMCD version override. If not provided, the version is
|
|
2026
|
+
* inferred from the payload's `v` key, defaulting to 1.
|
|
2027
|
+
*/
|
|
2028
|
+
version?: CmcdVersion;
|
|
2029
|
+
/**
|
|
2030
|
+
* The reporting mode of the payload.
|
|
2031
|
+
*/
|
|
2032
|
+
reportingMode?: CmcdReportingMode;
|
|
2033
|
+
};
|
|
2034
|
+
//#endregion
|
|
1711
2035
|
//#region src/decodeCmcd.d.ts
|
|
1712
2036
|
/**
|
|
1713
2037
|
* Decode a CMCD string to an object.
|
|
1714
2038
|
*
|
|
1715
2039
|
* @param cmcd - The CMCD string to decode.
|
|
2040
|
+
* @param options - Options for decoding.
|
|
1716
2041
|
*
|
|
1717
2042
|
* @returns The decoded CMCD object.
|
|
1718
2043
|
*
|
|
2044
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#payload-definition-for-headers-and-query-argument-transmission | CTA-5004-A Payload Definition}
|
|
2045
|
+
*
|
|
1719
2046
|
* @public
|
|
1720
2047
|
*
|
|
1721
2048
|
* @example
|
|
1722
2049
|
* {@includeCode ../test/decodeCmcd.test.ts#example}
|
|
1723
2050
|
*/
|
|
1724
|
-
declare function decodeCmcd
|
|
2051
|
+
declare function decodeCmcd(cmcd: string, options: CmcdDecodeOptions & {
|
|
2052
|
+
convertToLatest: true;
|
|
2053
|
+
}): Cmcd;
|
|
2054
|
+
declare function decodeCmcd<T extends CmcdData = CmcdData>(cmcd: string, options?: CmcdDecodeOptions): T;
|
|
1725
2055
|
//#endregion
|
|
1726
2056
|
//#region src/encodeCmcd.d.ts
|
|
1727
2057
|
/**
|
|
@@ -1732,6 +2062,8 @@ declare function decodeCmcd<T extends Cmcd = Cmcd>(cmcd: string): T;
|
|
|
1732
2062
|
*
|
|
1733
2063
|
* @returns The encoded CMCD string.
|
|
1734
2064
|
*
|
|
2065
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#payload-definition-for-headers-and-query-argument-transmission | CTA-5004-A Payload Definition}
|
|
2066
|
+
*
|
|
1735
2067
|
* @public
|
|
1736
2068
|
*
|
|
1737
2069
|
* @example
|
|
@@ -1744,45 +2076,63 @@ declare function encodeCmcd(cmcd: Cmcd, options?: CmcdEncodeOptions): string;
|
|
|
1744
2076
|
* Decode CMCD data from request headers.
|
|
1745
2077
|
*
|
|
1746
2078
|
* @param headers - The request headers to decode.
|
|
2079
|
+
* @param options - Options for decoding.
|
|
1747
2080
|
*
|
|
1748
2081
|
* @returns The decoded CMCD data.
|
|
1749
2082
|
*
|
|
2083
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#header-field-definition | CTA-5004-A Header Field Definition}
|
|
2084
|
+
*
|
|
1750
2085
|
* @public
|
|
1751
2086
|
*
|
|
1752
2087
|
* @example
|
|
1753
2088
|
* {@includeCode ../test/fromCmcdHeaders.test.ts#example}
|
|
1754
2089
|
*/
|
|
1755
|
-
declare function fromCmcdHeaders(headers: Record<string, string> | Headers
|
|
2090
|
+
declare function fromCmcdHeaders(headers: Record<string, string> | Headers, options: CmcdDecodeOptions & {
|
|
2091
|
+
convertToLatest: true;
|
|
2092
|
+
}): Cmcd;
|
|
2093
|
+
declare function fromCmcdHeaders(headers: Record<string, string> | Headers, options?: CmcdDecodeOptions): CmcdData;
|
|
1756
2094
|
//#endregion
|
|
1757
2095
|
//#region src/fromCmcdQuery.d.ts
|
|
1758
2096
|
/**
|
|
1759
2097
|
* Decode CMCD data from a query string.
|
|
1760
2098
|
*
|
|
1761
2099
|
* @param query - The query string to decode.
|
|
2100
|
+
* @param options - Options for decoding.
|
|
1762
2101
|
*
|
|
1763
2102
|
* @returns The decoded CMCD data.
|
|
1764
2103
|
*
|
|
2104
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#query-argument-definition | CTA-5004-A Query Argument Definition}
|
|
2105
|
+
*
|
|
1765
2106
|
* @public
|
|
1766
2107
|
*
|
|
1767
2108
|
* @example
|
|
1768
2109
|
* {@includeCode ../test/fromCmcdQuery.test.ts#example}
|
|
1769
2110
|
*/
|
|
1770
|
-
declare function fromCmcdQuery(query: string | URLSearchParams
|
|
2111
|
+
declare function fromCmcdQuery(query: string | URLSearchParams, options: CmcdDecodeOptions & {
|
|
2112
|
+
convertToLatest: true;
|
|
2113
|
+
}): Cmcd;
|
|
2114
|
+
declare function fromCmcdQuery(query: string | URLSearchParams, options?: CmcdDecodeOptions): CmcdData;
|
|
1771
2115
|
//#endregion
|
|
1772
2116
|
//#region src/fromCmcdUrl.d.ts
|
|
1773
2117
|
/**
|
|
1774
2118
|
* Decode CMCD data from a url encoded string.
|
|
1775
2119
|
*
|
|
1776
2120
|
* @param url - The url encoded string to decode.
|
|
2121
|
+
* @param options - Options for decoding.
|
|
1777
2122
|
*
|
|
1778
2123
|
* @returns The decoded CMCD data.
|
|
1779
2124
|
*
|
|
2125
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#query-argument-definition | CTA-5004-A Query Argument Definition}
|
|
2126
|
+
*
|
|
1780
2127
|
* @public
|
|
1781
2128
|
*
|
|
1782
2129
|
* @example
|
|
1783
2130
|
* {@includeCode ../test/fromCmcdUrl.test.ts#example}
|
|
1784
2131
|
*/
|
|
1785
|
-
declare function fromCmcdUrl(url: string
|
|
2132
|
+
declare function fromCmcdUrl(url: string, options: CmcdDecodeOptions & {
|
|
2133
|
+
convertToLatest: true;
|
|
2134
|
+
}): Cmcd;
|
|
2135
|
+
declare function fromCmcdUrl(url: string, options?: CmcdDecodeOptions): CmcdData;
|
|
1786
2136
|
//#endregion
|
|
1787
2137
|
//#region src/groupCmcdHeaders.d.ts
|
|
1788
2138
|
/**
|
|
@@ -1793,6 +2143,8 @@ declare function fromCmcdUrl(url: string): Cmcd;
|
|
|
1793
2143
|
*
|
|
1794
2144
|
* @returns The CMCD header shards.
|
|
1795
2145
|
*
|
|
2146
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#header-field-definition | CTA-5004-A Header Field Definition}
|
|
2147
|
+
*
|
|
1796
2148
|
* @public
|
|
1797
2149
|
*/
|
|
1798
2150
|
declare function groupCmcdHeaders(cmcd: Cmcd, customHeaderMap?: Partial<CmcdHeaderMap>): Record<CmcdHeaderField, CmcdHeaderValue>;
|
|
@@ -1854,6 +2206,21 @@ declare function isCmcdRequestKey(key: string): key is keyof Cmcd;
|
|
|
1854
2206
|
*/
|
|
1855
2207
|
declare function isCmcdResponseReceivedKey(key: string): key is keyof Cmcd;
|
|
1856
2208
|
//#endregion
|
|
2209
|
+
//#region src/isCmcdV1Data.d.ts
|
|
2210
|
+
/**
|
|
2211
|
+
* Check if a CMCD data object is version 1.
|
|
2212
|
+
*
|
|
2213
|
+
* @param data - The CMCD data object to check.
|
|
2214
|
+
*
|
|
2215
|
+
* @returns `true` if the data is version 1, `false` otherwise.
|
|
2216
|
+
*
|
|
2217
|
+
* @public
|
|
2218
|
+
*
|
|
2219
|
+
* @example
|
|
2220
|
+
* {@includeCode ../test/isCmcdV1Data.test.ts#example}
|
|
2221
|
+
*/
|
|
2222
|
+
declare function isCmcdV1Data(data: CmcdData): data is CmcdV1Data;
|
|
2223
|
+
//#endregion
|
|
1857
2224
|
//#region src/isCmcdV1Key.d.ts
|
|
1858
2225
|
/**
|
|
1859
2226
|
* Filter function for CMCD v1 keys.
|
|
@@ -1869,6 +2236,21 @@ declare function isCmcdResponseReceivedKey(key: string): key is keyof Cmcd;
|
|
|
1869
2236
|
*/
|
|
1870
2237
|
declare function isCmcdV1Key(key: string): key is CmcdKey;
|
|
1871
2238
|
//#endregion
|
|
2239
|
+
//#region src/isCmcdV2Data.d.ts
|
|
2240
|
+
/**
|
|
2241
|
+
* Check if a CMCD data object is version 2.
|
|
2242
|
+
*
|
|
2243
|
+
* @param data - The CMCD data object to check.
|
|
2244
|
+
*
|
|
2245
|
+
* @returns `true` if the data is version 2, `false` otherwise.
|
|
2246
|
+
*
|
|
2247
|
+
* @public
|
|
2248
|
+
*
|
|
2249
|
+
* @example
|
|
2250
|
+
* {@includeCode ../test/isCmcdV2Data.test.ts#example}
|
|
2251
|
+
*/
|
|
2252
|
+
declare function isCmcdV2Data(data: CmcdData): data is CmcdV2Data;
|
|
2253
|
+
//#endregion
|
|
1872
2254
|
//#region src/prepareCmcdData.d.ts
|
|
1873
2255
|
/**
|
|
1874
2256
|
* Convert a generic object to CMCD data.
|
|
@@ -1889,6 +2271,8 @@ declare function prepareCmcdData(obj: Record<string, any>, options?: CmcdEncodeO
|
|
|
1889
2271
|
*
|
|
1890
2272
|
* @returns The CMCD header shards.
|
|
1891
2273
|
*
|
|
2274
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#header-field-definition | CTA-5004-A Header Field Definition}
|
|
2275
|
+
*
|
|
1892
2276
|
* @public
|
|
1893
2277
|
*
|
|
1894
2278
|
* @example
|
|
@@ -1905,6 +2289,8 @@ declare function toCmcdHeaders(cmcd: Cmcd, options?: CmcdEncodeOptions): Record<
|
|
|
1905
2289
|
*
|
|
1906
2290
|
* @returns The CMCD query arg.
|
|
1907
2291
|
*
|
|
2292
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#query-argument-definition | CTA-5004-A Query Argument Definition}
|
|
2293
|
+
*
|
|
1908
2294
|
* @public
|
|
1909
2295
|
*
|
|
1910
2296
|
* @example
|
|
@@ -1921,6 +2307,8 @@ declare function toCmcdQuery(cmcd: Cmcd, options?: CmcdEncodeOptions): string;
|
|
|
1921
2307
|
*
|
|
1922
2308
|
* @returns The URL encoded CMCD data.
|
|
1923
2309
|
*
|
|
2310
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#query-argument-definition | CTA-5004-A Query Argument Definition}
|
|
2311
|
+
*
|
|
1924
2312
|
* @public
|
|
1925
2313
|
*/
|
|
1926
2314
|
declare function toCmcdUrl(cmcd: Cmcd, options?: CmcdEncodeOptions): string;
|
|
@@ -1937,5 +2325,166 @@ declare function toCmcdUrl(cmcd: Cmcd, options?: CmcdEncodeOptions): string;
|
|
|
1937
2325
|
*/
|
|
1938
2326
|
declare function toCmcdValue<V extends SfBareItem, P>(value: V, params?: P): SfItem<V, P>;
|
|
1939
2327
|
//#endregion
|
|
1940
|
-
|
|
2328
|
+
//#region src/validateCmcd.d.ts
|
|
2329
|
+
/**
|
|
2330
|
+
* Validates a CMCD payload by checking keys, values, and structure.
|
|
2331
|
+
*
|
|
2332
|
+
* @example
|
|
2333
|
+
* {@includeCode ../test/validateCmcd.test.ts#example}
|
|
2334
|
+
*
|
|
2335
|
+
* @param data - The CMCD payload to validate.
|
|
2336
|
+
* @param options - Validation options.
|
|
2337
|
+
* @returns The validation result.
|
|
2338
|
+
*
|
|
2339
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#data-payload-definition-what-data-to-send | CTA-5004-A Data Payload Definition}
|
|
2340
|
+
*
|
|
2341
|
+
* @public
|
|
2342
|
+
*/
|
|
2343
|
+
declare function validateCmcd(data: Record<string, unknown>, options?: CmcdValidationOptions): CmcdValidationResult;
|
|
2344
|
+
//#endregion
|
|
2345
|
+
//#region src/validateCmcdEventReport.d.ts
|
|
2346
|
+
/**
|
|
2347
|
+
* Validates a full HTTP request as an event-mode payload.
|
|
2348
|
+
*
|
|
2349
|
+
* Accepts an {@link @svta/cml-utils!HttpRequest | HttpRequest} object.
|
|
2350
|
+
*
|
|
2351
|
+
* This function validates that the request uses the POST method and has
|
|
2352
|
+
* the correct `Content-Type` header (`application/cmcd`) in addition to
|
|
2353
|
+
* validating the body content via {@link validateCmcdEvents}.
|
|
2354
|
+
*
|
|
2355
|
+
* @param request - An `HttpRequest` to validate.
|
|
2356
|
+
* @param options - Validation options (excluding `reportingMode`).
|
|
2357
|
+
* @returns The validation result including decoded data per event line.
|
|
2358
|
+
*
|
|
2359
|
+
* @example {@includeCode ../test/validateCmcdEventReport.test.ts#example}
|
|
2360
|
+
*
|
|
2361
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#event-mode | CTA-5004-A Event Mode}
|
|
2362
|
+
*
|
|
2363
|
+
* @public
|
|
2364
|
+
*/
|
|
2365
|
+
declare function validateCmcdEventReport(request: HttpRequest, options?: Omit<CmcdValidationOptions, "reportingMode">): CmcdEventsValidationResult;
|
|
2366
|
+
//#endregion
|
|
2367
|
+
//#region src/validateCmcdEvents.d.ts
|
|
2368
|
+
/**
|
|
2369
|
+
* Validates a raw CMCD string as an event-mode payload.
|
|
2370
|
+
*
|
|
2371
|
+
* This function decodes the string internally and validates it with
|
|
2372
|
+
* `reportingMode` set to `'event'`. The input may contain multiple
|
|
2373
|
+
* newline-separated events (e.g. an `application/cmcd` POST body), in which
|
|
2374
|
+
* case each line is validated independently and the results are merged.
|
|
2375
|
+
*
|
|
2376
|
+
* @param cmcd - The raw CMCD-encoded string to validate. May contain
|
|
2377
|
+
* multiple newline-separated event lines.
|
|
2378
|
+
* @param options - Validation options (excluding `reportingMode`).
|
|
2379
|
+
* @returns The validation result including decoded data per event line.
|
|
2380
|
+
*
|
|
2381
|
+
* @example
|
|
2382
|
+
* {@includeCode ../test/validateCmcdEvents.test.ts#example}
|
|
2383
|
+
*
|
|
2384
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#body-definition | CTA-5004-A Body Definition}
|
|
2385
|
+
*
|
|
2386
|
+
* @public
|
|
2387
|
+
*/
|
|
2388
|
+
declare function validateCmcdEvents(cmcd: string, options?: Omit<CmcdValidationOptions, "reportingMode">): CmcdEventsValidationResult;
|
|
2389
|
+
//#endregion
|
|
2390
|
+
//#region src/validateCmcdHeaders.d.ts
|
|
2391
|
+
/**
|
|
2392
|
+
* Validates CMCD HTTP headers by checking shard placement and payload validity.
|
|
2393
|
+
*
|
|
2394
|
+
* This function accepts raw CMCD header strings, decodes each shard
|
|
2395
|
+
* internally, verifies that each key is placed in its correct header shard,
|
|
2396
|
+
* then merges all shards and runs full payload validation (keys, values, and
|
|
2397
|
+
* structure) on the merged data.
|
|
2398
|
+
*
|
|
2399
|
+
* @example
|
|
2400
|
+
* {@includeCode ../test/validateCmcdHeaders.test.ts#example}
|
|
2401
|
+
*
|
|
2402
|
+
* @param headers - A `Headers` instance or a record of CMCD header fields to their raw encoded string values.
|
|
2403
|
+
* @param options - Validation options (excluding `reportingMode`).
|
|
2404
|
+
* @returns The validation result including decoded data.
|
|
2405
|
+
*
|
|
2406
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#header-field-definition | CTA-5004-A Header Field Definition}
|
|
2407
|
+
*
|
|
2408
|
+
* @public
|
|
2409
|
+
*/
|
|
2410
|
+
declare function validateCmcdHeaders(headers: Record<string, string> | Headers, options?: Omit<CmcdValidationOptions, "reportingMode">): CmcdDataValidationResult;
|
|
2411
|
+
//#endregion
|
|
2412
|
+
//#region src/validateCmcdKeys.d.ts
|
|
2413
|
+
/**
|
|
2414
|
+
* Validates that all keys in a CMCD payload are recognized spec keys or valid custom keys.
|
|
2415
|
+
*
|
|
2416
|
+
* @example
|
|
2417
|
+
* {@includeCode ../test/validateCmcdKeys.test.ts#example}
|
|
2418
|
+
*
|
|
2419
|
+
* @param data - The CMCD payload to validate.
|
|
2420
|
+
* @param options - Validation options.
|
|
2421
|
+
* @returns The validation result.
|
|
2422
|
+
*
|
|
2423
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#reserved-keys | CTA-5004-A Reserved Keys}
|
|
2424
|
+
*
|
|
2425
|
+
* @public
|
|
2426
|
+
*/
|
|
2427
|
+
declare function validateCmcdKeys(data: Record<string, unknown>, options?: CmcdValidationOptions): CmcdValidationResult;
|
|
2428
|
+
//#endregion
|
|
2429
|
+
//#region src/validateCmcdRequest.d.ts
|
|
2430
|
+
/**
|
|
2431
|
+
* Validates CMCD data from a request as a request-mode payload.
|
|
2432
|
+
*
|
|
2433
|
+
* Accepts a
|
|
2434
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/API/Request | Request}
|
|
2435
|
+
* object or an {@link @svta/cml-utils!HttpRequest | HttpRequest} object.
|
|
2436
|
+
*
|
|
2437
|
+
* The function checks for CMCD data in the HTTP headers first. If CMCD
|
|
2438
|
+
* headers are found, validation includes shard-placement checks via
|
|
2439
|
+
* {@link validateCmcdHeaders}. Otherwise, the CMCD query parameter is
|
|
2440
|
+
* extracted from the URL and validated.
|
|
2441
|
+
*
|
|
2442
|
+
* @param request - A `Request` or `HttpRequest` to validate.
|
|
2443
|
+
* @param options - Validation options (excluding `reportingMode`).
|
|
2444
|
+
* @returns The validation result including decoded data.
|
|
2445
|
+
*
|
|
2446
|
+
* @example
|
|
2447
|
+
* {@includeCode ../test/validateCmcdRequest.test.ts#example}
|
|
2448
|
+
*
|
|
2449
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#request-mode | CTA-5004-A Request Mode}
|
|
2450
|
+
*
|
|
2451
|
+
* @public
|
|
2452
|
+
*/
|
|
2453
|
+
declare function validateCmcdRequest(request: Request | HttpRequest, options?: Omit<CmcdValidationOptions, "reportingMode">): CmcdDataValidationResult;
|
|
2454
|
+
//#endregion
|
|
2455
|
+
//#region src/validateCmcdStructure.d.ts
|
|
2456
|
+
/**
|
|
2457
|
+
* Validates the structural rules of a CMCD payload.
|
|
2458
|
+
*
|
|
2459
|
+
* @example
|
|
2460
|
+
* {@includeCode ../test/validateCmcdStructure.test.ts#example}
|
|
2461
|
+
*
|
|
2462
|
+
* @param data - The CMCD payload to validate.
|
|
2463
|
+
* @param options - Validation options.
|
|
2464
|
+
* @returns The validation result.
|
|
2465
|
+
*
|
|
2466
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#data-payload-definition-what-data-to-send | CTA-5004-A Data Payload Definition}
|
|
2467
|
+
*
|
|
2468
|
+
* @public
|
|
2469
|
+
*/
|
|
2470
|
+
declare function validateCmcdStructure(data: Record<string, unknown>, options?: CmcdValidationOptions): CmcdValidationResult;
|
|
2471
|
+
//#endregion
|
|
2472
|
+
//#region src/validateCmcdValues.d.ts
|
|
2473
|
+
/**
|
|
2474
|
+
* Validates that all values in a CMCD payload conform to the expected types and constraints.
|
|
2475
|
+
*
|
|
2476
|
+
* @example
|
|
2477
|
+
* {@includeCode ../test/validateCmcdValues.test.ts#example}
|
|
2478
|
+
*
|
|
2479
|
+
* @param data - The CMCD payload to validate.
|
|
2480
|
+
* @param options - Validation options.
|
|
2481
|
+
* @returns The validation result.
|
|
2482
|
+
*
|
|
2483
|
+
* @see {@link https://cta-wave.github.io/Resources/common-media-client-data--cta-5004-b.html#reserved-keys | CTA-5004-A Reserved Keys}
|
|
2484
|
+
*
|
|
2485
|
+
* @public
|
|
2486
|
+
*/
|
|
2487
|
+
declare function validateCmcdValues(data: Record<string, unknown>, options?: CmcdValidationOptions): CmcdValidationResult;
|
|
2488
|
+
//#endregion
|
|
2489
|
+
export { CMCD_DEFAULT_TIME_INTERVAL, CMCD_EVENT_AD_BREAK_END, CMCD_EVENT_AD_BREAK_START, CMCD_EVENT_AD_END, CMCD_EVENT_AD_START, CMCD_EVENT_BACKGROUNDED_MODE, CMCD_EVENT_BITRATE_CHANGE, CMCD_EVENT_CONTENT_ID, CMCD_EVENT_CUSTOM_EVENT, CMCD_EVENT_ERROR, CMCD_EVENT_KEYS, CMCD_EVENT_MODE, CMCD_EVENT_MUTE, CMCD_EVENT_PLAYER_COLLAPSE, CMCD_EVENT_PLAYER_EXPAND, CMCD_EVENT_PLAY_STATE, CMCD_EVENT_RESPONSE_RECEIVED, CMCD_EVENT_SKIP, CMCD_EVENT_TIME_INTERVAL, CMCD_EVENT_UNMUTE, CMCD_FORMATTER_MAP, CMCD_HEADERS, CMCD_HEADER_FIELDS, CMCD_HEADER_MAP, CMCD_JSON, CMCD_KEYS, CMCD_MIME_TYPE, CMCD_OBJECT, CMCD_PARAM, CMCD_QUERY, CMCD_REQUEST, CMCD_REQUEST_KEYS, CMCD_REQUEST_MODE, CMCD_RESPONSE_KEYS, CMCD_SESSION, CMCD_STATUS, CMCD_V1, CMCD_V1_KEYS, CMCD_V2, CMCD_VALIDATION_SEVERITY_ERROR, CMCD_VALIDATION_SEVERITY_WARNING, Cmcd, CmcdCustomKey, CmcdCustomValue, CmcdData, CmcdDataValidationResult, CmcdDecodeOptions, CmcdEncodeOptions, CmcdEvent, CmcdEventReportConfig, CmcdEventType, CmcdEventsValidationResult, CmcdFormatter, CmcdFormatterMap, CmcdFormatterOptions, CmcdHeaderField, CmcdHeaderKey, CmcdHeaderMap, CmcdHeaderValue, CmcdKey, CmcdObjectType, CmcdObjectTypeList, CmcdPlayerState, CmcdReportConfig, CmcdReporter, CmcdReporterConfig, CmcdReportingMode, CmcdRequest, CmcdRequestKey, CmcdRequestReport, CmcdRequestReportConfig, CmcdResponse, CmcdStreamType, CmcdStreamingFormat, CmcdTransmissionMode, CmcdV1, CmcdV1Data, CmcdV2Data, CmcdValidationIssue, CmcdValidationOptions, CmcdValidationResult, CmcdValidationSeverity, CmcdValue, CmcdVersion, appendCmcdHeaders, appendCmcdQuery, decodeCmcd, encodeCmcd, fromCmcdHeaders, fromCmcdQuery, fromCmcdUrl, groupCmcdHeaders, isCmcdCustomKey, isCmcdEventKey, isCmcdRequestKey, isCmcdResponseReceivedKey, isCmcdV1Data, isCmcdV1Key, isCmcdV2Data, prepareCmcdData, toCmcdHeaders, toCmcdQuery, toCmcdUrl, toCmcdValue, validateCmcd, validateCmcdEventReport, validateCmcdEvents, validateCmcdHeaders, validateCmcdKeys, validateCmcdRequest, validateCmcdStructure, validateCmcdValues };
|
|
1941
2490
|
//# sourceMappingURL=index.d.ts.map
|