@openlup/platform 0.21.0 → 0.22.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 (263) hide show
  1. package/CHANGELOG.md +210 -47
  2. package/README.md +27 -4
  3. package/dist/composition/composeBundle.d.ts +7 -0
  4. package/dist/composition/composeBundle.js +2 -0
  5. package/dist/composition/fulfillmentContribution.d.ts +21 -0
  6. package/dist/composition/fulfillmentContribution.js +19 -0
  7. package/dist/composition/index.d.ts +1 -0
  8. package/dist/composition/index.js +1 -0
  9. package/dist/fulfillment/adapterConformance.d.ts +3 -0
  10. package/dist/fulfillment/adapterConformance.js +223 -0
  11. package/dist/fulfillment/bindings.d.ts +3 -0
  12. package/dist/fulfillment/bindings.js +29 -0
  13. package/dist/fulfillment/commerceFulfillmentHandlers.d.ts +29 -0
  14. package/dist/fulfillment/commerceFulfillmentHandlers.js +184 -0
  15. package/dist/fulfillment/commerceFulfillmentReadModel.d.ts +86 -0
  16. package/dist/fulfillment/commerceFulfillmentReadModel.js +131 -0
  17. package/dist/fulfillment/contracts/alignment.d.ts +25 -0
  18. package/dist/fulfillment/contracts/alignment.js +1 -0
  19. package/dist/fulfillment/contracts/bindings.d.ts +51 -0
  20. package/dist/fulfillment/contracts/bindings.js +1 -0
  21. package/dist/fulfillment/contracts/capabilities.d.ts +29 -0
  22. package/dist/fulfillment/contracts/capabilities.js +1 -0
  23. package/dist/fulfillment/contracts/conformance.d.ts +93 -0
  24. package/dist/fulfillment/contracts/conformance.js +1 -0
  25. package/dist/fulfillment/contracts/customerAlignment.d.ts +6 -0
  26. package/dist/fulfillment/contracts/customerAlignment.js +1 -0
  27. package/dist/fulfillment/contracts/dispatch.d.ts +105 -0
  28. package/dist/fulfillment/contracts/dispatch.js +1 -0
  29. package/dist/fulfillment/contracts/index.d.ts +18 -0
  30. package/dist/fulfillment/contracts/index.js +1 -0
  31. package/dist/fulfillment/contracts/label.d.ts +35 -0
  32. package/dist/fulfillment/contracts/label.js +1 -0
  33. package/dist/fulfillment/contracts/nativeUnsupported.d.ts +6 -0
  34. package/dist/fulfillment/contracts/nativeUnsupported.js +1 -0
  35. package/dist/fulfillment/contracts/observation.d.ts +52 -0
  36. package/dist/fulfillment/contracts/observation.js +1 -0
  37. package/dist/fulfillment/contracts/operator.d.ts +64 -0
  38. package/dist/fulfillment/contracts/operator.js +1 -0
  39. package/dist/fulfillment/contracts/read.d.ts +110 -0
  40. package/dist/fulfillment/contracts/read.js +1 -0
  41. package/dist/fulfillment/contracts/readback.d.ts +38 -0
  42. package/dist/fulfillment/contracts/readback.js +1 -0
  43. package/dist/fulfillment/contracts/replacement.d.ts +34 -0
  44. package/dist/fulfillment/contracts/replacement.js +1 -0
  45. package/dist/fulfillment/contracts/store.d.ts +86 -0
  46. package/dist/fulfillment/contracts/store.js +1 -0
  47. package/dist/fulfillment/contracts/sync.d.ts +170 -0
  48. package/dist/fulfillment/contracts/sync.js +1 -0
  49. package/dist/fulfillment/currentFulfillmentParcel.d.ts +2 -0
  50. package/dist/fulfillment/currentFulfillmentParcel.js +1 -0
  51. package/dist/fulfillment/delayReadModel.d.ts +11 -0
  52. package/dist/fulfillment/delayReadModel.js +45 -0
  53. package/dist/fulfillment/deliveryAlignmentReadModel.d.ts +4 -0
  54. package/dist/fulfillment/deliveryAlignmentReadModel.js +12 -0
  55. package/dist/fulfillment/dispatchProjection.d.ts +7 -0
  56. package/dist/fulfillment/dispatchProjection.js +18 -0
  57. package/dist/fulfillment/fulfillmentObservationEffects.d.ts +66 -0
  58. package/dist/fulfillment/fulfillmentObservationEffects.js +36 -0
  59. package/dist/fulfillment/handlerSchemas.d.ts +647 -0
  60. package/dist/fulfillment/handlerSchemas.js +213 -0
  61. package/dist/fulfillment/handlerSupport.d.ts +33 -0
  62. package/dist/fulfillment/handlerSupport.js +25 -0
  63. package/dist/fulfillment/index.d.ts +37 -0
  64. package/dist/fulfillment/index.js +37 -0
  65. package/dist/fulfillment/labelLifecycle.d.ts +24 -0
  66. package/dist/fulfillment/labelLifecycle.js +9 -0
  67. package/dist/fulfillment/lowStockEvidenceHandler.d.ts +36 -0
  68. package/dist/fulfillment/lowStockEvidenceHandler.js +46 -0
  69. package/dist/fulfillment/migrations.d.ts +27 -0
  70. package/dist/fulfillment/migrations.js +8 -0
  71. package/dist/fulfillment/nativeUnsupported.d.ts +10 -0
  72. package/dist/fulfillment/nativeUnsupported.js +18 -0
  73. package/dist/fulfillment/normalizedFulfillmentFacts.d.ts +2 -0
  74. package/dist/fulfillment/normalizedFulfillmentFacts.js +1 -0
  75. package/dist/fulfillment/observationProjection.d.ts +11 -0
  76. package/dist/fulfillment/observationProjection.js +37 -0
  77. package/dist/fulfillment/omnipack/capabilities.d.ts +3 -0
  78. package/dist/fulfillment/omnipack/capabilities.js +16 -0
  79. package/dist/fulfillment/omnipack/client.d.ts +37 -0
  80. package/dist/fulfillment/omnipack/client.js +162 -0
  81. package/dist/fulfillment/omnipack/index.d.ts +52 -0
  82. package/dist/fulfillment/omnipack/index.js +349 -0
  83. package/dist/fulfillment/omnipack/mappers.d.ts +73 -0
  84. package/dist/fulfillment/omnipack/mappers.js +177 -0
  85. package/dist/fulfillment/omnipack/observation.d.ts +21 -0
  86. package/dist/fulfillment/omnipack/observation.js +57 -0
  87. package/dist/fulfillment/omnipack/omnipackDispatchPayload.d.ts +36 -0
  88. package/dist/fulfillment/omnipack/omnipackDispatchPayload.js +63 -0
  89. package/dist/fulfillment/omnipack/omnipackOutboundOrderPayload.d.ts +83 -0
  90. package/dist/fulfillment/omnipack/omnipackOutboundOrderPayload.js +113 -0
  91. package/dist/fulfillment/omnipack/omnipackProductPackPayload.d.ts +11 -0
  92. package/dist/fulfillment/omnipack/omnipackProductPackPayload.js +38 -0
  93. package/dist/fulfillment/omnipack/omnipackProductPayload.d.ts +18 -0
  94. package/dist/fulfillment/omnipack/omnipackProductPayload.js +51 -0
  95. package/dist/fulfillment/omnipack/omnipackReconciliationPayload.d.ts +1 -0
  96. package/dist/fulfillment/omnipack/omnipackReconciliationPayload.js +3 -0
  97. package/dist/fulfillment/omnipack/omnipackStatusVocabulary.d.ts +4 -0
  98. package/dist/fulfillment/omnipack/omnipackStatusVocabulary.js +87 -0
  99. package/dist/fulfillment/omnipack/omnipackWebhookPayload.d.ts +9 -0
  100. package/dist/fulfillment/omnipack/omnipackWebhookPayload.js +76 -0
  101. package/dist/fulfillment/omnipack/productSyncMappers.d.ts +18 -0
  102. package/dist/fulfillment/omnipack/productSyncMappers.js +43 -0
  103. package/dist/fulfillment/omnipack/providerError.d.ts +25 -0
  104. package/dist/fulfillment/omnipack/providerError.js +47 -0
  105. package/dist/fulfillment/omnipack/trackingReferences.d.ts +16 -0
  106. package/dist/fulfillment/omnipack/trackingReferences.js +52 -0
  107. package/dist/fulfillment/paidFulfillmentRecovery.d.ts +67 -0
  108. package/dist/fulfillment/paidFulfillmentRecovery.js +154 -0
  109. package/dist/fulfillment/paidHandoff.d.ts +27 -0
  110. package/dist/fulfillment/paidHandoff.js +86 -0
  111. package/dist/fulfillment/paidHandoffPorts.d.ts +24 -0
  112. package/dist/fulfillment/paidHandoffPorts.js +3 -0
  113. package/dist/fulfillment/postgresDeliveryAlignment.d.ts +4 -0
  114. package/dist/fulfillment/postgresDeliveryAlignment.js +12 -0
  115. package/dist/fulfillment/postgresDispatchStore.d.ts +16 -0
  116. package/dist/fulfillment/postgresDispatchStore.js +44 -0
  117. package/dist/fulfillment/postgresEvidenceReadPort.d.ts +25 -0
  118. package/dist/fulfillment/postgresEvidenceReadPort.js +45 -0
  119. package/dist/fulfillment/postgresPaidFulfillmentRecovery.d.ts +25 -0
  120. package/dist/fulfillment/postgresPaidFulfillmentRecovery.js +26 -0
  121. package/dist/fulfillment/postgresPaidHandoffStore.d.ts +4 -0
  122. package/dist/fulfillment/postgresPaidHandoffStore.js +10 -0
  123. package/dist/fulfillment/postgresShipmentSpine.d.ts +63 -0
  124. package/dist/fulfillment/postgresShipmentSpine.js +232 -0
  125. package/dist/fulfillment/postgresStockSyncPort.d.ts +8 -0
  126. package/dist/fulfillment/postgresStockSyncPort.js +63 -0
  127. package/dist/fulfillment/productReconciliationEvidenceHandler.d.ts +36 -0
  128. package/dist/fulfillment/productReconciliationEvidenceHandler.js +50 -0
  129. package/dist/fulfillment/providerCapabilities.d.ts +9 -0
  130. package/dist/fulfillment/providerCapabilities.js +17 -0
  131. package/dist/fulfillment/providerCommandLedger.d.ts +143 -0
  132. package/dist/fulfillment/providerCommandLedger.js +14 -0
  133. package/dist/fulfillment/providerDispatchAcceptance.d.ts +26 -0
  134. package/dist/fulfillment/providerDispatchAcceptance.js +23 -0
  135. package/dist/fulfillment/providerDispatchError.d.ts +6 -0
  136. package/dist/fulfillment/providerDispatchError.js +5 -0
  137. package/dist/fulfillment/providerDispatchWorker.d.ts +31 -0
  138. package/dist/fulfillment/providerDispatchWorker.js +172 -0
  139. package/dist/fulfillment/providerProductSyncWorker.d.ts +28 -0
  140. package/dist/fulfillment/providerProductSyncWorker.js +122 -0
  141. package/dist/fulfillment/providerReconciliationError.d.ts +9 -0
  142. package/dist/fulfillment/providerReconciliationError.js +17 -0
  143. package/dist/fulfillment/providerReconciliationTerminalSkip.d.ts +2 -0
  144. package/dist/fulfillment/providerReconciliationTerminalSkip.js +6 -0
  145. package/dist/fulfillment/providerReconciliationTimestamp.d.ts +1 -0
  146. package/dist/fulfillment/providerReconciliationTimestamp.js +27 -0
  147. package/dist/fulfillment/providerReconciliationWorker.d.ts +82 -0
  148. package/dist/fulfillment/providerReconciliationWorker.js +151 -0
  149. package/dist/fulfillment/providerStockAvailability.d.ts +13 -0
  150. package/dist/fulfillment/providerStockAvailability.js +51 -0
  151. package/dist/fulfillment/providerStockSyncWorker.d.ts +37 -0
  152. package/dist/fulfillment/providerStockSyncWorker.js +186 -0
  153. package/dist/fulfillment/providerTrackingReferences.d.ts +15 -0
  154. package/dist/fulfillment/providerTrackingReferences.js +23 -0
  155. package/dist/fulfillment/replacementRefusals.d.ts +5 -0
  156. package/dist/fulfillment/replacementRefusals.js +38 -0
  157. package/dist/fulfillment/replacementShipmentHandler.d.ts +5 -0
  158. package/dist/fulfillment/replacementShipmentHandler.js +46 -0
  159. package/dist/fulfillment/schemaCapabilities.d.ts +13 -0
  160. package/dist/fulfillment/schemaCapabilities.js +7 -0
  161. package/dist/fulfillment/shipmentsOverviewHandler.d.ts +16 -0
  162. package/dist/fulfillment/shipmentsOverviewHandler.js +54 -0
  163. package/dist/fulfillment/statusMap.d.ts +2 -0
  164. package/dist/fulfillment/statusMap.js +1 -0
  165. package/dist/fulfillment/trackingProgress.d.ts +1 -0
  166. package/dist/fulfillment/trackingProgress.js +1 -0
  167. package/dist/fulfillment/verifiedIngress.d.ts +52 -0
  168. package/dist/fulfillment/verifiedIngress.js +66 -0
  169. package/dist/payments/stripe/index.d.ts +25 -0
  170. package/dist/payments/stripe/index.js +25 -0
  171. package/dist/payments/tpay/index.d.ts +30 -0
  172. package/dist/payments/tpay/index.js +30 -0
  173. package/package.json +17 -2
  174. package/release-gates.json +44 -3
  175. package/sql/20260808210000_fulfillment_shipment_rail.sql +810 -0
  176. package/sql/20260819150000_fulfillment_shipment_sequence.sql +98 -0
  177. package/sql/20261022080000_fulfillment_command_ledger.sql +786 -0
  178. package/sql/20261022090000_fulfillment_delivery_alignment.sql +1106 -0
  179. package/src/composition/composeBundle.ts +4 -0
  180. package/src/composition/fulfillmentContribution.ts +28 -0
  181. package/src/composition/index.ts +1 -0
  182. package/src/fulfillment/adapterConformance.ts +195 -0
  183. package/src/fulfillment/bindings.ts +26 -0
  184. package/src/fulfillment/commerceFulfillmentHandlers.ts +263 -0
  185. package/src/fulfillment/commerceFulfillmentReadModel.ts +257 -0
  186. package/src/fulfillment/contracts/alignment.ts +13 -0
  187. package/src/fulfillment/contracts/bindings.ts +30 -0
  188. package/src/fulfillment/contracts/capabilities.ts +15 -0
  189. package/src/fulfillment/contracts/conformance.ts +61 -0
  190. package/src/fulfillment/contracts/customerAlignment.ts +4 -0
  191. package/src/fulfillment/contracts/dispatch.ts +58 -0
  192. package/src/fulfillment/contracts/index.ts +18 -0
  193. package/src/fulfillment/contracts/label.ts +9 -0
  194. package/src/fulfillment/contracts/nativeUnsupported.ts +6 -0
  195. package/src/fulfillment/contracts/observation.ts +18 -0
  196. package/src/fulfillment/contracts/operator.ts +31 -0
  197. package/src/fulfillment/contracts/read.ts +42 -0
  198. package/src/fulfillment/contracts/readback.ts +11 -0
  199. package/src/fulfillment/contracts/replacement.ts +15 -0
  200. package/src/fulfillment/contracts/store.ts +26 -0
  201. package/src/fulfillment/contracts/sync.ts +61 -0
  202. package/src/fulfillment/currentFulfillmentParcel.ts +2 -0
  203. package/src/fulfillment/delayReadModel.ts +60 -0
  204. package/src/fulfillment/deliveryAlignmentReadModel.ts +15 -0
  205. package/src/fulfillment/dispatchProjection.ts +20 -0
  206. package/src/fulfillment/fulfillmentObservationEffects.ts +86 -0
  207. package/src/fulfillment/handlerSchemas.ts +255 -0
  208. package/src/fulfillment/handlerSupport.ts +25 -0
  209. package/src/fulfillment/index.ts +38 -0
  210. package/src/fulfillment/labelLifecycle.ts +11 -0
  211. package/src/fulfillment/lowStockEvidenceHandler.ts +60 -0
  212. package/src/fulfillment/migrations.ts +8 -0
  213. package/src/fulfillment/nativeUnsupported.ts +23 -0
  214. package/src/fulfillment/normalizedFulfillmentFacts.ts +2 -0
  215. package/src/fulfillment/observationProjection.ts +41 -0
  216. package/src/fulfillment/omnipack/capabilities.ts +18 -0
  217. package/src/fulfillment/omnipack/client.ts +258 -0
  218. package/src/fulfillment/omnipack/index.ts +312 -0
  219. package/src/fulfillment/omnipack/mappers.ts +261 -0
  220. package/src/fulfillment/omnipack/observation.ts +61 -0
  221. package/src/fulfillment/omnipack/omnipackDispatchPayload.ts +93 -0
  222. package/src/fulfillment/omnipack/omnipackOutboundOrderPayload.ts +194 -0
  223. package/src/fulfillment/omnipack/omnipackProductPackPayload.ts +47 -0
  224. package/src/fulfillment/omnipack/omnipackProductPayload.ts +67 -0
  225. package/src/fulfillment/omnipack/omnipackReconciliationPayload.ts +7 -0
  226. package/src/fulfillment/omnipack/omnipackStatusVocabulary.ts +103 -0
  227. package/src/fulfillment/omnipack/omnipackWebhookPayload.ts +73 -0
  228. package/src/fulfillment/omnipack/productSyncMappers.ts +74 -0
  229. package/src/fulfillment/omnipack/providerError.ts +64 -0
  230. package/src/fulfillment/omnipack/trackingReferences.ts +77 -0
  231. package/src/fulfillment/paidFulfillmentRecovery.ts +252 -0
  232. package/src/fulfillment/paidHandoff.ts +122 -0
  233. package/src/fulfillment/paidHandoffPorts.ts +21 -0
  234. package/src/fulfillment/postgresDeliveryAlignment.ts +14 -0
  235. package/src/fulfillment/postgresDispatchStore.ts +55 -0
  236. package/src/fulfillment/postgresEvidenceReadPort.ts +59 -0
  237. package/src/fulfillment/postgresPaidFulfillmentRecovery.ts +29 -0
  238. package/src/fulfillment/postgresPaidHandoffStore.ts +11 -0
  239. package/src/fulfillment/postgresShipmentSpine.ts +321 -0
  240. package/src/fulfillment/postgresStockSyncPort.ts +65 -0
  241. package/src/fulfillment/productReconciliationEvidenceHandler.ts +64 -0
  242. package/src/fulfillment/providerCapabilities.ts +18 -0
  243. package/src/fulfillment/providerCommandLedger.ts +53 -0
  244. package/src/fulfillment/providerDispatchAcceptance.ts +31 -0
  245. package/src/fulfillment/providerDispatchError.ts +7 -0
  246. package/src/fulfillment/providerDispatchWorker.ts +131 -0
  247. package/src/fulfillment/providerProductSyncWorker.ts +154 -0
  248. package/src/fulfillment/providerReconciliationError.ts +20 -0
  249. package/src/fulfillment/providerReconciliationTerminalSkip.ts +8 -0
  250. package/src/fulfillment/providerReconciliationTimestamp.ts +34 -0
  251. package/src/fulfillment/providerReconciliationWorker.ts +150 -0
  252. package/src/fulfillment/providerStockAvailability.ts +60 -0
  253. package/src/fulfillment/providerStockSyncWorker.ts +222 -0
  254. package/src/fulfillment/providerTrackingReferences.ts +31 -0
  255. package/src/fulfillment/replacementRefusals.ts +43 -0
  256. package/src/fulfillment/replacementShipmentHandler.ts +47 -0
  257. package/src/fulfillment/schemaCapabilities.ts +7 -0
  258. package/src/fulfillment/shipmentsOverviewHandler.ts +73 -0
  259. package/src/fulfillment/statusMap.ts +2 -0
  260. package/src/fulfillment/trackingProgress.ts +1 -0
  261. package/src/fulfillment/verifiedIngress.ts +80 -0
  262. package/src/payments/stripe/index.ts +30 -0
  263. package/src/payments/tpay/index.ts +36 -0
@@ -0,0 +1,66 @@
1
+ import { applyFulfillmentObservationEffects } from "./fulfillmentObservationEffects.js";
2
+ import { observationStatusPolicy, projectObservation } from "./observationProjection.js";
3
+ import { uniqueTrackingReferences } from "./providerTrackingReferences.js";
4
+ /** Adapter verification owns auth-before-parse; the host owns durable replay. */
5
+ export async function verifyAndNormalizeFulfillmentObservation(input) {
6
+ if (!input.enabled)
7
+ return { kind: "refused", refusal: { reason: "disabled", phase: "verify", retryable: false } };
8
+ const verified = await input.provider.verifyAndNormalize(input.verification);
9
+ if (verified.kind === "refused")
10
+ return verified;
11
+ const observation = projectObservation(verified.observation);
12
+ const inbound = await input.localPersistence.recordObservation(observation);
13
+ const ref = await input.lifecycle.findDispatchRef(observation);
14
+ if (!ref) {
15
+ await input.localPersistence.markProcessed(observation.eventKey, { status: "ignored", refusal: { reason: "local_missing", phase: "apply", retryable: false } });
16
+ return { kind: "ignored", observation, replayed: inbound.replayed, trackingRefs: 0, trackingReadBacks: 0 };
17
+ }
18
+ const externalRef = observation.correlation.externalRef?.trim() || ref.externalRef?.trim();
19
+ if (!externalRef)
20
+ throw new TypeError("fulfillment_dispatch_acceptance_external_ref_missing");
21
+ await input.lifecycle.acknowledgeDispatchAcceptance(ref, observation);
22
+ const statusEvidence = await input.lifecycle.recordStatusEvidence(ref, observation);
23
+ let trackingRefs = 0;
24
+ let trackingReadBacks = 0;
25
+ const effectPort = {
26
+ ...input.lifecycle.effects,
27
+ async markProviderStockConsumed(request) {
28
+ try {
29
+ return await input.lifecycle.effects.markProviderStockConsumed(request);
30
+ }
31
+ catch (error) {
32
+ if (input.lifecycle.classifyFailure(error) === "stock_contention") {
33
+ try {
34
+ await input.lifecycle.annotateStockContention?.(observation.eventKey, ref.fulfillmentRef);
35
+ }
36
+ catch { /* Annotation is best-effort; preserve the original stock failure. */ }
37
+ }
38
+ throw error;
39
+ }
40
+ },
41
+ };
42
+ const localStatus = observation.fact.canonicalStatus;
43
+ const effects = {
44
+ port: effectPort, localStatus, ids: { orderId: ref.orderRef, fulfillmentOrderId: ref.fulfillmentRef }, observation,
45
+ trackingRefs: uniqueTrackingReferences(observation.trackingRefs).map(tracking => ({ trackingNumber: tracking.trackingNumber, trackingUrl: tracking.publicUrl, carrierKind: tracking.carrierRef, service: tracking.serviceRef })),
46
+ stockIdempotencyKey: input.lifecycle.keys.stock(ref.fulfillmentRef), handoffIdempotencyKey: input.lifecycle.keys.handoff(ref.fulfillmentRef),
47
+ trackingIdempotencyKey: number => input.lifecycle.keys.tracking(observation.eventKey, number),
48
+ issueAccountingInvoice: input.lifecycle.issueAccountingInvoice ? () => input.lifecycle.issueAccountingInvoice(ref.fulfillmentRef) : undefined,
49
+ onTrackingRecorded: result => { trackingRefs += result.replayed ? 0 : 1; trackingReadBacks += result.readBack ? 1 : 0; },
50
+ };
51
+ if (!observationStatusPolicy.handsOver(localStatus))
52
+ await applyFulfillmentObservationEffects({ ...effects, trackingRefs: [] }, observationStatusPolicy);
53
+ else {
54
+ try {
55
+ await applyFulfillmentObservationEffects(effects, observationStatusPolicy);
56
+ }
57
+ catch (error) {
58
+ if (input.lifecycle.classifyFailure(error) !== "state_conflict")
59
+ throw error;
60
+ await input.localPersistence.markProcessed(observation.eventKey, { status: "processed" });
61
+ return { kind: "superseded", observation, replayed: inbound.replayed || statusEvidence.replayed, trackingRefs, trackingReadBacks };
62
+ }
63
+ }
64
+ await input.localPersistence.markProcessed(observation.eventKey, { status: "processed" });
65
+ return { kind: "processed", observation, replayed: inbound.replayed || statusEvidence.replayed, trackingRefs, trackingReadBacks };
66
+ }
@@ -14,3 +14,28 @@ export interface StripePaymentAdapterConfig {
14
14
  export declare const stripePaymentCapabilities: Readonly<PaymentAdapterCapabilities>;
15
15
  /** Explicit construction is the only activation point; importing performs no I/O. */
16
16
  export declare function createStripePaymentAdapter(config: StripePaymentAdapterConfig): PaymentAdapter;
17
+ /**
18
+ * @experimental Reference-application support surface; may change.
19
+ * Reference consumer: `server/adapters/stripe/stripeAdapterFactory.ts`.
20
+ */
21
+ export { createStripeSandboxPaymentExecutionAdapter } from "./stripeSandboxPaymentExecutionAdapter.js";
22
+ /**
23
+ * @experimental Reference-application support surface; may change.
24
+ * Reference consumer: `server/runtime/paymentProviderReadbackRegistry.ts`.
25
+ */
26
+ export { createStripePaymentReconciliationProvider } from "./stripePaymentReconciliationProvider.js";
27
+ /**
28
+ * @experimental Reference-application support surface; may change.
29
+ * Reference consumer: `server/infra/stripe/stripeApiClient.ts`.
30
+ */
31
+ export { mapStripeIntent } from "./intentMapper.js";
32
+ /**
33
+ * @experimental Reference-application support surface; may change.
34
+ * Reference consumer: `server/infra/stripe/stripeApiClient.ts`.
35
+ */
36
+ export { mapSetupIntent } from "./intentMapper.js";
37
+ /**
38
+ * @experimental Reference-application support surface; may change.
39
+ * Reference consumer: `server/adapters/paymentRecoveryGuidance.ts`.
40
+ */
41
+ export { normalizeStripeFailureEvidence } from "./stripeFailureEvidence.js";
@@ -237,3 +237,28 @@ function mapVerifiedStripeEvent(raw) {
237
237
  return { ...result, fingerprint: createHash("sha256").update(JSON.stringify(result)).digest("hex"),
238
238
  providerAuditPayload: normalized.rawPayload };
239
239
  }
240
+ /**
241
+ * @experimental Reference-application support surface; may change.
242
+ * Reference consumer: `server/adapters/stripe/stripeAdapterFactory.ts`.
243
+ */
244
+ export { createStripeSandboxPaymentExecutionAdapter } from "./stripeSandboxPaymentExecutionAdapter.js";
245
+ /**
246
+ * @experimental Reference-application support surface; may change.
247
+ * Reference consumer: `server/runtime/paymentProviderReadbackRegistry.ts`.
248
+ */
249
+ export { createStripePaymentReconciliationProvider } from "./stripePaymentReconciliationProvider.js";
250
+ /**
251
+ * @experimental Reference-application support surface; may change.
252
+ * Reference consumer: `server/infra/stripe/stripeApiClient.ts`.
253
+ */
254
+ export { mapStripeIntent } from "./intentMapper.js";
255
+ /**
256
+ * @experimental Reference-application support surface; may change.
257
+ * Reference consumer: `server/infra/stripe/stripeApiClient.ts`.
258
+ */
259
+ export { mapSetupIntent } from "./intentMapper.js";
260
+ /**
261
+ * @experimental Reference-application support surface; may change.
262
+ * Reference consumer: `server/adapters/paymentRecoveryGuidance.ts`.
263
+ */
264
+ export { normalizeStripeFailureEvidence } from "./stripeFailureEvidence.js";
@@ -41,3 +41,33 @@ export interface TpayPaymentAdapterConfig {
41
41
  }
42
42
  /** Construction explicitly selects this adapter; the host owns account activation and I/O policy. */
43
43
  export declare function createTpayPaymentAdapter(config: TpayPaymentAdapterConfig): PaymentAdapter;
44
+ /**
45
+ * @experimental Reference-application support surface; may change.
46
+ * Reference consumer: `server/adapters/tpay/tpayAdapterFactory.ts`.
47
+ */
48
+ export { createTpayPaymentExecutionAdapter } from "./tpayPaymentExecutionAdapter.js";
49
+ /**
50
+ * @experimental Reference-application support surface; may change.
51
+ * Reference consumer: `server/runtime/paymentProviderReadbackRegistry.ts`.
52
+ */
53
+ export { createTpayPaymentReconciliationProvider } from "./tpayPaymentReconciliationProvider.js";
54
+ /**
55
+ * @experimental Reference-application support surface; may change.
56
+ * Reference consumer: `server/bff/commerce/tpay-channels.ts`.
57
+ */
58
+ export { createTpayHttpClient } from "./tpayHttpClient.js";
59
+ /**
60
+ * @experimental Reference-application support surface; may change.
61
+ * Reference consumer: `server/adapters/paymentRecoveryGuidance.ts`.
62
+ */
63
+ export { normalizeTpayFailureEvidence } from "./tpayFailureEvidence.js";
64
+ /**
65
+ * @experimental Reference-application support surface; may change.
66
+ * Reference consumer: `server/adapters/supabase/payment/tpaySubscriptionActivation.ts`.
67
+ */
68
+ export { aliasValue } from "./tpayCreateTransactionInput.js";
69
+ /**
70
+ * @experimental Reference-application support surface; may change.
71
+ * Reference consumer: `server/shared/preparedProviderAttempt.ts`.
72
+ */
73
+ export { ProviderAttemptPreDispatchError } from "./preparedProviderAttempt.js";
@@ -262,3 +262,33 @@ function mapVerifiedTpayEvent(rawBody, occurred, mode, supportedCurrencies) {
262
262
  return { ...evidence, fingerprint: createHash("sha256").update(JSON.stringify(evidence)).digest("hex"),
263
263
  providerAuditPayload: payload };
264
264
  }
265
+ /**
266
+ * @experimental Reference-application support surface; may change.
267
+ * Reference consumer: `server/adapters/tpay/tpayAdapterFactory.ts`.
268
+ */
269
+ export { createTpayPaymentExecutionAdapter } from "./tpayPaymentExecutionAdapter.js";
270
+ /**
271
+ * @experimental Reference-application support surface; may change.
272
+ * Reference consumer: `server/runtime/paymentProviderReadbackRegistry.ts`.
273
+ */
274
+ export { createTpayPaymentReconciliationProvider } from "./tpayPaymentReconciliationProvider.js";
275
+ /**
276
+ * @experimental Reference-application support surface; may change.
277
+ * Reference consumer: `server/bff/commerce/tpay-channels.ts`.
278
+ */
279
+ export { createTpayHttpClient } from "./tpayHttpClient.js";
280
+ /**
281
+ * @experimental Reference-application support surface; may change.
282
+ * Reference consumer: `server/adapters/paymentRecoveryGuidance.ts`.
283
+ */
284
+ export { normalizeTpayFailureEvidence } from "./tpayFailureEvidence.js";
285
+ /**
286
+ * @experimental Reference-application support surface; may change.
287
+ * Reference consumer: `server/adapters/supabase/payment/tpaySubscriptionActivation.ts`.
288
+ */
289
+ export { aliasValue } from "./tpayCreateTransactionInput.js";
290
+ /**
291
+ * @experimental Reference-application support surface; may change.
292
+ * Reference consumer: `server/shared/preparedProviderAttempt.ts`.
293
+ */
294
+ export { ProviderAttemptPreDispatchError } from "./preparedProviderAttempt.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openlup/platform",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "private": false,
5
5
  "description": "Runnable server substrate: Node HTTP runtime, BFF dispatch, scheduler, storage, data gateways and bundle composition; development preview.",
6
6
  "license": "Apache-2.0",
@@ -31,7 +31,7 @@
31
31
  "api:update": "npm run build && node --experimental-strip-types ./scripts/api-contract.ts --update"
32
32
  },
33
33
  "peerDependencies": {
34
- "@openlup/core": "0.21.0",
34
+ "@openlup/core": "0.22.0",
35
35
  "pg": "^8.22.0",
36
36
  "@aws-sdk/client-s3": "^3.1144.0",
37
37
  "@types/pg": "^8.20.0"
@@ -195,6 +195,21 @@
195
195
  "types": "./dist/payments/tpay/index.d.ts",
196
196
  "import": "./dist/payments/tpay/index.js",
197
197
  "default": "./dist/payments/tpay/index.js"
198
+ },
199
+ "./fulfillment": {
200
+ "types": "./dist/fulfillment/index.d.ts",
201
+ "import": "./dist/fulfillment/index.js",
202
+ "default": "./dist/fulfillment/index.js"
203
+ },
204
+ "./fulfillment/contracts": {
205
+ "types": "./dist/fulfillment/contracts/index.d.ts",
206
+ "import": "./dist/fulfillment/contracts/index.js",
207
+ "default": "./dist/fulfillment/contracts/index.js"
208
+ },
209
+ "./fulfillment/omnipack": {
210
+ "types": "./dist/fulfillment/omnipack/index.d.ts",
211
+ "import": "./dist/fulfillment/omnipack/index.js",
212
+ "default": "./dist/fulfillment/omnipack/index.js"
198
213
  }
199
214
  },
200
215
  "repository": {
@@ -415,6 +415,46 @@
415
415
  ],
416
416
  "entrypoint": "dist/payments/tpay/index.d.ts",
417
417
  "snapshot": "api/payments-tpay.api.md"
418
+ },
419
+ "./fulfillment": {
420
+ "role": "capability",
421
+ "maturity": "experimental",
422
+ "compatibilityPolicy": "internal-candidate",
423
+ "packageSmokeEvidence": [
424
+ "test/packageBoundary.test.ts",
425
+ "test/fulfillment/contracts.test.ts",
426
+ "test/fulfillment/portFit.test.ts",
427
+ "test/fulfillment/dispatchRecovery.test.ts",
428
+ "test/fulfillment/paidHandoff.test.ts",
429
+ "test/fulfillment/providerCommandLedger.test.ts",
430
+ "test/fulfillment/postgresStore.test.ts"
431
+ ],
432
+ "entrypoint": "dist/fulfillment/index.d.ts",
433
+ "snapshot": "api/fulfillment.api.md"
434
+ },
435
+ "./fulfillment/contracts": {
436
+ "role": "capability",
437
+ "maturity": "experimental",
438
+ "compatibilityPolicy": "internal-candidate",
439
+ "packageSmokeEvidence": [
440
+ "test/packageBoundary.test.ts",
441
+ "test/fulfillment/contracts.test.ts",
442
+ "test/fulfillment/portFit.test.ts"
443
+ ],
444
+ "entrypoint": "dist/fulfillment/contracts/index.d.ts",
445
+ "snapshot": "api/fulfillment-contracts.api.md"
446
+ },
447
+ "./fulfillment/omnipack": {
448
+ "role": "capability",
449
+ "maturity": "experimental",
450
+ "compatibilityPolicy": "internal-candidate",
451
+ "packageSmokeEvidence": [
452
+ "test/fulfillment/omnipack/conformance.test.ts",
453
+ "test/fulfillment/omnipack/factory.test.ts",
454
+ "test/fulfillment/omnipack/transportAdaptation.test.ts"
455
+ ],
456
+ "entrypoint": "dist/fulfillment/omnipack/index.d.ts",
457
+ "snapshot": "api/fulfillment-omnipack.api.md"
418
458
  }
419
459
  },
420
460
  "pack": {
@@ -430,8 +470,8 @@
430
470
  "maxUnpackedBytes": 5734400,
431
471
  "maxFiles": 2100,
432
472
  "baseline": {
433
- "version": "0.20.0",
434
- "packedBytes": 809376
473
+ "version": "0.21.0",
474
+ "packedBytes": 1008887
435
475
  },
436
476
  "browserEntries": {
437
477
  "./catalog/contracts": 4096,
@@ -441,7 +481,8 @@
441
481
  "./pricing/contracts": 416,
442
482
  "./promotions/contracts": 32,
443
483
  "./shipping/contracts": 32,
444
- "./payments/contracts": 32
484
+ "./payments/contracts": 32,
485
+ "./fulfillment/contracts": 32
445
486
  }
446
487
  }
447
488
  }