@flaks/onerecord 0.2.0 → 0.4.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 (335) hide show
  1. package/CHANGELOG.md +145 -0
  2. package/MIGRATING.md +129 -0
  3. package/README.md +42 -34
  4. package/dist/classes/account-number/schema.d.ts +2 -7
  5. package/dist/classes/account-number/schema.d.ts.map +1 -1
  6. package/dist/classes/account-number/schema.js +7 -4
  7. package/dist/classes/account-number/schema.js.map +1 -1
  8. package/dist/classes/co2-emissions/codec.d.ts +4 -0
  9. package/dist/classes/co2-emissions/codec.d.ts.map +1 -0
  10. package/dist/classes/co2-emissions/codec.js +11 -0
  11. package/dist/classes/co2-emissions/codec.js.map +1 -0
  12. package/dist/classes/co2-emissions/deserialize.d.ts +5 -0
  13. package/dist/classes/co2-emissions/deserialize.d.ts.map +1 -0
  14. package/dist/classes/co2-emissions/deserialize.js +64 -0
  15. package/dist/classes/co2-emissions/deserialize.js.map +1 -0
  16. package/dist/classes/co2-emissions/index.d.ts +6 -0
  17. package/dist/classes/co2-emissions/index.d.ts.map +1 -0
  18. package/dist/classes/co2-emissions/index.js +5 -0
  19. package/dist/classes/co2-emissions/index.js.map +1 -0
  20. package/dist/classes/co2-emissions/schema.d.ts +18 -0
  21. package/dist/classes/co2-emissions/schema.d.ts.map +1 -0
  22. package/dist/classes/co2-emissions/schema.js +12 -0
  23. package/dist/classes/co2-emissions/schema.js.map +1 -0
  24. package/dist/classes/co2-emissions/serialize.d.ts +6 -0
  25. package/dist/classes/co2-emissions/serialize.d.ts.map +1 -0
  26. package/dist/classes/co2-emissions/serialize.js +28 -0
  27. package/dist/classes/co2-emissions/serialize.js.map +1 -0
  28. package/dist/classes/company/codec.d.ts +4 -0
  29. package/dist/classes/company/codec.d.ts.map +1 -0
  30. package/dist/classes/company/codec.js +11 -0
  31. package/dist/classes/company/codec.js.map +1 -0
  32. package/dist/classes/company/deserialize.d.ts +5 -0
  33. package/dist/classes/company/deserialize.d.ts.map +1 -0
  34. package/dist/classes/company/deserialize.js +64 -0
  35. package/dist/classes/company/deserialize.js.map +1 -0
  36. package/dist/classes/company/index.d.ts +6 -0
  37. package/dist/classes/company/index.d.ts.map +1 -0
  38. package/dist/classes/company/index.js +5 -0
  39. package/dist/classes/company/index.js.map +1 -0
  40. package/dist/classes/company/schema.d.ts +23 -0
  41. package/dist/classes/company/schema.d.ts.map +1 -0
  42. package/dist/classes/company/schema.js +23 -0
  43. package/dist/classes/company/schema.js.map +1 -0
  44. package/dist/classes/company/serialize.d.ts +6 -0
  45. package/dist/classes/company/serialize.d.ts.map +1 -0
  46. package/dist/classes/company/serialize.js +28 -0
  47. package/dist/classes/company/serialize.js.map +1 -0
  48. package/dist/classes/composing/codec.d.ts +4 -0
  49. package/dist/classes/composing/codec.d.ts.map +1 -0
  50. package/dist/classes/composing/codec.js +11 -0
  51. package/dist/classes/composing/codec.js.map +1 -0
  52. package/dist/classes/composing/deserialize.d.ts +5 -0
  53. package/dist/classes/composing/deserialize.d.ts.map +1 -0
  54. package/dist/classes/composing/deserialize.js +64 -0
  55. package/dist/classes/composing/deserialize.js.map +1 -0
  56. package/dist/classes/composing/index.d.ts +6 -0
  57. package/dist/classes/composing/index.d.ts.map +1 -0
  58. package/dist/classes/composing/index.js +5 -0
  59. package/dist/classes/composing/index.js.map +1 -0
  60. package/dist/classes/composing/schema.d.ts +27 -0
  61. package/dist/classes/composing/schema.d.ts.map +1 -0
  62. package/dist/classes/composing/schema.js +19 -0
  63. package/dist/classes/composing/schema.js.map +1 -0
  64. package/dist/classes/composing/serialize.d.ts +6 -0
  65. package/dist/classes/composing/serialize.d.ts.map +1 -0
  66. package/dist/classes/composing/serialize.js +28 -0
  67. package/dist/classes/composing/serialize.js.map +1 -0
  68. package/dist/classes/customs-information/codec.d.ts +4 -0
  69. package/dist/classes/customs-information/codec.d.ts.map +1 -0
  70. package/dist/classes/customs-information/codec.js +11 -0
  71. package/dist/classes/customs-information/codec.js.map +1 -0
  72. package/dist/classes/customs-information/deserialize.d.ts +5 -0
  73. package/dist/classes/customs-information/deserialize.d.ts.map +1 -0
  74. package/dist/classes/customs-information/deserialize.js +64 -0
  75. package/dist/classes/customs-information/deserialize.js.map +1 -0
  76. package/dist/classes/customs-information/index.d.ts +6 -0
  77. package/dist/classes/customs-information/index.d.ts.map +1 -0
  78. package/dist/classes/customs-information/index.js +5 -0
  79. package/dist/classes/customs-information/index.js.map +1 -0
  80. package/dist/classes/customs-information/schema.d.ts +18 -0
  81. package/dist/classes/customs-information/schema.d.ts.map +1 -0
  82. package/dist/classes/customs-information/schema.js +17 -0
  83. package/dist/classes/customs-information/schema.js.map +1 -0
  84. package/dist/classes/customs-information/serialize.d.ts +6 -0
  85. package/dist/classes/customs-information/serialize.d.ts.map +1 -0
  86. package/dist/classes/customs-information/serialize.js +28 -0
  87. package/dist/classes/customs-information/serialize.js.map +1 -0
  88. package/dist/classes/insurance/codec.d.ts +4 -0
  89. package/dist/classes/insurance/codec.d.ts.map +1 -0
  90. package/dist/classes/insurance/codec.js +11 -0
  91. package/dist/classes/insurance/codec.js.map +1 -0
  92. package/dist/classes/insurance/deserialize.d.ts +5 -0
  93. package/dist/classes/insurance/deserialize.d.ts.map +1 -0
  94. package/dist/classes/insurance/deserialize.js +64 -0
  95. package/dist/classes/insurance/deserialize.js.map +1 -0
  96. package/dist/classes/insurance/index.d.ts +6 -0
  97. package/dist/classes/insurance/index.d.ts.map +1 -0
  98. package/dist/classes/insurance/index.js +5 -0
  99. package/dist/classes/insurance/index.js.map +1 -0
  100. package/dist/classes/insurance/schema.d.ts +17 -0
  101. package/dist/classes/insurance/schema.d.ts.map +1 -0
  102. package/dist/classes/insurance/schema.js +11 -0
  103. package/dist/classes/insurance/schema.js.map +1 -0
  104. package/dist/classes/insurance/serialize.d.ts +6 -0
  105. package/dist/classes/insurance/serialize.d.ts.map +1 -0
  106. package/dist/classes/insurance/serialize.js +28 -0
  107. package/dist/classes/insurance/serialize.js.map +1 -0
  108. package/dist/classes/line-item-package/codec.d.ts +4 -0
  109. package/dist/classes/line-item-package/codec.d.ts.map +1 -0
  110. package/dist/classes/line-item-package/codec.js +11 -0
  111. package/dist/classes/line-item-package/codec.js.map +1 -0
  112. package/dist/classes/line-item-package/deserialize.d.ts +5 -0
  113. package/dist/classes/line-item-package/deserialize.d.ts.map +1 -0
  114. package/dist/classes/line-item-package/deserialize.js +64 -0
  115. package/dist/classes/line-item-package/deserialize.js.map +1 -0
  116. package/dist/classes/line-item-package/index.d.ts +6 -0
  117. package/dist/classes/line-item-package/index.d.ts.map +1 -0
  118. package/dist/classes/line-item-package/index.js +5 -0
  119. package/dist/classes/line-item-package/index.js.map +1 -0
  120. package/dist/classes/line-item-package/schema.d.ts +22 -0
  121. package/dist/classes/line-item-package/schema.d.ts.map +1 -0
  122. package/dist/classes/line-item-package/schema.js +12 -0
  123. package/dist/classes/line-item-package/schema.js.map +1 -0
  124. package/dist/classes/line-item-package/serialize.d.ts +6 -0
  125. package/dist/classes/line-item-package/serialize.d.ts.map +1 -0
  126. package/dist/classes/line-item-package/serialize.js +28 -0
  127. package/dist/classes/line-item-package/serialize.js.map +1 -0
  128. package/dist/classes/loading-material/codec.d.ts +4 -0
  129. package/dist/classes/loading-material/codec.d.ts.map +1 -0
  130. package/dist/classes/loading-material/codec.js +11 -0
  131. package/dist/classes/loading-material/codec.js.map +1 -0
  132. package/dist/classes/loading-material/deserialize.d.ts +5 -0
  133. package/dist/classes/loading-material/deserialize.d.ts.map +1 -0
  134. package/dist/classes/loading-material/deserialize.js +64 -0
  135. package/dist/classes/loading-material/deserialize.js.map +1 -0
  136. package/dist/classes/loading-material/index.d.ts +6 -0
  137. package/dist/classes/loading-material/index.d.ts.map +1 -0
  138. package/dist/classes/loading-material/index.js +5 -0
  139. package/dist/classes/loading-material/index.js.map +1 -0
  140. package/dist/classes/loading-material/schema.d.ts +20 -0
  141. package/dist/classes/loading-material/schema.d.ts.map +1 -0
  142. package/dist/classes/loading-material/schema.js +14 -0
  143. package/dist/classes/loading-material/schema.js.map +1 -0
  144. package/dist/classes/loading-material/serialize.d.ts +6 -0
  145. package/dist/classes/loading-material/serialize.d.ts.map +1 -0
  146. package/dist/classes/loading-material/serialize.js +28 -0
  147. package/dist/classes/loading-material/serialize.js.map +1 -0
  148. package/dist/classes/other-charge/codec.d.ts +4 -0
  149. package/dist/classes/other-charge/codec.d.ts.map +1 -0
  150. package/dist/classes/other-charge/codec.js +11 -0
  151. package/dist/classes/other-charge/codec.js.map +1 -0
  152. package/dist/classes/other-charge/deserialize.d.ts +5 -0
  153. package/dist/classes/other-charge/deserialize.d.ts.map +1 -0
  154. package/dist/classes/other-charge/deserialize.js +64 -0
  155. package/dist/classes/other-charge/deserialize.js.map +1 -0
  156. package/dist/classes/other-charge/index.d.ts +6 -0
  157. package/dist/classes/other-charge/index.d.ts.map +1 -0
  158. package/dist/classes/other-charge/index.js +5 -0
  159. package/dist/classes/other-charge/index.js.map +1 -0
  160. package/dist/classes/other-charge/schema.d.ts +27 -0
  161. package/dist/classes/other-charge/schema.d.ts.map +1 -0
  162. package/dist/classes/other-charge/schema.js +14 -0
  163. package/dist/classes/other-charge/schema.js.map +1 -0
  164. package/dist/classes/other-charge/serialize.d.ts +6 -0
  165. package/dist/classes/other-charge/serialize.d.ts.map +1 -0
  166. package/dist/classes/other-charge/serialize.js +28 -0
  167. package/dist/classes/other-charge/serialize.js.map +1 -0
  168. package/dist/classes/party/schema.d.ts +9 -1
  169. package/dist/classes/party/schema.d.ts.map +1 -1
  170. package/dist/classes/party/schema.js +5 -2
  171. package/dist/classes/party/schema.js.map +1 -1
  172. package/dist/classes/piece/schema.d.ts +11 -0
  173. package/dist/classes/piece/schema.d.ts.map +1 -1
  174. package/dist/classes/piece/schema.js +10 -0
  175. package/dist/classes/piece/schema.js.map +1 -1
  176. package/dist/classes/regulated-entity/codec.d.ts +4 -0
  177. package/dist/classes/regulated-entity/codec.d.ts.map +1 -0
  178. package/dist/classes/regulated-entity/codec.js +11 -0
  179. package/dist/classes/regulated-entity/codec.js.map +1 -0
  180. package/dist/classes/regulated-entity/deserialize.d.ts +5 -0
  181. package/dist/classes/regulated-entity/deserialize.d.ts.map +1 -0
  182. package/dist/classes/regulated-entity/deserialize.js +64 -0
  183. package/dist/classes/regulated-entity/deserialize.js.map +1 -0
  184. package/dist/classes/regulated-entity/index.d.ts +6 -0
  185. package/dist/classes/regulated-entity/index.d.ts.map +1 -0
  186. package/dist/classes/regulated-entity/index.js +5 -0
  187. package/dist/classes/regulated-entity/index.js.map +1 -0
  188. package/dist/classes/regulated-entity/schema.d.ts +19 -0
  189. package/dist/classes/regulated-entity/schema.d.ts.map +1 -0
  190. package/dist/classes/regulated-entity/schema.js +12 -0
  191. package/dist/classes/regulated-entity/schema.js.map +1 -0
  192. package/dist/classes/regulated-entity/serialize.d.ts +6 -0
  193. package/dist/classes/regulated-entity/serialize.d.ts.map +1 -0
  194. package/dist/classes/regulated-entity/serialize.js +28 -0
  195. package/dist/classes/regulated-entity/serialize.js.map +1 -0
  196. package/dist/classes/security-declaration/codec.d.ts +4 -0
  197. package/dist/classes/security-declaration/codec.d.ts.map +1 -0
  198. package/dist/classes/security-declaration/codec.js +11 -0
  199. package/dist/classes/security-declaration/codec.js.map +1 -0
  200. package/dist/classes/security-declaration/deserialize.d.ts +5 -0
  201. package/dist/classes/security-declaration/deserialize.d.ts.map +1 -0
  202. package/dist/classes/security-declaration/deserialize.js +64 -0
  203. package/dist/classes/security-declaration/deserialize.js.map +1 -0
  204. package/dist/classes/security-declaration/index.d.ts +6 -0
  205. package/dist/classes/security-declaration/index.d.ts.map +1 -0
  206. package/dist/classes/security-declaration/index.js +5 -0
  207. package/dist/classes/security-declaration/index.js.map +1 -0
  208. package/dist/classes/security-declaration/schema.d.ts +44 -0
  209. package/dist/classes/security-declaration/schema.d.ts.map +1 -0
  210. package/dist/classes/security-declaration/schema.js +21 -0
  211. package/dist/classes/security-declaration/schema.js.map +1 -0
  212. package/dist/classes/security-declaration/serialize.d.ts +6 -0
  213. package/dist/classes/security-declaration/serialize.d.ts.map +1 -0
  214. package/dist/classes/security-declaration/serialize.js +28 -0
  215. package/dist/classes/security-declaration/serialize.js.map +1 -0
  216. package/dist/classes/shared/value.d.ts +44 -0
  217. package/dist/classes/shared/value.d.ts.map +1 -0
  218. package/dist/classes/shared/value.js +39 -0
  219. package/dist/classes/shared/value.js.map +1 -0
  220. package/dist/classes/shipment/schema.d.ts +31 -8
  221. package/dist/classes/shipment/schema.d.ts.map +1 -1
  222. package/dist/classes/shipment/schema.js +15 -5
  223. package/dist/classes/shipment/schema.js.map +1 -1
  224. package/dist/classes/transport-movement/schema.d.ts +22 -0
  225. package/dist/classes/transport-movement/schema.d.ts.map +1 -1
  226. package/dist/classes/transport-movement/schema.js +7 -0
  227. package/dist/classes/transport-movement/schema.js.map +1 -1
  228. package/dist/classes/uld/codec.d.ts +4 -0
  229. package/dist/classes/uld/codec.d.ts.map +1 -0
  230. package/dist/classes/uld/codec.js +11 -0
  231. package/dist/classes/uld/codec.js.map +1 -0
  232. package/dist/classes/uld/deserialize.d.ts +5 -0
  233. package/dist/classes/uld/deserialize.d.ts.map +1 -0
  234. package/dist/classes/uld/deserialize.js +64 -0
  235. package/dist/classes/uld/deserialize.js.map +1 -0
  236. package/dist/classes/uld/index.d.ts +6 -0
  237. package/dist/classes/uld/index.d.ts.map +1 -0
  238. package/dist/classes/uld/index.js +5 -0
  239. package/dist/classes/uld/index.js.map +1 -0
  240. package/dist/classes/uld/schema.d.ts +31 -0
  241. package/dist/classes/uld/schema.d.ts.map +1 -0
  242. package/dist/classes/uld/schema.js +29 -0
  243. package/dist/classes/uld/schema.js.map +1 -0
  244. package/dist/classes/uld/serialize.d.ts +6 -0
  245. package/dist/classes/uld/serialize.d.ts.map +1 -0
  246. package/dist/classes/uld/serialize.js +28 -0
  247. package/dist/classes/uld/serialize.js.map +1 -0
  248. package/dist/classes/unit-composition/codec.d.ts +4 -0
  249. package/dist/classes/unit-composition/codec.d.ts.map +1 -0
  250. package/dist/classes/unit-composition/codec.js +11 -0
  251. package/dist/classes/unit-composition/codec.js.map +1 -0
  252. package/dist/classes/unit-composition/deserialize.d.ts +5 -0
  253. package/dist/classes/unit-composition/deserialize.d.ts.map +1 -0
  254. package/dist/classes/unit-composition/deserialize.js +64 -0
  255. package/dist/classes/unit-composition/deserialize.js.map +1 -0
  256. package/dist/classes/unit-composition/index.d.ts +6 -0
  257. package/dist/classes/unit-composition/index.d.ts.map +1 -0
  258. package/dist/classes/unit-composition/index.js +5 -0
  259. package/dist/classes/unit-composition/index.js.map +1 -0
  260. package/dist/classes/unit-composition/schema.d.ts +15 -0
  261. package/dist/classes/unit-composition/schema.d.ts.map +1 -0
  262. package/dist/classes/unit-composition/schema.js +12 -0
  263. package/dist/classes/unit-composition/schema.js.map +1 -0
  264. package/dist/classes/unit-composition/serialize.d.ts +6 -0
  265. package/dist/classes/unit-composition/serialize.d.ts.map +1 -0
  266. package/dist/classes/unit-composition/serialize.js +28 -0
  267. package/dist/classes/unit-composition/serialize.js.map +1 -0
  268. package/dist/classes/waybill/schema.d.ts +45 -5
  269. package/dist/classes/waybill/schema.d.ts.map +1 -1
  270. package/dist/classes/waybill/schema.js +28 -7
  271. package/dist/classes/waybill/schema.js.map +1 -1
  272. package/dist/classes/waybill-line-item/codec.d.ts +4 -0
  273. package/dist/classes/waybill-line-item/codec.d.ts.map +1 -0
  274. package/dist/classes/waybill-line-item/codec.js +11 -0
  275. package/dist/classes/waybill-line-item/codec.js.map +1 -0
  276. package/dist/classes/waybill-line-item/deserialize.d.ts +5 -0
  277. package/dist/classes/waybill-line-item/deserialize.d.ts.map +1 -0
  278. package/dist/classes/waybill-line-item/deserialize.js +64 -0
  279. package/dist/classes/waybill-line-item/deserialize.js.map +1 -0
  280. package/dist/classes/waybill-line-item/index.d.ts +6 -0
  281. package/dist/classes/waybill-line-item/index.d.ts.map +1 -0
  282. package/dist/classes/waybill-line-item/index.js +5 -0
  283. package/dist/classes/waybill-line-item/index.js.map +1 -0
  284. package/dist/classes/waybill-line-item/schema.d.ts +44 -0
  285. package/dist/classes/waybill-line-item/schema.d.ts.map +1 -0
  286. package/dist/classes/waybill-line-item/schema.js +22 -0
  287. package/dist/classes/waybill-line-item/schema.js.map +1 -0
  288. package/dist/classes/waybill-line-item/serialize.d.ts +6 -0
  289. package/dist/classes/waybill-line-item/serialize.d.ts.map +1 -0
  290. package/dist/classes/waybill-line-item/serialize.js +28 -0
  291. package/dist/classes/waybill-line-item/serialize.js.map +1 -0
  292. package/dist/codecs.d.ts +14 -2
  293. package/dist/codecs.d.ts.map +1 -1
  294. package/dist/codecs.js +14 -2
  295. package/dist/codecs.js.map +1 -1
  296. package/dist/codes/enums.d.ts +40 -0
  297. package/dist/codes/enums.d.ts.map +1 -1
  298. package/dist/codes/enums.js +5 -0
  299. package/dist/codes/enums.js.map +1 -1
  300. package/dist/codes/index.d.ts +1 -1
  301. package/dist/codes/index.d.ts.map +1 -1
  302. package/dist/codes/index.js +1 -1
  303. package/dist/codes/index.js.map +1 -1
  304. package/dist/dispatch/domain-constraints.d.ts +13 -8
  305. package/dist/dispatch/domain-constraints.d.ts.map +1 -1
  306. package/dist/dispatch/domain-constraints.js +14 -24
  307. package/dist/dispatch/domain-constraints.js.map +1 -1
  308. package/dist/dispatch/field-types.d.ts +2 -3
  309. package/dist/dispatch/field-types.d.ts.map +1 -1
  310. package/dist/dispatch/field-types.js +60 -13
  311. package/dist/dispatch/field-types.js.map +1 -1
  312. package/dist/dispatch/graph-walk.d.ts.map +1 -1
  313. package/dist/dispatch/graph-walk.js +9 -8
  314. package/dist/dispatch/graph-walk.js.map +1 -1
  315. package/dist/facade.d.ts +15 -3
  316. package/dist/facade.d.ts.map +1 -1
  317. package/dist/factory-classes.d.ts +33 -6
  318. package/dist/factory-classes.d.ts.map +1 -1
  319. package/dist/factory-classes.js +33 -6
  320. package/dist/factory-classes.js.map +1 -1
  321. package/dist/index.d.ts +27 -3
  322. package/dist/index.d.ts.map +1 -1
  323. package/dist/index.js +27 -3
  324. package/dist/index.js.map +1 -1
  325. package/dist/iri/zod-safe-iri.d.ts +18 -2
  326. package/dist/iri/zod-safe-iri.d.ts.map +1 -1
  327. package/dist/iri/zod-safe-iri.js +14 -2
  328. package/dist/iri/zod-safe-iri.js.map +1 -1
  329. package/dist/types/index.d.ts +10 -1
  330. package/dist/types/index.d.ts.map +1 -1
  331. package/dist/version.d.ts +9 -4
  332. package/dist/version.d.ts.map +1 -1
  333. package/dist/version.js +18 -6
  334. package/dist/version.js.map +1 -1
  335. package/package.json +7 -6
package/CHANGELOG.md CHANGED
@@ -4,6 +4,151 @@ All notable changes are documented here. Format follows
4
4
  [Keep a Changelog](https://keepachangelog.com/), versioning follows
5
5
  [SemVer](https://semver.org/) per the policy in `MIGRATING.md`.
6
6
 
7
+ ## [0.4.0] - 2026-05-19
8
+
9
+ ULD composition classes: the `:UnitComposition` / `:Composing` /
10
+ `:LoadingMaterial` ULD-build model plus the `CompositionType` code list.
11
+ Purely **additive** — no breaking changes, no schema rewrites. Every
12
+ modelling deviation is non-breaking and documented in
13
+ `docs/spec-deviations.md` §17. No migration required (see `MIGRATING.md`).
14
+
15
+ ### Added
16
+
17
+ - **`CompositionType`** code list — `COMPOSITION` | `DECOMPOSITION`
18
+ (`:CompositionType` individuals); the action sense of a `Composing` record.
19
+ - **`LoadingMaterial`** class — `:LoadingMaterial` (dunnage / securing /
20
+ load-distribution material used in a ULD build).
21
+ - **`UnitComposition`** class — `:UnitComposition` (the assembled ULD-load
22
+ record grouping a `ULD` with its constituent `Piece`s and loading material).
23
+ - **`Composing`** class — `:Composing` (the `:LogisticsActivity`-derived
24
+ loading/unloading action that produces or breaks a `UnitComposition`;
25
+ carries `compositionType`).
26
+ - **`ULD.inUnitComposition`** property — back-reference from a `ULD` to the
27
+ `UnitComposition` it participates in.
28
+ - Codecs, schemas, and `serialize*` / `serialize*Strict` / `deserialize*`
29
+ helpers for `LoadingMaterial`, `UnitComposition`, and `Composing`
30
+ (`*Codec`, `*Schema`, `serializeComposing`, `serializeComposingStrict`,
31
+ `deserializeComposing`, and the `UnitComposition` / `LoadingMaterial`
32
+ equivalents).
33
+
34
+ ### Notes
35
+
36
+ - Several inherited optional `:LogisticsActivity` / `:LogisticsObject`
37
+ properties are intentionally omitted from `Composing` / `UnitComposition`
38
+ (e.g. `actionTimeType`, `contactDetails`, `executionStatus`,
39
+ `checkActions`, `servedServices`). All are optional in the 3.2-rc2
40
+ ontology and can be added non-breakingly later — see
41
+ `docs/spec-deviations.md` §17 for the per-property rationale.
42
+
43
+ ## [0.3.0] - 2026-05-17
44
+
45
+ FWB-equivalence Path A: 10 new classes, schema rewrites for the core FWB
46
+ classes, full IATA 3.2.0 conformance for the covered class set with documented
47
+ deviations and 3.2.1-forward extensions. See `MIGRATING.md` for per-breaking-
48
+ change migration guidance.
49
+
50
+ ### Added
51
+
52
+ - **`Company`** class — concrete `:Organization` subtype; retires the abstract
53
+ `Organization` class. `Party.partyDetails` and all Organization-range fields
54
+ now point to `Company`.
55
+ - **`WaybillLineItem`** class — FWB rate/charge line item.
56
+ - **`OtherCharge`** class — FWB OCI/other-charge block.
57
+ - **`CustomsInformation`** class — FWB customs information block.
58
+ - **`Insurance`** class — FWB insurance details.
59
+ - **`LineItemPackage`** class — FWB package-level line item.
60
+ - **`ULD`** class — unit load device reference.
61
+ - **`CO2Emissions`** class — carbon emissions per spec §D6.
62
+ - **`RegulatedEntity`** class — security regulated entity (shipper/handler).
63
+ - **`SecurityDeclaration`** class — security declaration per spec §8.
64
+ - **Shared value sub-schemas**: `ValueSchema`, `CurrencyValueSchema`,
65
+ `DimensionsSchema` — used by all NEW value-typed properties in v0.3.0.
66
+ - **FWB properties** on `Waybill`: `shipment`, `involvedParties`,
67
+ `waybillLineItems`, `otherCharges`, `carrierDeclarationPlace`,
68
+ `departureLocation`, `arrivalLocation`, `houseWaybills`, `masterWaybill`,
69
+ `billingDetails` (IRI ref only; `:BillingDetails` class not modelled — deviation #16).
70
+ `accountingInformation` — deprecated upstream (owl:deprecated true in
71
+ 3.2-rc2 ~2861) — **deviation #15**.
72
+ - **FWB properties** on `Shipment`: `pieces`, `waybill`, `involvedParties`,
73
+ `customsInformation`, `insurance`, `securityDeclarations` (accepted as
74
+ optional 3.2.1-forward extension — deviation #12).
75
+ - **FWB properties** on `Piece`: `ofShipment`, `containedPieces`,
76
+ `securityDeclarations` (3.2.0-conformant via Piece restriction ~8260).
77
+ - `CARGO_ONTOLOGY_VERSION` bumped from `'3.2'` to `'3.2.0'` (exact endorsed
78
+ version string). Legacy alias `'3.2'` remains accepted by
79
+ `assertOntologyVersion` and `checkServerInformation`.
80
+
81
+ ### Changed
82
+
83
+ - **`Organization` class retired** — replaced by `Company`
84
+ (`:Company rdfs:subClassOf :Organization`; the only concrete org type shipped).
85
+ `Party.partyDetails` widened to accept `IRI | {@id}` (Person or Company).
86
+ `NI` added as accepted `Party.partyRole` value.
87
+ - **`Waybill`**: dropped `shipmentInformation` (renamed to `shipment`);
88
+ dropped `totalGrossWeight` (the field already exists on `Shipment` — use that).
89
+ - **`Shipment`**: dropped `pieceCount`, `totalVolume`, `containedPieces`
90
+ (renamed to `pieces`), `shipper`, `consignee` (moved to `involvedParties`).
91
+ - **`waybillType` enum**: `DIRECT` added.
92
+ - **`waybillPrefix`**: now accepts `[A-Z0-9]{1,3}` (editorial policy relaxation
93
+ — NOT a spec pattern; the ontology has only `xsd:string maxLength 3`).
94
+ - **`waybillNumber`**: now accepts `[A-Z0-9]+` per 3.2-rc2 ontology pattern.
95
+ - **`AccountNumber`**: `accountNumber`/`issuedBy`/`accountType` renamed to
96
+ `accountNumberType`/`textualValue`; `issuedBy` removed (wrong domain — belongs
97
+ to `:SecurityDeclaration`, not `:AccountNumber`).
98
+ - **`CARGO_ONTOLOGY_VERSION`**: `'3.2'` → `'3.2.0'`. `assertOntologyVersion`
99
+ and `checkServerInformation` now use an exact-alias accepted set
100
+ (`'3.2'` ≡ `'3.2.0'`, `'3.2.1'` rejected — NOT prefix-tolerant).
101
+ - **`FIELD_TYPES` map**: stale v0.2 entries removed (`Waybill.shipmentInformation`,
102
+ `Shipment.containedPieces`, `Shipment.consignee`, `Shipment.shipper`,
103
+ `Organization.address`, `Organization.contactPersons`,
104
+ `AccountNumber.issuedBy`); ~40 new entries added for v0.3.0 classes.
105
+ - **Domain constraints** (`domain-constraints.ts`): stale v0.2 constraints
106
+ on `Waybill.shipmentInformation` and `Shipment.containedPieces` removed.
107
+ No spec basis post-Path-A; the corrected cross-node check
108
+ (Waybill↔Shipment inverse-property consistency) is deferred.
109
+
110
+ ### BREAKING CHANGES
111
+
112
+ Consumers upgrading from v0.2.x must audit the following:
113
+
114
+ 1. **`Organization` class removed** — import `Company` instead. Any code
115
+ referencing `OrganizationSchema`, `OrganizationCodec`, `serializeOrganization`,
116
+ or `deserializeOrganization` will break.
117
+ 2. **`Waybill.shipmentInformation` removed** — use `Waybill.shipment`.
118
+ 3. **`Waybill.totalGrossWeight` removed** — field moved to `Shipment`.
119
+ 4. **`Shipment.pieceCount` removed** — no direct replacement (compute from `pieces.length`).
120
+ 5. **`Shipment.totalVolume` removed** — no direct replacement in v0.3.0.
121
+ 6. **`Shipment.containedPieces` removed** — use `Shipment.pieces`.
122
+ 7. **`Shipment.shipper` / `Shipment.consignee` removed** — use `Shipment.involvedParties`
123
+ filtered by `partyRole`.
124
+ 8. **`waybillType` enum**: `DIRECT` is now a valid value — exhaustive switches
125
+ must handle it.
126
+ 9. **`waybillPrefix`**: now accepts alphanumeric `[A-Z0-9]{1,3}` — do not
127
+ assume numeric-only downstream.
128
+ 10. **`waybillNumber`**: now accepts `[A-Z0-9]+` — do not assume numeric-only.
129
+ 11. **`AccountNumber` fields renamed**: `accountNumber` → `textualValue`,
130
+ `accountType` → `accountNumberType`; `issuedBy` removed.
131
+ 12. **`Party.partyDetails`** widened (additive for accept — a bare IRI still
132
+ validates; see MIGRATING.md for detail).
133
+ 13. **`CARGO_ONTOLOGY_VERSION`** changed from `'3.2'` to `'3.2.0'`. Any code
134
+ doing `=== '3.2'` on the constant will need updating.
135
+ 14. **`assertOntologyVersion('3.2.1')`** now throws (previously any mismatch
136
+ with `'3.2'` would throw; now the exact-alias set `{'3.2.0','3.2'}` is
137
+ accepted and everything else including `'3.2.1'` is rejected).
138
+ 15. **`domain_constraint_violation`** for `Waybill.shipmentInformation` /
139
+ `Shipment.containedPieces` no longer fires (those fields no longer exist).
140
+ 16. **`Party.partyRole`**: `'NI'` (also-notify, AWB box 7) is now an accepted
141
+ value — exhaustive `switch` statements over `partyRole` must handle it
142
+ (same migration class as `waybillType` `DIRECT`).
143
+
144
+ ### Spec deviations
145
+
146
+ - **#12 (reworded)**: `Shipment.securityDeclarations` is a documented
147
+ 3.2.1-forward extension — see `docs/spec-deviations.md#12`.
148
+ - **#14 (new)**: Legacy `{unit,value}` shape on 3 pre-existing fields.
149
+ - **#15 (new)**: `Waybill.accountingInformation` is `owl:deprecated` in 3.2-rc2.
150
+ - **#16 (new)**: `BillingDetails` class not modelled in v0.3.0.
151
+
7
152
  ## [0.2.0] - 2026-04-28
8
153
 
9
154
  First publicly verifiable release. Closes 3 of 5 v0.1.x spec
package/MIGRATING.md CHANGED
@@ -2,6 +2,135 @@
2
2
 
3
3
  This file documents one entry per minor release.
4
4
 
5
+ ## Migrating from v0.3.x to v0.4.0
6
+
7
+ **No action required.** v0.4.0 is purely additive: it introduces the ULD
8
+ composition model (`UnitComposition`, `Composing`, `LoadingMaterial`, the
9
+ `CompositionType` code list, and the `ULD.inUnitComposition` back-reference).
10
+
11
+ - No classes removed, no fields renamed, no schema shapes changed.
12
+ - Existing v0.3.x wire payloads validate and round-trip unchanged.
13
+ - Adopt the new classes only if you produce or consume ULD-build records;
14
+ otherwise upgrading is transparent.
15
+
16
+ Per the SemVer policy below, this minor bump carries no breaking changes
17
+ (it could have, but does not). Every modelling deviation in the new classes
18
+ is non-breaking and documented in `docs/spec-deviations.md` §17.
19
+
20
+ ## Migrating from v0.2.x to v0.3.0
21
+
22
+ v0.3.0 is a **breaking release**. Review every item below before upgrading.
23
+
24
+ ### 1. `Organization` class retired → use `Company`
25
+
26
+ `Organization` is removed. Import and use `Company` instead. Update all
27
+ references to `OrganizationSchema`, `OrganizationCodec`, `serializeOrganization`,
28
+ `deserializeOrganization`.
29
+
30
+ ```typescript
31
+ // Before (v0.2.x)
32
+ import { OrganizationCodec } from '@flaks/onerecord'
33
+ // After (v0.3.0)
34
+ import { CompanyCodec } from '@flaks/onerecord'
35
+ ```
36
+
37
+ ### 2. `Waybill.shipmentInformation` → `Waybill.shipment`
38
+
39
+ ```typescript
40
+ // Before
41
+ waybill.shipmentInformation = 'https://example/sh'
42
+ // After
43
+ waybill.shipment = 'https://example/sh'
44
+ ```
45
+
46
+ ### 3. `Shipment.containedPieces` → `Shipment.pieces`
47
+
48
+ ```typescript
49
+ // Before
50
+ shipment.containedPieces = ['https://example/p1']
51
+ // After
52
+ shipment.pieces = ['https://example/p1']
53
+ ```
54
+
55
+ ### 4. `Shipment.shipper` / `Shipment.consignee` → `Shipment.involvedParties`
56
+
57
+ The `shipper` and `consignee` top-level fields on `Shipment` are removed.
58
+ Use `Shipment.involvedParties` filtered by `partyRole`:
59
+
60
+ ```typescript
61
+ const shipper = shipment.involvedParties?.find(p => p.partyRole === 'SHP')
62
+ const consignee = shipment.involvedParties?.find(p => p.partyRole === 'CNE')
63
+ ```
64
+
65
+ ### 5. `Shipment.pieceCount` / `Shipment.totalVolume` removed
66
+
67
+ No direct replacement in v0.3.0. Compute `pieceCount` from `pieces.length`
68
+ if needed. `totalVolume` is deferred (no spec-correct successor in scope).
69
+
70
+ ### 6. `AccountNumber` field renames
71
+
72
+ | v0.2.x field | v0.3.0 field | Notes |
73
+ |---|---|---|
74
+ | `accountNumber` | `textualValue` | String value of the account number |
75
+ | `accountType` | `accountNumberType` | IRI ref to code value |
76
+ | `issuedBy` | removed | Wrong domain; belongs to `:SecurityDeclaration` |
77
+
78
+ ### 7. `Party.partyDetails` widening — additive for accept
79
+
80
+ `partyDetails` now accepts `Person | Company` (not `Person | Organization`).
81
+ **This is additive for deserializing**: a bare IRI still validates. Code
82
+ that checks `partyDetails['@type'] === 'Organization'` must be updated to
83
+ `'Company'`. The new `NI` value is accepted for `partyRole`.
84
+
85
+ ### 8. `waybillNumber` and `waybillPrefix` regex relaxation
86
+
87
+ - **`waybillNumber`**: now accepts `[A-Z0-9]+` **per the 3.2-rc2 ontology
88
+ pattern**. Do not assume numeric-only (`[0-9]+`) downstream.
89
+ - **`waybillPrefix`**: now accepts up to 3 alphanumeric characters (`[A-Z0-9]{1,3}`)
90
+ as the library's **EDITORIAL policy** — the ontology only specifies
91
+ `xsd:string maxLength 3` with no character-class restriction. Do not assume
92
+ numeric-only downstream.
93
+
94
+ ### 9. `CARGO_ONTOLOGY_VERSION` constant changed
95
+
96
+ The exported constant changed from `'3.2'` to `'3.2.0'`:
97
+
98
+ ```typescript
99
+ // Before: CARGO_ONTOLOGY_VERSION === '3.2'
100
+ // After: CARGO_ONTOLOGY_VERSION === '3.2.0'
101
+ ```
102
+
103
+ Any code doing `=== '3.2'` on the constant must be updated to `=== '3.2.0'`
104
+ (or use `CARGO_ONTOLOGY_VERSION` indirectly).
105
+
106
+ ### 10. `assertOntologyVersion` + `checkServerInformation` — exact-alias peer-compat policy
107
+
108
+ Both functions now use an **exact-alias accepted set**: `{'3.2.0', '3.2'}`.
109
+
110
+ - `assertOntologyVersion('3.2.0')` — does NOT throw (canonical pin)
111
+ - `assertOntologyVersion('3.2')` — does NOT throw (legacy alias ≡ 3.2.0)
112
+ - `assertOntologyVersion('3.2.1')` — THROWS `incompatible_ontology_version`
113
+ - `assertOntologyVersion('4.0')` — THROWS `incompatible_ontology_version`
114
+
115
+ The accepted set is **NOT** prefix-tolerant (`'3.2.1'` is master-only and
116
+ intentionally rejected). `checkServerInformation` follows the same rule:
117
+ a server advertising `cargoOntologyVersion: '3.2.1'` will return
118
+ `compatible: false`.
119
+
120
+ ### 11. `waybillType` enum: `DIRECT` added
121
+
122
+ If your code has an exhaustive `switch` on `waybillType`, add a `'DIRECT'`
123
+ case. TypeScript will surface this at compile time.
124
+
125
+ ### 12. `domain_constraint_violation` for stale fields no longer fires
126
+
127
+ If your code expected `domain_constraint_violation` for a Waybill missing
128
+ `shipmentInformation` or a Shipment missing `containedPieces`, those errors
129
+ no longer fire — those fields don't exist in v0.3.0. Update your error
130
+ handling to match the new field names (`shipment`, `pieces`).
131
+
132
+ ---
133
+
5
134
  ## Migrating from v0.1.x to v0.2.0
6
135
 
7
136
  v0.2.0 is **non-breaking at the call-site level** for v0.1.x consumers.
package/README.md CHANGED
@@ -1,18 +1,19 @@
1
1
  # @flaks/onerecord
2
2
 
3
- Zero-dependency Zod-first TypeScript mapper for the IATA OneRecord cargo data model 3.2 and API spec 2.2.0.
3
+ Zero-dependency Zod-first TypeScript mapper for the IATA OneRecord cargo data model 3.2.0 and API spec 2.2.0.
4
4
 
5
5
  ## What it is
6
6
 
7
7
  `@flaks/onerecord` provides round-trip-safe serialization and deserialization for
8
- 32 OneRecord cargo data model classes. Each class ships with a Zod schema, an
9
- application-layer TypeScript type, a `JsonLd<T>` brand, `serialize` / `serializeStrict`
10
- / `deserialize` functions, and a `Codec` bundle. A factory (`createMapper`) and a
11
- namespaced facade (`onerecord`) cover the two main consumption patterns. Safety
12
- primitives (depth, node, string, array, payload limits; prototype-pollution defense;
13
- IRI validation) run before Zod so that invalid JSON-LD graphs never reach schema
14
- evaluation. All 22 parse-error variants are typed as a discriminated union (`ParseError`)
15
- so callers handle every failure mode exhaustively.
8
+ the OneRecord cargo data model class set (Ring 1–5, booking-flow, and FWB-equivalence
9
+ classes added in v0.3.0). Each class ships with a Zod schema, an application-layer
10
+ TypeScript type, a `JsonLd<T>` brand, `serialize` / `serializeStrict` / `deserialize`
11
+ functions, and a `Codec` bundle. A factory (`createMapper`) and a namespaced facade
12
+ (`onerecord`) cover the two main consumption patterns. Safety primitives (depth, node,
13
+ string, array, payload limits; prototype-pollution defense; IRI validation) run before
14
+ Zod so that invalid JSON-LD graphs never reach schema evaluation. All parse-error
15
+ variants are typed as a discriminated union (`ParseError`) so callers handle every
16
+ failure mode exhaustively.
16
17
 
17
18
  ## Why use this library?
18
19
 
@@ -36,14 +37,20 @@ Use this library if you're building cargo software that needs to:
36
37
  `missing_type`, all surfaced as typed `ParseError` variants. Default
37
38
  per-class deserializers stay structural-only for v0.1.x compatibility;
38
39
  graph-walk is opt-in.
39
- - **Type-check** every parse-failure path: `ParseError` is a 22-variant
40
- discriminated union, so the compiler tells you when you've forgotten a
41
- failure mode.
40
+ - **Type-check** every parse-failure path: `ParseError` is a discriminated
41
+ union, so the compiler tells you when you've forgotten a failure mode.
42
42
 
43
43
  Skip it if you want a generic JSON-LD or RDF toolkit; this is purpose-built
44
44
  for the IATA cargo ontology and the ONE Record API spec 2.2.0.
45
45
 
46
- ### Publicly verifiable
46
+ ### Conformance and verifiability
47
+
48
+ This library is **3.2.0-conformant for the covered class set, with documented
49
+ deviations and 3.2.1-forward extensions**. Specifically:
50
+ `Shipment.securityDeclarations` is accepted as a documented 3.2.1-forward
51
+ extension (deviation #12). Every deviation is recorded in
52
+ [`docs/spec-deviations.md`](docs/spec-deviations.md) — read that before
53
+ adopting if your integration must match the spec verbatim.
47
54
 
48
55
  This library publishes verifiable artifacts so consumers can audit the
49
56
  conformance claim independently:
@@ -51,12 +58,13 @@ conformance claim independently:
51
58
  - All releases are GPG-signed git tags + signed npm tarballs (per
52
59
  [`MAINTENANCE.md`](MAINTENANCE.md)).
53
60
  - Every spec deviation is documented in [`docs/spec-deviations.md`](docs/spec-deviations.md)
54
- with status banners (CLOSED, PARTIAL, deferred-to-v0.3) and explicit
55
- guidance on what consumers should do today.
56
- - Property-based round-trip tests for the eight Ring 1+2 classes
57
- (Waybill, Shipment, Piece, Address, Person, Organization, Party,
58
- AccountNumber) — `serialize(deserialize(x))` is field-equivalent for
59
- any value an `Arbitrary` produces.
61
+ with status banners (CLOSED, PARTIAL, deferred) and explicit guidance
62
+ on what consumers should do today.
63
+ - A [`docs/conformance-matrix.md`](docs/conformance-matrix.md) maps each
64
+ class and field to its binding authority in `IATA-1R-DM-Ontology.ttl`.
65
+ - Property-based round-trip tests for the Ring 1+2 classes
66
+ — `serialize(deserialize(x))` is field-equivalent for any value an
67
+ `Arbitrary` produces.
60
68
  - Contract tests at `test/contract/` exercise the wire format
61
69
  end-to-end against the OLF-hosted reference NE:ONE Server (the IATA
62
70
  OneRecord reference implementation). See [`CONTRIBUTING.md`](CONTRIBUTING.md)
@@ -64,11 +72,11 @@ conformance claim independently:
64
72
 
65
73
  ## Status
66
74
 
67
- `v0.2.0` ships:
75
+ `v0.3.0` ships:
68
76
 
69
- - The 32 canonical cargo data model classes (Ring 1–5 plus booking-flow)
70
- with full round-trip codecs, Zod schemas, snapshot tests, and pre-Zod
71
- safety primitives.
77
+ - The canonical cargo data model class set (Ring 1–5, booking-flow, plus
78
+ 10 new FWB-equivalence classes in v0.3.0) with full round-trip codecs,
79
+ Zod schemas, snapshot tests, and pre-Zod safety primitives.
72
80
  - Opt-in **graph-walk dispatcher** (`createMapper({ graphWalk: true })` or
73
81
  `onerecord.dispatch.deserialize.<Class>`) emitting all four cross-node
74
82
  integrity ParseError kinds.
@@ -87,11 +95,11 @@ conformance claim independently:
87
95
  The library is Apache-2.0 and ready for use within the v0.x stability
88
96
  policy described in [`MIGRATING.md`](MIGRATING.md).
89
97
 
90
- Spec compliance: cargo data model **3.2 (2025-07 endorsed standard)**, API
91
- spec **2.2.0**. A small number of deliberate divergences from canonical
92
- spec behavior are documented in
93
- [`docs/spec-deviations.md`](docs/spec-deviations.md); read that before
94
- adopting if your integration must match the spec verbatim.
98
+ Spec compliance: cargo data model **3.2.0 (2025-07 endorsed standard, 3.2-rc2 file)**,
99
+ API spec **2.2.0**. The library is 3.2.0-conformant for the covered class set,
100
+ with documented deviations and 3.2.1-forward extensions. See
101
+ [`docs/spec-deviations.md`](docs/spec-deviations.md) and
102
+ [`docs/conformance-matrix.md`](docs/conformance-matrix.md) for the full picture.
95
103
 
96
104
  ## Install
97
105
 
@@ -163,7 +171,7 @@ const jsonLd = onerecord.serialize.Piece(piece)
163
171
 
164
172
  ### Per-class exports
165
173
 
166
- Each of the 32 classes exposes:
174
+ Each registered class exposes:
167
175
 
168
176
  | Export | Description |
169
177
  |---|---|
@@ -196,9 +204,9 @@ No bound state; suitable for one-off operations and tree-shake-friendly imports.
196
204
 
197
205
  ### Errors
198
206
 
199
- - `ParseError` — 22-variant discriminated union (`kind` field); covers
200
- `zod_validation`, `cardinality_violation`, `invalid_iri`, `depth_limit_exceeded`,
201
- `prototype_pollution_attempt`, `invalid_pointer`, and 16 more
207
+ - `ParseError` — discriminated union on `kind`; covers `zod_validation`,
208
+ `cardinality_violation`, `invalid_iri`, `depth_limit_exceeded`,
209
+ `prototype_pollution_attempt`, `invalid_pointer`, and more
202
210
  - `SerializationError` — `code: 'invalid_application_object' | 'iri_construction_failed'`
203
211
  - `formatError(e: ParseError): string` — human-readable message
204
212
  - `redactError(e: ParseError): ParseError` — strips PII from error payloads before logging
@@ -288,14 +296,14 @@ import type { Waybill, ParseError } from '@flaks/onerecord/types'
288
296
 
289
297
  | Spec | Version |
290
298
  |---|---|
291
- | Cargo data model | 3.2 (2025-07 endorsed standard) |
299
+ | Cargo data model | 3.2.0 (2025-07 endorsed standard, 3.2-rc2 ontology file) |
292
300
  | API spec | 2.2.0 |
293
301
 
294
302
  ## Development
295
303
 
296
304
  ```bash
297
305
  bun install
298
- bun run test # 518 passing + 10 skipped = 528 total
306
+ bun run test # see CI for current count
299
307
  bun run lint # Biome
300
308
  bun run typecheck # tsc --noEmit
301
309
  ```
@@ -4,13 +4,8 @@ export declare const AccountNumberSchema: z.ZodObject<{
4
4
  '@context': z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
5
5
  '@id': z.ZodString;
6
6
  '@type': z.ZodLiteral<"AccountNumber">;
7
- accountNumber: z.ZodString;
8
- issuedBy: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("../../index.js").SafeIri, string>>>;
9
- accountType: z.ZodOptional<z.ZodEnum<{
10
- IATA_CASS: "IATA_CASS";
11
- INTERNAL: "INTERNAL";
12
- OTHER: "OTHER";
13
- }>>;
7
+ accountNumberType: z.ZodOptional<z.ZodString>;
8
+ textualValue: z.ZodOptional<z.ZodString>;
14
9
  }, z.core.$strict>;
15
10
  export type AccountNumber = z.infer<typeof AccountNumberSchema>;
16
11
  export type JsonLdAccountNumber = JsonLd<'AccountNumber'>;
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/classes/account-number/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAGvD,eAAO,MAAM,mBAAmB;;;;;;;;;;;kBAKrB,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"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/classes/account-number/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAGvD,eAAO,MAAM,mBAAmB;;;;;;kBASrB,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"}
@@ -1,10 +1,13 @@
1
1
  import { z } from 'zod';
2
- import { safeIri } from '../../iri/zod-safe-iri.js';
3
2
  import { LogisticsObjectSchema } from '../shared/logistics-object.js';
4
3
  export const AccountNumberSchema = LogisticsObjectSchema.extend({
5
4
  '@type': z.literal('AccountNumber'),
6
- accountNumber: z.string().max(35),
7
- issuedBy: safeIri().optional(),
8
- accountType: z.enum(['IATA_CASS', 'INTERNAL', 'OTHER']).optional(),
5
+ // :accountNumberType → :AccountType, owl:maxCardinality 1 (TTL DM 4780/4784-4785).
6
+ // String per open-codelist idiom — :AccountType is rdfs:subClassOf :CodeListElement,
7
+ // no owl:oneOf in DM or CL ontology (DM TTL 4801-4805).
8
+ accountNumberType: z.string().min(1).max(16).optional(),
9
+ // :textualValue → xsd:string, owl:maxCardinality 1 (TTL DM 4788/4791-4793). .max(35) = FWB account
10
+ // field width (editorial — the ontology has no length facet).
11
+ textualValue: z.string().min(1).max(35).optional(),
9
12
  }).strict();
10
13
  //# sourceMappingURL=schema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/classes/account-number/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAEnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AAErE,MAAM,CAAC,MAAM,mBAAmB,GAAG,qBAAqB,CAAC,MAAM,CAAC;IAC9D,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC;IACnC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC;IACjC,QAAQ,EAAE,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC9B,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE;CACnE,CAAC,CAAC,MAAM,EAAE,CAAA"}
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/classes/account-number/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AAErE,MAAM,CAAC,MAAM,mBAAmB,GAAG,qBAAqB,CAAC,MAAM,CAAC;IAC9D,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC;IACnC,mFAAmF;IACnF,qFAAqF;IACrF,wDAAwD;IACxD,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;IACvD,mGAAmG;IACnG,8DAA8D;IAC9D,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;CACnD,CAAC,CAAC,MAAM,EAAE,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { Codec } from '../shared/codec.js';
2
+ import type { CO2Emissions, JsonLdCO2Emissions } from './schema.js';
3
+ export declare const CO2EmissionsCodec: Codec<CO2Emissions, JsonLdCO2Emissions, 'CO2Emissions'>;
4
+ //# sourceMappingURL=codec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../../src/classes/co2-emissions/codec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAE/C,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAInE,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,YAAY,EAAE,kBAAkB,EAAE,cAAc,CAOzE,CAAA"}
@@ -0,0 +1,11 @@
1
+ import { deserializeCO2Emissions } from './deserialize.js';
2
+ import { CO2EmissionsSchema } from './schema.js';
3
+ import { serializeCO2Emissions, serializeCO2EmissionsStrict } from './serialize.js';
4
+ export const CO2EmissionsCodec = Object.freeze({
5
+ schema: CO2EmissionsSchema,
6
+ serialize: serializeCO2Emissions,
7
+ serializeStrict: serializeCO2EmissionsStrict,
8
+ deserialize: deserializeCO2Emissions,
9
+ type: 'CO2Emissions',
10
+ });
11
+ //# sourceMappingURL=codec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codec.js","sourceRoot":"","sources":["../../../src/classes/co2-emissions/codec.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAE1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,EAAE,qBAAqB,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAA;AAEnF,MAAM,CAAC,MAAM,iBAAiB,GAC5B,MAAM,CAAC,MAAM,CAAC;IACZ,MAAM,EAAE,kBAAkB;IAC1B,SAAS,EAAE,qBAAqB;IAChC,eAAe,EAAE,2BAA2B;IAC5C,WAAW,EAAE,uBAAuB;IACpC,IAAI,EAAE,cAAc;CACZ,CAAC,CAAA"}
@@ -0,0 +1,5 @@
1
+ import type { ParseResult } from '../../result.js';
2
+ import type { DeserializeOpts } from '../../safety/limits.js';
3
+ import type { CO2Emissions } from './schema.js';
4
+ export declare function deserializeCO2Emissions(input: unknown, opts?: DeserializeOpts): ParseResult<CO2Emissions>;
5
+ //# sourceMappingURL=deserialize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deserialize.d.ts","sourceRoot":"","sources":["../../../src/classes/co2-emissions/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,YAAY,EAAE,MAAM,aAAa,CAAA;AAG/C,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,OAAO,EACd,IAAI,GAAE,eAAoB,GACzB,WAAW,CAAC,YAAY,CAAC,CA2D3B"}
@@ -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 { CO2EmissionsSchema } from './schema.js';
6
+ export function deserializeCO2Emissions(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 = CO2EmissionsSchema.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/co2-emissions/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,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAEhD,MAAM,UAAU,uBAAuB,CACrC,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,IAAI,CAAC,iBAAiB,KAAK,SAAS;QAAE,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,CAAA;IAC5F,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS;QAAE,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAA;IACrD,MAAM,GAAG,GAAG,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;IACvC,IAAI,CAAC,GAAG,CAAC,EAAE;QAAE,OAAO,GAAG,CAAA;IAEvB,+DAA+D;IAC/D,IAAI,GAAG,CAAC,KAAK,IAAI,OAAO,GAAG,CAAC,KAAK,KAAK,QAAQ,IAAI,UAAU,IAAI,GAAG,CAAC,KAAK,EAAE,CAAC;QAC1E,MAAM,OAAO,GAA+C,EAAE,CAAA;QAC9D,IAAI,IAAI,CAAC,eAAe,KAAK,SAAS;YAAE,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAA;QACtF,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS;YAAE,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAA;QACrD,MAAM,IAAI,GAAG,oBAAoB,CAAE,GAAG,CAAC,KAAiC,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,CAAA;QAC9F,IAAI,CAAC,IAAI,CAAC,EAAE;YAAE,OAAO,IAAI,CAAA;IAC3B,CAAC;IAED,0DAA0D;IAC1D,MAAM,KAAK,GAAG,mBAAmB,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;IACjD,IAAI,KAAK,EAAE,CAAC;QACV,OAAO;YACL,EAAE,EAAE,KAAK;YACT,KAAK,EAAE,QAAQ,CACb;gBACE,IAAI,EAAE,uBAAuB;gBAC7B,KAAK,EAAE,KAAK,CAAC,KAAK;gBAClB,QAAQ,EAAE,aAAa;gBACvB,GAAG,EAAE,CAAC;gBACN,IAAI,EAAE,KAAK,CAAC,IAAI;aACjB,EACD,IAAI,CAAC,IAAI,CACV;SACF,CAAA;IACH,CAAC;IAED,2DAA2D;IAC3D,MAAM,CAAC,GAAG,kBAAkB,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;IACjD,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,CAAiB,EAAE,CAAA;AACpE,CAAC"}
@@ -0,0 +1,6 @@
1
+ export { CO2EmissionsCodec } from './codec.js';
2
+ export { deserializeCO2Emissions } from './deserialize.js';
3
+ export { CO2EmissionsSchema } from './schema.js';
4
+ export type { CO2Emissions, JsonLdCO2Emissions } from './schema.js';
5
+ export { serializeCO2Emissions, serializeCO2EmissionsStrict } from './serialize.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/classes/co2-emissions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAChD,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AACnE,OAAO,EAAE,qBAAqB,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAA"}
@@ -0,0 +1,5 @@
1
+ export { CO2EmissionsCodec } from './codec.js';
2
+ export { deserializeCO2Emissions } from './deserialize.js';
3
+ export { CO2EmissionsSchema } from './schema.js';
4
+ export { serializeCO2Emissions, serializeCO2EmissionsStrict } from './serialize.js';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/classes/co2-emissions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAEhD,OAAO,EAAE,qBAAqB,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAA"}
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+ import type { JsonLd } from '../shared/jsonld-brand.js';
3
+ export declare const CO2EmissionsSchema: z.ZodObject<{
4
+ '@context': z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
5
+ '@id': z.ZodString;
6
+ '@type': z.ZodLiteral<"CO2Emissions">;
7
+ calculatedEmissions: z.ZodOptional<z.ZodObject<{
8
+ '@type': z.ZodOptional<z.ZodLiteral<"Value">>;
9
+ numericalValue: z.ZodNumber;
10
+ unit: z.ZodString;
11
+ }, z.core.$strict>>;
12
+ calculationFor: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("../../index.js").SafeIri, string>>>;
13
+ methodName: z.ZodOptional<z.ZodString>;
14
+ methodVersion: z.ZodOptional<z.ZodString>;
15
+ }, z.core.$strict>;
16
+ export type CO2Emissions = z.infer<typeof CO2EmissionsSchema>;
17
+ export type JsonLdCO2Emissions = JsonLd<'CO2Emissions'>;
18
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/classes/co2-emissions/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAIvD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;kBAMpB,CAAA;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAC7D,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,cAAc,CAAC,CAAA"}