@svta/cml-cmsd 0.19.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.
Files changed (80) hide show
  1. package/LICENSE +201 -0
  2. package/dist/CMSD_DYNAMIC.d.ts +8 -0
  3. package/dist/CMSD_DYNAMIC.d.ts.map +1 -0
  4. package/dist/CMSD_DYNAMIC.js +8 -0
  5. package/dist/CMSD_DYNAMIC.js.map +1 -0
  6. package/dist/CMSD_STATIC.d.ts +8 -0
  7. package/dist/CMSD_STATIC.d.ts.map +1 -0
  8. package/dist/CMSD_STATIC.js +8 -0
  9. package/dist/CMSD_STATIC.js.map +1 -0
  10. package/dist/CMSD_V1.d.ts +8 -0
  11. package/dist/CMSD_V1.d.ts.map +1 -0
  12. package/dist/CMSD_V1.js +8 -0
  13. package/dist/CMSD_V1.js.map +1 -0
  14. package/dist/CmsdCustomKey.d.ts +11 -0
  15. package/dist/CmsdCustomKey.d.ts.map +1 -0
  16. package/dist/CmsdCustomKey.js +2 -0
  17. package/dist/CmsdCustomKey.js.map +1 -0
  18. package/dist/CmsdDynamic.d.ts +20 -0
  19. package/dist/CmsdDynamic.d.ts.map +1 -0
  20. package/dist/CmsdDynamic.js +2 -0
  21. package/dist/CmsdDynamic.js.map +1 -0
  22. package/dist/CmsdDynamicParams.d.ts +75 -0
  23. package/dist/CmsdDynamicParams.d.ts.map +1 -0
  24. package/dist/CmsdDynamicParams.js +2 -0
  25. package/dist/CmsdDynamicParams.js.map +1 -0
  26. package/dist/CmsdEncodeOptions.d.ts +15 -0
  27. package/dist/CmsdEncodeOptions.d.ts.map +1 -0
  28. package/dist/CmsdEncodeOptions.js +2 -0
  29. package/dist/CmsdEncodeOptions.js.map +1 -0
  30. package/dist/CmsdHeaderField.d.ts +28 -0
  31. package/dist/CmsdHeaderField.d.ts.map +1 -0
  32. package/dist/CmsdHeaderField.js +23 -0
  33. package/dist/CmsdHeaderField.js.map +1 -0
  34. package/dist/CmsdObjectType.d.ts +15 -0
  35. package/dist/CmsdObjectType.d.ts.map +1 -0
  36. package/dist/CmsdObjectType.js +11 -0
  37. package/dist/CmsdObjectType.js.map +1 -0
  38. package/dist/CmsdStatic.d.ts +154 -0
  39. package/dist/CmsdStatic.d.ts.map +1 -0
  40. package/dist/CmsdStatic.js +2 -0
  41. package/dist/CmsdStatic.js.map +1 -0
  42. package/dist/CmsdStreamType.d.ts +15 -0
  43. package/dist/CmsdStreamType.d.ts.map +1 -0
  44. package/dist/CmsdStreamType.js +11 -0
  45. package/dist/CmsdStreamType.js.map +1 -0
  46. package/dist/CmsdStreamingFormat.d.ts +15 -0
  47. package/dist/CmsdStreamingFormat.d.ts.map +1 -0
  48. package/dist/CmsdStreamingFormat.js +11 -0
  49. package/dist/CmsdStreamingFormat.js.map +1 -0
  50. package/dist/CmsdValue.d.ts +12 -0
  51. package/dist/CmsdValue.d.ts.map +1 -0
  52. package/dist/CmsdValue.js +2 -0
  53. package/dist/CmsdValue.js.map +1 -0
  54. package/dist/decodeCmsdDynamic.d.ts +13 -0
  55. package/dist/decodeCmsdDynamic.d.ts.map +1 -0
  56. package/dist/decodeCmsdDynamic.js +19 -0
  57. package/dist/decodeCmsdDynamic.js.map +1 -0
  58. package/dist/decodeCmsdStatic.d.ts +13 -0
  59. package/dist/decodeCmsdStatic.d.ts.map +1 -0
  60. package/dist/decodeCmsdStatic.js +25 -0
  61. package/dist/decodeCmsdStatic.js.map +1 -0
  62. package/dist/encodeCmsdDynamic.d.ts +26 -0
  63. package/dist/encodeCmsdDynamic.d.ts.map +1 -0
  64. package/dist/encodeCmsdDynamic.js +15 -0
  65. package/dist/encodeCmsdDynamic.js.map +1 -0
  66. package/dist/encodeCmsdStatic.d.ts +15 -0
  67. package/dist/encodeCmsdStatic.d.ts.map +1 -0
  68. package/dist/encodeCmsdStatic.js +20 -0
  69. package/dist/encodeCmsdStatic.js.map +1 -0
  70. package/dist/index.d.ts +23 -0
  71. package/dist/index.d.ts.map +1 -0
  72. package/dist/index.js +17 -0
  73. package/dist/index.js.map +1 -0
  74. package/dist/tsconfig.tsbuildinfo +1 -0
  75. package/dist/tsdoc-metadata.json +11 -0
  76. package/dist/utils/processCmsd.d.ts +4 -0
  77. package/dist/utils/processCmsd.d.ts.map +1 -0
  78. package/dist/utils/processCmsd.js +28 -0
  79. package/dist/utils/processCmsd.js.map +1 -0
  80. package/package.json +78 -0
@@ -0,0 +1,154 @@
1
+ import type { CmsdCustomKey } from './CmsdCustomKey.js';
2
+ import type { CmsdObjectType } from './CmsdObjectType.js';
3
+ import type { CmsdStreamType } from './CmsdStreamType.js';
4
+ import type { CmsdStreamingFormat } from './CmsdStreamingFormat.js';
5
+ import type { CmsdValue } from './CmsdValue.js';
6
+ /**
7
+ * Common Media Server Data (CMSD) static response header fields.
8
+ *
9
+ * @see {@link https://cdn.cta.tech/cta/media/media/resources/standards/pdfs/cta-5006-final.pdf|CMSD Spec}
10
+ *
11
+ *
12
+ * @beta
13
+ */
14
+ export type CmsdStatic = {
15
+ /**
16
+ * Custom key names may be used, but they MUST carry a hyphenated prefix to ensure that there will not be a namespace collision
17
+ * with future revisions to this specification. Clients SHOULD use a reverse-DNS syntax when defining their own prefix.
18
+ */
19
+ [index: CmsdCustomKey]: CmsdValue;
20
+ /**
21
+ * Availability time
22
+ *
23
+ * The wallclock time at which the first byte of this object became available at the origin for successful request. The time is
24
+ * expressed as integer milliseconds since the Unix Epoch, i.e., the number of milliseconds that have elapsed since January 1,
25
+ * 1970 (midnight UTC/GMT), not counting leap seconds (in ISO 8601: 1970- 01-01T00:00:000Z).
26
+ *
27
+ * Integer Milliseconds
28
+ */
29
+ at?: number;
30
+ /**
31
+ * Encoded bitrate
32
+ *
33
+ * The encoded bitrate of the audio or video object being requested. If the instantaneous bitrate varies over the duration of the
34
+ * object, the average value over the duration of the object SHOULD be communicated. This key should only accompany objects that
35
+ * have an implicit bitrate.
36
+ *
37
+ * Integer kbps
38
+ */
39
+ br?: number;
40
+ /**
41
+ * Object duration
42
+ *
43
+ * The playback duration in milliseconds of the object being requested. If a partial segment is being requested, then this value
44
+ * MUST indicate the playback duration of that part and not that of its parent segment. This value can be an approximation of the
45
+ * estimated duration if the explicit value is not known.
46
+ *
47
+ * Integer milliseconds
48
+ */
49
+ d?: number;
50
+ /**
51
+ * Held time
52
+ *
53
+ * The number of milliseconds that this response was held back by an origin before returning. This is applicable to blocking responses
54
+ * under LL-HLS [HLSbis].
55
+ *
56
+ * Integer Milliseconds
57
+ */
58
+ ht?: number;
59
+ /**
60
+ * Intermediary identifier
61
+ *
62
+ * An identifier for the processing server. The value SHOULD identify both the organization and the intermediary that is writing the key.
63
+ * Identifiers SHOULD be as concise as possible to reduce log file and transferred size, while still remaining unique.
64
+ *
65
+ * String
66
+ */
67
+ n?: string;
68
+ /**
69
+ * Next object request
70
+ *
71
+ * Relative path of the next object to be requested. This can be used to trigger pre-fetching by the CDN. This MUST be a path relative to the current
72
+ * request. This string MUST be URLEncoded. The client SHOULD NOT depend upon any pre-fetch action being taken - it is merely a request for such a
73
+ * pre-fetch to take place.
74
+ *
75
+ * String
76
+ */
77
+ nor?: string;
78
+ /**
79
+ * Next range request
80
+ *
81
+ * If the next request will be a partial object request, then this string denotes the byte range to be requested. If the ‘nor’ field is not set, then the
82
+ * object is assumed to match the object currently being requested. The client SHOULD NOT depend upon any pre-fetch action being taken – it is merely a
83
+ * request for such a pre-fetch to take place. Formatting is similar to the HTTP Range header, except that the unit MUST be ‘byte’, the ‘Range:’ prefix is
84
+ * NOT required and specifying multiple ranges is NOT allowed. Valid combinations are:
85
+ *
86
+ * - `"\<range-start\>-"`
87
+ * - `"\<range-start\>-\<range-end\>"`
88
+ * - `"-\<suffix-length\>"`
89
+ *
90
+ * String
91
+ */
92
+ nrr?: string;
93
+ /**
94
+ * Object type
95
+ *
96
+ * The media type of the current object being requested:
97
+ * - `m` = text file, such as a manifest or playlist
98
+ * - `a` = audio only
99
+ * - `v` = video only
100
+ * - `av` = muxed audio and video
101
+ * - `i` = init segment
102
+ * - `c` = caption or subtitle
103
+ * - `tt` = ISOBMFF timed text track
104
+ * - `k` = cryptographic key, license or certificate.
105
+ * - `o` = other
106
+ *
107
+ * If the object type being requested is unknown, then this key MUST NOT be used.
108
+ *
109
+ * Token
110
+ */
111
+ ot?: CmsdObjectType;
112
+ /**
113
+ * Streaming format
114
+ *
115
+ * The streaming format that defines the current request.
116
+ *
117
+ * - `d` = MPEG DASH
118
+ * - `h` = HTTP Live Streaming (HLS)
119
+ * - `s` = Smooth Streaming
120
+ * - `o` = other
121
+ *
122
+ * If the streaming format being requested is unknown, then this key MUST NOT be used.
123
+ *
124
+ * Token
125
+ */
126
+ sf?: CmsdStreamingFormat;
127
+ /**
128
+ * Stream type
129
+ * - `v` = all segments are available – e.g., VOD
130
+ * - `l` = segments become available over time – e.g., LIVE
131
+ *
132
+ * Token
133
+ */
134
+ st?: CmsdStreamType;
135
+ /**
136
+ * Startup
137
+ *
138
+ * Key is included without a value if the object is needed urgently due to startup, seeking or recovery after a buffer-empty event. The media SHOULD not be
139
+ * rendering when this request is made. This key MUST not be sent if it is FALSE.
140
+ *
141
+ * Boolean
142
+ */
143
+ su?: boolean;
144
+ /**
145
+ * CMSD version
146
+ *
147
+ * The version of this specification used for interpreting the defined key names and values. If this key is omitted, the client and server MUST
148
+ * interpret the values as being defined by version 1. Client SHOULD omit this field if the version is 1.
149
+ *
150
+ * Integer
151
+ */
152
+ v?: number;
153
+ };
154
+ //# sourceMappingURL=CmsdStatic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CmsdStatic.d.ts","sourceRoot":"","sources":["../src/CmsdStatic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD;;;;;;;GAOG;AACH,MAAM,MAAM,UAAU,GAAG;IAExB;;;OAGG;IACH,CAAC,KAAK,EAAE,aAAa,GAAG,SAAS,CAAC;IAElC;;;;;;;;OAQG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;;;;;;;OAQG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;;;;;;;OAQG;IACH,CAAC,CAAC,EAAE,MAAM,CAAC;IAEX;;;;;;;OAOG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;;;;;;OAOG;IACH,CAAC,CAAC,EAAE,MAAM,CAAC;IAEX;;;;;;;;OAQG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;;;;;;;;;;;OAaG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;;;;;;;;;;;;;;;OAiBG;IACH,EAAE,CAAC,EAAE,cAAc,CAAC;IAEpB;;;;;;;;;;;;;OAaG;IACH,EAAE,CAAC,EAAE,mBAAmB,CAAC;IAEzB;;;;;;OAMG;IACH,EAAE,CAAC,EAAE,cAAc,CAAC;IAEpB;;;;;;;OAOG;IACH,EAAE,CAAC,EAAE,OAAO,CAAC;IAEb;;;;;;;OAOG;IACH,CAAC,CAAC,EAAE,MAAM,CAAC;CACX,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=CmsdStatic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CmsdStatic.js","sourceRoot":"","sources":["../src/CmsdStatic.ts"],"names":[],"mappings":"","sourcesContent":["import type { CmsdCustomKey } from './CmsdCustomKey.js';\nimport type { CmsdObjectType } from './CmsdObjectType.js';\nimport type { CmsdStreamType } from './CmsdStreamType.js';\nimport type { CmsdStreamingFormat } from './CmsdStreamingFormat.js';\nimport type { CmsdValue } from './CmsdValue.js';\n\n/**\n * Common Media Server Data (CMSD) static response header fields.\n *\n * @see {@link https://cdn.cta.tech/cta/media/media/resources/standards/pdfs/cta-5006-final.pdf|CMSD Spec}\n *\n *\n * @beta\n */\nexport type CmsdStatic = {\n\n\t/**\n\t * Custom key names may be used, but they MUST carry a hyphenated prefix to ensure that there will not be a namespace collision\n\t * with future revisions to this specification. Clients SHOULD use a reverse-DNS syntax when defining their own prefix.\n\t */\n\t[index: CmsdCustomKey]: CmsdValue;\n\n\t/**\n\t * Availability time\n\t *\n\t * The wallclock time at which the first byte of this object became available at the origin for successful request. The time is\n\t * expressed as integer milliseconds since the Unix Epoch, i.e., the number of milliseconds that have elapsed since January 1,\n\t * 1970 (midnight UTC/GMT), not counting leap seconds (in ISO 8601: 1970- 01-01T00:00:000Z).\n\t *\n\t * Integer Milliseconds\n\t */\n\tat?: number;\n\n\t/**\n\t * Encoded bitrate\n\t *\n\t * The encoded bitrate of the audio or video object being requested. If the instantaneous bitrate varies over the duration of the\n\t * object, the average value over the duration of the object SHOULD be communicated. This key should only accompany objects that\n\t * have an implicit bitrate.\n\t *\n\t * Integer kbps\n\t */\n\tbr?: number;\n\n\t/**\n\t * Object duration\n\t *\n\t * The playback duration in milliseconds of the object being requested. If a partial segment is being requested, then this value\n\t * MUST indicate the playback duration of that part and not that of its parent segment. This value can be an approximation of the\n\t * estimated duration if the explicit value is not known.\n\t *\n\t * Integer milliseconds\n\t */\n\td?: number;\n\n\t/**\n\t * Held time\n\t *\n\t * The number of milliseconds that this response was held back by an origin before returning. This is applicable to blocking responses\n\t * under LL-HLS [HLSbis].\n\t *\n\t * Integer Milliseconds\n\t */\n\tht?: number;\n\n\t/**\n\t * Intermediary identifier\n\t *\n\t * An identifier for the processing server. The value SHOULD identify both the organization and the intermediary that is writing the key.\n\t * Identifiers SHOULD be as concise as possible to reduce log file and transferred size, while still remaining unique.\n\t *\n\t * String\n\t */\n\tn?: string;\n\n\t/**\n\t * Next object request\n\t *\n\t * Relative path of the next object to be requested. This can be used to trigger pre-fetching by the CDN. This MUST be a path relative to the current\n\t * request. This string MUST be URLEncoded. The client SHOULD NOT depend upon any pre-fetch action being taken - it is merely a request for such a\n\t * pre-fetch to take place.\n\t *\n\t * String\n\t */\n\tnor?: string;\n\n\t/**\n\t * Next range request\n\t *\n\t * If the next request will be a partial object request, then this string denotes the byte range to be requested. If the ‘nor’ field is not set, then the\n\t * object is assumed to match the object currently being requested. The client SHOULD NOT depend upon any pre-fetch action being taken – it is merely a\n\t * request for such a pre-fetch to take place. Formatting is similar to the HTTP Range header, except that the unit MUST be ‘byte’, the ‘Range:’ prefix is\n\t * NOT required and specifying multiple ranges is NOT allowed. Valid combinations are:\n\t *\n\t * - `\"\\<range-start\\>-\"`\n\t * - `\"\\<range-start\\>-\\<range-end\\>\"`\n\t * - `\"-\\<suffix-length\\>\"`\n\t *\n\t * String\n\t */\n\tnrr?: string;\n\n\t/**\n\t * Object type\n\t *\n\t * The media type of the current object being requested:\n\t * - `m` = text file, such as a manifest or playlist\n\t * - `a` = audio only\n\t * - `v` = video only\n\t * - `av` = muxed audio and video\n\t * - `i` = init segment\n\t * - `c` = caption or subtitle\n\t * - `tt` = ISOBMFF timed text track\n\t * - `k` = cryptographic key, license or certificate.\n\t * - `o` = other\n\t *\n\t * If the object type being requested is unknown, then this key MUST NOT be used.\n\t *\n\t * Token\n\t */\n\tot?: CmsdObjectType;\n\n\t/**\n\t * Streaming format\n\t *\n\t * The streaming format that defines the current request.\n\t *\n\t * - `d` = MPEG DASH\n\t * - `h` = HTTP Live Streaming (HLS)\n\t * - `s` = Smooth Streaming\n\t * - `o` = other\n\t *\n\t * If the streaming format being requested is unknown, then this key MUST NOT be used.\n\t *\n\t * Token\n\t */\n\tsf?: CmsdStreamingFormat;\n\n\t/**\n\t * Stream type\n\t * - `v` = all segments are available – e.g., VOD\n\t * - `l` = segments become available over time – e.g., LIVE\n\t *\n\t * Token\n\t */\n\tst?: CmsdStreamType;\n\n\t/**\n\t * Startup\n\t *\n\t * Key is included without a value if the object is needed urgently due to startup, seeking or recovery after a buffer-empty event. The media SHOULD not be\n\t * rendering when this request is made. This key MUST not be sent if it is FALSE.\n\t *\n\t * Boolean\n\t */\n\tsu?: boolean;\n\n\t/**\n\t * CMSD version\n\t *\n\t * The version of this specification used for interpreting the defined key names and values. If this key is omitted, the client and server MUST\n\t * interpret the values as being defined by version 1. Client SHOULD omit this field if the version is 1.\n\t *\n\t * Integer\n\t */\n\tv?: number;\n};\n"]}
@@ -0,0 +1,15 @@
1
+ import { CmStreamType } from '@svta/cml-cta/CmStreamType.js';
2
+ /**
3
+ * Common Media Server Data Stream Type
4
+ *
5
+ *
6
+ * @enum
7
+ *
8
+ * @beta
9
+ */
10
+ export declare const CmsdStreamType: typeof CmStreamType;
11
+ /**
12
+ * @beta
13
+ */
14
+ export type CmsdStreamType = CmStreamType;
15
+ //# sourceMappingURL=CmsdStreamType.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CmsdStreamType.d.ts","sourceRoot":"","sources":["../src/CmsdStreamType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,EAAmB,OAAO,YAAY,CAAC;AAElE;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,YAAY,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { CmStreamType } from '@svta/cml-cta/CmStreamType.js';
2
+ /**
3
+ * Common Media Server Data Stream Type
4
+ *
5
+ *
6
+ * @enum
7
+ *
8
+ * @beta
9
+ */
10
+ export const CmsdStreamType = CmStreamType;
11
+ //# sourceMappingURL=CmsdStreamType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CmsdStreamType.js","sourceRoot":"","sources":["../src/CmsdStreamType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,YAAmC,CAAC","sourcesContent":["import { CmStreamType } from '@svta/cml-cta/CmStreamType.js';\n\n/**\n * Common Media Server Data Stream Type\n *\n *\n * @enum\n *\n * @beta\n */\nexport const CmsdStreamType = CmStreamType as typeof CmStreamType;\n\n/**\n * @beta\n */\nexport type CmsdStreamType = CmStreamType;\n"]}
@@ -0,0 +1,15 @@
1
+ import { CmStreamingFormat } from '@svta/cml-cta/CmStreamingFormat.js';
2
+ /**
3
+ * Common Media Server Data Streaming Format
4
+ *
5
+ *
6
+ * @enum
7
+ *
8
+ * @beta
9
+ */
10
+ export declare const CmsdStreamingFormat: typeof CmStreamingFormat;
11
+ /**
12
+ * @beta
13
+ */
14
+ export type CmsdStreamingFormat = CmStreamingFormat;
15
+ //# sourceMappingURL=CmsdStreamingFormat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CmsdStreamingFormat.d.ts","sourceRoot":"","sources":["../src/CmsdStreamingFormat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAEvE;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,EAAwB,OAAO,iBAAiB,CAAC;AAEjF;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { CmStreamingFormat } from '@svta/cml-cta/CmStreamingFormat.js';
2
+ /**
3
+ * Common Media Server Data Streaming Format
4
+ *
5
+ *
6
+ * @enum
7
+ *
8
+ * @beta
9
+ */
10
+ export const CmsdStreamingFormat = CmStreamingFormat;
11
+ //# sourceMappingURL=CmsdStreamingFormat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CmsdStreamingFormat.js","sourceRoot":"","sources":["../src/CmsdStreamingFormat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAEvE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,iBAA6C,CAAC","sourcesContent":["import { CmStreamingFormat } from '@svta/cml-cta/CmStreamingFormat.js';\n\n/**\n * Common Media Server Data Streaming Format\n *\n *\n * @enum\n *\n * @beta\n */\nexport const CmsdStreamingFormat = CmStreamingFormat as typeof CmStreamingFormat;\n\n/**\n * @beta\n */\nexport type CmsdStreamingFormat = CmStreamingFormat;\n"]}
@@ -0,0 +1,12 @@
1
+ import type { SfToken } from '@svta/cml-structured-field-values/SfToken.js';
2
+ import type { CmsdObjectType } from './CmsdObjectType.js';
3
+ import type { CmsdStreamType } from './CmsdStreamType.js';
4
+ import type { CmsdStreamingFormat } from './CmsdStreamingFormat.js';
5
+ /**
6
+ * CMSD Value
7
+ *
8
+ *
9
+ * @beta
10
+ */
11
+ export type CmsdValue = CmsdObjectType | CmsdStreamingFormat | CmsdStreamType | string | number | boolean | symbol | SfToken;
12
+ //# sourceMappingURL=CmsdValue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CmsdValue.d.ts","sourceRoot":"","sources":["../src/CmsdValue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8CAA8C,CAAC;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEpE;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,cAAc,GAAG,mBAAmB,GAAG,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=CmsdValue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CmsdValue.js","sourceRoot":"","sources":["../src/CmsdValue.ts"],"names":[],"mappings":"","sourcesContent":["import type { SfToken } from '@svta/cml-structured-field-values/SfToken.js';\nimport type { CmsdObjectType } from './CmsdObjectType.js';\nimport type { CmsdStreamType } from './CmsdStreamType.js';\nimport type { CmsdStreamingFormat } from './CmsdStreamingFormat.js';\n\n/**\n * CMSD Value\n *\n *\n * @beta\n */\nexport type CmsdValue = CmsdObjectType | CmsdStreamingFormat | CmsdStreamType | string | number | boolean | symbol | SfToken;\n"]}
@@ -0,0 +1,13 @@
1
+ import type { CmsdDynamic } from './CmsdDynamic.js';
2
+ /**
3
+ * Decode a CMSD dynamic string to an object.
4
+ *
5
+ * @param cmsd - The CMSD string to decode.
6
+ *
7
+ * @returns The decoded CMSD object.
8
+ *
9
+ *
10
+ * @beta
11
+ */
12
+ export declare function decodeCmsdDynamic(cmsd: string): CmsdDynamic[];
13
+ //# sourceMappingURL=decodeCmsdDynamic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decodeCmsdDynamic.d.ts","sourceRoot":"","sources":["../src/decodeCmsdDynamic.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,EAAE,CAQ7D"}
@@ -0,0 +1,19 @@
1
+ import { decodeSfList } from '@svta/cml-structured-field-values/decodeSfList.js';
2
+ /**
3
+ * Decode a CMSD dynamic string to an object.
4
+ *
5
+ * @param cmsd - The CMSD string to decode.
6
+ *
7
+ * @returns The decoded CMSD object.
8
+ *
9
+ *
10
+ * @beta
11
+ */
12
+ export function decodeCmsdDynamic(cmsd) {
13
+ if (!cmsd) {
14
+ return [];
15
+ }
16
+ const sfDict = decodeSfList(cmsd);
17
+ return sfDict;
18
+ }
19
+ //# sourceMappingURL=decodeCmsdDynamic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decodeCmsdDynamic.js","sourceRoot":"","sources":["../src/decodeCmsdDynamic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mDAAmD,CAAC;AAGjF;;;;;;;;;GASG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC7C,IAAI,CAAC,IAAI,EAAE,CAAC;QACX,OAAO,EAAE,CAAC;IACX,CAAC;IAED,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IAElC,OAAO,MAAuB,CAAC;AAChC,CAAC","sourcesContent":["import { decodeSfList } from '@svta/cml-structured-field-values/decodeSfList.js';\nimport type { CmsdDynamic } from './CmsdDynamic.js';\n\n/**\n * Decode a CMSD dynamic string to an object.\n *\n * @param cmsd - The CMSD string to decode.\n *\n * @returns The decoded CMSD object.\n *\n *\n * @beta\n */\nexport function decodeCmsdDynamic(cmsd: string): CmsdDynamic[] {\n\tif (!cmsd) {\n\t\treturn [];\n\t}\n\n\tconst sfDict = decodeSfList(cmsd);\n\n\treturn sfDict as CmsdDynamic[];\n}\n"]}
@@ -0,0 +1,13 @@
1
+ import type { CmsdStatic } from './CmsdStatic.js';
2
+ /**
3
+ * Decode a CMSD Static dict string to an object.
4
+ *
5
+ * @param cmsd - The CMSD string to decode.
6
+ *
7
+ * @returns The decoded CMSD object.
8
+ *
9
+ *
10
+ * @beta
11
+ */
12
+ export declare function decodeCmsdStatic(cmsd: string): CmsdStatic;
13
+ //# sourceMappingURL=decodeCmsdStatic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decodeCmsdStatic.d.ts","sourceRoot":"","sources":["../src/decodeCmsdStatic.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAYzD"}
@@ -0,0 +1,25 @@
1
+ import { decodeSfDict } from '@svta/cml-structured-field-values/decodeSfDict.js';
2
+ import { symbolToStr } from '@svta/cml-structured-field-values/utils/symbolToStr.js';
3
+ /**
4
+ * Decode a CMSD Static dict string to an object.
5
+ *
6
+ * @param cmsd - The CMSD string to decode.
7
+ *
8
+ * @returns The decoded CMSD object.
9
+ *
10
+ *
11
+ * @beta
12
+ */
13
+ export function decodeCmsdStatic(cmsd) {
14
+ if (!cmsd) {
15
+ return {};
16
+ }
17
+ return Object
18
+ .entries(decodeSfDict(cmsd))
19
+ .reduce((acc, [key, item]) => {
20
+ const { value } = item;
21
+ acc[key] = (typeof value === 'symbol' ? symbolToStr(value) : value);
22
+ return acc;
23
+ }, {});
24
+ }
25
+ //# sourceMappingURL=decodeCmsdStatic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decodeCmsdStatic.js","sourceRoot":"","sources":["../src/decodeCmsdStatic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mDAAmD,CAAC;AACjF,OAAO,EAAE,WAAW,EAAE,MAAM,wDAAwD,CAAC;AAGrF;;;;;;;;;GASG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC5C,IAAI,CAAC,IAAI,EAAE,CAAC;QACX,OAAO,EAAE,CAAC;IACX,CAAC;IAED,OAAO,MAAM;SACX,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;SAC3B,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE;QAC5B,MAAM,EAAE,KAAK,EAAE,GAAQ,IAAI,CAAC;QAC5B,GAAG,CAAC,GAAU,CAAC,GAAG,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAQ,CAAC;QAClF,OAAO,GAAG,CAAC;IACZ,CAAC,EAAE,EAAgB,CAAC,CAAC;AACvB,CAAC","sourcesContent":["import { decodeSfDict } from '@svta/cml-structured-field-values/decodeSfDict.js';\nimport { symbolToStr } from '@svta/cml-structured-field-values/utils/symbolToStr.js';\nimport type { CmsdStatic } from './CmsdStatic.js';\n\n/**\n * Decode a CMSD Static dict string to an object.\n *\n * @param cmsd - The CMSD string to decode.\n *\n * @returns The decoded CMSD object.\n *\n *\n * @beta\n */\nexport function decodeCmsdStatic(cmsd: string): CmsdStatic {\n\tif (!cmsd) {\n\t\treturn {};\n\t}\n\n\treturn Object\n\t\t.entries(decodeSfDict(cmsd))\n\t\t.reduce((acc, [key, item]) => {\n\t\t\tconst { value }: any = item;\n\t\t\tacc[key as any] = (typeof value === 'symbol' ? symbolToStr(value) : value) as any;\n\t\t\treturn acc;\n\t\t}, {} as CmsdStatic);\n}\n"]}
@@ -0,0 +1,26 @@
1
+ import { SfItem } from '@svta/cml-structured-field-values/SfItem.js';
2
+ import type { CmsdDynamic } from './CmsdDynamic.js';
3
+ /**
4
+ * Encode a list of CMSD Dynamic objects.
5
+ *
6
+ * @param value - The list of `SfItems` to encode.
7
+ *
8
+ * @returns The encoded CMSD string.
9
+ *
10
+ *
11
+ * @beta
12
+ */
13
+ export declare function encodeCmsdDynamic(value: SfItem[]): string;
14
+ /**
15
+ * Encode a single CMSD Dynamic object.
16
+ *
17
+ * @param value - The server name
18
+ * @param cmsd - The CMSD object to encode.
19
+ *
20
+ * @returns The encoded CMSD string.
21
+ *
22
+ *
23
+ * @beta
24
+ */
25
+ export declare function encodeCmsdDynamic(value: string, cmsd: CmsdDynamic): string;
26
+ //# sourceMappingURL=encodeCmsdDynamic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encodeCmsdDynamic.d.ts","sourceRoot":"","sources":["../src/encodeCmsdDynamic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,6CAA6C,CAAC;AAErE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;AAE3D;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,MAAM,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { SfItem } from '@svta/cml-structured-field-values/SfItem.js';
2
+ import { encodeSfList } from '@svta/cml-structured-field-values/encodeSfList.js';
3
+ export function encodeCmsdDynamic(value, cmsd) {
4
+ if (!value) {
5
+ return '';
6
+ }
7
+ if (typeof value === 'string') {
8
+ if (!cmsd) {
9
+ return '';
10
+ }
11
+ value = [new SfItem(value, cmsd)];
12
+ }
13
+ return encodeSfList(value, { whitespace: false });
14
+ }
15
+ //# sourceMappingURL=encodeCmsdDynamic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encodeCmsdDynamic.js","sourceRoot":"","sources":["../src/encodeCmsdDynamic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,6CAA6C,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,mDAAmD,CAAC;AA4BjF,MAAM,UAAU,iBAAiB,CAAC,KAAwB,EAAE,IAAkB;IAC7E,IAAI,CAAC,KAAK,EAAE,CAAC;QACZ,OAAO,EAAE,CAAC;IACX,CAAC;IAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC/B,IAAI,CAAC,IAAI,EAAE,CAAC;YACX,OAAO,EAAE,CAAC;QACX,CAAC;QAED,KAAK,GAAG,CAAC,IAAI,MAAM,CAAC,KAAK,EAAE,IAAW,CAAC,CAAC,CAAC;IAC1C,CAAC;IAED,OAAO,YAAY,CAAC,KAAK,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;AACnD,CAAC","sourcesContent":["import { SfItem } from '@svta/cml-structured-field-values/SfItem.js';\nimport { encodeSfList } from '@svta/cml-structured-field-values/encodeSfList.js';\nimport type { CmsdDynamic } from './CmsdDynamic.js';\n\n/**\n * Encode a list of CMSD Dynamic objects.\n *\n * @param value - The list of `SfItems` to encode.\n *\n * @returns The encoded CMSD string.\n *\n *\n * @beta\n */\nexport function encodeCmsdDynamic(value: SfItem[]): string;\n\n/**\n * Encode a single CMSD Dynamic object.\n *\n * @param value - The server name\n * @param cmsd - The CMSD object to encode.\n *\n * @returns The encoded CMSD string.\n *\n *\n * @beta\n */\nexport function encodeCmsdDynamic(value: string, cmsd: CmsdDynamic): string;\n\nexport function encodeCmsdDynamic(value: string | SfItem[], cmsd?: CmsdDynamic): string {\n\tif (!value) {\n\t\treturn '';\n\t}\n\n\tif (typeof value === 'string') {\n\t\tif (!cmsd) {\n\t\t\treturn '';\n\t\t}\n\n\t\tvalue = [new SfItem(value, cmsd as any)];\n\t}\n\n\treturn encodeSfList(value, { whitespace: false });\n}\n"]}
@@ -0,0 +1,15 @@
1
+ import type { CmsdEncodeOptions } from './CmsdEncodeOptions.js';
2
+ import type { CmsdStatic } from './CmsdStatic.js';
3
+ /**
4
+ * Encode a CMSD Static object.
5
+ *
6
+ * @param cmsd - The CMSD object to encode.
7
+ * @param options - Encoding options
8
+ *
9
+ * @returns The encoded CMSD string.
10
+ *
11
+ *
12
+ * @beta
13
+ */
14
+ export declare function encodeCmsdStatic(cmsd: CmsdStatic, options?: CmsdEncodeOptions): string;
15
+ //# sourceMappingURL=encodeCmsdStatic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encodeCmsdStatic.d.ts","sourceRoot":"","sources":["../src/encodeCmsdStatic.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGlD;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,MAAM,CAMtF"}
@@ -0,0 +1,20 @@
1
+ import { encodeSfDict } from '@svta/cml-structured-field-values/encodeSfDict.js';
2
+ import { processCmsd } from './utils/processCmsd.js';
3
+ /**
4
+ * Encode a CMSD Static object.
5
+ *
6
+ * @param cmsd - The CMSD object to encode.
7
+ * @param options - Encoding options
8
+ *
9
+ * @returns The encoded CMSD string.
10
+ *
11
+ *
12
+ * @beta
13
+ */
14
+ export function encodeCmsdStatic(cmsd, options) {
15
+ if (!cmsd) {
16
+ return '';
17
+ }
18
+ return encodeSfDict(processCmsd(cmsd, options), { whitespace: false });
19
+ }
20
+ //# sourceMappingURL=encodeCmsdStatic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encodeCmsdStatic.js","sourceRoot":"","sources":["../src/encodeCmsdStatic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mDAAmD,CAAC;AAGjF,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAgB,EAAE,OAA2B;IAC7E,IAAI,CAAC,IAAI,EAAE,CAAC;QACX,OAAO,EAAE,CAAC;IACX,CAAC;IAED,OAAO,YAAY,CAAC,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;AACxE,CAAC","sourcesContent":["import { encodeSfDict } from '@svta/cml-structured-field-values/encodeSfDict.js';\nimport type { CmsdEncodeOptions } from './CmsdEncodeOptions.js';\nimport type { CmsdStatic } from './CmsdStatic.js';\nimport { processCmsd } from './utils/processCmsd.js';\n\n/**\n * Encode a CMSD Static object.\n *\n * @param cmsd - The CMSD object to encode.\n * @param options - Encoding options\n *\n * @returns The encoded CMSD string.\n *\n *\n * @beta\n */\nexport function encodeCmsdStatic(cmsd: CmsdStatic, options?: CmsdEncodeOptions): string {\n\tif (!cmsd) {\n\t\treturn '';\n\t}\n\n\treturn encodeSfDict(processCmsd(cmsd, options), { whitespace: false });\n}\n"]}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * A collection of tools for working with Common Media Server Data (CMSD).
3
+ *
4
+ * @packageDocumentation
5
+ */
6
+ export * from './CMSD_DYNAMIC.js';
7
+ export * from './CMSD_STATIC.js';
8
+ export * from './CMSD_V1.js';
9
+ export type * from './CmsdCustomKey.js';
10
+ export type * from './CmsdDynamic.js';
11
+ export type * from './CmsdDynamicParams.js';
12
+ export type * from './CmsdEncodeOptions.js';
13
+ export * from './CmsdHeaderField.js';
14
+ export * from './CmsdObjectType.js';
15
+ export type * from './CmsdStatic.js';
16
+ export * from './CmsdStreamingFormat.js';
17
+ export * from './CmsdStreamType.js';
18
+ export type * from './CmsdValue.js';
19
+ export * from './decodeCmsdDynamic.js';
20
+ export * from './decodeCmsdStatic.js';
21
+ export * from './encodeCmsdDynamic.js';
22
+ export * from './encodeCmsdStatic.js';
23
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,mBAAmB,oBAAoB,CAAC;AACxC,mBAAmB,kBAAkB,CAAC;AACtC,mBAAmB,wBAAwB,CAAC;AAC5C,mBAAmB,wBAAwB,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,mBAAmB,iBAAiB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,mBAAmB,gBAAgB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,17 @@
1
+ /**
2
+ * A collection of tools for working with Common Media Server Data (CMSD).
3
+ *
4
+ * @packageDocumentation
5
+ */
6
+ export * from './CMSD_DYNAMIC.js';
7
+ export * from './CMSD_STATIC.js';
8
+ export * from './CMSD_V1.js';
9
+ export * from './CmsdHeaderField.js';
10
+ export * from './CmsdObjectType.js';
11
+ export * from './CmsdStreamingFormat.js';
12
+ export * from './CmsdStreamType.js';
13
+ export * from './decodeCmsdDynamic.js';
14
+ export * from './decodeCmsdStatic.js';
15
+ export * from './encodeCmsdDynamic.js';
16
+ export * from './encodeCmsdStatic.js';
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAK7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AAEpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AAEpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC","sourcesContent":["/**\n * A collection of tools for working with Common Media Server Data (CMSD).\n *\n * @packageDocumentation\n */\nexport * from './CMSD_DYNAMIC.js';\nexport * from './CMSD_STATIC.js';\nexport * from './CMSD_V1.js';\nexport type * from './CmsdCustomKey.js';\nexport type * from './CmsdDynamic.js';\nexport type * from './CmsdDynamicParams.js';\nexport type * from './CmsdEncodeOptions.js';\nexport * from './CmsdHeaderField.js';\nexport * from './CmsdObjectType.js';\nexport type * from './CmsdStatic.js';\nexport * from './CmsdStreamingFormat.js';\nexport * from './CmsdStreamType.js';\nexport type * from './CmsdValue.js';\nexport * from './decodeCmsdDynamic.js';\nexport * from './decodeCmsdStatic.js';\nexport * from './encodeCmsdDynamic.js';\nexport * from './encodeCmsdStatic.js';\n"]}