@freighttech/shipment-tracking 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (456) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE +25 -0
  3. package/dist/generated/entities/bic_config/index.js +21 -0
  4. package/dist/generated/entities/bic_config/index.js.map +7 -0
  5. package/dist/generated/entities/carrier_config/index.js +27 -0
  6. package/dist/generated/entities/carrier_config/index.js.map +7 -0
  7. package/dist/generated/entities/location_override/index.js +33 -0
  8. package/dist/generated/entities/location_override/index.js.map +7 -0
  9. package/dist/generated/entities/shipment/index.js +73 -0
  10. package/dist/generated/entities/shipment/index.js.map +7 -0
  11. package/dist/generated/entities/ships_go_config/index.js +31 -0
  12. package/dist/generated/entities/ships_go_config/index.js.map +7 -0
  13. package/dist/generated/entities/tracking_event/index.js +101 -0
  14. package/dist/generated/entities/tracking_event/index.js.map +7 -0
  15. package/dist/generated/entities/tracking_job/index.js +47 -0
  16. package/dist/generated/entities/tracking_job/index.js.map +7 -0
  17. package/dist/generated/entities/webhook/index.js +25 -0
  18. package/dist/generated/entities/webhook/index.js.map +7 -0
  19. package/dist/generated/entities/webhook_delivery/index.js +25 -0
  20. package/dist/generated/entities/webhook_delivery/index.js.map +7 -0
  21. package/dist/generated/entities.ids.generated.js +21 -0
  22. package/dist/generated/entities.ids.generated.js.map +7 -0
  23. package/dist/index.js +41 -0
  24. package/dist/index.js.map +7 -0
  25. package/dist/modules/shipment_tracking/acl.js +22 -0
  26. package/dist/modules/shipment_tracking/acl.js.map +7 -0
  27. package/dist/modules/shipment_tracking/api/bic-configs/route.js +176 -0
  28. package/dist/modules/shipment_tracking/api/bic-configs/route.js.map +7 -0
  29. package/dist/modules/shipment_tracking/api/bic-configs/test/route.js +95 -0
  30. package/dist/modules/shipment_tracking/api/bic-configs/test/route.js.map +7 -0
  31. package/dist/modules/shipment_tracking/api/cargo-events/route.js +93 -0
  32. package/dist/modules/shipment_tracking/api/cargo-events/route.js.map +7 -0
  33. package/dist/modules/shipment_tracking/api/carrier-configs/route.js +139 -0
  34. package/dist/modules/shipment_tracking/api/carrier-configs/route.js.map +7 -0
  35. package/dist/modules/shipment_tracking/api/dashboard/ships-map/route.js +177 -0
  36. package/dist/modules/shipment_tracking/api/dashboard/ships-map/route.js.map +7 -0
  37. package/dist/modules/shipment_tracking/api/location-overrides/route.js +179 -0
  38. package/dist/modules/shipment_tracking/api/location-overrides/route.js.map +7 -0
  39. package/dist/modules/shipment_tracking/api/openapi.js +27 -0
  40. package/dist/modules/shipment_tracking/api/openapi.js.map +7 -0
  41. package/dist/modules/shipment_tracking/api/shipments/route.js +192 -0
  42. package/dist/modules/shipment_tracking/api/shipments/route.js.map +7 -0
  43. package/dist/modules/shipment_tracking/api/shipsgo-configs/route.js +185 -0
  44. package/dist/modules/shipment_tracking/api/shipsgo-configs/route.js.map +7 -0
  45. package/dist/modules/shipment_tracking/api/tracking-jobs/route.js +144 -0
  46. package/dist/modules/shipment_tracking/api/tracking-jobs/route.js.map +7 -0
  47. package/dist/modules/shipment_tracking/api/tracking-jobs/sync/route.js +107 -0
  48. package/dist/modules/shipment_tracking/api/tracking-jobs/sync/route.js.map +7 -0
  49. package/dist/modules/shipment_tracking/api/utils.js +12 -0
  50. package/dist/modules/shipment_tracking/api/utils.js.map +7 -0
  51. package/dist/modules/shipment_tracking/api/webhooks/deliveries/route.js +76 -0
  52. package/dist/modules/shipment_tracking/api/webhooks/deliveries/route.js.map +7 -0
  53. package/dist/modules/shipment_tracking/api/webhooks/route.js +135 -0
  54. package/dist/modules/shipment_tracking/api/webhooks/route.js.map +7 -0
  55. package/dist/modules/shipment_tracking/api/webhooks/test/route.js +71 -0
  56. package/dist/modules/shipment_tracking/api/webhooks/test/route.js.map +7 -0
  57. package/dist/modules/shipment_tracking/assets/carriers/cma_cgm.png +0 -0
  58. package/dist/modules/shipment_tracking/assets/carriers/cosco.png +0 -0
  59. package/dist/modules/shipment_tracking/assets/carriers/evergreen.png +0 -0
  60. package/dist/modules/shipment_tracking/assets/carriers/hapag_lloyd.png +0 -0
  61. package/dist/modules/shipment_tracking/assets/carriers/maersk.png +0 -0
  62. package/dist/modules/shipment_tracking/assets/carriers/msc.png +0 -0
  63. package/dist/modules/shipment_tracking/assets/carriers/one.png +0 -0
  64. package/dist/modules/shipment_tracking/assets/carriers/oocl.png +0 -0
  65. package/dist/modules/shipment_tracking/assets/carriers/yang_ming.png +0 -0
  66. package/dist/modules/shipment_tracking/assets/carriers/zim.png +0 -0
  67. package/dist/modules/shipment_tracking/assets/index.js +52 -0
  68. package/dist/modules/shipment_tracking/assets/index.js.map +7 -0
  69. package/dist/modules/shipment_tracking/backend/carrier-configs/page.js +621 -0
  70. package/dist/modules/shipment_tracking/backend/carrier-configs/page.js.map +7 -0
  71. package/dist/modules/shipment_tracking/backend/carrier-configs/page.meta.js +19 -0
  72. package/dist/modules/shipment_tracking/backend/carrier-configs/page.meta.js.map +7 -0
  73. package/dist/modules/shipment_tracking/backend/location-overrides/page.js +198 -0
  74. package/dist/modules/shipment_tracking/backend/location-overrides/page.js.map +7 -0
  75. package/dist/modules/shipment_tracking/backend/location-overrides/page.meta.js +19 -0
  76. package/dist/modules/shipment_tracking/backend/location-overrides/page.meta.js.map +7 -0
  77. package/dist/modules/shipment_tracking/backend/shipment-tracking/page.js +279 -0
  78. package/dist/modules/shipment_tracking/backend/shipment-tracking/page.js.map +7 -0
  79. package/dist/modules/shipment_tracking/backend/shipment-tracking/page.meta.js +19 -0
  80. package/dist/modules/shipment_tracking/backend/shipment-tracking/page.meta.js.map +7 -0
  81. package/dist/modules/shipment_tracking/backend/tracking-jobs/page.js +10 -0
  82. package/dist/modules/shipment_tracking/backend/tracking-jobs/page.js.map +7 -0
  83. package/dist/modules/shipment_tracking/backend/tracking-jobs/page.meta.js +19 -0
  84. package/dist/modules/shipment_tracking/backend/tracking-jobs/page.meta.js.map +7 -0
  85. package/dist/modules/shipment_tracking/backend/webhooks/page.js +198 -0
  86. package/dist/modules/shipment_tracking/backend/webhooks/page.js.map +7 -0
  87. package/dist/modules/shipment_tracking/backend/webhooks/page.meta.js +19 -0
  88. package/dist/modules/shipment_tracking/backend/webhooks/page.meta.js.map +7 -0
  89. package/dist/modules/shipment_tracking/ce.js +52 -0
  90. package/dist/modules/shipment_tracking/ce.js.map +7 -0
  91. package/dist/modules/shipment_tracking/cli.js +229 -0
  92. package/dist/modules/shipment_tracking/cli.js.map +7 -0
  93. package/dist/modules/shipment_tracking/commands/bic-configs.js +66 -0
  94. package/dist/modules/shipment_tracking/commands/bic-configs.js.map +7 -0
  95. package/dist/modules/shipment_tracking/commands/carrier-configs.js +65 -0
  96. package/dist/modules/shipment_tracking/commands/carrier-configs.js.map +7 -0
  97. package/dist/modules/shipment_tracking/commands/index.js +9 -0
  98. package/dist/modules/shipment_tracking/commands/index.js.map +7 -0
  99. package/dist/modules/shipment_tracking/commands/location-overrides.js +93 -0
  100. package/dist/modules/shipment_tracking/commands/location-overrides.js.map +7 -0
  101. package/dist/modules/shipment_tracking/commands/shipments.js +200 -0
  102. package/dist/modules/shipment_tracking/commands/shipments.js.map +7 -0
  103. package/dist/modules/shipment_tracking/commands/shipsgo-configs.js +75 -0
  104. package/dist/modules/shipment_tracking/commands/shipsgo-configs.js.map +7 -0
  105. package/dist/modules/shipment_tracking/commands/tracking-jobs.js +120 -0
  106. package/dist/modules/shipment_tracking/commands/tracking-jobs.js.map +7 -0
  107. package/dist/modules/shipment_tracking/commands/tracking.js +140 -0
  108. package/dist/modules/shipment_tracking/commands/tracking.js.map +7 -0
  109. package/dist/modules/shipment_tracking/commands/webhooks.js +115 -0
  110. package/dist/modules/shipment_tracking/commands/webhooks.js.map +7 -0
  111. package/dist/modules/shipment_tracking/components/CombinedTimestampCell.js +168 -0
  112. package/dist/modules/shipment_tracking/components/CombinedTimestampCell.js.map +7 -0
  113. package/dist/modules/shipment_tracking/components/FacilityLocationInput.js +202 -0
  114. package/dist/modules/shipment_tracking/components/FacilityLocationInput.js.map +7 -0
  115. package/dist/modules/shipment_tracking/components/LocationOverrideDrawer.js +501 -0
  116. package/dist/modules/shipment_tracking/components/LocationOverrideDrawer.js.map +7 -0
  117. package/dist/modules/shipment_tracking/components/ShipmentDetailsDrawer.js +818 -0
  118. package/dist/modules/shipment_tracking/components/ShipmentDetailsDrawer.js.map +7 -0
  119. package/dist/modules/shipment_tracking/components/ShipmentDrawer.js +404 -0
  120. package/dist/modules/shipment_tracking/components/ShipmentDrawer.js.map +7 -0
  121. package/dist/modules/shipment_tracking/components/ShipsGoConfigSection.js +200 -0
  122. package/dist/modules/shipment_tracking/components/ShipsGoConfigSection.js.map +7 -0
  123. package/dist/modules/shipment_tracking/components/TimestampCell.js +108 -0
  124. package/dist/modules/shipment_tracking/components/TimestampCell.js.map +7 -0
  125. package/dist/modules/shipment_tracking/components/TrackingJobDrawer.js +343 -0
  126. package/dist/modules/shipment_tracking/components/TrackingJobDrawer.js.map +7 -0
  127. package/dist/modules/shipment_tracking/components/VesselTrackingMap.js +496 -0
  128. package/dist/modules/shipment_tracking/components/VesselTrackingMap.js.map +7 -0
  129. package/dist/modules/shipment_tracking/components/WebhookDrawer.js +332 -0
  130. package/dist/modules/shipment_tracking/components/WebhookDrawer.js.map +7 -0
  131. package/dist/modules/shipment_tracking/data/entities.js +686 -0
  132. package/dist/modules/shipment_tracking/data/entities.js.map +7 -0
  133. package/dist/modules/shipment_tracking/data/validators.js +434 -0
  134. package/dist/modules/shipment_tracking/data/validators.js.map +7 -0
  135. package/dist/modules/shipment_tracking/di.js +60 -0
  136. package/dist/modules/shipment_tracking/di.js.map +7 -0
  137. package/dist/modules/shipment_tracking/encryption.js +12 -0
  138. package/dist/modules/shipment_tracking/encryption.js.map +7 -0
  139. package/dist/modules/shipment_tracking/events.js +87 -0
  140. package/dist/modules/shipment_tracking/events.js.map +7 -0
  141. package/dist/modules/shipment_tracking/hooks/useVesselTracking.js +137 -0
  142. package/dist/modules/shipment_tracking/hooks/useVesselTracking.js.map +7 -0
  143. package/dist/modules/shipment_tracking/i18n/de.json +327 -0
  144. package/dist/modules/shipment_tracking/i18n/en.json +327 -0
  145. package/dist/modules/shipment_tracking/i18n/es.json +327 -0
  146. package/dist/modules/shipment_tracking/i18n/pl.json +327 -0
  147. package/dist/modules/shipment_tracking/index.js +15 -0
  148. package/dist/modules/shipment_tracking/index.js.map +7 -0
  149. package/dist/modules/shipment_tracking/lib/adapters/cma-cgm.js +66 -0
  150. package/dist/modules/shipment_tracking/lib/adapters/cma-cgm.js.map +7 -0
  151. package/dist/modules/shipment_tracking/lib/adapters/cosco-types.js +1 -0
  152. package/dist/modules/shipment_tracking/lib/adapters/cosco-types.js.map +7 -0
  153. package/dist/modules/shipment_tracking/lib/adapters/cosco.js +236 -0
  154. package/dist/modules/shipment_tracking/lib/adapters/cosco.js.map +7 -0
  155. package/dist/modules/shipment_tracking/lib/adapters/evergreen.js +87 -0
  156. package/dist/modules/shipment_tracking/lib/adapters/evergreen.js.map +7 -0
  157. package/dist/modules/shipment_tracking/lib/adapters/hapag-lloyd.js +68 -0
  158. package/dist/modules/shipment_tracking/lib/adapters/hapag-lloyd.js.map +7 -0
  159. package/dist/modules/shipment_tracking/lib/adapters/index.js +20 -0
  160. package/dist/modules/shipment_tracking/lib/adapters/index.js.map +7 -0
  161. package/dist/modules/shipment_tracking/lib/adapters/maersk.js +84 -0
  162. package/dist/modules/shipment_tracking/lib/adapters/maersk.js.map +7 -0
  163. package/dist/modules/shipment_tracking/lib/adapters/msc.js +170 -0
  164. package/dist/modules/shipment_tracking/lib/adapters/msc.js.map +7 -0
  165. package/dist/modules/shipment_tracking/lib/adapters/zim.js +85 -0
  166. package/dist/modules/shipment_tracking/lib/adapters/zim.js.map +7 -0
  167. package/dist/modules/shipment_tracking/lib/audit-helpers.js +20 -0
  168. package/dist/modules/shipment_tracking/lib/audit-helpers.js.map +7 -0
  169. package/dist/modules/shipment_tracking/lib/auth/base64url.js +8 -0
  170. package/dist/modules/shipment_tracking/lib/auth/base64url.js.map +7 -0
  171. package/dist/modules/shipment_tracking/lib/auth/oauth-client.js +38 -0
  172. package/dist/modules/shipment_tracking/lib/auth/oauth-client.js.map +7 -0
  173. package/dist/modules/shipment_tracking/lib/background.js +15 -0
  174. package/dist/modules/shipment_tracking/lib/background.js.map +7 -0
  175. package/dist/modules/shipment_tracking/lib/bic-api-client.js +106 -0
  176. package/dist/modules/shipment_tracking/lib/bic-api-client.js.map +7 -0
  177. package/dist/modules/shipment_tracking/lib/carrier-adapter.js +17 -0
  178. package/dist/modules/shipment_tracking/lib/carrier-adapter.js.map +7 -0
  179. package/dist/modules/shipment_tracking/lib/current-vessel.js +149 -0
  180. package/dist/modules/shipment_tracking/lib/current-vessel.js.map +7 -0
  181. package/dist/modules/shipment_tracking/lib/dcsa-event-mapping.js +124 -0
  182. package/dist/modules/shipment_tracking/lib/dcsa-event-mapping.js.map +7 -0
  183. package/dist/modules/shipment_tracking/lib/dcsa-event-parser.js +112 -0
  184. package/dist/modules/shipment_tracking/lib/dcsa-event-parser.js.map +7 -0
  185. package/dist/modules/shipment_tracking/lib/dcsa-params.js +16 -0
  186. package/dist/modules/shipment_tracking/lib/dcsa-params.js.map +7 -0
  187. package/dist/modules/shipment_tracking/lib/empty-return.js +48 -0
  188. package/dist/modules/shipment_tracking/lib/empty-return.js.map +7 -0
  189. package/dist/modules/shipment_tracking/lib/location-overrides.js +85 -0
  190. package/dist/modules/shipment_tracking/lib/location-overrides.js.map +7 -0
  191. package/dist/modules/shipment_tracking/lib/location-types.js +59 -0
  192. package/dist/modules/shipment_tracking/lib/location-types.js.map +7 -0
  193. package/dist/modules/shipment_tracking/lib/logger.js +113 -0
  194. package/dist/modules/shipment_tracking/lib/logger.js.map +7 -0
  195. package/dist/modules/shipment_tracking/lib/poi-event-processor.js +183 -0
  196. package/dist/modules/shipment_tracking/lib/poi-event-processor.js.map +7 -0
  197. package/dist/modules/shipment_tracking/lib/poi-nats-config.js +52 -0
  198. package/dist/modules/shipment_tracking/lib/poi-nats-config.js.map +7 -0
  199. package/dist/modules/shipment_tracking/lib/poi-types.js +43 -0
  200. package/dist/modules/shipment_tracking/lib/poi-types.js.map +7 -0
  201. package/dist/modules/shipment_tracking/lib/rate-limiter.js +31 -0
  202. package/dist/modules/shipment_tracking/lib/rate-limiter.js.map +7 -0
  203. package/dist/modules/shipment_tracking/lib/route-extraction.js +187 -0
  204. package/dist/modules/shipment_tracking/lib/route-extraction.js.map +7 -0
  205. package/dist/modules/shipment_tracking/lib/route-inference.js +106 -0
  206. package/dist/modules/shipment_tracking/lib/route-inference.js.map +7 -0
  207. package/dist/modules/shipment_tracking/lib/schedule-generator.js +63 -0
  208. package/dist/modules/shipment_tracking/lib/schedule-generator.js.map +7 -0
  209. package/dist/modules/shipment_tracking/lib/shipsgo-client.js +143 -0
  210. package/dist/modules/shipment_tracking/lib/shipsgo-client.js.map +7 -0
  211. package/dist/modules/shipment_tracking/lib/shipsgo-mapper.js +204 -0
  212. package/dist/modules/shipment_tracking/lib/shipsgo-mapper.js.map +7 -0
  213. package/dist/modules/shipment_tracking/lib/status-machine.js +131 -0
  214. package/dist/modules/shipment_tracking/lib/status-machine.js.map +7 -0
  215. package/dist/modules/shipment_tracking/lib/time-extraction.js +41 -0
  216. package/dist/modules/shipment_tracking/lib/time-extraction.js.map +7 -0
  217. package/dist/modules/shipment_tracking/lib/timestamp-utils.js +100 -0
  218. package/dist/modules/shipment_tracking/lib/timestamp-utils.js.map +7 -0
  219. package/dist/modules/shipment_tracking/lib/vessel-api.js +111 -0
  220. package/dist/modules/shipment_tracking/lib/vessel-api.js.map +7 -0
  221. package/dist/modules/shipment_tracking/lib/vessel-cache.js +50 -0
  222. package/dist/modules/shipment_tracking/lib/vessel-cache.js.map +7 -0
  223. package/dist/modules/shipment_tracking/lib/vessel-extraction.js +13 -0
  224. package/dist/modules/shipment_tracking/lib/vessel-extraction.js.map +7 -0
  225. package/dist/modules/shipment_tracking/lib/webhook-dispatcher.js +62 -0
  226. package/dist/modules/shipment_tracking/lib/webhook-dispatcher.js.map +7 -0
  227. package/dist/modules/shipment_tracking/migrations/Migration20260422161208_shipment_tracking.js +48 -0
  228. package/dist/modules/shipment_tracking/migrations/Migration20260422161208_shipment_tracking.js.map +7 -0
  229. package/dist/modules/shipment_tracking/migrations/Migration20260529120000_shipment_tracking_poi_region_names.js +15 -0
  230. package/dist/modules/shipment_tracking/migrations/Migration20260529120000_shipment_tracking_poi_region_names.js.map +7 -0
  231. package/dist/modules/shipment_tracking/migrations/Migration20260821120000_shipment_tracking_shipsgo.js +47 -0
  232. package/dist/modules/shipment_tracking/migrations/Migration20260821120000_shipment_tracking_shipsgo.js.map +7 -0
  233. package/dist/modules/shipment_tracking/notifications.js +145 -0
  234. package/dist/modules/shipment_tracking/notifications.js.map +7 -0
  235. package/dist/modules/shipment_tracking/services/carrierRegistry.js +24 -0
  236. package/dist/modules/shipment_tracking/services/carrierRegistry.js.map +7 -0
  237. package/dist/modules/shipment_tracking/services/poiNatsService.js +397 -0
  238. package/dist/modules/shipment_tracking/services/poiNatsService.js.map +7 -0
  239. package/dist/modules/shipment_tracking/services/shipsGoProvider.js +163 -0
  240. package/dist/modules/shipment_tracking/services/shipsGoProvider.js.map +7 -0
  241. package/dist/modules/shipment_tracking/services/trackingService.js +1283 -0
  242. package/dist/modules/shipment_tracking/services/trackingService.js.map +7 -0
  243. package/dist/modules/shipment_tracking/services/webhookService.js +263 -0
  244. package/dist/modules/shipment_tracking/services/webhookService.js.map +7 -0
  245. package/dist/modules/shipment_tracking/setup.js +72 -0
  246. package/dist/modules/shipment_tracking/setup.js.map +7 -0
  247. package/dist/modules/shipment_tracking/subscribers/cargo-event-created.js +60 -0
  248. package/dist/modules/shipment_tracking/subscribers/cargo-event-created.js.map +7 -0
  249. package/dist/modules/shipment_tracking/subscribers/dcsa-event-webhook-dispatch.js +58 -0
  250. package/dist/modules/shipment_tracking/subscribers/dcsa-event-webhook-dispatch.js.map +7 -0
  251. package/dist/modules/shipment_tracking/subscribers/poi-event-notification.js +82 -0
  252. package/dist/modules/shipment_tracking/subscribers/poi-event-notification.js.map +7 -0
  253. package/dist/modules/shipment_tracking/subscribers/poi-event-webhook-dispatch.js +53 -0
  254. package/dist/modules/shipment_tracking/subscribers/poi-event-webhook-dispatch.js.map +7 -0
  255. package/dist/modules/shipment_tracking/subscribers/shipment-status-changed.js +28 -0
  256. package/dist/modules/shipment_tracking/subscribers/shipment-status-changed.js.map +7 -0
  257. package/dist/modules/shipment_tracking/subscribers/terminal-event-ingest.js +67 -0
  258. package/dist/modules/shipment_tracking/subscribers/terminal-event-ingest.js.map +7 -0
  259. package/dist/modules/shipment_tracking/subscribers/tracking-job-initial-poll.js +30 -0
  260. package/dist/modules/shipment_tracking/subscribers/tracking-job-initial-poll.js.map +7 -0
  261. package/dist/modules/shipment_tracking/subscribers/tracking-job-webhook-dispatch.js +19 -0
  262. package/dist/modules/shipment_tracking/subscribers/tracking-job-webhook-dispatch.js.map +7 -0
  263. package/dist/modules/shipment_tracking/tables/index.js +6 -0
  264. package/dist/modules/shipment_tracking/tables/index.js.map +7 -0
  265. package/dist/modules/shipment_tracking/tables/tracking_job/table.client.js +284 -0
  266. package/dist/modules/shipment_tracking/tables/tracking_job/table.client.js.map +7 -0
  267. package/dist/modules/shipment_tracking/tables/tracking_job/table.js +36 -0
  268. package/dist/modules/shipment_tracking/tables/tracking_job/table.js.map +7 -0
  269. package/dist/modules/shipment_tracking/widgets/dashboard/ships-map/config.js +25 -0
  270. package/dist/modules/shipment_tracking/widgets/dashboard/ships-map/config.js.map +7 -0
  271. package/dist/modules/shipment_tracking/widgets/dashboard/ships-map/widget.client.js +355 -0
  272. package/dist/modules/shipment_tracking/widgets/dashboard/ships-map/widget.client.js.map +7 -0
  273. package/dist/modules/shipment_tracking/widgets/dashboard/ships-map/widget.js +26 -0
  274. package/dist/modules/shipment_tracking/widgets/dashboard/ships-map/widget.js.map +7 -0
  275. package/dist/types/assets.d.js +1 -0
  276. package/dist/types/assets.d.js.map +7 -0
  277. package/generated/entities/bic_config/index.ts +20 -0
  278. package/generated/entities/carrier_config/index.ts +23 -0
  279. package/generated/entities/location_override/index.ts +26 -0
  280. package/generated/entities/shipment/index.ts +46 -0
  281. package/generated/entities/ships_go_config/index.ts +25 -0
  282. package/generated/entities/tracking_event/index.ts +60 -0
  283. package/generated/entities/tracking_job/index.ts +33 -0
  284. package/generated/entities/webhook/index.ts +22 -0
  285. package/generated/entities/webhook_delivery/index.ts +22 -0
  286. package/generated/entities.ids.generated.ts +47 -0
  287. package/package.json +81 -0
  288. package/src/index.ts +39 -0
  289. package/src/modules/shipment_tracking/__integration__/TC-TRACK-410-shipsgo-config-api.spec.ts +133 -0
  290. package/src/modules/shipment_tracking/__integration__/meta.ts +4 -0
  291. package/src/modules/shipment_tracking/__tests__/empty-return-stop.test.ts +231 -0
  292. package/src/modules/shipment_tracking/__tests__/fixtures/hapag-lloyd-transship-container.json +702 -0
  293. package/src/modules/shipment_tracking/__tests__/fixtures/index.ts +434 -0
  294. package/src/modules/shipment_tracking/__tests__/fixtures/maersk-multi-transship-completed.json +1518 -0
  295. package/src/modules/shipment_tracking/__tests__/fixtures/maersk-transship-intransit.json +558 -0
  296. package/src/modules/shipment_tracking/__tests__/fixtures/msc-direct.json +222 -0
  297. package/src/modules/shipment_tracking/__tests__/fixtures/msc-multi-transship-completed.json +974 -0
  298. package/src/modules/shipment_tracking/__tests__/fixtures/msc-multi.json +4846 -0
  299. package/src/modules/shipment_tracking/__tests__/fixtures/msc-transship.json +409 -0
  300. package/src/modules/shipment_tracking/__tests__/fixtures/poi-events.json +240 -0
  301. package/src/modules/shipment_tracking/__tests__/fixtures/synthetic/index.ts +138 -0
  302. package/src/modules/shipment_tracking/__tests__/fixtures/synthetic-eta-updates.json +288 -0
  303. package/src/modules/shipment_tracking/__tests__/fixtures/synthetic-route-inference.json +201 -0
  304. package/src/modules/shipment_tracking/__tests__/fixtures/synthetic-voyage-progression.json +410 -0
  305. package/src/modules/shipment_tracking/__tests__/shipsgo-air-mapper.test.ts +157 -0
  306. package/src/modules/shipment_tracking/__tests__/shipsgo-client.test.ts +155 -0
  307. package/src/modules/shipment_tracking/__tests__/shipsgo-mapper.test.ts +201 -0
  308. package/src/modules/shipment_tracking/__tests__/shipsgo-poll.test.ts +357 -0
  309. package/src/modules/shipment_tracking/__tests__/shipsgo-provider.test.ts +364 -0
  310. package/src/modules/shipment_tracking/__tests__/trackingService.integration.test.ts +2248 -0
  311. package/src/modules/shipment_tracking/__tests__/webhookPayload.test.ts +151 -0
  312. package/src/modules/shipment_tracking/acl.ts +18 -0
  313. package/src/modules/shipment_tracking/api/bic-configs/route.ts +206 -0
  314. package/src/modules/shipment_tracking/api/bic-configs/test/route.ts +108 -0
  315. package/src/modules/shipment_tracking/api/cargo-events/route.ts +101 -0
  316. package/src/modules/shipment_tracking/api/carrier-configs/route.ts +142 -0
  317. package/src/modules/shipment_tracking/api/dashboard/ships-map/route.ts +246 -0
  318. package/src/modules/shipment_tracking/api/location-overrides/route.ts +185 -0
  319. package/src/modules/shipment_tracking/api/openapi.ts +28 -0
  320. package/src/modules/shipment_tracking/api/shipments/route.ts +197 -0
  321. package/src/modules/shipment_tracking/api/shipsgo-configs/route.ts +215 -0
  322. package/src/modules/shipment_tracking/api/tracking-jobs/route.ts +149 -0
  323. package/src/modules/shipment_tracking/api/tracking-jobs/sync/route.ts +116 -0
  324. package/src/modules/shipment_tracking/api/utils.ts +10 -0
  325. package/src/modules/shipment_tracking/api/webhooks/deliveries/route.ts +82 -0
  326. package/src/modules/shipment_tracking/api/webhooks/route.ts +138 -0
  327. package/src/modules/shipment_tracking/api/webhooks/test/route.ts +84 -0
  328. package/src/modules/shipment_tracking/assets/carriers/cma_cgm.png +0 -0
  329. package/src/modules/shipment_tracking/assets/carriers/cosco.png +0 -0
  330. package/src/modules/shipment_tracking/assets/carriers/evergreen.png +0 -0
  331. package/src/modules/shipment_tracking/assets/carriers/hapag_lloyd.png +0 -0
  332. package/src/modules/shipment_tracking/assets/carriers/maersk.png +0 -0
  333. package/src/modules/shipment_tracking/assets/carriers/msc.png +0 -0
  334. package/src/modules/shipment_tracking/assets/carriers/one.png +0 -0
  335. package/src/modules/shipment_tracking/assets/carriers/oocl.png +0 -0
  336. package/src/modules/shipment_tracking/assets/carriers/yang_ming.png +0 -0
  337. package/src/modules/shipment_tracking/assets/carriers/zim.png +0 -0
  338. package/src/modules/shipment_tracking/assets/index.ts +66 -0
  339. package/src/modules/shipment_tracking/backend/carrier-configs/page.meta.ts +16 -0
  340. package/src/modules/shipment_tracking/backend/carrier-configs/page.tsx +782 -0
  341. package/src/modules/shipment_tracking/backend/location-overrides/page.meta.ts +16 -0
  342. package/src/modules/shipment_tracking/backend/location-overrides/page.tsx +241 -0
  343. package/src/modules/shipment_tracking/backend/shipment-tracking/page.meta.ts +16 -0
  344. package/src/modules/shipment_tracking/backend/shipment-tracking/page.tsx +340 -0
  345. package/src/modules/shipment_tracking/backend/tracking-jobs/page.meta.ts +16 -0
  346. package/src/modules/shipment_tracking/backend/tracking-jobs/page.tsx +16 -0
  347. package/src/modules/shipment_tracking/backend/webhooks/page.meta.ts +16 -0
  348. package/src/modules/shipment_tracking/backend/webhooks/page.tsx +228 -0
  349. package/src/modules/shipment_tracking/ce.ts +48 -0
  350. package/src/modules/shipment_tracking/cli.ts +321 -0
  351. package/src/modules/shipment_tracking/commands/bic-configs.ts +94 -0
  352. package/src/modules/shipment_tracking/commands/carrier-configs.ts +89 -0
  353. package/src/modules/shipment_tracking/commands/index.ts +8 -0
  354. package/src/modules/shipment_tracking/commands/location-overrides.ts +119 -0
  355. package/src/modules/shipment_tracking/commands/shipments.ts +247 -0
  356. package/src/modules/shipment_tracking/commands/shipsgo-configs.ts +101 -0
  357. package/src/modules/shipment_tracking/commands/tracking-jobs.ts +158 -0
  358. package/src/modules/shipment_tracking/commands/tracking.ts +230 -0
  359. package/src/modules/shipment_tracking/commands/webhooks.ts +159 -0
  360. package/src/modules/shipment_tracking/components/CombinedTimestampCell.tsx +236 -0
  361. package/src/modules/shipment_tracking/components/FacilityLocationInput.tsx +235 -0
  362. package/src/modules/shipment_tracking/components/LocationOverrideDrawer.tsx +586 -0
  363. package/src/modules/shipment_tracking/components/ShipmentDetailsDrawer.tsx +1364 -0
  364. package/src/modules/shipment_tracking/components/ShipmentDrawer.tsx +498 -0
  365. package/src/modules/shipment_tracking/components/ShipsGoConfigSection.tsx +266 -0
  366. package/src/modules/shipment_tracking/components/TimestampCell.tsx +146 -0
  367. package/src/modules/shipment_tracking/components/TrackingJobDrawer.tsx +467 -0
  368. package/src/modules/shipment_tracking/components/VesselTrackingMap.tsx +761 -0
  369. package/src/modules/shipment_tracking/components/WebhookDrawer.tsx +434 -0
  370. package/src/modules/shipment_tracking/data/entities.ts +748 -0
  371. package/src/modules/shipment_tracking/data/validators.ts +523 -0
  372. package/src/modules/shipment_tracking/di.ts +73 -0
  373. package/src/modules/shipment_tracking/encryption.ts +17 -0
  374. package/src/modules/shipment_tracking/events.ts +122 -0
  375. package/src/modules/shipment_tracking/hooks/useVesselTracking.ts +297 -0
  376. package/src/modules/shipment_tracking/i18n/de.json +327 -0
  377. package/src/modules/shipment_tracking/i18n/en.json +327 -0
  378. package/src/modules/shipment_tracking/i18n/es.json +327 -0
  379. package/src/modules/shipment_tracking/i18n/pl.json +327 -0
  380. package/src/modules/shipment_tracking/index.ts +13 -0
  381. package/src/modules/shipment_tracking/lib/__tests__/dcsa-event-mapping.test.ts +385 -0
  382. package/src/modules/shipment_tracking/lib/__tests__/dcsa-event-parser.test.ts +398 -0
  383. package/src/modules/shipment_tracking/lib/__tests__/empty-return.test.ts +174 -0
  384. package/src/modules/shipment_tracking/lib/__tests__/poi-event-processor.test.ts +699 -0
  385. package/src/modules/shipment_tracking/lib/__tests__/route-inference.test.ts +402 -0
  386. package/src/modules/shipment_tracking/lib/__tests__/status-machine.test.ts +447 -0
  387. package/src/modules/shipment_tracking/lib/__tests__/time-extraction.test.ts +331 -0
  388. package/src/modules/shipment_tracking/lib/__tests__/timestamp-utils.test.ts +260 -0
  389. package/src/modules/shipment_tracking/lib/__tests__/vessel-api.test.ts +125 -0
  390. package/src/modules/shipment_tracking/lib/__tests__/vessel-extraction.test.ts +108 -0
  391. package/src/modules/shipment_tracking/lib/adapters/cma-cgm.ts +84 -0
  392. package/src/modules/shipment_tracking/lib/adapters/cosco-types.ts +145 -0
  393. package/src/modules/shipment_tracking/lib/adapters/cosco.ts +314 -0
  394. package/src/modules/shipment_tracking/lib/adapters/evergreen.ts +107 -0
  395. package/src/modules/shipment_tracking/lib/adapters/hapag-lloyd.ts +88 -0
  396. package/src/modules/shipment_tracking/lib/adapters/index.ts +18 -0
  397. package/src/modules/shipment_tracking/lib/adapters/maersk.ts +104 -0
  398. package/src/modules/shipment_tracking/lib/adapters/msc.ts +223 -0
  399. package/src/modules/shipment_tracking/lib/adapters/zim.ts +106 -0
  400. package/src/modules/shipment_tracking/lib/audit-helpers.ts +29 -0
  401. package/src/modules/shipment_tracking/lib/auth/base64url.ts +4 -0
  402. package/src/modules/shipment_tracking/lib/auth/oauth-client.ts +53 -0
  403. package/src/modules/shipment_tracking/lib/background.ts +24 -0
  404. package/src/modules/shipment_tracking/lib/bic-api-client.ts +199 -0
  405. package/src/modules/shipment_tracking/lib/carrier-adapter.ts +136 -0
  406. package/src/modules/shipment_tracking/lib/current-vessel.ts +274 -0
  407. package/src/modules/shipment_tracking/lib/dcsa-event-mapping.ts +202 -0
  408. package/src/modules/shipment_tracking/lib/dcsa-event-parser.ts +163 -0
  409. package/src/modules/shipment_tracking/lib/dcsa-params.ts +14 -0
  410. package/src/modules/shipment_tracking/lib/empty-return.ts +122 -0
  411. package/src/modules/shipment_tracking/lib/location-overrides.ts +150 -0
  412. package/src/modules/shipment_tracking/lib/location-types.ts +154 -0
  413. package/src/modules/shipment_tracking/lib/logger.ts +195 -0
  414. package/src/modules/shipment_tracking/lib/poi-event-processor.ts +302 -0
  415. package/src/modules/shipment_tracking/lib/poi-nats-config.ts +134 -0
  416. package/src/modules/shipment_tracking/lib/poi-types.ts +198 -0
  417. package/src/modules/shipment_tracking/lib/rate-limiter.ts +58 -0
  418. package/src/modules/shipment_tracking/lib/route-extraction.ts +439 -0
  419. package/src/modules/shipment_tracking/lib/route-inference.ts +238 -0
  420. package/src/modules/shipment_tracking/lib/schedule-generator.ts +92 -0
  421. package/src/modules/shipment_tracking/lib/shipsgo-client.ts +350 -0
  422. package/src/modules/shipment_tracking/lib/shipsgo-mapper.ts +296 -0
  423. package/src/modules/shipment_tracking/lib/status-machine.ts +230 -0
  424. package/src/modules/shipment_tracking/lib/time-extraction.ts +85 -0
  425. package/src/modules/shipment_tracking/lib/timestamp-utils.ts +244 -0
  426. package/src/modules/shipment_tracking/lib/vessel-api.ts +299 -0
  427. package/src/modules/shipment_tracking/lib/vessel-cache.ts +102 -0
  428. package/src/modules/shipment_tracking/lib/vessel-extraction.ts +39 -0
  429. package/src/modules/shipment_tracking/lib/webhook-dispatcher.ts +93 -0
  430. package/src/modules/shipment_tracking/migrations/.snapshot-open-mercato.json +2914 -0
  431. package/src/modules/shipment_tracking/migrations/Migration20260422161208_shipment_tracking.ts +60 -0
  432. package/src/modules/shipment_tracking/migrations/Migration20260529120000_shipment_tracking_poi_region_names.ts +22 -0
  433. package/src/modules/shipment_tracking/migrations/Migration20260821120000_shipment_tracking_shipsgo.ts +65 -0
  434. package/src/modules/shipment_tracking/notifications.ts +151 -0
  435. package/src/modules/shipment_tracking/services/carrierRegistry.ts +29 -0
  436. package/src/modules/shipment_tracking/services/poiNatsService.ts +526 -0
  437. package/src/modules/shipment_tracking/services/shipsGoProvider.ts +231 -0
  438. package/src/modules/shipment_tracking/services/trackingService.ts +1777 -0
  439. package/src/modules/shipment_tracking/services/webhookService.ts +347 -0
  440. package/src/modules/shipment_tracking/setup.ts +99 -0
  441. package/src/modules/shipment_tracking/subscribers/__tests__/terminal-event-ingest.test.ts +141 -0
  442. package/src/modules/shipment_tracking/subscribers/cargo-event-created.ts +115 -0
  443. package/src/modules/shipment_tracking/subscribers/dcsa-event-webhook-dispatch.ts +115 -0
  444. package/src/modules/shipment_tracking/subscribers/poi-event-notification.ts +144 -0
  445. package/src/modules/shipment_tracking/subscribers/poi-event-webhook-dispatch.ts +94 -0
  446. package/src/modules/shipment_tracking/subscribers/shipment-status-changed.ts +41 -0
  447. package/src/modules/shipment_tracking/subscribers/terminal-event-ingest.ts +109 -0
  448. package/src/modules/shipment_tracking/subscribers/tracking-job-initial-poll.ts +53 -0
  449. package/src/modules/shipment_tracking/subscribers/tracking-job-webhook-dispatch.ts +50 -0
  450. package/src/modules/shipment_tracking/tables/index.ts +4 -0
  451. package/src/modules/shipment_tracking/tables/tracking_job/table.client.tsx +337 -0
  452. package/src/modules/shipment_tracking/tables/tracking_job/table.ts +34 -0
  453. package/src/modules/shipment_tracking/widgets/dashboard/ships-map/config.ts +32 -0
  454. package/src/modules/shipment_tracking/widgets/dashboard/ships-map/widget.client.tsx +448 -0
  455. package/src/modules/shipment_tracking/widgets/dashboard/ships-map/widget.ts +25 -0
  456. package/src/types/assets.d.ts +5 -0
@@ -0,0 +1,686 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __decorateClass = (decorators, target, key, kind) => {
4
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
5
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
+ if (decorator = decorators[i])
7
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
+ if (kind && result) __defProp(target, key, result);
9
+ return result;
10
+ };
11
+ import { Collection, OptionalProps } from "@mikro-orm/core";
12
+ import { Entity, PrimaryKey, Property, Index, Unique, ManyToOne, OneToMany } from "@mikro-orm/decorators/legacy";
13
+ OptionalProps;
14
+ let TrackingJob = class {
15
+ constructor() {
16
+ this.provider = "carrier";
17
+ this.mode = "ocean";
18
+ this.status = "active";
19
+ this.retryCount = 0;
20
+ this.shipments = new Collection(this);
21
+ this.events = new Collection(this);
22
+ }
23
+ };
24
+ __decorateClass([
25
+ PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
26
+ ], TrackingJob.prototype, "id", 2);
27
+ __decorateClass([
28
+ Property({ name: "organization_id", type: "uuid" })
29
+ ], TrackingJob.prototype, "organizationId", 2);
30
+ __decorateClass([
31
+ Property({ name: "tenant_id", type: "uuid" })
32
+ ], TrackingJob.prototype, "tenantId", 2);
33
+ __decorateClass([
34
+ Property({ type: "text", default: "carrier" })
35
+ ], TrackingJob.prototype, "provider", 2);
36
+ __decorateClass([
37
+ Property({ type: "text", default: "ocean" })
38
+ ], TrackingJob.prototype, "mode", 2);
39
+ __decorateClass([
40
+ Property({ name: "provider_shipment_id", type: "text", nullable: true })
41
+ ], TrackingJob.prototype, "providerShipmentId", 2);
42
+ __decorateClass([
43
+ Property({ name: "carrier_code", type: "text" })
44
+ ], TrackingJob.prototype, "carrierCode", 2);
45
+ __decorateClass([
46
+ Property({ name: "reference_type", type: "text" })
47
+ ], TrackingJob.prototype, "referenceType", 2);
48
+ __decorateClass([
49
+ Property({ name: "reference_value", type: "text" })
50
+ ], TrackingJob.prototype, "referenceValue", 2);
51
+ __decorateClass([
52
+ Property({ name: "origin_unlocode", type: "text", length: 5, nullable: true })
53
+ ], TrackingJob.prototype, "originUnlocode", 2);
54
+ __decorateClass([
55
+ Property({ name: "destination_unlocode", type: "text", length: 5, nullable: true })
56
+ ], TrackingJob.prototype, "destinationUnlocode", 2);
57
+ __decorateClass([
58
+ Property({ type: "text", default: "active" })
59
+ ], TrackingJob.prototype, "status", 2);
60
+ __decorateClass([
61
+ Property({ type: "jsonb", nullable: true })
62
+ ], TrackingJob.prototype, "schedule", 2);
63
+ __decorateClass([
64
+ Property({ name: "next_poll_at", type: Date, nullable: true })
65
+ ], TrackingJob.prototype, "nextPollAt", 2);
66
+ __decorateClass([
67
+ Property({ name: "last_poll_at", type: Date, nullable: true })
68
+ ], TrackingJob.prototype, "lastPollAt", 2);
69
+ __decorateClass([
70
+ Property({ name: "retry_count", type: "integer", default: 0 })
71
+ ], TrackingJob.prototype, "retryCount", 2);
72
+ __decorateClass([
73
+ Property({ name: "error_history", type: "jsonb", nullable: true })
74
+ ], TrackingJob.prototype, "errorHistory", 2);
75
+ __decorateClass([
76
+ Property({ name: "created_at", type: Date, defaultRaw: "now()" })
77
+ ], TrackingJob.prototype, "createdAt", 2);
78
+ __decorateClass([
79
+ Property({ name: "updated_at", type: Date, defaultRaw: "now()", onUpdate: () => /* @__PURE__ */ new Date() })
80
+ ], TrackingJob.prototype, "updatedAt", 2);
81
+ __decorateClass([
82
+ Property({ name: "deleted_at", type: Date, nullable: true })
83
+ ], TrackingJob.prototype, "deletedAt", 2);
84
+ __decorateClass([
85
+ OneToMany(() => Shipment, (s) => s.trackingJob)
86
+ ], TrackingJob.prototype, "shipments", 2);
87
+ __decorateClass([
88
+ OneToMany(() => TrackingEvent, (e) => e.trackingJob)
89
+ ], TrackingJob.prototype, "events", 2);
90
+ TrackingJob = __decorateClass([
91
+ Entity({ tableName: "shipment_tracking_jobs" }),
92
+ Index({ name: "st_jobs_org_tenant_idx", properties: ["organizationId", "tenantId"] }),
93
+ Index({ name: "st_jobs_status_idx", properties: ["status"] }),
94
+ Index({ name: "st_jobs_next_poll_idx", properties: ["nextPollAt"] })
95
+ ], TrackingJob);
96
+ OptionalProps;
97
+ let Shipment = class {
98
+ constructor() {
99
+ this.status = "PENDING";
100
+ this.mode = "ocean";
101
+ this.eventCount = 0;
102
+ this.isActive = true;
103
+ }
104
+ };
105
+ __decorateClass([
106
+ PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
107
+ ], Shipment.prototype, "id", 2);
108
+ __decorateClass([
109
+ Property({ name: "organization_id", type: "uuid" })
110
+ ], Shipment.prototype, "organizationId", 2);
111
+ __decorateClass([
112
+ Property({ name: "tenant_id", type: "uuid" })
113
+ ], Shipment.prototype, "tenantId", 2);
114
+ __decorateClass([
115
+ Property({ type: "text", default: "PENDING" })
116
+ ], Shipment.prototype, "status", 2);
117
+ __decorateClass([
118
+ Property({ type: "text", default: "ocean" })
119
+ ], Shipment.prototype, "mode", 2);
120
+ __decorateClass([
121
+ Property({ name: "carrier_code", type: "text", nullable: true })
122
+ ], Shipment.prototype, "carrierCode", 2);
123
+ __decorateClass([
124
+ Property({ name: "container_number", type: "text", nullable: true })
125
+ ], Shipment.prototype, "containerNumber", 2);
126
+ __decorateClass([
127
+ Property({ name: "awb_number", type: "text", nullable: true })
128
+ ], Shipment.prototype, "awbNumber", 2);
129
+ __decorateClass([
130
+ Property({ name: "flight_number", type: "text", nullable: true })
131
+ ], Shipment.prototype, "flightNumber", 2);
132
+ __decorateClass([
133
+ Property({ name: "airline_code", type: "text", nullable: true })
134
+ ], Shipment.prototype, "airlineCode", 2);
135
+ __decorateClass([
136
+ Property({ name: "airline_name", type: "text", nullable: true })
137
+ ], Shipment.prototype, "airlineName", 2);
138
+ __decorateClass([
139
+ Property({ name: "iso_equipment_code", type: "text", nullable: true })
140
+ ], Shipment.prototype, "isoEquipmentCode", 2);
141
+ __decorateClass([
142
+ Property({ name: "booking_number", type: "text", nullable: true })
143
+ ], Shipment.prototype, "bookingNumber", 2);
144
+ __decorateClass([
145
+ Property({ name: "bol_number", type: "text", nullable: true })
146
+ ], Shipment.prototype, "bolNumber", 2);
147
+ __decorateClass([
148
+ Property({ name: "etd_timestamps", type: "jsonb", nullable: true })
149
+ ], Shipment.prototype, "etdTimestamps", 2);
150
+ __decorateClass([
151
+ Property({ name: "eta_timestamps", type: "jsonb", nullable: true })
152
+ ], Shipment.prototype, "etaTimestamps", 2);
153
+ __decorateClass([
154
+ Property({ name: "atd_timestamps", type: "jsonb", nullable: true })
155
+ ], Shipment.prototype, "atdTimestamps", 2);
156
+ __decorateClass([
157
+ Property({ name: "ata_timestamps", type: "jsonb", nullable: true })
158
+ ], Shipment.prototype, "ataTimestamps", 2);
159
+ __decorateClass([
160
+ Property({ name: "origin_location", type: "jsonb", nullable: true })
161
+ ], Shipment.prototype, "originLocation", 2);
162
+ __decorateClass([
163
+ Property({ name: "destination_location", type: "jsonb", nullable: true })
164
+ ], Shipment.prototype, "destinationLocation", 2);
165
+ __decorateClass([
166
+ Property({ name: "vessel_name", type: "text", nullable: true })
167
+ ], Shipment.prototype, "vesselName", 2);
168
+ __decorateClass([
169
+ Property({ name: "vessel_imo", type: "text", nullable: true })
170
+ ], Shipment.prototype, "vesselImo", 2);
171
+ __decorateClass([
172
+ Property({ name: "voyage_number", type: "text", nullable: true })
173
+ ], Shipment.prototype, "voyageNumber", 2);
174
+ __decorateClass([
175
+ Property({ name: "event_count", type: "integer", default: 0 })
176
+ ], Shipment.prototype, "eventCount", 2);
177
+ __decorateClass([
178
+ Property({ name: "last_event_at", type: Date, nullable: true })
179
+ ], Shipment.prototype, "lastEventAt", 2);
180
+ __decorateClass([
181
+ Property({ type: "jsonb", nullable: true })
182
+ ], Shipment.prototype, "extra", 2);
183
+ __decorateClass([
184
+ Property({ name: "route_stops", type: "jsonb", nullable: true })
185
+ ], Shipment.prototype, "routeStops", 2);
186
+ __decorateClass([
187
+ Property({ name: "cargo_events", type: "jsonb", nullable: true })
188
+ ], Shipment.prototype, "cargoEvents", 2);
189
+ __decorateClass([
190
+ Property({ type: "jsonb", nullable: true })
191
+ ], Shipment.prototype, "seals", 2);
192
+ __decorateClass([
193
+ Property({ name: "is_active", type: "boolean", default: true })
194
+ ], Shipment.prototype, "isActive", 2);
195
+ __decorateClass([
196
+ Property({ name: "created_at", type: Date, defaultRaw: "now()" })
197
+ ], Shipment.prototype, "createdAt", 2);
198
+ __decorateClass([
199
+ Property({ name: "updated_at", type: Date, defaultRaw: "now()", onUpdate: () => /* @__PURE__ */ new Date() })
200
+ ], Shipment.prototype, "updatedAt", 2);
201
+ __decorateClass([
202
+ Property({ name: "deleted_at", type: Date, nullable: true })
203
+ ], Shipment.prototype, "deletedAt", 2);
204
+ __decorateClass([
205
+ Property({ name: "created_by_user_id", type: "uuid", nullable: true })
206
+ ], Shipment.prototype, "createdByUserId", 2);
207
+ __decorateClass([
208
+ ManyToOne(() => TrackingJob, { fieldName: "tracking_job_id", nullable: true })
209
+ ], Shipment.prototype, "trackingJob", 2);
210
+ Shipment = __decorateClass([
211
+ Entity({ tableName: "shipment_tracking_shipments" }),
212
+ Index({ name: "st_shipments_org_tenant_idx", properties: ["organizationId", "tenantId"] }),
213
+ Index({ name: "st_shipments_status_idx", properties: ["status"] }),
214
+ Index({ name: "st_shipments_carrier_idx", properties: ["carrierCode"] }),
215
+ Index({ name: "st_shipments_tracking_job_idx", properties: ["trackingJob"] })
216
+ ], Shipment);
217
+ OptionalProps;
218
+ let TrackingEvent = class {
219
+ constructor() {
220
+ this.source = "dcsa";
221
+ }
222
+ };
223
+ __decorateClass([
224
+ PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
225
+ ], TrackingEvent.prototype, "id", 2);
226
+ __decorateClass([
227
+ Property({ name: "organization_id", type: "uuid" })
228
+ ], TrackingEvent.prototype, "organizationId", 2);
229
+ __decorateClass([
230
+ Property({ name: "tenant_id", type: "uuid" })
231
+ ], TrackingEvent.prototype, "tenantId", 2);
232
+ __decorateClass([
233
+ ManyToOne(() => TrackingJob, { fieldName: "tracking_job_id" })
234
+ ], TrackingEvent.prototype, "trackingJob", 2);
235
+ __decorateClass([
236
+ Property({ type: "text", default: "dcsa" })
237
+ ], TrackingEvent.prototype, "source", 2);
238
+ __decorateClass([
239
+ Property({ name: "source_event_id", type: "text", nullable: true })
240
+ ], TrackingEvent.prototype, "sourceEventId", 2);
241
+ __decorateClass([
242
+ Property({ name: "event_type", type: "text" })
243
+ ], TrackingEvent.prototype, "eventType", 2);
244
+ __decorateClass([
245
+ Property({ name: "event_code", type: "text" })
246
+ ], TrackingEvent.prototype, "eventCode", 2);
247
+ __decorateClass([
248
+ Property({ name: "event_classifier_code", type: "text", nullable: true })
249
+ ], TrackingEvent.prototype, "eventClassifierCode", 2);
250
+ __decorateClass([
251
+ Property({ name: "event_date_time", type: Date })
252
+ ], TrackingEvent.prototype, "eventDateTime", 2);
253
+ __decorateClass([
254
+ Property({ name: "event_date_time_offset", type: "text", nullable: true })
255
+ ], TrackingEvent.prototype, "eventDateTimeOffset", 2);
256
+ __decorateClass([
257
+ Property({ type: "text", nullable: true })
258
+ ], TrackingEvent.prototype, "description", 2);
259
+ __decorateClass([
260
+ Property({ name: "raw_data", type: "jsonb", nullable: true })
261
+ ], TrackingEvent.prototype, "rawData", 2);
262
+ __decorateClass([
263
+ Property({ name: "equipment_reference", type: "text", nullable: true })
264
+ ], TrackingEvent.prototype, "equipmentReference", 2);
265
+ __decorateClass([
266
+ Property({ name: "iso_equipment_code", type: "text", nullable: true })
267
+ ], TrackingEvent.prototype, "isoEquipmentCode", 2);
268
+ __decorateClass([
269
+ Property({ name: "empty_indicator_code", type: "text", nullable: true })
270
+ ], TrackingEvent.prototype, "emptyIndicatorCode", 2);
271
+ __decorateClass([
272
+ Property({ name: "is_transshipment_move", type: "boolean", nullable: true })
273
+ ], TrackingEvent.prototype, "isTransshipmentMove", 2);
274
+ __decorateClass([
275
+ Property({ name: "location_name", type: "text", nullable: true })
276
+ ], TrackingEvent.prototype, "locationName", 2);
277
+ __decorateClass([
278
+ Property({ name: "location_unlocode", type: "text", nullable: true })
279
+ ], TrackingEvent.prototype, "locationUnlocode", 2);
280
+ __decorateClass([
281
+ Property({ name: "location_country", type: "text", nullable: true })
282
+ ], TrackingEvent.prototype, "locationCountry", 2);
283
+ __decorateClass([
284
+ Property({ name: "region_name_pl", type: "text", nullable: true })
285
+ ], TrackingEvent.prototype, "regionNamePl", 2);
286
+ __decorateClass([
287
+ Property({ name: "region_name_en", type: "text", nullable: true })
288
+ ], TrackingEvent.prototype, "regionNameEn", 2);
289
+ __decorateClass([
290
+ Property({ name: "facility_code", type: "text", nullable: true })
291
+ ], TrackingEvent.prototype, "facilityCode", 2);
292
+ __decorateClass([
293
+ Property({ name: "facility_code_list_provider", type: "text", nullable: true })
294
+ ], TrackingEvent.prototype, "facilityCodeListProvider", 2);
295
+ __decorateClass([
296
+ Property({ name: "facility_type_code", type: "text", nullable: true })
297
+ ], TrackingEvent.prototype, "facilityTypeCode", 2);
298
+ __decorateClass([
299
+ Property({ name: "facility_address", type: "text", nullable: true })
300
+ ], TrackingEvent.prototype, "facilityAddress", 2);
301
+ __decorateClass([
302
+ Property({ type: "float", nullable: true })
303
+ ], TrackingEvent.prototype, "latitude", 2);
304
+ __decorateClass([
305
+ Property({ type: "float", nullable: true })
306
+ ], TrackingEvent.prototype, "longitude", 2);
307
+ __decorateClass([
308
+ Property({ name: "transport_call_reference", type: "text", nullable: true })
309
+ ], TrackingEvent.prototype, "transportCallReference", 2);
310
+ __decorateClass([
311
+ Property({ name: "mode_of_transport", type: "text", nullable: true })
312
+ ], TrackingEvent.prototype, "modeOfTransport", 2);
313
+ __decorateClass([
314
+ Property({ name: "vessel_name", type: "text", nullable: true })
315
+ ], TrackingEvent.prototype, "vesselName", 2);
316
+ __decorateClass([
317
+ Property({ name: "vessel_imo", type: "text", nullable: true })
318
+ ], TrackingEvent.prototype, "vesselImo", 2);
319
+ __decorateClass([
320
+ Property({ name: "voyage_number", type: "text", nullable: true })
321
+ ], TrackingEvent.prototype, "voyageNumber", 2);
322
+ __decorateClass([
323
+ Property({ name: "carrier_service_code", type: "text", nullable: true })
324
+ ], TrackingEvent.prototype, "carrierServiceCode", 2);
325
+ __decorateClass([
326
+ Property({ name: "carrier_export_voyage_number", type: "text", nullable: true })
327
+ ], TrackingEvent.prototype, "carrierExportVoyageNumber", 2);
328
+ __decorateClass([
329
+ Property({ name: "carrier_import_voyage_number", type: "text", nullable: true })
330
+ ], TrackingEvent.prototype, "carrierImportVoyageNumber", 2);
331
+ __decorateClass([
332
+ Property({ name: "universal_service_reference", type: "text", nullable: true })
333
+ ], TrackingEvent.prototype, "universalServiceReference", 2);
334
+ __decorateClass([
335
+ Property({ name: "universal_export_voyage_reference", type: "text", nullable: true })
336
+ ], TrackingEvent.prototype, "universalExportVoyageReference", 2);
337
+ __decorateClass([
338
+ Property({ name: "universal_import_voyage_reference", type: "text", nullable: true })
339
+ ], TrackingEvent.prototype, "universalImportVoyageReference", 2);
340
+ __decorateClass([
341
+ Property({ name: "port_visit_reference", type: "text", nullable: true })
342
+ ], TrackingEvent.prototype, "portVisitReference", 2);
343
+ __decorateClass([
344
+ Property({ name: "related_document_references", type: "jsonb", nullable: true })
345
+ ], TrackingEvent.prototype, "relatedDocumentReferences", 2);
346
+ __decorateClass([
347
+ Property({ name: "event_created_date_time", type: Date, nullable: true })
348
+ ], TrackingEvent.prototype, "eventCreatedDateTime", 2);
349
+ __decorateClass([
350
+ Property({ name: "retracted_event_id", type: "text", nullable: true })
351
+ ], TrackingEvent.prototype, "retractedEventId", 2);
352
+ __decorateClass([
353
+ Property({ name: "publisher_name", type: "text", nullable: true })
354
+ ], TrackingEvent.prototype, "publisherName", 2);
355
+ __decorateClass([
356
+ Property({ name: "publisher_role", type: "text", nullable: true })
357
+ ], TrackingEvent.prototype, "publisherRole", 2);
358
+ __decorateClass([
359
+ Property({ name: "delay_reason_code", type: "text", nullable: true })
360
+ ], TrackingEvent.prototype, "delayReasonCode", 2);
361
+ __decorateClass([
362
+ Property({ name: "change_remark", type: "text", nullable: true })
363
+ ], TrackingEvent.prototype, "changeRemark", 2);
364
+ __decorateClass([
365
+ Property({ type: "jsonb", nullable: true })
366
+ ], TrackingEvent.prototype, "seals", 2);
367
+ __decorateClass([
368
+ Property({ name: "created_at", type: Date, defaultRaw: "now()" })
369
+ ], TrackingEvent.prototype, "createdAt", 2);
370
+ TrackingEvent = __decorateClass([
371
+ Entity({ tableName: "shipment_tracking_events" }),
372
+ Index({ name: "st_events_org_tenant_idx", properties: ["organizationId", "tenantId"] }),
373
+ Index({ name: "st_events_tracking_job_idx", properties: ["trackingJob"] }),
374
+ Index({ name: "st_events_equipment_ref_idx", properties: ["equipmentReference"] }),
375
+ Index({ name: "st_events_event_date_time_idx", properties: ["eventDateTime"] }),
376
+ Unique({ name: "st_events_source_event_uniq", properties: ["trackingJob", "source", "sourceEventId"] })
377
+ ], TrackingEvent);
378
+ OptionalProps;
379
+ let CarrierConfig = class {
380
+ constructor() {
381
+ this.rateLimitRequests = 60;
382
+ this.rateLimitWindowSeconds = 60;
383
+ this.isActive = true;
384
+ }
385
+ };
386
+ __decorateClass([
387
+ PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
388
+ ], CarrierConfig.prototype, "id", 2);
389
+ __decorateClass([
390
+ Property({ name: "organization_id", type: "uuid" })
391
+ ], CarrierConfig.prototype, "organizationId", 2);
392
+ __decorateClass([
393
+ Property({ name: "tenant_id", type: "uuid" })
394
+ ], CarrierConfig.prototype, "tenantId", 2);
395
+ __decorateClass([
396
+ Property({ name: "carrier_code", type: "text" })
397
+ ], CarrierConfig.prototype, "carrierCode", 2);
398
+ __decorateClass([
399
+ Property({ name: "api_endpoint", type: "text", nullable: true })
400
+ ], CarrierConfig.prototype, "apiEndpoint", 2);
401
+ __decorateClass([
402
+ Property({ name: "auth_config", type: "jsonb", nullable: true })
403
+ ], CarrierConfig.prototype, "authConfig", 2);
404
+ __decorateClass([
405
+ Property({ name: "rate_limit_requests", type: "integer", default: 60 })
406
+ ], CarrierConfig.prototype, "rateLimitRequests", 2);
407
+ __decorateClass([
408
+ Property({ name: "rate_limit_window_seconds", type: "integer", default: 60 })
409
+ ], CarrierConfig.prototype, "rateLimitWindowSeconds", 2);
410
+ __decorateClass([
411
+ Property({ name: "is_active", type: "boolean", default: true })
412
+ ], CarrierConfig.prototype, "isActive", 2);
413
+ __decorateClass([
414
+ Property({ name: "created_at", type: Date, defaultRaw: "now()" })
415
+ ], CarrierConfig.prototype, "createdAt", 2);
416
+ __decorateClass([
417
+ Property({ name: "updated_at", type: Date, defaultRaw: "now()", onUpdate: () => /* @__PURE__ */ new Date() })
418
+ ], CarrierConfig.prototype, "updatedAt", 2);
419
+ __decorateClass([
420
+ Property({ name: "deleted_at", type: Date, nullable: true })
421
+ ], CarrierConfig.prototype, "deletedAt", 2);
422
+ CarrierConfig = __decorateClass([
423
+ Entity({ tableName: "shipment_tracking_carrier_configs" }),
424
+ Index({ name: "st_carrier_configs_org_tenant_idx", properties: ["organizationId", "tenantId"] }),
425
+ Unique({ name: "st_carrier_configs_code_uniq", properties: ["organizationId", "tenantId", "carrierCode"] })
426
+ ], CarrierConfig);
427
+ OptionalProps;
428
+ let BicConfig = class {
429
+ constructor() {
430
+ this.isEnabled = false;
431
+ this.baseUrl = "https://api.bic-code.org";
432
+ }
433
+ };
434
+ __decorateClass([
435
+ PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
436
+ ], BicConfig.prototype, "id", 2);
437
+ __decorateClass([
438
+ Property({ name: "organization_id", type: "uuid" })
439
+ ], BicConfig.prototype, "organizationId", 2);
440
+ __decorateClass([
441
+ Property({ name: "tenant_id", type: "uuid" })
442
+ ], BicConfig.prototype, "tenantId", 2);
443
+ __decorateClass([
444
+ Property({ name: "is_enabled", type: "boolean", default: false })
445
+ ], BicConfig.prototype, "isEnabled", 2);
446
+ __decorateClass([
447
+ Property({ type: "text" })
448
+ ], BicConfig.prototype, "username", 2);
449
+ __decorateClass([
450
+ Property({ type: "text" })
451
+ ], BicConfig.prototype, "password", 2);
452
+ __decorateClass([
453
+ Property({ name: "base_url", type: "text", default: "https://api.bic-code.org" })
454
+ ], BicConfig.prototype, "baseUrl", 2);
455
+ __decorateClass([
456
+ Property({ name: "created_at", type: Date, defaultRaw: "now()" })
457
+ ], BicConfig.prototype, "createdAt", 2);
458
+ __decorateClass([
459
+ Property({ name: "updated_at", type: Date, defaultRaw: "now()", onUpdate: () => /* @__PURE__ */ new Date() })
460
+ ], BicConfig.prototype, "updatedAt", 2);
461
+ BicConfig = __decorateClass([
462
+ Entity({ tableName: "shipment_tracking_bic_configs" }),
463
+ Index({ name: "st_bic_configs_org_tenant_idx", properties: ["organizationId", "tenantId"] }),
464
+ Unique({ name: "st_bic_configs_scope_unique", properties: ["organizationId", "tenantId"] })
465
+ ], BicConfig);
466
+ OptionalProps;
467
+ let ShipsGoConfig = class {
468
+ constructor() {
469
+ this.isEnabled = false;
470
+ this.baseUrl = "https://api.shipsgo.com/v2";
471
+ this.oceanEnabled = true;
472
+ this.airEnabled = true;
473
+ this.rateLimitRequests = 60;
474
+ this.rateLimitWindowSeconds = 60;
475
+ this.isActive = true;
476
+ }
477
+ };
478
+ __decorateClass([
479
+ PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
480
+ ], ShipsGoConfig.prototype, "id", 2);
481
+ __decorateClass([
482
+ Property({ name: "organization_id", type: "uuid" })
483
+ ], ShipsGoConfig.prototype, "organizationId", 2);
484
+ __decorateClass([
485
+ Property({ name: "tenant_id", type: "uuid" })
486
+ ], ShipsGoConfig.prototype, "tenantId", 2);
487
+ __decorateClass([
488
+ Property({ name: "is_enabled", type: "boolean", default: false })
489
+ ], ShipsGoConfig.prototype, "isEnabled", 2);
490
+ __decorateClass([
491
+ Property({ name: "api_token", type: "text" })
492
+ ], ShipsGoConfig.prototype, "apiToken", 2);
493
+ __decorateClass([
494
+ Property({ name: "base_url", type: "text", default: "https://api.shipsgo.com/v2" })
495
+ ], ShipsGoConfig.prototype, "baseUrl", 2);
496
+ __decorateClass([
497
+ Property({ name: "ocean_enabled", type: "boolean", default: true })
498
+ ], ShipsGoConfig.prototype, "oceanEnabled", 2);
499
+ __decorateClass([
500
+ Property({ name: "air_enabled", type: "boolean", default: true })
501
+ ], ShipsGoConfig.prototype, "airEnabled", 2);
502
+ __decorateClass([
503
+ Property({ name: "rate_limit_requests", type: "integer", default: 60 })
504
+ ], ShipsGoConfig.prototype, "rateLimitRequests", 2);
505
+ __decorateClass([
506
+ Property({ name: "rate_limit_window_seconds", type: "integer", default: 60 })
507
+ ], ShipsGoConfig.prototype, "rateLimitWindowSeconds", 2);
508
+ __decorateClass([
509
+ Property({ name: "is_active", type: "boolean", default: true })
510
+ ], ShipsGoConfig.prototype, "isActive", 2);
511
+ __decorateClass([
512
+ Property({ name: "created_at", type: Date, defaultRaw: "now()" })
513
+ ], ShipsGoConfig.prototype, "createdAt", 2);
514
+ __decorateClass([
515
+ Property({ name: "updated_at", type: Date, defaultRaw: "now()", onUpdate: () => /* @__PURE__ */ new Date() })
516
+ ], ShipsGoConfig.prototype, "updatedAt", 2);
517
+ __decorateClass([
518
+ Property({ name: "deleted_at", type: Date, nullable: true })
519
+ ], ShipsGoConfig.prototype, "deletedAt", 2);
520
+ ShipsGoConfig = __decorateClass([
521
+ Entity({ tableName: "shipment_tracking_shipsgo_configs" }),
522
+ Index({ name: "st_shipsgo_configs_org_tenant_idx", properties: ["organizationId", "tenantId"] }),
523
+ Unique({ name: "st_shipsgo_configs_scope_unique", properties: ["organizationId", "tenantId"] })
524
+ ], ShipsGoConfig);
525
+ OptionalProps;
526
+ let Webhook = class {
527
+ constructor() {
528
+ this.isActive = true;
529
+ this.deliveries = new Collection(this);
530
+ }
531
+ };
532
+ __decorateClass([
533
+ PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
534
+ ], Webhook.prototype, "id", 2);
535
+ __decorateClass([
536
+ Property({ name: "organization_id", type: "uuid" })
537
+ ], Webhook.prototype, "organizationId", 2);
538
+ __decorateClass([
539
+ Property({ name: "tenant_id", type: "uuid" })
540
+ ], Webhook.prototype, "tenantId", 2);
541
+ __decorateClass([
542
+ Property({ type: "text" })
543
+ ], Webhook.prototype, "url", 2);
544
+ __decorateClass([
545
+ Property({ name: "events_subscribed", type: "jsonb" })
546
+ ], Webhook.prototype, "eventsSubscribed", 2);
547
+ __decorateClass([
548
+ Property({ name: "hmac_secret", type: "text", nullable: true })
549
+ ], Webhook.prototype, "hmacSecret", 2);
550
+ __decorateClass([
551
+ Property({ name: "is_active", type: "boolean", default: true })
552
+ ], Webhook.prototype, "isActive", 2);
553
+ __decorateClass([
554
+ Property({ name: "created_at", type: Date, defaultRaw: "now()" })
555
+ ], Webhook.prototype, "createdAt", 2);
556
+ __decorateClass([
557
+ Property({ name: "updated_at", type: Date, defaultRaw: "now()", onUpdate: () => /* @__PURE__ */ new Date() })
558
+ ], Webhook.prototype, "updatedAt", 2);
559
+ __decorateClass([
560
+ Property({ name: "deleted_at", type: Date, nullable: true })
561
+ ], Webhook.prototype, "deletedAt", 2);
562
+ __decorateClass([
563
+ OneToMany(() => WebhookDelivery, (delivery) => delivery.webhook)
564
+ ], Webhook.prototype, "deliveries", 2);
565
+ Webhook = __decorateClass([
566
+ Entity({ tableName: "shipment_tracking_webhooks" }),
567
+ Index({ name: "st_webhooks_org_tenant_idx", properties: ["organizationId", "tenantId"] })
568
+ ], Webhook);
569
+ OptionalProps;
570
+ let LocationOverride = class {
571
+ constructor() {
572
+ this.isActive = true;
573
+ }
574
+ };
575
+ __decorateClass([
576
+ PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
577
+ ], LocationOverride.prototype, "id", 2);
578
+ __decorateClass([
579
+ Property({ name: "organization_id", type: "uuid" })
580
+ ], LocationOverride.prototype, "organizationId", 2);
581
+ __decorateClass([
582
+ Property({ name: "tenant_id", type: "uuid" })
583
+ ], LocationOverride.prototype, "tenantId", 2);
584
+ __decorateClass([
585
+ Property({ name: "carrier_code", type: "text", nullable: true })
586
+ ], LocationOverride.prototype, "carrierCode", 2);
587
+ __decorateClass([
588
+ Property({ name: "unlocode", type: "text", length: 5 })
589
+ ], LocationOverride.prototype, "unlocode", 2);
590
+ __decorateClass([
591
+ Property({ name: "facility_code", type: "text" })
592
+ ], LocationOverride.prototype, "facilityCode", 2);
593
+ __decorateClass([
594
+ Property({ name: "facility_code_list_provider", type: "text" })
595
+ ], LocationOverride.prototype, "facilityCodeListProvider", 2);
596
+ __decorateClass([
597
+ Property({ name: "override_data", type: "jsonb" })
598
+ ], LocationOverride.prototype, "overrideData", 2);
599
+ __decorateClass([
600
+ Property({ type: "text", nullable: true })
601
+ ], LocationOverride.prototype, "description", 2);
602
+ __decorateClass([
603
+ Property({ name: "is_active", type: "boolean", default: true })
604
+ ], LocationOverride.prototype, "isActive", 2);
605
+ __decorateClass([
606
+ Property({ name: "created_at", type: Date, defaultRaw: "now()" })
607
+ ], LocationOverride.prototype, "createdAt", 2);
608
+ __decorateClass([
609
+ Property({ name: "updated_at", type: Date, defaultRaw: "now()", onUpdate: () => /* @__PURE__ */ new Date() })
610
+ ], LocationOverride.prototype, "updatedAt", 2);
611
+ __decorateClass([
612
+ Property({ name: "deleted_at", type: Date, nullable: true })
613
+ ], LocationOverride.prototype, "deletedAt", 2);
614
+ __decorateClass([
615
+ Property({ name: "created_by_user_id", type: "uuid", nullable: true })
616
+ ], LocationOverride.prototype, "createdByUserId", 2);
617
+ __decorateClass([
618
+ Property({ name: "updated_by_user_id", type: "uuid", nullable: true })
619
+ ], LocationOverride.prototype, "updatedByUserId", 2);
620
+ LocationOverride = __decorateClass([
621
+ Entity({ tableName: "shipment_tracking_location_overrides" }),
622
+ Unique({
623
+ name: "st_location_overrides_match_uniq",
624
+ properties: ["organizationId", "tenantId", "carrierCode", "unlocode", "facilityCode", "facilityCodeListProvider"]
625
+ }),
626
+ Index({ name: "st_location_overrides_org_tenant_idx", properties: ["organizationId", "tenantId"] }),
627
+ Index({ name: "st_location_overrides_lookup_idx", properties: ["unlocode", "facilityCode", "facilityCodeListProvider"] })
628
+ ], LocationOverride);
629
+ OptionalProps;
630
+ let WebhookDelivery = class {
631
+ constructor() {
632
+ this.status = "pending";
633
+ this.retryCount = 0;
634
+ }
635
+ };
636
+ __decorateClass([
637
+ PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
638
+ ], WebhookDelivery.prototype, "id", 2);
639
+ __decorateClass([
640
+ ManyToOne(() => Webhook, { fieldName: "webhook_id" })
641
+ ], WebhookDelivery.prototype, "webhook", 2);
642
+ __decorateClass([
643
+ Property({ name: "event_type", type: "text" })
644
+ ], WebhookDelivery.prototype, "eventType", 2);
645
+ __decorateClass([
646
+ Property({ type: "text", default: "pending" })
647
+ ], WebhookDelivery.prototype, "status", 2);
648
+ __decorateClass([
649
+ Property({ name: "retry_count", type: "integer", default: 0 })
650
+ ], WebhookDelivery.prototype, "retryCount", 2);
651
+ __decorateClass([
652
+ Property({ name: "next_retry_at", type: Date, nullable: true })
653
+ ], WebhookDelivery.prototype, "nextRetryAt", 2);
654
+ __decorateClass([
655
+ Property({ type: "jsonb" })
656
+ ], WebhookDelivery.prototype, "payload", 2);
657
+ __decorateClass([
658
+ Property({ name: "response_status", type: "integer", nullable: true })
659
+ ], WebhookDelivery.prototype, "responseStatus", 2);
660
+ __decorateClass([
661
+ Property({ name: "response_body", type: "text", nullable: true })
662
+ ], WebhookDelivery.prototype, "responseBody", 2);
663
+ __decorateClass([
664
+ Property({ name: "error_message", type: "text", nullable: true })
665
+ ], WebhookDelivery.prototype, "errorMessage", 2);
666
+ __decorateClass([
667
+ Property({ name: "created_at", type: Date, defaultRaw: "now()" })
668
+ ], WebhookDelivery.prototype, "createdAt", 2);
669
+ WebhookDelivery = __decorateClass([
670
+ Entity({ tableName: "shipment_tracking_webhook_deliveries" }),
671
+ Index({ name: "st_webhook_deliveries_webhook_idx", properties: ["webhook"] }),
672
+ Index({ name: "st_webhook_deliveries_status_idx", properties: ["status"] }),
673
+ Index({ name: "st_webhook_deliveries_next_retry_idx", properties: ["nextRetryAt"] })
674
+ ], WebhookDelivery);
675
+ export {
676
+ BicConfig,
677
+ CarrierConfig,
678
+ LocationOverride,
679
+ Shipment,
680
+ ShipsGoConfig,
681
+ TrackingEvent,
682
+ TrackingJob,
683
+ Webhook,
684
+ WebhookDelivery
685
+ };
686
+ //# sourceMappingURL=entities.js.map