@flaks/onerecord 0.1.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (328) hide show
  1. package/CHANGELOG.md +324 -5
  2. package/MIGRATING.md +191 -5
  3. package/README.md +94 -34
  4. package/dist/booking-flow/index.d.ts +1 -1
  5. package/dist/booking-flow/index.d.ts.map +1 -1
  6. package/dist/booking-flow/index.js +1 -1
  7. package/dist/booking-flow/index.js.map +1 -1
  8. package/dist/booking-flow/transitions.d.ts +21 -0
  9. package/dist/booking-flow/transitions.d.ts.map +1 -1
  10. package/dist/booking-flow/transitions.js +57 -5
  11. package/dist/booking-flow/transitions.js.map +1 -1
  12. package/dist/classes/account-number/schema.d.ts +2 -7
  13. package/dist/classes/account-number/schema.d.ts.map +1 -1
  14. package/dist/classes/account-number/schema.js +7 -4
  15. package/dist/classes/account-number/schema.js.map +1 -1
  16. package/dist/classes/co2-emissions/codec.d.ts +4 -0
  17. package/dist/classes/co2-emissions/codec.d.ts.map +1 -0
  18. package/dist/classes/co2-emissions/codec.js +11 -0
  19. package/dist/classes/co2-emissions/codec.js.map +1 -0
  20. package/dist/classes/co2-emissions/deserialize.d.ts +5 -0
  21. package/dist/classes/co2-emissions/deserialize.d.ts.map +1 -0
  22. package/dist/classes/co2-emissions/deserialize.js +64 -0
  23. package/dist/classes/co2-emissions/deserialize.js.map +1 -0
  24. package/dist/classes/co2-emissions/index.d.ts +6 -0
  25. package/dist/classes/co2-emissions/index.d.ts.map +1 -0
  26. package/dist/classes/co2-emissions/index.js +5 -0
  27. package/dist/classes/co2-emissions/index.js.map +1 -0
  28. package/dist/classes/co2-emissions/schema.d.ts +18 -0
  29. package/dist/classes/co2-emissions/schema.d.ts.map +1 -0
  30. package/dist/classes/co2-emissions/schema.js +12 -0
  31. package/dist/classes/co2-emissions/schema.js.map +1 -0
  32. package/dist/classes/co2-emissions/serialize.d.ts +6 -0
  33. package/dist/classes/co2-emissions/serialize.d.ts.map +1 -0
  34. package/dist/classes/co2-emissions/serialize.js +28 -0
  35. package/dist/classes/co2-emissions/serialize.js.map +1 -0
  36. package/dist/classes/company/codec.d.ts +4 -0
  37. package/dist/classes/company/codec.d.ts.map +1 -0
  38. package/dist/classes/company/codec.js +11 -0
  39. package/dist/classes/company/codec.js.map +1 -0
  40. package/dist/classes/company/deserialize.d.ts +5 -0
  41. package/dist/classes/company/deserialize.d.ts.map +1 -0
  42. package/dist/classes/company/deserialize.js +64 -0
  43. package/dist/classes/company/deserialize.js.map +1 -0
  44. package/dist/classes/company/index.d.ts +6 -0
  45. package/dist/classes/company/index.d.ts.map +1 -0
  46. package/dist/classes/company/index.js +5 -0
  47. package/dist/classes/company/index.js.map +1 -0
  48. package/dist/classes/company/schema.d.ts +23 -0
  49. package/dist/classes/company/schema.d.ts.map +1 -0
  50. package/dist/classes/company/schema.js +23 -0
  51. package/dist/classes/company/schema.js.map +1 -0
  52. package/dist/classes/company/serialize.d.ts +6 -0
  53. package/dist/classes/company/serialize.d.ts.map +1 -0
  54. package/dist/classes/company/serialize.js +28 -0
  55. package/dist/classes/company/serialize.js.map +1 -0
  56. package/dist/classes/customs-information/codec.d.ts +4 -0
  57. package/dist/classes/customs-information/codec.d.ts.map +1 -0
  58. package/dist/classes/customs-information/codec.js +11 -0
  59. package/dist/classes/customs-information/codec.js.map +1 -0
  60. package/dist/classes/customs-information/deserialize.d.ts +5 -0
  61. package/dist/classes/customs-information/deserialize.d.ts.map +1 -0
  62. package/dist/classes/customs-information/deserialize.js +64 -0
  63. package/dist/classes/customs-information/deserialize.js.map +1 -0
  64. package/dist/classes/customs-information/index.d.ts +6 -0
  65. package/dist/classes/customs-information/index.d.ts.map +1 -0
  66. package/dist/classes/customs-information/index.js +5 -0
  67. package/dist/classes/customs-information/index.js.map +1 -0
  68. package/dist/classes/customs-information/schema.d.ts +18 -0
  69. package/dist/classes/customs-information/schema.d.ts.map +1 -0
  70. package/dist/classes/customs-information/schema.js +17 -0
  71. package/dist/classes/customs-information/schema.js.map +1 -0
  72. package/dist/classes/customs-information/serialize.d.ts +6 -0
  73. package/dist/classes/customs-information/serialize.d.ts.map +1 -0
  74. package/dist/classes/customs-information/serialize.js +28 -0
  75. package/dist/classes/customs-information/serialize.js.map +1 -0
  76. package/dist/classes/insurance/codec.d.ts +4 -0
  77. package/dist/classes/insurance/codec.d.ts.map +1 -0
  78. package/dist/classes/insurance/codec.js +11 -0
  79. package/dist/classes/insurance/codec.js.map +1 -0
  80. package/dist/classes/insurance/deserialize.d.ts +5 -0
  81. package/dist/classes/insurance/deserialize.d.ts.map +1 -0
  82. package/dist/classes/insurance/deserialize.js +64 -0
  83. package/dist/classes/insurance/deserialize.js.map +1 -0
  84. package/dist/classes/insurance/index.d.ts +6 -0
  85. package/dist/classes/insurance/index.d.ts.map +1 -0
  86. package/dist/classes/insurance/index.js +5 -0
  87. package/dist/classes/insurance/index.js.map +1 -0
  88. package/dist/classes/insurance/schema.d.ts +17 -0
  89. package/dist/classes/insurance/schema.d.ts.map +1 -0
  90. package/dist/classes/insurance/schema.js +11 -0
  91. package/dist/classes/insurance/schema.js.map +1 -0
  92. package/dist/classes/insurance/serialize.d.ts +6 -0
  93. package/dist/classes/insurance/serialize.d.ts.map +1 -0
  94. package/dist/classes/insurance/serialize.js +28 -0
  95. package/dist/classes/insurance/serialize.js.map +1 -0
  96. package/dist/classes/line-item-package/codec.d.ts +4 -0
  97. package/dist/classes/line-item-package/codec.d.ts.map +1 -0
  98. package/dist/classes/line-item-package/codec.js +11 -0
  99. package/dist/classes/line-item-package/codec.js.map +1 -0
  100. package/dist/classes/line-item-package/deserialize.d.ts +5 -0
  101. package/dist/classes/line-item-package/deserialize.d.ts.map +1 -0
  102. package/dist/classes/line-item-package/deserialize.js +64 -0
  103. package/dist/classes/line-item-package/deserialize.js.map +1 -0
  104. package/dist/classes/line-item-package/index.d.ts +6 -0
  105. package/dist/classes/line-item-package/index.d.ts.map +1 -0
  106. package/dist/classes/line-item-package/index.js +5 -0
  107. package/dist/classes/line-item-package/index.js.map +1 -0
  108. package/dist/classes/line-item-package/schema.d.ts +22 -0
  109. package/dist/classes/line-item-package/schema.d.ts.map +1 -0
  110. package/dist/classes/line-item-package/schema.js +12 -0
  111. package/dist/classes/line-item-package/schema.js.map +1 -0
  112. package/dist/classes/line-item-package/serialize.d.ts +6 -0
  113. package/dist/classes/line-item-package/serialize.d.ts.map +1 -0
  114. package/dist/classes/line-item-package/serialize.js +28 -0
  115. package/dist/classes/line-item-package/serialize.js.map +1 -0
  116. package/dist/classes/other-charge/codec.d.ts +4 -0
  117. package/dist/classes/other-charge/codec.d.ts.map +1 -0
  118. package/dist/classes/other-charge/codec.js +11 -0
  119. package/dist/classes/other-charge/codec.js.map +1 -0
  120. package/dist/classes/other-charge/deserialize.d.ts +5 -0
  121. package/dist/classes/other-charge/deserialize.d.ts.map +1 -0
  122. package/dist/classes/other-charge/deserialize.js +64 -0
  123. package/dist/classes/other-charge/deserialize.js.map +1 -0
  124. package/dist/classes/other-charge/index.d.ts +6 -0
  125. package/dist/classes/other-charge/index.d.ts.map +1 -0
  126. package/dist/classes/other-charge/index.js +5 -0
  127. package/dist/classes/other-charge/index.js.map +1 -0
  128. package/dist/classes/other-charge/schema.d.ts +27 -0
  129. package/dist/classes/other-charge/schema.d.ts.map +1 -0
  130. package/dist/classes/other-charge/schema.js +14 -0
  131. package/dist/classes/other-charge/schema.js.map +1 -0
  132. package/dist/classes/other-charge/serialize.d.ts +6 -0
  133. package/dist/classes/other-charge/serialize.d.ts.map +1 -0
  134. package/dist/classes/other-charge/serialize.js +28 -0
  135. package/dist/classes/other-charge/serialize.js.map +1 -0
  136. package/dist/classes/party/schema.d.ts +9 -1
  137. package/dist/classes/party/schema.d.ts.map +1 -1
  138. package/dist/classes/party/schema.js +5 -2
  139. package/dist/classes/party/schema.js.map +1 -1
  140. package/dist/classes/piece/schema.d.ts +11 -0
  141. package/dist/classes/piece/schema.d.ts.map +1 -1
  142. package/dist/classes/piece/schema.js +10 -0
  143. package/dist/classes/piece/schema.js.map +1 -1
  144. package/dist/classes/regulated-entity/codec.d.ts +4 -0
  145. package/dist/classes/regulated-entity/codec.d.ts.map +1 -0
  146. package/dist/classes/regulated-entity/codec.js +11 -0
  147. package/dist/classes/regulated-entity/codec.js.map +1 -0
  148. package/dist/classes/regulated-entity/deserialize.d.ts +5 -0
  149. package/dist/classes/regulated-entity/deserialize.d.ts.map +1 -0
  150. package/dist/classes/regulated-entity/deserialize.js +64 -0
  151. package/dist/classes/regulated-entity/deserialize.js.map +1 -0
  152. package/dist/classes/regulated-entity/index.d.ts +6 -0
  153. package/dist/classes/regulated-entity/index.d.ts.map +1 -0
  154. package/dist/classes/regulated-entity/index.js +5 -0
  155. package/dist/classes/regulated-entity/index.js.map +1 -0
  156. package/dist/classes/regulated-entity/schema.d.ts +19 -0
  157. package/dist/classes/regulated-entity/schema.d.ts.map +1 -0
  158. package/dist/classes/regulated-entity/schema.js +12 -0
  159. package/dist/classes/regulated-entity/schema.js.map +1 -0
  160. package/dist/classes/regulated-entity/serialize.d.ts +6 -0
  161. package/dist/classes/regulated-entity/serialize.d.ts.map +1 -0
  162. package/dist/classes/regulated-entity/serialize.js +28 -0
  163. package/dist/classes/regulated-entity/serialize.js.map +1 -0
  164. package/dist/classes/security-declaration/codec.d.ts +4 -0
  165. package/dist/classes/security-declaration/codec.d.ts.map +1 -0
  166. package/dist/classes/security-declaration/codec.js +11 -0
  167. package/dist/classes/security-declaration/codec.js.map +1 -0
  168. package/dist/classes/security-declaration/deserialize.d.ts +5 -0
  169. package/dist/classes/security-declaration/deserialize.d.ts.map +1 -0
  170. package/dist/classes/security-declaration/deserialize.js +64 -0
  171. package/dist/classes/security-declaration/deserialize.js.map +1 -0
  172. package/dist/classes/security-declaration/index.d.ts +6 -0
  173. package/dist/classes/security-declaration/index.d.ts.map +1 -0
  174. package/dist/classes/security-declaration/index.js +5 -0
  175. package/dist/classes/security-declaration/index.js.map +1 -0
  176. package/dist/classes/security-declaration/schema.d.ts +44 -0
  177. package/dist/classes/security-declaration/schema.d.ts.map +1 -0
  178. package/dist/classes/security-declaration/schema.js +21 -0
  179. package/dist/classes/security-declaration/schema.js.map +1 -0
  180. package/dist/classes/security-declaration/serialize.d.ts +6 -0
  181. package/dist/classes/security-declaration/serialize.d.ts.map +1 -0
  182. package/dist/classes/security-declaration/serialize.js +28 -0
  183. package/dist/classes/security-declaration/serialize.js.map +1 -0
  184. package/dist/classes/shared/value.d.ts +44 -0
  185. package/dist/classes/shared/value.d.ts.map +1 -0
  186. package/dist/classes/shared/value.js +39 -0
  187. package/dist/classes/shared/value.js.map +1 -0
  188. package/dist/classes/shipment/schema.d.ts +31 -8
  189. package/dist/classes/shipment/schema.d.ts.map +1 -1
  190. package/dist/classes/shipment/schema.js +15 -5
  191. package/dist/classes/shipment/schema.js.map +1 -1
  192. package/dist/classes/transport-movement/schema.d.ts +22 -0
  193. package/dist/classes/transport-movement/schema.d.ts.map +1 -1
  194. package/dist/classes/transport-movement/schema.js +7 -0
  195. package/dist/classes/transport-movement/schema.js.map +1 -1
  196. package/dist/classes/uld/codec.d.ts +4 -0
  197. package/dist/classes/uld/codec.d.ts.map +1 -0
  198. package/dist/classes/uld/codec.js +11 -0
  199. package/dist/classes/uld/codec.js.map +1 -0
  200. package/dist/classes/uld/deserialize.d.ts +5 -0
  201. package/dist/classes/uld/deserialize.d.ts.map +1 -0
  202. package/dist/classes/uld/deserialize.js +64 -0
  203. package/dist/classes/uld/deserialize.js.map +1 -0
  204. package/dist/classes/uld/index.d.ts +6 -0
  205. package/dist/classes/uld/index.d.ts.map +1 -0
  206. package/dist/classes/uld/index.js +5 -0
  207. package/dist/classes/uld/index.js.map +1 -0
  208. package/dist/classes/uld/schema.d.ts +31 -0
  209. package/dist/classes/uld/schema.d.ts.map +1 -0
  210. package/dist/classes/uld/schema.js +29 -0
  211. package/dist/classes/uld/schema.js.map +1 -0
  212. package/dist/classes/uld/serialize.d.ts +6 -0
  213. package/dist/classes/uld/serialize.d.ts.map +1 -0
  214. package/dist/classes/uld/serialize.js +28 -0
  215. package/dist/classes/uld/serialize.js.map +1 -0
  216. package/dist/classes/waybill/schema.d.ts +45 -5
  217. package/dist/classes/waybill/schema.d.ts.map +1 -1
  218. package/dist/classes/waybill/schema.js +28 -7
  219. package/dist/classes/waybill/schema.js.map +1 -1
  220. package/dist/classes/waybill-line-item/codec.d.ts +4 -0
  221. package/dist/classes/waybill-line-item/codec.d.ts.map +1 -0
  222. package/dist/classes/waybill-line-item/codec.js +11 -0
  223. package/dist/classes/waybill-line-item/codec.js.map +1 -0
  224. package/dist/classes/waybill-line-item/deserialize.d.ts +5 -0
  225. package/dist/classes/waybill-line-item/deserialize.d.ts.map +1 -0
  226. package/dist/classes/waybill-line-item/deserialize.js +64 -0
  227. package/dist/classes/waybill-line-item/deserialize.js.map +1 -0
  228. package/dist/classes/waybill-line-item/index.d.ts +6 -0
  229. package/dist/classes/waybill-line-item/index.d.ts.map +1 -0
  230. package/dist/classes/waybill-line-item/index.js +5 -0
  231. package/dist/classes/waybill-line-item/index.js.map +1 -0
  232. package/dist/classes/waybill-line-item/schema.d.ts +44 -0
  233. package/dist/classes/waybill-line-item/schema.d.ts.map +1 -0
  234. package/dist/classes/waybill-line-item/schema.js +22 -0
  235. package/dist/classes/waybill-line-item/schema.js.map +1 -0
  236. package/dist/classes/waybill-line-item/serialize.d.ts +6 -0
  237. package/dist/classes/waybill-line-item/serialize.d.ts.map +1 -0
  238. package/dist/classes/waybill-line-item/serialize.js +28 -0
  239. package/dist/classes/waybill-line-item/serialize.js.map +1 -0
  240. package/dist/codecs.d.ts +10 -1
  241. package/dist/codecs.d.ts.map +1 -1
  242. package/dist/codecs.js +10 -1
  243. package/dist/codecs.js.map +1 -1
  244. package/dist/codes/enums.d.ts +35 -0
  245. package/dist/codes/enums.d.ts.map +1 -1
  246. package/dist/codes/enums.js +4 -0
  247. package/dist/codes/enums.js.map +1 -1
  248. package/dist/codes/fsu-event-codes.d.ts +6 -6
  249. package/dist/codes/fsu-event-codes.d.ts.map +1 -1
  250. package/dist/codes/fsu-event-codes.js +11 -9
  251. package/dist/codes/fsu-event-codes.js.map +1 -1
  252. package/dist/codes/index.d.ts +1 -1
  253. package/dist/codes/index.d.ts.map +1 -1
  254. package/dist/codes/index.js +1 -1
  255. package/dist/codes/index.js.map +1 -1
  256. package/dist/dispatch/context-order.d.ts +28 -0
  257. package/dist/dispatch/context-order.d.ts.map +1 -0
  258. package/dist/dispatch/context-order.js +21 -0
  259. package/dist/dispatch/context-order.js.map +1 -0
  260. package/dist/dispatch/domain-constraints.d.ts +49 -0
  261. package/dist/dispatch/domain-constraints.d.ts.map +1 -0
  262. package/dist/dispatch/domain-constraints.js +59 -0
  263. package/dist/dispatch/domain-constraints.js.map +1 -0
  264. package/dist/dispatch/field-types.d.ts +29 -0
  265. package/dist/dispatch/field-types.d.ts.map +1 -0
  266. package/dist/dispatch/field-types.js +135 -0
  267. package/dist/dispatch/field-types.js.map +1 -0
  268. package/dist/dispatch/graph-walk.d.ts +23 -0
  269. package/dist/dispatch/graph-walk.d.ts.map +1 -0
  270. package/dist/dispatch/graph-walk.js +207 -0
  271. package/dist/dispatch/graph-walk.js.map +1 -0
  272. package/dist/dispatch/index.d.ts +30 -0
  273. package/dist/dispatch/index.d.ts.map +1 -0
  274. package/dist/dispatch/index.js +36 -0
  275. package/dist/dispatch/index.js.map +1 -0
  276. package/dist/dispatch/iri-canonical.d.ts +28 -0
  277. package/dist/dispatch/iri-canonical.d.ts.map +1 -0
  278. package/dist/dispatch/iri-canonical.js +55 -0
  279. package/dist/dispatch/iri-canonical.js.map +1 -0
  280. package/dist/error/format.d.ts.map +1 -1
  281. package/dist/error/format.js +8 -0
  282. package/dist/error/format.js.map +1 -1
  283. package/dist/facade.d.ts +53 -2
  284. package/dist/facade.d.ts.map +1 -1
  285. package/dist/facade.js +8 -0
  286. package/dist/facade.js.map +1 -1
  287. package/dist/factory-classes.d.ts +27 -6
  288. package/dist/factory-classes.d.ts.map +1 -1
  289. package/dist/factory-classes.js +27 -6
  290. package/dist/factory-classes.js.map +1 -1
  291. package/dist/factory.d.ts +12 -0
  292. package/dist/factory.d.ts.map +1 -1
  293. package/dist/factory.js +10 -1
  294. package/dist/factory.js.map +1 -1
  295. package/dist/index.d.ts +32 -3
  296. package/dist/index.d.ts.map +1 -1
  297. package/dist/index.js +30 -3
  298. package/dist/index.js.map +1 -1
  299. package/dist/iri/dereference.d.ts +42 -0
  300. package/dist/iri/dereference.d.ts.map +1 -0
  301. package/dist/iri/dereference.js +75 -0
  302. package/dist/iri/dereference.js.map +1 -0
  303. package/dist/iri/zod-safe-iri.d.ts +18 -2
  304. package/dist/iri/zod-safe-iri.d.ts.map +1 -1
  305. package/dist/iri/zod-safe-iri.js +14 -2
  306. package/dist/iri/zod-safe-iri.js.map +1 -1
  307. package/dist/result.d.ts +27 -1
  308. package/dist/result.d.ts.map +1 -1
  309. package/dist/result.js +9 -0
  310. package/dist/result.js.map +1 -1
  311. package/dist/safety/blank-node.d.ts +20 -0
  312. package/dist/safety/blank-node.d.ts.map +1 -0
  313. package/dist/safety/blank-node.js +59 -0
  314. package/dist/safety/blank-node.js.map +1 -0
  315. package/dist/safety/pre-validate.d.ts.map +1 -1
  316. package/dist/safety/pre-validate.js +12 -72
  317. package/dist/safety/pre-validate.js.map +1 -1
  318. package/dist/safety/walk-graph.d.ts +30 -0
  319. package/dist/safety/walk-graph.d.ts.map +1 -0
  320. package/dist/safety/walk-graph.js +100 -0
  321. package/dist/safety/walk-graph.js.map +1 -0
  322. package/dist/types/index.d.ts +10 -1
  323. package/dist/types/index.d.ts.map +1 -1
  324. package/dist/version.d.ts +9 -4
  325. package/dist/version.d.ts.map +1 -1
  326. package/dist/version.js +18 -6
  327. package/dist/version.js.map +1 -1
  328. package/package.json +9 -9
package/CHANGELOG.md CHANGED
@@ -4,11 +4,330 @@ 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.1.1] - 2026-04-27 (install fix + open-sourcing pass)
8
-
9
- First public release. v0.1.0 was tagged but unconsumable via git URL
10
- (see "Critical install fix" below); v0.1.1 is the first version Tracks
11
- B and C should pin to.
7
+ ## [0.3.0] - 2026-05-17
8
+
9
+ FWB-equivalence Path A: 10 new classes, schema rewrites for the core FWB
10
+ classes, full IATA 3.2.0 conformance for the covered class set with documented
11
+ deviations and 3.2.1-forward extensions. See `MIGRATING.md` for per-breaking-
12
+ change migration guidance.
13
+
14
+ ### Added
15
+
16
+ - **`Company`** class — concrete `:Organization` subtype; retires the abstract
17
+ `Organization` class. `Party.partyDetails` and all Organization-range fields
18
+ now point to `Company`.
19
+ - **`WaybillLineItem`** class — FWB rate/charge line item.
20
+ - **`OtherCharge`** class — FWB OCI/other-charge block.
21
+ - **`CustomsInformation`** class — FWB customs information block.
22
+ - **`Insurance`** class — FWB insurance details.
23
+ - **`LineItemPackage`** class — FWB package-level line item.
24
+ - **`ULD`** class — unit load device reference.
25
+ - **`CO2Emissions`** class — carbon emissions per spec §D6.
26
+ - **`RegulatedEntity`** class — security regulated entity (shipper/handler).
27
+ - **`SecurityDeclaration`** class — security declaration per spec §8.
28
+ - **Shared value sub-schemas**: `ValueSchema`, `CurrencyValueSchema`,
29
+ `DimensionsSchema` — used by all NEW value-typed properties in v0.3.0.
30
+ - **FWB properties** on `Waybill`: `shipment`, `involvedParties`,
31
+ `waybillLineItems`, `otherCharges`, `carrierDeclarationPlace`,
32
+ `departureLocation`, `arrivalLocation`, `houseWaybills`, `masterWaybill`,
33
+ `billingDetails` (IRI ref only; `:BillingDetails` class not modelled — deviation #16).
34
+ `accountingInformation` — deprecated upstream (owl:deprecated true in
35
+ 3.2-rc2 ~2861) — **deviation #15**.
36
+ - **FWB properties** on `Shipment`: `pieces`, `waybill`, `involvedParties`,
37
+ `customsInformation`, `insurance`, `securityDeclarations` (accepted as
38
+ optional 3.2.1-forward extension — deviation #12).
39
+ - **FWB properties** on `Piece`: `ofShipment`, `containedPieces`,
40
+ `securityDeclarations` (3.2.0-conformant via Piece restriction ~8260).
41
+ - `CARGO_ONTOLOGY_VERSION` bumped from `'3.2'` to `'3.2.0'` (exact endorsed
42
+ version string). Legacy alias `'3.2'` remains accepted by
43
+ `assertOntologyVersion` and `checkServerInformation`.
44
+
45
+ ### Changed
46
+
47
+ - **`Organization` class retired** — replaced by `Company`
48
+ (`:Company rdfs:subClassOf :Organization`; the only concrete org type shipped).
49
+ `Party.partyDetails` widened to accept `IRI | {@id}` (Person or Company).
50
+ `NI` added as accepted `Party.partyRole` value.
51
+ - **`Waybill`**: dropped `shipmentInformation` (renamed to `shipment`);
52
+ dropped `totalGrossWeight` (the field already exists on `Shipment` — use that).
53
+ - **`Shipment`**: dropped `pieceCount`, `totalVolume`, `containedPieces`
54
+ (renamed to `pieces`), `shipper`, `consignee` (moved to `involvedParties`).
55
+ - **`waybillType` enum**: `DIRECT` added.
56
+ - **`waybillPrefix`**: now accepts `[A-Z0-9]{1,3}` (editorial policy relaxation
57
+ — NOT a spec pattern; the ontology has only `xsd:string maxLength 3`).
58
+ - **`waybillNumber`**: now accepts `[A-Z0-9]+` per 3.2-rc2 ontology pattern.
59
+ - **`AccountNumber`**: `accountNumber`/`issuedBy`/`accountType` renamed to
60
+ `accountNumberType`/`textualValue`; `issuedBy` removed (wrong domain — belongs
61
+ to `:SecurityDeclaration`, not `:AccountNumber`).
62
+ - **`CARGO_ONTOLOGY_VERSION`**: `'3.2'` → `'3.2.0'`. `assertOntologyVersion`
63
+ and `checkServerInformation` now use an exact-alias accepted set
64
+ (`'3.2'` ≡ `'3.2.0'`, `'3.2.1'` rejected — NOT prefix-tolerant).
65
+ - **`FIELD_TYPES` map**: stale v0.2 entries removed (`Waybill.shipmentInformation`,
66
+ `Shipment.containedPieces`, `Shipment.consignee`, `Shipment.shipper`,
67
+ `Organization.address`, `Organization.contactPersons`,
68
+ `AccountNumber.issuedBy`); ~40 new entries added for v0.3.0 classes.
69
+ - **Domain constraints** (`domain-constraints.ts`): stale v0.2 constraints
70
+ on `Waybill.shipmentInformation` and `Shipment.containedPieces` removed.
71
+ No spec basis post-Path-A; the corrected cross-node check
72
+ (Waybill↔Shipment inverse-property consistency) is deferred.
73
+
74
+ ### BREAKING CHANGES
75
+
76
+ Consumers upgrading from v0.2.x must audit the following:
77
+
78
+ 1. **`Organization` class removed** — import `Company` instead. Any code
79
+ referencing `OrganizationSchema`, `OrganizationCodec`, `serializeOrganization`,
80
+ or `deserializeOrganization` will break.
81
+ 2. **`Waybill.shipmentInformation` removed** — use `Waybill.shipment`.
82
+ 3. **`Waybill.totalGrossWeight` removed** — field moved to `Shipment`.
83
+ 4. **`Shipment.pieceCount` removed** — no direct replacement (compute from `pieces.length`).
84
+ 5. **`Shipment.totalVolume` removed** — no direct replacement in v0.3.0.
85
+ 6. **`Shipment.containedPieces` removed** — use `Shipment.pieces`.
86
+ 7. **`Shipment.shipper` / `Shipment.consignee` removed** — use `Shipment.involvedParties`
87
+ filtered by `partyRole`.
88
+ 8. **`waybillType` enum**: `DIRECT` is now a valid value — exhaustive switches
89
+ must handle it.
90
+ 9. **`waybillPrefix`**: now accepts alphanumeric `[A-Z0-9]{1,3}` — do not
91
+ assume numeric-only downstream.
92
+ 10. **`waybillNumber`**: now accepts `[A-Z0-9]+` — do not assume numeric-only.
93
+ 11. **`AccountNumber` fields renamed**: `accountNumber` → `textualValue`,
94
+ `accountType` → `accountNumberType`; `issuedBy` removed.
95
+ 12. **`Party.partyDetails`** widened (additive for accept — a bare IRI still
96
+ validates; see MIGRATING.md for detail).
97
+ 13. **`CARGO_ONTOLOGY_VERSION`** changed from `'3.2'` to `'3.2.0'`. Any code
98
+ doing `=== '3.2'` on the constant will need updating.
99
+ 14. **`assertOntologyVersion('3.2.1')`** now throws (previously any mismatch
100
+ with `'3.2'` would throw; now the exact-alias set `{'3.2.0','3.2'}` is
101
+ accepted and everything else including `'3.2.1'` is rejected).
102
+ 15. **`domain_constraint_violation`** for `Waybill.shipmentInformation` /
103
+ `Shipment.containedPieces` no longer fires (those fields no longer exist).
104
+ 16. **`Party.partyRole`**: `'NI'` (also-notify, AWB box 7) is now an accepted
105
+ value — exhaustive `switch` statements over `partyRole` must handle it
106
+ (same migration class as `waybillType` `DIRECT`).
107
+
108
+ ### Spec deviations
109
+
110
+ - **#12 (reworded)**: `Shipment.securityDeclarations` is a documented
111
+ 3.2.1-forward extension — see `docs/spec-deviations.md#12`.
112
+ - **#14 (new)**: Legacy `{unit,value}` shape on 3 pre-existing fields.
113
+ - **#15 (new)**: `Waybill.accountingInformation` is `owl:deprecated` in 3.2-rc2.
114
+ - **#16 (new)**: `BillingDetails` class not modelled in v0.3.0.
115
+
116
+ ## [0.2.0] - 2026-04-28
117
+
118
+ First publicly verifiable release. Closes 3 of 5 v0.1.x spec
119
+ deviations PLUS pulls forward 5 of the 6 newly-identified deviations
120
+ (#6 partially, #7, #8, #9, #10) for net 7 of 11 deviations CLOSED
121
+ or PARTIAL in v0.2.0. Adds 4 new opt-in `ParseError.kind` values
122
+ that fire only through the dispatch path; default per-class
123
+ deserializers stay v0.1.x-permissive (no breaking changes).
124
+
125
+ ### Added
126
+
127
+ - **`acceptBookingOptionViaRequest(opt)`** — spec §5.4-correct booking
128
+ transition that returns the intermediate `BookingOptionRequest` state
129
+ instead of jumping straight to `Booking`. Closes deviation #1
130
+ partially (forwarder→carrier hop only; carrier-side acceptance flow
131
+ is v0.3 work).
132
+ - **Graph-walk dispatcher** — opt-in cross-node integrity validation
133
+ via `createMapper({ graphWalk: true })` or
134
+ `onerecord.dispatch.deserialize.<Class>`. Emits all four reserved
135
+ ParseError kinds: `duplicate_id_in_graph`, `missing_id`,
136
+ `wrong_type_for_endpoint`, `missing_type`. Default per-class
137
+ deserializers unchanged. Closes deviation #2 for JSON-LD structural
138
+ integrity (domain-semantic checks remain deviation #6, deferred).
139
+ - **`walkGraph` helper** at `src/safety/walk-graph.ts` — visitor-pattern
140
+ recursive walker shared by `preValidate` and `dispatchGraphWalk`.
141
+ Single traversal, no double-walk overhead.
142
+ - **`FIELD_TYPES` map** at `src/dispatch/field-types.ts` — covers all
143
+ 32 cargo classes with field-to-expected-type mappings; polymorphic
144
+ fields marked `'*'`.
145
+ - **Property-based round-trip tests** for the 7 remaining Ring 1+2
146
+ classes (Shipment, Piece, Address, Person, Organization, Party,
147
+ AccountNumber). Joins the existing Waybill test. Total runtime ~1.6s.
148
+ - **`PARSE_ERROR_KINDS.length === 26` lock test** — fails CI on
149
+ unexpected union drift. Bumped from 22 in v0.1.x with four new
150
+ kinds: `blank_node_forbidden` (#8), `iri_not_canonical` (#9),
151
+ `context_order_violation` (#10), `domain_constraint_violation` (#6).
152
+ - **Contract test harness + 6 contract tests** at `test/contract/`
153
+ against the OLF-hosted reference NE:ONE Server. All 6 plan-specified
154
+ topics shipped: Waybill, Shipment, Piece, booking-flow, operations
155
+ (JSON-Patch via applyChange), notification (Subscription LO + endpoint
156
+ smoke). Includes Keycloak auth + defensive RDF-strict-mode
157
+ wire-format adapter (envelope shape, ObjectProperty `@id` wrapping,
158
+ xsd-typed literals, `@graph` response unwrap). Excluded from the
159
+ default `bun run test`; run via `bun run test:contract` after
160
+ starting the local NE:ONE stack.
161
+ - **Skeleton bundled docker-compose** at `test/contract/docker-compose.neone.yml`
162
+ for in-memory-mode local stack. Realm config not bundled (OLF License
163
+ §4 review pending); fetch instructions in CONTRIBUTING.md.
164
+ Headless CI integration (release.yml NE:ONE gate, nightly job)
165
+ deferred to v0.3 — bundling realm + per-run reset is multi-day work.
166
+ - **`MAINTENANCE.md`** — release playbook + signing key info + npm
167
+ credential policy + bus-factor note (R8 mitigation).
168
+ - **Six newly-identified spec deviations (#6–#11)** documented:
169
+ - **#6 — domain-semantic cross-node validation**: PARTIAL closure
170
+ (root-level cardinality enforced via `domain_constraint_violation`;
171
+ Waybill.shipmentInformation REQUIRED, Shipment.containedPieces
172
+ REQUIRED ≥1). AWB consistency, total-pieces sums, and reference
173
+ resolvability still v0.3 work.
174
+ - **#7 — IRI dereferenceability**: CLOSED via opt-in helper
175
+ `dereferenceIri(iri, opts)` async utility. Library doesn't wire
176
+ into deserializers (would force network I/O); consumers call
177
+ when they need it.
178
+ - **#8 — blank-node rejection**: CLOSED. Pre-Zod check at
179
+ `src/safety/blank-node.ts` emits `blank_node_forbidden` for
180
+ `_:b0`-style `@id` values per spec §3.2.
181
+ - **#9 — IRI canonicalization**: CLOSED via opt-in dispatch
182
+ (`iri_not_canonical` for uppercase scheme/host or default port
183
+ per RFC 3987 + spec §3.2).
184
+ - **#10 — `@context` array-order**: CLOSED via opt-in dispatch
185
+ (`context_order_violation` when array @context's last element
186
+ is not in the allowlist; per JSON-LD 1.1 §3.7 last item is the
187
+ effective context).
188
+ - **Spec deviation #11** — STATE_DIAGRAM source-state keys do not
189
+ match `BookingOption.optionStatus` enum; documents intentional
190
+ hardcode in the four `*BookingOption` transitions. Resolution
191
+ requires IATA §5.4 reconciliation; v0.3.
192
+
193
+ ### Changed
194
+
195
+ - **FSU code fixture regenerated** with a real `sha256:` blob hash
196
+ (`f5f483a5...`) sourced from upstream IATA-Cargo via the new sibling
197
+ [`tjo099/onerecord-xlsx-tools`](https://github.com/tjo099/onerecord-xlsx-tools)
198
+ tool. v0.1.x's hand-pinned 26 codes diverged from the upstream working
199
+ draft by 6 codes in each direction. Per Phase 0 verification the
200
+ upstream set is adopted: removes CLR, FOO, FWB, OFD, RCM, RCV; adds
201
+ DOC, DPU, FIW, FOW, OCI, OSI. `FSU_EVENT_CODES` const updated to
202
+ match. Closes deviation #4.
203
+ - Spec rev-2 wording corrected: the reference NE:ONE Server is hosted
204
+ by the **Open Logistics Foundation Working Group on Digital Air
205
+ Cargo**, not IATA-Cargo. OLF License v1.3 — unrestricted CI use
206
+ confirmed (R6 closure).
207
+
208
+ ### Deprecated
209
+
210
+ - **`acceptBookingOption`** — marked `@deprecated`; removal in v0.3
211
+ unless IATA §5.4 reconciliation restores the §5.2 shortcut. Migrate
212
+ to `acceptBookingOptionViaRequest`.
213
+
214
+ ### Removed
215
+
216
+ - **`xlsx` devDep** moved to the sibling
217
+ [`tjo099/onerecord-xlsx-tools`](https://github.com/tjo099/onerecord-xlsx-tools)
218
+ repo. Closes the two high-severity advisories on the main library's
219
+ surface (Prototype Pollution + ReDoS). `bun audit` now shows 2
220
+ remaining vitest-transitive moderates only.
221
+ - `scripts/convert-iata-xlsx.ts` — moved to the sibling repo.
222
+
223
+ ### Fixed
224
+
225
+ - v0.1.2 GitHub Release page backfilled (the auto-create step in
226
+ `release.yml` failed on the v0.1.2 publish before commit `d8acc2c`
227
+ added the explicit `git fetch --tags --force` step).
228
+ - Re-enabled four `it.skip` placeholder tests in `test/deserialize-errors/`:
229
+ `forbidden_state_transition`, `operation_field_not_allowed`,
230
+ `prototype_pollution_attempt` + `invalid_pointer` (via `applyChange`),
231
+ and `change_partial_failure`. Plus the four graph-walk-emitted kinds
232
+ (`duplicate_id_in_graph`, `missing_id`, `missing_type`,
233
+ `wrong_type_for_endpoint`) — formerly placeholders, now real
234
+ assertions against `dispatchGraphWalk`.
235
+
236
+ ### Plan deviations (v0.2.0 work that diverged from the original plan)
237
+
238
+ - **Phase 2 Task 2.1 reinterpreted (Path B)** — the plan proposed
239
+ reading `canTransition` source state from `opt.optionStatus`. The
240
+ Phase 2 readiness scan showed this would break every BookingOption
241
+ transition because STATE_DIAGRAM source-state keys don't align with
242
+ the schema's optionStatus enum. The hardcode is intentional pending
243
+ v0.3 reconciliation; deviation #11 documents the underlying issue.
244
+ - **Phase 5 fully scoped** — all 6 contract test topics implemented
245
+ in v0.2.0 (Waybill, Shipment, Piece, booking-flow, operations,
246
+ notification). CI integration (release.yml NE:ONE gate, nightly
247
+ contract job) still deferred to v0.3 — bundling realm config +
248
+ per-run stack reset for headless runners is multi-day work; the
249
+ skeleton compose file is the v0.3 starting point. Run manually
250
+ before tagging via `bun run test:contract`.
251
+ - **Phase 1 Task 1.5 location** — sibling repo cloned to
252
+ `F:/dev/onerecord-xlsx-tools/` (matching the maintainer's
253
+ `F:/dev/` convention) instead of the plan's `/tmp/`.
254
+ - **Plan-vs-API drifts surfaced and corrected** — the plan's verbatim
255
+ test code for Tasks 1.2/1.3/1.4 used an obsolete Operations API
256
+ (`o`/`s`/`v` shorthand vs. real `op`/`path`/`value`;
257
+ `Change.operations` vs. real `Change.hasOperation`; `add`/`replace`
258
+ enum vs. real `ADD`/`DELETE`). Test bodies rewritten to match real
259
+ schemas. Plan's `findContainingClass` always-returns-undefined logic
260
+ bug fixed in `dispatchGraphWalk` (depth-1 wrong-type checks now fire).
261
+ - **Test paths normalized** — `test/api-surface/` and `test/dispatch/`
262
+ in the plan's File Structure table actually live at
263
+ `test/unit/api-surface/` and replaced existing placeholders in
264
+ `test/deserialize-errors/`.
265
+
266
+ ## [0.1.2] - 2026-04-27 (npm publish — supersedes 0.1.1)
267
+
268
+ `@flaks/onerecord` is now published to the public npm registry as a
269
+ scoped public package. **This is the first version Tracks B + C
270
+ should adopt.** v0.1.1's `prepare`-script approach to the git-URL
271
+ install issue does not work on Bun (default "trusted dependencies"
272
+ model blocks lifecycle scripts); v0.1.2 ships pre-built `dist/` in
273
+ the registry tarball, making `bun add @flaks/onerecord` work
274
+ zero-config across all package managers.
275
+
276
+ ### Install
277
+
278
+ ```bash
279
+ npm install @flaks/onerecord
280
+ # or
281
+ bun add @flaks/onerecord
282
+ # or
283
+ pnpm add @flaks/onerecord
284
+ ```
285
+
286
+ ### Why npm publish moved earlier than the v0.2.0 plan
287
+
288
+ The original v0.2.0 roadmap listed npm publish as one of several
289
+ ecosystem-hardening items (alongside NE:ONE contract test, SBOM/SLSA,
290
+ bundle-size assertion). After v0.1.0 + v0.1.1 git-URL distribution
291
+ attempts proved unworkable for Bun consumers, npm publish moved into
292
+ v0.1.2 as a hotfix. The remaining v0.2.0 items still apply.
293
+
294
+ ### Release pipeline fix
295
+
296
+ - Add `fetch-tags: true` to the `actions/checkout` step in
297
+ `release.yml`. Without this, the runner's git tag object is
298
+ materialized as a lightweight ref (commit only, no signature
299
+ metadata), and `git tag -v` fails with `cannot verify a non-tag
300
+ object of type commit`. This is what caused the v0.1.1 release.yml
301
+ run to fail.
302
+
303
+ ### Package metadata
304
+
305
+ - Added `keywords`, `homepage`, `bugs`, `author` fields to
306
+ `package.json` for npm registry display and search indexing.
307
+ - Changed `publishConfig.access` from `restricted` to `public`.
308
+
309
+ ### Note on v0.1.1
310
+
311
+ v0.1.1 remains tagged in git but is documented broken — `prepare`
312
+ script alone does not work for Bun consumers. Do not pin to v0.1.1.
313
+ v0.1.2 is the version Tracks B + C should adopt.
314
+
315
+ ## [0.1.1] - 2026-04-27 (install fix attempt — superseded by 0.1.2)
316
+
317
+ **Tagged but functionally broken on Bun consumers.** This release
318
+ attempted to fix the v0.1.0 git-URL install breakage by adding a
319
+ `prepare` lifecycle script. The fix worked for npm consumers (which
320
+ default-trust `prepare` for git installs) but failed on Bun, which
321
+ default-blocks postinstall scripts via its "trusted dependencies"
322
+ model. See `[0.1.2]` above for the actual fix (npm publish).
323
+
324
+ The CHANGELOG content originally drafted under this version (open-
325
+ sourcing pass items: GPG signing, governance scaffolding, public docs,
326
+ public flip) shipped to `main` with this tag and is preserved on the
327
+ v0.1.1 commit (`86dd181`). All of those items are also present in
328
+ v0.1.2.
329
+
330
+ Original v0.1.1 changelog content follows for historical reference:
12
331
 
13
332
  ### Critical install fix
14
333
 
package/MIGRATING.md CHANGED
@@ -2,19 +2,205 @@
2
2
 
3
3
  This file documents one entry per minor release.
4
4
 
5
+ ## Migrating from v0.2.x to v0.3.0
6
+
7
+ v0.3.0 is a **breaking release**. Review every item below before upgrading.
8
+
9
+ ### 1. `Organization` class retired → use `Company`
10
+
11
+ `Organization` is removed. Import and use `Company` instead. Update all
12
+ references to `OrganizationSchema`, `OrganizationCodec`, `serializeOrganization`,
13
+ `deserializeOrganization`.
14
+
15
+ ```typescript
16
+ // Before (v0.2.x)
17
+ import { OrganizationCodec } from '@flaks/onerecord'
18
+ // After (v0.3.0)
19
+ import { CompanyCodec } from '@flaks/onerecord'
20
+ ```
21
+
22
+ ### 2. `Waybill.shipmentInformation` → `Waybill.shipment`
23
+
24
+ ```typescript
25
+ // Before
26
+ waybill.shipmentInformation = 'https://example/sh'
27
+ // After
28
+ waybill.shipment = 'https://example/sh'
29
+ ```
30
+
31
+ ### 3. `Shipment.containedPieces` → `Shipment.pieces`
32
+
33
+ ```typescript
34
+ // Before
35
+ shipment.containedPieces = ['https://example/p1']
36
+ // After
37
+ shipment.pieces = ['https://example/p1']
38
+ ```
39
+
40
+ ### 4. `Shipment.shipper` / `Shipment.consignee` → `Shipment.involvedParties`
41
+
42
+ The `shipper` and `consignee` top-level fields on `Shipment` are removed.
43
+ Use `Shipment.involvedParties` filtered by `partyRole`:
44
+
45
+ ```typescript
46
+ const shipper = shipment.involvedParties?.find(p => p.partyRole === 'SHP')
47
+ const consignee = shipment.involvedParties?.find(p => p.partyRole === 'CNE')
48
+ ```
49
+
50
+ ### 5. `Shipment.pieceCount` / `Shipment.totalVolume` removed
51
+
52
+ No direct replacement in v0.3.0. Compute `pieceCount` from `pieces.length`
53
+ if needed. `totalVolume` is deferred (no spec-correct successor in scope).
54
+
55
+ ### 6. `AccountNumber` field renames
56
+
57
+ | v0.2.x field | v0.3.0 field | Notes |
58
+ |---|---|---|
59
+ | `accountNumber` | `textualValue` | String value of the account number |
60
+ | `accountType` | `accountNumberType` | IRI ref to code value |
61
+ | `issuedBy` | removed | Wrong domain; belongs to `:SecurityDeclaration` |
62
+
63
+ ### 7. `Party.partyDetails` widening — additive for accept
64
+
65
+ `partyDetails` now accepts `Person | Company` (not `Person | Organization`).
66
+ **This is additive for deserializing**: a bare IRI still validates. Code
67
+ that checks `partyDetails['@type'] === 'Organization'` must be updated to
68
+ `'Company'`. The new `NI` value is accepted for `partyRole`.
69
+
70
+ ### 8. `waybillNumber` and `waybillPrefix` regex relaxation
71
+
72
+ - **`waybillNumber`**: now accepts `[A-Z0-9]+` **per the 3.2-rc2 ontology
73
+ pattern**. Do not assume numeric-only (`[0-9]+`) downstream.
74
+ - **`waybillPrefix`**: now accepts up to 3 alphanumeric characters (`[A-Z0-9]{1,3}`)
75
+ as the library's **EDITORIAL policy** — the ontology only specifies
76
+ `xsd:string maxLength 3` with no character-class restriction. Do not assume
77
+ numeric-only downstream.
78
+
79
+ ### 9. `CARGO_ONTOLOGY_VERSION` constant changed
80
+
81
+ The exported constant changed from `'3.2'` to `'3.2.0'`:
82
+
83
+ ```typescript
84
+ // Before: CARGO_ONTOLOGY_VERSION === '3.2'
85
+ // After: CARGO_ONTOLOGY_VERSION === '3.2.0'
86
+ ```
87
+
88
+ Any code doing `=== '3.2'` on the constant must be updated to `=== '3.2.0'`
89
+ (or use `CARGO_ONTOLOGY_VERSION` indirectly).
90
+
91
+ ### 10. `assertOntologyVersion` + `checkServerInformation` — exact-alias peer-compat policy
92
+
93
+ Both functions now use an **exact-alias accepted set**: `{'3.2.0', '3.2'}`.
94
+
95
+ - `assertOntologyVersion('3.2.0')` — does NOT throw (canonical pin)
96
+ - `assertOntologyVersion('3.2')` — does NOT throw (legacy alias ≡ 3.2.0)
97
+ - `assertOntologyVersion('3.2.1')` — THROWS `incompatible_ontology_version`
98
+ - `assertOntologyVersion('4.0')` — THROWS `incompatible_ontology_version`
99
+
100
+ The accepted set is **NOT** prefix-tolerant (`'3.2.1'` is master-only and
101
+ intentionally rejected). `checkServerInformation` follows the same rule:
102
+ a server advertising `cargoOntologyVersion: '3.2.1'` will return
103
+ `compatible: false`.
104
+
105
+ ### 11. `waybillType` enum: `DIRECT` added
106
+
107
+ If your code has an exhaustive `switch` on `waybillType`, add a `'DIRECT'`
108
+ case. TypeScript will surface this at compile time.
109
+
110
+ ### 12. `domain_constraint_violation` for stale fields no longer fires
111
+
112
+ If your code expected `domain_constraint_violation` for a Waybill missing
113
+ `shipmentInformation` or a Shipment missing `containedPieces`, those errors
114
+ no longer fire — those fields don't exist in v0.3.0. Update your error
115
+ handling to match the new field names (`shipment`, `pieces`).
116
+
117
+ ---
118
+
119
+ ## Migrating from v0.1.x to v0.2.0
120
+
121
+ v0.2.0 is **non-breaking at the call-site level** for v0.1.x consumers.
122
+ Existing imports, codecs, and `createMapper({ ... })` calls work
123
+ unchanged. The release adds opt-in surfaces and one deprecation.
124
+
125
+ ### What's new (additive — adopt if useful)
126
+
127
+ - **Graph-walk dispatcher** for cross-node integrity validation:
128
+ ```typescript
129
+ // Option A — namespaced facade
130
+ import { onerecord } from '@flaks/onerecord'
131
+ const r = onerecord.dispatch.deserialize.Waybill(input)
132
+
133
+ // Option B — bound mapper
134
+ import { createMapper } from '@flaks/onerecord'
135
+ const m = createMapper({ graphWalk: true })
136
+ const r = m.deserializeWaybill(input)
137
+ ```
138
+ Both emit `duplicate_id_in_graph`, `missing_id`, `wrong_type_for_endpoint`,
139
+ `missing_type` for cross-node violations on direct children of the
140
+ root. Default per-class deserializers (`WaybillCodec.deserialize`,
141
+ `onerecord.deserialize.Waybill`) are unchanged — graph-walk is opt-in.
142
+
143
+ - **`acceptBookingOptionViaRequest`** — spec §5.4-correct booking flow
144
+ that returns the `BookingOptionRequest` intermediate state instead
145
+ of jumping straight to `Booking`:
146
+ ```typescript
147
+ import { acceptBookingOptionViaRequest } from '@flaks/onerecord'
148
+ const result = acceptBookingOptionViaRequest(opt)
149
+ // result.value is BookingOptionRequest, not Booking
150
+ ```
151
+
152
+ ### Deprecations (warn now, remove in v0.3)
153
+
154
+ - **`acceptBookingOption`** is `@deprecated`. Migrate to
155
+ `acceptBookingOptionViaRequest` and chain through your persistence
156
+ layer's BookingOptionRequest → Booking transition. Removal in v0.3
157
+ unless an IATA §5.4 spec amendment restores the §5.2 shortcut.
158
+ TypeScript will surface the deprecation; runtime behavior is unchanged
159
+ through v0.2.x.
160
+
161
+ ### FSU code list — 6 codes changed in each direction
162
+
163
+ The `FSU_EVENT_CODES` const + `test/fixtures/iata/xfsu-status-codes.json`
164
+ were regenerated from the upstream IATA-Cargo working draft. Net count
165
+ unchanged at 26, but **6 codes were dropped and 6 were added**:
166
+
167
+ - Removed: CLR, FOO, FWB, OFD, RCM, RCV
168
+ - Added: DOC, DPU, FIW, FOW, OCI, OSI
169
+
170
+ If your application enumerates FSU codes directly via `FsuCode` or
171
+ `FSU_EVENT_CODES.<KEY>`, switch to the new keys. Audit before updating;
172
+ this is the only behavior change that may break consumer code.
173
+
174
+ ### Bun-style consumers using `ignoreScripts`
175
+
176
+ If your consumer project sets `bun install --ignoreScripts` or equivalent,
177
+ v0.2.0 is unaffected — the library has no `prepare`/`postinstall` scripts.
178
+ The `xlsx` devDep (which carried two high-severity advisories) was
179
+ extracted to the sibling [`tjo099/onerecord-xlsx-tools`](https://github.com/tjo099/onerecord-xlsx-tools)
180
+ repo in v0.2.0. Your `bun audit` against `@flaks/onerecord` should now
181
+ show 0 findings from `xlsx` — only 2 vitest-transitive moderates remain.
182
+
5
183
  ## Migrating to v0.1.0
6
184
 
7
185
  v0.1.0 is the first minor release. There is no prior version to migrate from.
8
186
 
9
- ### Install
187
+ ### Install (current — v0.1.2 onwards)
10
188
 
11
189
  ```bash
12
- bun add git+https://github.com/tjo099/onerecord-mapper#v0.1.0
190
+ npm install @flaks/onerecord
191
+ # or
192
+ bun add @flaks/onerecord
13
193
  ```
14
194
 
15
- Pin to a specific tag in production. A future v0.2.0 release will
16
- additionally publish to npm as the public scoped package
17
- `@flaks/onerecord`; installing via git URL works today.
195
+ Pin a minor range in production (e.g. `"@flaks/onerecord": "^0.1.0"`).
196
+
197
+ ### Older install paths (historical)
198
+
199
+ - `v0.1.0` shipped as a git-URL install only. Do not use — `dist/` was
200
+ not in the tag. See CHANGELOG for details.
201
+ - `v0.1.1` attempted a `prepare`-script fix for git-URL installs.
202
+ Does not work on Bun's default "trusted dependencies" model. Skipped
203
+ in favor of v0.1.2 npm publish.
18
204
 
19
205
  ### Recommended import patterns
20
206