@flaks/onerecord 0.4.0 → 0.6.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 (149) hide show
  1. package/CHANGELOG.md +98 -0
  2. package/MIGRATING.md +108 -0
  3. package/README.md +7 -0
  4. package/dist/api/index.d.ts +296 -0
  5. package/dist/api/index.d.ts.map +1 -0
  6. package/dist/api/index.js +197 -0
  7. package/dist/api/index.js.map +1 -0
  8. package/dist/booking-flow/can-transition.d.ts +3 -0
  9. package/dist/booking-flow/can-transition.d.ts.map +1 -1
  10. package/dist/booking-flow/can-transition.js +3 -0
  11. package/dist/booking-flow/can-transition.js.map +1 -1
  12. package/dist/booking-flow/state-diagram.d.ts +5 -1
  13. package/dist/booking-flow/state-diagram.d.ts.map +1 -1
  14. package/dist/booking-flow/state-diagram.js +5 -1
  15. package/dist/booking-flow/state-diagram.js.map +1 -1
  16. package/dist/booking-flow/transitions.d.ts +14 -1
  17. package/dist/booking-flow/transitions.d.ts.map +1 -1
  18. package/dist/booking-flow/transitions.js +73 -18
  19. package/dist/booking-flow/transitions.js.map +1 -1
  20. package/dist/classes/booking/schema.d.ts +94 -4
  21. package/dist/classes/booking/schema.d.ts.map +1 -1
  22. package/dist/classes/booking/schema.js +43 -2
  23. package/dist/classes/booking/schema.js.map +1 -1
  24. package/dist/classes/booking-option/schema.d.ts +58 -4
  25. package/dist/classes/booking-option/schema.d.ts.map +1 -1
  26. package/dist/classes/booking-option/schema.js +24 -2
  27. package/dist/classes/booking-option/schema.js.map +1 -1
  28. package/dist/classes/booking-request/schema.d.ts +17 -4
  29. package/dist/classes/booking-request/schema.d.ts.map +1 -1
  30. package/dist/classes/booking-request/schema.js +20 -7
  31. package/dist/classes/booking-request/schema.js.map +1 -1
  32. package/dist/classes/party/schema.d.ts +1 -1
  33. package/dist/classes/price/codec.d.ts +4 -0
  34. package/dist/classes/price/codec.d.ts.map +1 -0
  35. package/dist/classes/price/codec.js +11 -0
  36. package/dist/classes/price/codec.js.map +1 -0
  37. package/dist/classes/price/deserialize.d.ts +5 -0
  38. package/dist/classes/price/deserialize.d.ts.map +1 -0
  39. package/dist/classes/{organization → price}/deserialize.js +3 -3
  40. package/dist/classes/price/deserialize.js.map +1 -0
  41. package/dist/classes/price/index.d.ts +6 -0
  42. package/dist/classes/price/index.d.ts.map +1 -0
  43. package/dist/classes/price/index.js +5 -0
  44. package/dist/classes/price/index.js.map +1 -0
  45. package/dist/classes/price/schema.d.ts +14 -0
  46. package/dist/classes/price/schema.d.ts.map +1 -0
  47. package/dist/classes/price/schema.js +12 -0
  48. package/dist/classes/price/schema.js.map +1 -0
  49. package/dist/classes/price/serialize.d.ts +6 -0
  50. package/dist/classes/price/serialize.d.ts.map +1 -0
  51. package/dist/classes/{organization → price}/serialize.js +6 -6
  52. package/dist/classes/price/serialize.js.map +1 -0
  53. package/dist/classes/ratings/codec.d.ts +4 -0
  54. package/dist/classes/ratings/codec.d.ts.map +1 -0
  55. package/dist/classes/ratings/codec.js +11 -0
  56. package/dist/classes/ratings/codec.js.map +1 -0
  57. package/dist/classes/ratings/deserialize.d.ts +5 -0
  58. package/dist/classes/ratings/deserialize.d.ts.map +1 -0
  59. package/dist/classes/ratings/deserialize.js +64 -0
  60. package/dist/classes/ratings/deserialize.js.map +1 -0
  61. package/dist/classes/ratings/index.d.ts +6 -0
  62. package/dist/classes/ratings/index.d.ts.map +1 -0
  63. package/dist/classes/ratings/index.js +5 -0
  64. package/dist/classes/ratings/index.js.map +1 -0
  65. package/dist/classes/ratings/schema.d.ts +60 -0
  66. package/dist/classes/ratings/schema.d.ts.map +1 -0
  67. package/dist/classes/ratings/schema.js +23 -0
  68. package/dist/classes/ratings/schema.js.map +1 -0
  69. package/dist/classes/ratings/serialize.d.ts +6 -0
  70. package/dist/classes/ratings/serialize.d.ts.map +1 -0
  71. package/dist/classes/ratings/serialize.js +28 -0
  72. package/dist/classes/ratings/serialize.js.map +1 -0
  73. package/dist/classes/shared/distribution.d.ts +109 -0
  74. package/dist/classes/shared/distribution.d.ts.map +1 -0
  75. package/dist/classes/shared/distribution.js +97 -0
  76. package/dist/classes/shared/distribution.js.map +1 -0
  77. package/dist/classes/transport-legs/codec.d.ts +4 -0
  78. package/dist/classes/transport-legs/codec.d.ts.map +1 -0
  79. package/dist/classes/transport-legs/codec.js +11 -0
  80. package/dist/classes/transport-legs/codec.js.map +1 -0
  81. package/dist/classes/transport-legs/deserialize.d.ts +5 -0
  82. package/dist/classes/transport-legs/deserialize.d.ts.map +1 -0
  83. package/dist/classes/transport-legs/deserialize.js +64 -0
  84. package/dist/classes/transport-legs/deserialize.js.map +1 -0
  85. package/dist/classes/transport-legs/index.d.ts +6 -0
  86. package/dist/classes/transport-legs/index.d.ts.map +1 -0
  87. package/dist/classes/transport-legs/index.js +5 -0
  88. package/dist/classes/transport-legs/index.js.map +1 -0
  89. package/dist/classes/transport-legs/schema.d.ts +25 -0
  90. package/dist/classes/transport-legs/schema.d.ts.map +1 -0
  91. package/dist/classes/transport-legs/schema.js +19 -0
  92. package/dist/classes/transport-legs/schema.js.map +1 -0
  93. package/dist/classes/transport-legs/serialize.d.ts +6 -0
  94. package/dist/classes/transport-legs/serialize.d.ts.map +1 -0
  95. package/dist/classes/transport-legs/serialize.js +28 -0
  96. package/dist/classes/transport-legs/serialize.js.map +1 -0
  97. package/dist/classes/transport-movement/schema.d.ts +1 -1
  98. package/dist/codecs.d.ts +3 -0
  99. package/dist/codecs.d.ts.map +1 -1
  100. package/dist/codecs.js +3 -0
  101. package/dist/codecs.js.map +1 -1
  102. package/dist/codes/enums.d.ts +59 -8
  103. package/dist/codes/enums.d.ts.map +1 -1
  104. package/dist/codes/enums.js +45 -10
  105. package/dist/codes/enums.js.map +1 -1
  106. package/dist/codes/index.d.ts +1 -1
  107. package/dist/codes/index.d.ts.map +1 -1
  108. package/dist/codes/index.js +1 -1
  109. package/dist/codes/index.js.map +1 -1
  110. package/dist/dispatch/field-types.d.ts.map +1 -1
  111. package/dist/dispatch/field-types.js +30 -1
  112. package/dist/dispatch/field-types.js.map +1 -1
  113. package/dist/dispatch/iri-canonical.d.ts +5 -1
  114. package/dist/dispatch/iri-canonical.d.ts.map +1 -1
  115. package/dist/dispatch/iri-canonical.js +6 -2
  116. package/dist/dispatch/iri-canonical.js.map +1 -1
  117. package/dist/facade.d.ts +7 -4
  118. package/dist/facade.d.ts.map +1 -1
  119. package/dist/factory-classes.d.ts +6 -0
  120. package/dist/factory-classes.d.ts.map +1 -1
  121. package/dist/factory-classes.js +6 -0
  122. package/dist/factory-classes.js.map +1 -1
  123. package/dist/index.d.ts +9 -1
  124. package/dist/index.d.ts.map +1 -1
  125. package/dist/index.js +11 -1
  126. package/dist/index.js.map +1 -1
  127. package/dist/types/index.d.ts +5 -0
  128. package/dist/types/index.d.ts.map +1 -1
  129. package/dist/version.d.ts +1 -1
  130. package/dist/version.js +1 -1
  131. package/package.json +10 -5
  132. package/dist/classes/organization/codec.d.ts +0 -4
  133. package/dist/classes/organization/codec.d.ts.map +0 -1
  134. package/dist/classes/organization/codec.js +0 -11
  135. package/dist/classes/organization/codec.js.map +0 -1
  136. package/dist/classes/organization/deserialize.d.ts +0 -5
  137. package/dist/classes/organization/deserialize.d.ts.map +0 -1
  138. package/dist/classes/organization/deserialize.js.map +0 -1
  139. package/dist/classes/organization/index.d.ts +0 -6
  140. package/dist/classes/organization/index.d.ts.map +0 -1
  141. package/dist/classes/organization/index.js +0 -5
  142. package/dist/classes/organization/index.js.map +0 -1
  143. package/dist/classes/organization/schema.d.ts +0 -14
  144. package/dist/classes/organization/schema.d.ts.map +0 -1
  145. package/dist/classes/organization/schema.js +0 -11
  146. package/dist/classes/organization/schema.js.map +0 -1
  147. package/dist/classes/organization/serialize.d.ts +0 -6
  148. package/dist/classes/organization/serialize.d.ts.map +0 -1
  149. package/dist/classes/organization/serialize.js.map +0 -1
@@ -0,0 +1,60 @@
1
+ import { z } from 'zod';
2
+ import type { JsonLd } from '../shared/jsonld-brand.js';
3
+ export declare const RatingsSchema: z.ZodObject<{
4
+ '@context': z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
5
+ '@id': z.ZodString;
6
+ '@type': z.ZodLiteral<"Ratings">;
7
+ billingChargeIdentifier: z.ZodOptional<z.ZodEnum<{
8
+ CN: "CN";
9
+ CO: "CO";
10
+ CT: "CT";
11
+ IN: "IN";
12
+ NI: "NI";
13
+ OA: "OA";
14
+ OC: "OC";
15
+ SI: "SI";
16
+ TX: "TX";
17
+ VC: "VC";
18
+ WT: "WT";
19
+ }>>;
20
+ chargeDescription: z.ZodOptional<z.ZodString>;
21
+ chargePaymentType: z.ZodOptional<z.ZodEnum<{
22
+ P: "P";
23
+ C: "C";
24
+ }>>;
25
+ chargeType: z.ZodOptional<z.ZodEnum<{
26
+ CN: "CN";
27
+ CO: "CO";
28
+ CT: "CT";
29
+ IN: "IN";
30
+ NI: "NI";
31
+ OA: "OA";
32
+ OC: "OC";
33
+ SI: "SI";
34
+ TX: "TX";
35
+ VC: "VC";
36
+ WT: "WT";
37
+ }>>;
38
+ entitlement: z.ZodOptional<z.ZodEnum<{
39
+ C: "C";
40
+ A: "A";
41
+ }>>;
42
+ forPrices: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<import("../../index.js").SafeIri, string>>>>;
43
+ otherChargeCode: z.ZodOptional<z.ZodString>;
44
+ priceReferenceId: z.ZodOptional<z.ZodString>;
45
+ priceSpecification: z.ZodOptional<z.ZodString>;
46
+ quantity: z.ZodOptional<z.ZodNumber>;
47
+ ranges: z.ZodOptional<z.ZodArray<z.ZodObject<{
48
+ '@type': z.ZodOptional<z.ZodLiteral<"Ranges">>;
49
+ rateClassCode: z.ZodOptional<z.ZodString>;
50
+ uldRateClassType: z.ZodOptional<z.ZodString>;
51
+ maximumQuantity: z.ZodOptional<z.ZodNumber>;
52
+ minimumQuantity: z.ZodOptional<z.ZodNumber>;
53
+ unitBasis: z.ZodOptional<z.ZodString>;
54
+ }, z.core.$strict>>>;
55
+ rcp: z.ZodOptional<z.ZodString>;
56
+ subTotal: z.ZodOptional<z.ZodNumber>;
57
+ }, z.core.$strict>;
58
+ export type Ratings = z.infer<typeof RatingsSchema>;
59
+ export type JsonLdRatings = JsonLd<'Ratings'>;
60
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/classes/ratings/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAIvD,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAef,CAAA;AAEX,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AACnD,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,SAAS,CAAC,CAAA"}
@@ -0,0 +1,23 @@
1
+ import { z } from 'zod';
2
+ import { ChargeIdentifier, EntitlementCode, PrepaidCollectIndicator } from '../../codes/enums.js';
3
+ import { safeIri } from '../../iri/zod-safe-iri.js';
4
+ import { RangesSchema } from '../shared/distribution.js';
5
+ import { LogisticsObjectSchema } from '../shared/logistics-object.js';
6
+ // :Ratings L8966
7
+ export const RatingsSchema = LogisticsObjectSchema.extend({
8
+ '@type': z.literal('Ratings'),
9
+ billingChargeIdentifier: ChargeIdentifier.optional(), // L361
10
+ chargeDescription: z.string().min(1).max(256).optional(), // L3096
11
+ chargePaymentType: PrepaidCollectIndicator.optional(), // L519
12
+ chargeType: ChargeIdentifier.optional(), // L527
13
+ entitlement: EntitlementCode.optional(), // L1016
14
+ forPrices: z.array(safeIri()).optional(), // L1176 → :Price, many
15
+ otherChargeCode: z.string().min(1).max(16).optional(), // L1764
16
+ priceReferenceId: z.string().min(1).max(64).optional(), // L4135
17
+ priceSpecification: z.string().min(1).max(64).optional(), // L4143
18
+ quantity: z.number().optional(), // L4183
19
+ ranges: z.array(RangesSchema).optional(), // L2052 → :Ranges (embedded), many
20
+ rcp: z.string().min(1).max(16).optional(), // L2115 → :CodeListElement
21
+ subTotal: z.number().optional(), // L4519 xsd:double — the ontology defines no currency
22
+ }).strict();
23
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/classes/ratings/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AACjG,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAExD,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AAErE,iBAAiB;AACjB,MAAM,CAAC,MAAM,aAAa,GAAG,qBAAqB,CAAC,MAAM,CAAC;IACxD,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;IAC7B,uBAAuB,EAAE,gBAAgB,CAAC,QAAQ,EAAE,EAAE,OAAO;IAC7D,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,QAAQ;IAClE,iBAAiB,EAAE,uBAAuB,CAAC,QAAQ,EAAE,EAAE,OAAO;IAC9D,UAAU,EAAE,gBAAgB,CAAC,QAAQ,EAAE,EAAE,OAAO;IAChD,WAAW,EAAE,eAAe,CAAC,QAAQ,EAAE,EAAE,QAAQ;IACjD,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,uBAAuB;IACjE,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,QAAQ;IAC/D,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,QAAQ;IAChE,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,QAAQ;IAClE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,QAAQ;IACzC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE,EAAE,mCAAmC;IAC7E,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,2BAA2B;IACtE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,sDAAsD;CACxF,CAAC,CAAC,MAAM,EAAE,CAAA"}
@@ -0,0 +1,6 @@
1
+ import type { ParseResult } from '../../result.js';
2
+ import type { SerializeOpts } from '../../safety/limits.js';
3
+ import type { JsonLdRatings, Ratings } from './schema.js';
4
+ export declare function serializeRatings(input: Ratings, _opts?: SerializeOpts): JsonLdRatings;
5
+ export declare function serializeRatingsStrict(input: Ratings, _opts?: SerializeOpts): ParseResult<JsonLdRatings>;
6
+ //# sourceMappingURL=serialize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../../../src/classes/ratings/serialize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAElD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAE3D,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAGzD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,aAAa,GAAG,aAAa,CAUrF;AAED,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,OAAO,EACd,KAAK,CAAC,EAAE,aAAa,GACpB,WAAW,CAAC,aAAa,CAAC,CAgB5B"}
@@ -0,0 +1,28 @@
1
+ import { SerializationError } from '../../result.js';
2
+ import { omitEmpty } from '../shared/parse-utils.js';
3
+ import { RatingsSchema } from './schema.js';
4
+ export function serializeRatings(input, _opts) {
5
+ const r = RatingsSchema.safeParse(input);
6
+ if (!r.success) {
7
+ throw new SerializationError('invalid_application_object', 'SerializationError[invalid_application_object]: serializeRatings: invalid input', r.error.issues);
8
+ }
9
+ return omitEmpty(r.data);
10
+ }
11
+ export function serializeRatingsStrict(input, _opts) {
12
+ const r = RatingsSchema.safeParse(input);
13
+ if (!r.success) {
14
+ return {
15
+ ok: false,
16
+ error: {
17
+ kind: 'zod_validation',
18
+ issues: r.error.issues.map((i) => ({
19
+ path: i.path.length === 0 ? '$' : i.path.join('.'),
20
+ message: i.message,
21
+ code: i.code,
22
+ })),
23
+ },
24
+ };
25
+ }
26
+ return { ok: true, value: omitEmpty(r.data) };
27
+ }
28
+ //# sourceMappingURL=serialize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serialize.js","sourceRoot":"","sources":["../../../src/classes/ratings/serialize.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAEpD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE3C,MAAM,UAAU,gBAAgB,CAAC,KAAc,EAAE,KAAqB;IACpE,MAAM,CAAC,GAAG,aAAa,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;IACxC,IAAI,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QACf,MAAM,IAAI,kBAAkB,CAC1B,4BAA4B,EAC5B,iFAAiF,EACjF,CAAC,CAAC,KAAK,CAAC,MAAM,CACf,CAAA;IACH,CAAC;IACD,OAAO,SAAS,CAAC,CAAC,CAAC,IAAI,CAA6B,CAAA;AACtD,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,KAAc,EACd,KAAqB;IAErB,MAAM,CAAC,GAAG,aAAa,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;IACxC,IAAI,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QACf,OAAO;YACL,EAAE,EAAE,KAAK;YACT,KAAK,EAAE;gBACL,IAAI,EAAE,gBAAgB;gBACtB,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;oBACjC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;oBAClD,OAAO,EAAE,CAAC,CAAC,OAAO;oBAClB,IAAI,EAAE,CAAC,CAAC,IAAI;iBACb,CAAC,CAAC;aACJ;SACF,CAAA;IACH,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,IAAI,CAA6B,EAAE,CAAA;AAC3E,CAAC"}
@@ -0,0 +1,109 @@
1
+ import { z } from 'zod';
2
+ /** xsd:duration (spec §2.1). Needs at least one component; `T` needs a time part. */
3
+ export declare const XSD_DURATION: RegExp;
4
+ export declare const RangesSchema: z.ZodObject<{
5
+ '@type': z.ZodOptional<z.ZodLiteral<"Ranges">>;
6
+ rateClassCode: z.ZodOptional<z.ZodString>;
7
+ uldRateClassType: z.ZodOptional<z.ZodString>;
8
+ maximumQuantity: z.ZodOptional<z.ZodNumber>;
9
+ minimumQuantity: z.ZodOptional<z.ZodNumber>;
10
+ unitBasis: z.ZodOptional<z.ZodString>;
11
+ }, z.core.$strict>;
12
+ export type Ranges = z.infer<typeof RangesSchema>;
13
+ export declare const UnitsPreferenceSchema: z.ZodObject<{
14
+ '@type': z.ZodOptional<z.ZodLiteral<"UnitsPreference">>;
15
+ currency: z.ZodOptional<z.ZodString>;
16
+ dimensionsUnit: z.ZodOptional<z.ZodString>;
17
+ temperatureUnit: z.ZodOptional<z.ZodString>;
18
+ volumeUnit: z.ZodOptional<z.ZodString>;
19
+ weightUnit: z.ZodOptional<z.ZodString>;
20
+ }, z.core.$strict>;
21
+ export type UnitsPreference = z.infer<typeof UnitsPreferenceSchema>;
22
+ export declare const CarrierProductSchema: z.ZodObject<{
23
+ '@type': z.ZodOptional<z.ZodLiteral<"CarrierProduct">>;
24
+ productCode: z.ZodOptional<z.ZodString>;
25
+ serviceLevelCode: z.ZodOptional<z.ZodString>;
26
+ productDescription: z.ZodOptional<z.ZodString>;
27
+ }, z.core.$strict>;
28
+ export type CarrierProduct = z.infer<typeof CarrierProductSchema>;
29
+ export declare const StationRemarksSchema: z.ZodObject<{
30
+ '@type': z.ZodOptional<z.ZodLiteral<"StationRemarks">>;
31
+ station: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("../../index.js").SafeIri, string>>>;
32
+ remarksText: z.ZodOptional<z.ZodString>;
33
+ }, z.core.$strict>;
34
+ export type StationRemarks = z.infer<typeof StationRemarksSchema>;
35
+ export declare const EmbeddedBookingTimesSchema: z.ZodObject<{
36
+ '@type': z.ZodOptional<z.ZodLiteral<"BookingTimes">>;
37
+ earliestAcceptanceTime: z.ZodOptional<z.ZodString>;
38
+ latestAcceptanceTime: z.ZodOptional<z.ZodString>;
39
+ latestArrivalTime: z.ZodOptional<z.ZodString>;
40
+ timeOfAvailability: z.ZodOptional<z.ZodString>;
41
+ totalTransitTime: z.ZodOptional<z.ZodString>;
42
+ }, z.core.$strict>;
43
+ export type EmbeddedBookingTimes = z.infer<typeof EmbeddedBookingTimesSchema>;
44
+ export declare const PieceGroupSchema: z.ZodObject<{
45
+ '@type': z.ZodOptional<z.ZodLiteral<"PieceGroup">>;
46
+ dryIceWeight: z.ZodOptional<z.ZodObject<{
47
+ '@type': z.ZodOptional<z.ZodLiteral<"Value">>;
48
+ numericalValue: z.ZodNumber;
49
+ unit: z.ZodString;
50
+ }, z.core.$strict>>;
51
+ pieceGroupCount: z.ZodOptional<z.ZodNumber>;
52
+ pieceGroupGrossWeight: z.ZodOptional<z.ZodObject<{
53
+ '@type': z.ZodOptional<z.ZodLiteral<"Value">>;
54
+ numericalValue: z.ZodNumber;
55
+ unit: z.ZodString;
56
+ }, z.core.$strict>>;
57
+ pieceGroupId: z.ZodOptional<z.ZodNumber>;
58
+ }, z.core.$strict>;
59
+ export type PieceGroup = z.infer<typeof PieceGroupSchema>;
60
+ export declare const EmbeddedBookingSegmentSchema: z.ZodObject<{
61
+ '@type': z.ZodOptional<z.ZodLiteral<"BookingSegment">>;
62
+ allotmentCode: z.ZodOptional<z.ZodString>;
63
+ pieceGroups: z.ZodOptional<z.ZodArray<z.ZodObject<{
64
+ '@type': z.ZodOptional<z.ZodLiteral<"PieceGroup">>;
65
+ dryIceWeight: z.ZodOptional<z.ZodObject<{
66
+ '@type': z.ZodOptional<z.ZodLiteral<"Value">>;
67
+ numericalValue: z.ZodNumber;
68
+ unit: z.ZodString;
69
+ }, z.core.$strict>>;
70
+ pieceGroupCount: z.ZodOptional<z.ZodNumber>;
71
+ pieceGroupGrossWeight: z.ZodOptional<z.ZodObject<{
72
+ '@type': z.ZodOptional<z.ZodLiteral<"Value">>;
73
+ numericalValue: z.ZodNumber;
74
+ unit: z.ZodString;
75
+ }, z.core.$strict>>;
76
+ pieceGroupId: z.ZodOptional<z.ZodNumber>;
77
+ }, z.core.$strict>>>;
78
+ spaceAllocationCode: z.ZodOptional<z.ZodEnum<{
79
+ CN: "CN";
80
+ CA: "CA";
81
+ HK: "HK";
82
+ HL: "HL";
83
+ HN: "HN";
84
+ KK: "KK";
85
+ LL: "LL";
86
+ NA: "NA";
87
+ NL: "NL";
88
+ NN: "NN";
89
+ SS: "SS";
90
+ UN: "UN";
91
+ UU: "UU";
92
+ XX: "XX";
93
+ }>>;
94
+ transportLegs: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("../../index.js").SafeIri, string>>>;
95
+ }, z.core.$strict>;
96
+ export type EmbeddedBookingSegment = z.infer<typeof EmbeddedBookingSegmentSchema>;
97
+ export declare const ActivitySequenceSchema: z.ZodObject<{
98
+ '@type': z.ZodOptional<z.ZodLiteral<"ActivitySequence">>;
99
+ activity: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("../../index.js").SafeIri, string>>>;
100
+ sequenceNumber: z.ZodOptional<z.ZodString>;
101
+ }, z.core.$strict>;
102
+ export type ActivitySequence = z.infer<typeof ActivitySequenceSchema>;
103
+ export declare const ContactDetailSchema: z.ZodObject<{
104
+ '@type': z.ZodOptional<z.ZodLiteral<"ContactDetail">>;
105
+ contactDetailType: z.ZodOptional<z.ZodString>;
106
+ textualValue: z.ZodOptional<z.ZodString>;
107
+ }, z.core.$strict>;
108
+ export type ContactDetail = z.infer<typeof ContactDetailSchema>;
109
+ //# sourceMappingURL=distribution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"distribution.d.ts","sourceRoot":"","sources":["../../../src/classes/shared/distribution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAUvB,qFAAqF;AACrF,eAAO,MAAM,YAAY,QACsE,CAAA;AAG/F,eAAO,MAAM,YAAY;;;;;;;kBASd,CAAA;AACX,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA;AAGjD,eAAO,MAAM,qBAAqB;;;;;;;kBASvB,CAAA;AACX,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAGnE,eAAO,MAAM,oBAAoB;;;;;kBAOtB,CAAA;AACX,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAGjE,eAAO,MAAM,oBAAoB;;;;kBAMtB,CAAA;AACX,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAGjE,eAAO,MAAM,0BAA0B;;;;;;;kBAS5B,CAAA;AACX,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAG7E,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;kBAQlB,CAAA;AACX,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAGzD,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAQ9B,CAAA;AACX,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA;AAGjF,eAAO,MAAM,sBAAsB;;;;kBAMxB,CAAA;AACX,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAGrE,eAAO,MAAM,mBAAmB;;;;kBAMrB,CAAA;AACX,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA"}
@@ -0,0 +1,97 @@
1
+ import { z } from 'zod';
2
+ import { SpaceAllocationCode } from '../../codes/enums.js';
3
+ import { safeIri } from '../../iri/zod-safe-iri.js';
4
+ import { ValueSchema } from './value.js';
5
+ // Embedded Quote & Book shapes (v0.6.0 spec §3). Internal schemas, following the
6
+ // value.ts precedent; only their types are exported. Line citations (Lnnnn) refer
7
+ // to the official 2025-07-standard ontology file at IATA commit 49e8ac1b.
8
+ // No shape has an @id.
9
+ /** xsd:duration (spec §2.1). Needs at least one component; `T` needs a time part. */
10
+ export const XSD_DURATION = /^-?P(?=\d|T\d)(?:\d+Y)?(?:\d+M)?(?:\d+D)?(?:T(?=\d)(?:\d+H)?(?:\d+M)?(?:\d+(?:\.\d+)?S)?)?$/;
11
+ // :Ranges L8919
12
+ export const RangesSchema = z
13
+ .object({
14
+ '@type': z.literal('Ranges').optional(),
15
+ rateClassCode: z.string().min(1).max(8).optional(), // :rateClassCode L2068
16
+ uldRateClassType: z.string().min(1).max(16).optional(), // :uldRateClassType L2664
17
+ maximumQuantity: z.number().optional(), // :maximumQuantity L3797
18
+ minimumQuantity: z.number().optional(), // :minimumQuantity L3837
19
+ unitBasis: z.string().min(1).max(64).optional(), // :unitBasis L4671
20
+ })
21
+ .strict();
22
+ // :UnitsPreference L9924
23
+ export const UnitsPreferenceSchema = z
24
+ .object({
25
+ '@type': z.literal('UnitsPreference').optional(),
26
+ currency: z.string().min(1).optional(), // :currency L801
27
+ dimensionsUnit: z.string().min(1).optional(), // :dimensionsUnit L951
28
+ temperatureUnit: z.string().min(1).optional(), // :temperatureUnit L2519
29
+ volumeUnit: z.string().min(1).optional(), // :volumeUnit L2772
30
+ weightUnit: z.string().min(1).optional(), // :weightUnit L2831
31
+ })
32
+ .strict();
33
+ // :CarrierProduct L5855
34
+ export const CarrierProductSchema = z
35
+ .object({
36
+ '@type': z.literal('CarrierProduct').optional(),
37
+ productCode: z.string().min(1).max(16).optional(), // :productCode L2009
38
+ serviceLevelCode: z.string().min(1).max(16).optional(), // :serviceLevelCode L2291
39
+ productDescription: z.string().min(1).max(256).optional(), // :productDescription L4151
40
+ })
41
+ .strict();
42
+ // :StationRemarks L9317
43
+ export const StationRemarksSchema = z
44
+ .object({
45
+ '@type': z.literal('StationRemarks').optional(),
46
+ station: safeIri().optional(), // :station L2386 (comment says mandatory; no cardinality restriction)
47
+ remarksText: z.string().min(1).max(512).optional(), // :remarksText L4270
48
+ })
49
+ .strict();
50
+ // :BookingTimes L5744 (embedded; named to avoid the legacy LogisticsObject BookingTimes)
51
+ export const EmbeddedBookingTimesSchema = z
52
+ .object({
53
+ '@type': z.literal('BookingTimes').optional(),
54
+ earliestAcceptanceTime: z.string().datetime({ offset: true }).optional(), // L3423
55
+ latestAcceptanceTime: z.string().datetime({ offset: true }).optional(), // L3670
56
+ latestArrivalTime: z.string().datetime({ offset: true }).optional(), // L3678
57
+ timeOfAvailability: z.string().datetime({ offset: true }).optional(), // L4591
58
+ totalTransitTime: z.string().regex(XSD_DURATION).optional(), // :totalTransitTime L4599
59
+ })
60
+ .strict();
61
+ // :PieceGroup L8460
62
+ export const PieceGroupSchema = z
63
+ .object({
64
+ '@type': z.literal('PieceGroup').optional(),
65
+ dryIceWeight: ValueSchema.optional(), // :dryIceWeight L992
66
+ pieceGroupCount: z.number().int().optional(), // :pieceGroupCount L4084
67
+ pieceGroupGrossWeight: ValueSchema.optional(), // :pieceGroupGrossWeight L1926
68
+ pieceGroupId: z.number().int().optional(), // :pieceGroupId L4092
69
+ })
70
+ .strict();
71
+ // :BookingSegment L5595 (embedded; named to avoid the legacy LogisticsObject BookingSegment)
72
+ export const EmbeddedBookingSegmentSchema = z
73
+ .object({
74
+ '@type': z.literal('BookingSegment').optional(),
75
+ allotmentCode: z.string().min(1).max(64).optional(), // :allotmentCode L2969
76
+ pieceGroups: z.array(PieceGroupSchema).optional(), // :pieceGroups L1934 (many)
77
+ spaceAllocationCode: SpaceAllocationCode.optional(), // :spaceAllocationCode L2363
78
+ transportLegs: safeIri().optional(), // :transportLegs L2584 (max 1 on BookingSegment)
79
+ })
80
+ .strict();
81
+ // :ActivitySequence L4849
82
+ export const ActivitySequenceSchema = z
83
+ .object({
84
+ '@type': z.literal('ActivitySequence').optional(),
85
+ activity: safeIri().optional(), // :activity L219 -> :LogisticsActivity
86
+ sequenceNumber: z.string().min(1).max(64).optional(), // :sequenceNumber L4326
87
+ })
88
+ .strict();
89
+ // :ContactDetail L6185
90
+ export const ContactDetailSchema = z
91
+ .object({
92
+ '@type': z.literal('ContactDetail').optional(),
93
+ contactDetailType: z.string().min(1).max(64).optional(), // :contactDetailType L692 (open list)
94
+ textualValue: z.string().min(1).optional(), // :textualValue L4583
95
+ })
96
+ .strict();
97
+ //# sourceMappingURL=distribution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"distribution.js","sourceRoot":"","sources":["../../../src/classes/shared/distribution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAExC,iFAAiF;AACjF,kFAAkF;AAClF,0EAA0E;AAC1E,uBAAuB;AAEvB,qFAAqF;AACrF,MAAM,CAAC,MAAM,YAAY,GACvB,6FAA6F,CAAA;AAE/F,gBAAgB;AAChB,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC;KAC1B,MAAM,CAAC;IACN,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE;IACvC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,uBAAuB;IAC3E,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,0BAA0B;IAClF,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,yBAAyB;IACjE,eAAe,EAAE,CA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A6B;IAClF,aAAa,EAAE,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,iDAAiD;CACvF,CAAC;KACD,MAAM,EAAE,CAAA;AAGX,0BAA0B;AAC1B,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC;KACpC,MAAM,CAAC;IACN,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,QAAQ,EAAE;IACjD,QAAQ,EAAE,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,uCAAuC;IACvE,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,wBAAwB;CAC/E,CAAC;KACD,MAAM,EAAE,CAAA;AAGX,uBAAuB;AACvB,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC;KACjC,MAAM,CAAC;IACN,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,QAAQ,EAAE;IAC9C,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,sCAAsC;IAC/F,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,sBAAsB;CACnE,CAAC;KACD,MAAM,EAAE,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { Codec } from '../shared/codec.js';
2
+ import type { JsonLdTransportLegs, TransportLegs } from './schema.js';
3
+ export declare const TransportLegsCodec: Codec<TransportLegs, JsonLdTransportLegs, 'TransportLegs'>;
4
+ //# sourceMappingURL=codec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../../src/classes/transport-legs/codec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAE/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAIrE,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,aAAa,EAAE,mBAAmB,EAAE,eAAe,CAO7E,CAAA"}
@@ -0,0 +1,11 @@
1
+ import { deserializeTransportLegs } from './deserialize.js';
2
+ import { TransportLegsSchema } from './schema.js';
3
+ import { serializeTransportLegs, serializeTransportLegsStrict } from './serialize.js';
4
+ export const TransportLegsCodec = Object.freeze({
5
+ schema: TransportLegsSchema,
6
+ serialize: serializeTransportLegs,
7
+ serializeStrict: serializeTransportLegsStrict,
8
+ deserialize: deserializeTransportLegs,
9
+ type: 'TransportLegs',
10
+ });
11
+ //# sourceMappingURL=codec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codec.js","sourceRoot":"","sources":["../../../src/classes/transport-legs/codec.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAA;AAE3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAE,sBAAsB,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAA;AAErF,MAAM,CAAC,MAAM,kBAAkB,GAC7B,MAAM,CAAC,MAAM,CAAC;IACZ,MAAM,EAAE,mBAAmB;IAC3B,SAAS,EAAE,sBAAsB;IACjC,eAAe,EAAE,4BAA4B;IAC7C,WAAW,EAAE,wBAAwB;IACrC,IAAI,EAAE,eAAe;CACb,CAAC,CAAA"}
@@ -0,0 +1,5 @@
1
+ import type { ParseResult } from '../../result.js';
2
+ import type { DeserializeOpts } from '../../safety/limits.js';
3
+ import type { TransportLegs } from './schema.js';
4
+ export declare function deserializeTransportLegs(input: unknown, opts?: DeserializeOpts): ParseResult<TransportLegs>;
5
+ //# sourceMappingURL=deserialize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deserialize.d.ts","sourceRoot":"","sources":["../../../src/classes/transport-legs/deserialize.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAG7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAGhD,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,OAAO,EACd,IAAI,GAAE,eAAoB,GACzB,WAAW,CAAC,aAAa,CAAC,CA2D5B"}
@@ -0,0 +1,64 @@
1
+ import { assertContextAllowed } from '../../context.js';
2
+ import { findInvalidIriInIssues } from '../../iri/zod-safe-iri.js';
3
+ import { preValidate } from '../../safety/pre-validate.js';
4
+ import { findFirstEmptyArray, nullProtoClone, withMeta } from '../shared/parse-utils.js';
5
+ import { TransportLegsSchema } from './schema.js';
6
+ export function deserializeTransportLegs(input, opts = {}) {
7
+ // 1. Pre-Zod sanity (depth/nodes/string/array/payload/pollution/cycle)
8
+ const preOpts = {};
9
+ if (opts.limits !== undefined)
10
+ preOpts.limits = opts.limits;
11
+ if (opts.payloadByteLength !== undefined)
12
+ preOpts.payloadByteLength = opts.payloadByteLength;
13
+ if (opts.meta !== undefined)
14
+ preOpts.meta = opts.meta;
15
+ const pre = preValidate(input, preOpts);
16
+ if (!pre.ok)
17
+ return pre;
18
+ // 2. v2 (A3-B2, A1-M4): @context allowlist enforced before Zod
19
+ if (pre.value && typeof pre.value === 'object' && '@context' in pre.value) {
20
+ const ctxOpts = {};
21
+ if (opts.allowedContexts !== undefined)
22
+ ctxOpts.allowedContexts = opts.allowedContexts;
23
+ if (opts.meta !== undefined)
24
+ ctxOpts.meta = opts.meta;
25
+ const ctxR = assertContextAllowed(pre.value['@context'], ctxOpts);
26
+ if (!ctxR.ok)
27
+ return ctxR;
28
+ }
29
+ // 3. v3 plan correction: empty-array rejection BEFORE Zod
30
+ const empty = findFirstEmptyArray(pre.value, '$');
31
+ if (empty) {
32
+ return {
33
+ ok: false,
34
+ error: withMeta({
35
+ kind: 'cardinality_violation',
36
+ field: empty.field,
37
+ expected: '>=1 or omit',
38
+ got: 0,
39
+ path: empty.path,
40
+ }, opts.meta),
41
+ };
42
+ }
43
+ // 4. Zod parse — lift safeIri-tagged issues to invalid_iri
44
+ const r = TransportLegsSchema.safeParse(pre.value);
45
+ if (!r.success) {
46
+ const iriErr = findInvalidIriInIssues(r.error.issues, '$');
47
+ if (iriErr)
48
+ return { ok: false, error: withMeta(iriErr, opts.meta) };
49
+ return {
50
+ ok: false,
51
+ error: withMeta({
52
+ kind: 'zod_validation',
53
+ issues: r.error.issues.map((i) => ({
54
+ path: i.path.length === 0 ? '$' : i.path.join('.'),
55
+ message: i.message,
56
+ code: i.code,
57
+ })),
58
+ }, opts.meta),
59
+ };
60
+ }
61
+ // 5. v2 (A1-M5, A3-M4): null-prototype clone the output graph
62
+ return { ok: true, value: nullProtoClone(r.data) };
63
+ }
64
+ //# sourceMappingURL=deserialize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deserialize.js","sourceRoot":"","sources":["../../../src/classes/transport-legs/deserialize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAA;AAGlE,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAExF,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEjD,MAAM,UAAU,wBAAwB,CACtC,KAAc,EACd,OAAwB,EAAE;IAE1B,uEAAuE;IACvE,MAAM,OAAO,GAAsC,EAAE,CAAA;IACrD,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS;QAAE,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;IAC3D,IAAI,I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;SACF,CAAA;IACH,CAAC;IAED,2DAA2D;IAC3D,MAAM,CAAC,GAAG,mBAAmB,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;IAClD,IAAI,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QACf,MAAM,MAAM,GAAG,sBAAsB,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;QAC1D,IAAI,MAAM;YAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAA;QACpE,OAAO;YACL,EAAE,EAAE,KAAK;YACT,KAAK,EAAE,QAAQ,CACb;gBACE,IAAI,EAAE,gBAAgB;gBACtB,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;oBACjC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;oBAClD,OAAO,EAAE,CAAC,CAAC,OAAO;oBAClB,IAAI,EAAE,CAAC,CAAC,IAAI;iBACb,CAAC,CAAC;aACJ,EACD,IAAI,CAAC,IAAI,CACV;SACF,CAAA;IACH,CAAC;IAED,8DAA8D;IAC9D,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,IAAI,CAAkB,EAAE,CAAA;AACrE,CAAC"}
@@ -0,0 +1,6 @@
1
+ export { TransportLegsCodec } from './codec.js';
2
+ export { deserializeTransportLegs } from './deserialize.js';
3
+ export { TransportLegsSchema } from './schema.js';
4
+ export type { TransportLegs, JsonLdTransportLegs } from './schema.js';
5
+ export { serializeTransportLegs, serializeTransportLegsStrict } from './serialize.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/classes/transport-legs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAC/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAA;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AACjD,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AACrE,OAAO,EAAE,sBAAsB,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAA"}
@@ -0,0 +1,5 @@
1
+ export { TransportLegsCodec } from './codec.js';
2
+ export { deserializeTransportLegs } from './deserialize.js';
3
+ export { TransportLegsSchema } from './schema.js';
4
+ export { serializeTransportLegs, serializeTransportLegsStrict } from './serialize.js';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/classes/transport-legs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAC/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAA;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEjD,OAAO,EAAE,sBAAsB,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAA"}
@@ -0,0 +1,25 @@
1
+ import { z } from 'zod';
2
+ import type { JsonLd } from '../shared/jsonld-brand.js';
3
+ export declare const TransportLegsSchema: z.ZodObject<{
4
+ '@context': z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
5
+ '@id': z.ZodString;
6
+ '@type': z.ZodLiteral<"TransportLegs">;
7
+ arrivalDate: z.ZodOptional<z.ZodString>;
8
+ arrivalLocation: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("../../index.js").SafeIri, string>>>;
9
+ co2Emissions: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("../../index.js").SafeIri, string>>>;
10
+ departureDate: z.ZodOptional<z.ZodString>;
11
+ departureLocation: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("../../index.js").SafeIri, string>>>;
12
+ legNumber: z.ZodOptional<z.ZodNumber>;
13
+ operatingTransportMeans: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("../../index.js").SafeIri, string>>>;
14
+ transportIdentifier: z.ZodOptional<z.ZodString>;
15
+ transportMeansServiceType: z.ZodOptional<z.ZodEnum<{
16
+ FREIGHTER: "FREIGHTER";
17
+ MIXED_CONFIGURATION_COMBI: "MIXED_CONFIGURATION_COMBI";
18
+ PASSENGER: "PASSENGER";
19
+ TRUCK: "TRUCK";
20
+ }>>;
21
+ transportMeansType: z.ZodOptional<z.ZodString>;
22
+ }, z.core.$strict>;
23
+ export type TransportLegs = z.infer<typeof TransportLegsSchema>;
24
+ export type JsonLdTransportLegs = JsonLd<'TransportLegs'>;
25
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/classes/transport-legs/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAIvD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;kBAYrB,CAAA;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAC/D,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,eAAe,CAAC,CAAA"}
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+ import { TransportMeansServiceType } from '../../codes/enums.js';
3
+ import { safeIri } from '../../iri/zod-safe-iri.js';
4
+ import { LogisticsObjectSchema } from '../shared/logistics-object.js';
5
+ // :TransportLegs L9424
6
+ export const TransportLegsSchema = LogisticsObjectSchema.extend({
7
+ '@type': z.literal('TransportLegs'),
8
+ arrivalDate: z.string().datetime({ offset: true }).optional(), // L3008
9
+ arrivalLocation: safeIri().optional(), // L301 → :Location
10
+ co2Emissions: safeIri().optional(), // L613 → :CO2Emissions (as TransportMovement.co2Emissions)
11
+ departureDate: z.string().datetime({ offset: true }).optional(), // L3343
12
+ departureLocation: safeIri().optional(), // L873 → :Location
13
+ legNumber: z.number().int().optional(), // L3694 xsd:integer
14
+ operatingTransportMeans: safeIri().optional(), // L1715 → :TransportMeans (not modelled)
15
+ transportIdentifier: z.string().max(17).optional(), // L4623 (as TransportMovement.transportIdentifier)
16
+ transportMeansServiceType: TransportMeansServiceType.optional(), // L2592
17
+ transportMeansType: z.string().min(1).max(16).optional(), // L2600 → :CodeListElement
18
+ }).strict();
19
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/classes/transport-legs/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAEnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AAErE,uBAAuB;AACvB,MAAM,CAAC,MAAM,mBAAmB,GAAG,qBAAqB,CAAC,MAAM,CAAC;IAC9D,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC;IACnC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,QAAQ;IACvE,eAAe,EAAE,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,mBAAmB;IAC1D,YAAY,EAAE,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,2DAA2D;IAC/F,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,QAAQ;IACzE,iBAAiB,EAAE,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,mBAAmB;IAC5D,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,EAAE,oBAAoB;IAC5D,uBAAuB,EAAE,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,yCAAyC;IACxF,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,mDAAmD;IACvG,yBAAyB,EAAE,yBAAyB,CAAC,QAAQ,EAAE,EAAE,QAAQ;IACzE,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,2BAA2B;CACtF,CAAC,CAAC,MAAM,EAAE,CAAA"}
@@ -0,0 +1,6 @@
1
+ import type { ParseResult } from '../../result.js';
2
+ import type { SerializeOpts } from '../../safety/limits.js';
3
+ import type { JsonLdTransportLegs, TransportLegs } from './schema.js';
4
+ export declare function serializeTransportLegs(input: TransportLegs, _opts?: SerializeOpts): JsonLdTransportLegs;
5
+ export declare function serializeTransportLegsStrict(input: TransportLegs, _opts?: SerializeOpts): ParseResult<JsonLdTransportLegs>;
6
+ //# sourceMappingURL=serialize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../../../src/classes/transport-legs/serialize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAElD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAE3D,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAGrE,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,aAAa,EACpB,KAAK,CAAC,EAAE,aAAa,GACpB,mBAAmB,CAUrB;AAED,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,aAAa,EACpB,KAAK,CAAC,EAAE,aAAa,GACpB,WAAW,CAAC,mBAAmB,CAAC,CAgBlC"}
@@ -0,0 +1,28 @@
1
+ import { SerializationError } from '../../result.js';
2
+ import { omitEmpty } from '../shared/parse-utils.js';
3
+ import { TransportLegsSchema } from './schema.js';
4
+ export function serializeTransportLegs(input, _opts) {
5
+ const r = TransportLegsSchema.safeParse(input);
6
+ if (!r.success) {
7
+ throw new SerializationError('invalid_application_object', 'SerializationError[invalid_application_object]: serializeTransportLegs: invalid input', r.error.issues);
8
+ }
9
+ return omitEmpty(r.data);
10
+ }
11
+ export function serializeTransportLegsStrict(input, _opts) {
12
+ const r = TransportLegsSchema.safeParse(input);
13
+ if (!r.success) {
14
+ return {
15
+ ok: false,
16
+ error: {
17
+ kind: 'zod_validation',
18
+ issues: r.error.issues.map((i) => ({
19
+ path: i.path.length === 0 ? '$' : i.path.join('.'),
20
+ message: i.message,
21
+ code: i.code,
22
+ })),
23
+ },
24
+ };
25
+ }
26
+ return { ok: true, value: omitEmpty(r.data) };
27
+ }
28
+ //# sourceMappingURL=serialize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serialize.js","sourceRoot":"","sources":["../../../src/classes/transport-legs/serialize.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAEpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEjD,MAAM,UAAU,sBAAsB,CACpC,KAAoB,EACpB,KAAqB;IAErB,MAAM,CAAC,GAAG,mBAAmB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;IAC9C,IAAI,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QACf,MAAM,IAAI,kBAAkB,CAC1B,4BAA4B,EAC5B,uFAAuF,EACvF,CAAC,CAAC,KAAK,CAAC,MAAM,CACf,CAAA;IACH,CAAC;IACD,OAAO,SAAS,CAAC,CAAC,CAAC,IAAI,CAAmC,CAAA;AAC5D,CAAC;AAED,MAAM,UAAU,4BAA4B,CAC1C,KAAoB,EACpB,KAAqB;IAErB,MAAM,CAAC,GAAG,mBAAmB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;IAC9C,IAAI,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QACf,OAAO;YACL,EAAE,EAAE,KAAK;YACT,KAAK,EAAE;gBACL,IAAI,EAAE,gBAAgB;gBACtB,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;oBACjC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;oBAClD,OAAO,EAAE,CAAC,CAAC,OAAO;oBAClB,IAAI,EAAE,CAAC,CAAC,IAAI;iBACb,CAAC,CAAC;aACJ;SACF,CAAA;IACH,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,IAAI,CAAmC,EAAE,CAAA;AACjF,CAAC"}
@@ -6,8 +6,8 @@ export declare const TransportMovementSchema: z.ZodObject<{
6
6
  '@type': z.ZodLiteral<"TransportMovement">;
7
7
  transportIdentifier: z.ZodString;
8
8
  modeCode: z.ZodEnum<{
9
- AIR: "AIR";
10
9
  TRUCK: "TRUCK";
10
+ AIR: "AIR";
11
11
  RAIL: "RAIL";
12
12
  SEA: "SEA";
13
13
  }>;
package/dist/codecs.d.ts CHANGED
@@ -30,10 +30,13 @@ export { OtherChargeCodec } from './classes/other-charge/index.js';
30
30
  export { PartyCodec } from './classes/party/index.js';
31
31
  export { PersonCodec } from './classes/person/index.js';
32
32
  export { PieceCodec } from './classes/piece/index.js';
33
+ export { PriceCodec } from './classes/price/index.js';
34
+ export { RatingsCodec } from './classes/ratings/index.js';
33
35
  export { ServerInformationCodec } from './classes/server-information/index.js';
34
36
  export { ShipmentCodec } from './classes/shipment/index.js';
35
37
  export { SubscriptionCodec } from './classes/subscription/index.js';
36
38
  export { SubscriptionRequestCodec } from './classes/subscription-request/index.js';
39
+ export { TransportLegsCodec } from './classes/transport-legs/index.js';
37
40
  export { TransportMovementCodec } from './classes/transport-movement/index.js';
38
41
  export { RegulatedEntityCodec } from './classes/regulated-entity/index.js';
39
42
  export { SecurityDeclarationCodec } from './classes/security-declaration/index.js';