@tomgiee/tsdp 1.0.1 → 1.1.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 (68) hide show
  1. package/README.md +0 -39
  2. package/dist/src/builder/media-builder.d.ts.map +1 -1
  3. package/dist/src/builder/media-builder.js +5 -12
  4. package/dist/src/builder/session-builder.d.ts.map +1 -1
  5. package/dist/src/builder/session-builder.js +4 -14
  6. package/dist/src/index.d.ts +6 -10
  7. package/dist/src/index.d.ts.map +1 -1
  8. package/dist/src/index.js +37 -49
  9. package/dist/src/parser/core.d.ts +366 -0
  10. package/dist/src/parser/core.d.ts.map +1 -0
  11. package/dist/src/parser/core.js +802 -0
  12. package/dist/src/parser/field-parser.d.ts +51 -8
  13. package/dist/src/parser/field-parser.d.ts.map +1 -1
  14. package/dist/src/parser/field-parser.js +91 -23
  15. package/dist/src/parser/media-parser.d.ts +1 -1
  16. package/dist/src/parser/media-parser.d.ts.map +1 -1
  17. package/dist/src/parser/media-parser.js +9 -15
  18. package/dist/src/parser/session-parser.d.ts.map +1 -1
  19. package/dist/src/parser/session-parser.js +16 -17
  20. package/dist/src/parser/time-parser.d.ts +1 -1
  21. package/dist/src/parser/time-parser.d.ts.map +1 -1
  22. package/dist/src/parser/time-parser.js +8 -8
  23. package/dist/src/serializer/fields.d.ts +167 -0
  24. package/dist/src/serializer/fields.d.ts.map +1 -0
  25. package/dist/src/serializer/fields.js +320 -0
  26. package/dist/src/serializer/media-serializer.js +6 -7
  27. package/dist/src/serializer/session-serializer.js +13 -15
  28. package/dist/src/types/attributes.d.ts.map +1 -1
  29. package/dist/src/types/fields.d.ts +5 -5
  30. package/dist/src/types/fields.d.ts.map +1 -1
  31. package/dist/src/types/fields.js +4 -4
  32. package/dist/src/types/media.d.ts +9 -10
  33. package/dist/src/types/media.d.ts.map +1 -1
  34. package/dist/src/types/media.js +2 -4
  35. package/dist/src/types/network.d.ts +15 -56
  36. package/dist/src/types/network.d.ts.map +1 -1
  37. package/dist/src/types/network.js +3 -34
  38. package/dist/src/types/primitives.d.ts +3 -147
  39. package/dist/src/types/primitives.d.ts.map +1 -1
  40. package/dist/src/types/primitives.js +2 -171
  41. package/dist/src/types/session.d.ts +14 -14
  42. package/dist/src/types/session.d.ts.map +1 -1
  43. package/dist/src/types/time.d.ts +4 -4
  44. package/dist/src/types/time.d.ts.map +1 -1
  45. package/dist/src/types/time.js +8 -6
  46. package/dist/src/utils/address-parser.d.ts +4 -4
  47. package/dist/src/utils/address-parser.d.ts.map +1 -1
  48. package/dist/src/utils/address-parser.js +9 -16
  49. package/dist/src/validator/validator.d.ts +94 -0
  50. package/dist/src/validator/validator.d.ts.map +1 -0
  51. package/dist/src/validator/validator.js +573 -0
  52. package/dist/tests/unit/parser/attribute-parser.test.js +106 -107
  53. package/dist/tests/unit/parser/field-parser.test.js +66 -66
  54. package/dist/tests/unit/parser/media-parser.test.js +38 -38
  55. package/dist/tests/unit/parser/primitive-parser.test.js +89 -90
  56. package/dist/tests/unit/parser/scanner.test.js +32 -32
  57. package/dist/tests/unit/parser/time-parser.test.js +22 -22
  58. package/dist/tests/unit/serializer/attribute-serializer.test.js +22 -22
  59. package/dist/tests/unit/serializer/field-serializer.test.js +57 -57
  60. package/dist/tests/unit/serializer/media-serializer.test.js +5 -6
  61. package/dist/tests/unit/serializer/session-serializer.test.js +24 -24
  62. package/dist/tests/unit/serializer/time-serializer.test.js +16 -16
  63. package/dist/tests/unit/types/network.test.js +21 -56
  64. package/dist/tests/unit/types/primitives.test.js +0 -39
  65. package/dist/tests/unit/validator/media-validator.test.js +34 -35
  66. package/dist/tests/unit/validator/semantic-validator.test.js +36 -37
  67. package/dist/tests/unit/validator/session-validator.test.js +54 -54
  68. package/package.json +1 -1
@@ -0,0 +1,167 @@
1
+ /**
2
+ * Field, attribute, and time serializers for SDP (RFC 8866)
3
+ *
4
+ * This module consolidates serializers for:
5
+ * - Individual field types (v=, o=, s=, i=, u=, e=, p=, c=, b=, k=)
6
+ * - Attributes (a= fields)
7
+ * - Time descriptions (t=, r=, z=)
8
+ */
9
+ import { Version } from '../types/primitives';
10
+ import { Bandwidth, Connection, Origin } from '../types/fields';
11
+ import { ConnectionAddress } from '../types/network';
12
+ import { Attribute } from '../types/attributes';
13
+ import { Repeat, TimeDescription, Timezone, Timing } from '../types/time';
14
+ /**
15
+ * Serialize version field
16
+ *
17
+ * Format: v=0
18
+ *
19
+ * @param version - Version number
20
+ * @returns Serialized version line (without line ending)
21
+ */
22
+ export declare function serializeVersionField(version: Version): string;
23
+ /**
24
+ * Serialize origin field
25
+ *
26
+ * Format: o=<username> <sess-id> <sess-version> <nettype> <addrtype> <unicast-address>
27
+ *
28
+ * @param origin - Origin object
29
+ * @returns Serialized origin line (without line ending)
30
+ */
31
+ export declare function serializeOriginField(origin: Origin): string;
32
+ /**
33
+ * Serialize session name field
34
+ *
35
+ * Format: s=<session name>
36
+ *
37
+ * @param sessionName - Session name
38
+ * @returns Serialized session name line (without line ending)
39
+ */
40
+ export declare function serializeSessionNameField(sessionName: string): string;
41
+ /**
42
+ * Serialize information field
43
+ *
44
+ * Format: i=<session information>
45
+ *
46
+ * @param information - Information string
47
+ * @returns Serialized information line (without line ending)
48
+ */
49
+ export declare function serializeInformationField(information: string): string;
50
+ /**
51
+ * Serialize URI field
52
+ *
53
+ * Format: u=<uri>
54
+ *
55
+ * @param uri - URI string
56
+ * @returns Serialized URI line (without line ending)
57
+ */
58
+ export declare function serializeUriField(uri: string): string;
59
+ /**
60
+ * Serialize email field
61
+ *
62
+ * Format: e=<email-address>
63
+ *
64
+ * @param email - Email string
65
+ * @returns Serialized email line (without line ending)
66
+ */
67
+ export declare function serializeEmailField(email: string): string;
68
+ /**
69
+ * Serialize phone field
70
+ *
71
+ * Format: p=<phone-number>
72
+ *
73
+ * @param phone - Phone string
74
+ * @returns Serialized phone line (without line ending)
75
+ */
76
+ export declare function serializePhoneField(phone: string): string;
77
+ /**
78
+ * Serialize connection field
79
+ *
80
+ * Format: c=<nettype> <addrtype> <connection-address>
81
+ *
82
+ * Connection address formats:
83
+ * - Unicast: <address>
84
+ * - IPv4 multicast: <address>/<ttl>[/<numAddresses>]
85
+ * - IPv6 multicast: <address>[/<numAddresses>]
86
+ * - FQDN multicast: <address>[/<ttl>][/<numAddresses>]
87
+ *
88
+ * @param connection - Connection object
89
+ * @returns Serialized connection line (without line ending)
90
+ */
91
+ export declare function serializeConnectionField(connection: Connection): string;
92
+ /**
93
+ * Serialize connection address (unicast or multicast)
94
+ *
95
+ * @param address - Connection address
96
+ * @returns Serialized address string
97
+ */
98
+ export declare function serializeConnectionAddress(address: ConnectionAddress): string;
99
+ /**
100
+ * Serialize bandwidth field
101
+ *
102
+ * Format: b=<bwtype>:<bandwidth>
103
+ *
104
+ * @param bandwidth - Bandwidth object
105
+ * @returns Serialized bandwidth line (without line ending)
106
+ */
107
+ export declare function serializeBandwidthField(bandwidth: Bandwidth): string;
108
+ /**
109
+ * Serialize key field (OBSOLETE per RFC 8866)
110
+ *
111
+ * Format: k=<method>:<key> or k=<method>
112
+ *
113
+ * @param key - Key string
114
+ * @returns Serialized key line (without line ending)
115
+ */
116
+ export declare function serializeKeyField(key: string): string;
117
+ /**
118
+ * Serialize attribute field
119
+ *
120
+ * Formats:
121
+ * - Property attribute: a=<attribute-name>
122
+ * - Value attribute: a=<attribute-name>:<attribute-value>
123
+ *
124
+ * @param attr - Attribute object
125
+ * @returns Serialized attribute line (without line ending)
126
+ */
127
+ export declare function serializeAttributeField(attr: Attribute): string;
128
+ /**
129
+ * Serialize timing field
130
+ *
131
+ * Format: t=<start-time> <stop-time>
132
+ *
133
+ * @param timing - Timing object
134
+ * @returns Serialized timing line (without line ending)
135
+ */
136
+ export declare function serializeTimingField(timing: Timing): string;
137
+ /**
138
+ * Serialize repeat field
139
+ *
140
+ * Format: r=<repeat-interval> <active-duration> <offsets-from-start-time>
141
+ *
142
+ * @param repeat - Repeat object
143
+ * @returns Serialized repeat line (without line ending)
144
+ */
145
+ export declare function serializeRepeatField(repeat: Repeat): string;
146
+ /**
147
+ * Serialize timezone field
148
+ *
149
+ * Format: z=<adjustment-time> <offset> [<adjustment-time> <offset> ...]
150
+ *
151
+ * @param timezone - Timezone object
152
+ * @returns Serialized timezone line (without line ending)
153
+ */
154
+ export declare function serializeTimezoneField(timezone: Timezone): string;
155
+ /**
156
+ * Serialize a complete time description
157
+ *
158
+ * Outputs:
159
+ * - One t= line
160
+ * - Zero or more r= lines
161
+ * - Zero or one z= line
162
+ *
163
+ * @param td - TimeDescription object
164
+ * @returns Array of serialized lines (without line endings)
165
+ */
166
+ export declare function serializeTimeDescription(td: TimeDescription): string[];
167
+ //# sourceMappingURL=fields.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../../../src/serializer/fields.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAC,OAAO,EAAC,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAC,SAAS,EAAE,UAAU,EAAE,MAAM,EAAC,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EACL,iBAAiB,EAKlB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAC,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,EAAC,MAAM,eAAe,CAAC;AAOxE;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAE9D;AAMD;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAE3D;AAMD;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAErE;AAMD;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAErE;AAMD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAErD;AAMD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEzD;AAMD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEzD;AAMD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAGvE;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,CA0C7E;AAMD;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAEpE;AAMD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAErD;AAMD;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAW/D;AAMD;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAE3D;AAMD;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAM3D;AAMD;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAMjE;AAMD;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,eAAe,GAAG,MAAM,EAAE,CAiBtE"}
@@ -0,0 +1,320 @@
1
+ "use strict";
2
+ /**
3
+ * Field, attribute, and time serializers for SDP (RFC 8866)
4
+ *
5
+ * This module consolidates serializers for:
6
+ * - Individual field types (v=, o=, s=, i=, u=, e=, p=, c=, b=, k=)
7
+ * - Attributes (a= fields)
8
+ * - Time descriptions (t=, r=, z=)
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.serializeVersionField = serializeVersionField;
12
+ exports.serializeOriginField = serializeOriginField;
13
+ exports.serializeSessionNameField = serializeSessionNameField;
14
+ exports.serializeInformationField = serializeInformationField;
15
+ exports.serializeUriField = serializeUriField;
16
+ exports.serializeEmailField = serializeEmailField;
17
+ exports.serializePhoneField = serializePhoneField;
18
+ exports.serializeConnectionField = serializeConnectionField;
19
+ exports.serializeConnectionAddress = serializeConnectionAddress;
20
+ exports.serializeBandwidthField = serializeBandwidthField;
21
+ exports.serializeKeyField = serializeKeyField;
22
+ exports.serializeAttributeField = serializeAttributeField;
23
+ exports.serializeTimingField = serializeTimingField;
24
+ exports.serializeRepeatField = serializeRepeatField;
25
+ exports.serializeTimezoneField = serializeTimezoneField;
26
+ exports.serializeTimeDescription = serializeTimeDescription;
27
+ const network_1 = require("../types/network");
28
+ const time_converter_1 = require("../utils/time-converter");
29
+ // ============================================================================
30
+ // Version Field Serializer (v=)
31
+ // ============================================================================
32
+ /**
33
+ * Serialize version field
34
+ *
35
+ * Format: v=0
36
+ *
37
+ * @param version - Version number
38
+ * @returns Serialized version line (without line ending)
39
+ */
40
+ function serializeVersionField(version) {
41
+ return `v=${version}`;
42
+ }
43
+ // ============================================================================
44
+ // Origin Field Serializer (o=)
45
+ // ============================================================================
46
+ /**
47
+ * Serialize origin field
48
+ *
49
+ * Format: o=<username> <sess-id> <sess-version> <nettype> <addrtype> <unicast-address>
50
+ *
51
+ * @param origin - Origin object
52
+ * @returns Serialized origin line (without line ending)
53
+ */
54
+ function serializeOriginField(origin) {
55
+ return `o=${origin.username} ${origin.sessId} ${origin.sessVersion} ${origin.netType} ${origin.addrType} ${origin.unicastAddress}`;
56
+ }
57
+ // ============================================================================
58
+ // Session Name Field Serializer (s=)
59
+ // ============================================================================
60
+ /**
61
+ * Serialize session name field
62
+ *
63
+ * Format: s=<session name>
64
+ *
65
+ * @param sessionName - Session name
66
+ * @returns Serialized session name line (without line ending)
67
+ */
68
+ function serializeSessionNameField(sessionName) {
69
+ return `s=${sessionName}`;
70
+ }
71
+ // ============================================================================
72
+ // Information Field Serializer (i=)
73
+ // ============================================================================
74
+ /**
75
+ * Serialize information field
76
+ *
77
+ * Format: i=<session information>
78
+ *
79
+ * @param information - Information string
80
+ * @returns Serialized information line (without line ending)
81
+ */
82
+ function serializeInformationField(information) {
83
+ return `i=${information}`;
84
+ }
85
+ // ============================================================================
86
+ // URI Field Serializer (u=)
87
+ // ============================================================================
88
+ /**
89
+ * Serialize URI field
90
+ *
91
+ * Format: u=<uri>
92
+ *
93
+ * @param uri - URI string
94
+ * @returns Serialized URI line (without line ending)
95
+ */
96
+ function serializeUriField(uri) {
97
+ return `u=${uri}`;
98
+ }
99
+ // ============================================================================
100
+ // Email Field Serializer (e=)
101
+ // ============================================================================
102
+ /**
103
+ * Serialize email field
104
+ *
105
+ * Format: e=<email-address>
106
+ *
107
+ * @param email - Email string
108
+ * @returns Serialized email line (without line ending)
109
+ */
110
+ function serializeEmailField(email) {
111
+ return `e=${email}`;
112
+ }
113
+ // ============================================================================
114
+ // Phone Field Serializer (p=)
115
+ // ============================================================================
116
+ /**
117
+ * Serialize phone field
118
+ *
119
+ * Format: p=<phone-number>
120
+ *
121
+ * @param phone - Phone string
122
+ * @returns Serialized phone line (without line ending)
123
+ */
124
+ function serializePhoneField(phone) {
125
+ return `p=${phone}`;
126
+ }
127
+ // ============================================================================
128
+ // Connection Field Serializer (c=)
129
+ // ============================================================================
130
+ /**
131
+ * Serialize connection field
132
+ *
133
+ * Format: c=<nettype> <addrtype> <connection-address>
134
+ *
135
+ * Connection address formats:
136
+ * - Unicast: <address>
137
+ * - IPv4 multicast: <address>/<ttl>[/<numAddresses>]
138
+ * - IPv6 multicast: <address>[/<numAddresses>]
139
+ * - FQDN multicast: <address>[/<ttl>][/<numAddresses>]
140
+ *
141
+ * @param connection - Connection object
142
+ * @returns Serialized connection line (without line ending)
143
+ */
144
+ function serializeConnectionField(connection) {
145
+ const addressStr = serializeConnectionAddress(connection.connectionAddress);
146
+ return `c=${connection.netType} ${connection.addrType} ${addressStr}`;
147
+ }
148
+ /**
149
+ * Serialize connection address (unicast or multicast)
150
+ *
151
+ * @param address - Connection address
152
+ * @returns Serialized address string
153
+ */
154
+ function serializeConnectionAddress(address) {
155
+ if (!(0, network_1.isMulticastAddress)(address)) {
156
+ // Unicast address - just the address string
157
+ return address;
158
+ }
159
+ // Multicast address
160
+ if ((0, network_1.isIP4MulticastAddress)(address)) {
161
+ // IPv4 multicast: <address>/<ttl>[/<numAddresses>]
162
+ let result = `${address.address}/${address.ttl}`;
163
+ if (address.numAddresses !== undefined) {
164
+ result += `/${address.numAddresses}`;
165
+ }
166
+ return result;
167
+ }
168
+ if ((0, network_1.isIP6MulticastAddress)(address)) {
169
+ // IPv6 multicast: <address>[/<numAddresses>]
170
+ if (address.numAddresses !== undefined) {
171
+ return `${address.address}/${address.numAddresses}`;
172
+ }
173
+ return address.address;
174
+ }
175
+ if ((0, network_1.isFQDNMulticastAddress)(address)) {
176
+ // FQDN multicast: <address>[/<ttl>][/<numAddresses>]
177
+ let result = address.address;
178
+ if (address.ttl !== undefined) {
179
+ result += `/${address.ttl}`;
180
+ if (address.numAddresses !== undefined) {
181
+ result += `/${address.numAddresses}`;
182
+ }
183
+ }
184
+ else if (address.numAddresses !== undefined) {
185
+ // numAddresses without TTL - this is unusual but handle it
186
+ result += `/${address.numAddresses}`;
187
+ }
188
+ return result;
189
+ }
190
+ // Exhaustive check - this should never be reached
191
+ const _exhaustive = address;
192
+ return _exhaustive;
193
+ }
194
+ // ============================================================================
195
+ // Bandwidth Field Serializer (b=)
196
+ // ============================================================================
197
+ /**
198
+ * Serialize bandwidth field
199
+ *
200
+ * Format: b=<bwtype>:<bandwidth>
201
+ *
202
+ * @param bandwidth - Bandwidth object
203
+ * @returns Serialized bandwidth line (without line ending)
204
+ */
205
+ function serializeBandwidthField(bandwidth) {
206
+ return `b=${bandwidth.type}:${bandwidth.value}`;
207
+ }
208
+ // ============================================================================
209
+ // Key Field Serializer (k=)
210
+ // ============================================================================
211
+ /**
212
+ * Serialize key field (OBSOLETE per RFC 8866)
213
+ *
214
+ * Format: k=<method>:<key> or k=<method>
215
+ *
216
+ * @param key - Key string
217
+ * @returns Serialized key line (without line ending)
218
+ */
219
+ function serializeKeyField(key) {
220
+ return `k=${key}`;
221
+ }
222
+ // ============================================================================
223
+ // Attribute Field Serializer (a=)
224
+ // ============================================================================
225
+ /**
226
+ * Serialize attribute field
227
+ *
228
+ * Formats:
229
+ * - Property attribute: a=<attribute-name>
230
+ * - Value attribute: a=<attribute-name>:<attribute-value>
231
+ *
232
+ * @param attr - Attribute object
233
+ * @returns Serialized attribute line (without line ending)
234
+ */
235
+ function serializeAttributeField(attr) {
236
+ switch (attr.kind) {
237
+ case 'property':
238
+ return `a=${attr.name}`;
239
+ case 'value':
240
+ return `a=${attr.name}:${attr.value}`;
241
+ default: {
242
+ // Exhaustive check - ensures all cases are handled
243
+ return attr;
244
+ }
245
+ }
246
+ }
247
+ // ============================================================================
248
+ // Timing Field Serializer (t=)
249
+ // ============================================================================
250
+ /**
251
+ * Serialize timing field
252
+ *
253
+ * Format: t=<start-time> <stop-time>
254
+ *
255
+ * @param timing - Timing object
256
+ * @returns Serialized timing line (without line ending)
257
+ */
258
+ function serializeTimingField(timing) {
259
+ return `t=${timing.startTime} ${timing.stopTime}`;
260
+ }
261
+ // ============================================================================
262
+ // Repeat Field Serializer (r=)
263
+ // ============================================================================
264
+ /**
265
+ * Serialize repeat field
266
+ *
267
+ * Format: r=<repeat-interval> <active-duration> <offsets-from-start-time>
268
+ *
269
+ * @param repeat - Repeat object
270
+ * @returns Serialized repeat line (without line ending)
271
+ */
272
+ function serializeRepeatField(repeat) {
273
+ const interval = (0, time_converter_1.serializeTypedTime)(repeat.interval);
274
+ const duration = (0, time_converter_1.serializeTypedTime)(repeat.duration);
275
+ const offsets = repeat.offsets.map(time_converter_1.serializeTypedTime).join(' ');
276
+ return `r=${interval} ${duration} ${offsets}`;
277
+ }
278
+ // ============================================================================
279
+ // Timezone Field Serializer (z=)
280
+ // ============================================================================
281
+ /**
282
+ * Serialize timezone field
283
+ *
284
+ * Format: z=<adjustment-time> <offset> [<adjustment-time> <offset> ...]
285
+ *
286
+ * @param timezone - Timezone object
287
+ * @returns Serialized timezone line (without line ending)
288
+ */
289
+ function serializeTimezoneField(timezone) {
290
+ const pairs = timezone.adjustments.map((adj) => `${adj.time} ${(0, time_converter_1.serializeTypedTime)(adj.offset)}`);
291
+ return `z=${pairs.join(' ')}`;
292
+ }
293
+ // ============================================================================
294
+ // Time Description Serializer
295
+ // ============================================================================
296
+ /**
297
+ * Serialize a complete time description
298
+ *
299
+ * Outputs:
300
+ * - One t= line
301
+ * - Zero or more r= lines
302
+ * - Zero or one z= line
303
+ *
304
+ * @param td - TimeDescription object
305
+ * @returns Array of serialized lines (without line endings)
306
+ */
307
+ function serializeTimeDescription(td) {
308
+ const lines = [];
309
+ // t= timing (required)
310
+ lines.push(serializeTimingField(td.timing));
311
+ // r= repeat times (optional, multiple)
312
+ for (const repeat of td.repeats) {
313
+ lines.push(serializeRepeatField(repeat));
314
+ }
315
+ // z= timezone (optional, at most one)
316
+ if (td.timezone) {
317
+ lines.push(serializeTimezoneField(td.timezone));
318
+ }
319
+ return lines;
320
+ }
@@ -8,8 +8,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.serializeMediaField = serializeMediaField;
9
9
  exports.serializeMediaDescription = serializeMediaDescription;
10
10
  const media_1 = require("../types/media");
11
- const field_serializer_1 = require("./field-serializer");
12
- const attribute_serializer_1 = require("./attribute-serializer");
11
+ const fields_1 = require("./fields");
13
12
  // ============================================================================
14
13
  // Media Field Serializer (m=)
15
14
  // ============================================================================
@@ -61,23 +60,23 @@ function serializeMediaDescription(md) {
61
60
  lines.push(serializeMediaField(md.media));
62
61
  // i= information (optional)
63
62
  if (md.information !== undefined) {
64
- lines.push((0, field_serializer_1.serializeInformationField)(md.information));
63
+ lines.push((0, fields_1.serializeInformationField)(md.information));
65
64
  }
66
65
  // c= connections (optional, multiple)
67
66
  for (const connection of md.connections) {
68
- lines.push((0, field_serializer_1.serializeConnectionField)(connection));
67
+ lines.push((0, fields_1.serializeConnectionField)(connection));
69
68
  }
70
69
  // b= bandwidths (optional, multiple)
71
70
  for (const bandwidth of md.bandwidths) {
72
- lines.push((0, field_serializer_1.serializeBandwidthField)(bandwidth));
71
+ lines.push((0, fields_1.serializeBandwidthField)(bandwidth));
73
72
  }
74
73
  // k= key (optional, OBSOLETE)
75
74
  if (md.key !== undefined) {
76
- lines.push((0, field_serializer_1.serializeKeyField)(md.key));
75
+ lines.push((0, fields_1.serializeKeyField)(md.key));
77
76
  }
78
77
  // a= attributes (optional, multiple)
79
78
  for (const attr of md.attributes) {
80
- lines.push((0, attribute_serializer_1.serializeAttributeField)(attr));
79
+ lines.push((0, fields_1.serializeAttributeField)(attr));
81
80
  }
82
81
  return lines;
83
82
  }
@@ -6,9 +6,7 @@
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.serializeSessionDescription = serializeSessionDescription;
9
- const field_serializer_1 = require("./field-serializer");
10
- const time_serializer_1 = require("./time-serializer");
11
- const attribute_serializer_1 = require("./attribute-serializer");
9
+ const fields_1 = require("./fields");
12
10
  const media_serializer_1 = require("./media-serializer");
13
11
  // ============================================================================
14
12
  // Session Serializer
@@ -39,52 +37,52 @@ function serializeSessionDescription(session) {
39
37
  // ========================================================================
40
38
  // 1-3. Required session-level fields (v=, o=, s=)
41
39
  // ========================================================================
42
- lines.push((0, field_serializer_1.serializeVersionField)(session.version));
43
- lines.push((0, field_serializer_1.serializeOriginField)(session.origin));
44
- lines.push((0, field_serializer_1.serializeSessionNameField)(session.sessionName));
40
+ lines.push((0, fields_1.serializeVersionField)(session.version));
41
+ lines.push((0, fields_1.serializeOriginField)(session.origin));
42
+ lines.push((0, fields_1.serializeSessionNameField)(session.sessionName));
45
43
  // ========================================================================
46
44
  // 4-9. Optional session-level fields (i=, u=, e=, p=, c=, b=)
47
45
  // ========================================================================
48
46
  // i= session information (optional)
49
47
  if (session.sessionInformation !== undefined) {
50
- lines.push((0, field_serializer_1.serializeInformationField)(session.sessionInformation));
48
+ lines.push((0, fields_1.serializeInformationField)(session.sessionInformation));
51
49
  }
52
50
  // u= URI (optional)
53
51
  if (session.uri !== undefined) {
54
- lines.push((0, field_serializer_1.serializeUriField)(session.uri));
52
+ lines.push((0, fields_1.serializeUriField)(session.uri));
55
53
  }
56
54
  // e= email (optional, multiple)
57
55
  for (const email of session.emails) {
58
- lines.push((0, field_serializer_1.serializeEmailField)(email));
56
+ lines.push((0, fields_1.serializeEmailField)(email));
59
57
  }
60
58
  // p= phone (optional, multiple)
61
59
  for (const phone of session.phones) {
62
- lines.push((0, field_serializer_1.serializePhoneField)(phone));
60
+ lines.push((0, fields_1.serializePhoneField)(phone));
63
61
  }
64
62
  // c= connection (optional at session level)
65
63
  if (session.connection !== undefined) {
66
- lines.push((0, field_serializer_1.serializeConnectionField)(session.connection));
64
+ lines.push((0, fields_1.serializeConnectionField)(session.connection));
67
65
  }
68
66
  // b= bandwidth (optional, multiple)
69
67
  for (const bandwidth of session.bandwidths) {
70
- lines.push((0, field_serializer_1.serializeBandwidthField)(bandwidth));
68
+ lines.push((0, fields_1.serializeBandwidthField)(bandwidth));
71
69
  }
72
70
  // ========================================================================
73
71
  // 10. Time descriptions (required, at least one)
74
72
  // ========================================================================
75
73
  for (const td of session.timeDescriptions) {
76
- lines.push(...(0, time_serializer_1.serializeTimeDescription)(td));
74
+ lines.push(...(0, fields_1.serializeTimeDescription)(td));
77
75
  }
78
76
  // ========================================================================
79
77
  // 11-12. Session-level key and attributes (k=, a=)
80
78
  // ========================================================================
81
79
  // k= key (optional, OBSOLETE)
82
80
  if (session.key !== undefined) {
83
- lines.push((0, field_serializer_1.serializeKeyField)(session.key));
81
+ lines.push((0, fields_1.serializeKeyField)(session.key));
84
82
  }
85
83
  // a= attributes (optional, multiple)
86
84
  for (const attr of session.attributes) {
87
- lines.push((0, attribute_serializer_1.serializeAttributeField)(attr));
85
+ lines.push((0, fields_1.serializeAttributeField)(attr));
88
86
  }
89
87
  // ========================================================================
90
88
  // 13. Media descriptions (optional, zero or more)
@@ -1 +1 @@
1
- {"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../../../src/types/attributes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,iBAAiB,GAAG,cAAc,CAAC;AAM3D;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;CAC3B;AAMD;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IA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AShE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG,iBAAiB,CAStE;AAMD;;;;;;GAMG;AACH,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAE/D;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAwBhF,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,aAAa,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS,CAE7F;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAMhF;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAM9E;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,SAAS,MAAM,EAE7B,CAAC;AAEzB;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,SAAS,MAAM,EAE3B,CAAC;AAMzB;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,IAAI,iBAAiB,CAE9E;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,IAAI,cAAc,CAExE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,SAAS,GACd,IAAI,IAAI,iBAAiB,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,iBAAiB,CAQvF"}
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Defines types for individual SDP fields such as Origin, Connection, Bandwidth, etc.
5
5
  */
6
- import { Username, SessionId, SessionVersion, NetType, AddrType, BandwidthType } from './primitives';
6
+ import { NetType, AddrType } from './primitives';
7
7
  import { UnicastAddress, ConnectionAddress } from './network';
8
8
  /**
9
9
  * Origin field (RFC 8866 Section 5.2)
@@ -17,19 +17,19 @@ export interface Origin {
17
17
  * Username of the session originator
18
18
  * Use "-" if the originating host does not support the concept of user IDs
19
19
  */
20
- readonly username: Username;
20
+ readonly username: string;
21
21
  /**
22
22
  * Numeric string such that the tuple of username, sess-id, nettype, addrtype,
23
23
  * and unicast-address forms a globally unique identifier for the session.
24
24
  * Recommended to be an NTP timestamp.
25
25
  */
26
- readonly sessId: SessionId;
26
+ readonly sessId: string;
27
27
  /**
28
28
  * Version number for this session description.
29
29
  * Incremented when the session data is modified.
30
30
  * Recommended to be an NTP timestamp.
31
31
  */
32
- readonly sessVersion: SessionVersion;
32
+ readonly sessVersion: string;
33
33
  /**
34
34
  * Type of network (typically "IN" for Internet)
35
35
  */
@@ -79,7 +79,7 @@ export interface Bandwidth {
79
79
  * - "AS": Application Specific - bandwidth for a single media stream
80
80
  * - Or a registered extension type
81
81
  */
82
- readonly type: BandwidthType;
82
+ readonly type: string;
83
83
  /**
84
84
  * Bandwidth value in kilobits per second
85
85
  */