@openlup/platform 0.26.0 → 0.28.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.
- package/CHANGELOG.md +305 -327
- package/README.md +332 -16
- package/dist/account-support/accountReadFacade.d.ts +8 -0
- package/dist/account-support/accountReadFacade.js +10 -0
- package/dist/account-support/accountReadModels.d.ts +69 -0
- package/dist/account-support/accountReadModels.js +272 -0
- package/dist/account-support/bindings.d.ts +23 -0
- package/dist/account-support/bindings.js +16 -0
- package/dist/account-support/contracts/account.d.ts +281 -0
- package/dist/account-support/contracts/account.js +1 -0
- package/dist/account-support/contracts/capabilities.d.ts +44 -0
- package/dist/account-support/contracts/capabilities.js +1 -0
- package/dist/account-support/contracts/commands.d.ts +307 -0
- package/dist/account-support/contracts/commands.js +1 -0
- package/dist/account-support/contracts/customer360.d.ts +154 -0
- package/dist/account-support/contracts/customer360.js +1 -0
- package/dist/account-support/contracts/index.d.ts +10 -0
- package/dist/account-support/contracts/index.js +1 -0
- package/dist/account-support/contracts/invoice.d.ts +79 -0
- package/dist/account-support/contracts/invoice.js +1 -0
- package/dist/account-support/contracts/operator.d.ts +289 -0
- package/dist/account-support/contracts/operator.js +1 -0
- package/dist/account-support/contribution.d.ts +24 -0
- package/dist/account-support/contribution.js +22 -0
- package/dist/account-support/customer360.d.ts +106 -0
- package/dist/account-support/customer360.js +163 -0
- package/dist/account-support/customerAccountReadDiagnostics.d.ts +11 -0
- package/dist/account-support/customerAccountReadDiagnostics.js +71 -0
- package/dist/account-support/index.d.ts +26 -0
- package/dist/account-support/index.js +15 -0
- package/dist/account-support/invoiceAccess.d.ts +57 -0
- package/dist/account-support/invoiceAccess.js +40 -0
- package/dist/account-support/migrations.d.ts +14 -0
- package/dist/account-support/migrations.js +7 -0
- package/dist/account-support/operatorAuthority.d.ts +67 -0
- package/dist/account-support/operatorAuthority.js +379 -0
- package/dist/account-support/operatorRecovery.d.ts +66 -0
- package/dist/account-support/operatorRecovery.js +129 -0
- package/dist/account-support/orderHistory.d.ts +50 -0
- package/dist/account-support/orderHistory.js +188 -0
- package/dist/account-support/paymentMethodComposition.d.ts +5 -0
- package/dist/account-support/paymentMethodComposition.js +4 -0
- package/dist/account-support/postgresOperatorAuthority.d.ts +16 -0
- package/dist/account-support/postgresOperatorAuthority.js +93 -0
- package/dist/account-support/selfService.d.ts +6 -0
- package/dist/account-support/selfService.js +81 -0
- package/dist/account-support/subscriptionCommandCodec.d.ts +10 -0
- package/dist/account-support/subscriptionCommandCodec.js +38 -0
- package/dist/catalog/draftSchemas.d.ts +1 -1
- package/dist/catalog/foundationSchemas.d.ts +3 -3
- package/dist/catalog/resolvedSkuProjection.d.ts +2 -2
- package/dist/catalog/sellableSchemas.d.ts +2 -2
- package/dist/commerce/adapters/managed/commerceOmsControlPlane.d.ts +3 -0
- package/dist/commerce/adapters/managed/commerceOmsControlPlane.js +71 -0
- package/dist/commerce/adapters/managed/commerceOmsMutations.d.ts +10 -0
- package/dist/commerce/adapters/managed/commerceOmsMutations.js +119 -0
- package/dist/commerce/adapters/managed/commerceOmsPort.d.ts +28 -0
- package/dist/commerce/adapters/managed/commerceOmsPort.js +101 -0
- package/dist/commerce/adapters/managed/oms/accounting.d.ts +3 -0
- package/dist/commerce/adapters/managed/oms/accounting.js +13 -0
- package/dist/commerce/adapters/managed/oms/fulfillmentReads.d.ts +17 -0
- package/dist/commerce/adapters/managed/oms/fulfillmentReads.js +81 -0
- package/dist/commerce/adapters/managed/oms/inboundEvents.d.ts +9 -0
- package/dist/commerce/adapters/managed/oms/inboundEvents.js +40 -0
- package/dist/commerce/adapters/managed/oms/outboxEvents.d.ts +2 -0
- package/dist/commerce/adapters/managed/oms/outboxEvents.js +23 -0
- package/dist/commerce/adapters/managed/oms/paymentAttempts.d.ts +3 -0
- package/dist/commerce/adapters/managed/oms/paymentAttempts.js +15 -0
- package/dist/commerce/adapters/managed/oms/queueSelection.d.ts +12 -0
- package/dist/commerce/adapters/managed/oms/queueSelection.js +109 -0
- package/dist/commerce/adapters/managed/oms/readProjections.d.ts +18 -0
- package/dist/commerce/adapters/managed/oms/readProjections.js +13 -0
- package/dist/commerce/adapters/managed/oms/readQueries.d.ts +16 -0
- package/dist/commerce/adapters/managed/oms/readQueries.js +276 -0
- package/dist/commerce/adapters/managed/oms/types.d.ts +2 -0
- package/dist/commerce/adapters/managed/oms/types.js +7 -0
- package/dist/commerce/checkoutCommandSchemas.d.ts +89 -0
- package/dist/commerce/checkoutCommandSchemas.js +70 -0
- package/dist/commerce/checkoutHelpers.d.ts +21 -0
- package/dist/commerce/checkoutHelpers.js +29 -0
- package/dist/commerce/checkoutResumeSchemas.d.ts +158 -0
- package/dist/commerce/checkoutResumeSchemas.js +145 -0
- package/dist/commerce/checkoutSchemas.d.ts +158 -0
- package/dist/commerce/checkoutSchemas.js +161 -0
- package/dist/commerce/commerceReturnsPort.d.ts +97 -0
- package/dist/commerce/commerceReturnsPort.js +39 -0
- package/dist/commerce/configuratorIntentPersistenceSchemas.d.ts +20 -0
- package/dist/commerce/configuratorIntentPersistenceSchemas.js +21 -0
- package/dist/commerce/configuratorIntentSchemas.d.ts +63 -0
- package/dist/commerce/configuratorIntentSchemas.js +43 -0
- package/dist/commerce/contractPrimitives.d.ts +50 -0
- package/dist/commerce/contractPrimitives.js +25 -0
- package/dist/commerce/contracts/availability.d.ts +23 -0
- package/dist/commerce/contracts/availability.js +1 -0
- package/dist/commerce/contracts/fulfillmentRecovery.d.ts +25 -0
- package/dist/commerce/contracts/fulfillmentRecovery.js +1 -0
- package/dist/commerce/contracts/index.d.ts +13 -0
- package/dist/commerce/contracts/index.js +1 -0
- package/dist/commerce/contracts/intent.d.ts +86 -0
- package/dist/commerce/contracts/intent.js +1 -0
- package/dist/commerce/contracts/omsTypes.d.ts +1216 -0
- package/dist/commerce/contracts/omsTypes.js +1 -0
- package/dist/commerce/contracts/order.d.ts +39 -0
- package/dist/commerce/contracts/order.js +1 -0
- package/dist/commerce/contracts/orderMoney.d.ts +52 -0
- package/dist/commerce/contracts/orderMoney.js +1 -0
- package/dist/commerce/contracts/ports.d.ts +113 -0
- package/dist/commerce/contracts/ports.js +1 -0
- package/dist/commerce/contracts/recovery.d.ts +11 -0
- package/dist/commerce/contracts/recovery.js +1 -0
- package/dist/commerce/contracts/runtimePorts.d.ts +196 -0
- package/dist/commerce/contracts/runtimePorts.js +1 -0
- package/dist/commerce/contracts/state.d.ts +26 -0
- package/dist/commerce/contracts/state.js +43 -0
- package/dist/commerce/customerDefaultsSnapshotSchemas.d.ts +51 -0
- package/dist/commerce/customerDefaultsSnapshotSchemas.js +106 -0
- package/dist/commerce/errors.d.ts +18 -0
- package/dist/commerce/errors.js +36 -0
- package/dist/commerce/fulfillmentEligibility.d.ts +6 -0
- package/dist/commerce/fulfillmentEligibility.js +31 -0
- package/dist/commerce/index.d.ts +72 -0
- package/dist/commerce/index.js +67 -0
- package/dist/commerce/model/customerFulfillmentRecovery.d.ts +40 -0
- package/dist/commerce/model/customerFulfillmentRecovery.js +144 -0
- package/dist/commerce/model/fulfillmentCancellationEligibility.d.ts +7 -0
- package/dist/commerce/model/fulfillmentCancellationEligibility.js +9 -0
- package/dist/commerce/model/omsAccountingVisibility.d.ts +12 -0
- package/dist/commerce/model/omsAccountingVisibility.js +118 -0
- package/dist/commerce/model/omsBillingInvoiceBuyer.d.ts +2 -0
- package/dist/commerce/model/omsBillingInvoiceBuyer.js +15 -0
- package/dist/commerce/model/omsCurrency.d.ts +4 -0
- package/dist/commerce/model/omsCurrency.js +5 -0
- package/dist/commerce/model/omsFulfillmentDebug.d.ts +20 -0
- package/dist/commerce/model/omsFulfillmentDebug.js +122 -0
- package/dist/commerce/model/omsFulfillmentSummary.d.ts +16 -0
- package/dist/commerce/model/omsFulfillmentSummary.js +189 -0
- package/dist/commerce/model/omsListTotals.d.ts +13 -0
- package/dist/commerce/model/omsListTotals.js +32 -0
- package/dist/commerce/model/omsOperationalLadder.d.ts +51 -0
- package/dist/commerce/model/omsOperationalLadder.js +158 -0
- package/dist/commerce/model/omsOrderLineMoney.d.ts +4 -0
- package/dist/commerce/model/omsOrderLineMoney.js +25 -0
- package/dist/commerce/model/omsPaymentMethodSummary.d.ts +5 -0
- package/dist/commerce/model/omsPaymentMethodSummary.js +11 -0
- package/dist/commerce/model/omsReadModel.d.ts +43 -0
- package/dist/commerce/model/omsReadModel.js +211 -0
- package/dist/commerce/model/omsReadModelCommunication.d.ts +3 -0
- package/dist/commerce/model/omsReadModelCommunication.js +29 -0
- package/dist/commerce/model/omsReadModelHelpers.d.ts +125 -0
- package/dist/commerce/model/omsReadModelHelpers.js +212 -0
- package/dist/commerce/model/omsReadModelList.d.ts +33 -0
- package/dist/commerce/model/omsReadModelList.js +50 -0
- package/dist/commerce/model/omsReadModelListSummary.d.ts +3 -0
- package/dist/commerce/model/omsReadModelListSummary.js +13 -0
- package/dist/commerce/model/omsReadModelPricing.d.ts +5 -0
- package/dist/commerce/model/omsReadModelPricing.js +36 -0
- package/dist/commerce/model/omsReadModelProjections.d.ts +1 -0
- package/dist/commerce/model/omsReadModelProjections.js +1 -0
- package/dist/commerce/model/omsReadModelRowCore.d.ts +79 -0
- package/dist/commerce/model/omsReadModelRowCore.js +149 -0
- package/dist/commerce/model/omsReadModelRows.d.ts +1 -0
- package/dist/commerce/model/omsReadModelRows.js +6 -0
- package/dist/commerce/offerAvailability.d.ts +18 -0
- package/dist/commerce/offerAvailability.js +53 -0
- package/dist/commerce/offerAvailabilitySchemas.d.ts +43 -0
- package/dist/commerce/offerAvailabilitySchemas.js +42 -0
- package/dist/commerce/offerEvidenceSchemas.d.ts +7 -0
- package/dist/commerce/offerEvidenceSchemas.js +13 -0
- package/dist/commerce/oms/omsContractBase.d.ts +130 -0
- package/dist/commerce/oms/omsContractBase.js +86 -0
- package/dist/commerce/oms/omsContractReadAuxSchemas.d.ts +222 -0
- package/dist/commerce/oms/omsContractReadAuxSchemas.js +123 -0
- package/dist/commerce/oms/omsContractReadSchemas.d.ts +2266 -0
- package/dist/commerce/oms/omsContractReadSchemas.js +277 -0
- package/dist/commerce/oms/omsContractRequests.d.ts +196 -0
- package/dist/commerce/oms/omsContractRequests.js +118 -0
- package/dist/commerce/oms/omsContracts.d.ts +5 -0
- package/dist/commerce/oms/omsContracts.js +4 -0
- package/dist/commerce/oms/omsControlPlane.d.ts +275 -0
- package/dist/commerce/oms/omsControlPlane.js +72 -0
- package/dist/commerce/oms/omsFulfillmentContractSchemas.d.ts +203 -0
- package/dist/commerce/oms/omsFulfillmentContractSchemas.js +94 -0
- package/dist/commerce/oms/omsFulfillmentDebugSchemas.d.ts +69 -0
- package/dist/commerce/oms/omsFulfillmentDebugSchemas.js +33 -0
- package/dist/commerce/oms/omsFulfillmentHealthSchemas.d.ts +67 -0
- package/dist/commerce/oms/omsFulfillmentHealthSchemas.js +44 -0
- package/dist/commerce/oms/omsPorts.d.ts +84 -0
- package/dist/commerce/oms/omsPorts.js +148 -0
- package/dist/commerce/oms/omsPrimitives.d.ts +5 -0
- package/dist/commerce/oms/omsPrimitives.js +3 -0
- package/dist/commerce/oms/omsProviderEvidenceSchemas.d.ts +15 -0
- package/dist/commerce/oms/omsProviderEvidenceSchemas.js +12 -0
- package/dist/commerce/orderDraftErrors.d.ts +13 -0
- package/dist/commerce/orderDraftErrors.js +20 -0
- package/dist/commerce/orderEmailEligibility.d.ts +54 -0
- package/dist/commerce/orderEmailEligibility.js +123 -0
- package/dist/commerce/orderEmailLines.d.ts +12 -0
- package/dist/commerce/orderEmailLines.js +8 -0
- package/dist/commerce/orderFeedbackContracts.d.ts +41 -0
- package/dist/commerce/orderFeedbackContracts.js +33 -0
- package/dist/commerce/orderMoney.d.ts +6 -0
- package/dist/commerce/orderMoney.js +168 -0
- package/dist/commerce/orderReviewContracts.d.ts +475 -0
- package/dist/commerce/orderReviewContracts.js +94 -0
- package/dist/commerce/orderReviewPorts.d.ts +140 -0
- package/dist/commerce/orderReviewPorts.js +1 -0
- package/dist/commerce/outboxDispatchContracts.d.ts +30 -0
- package/dist/commerce/outboxDispatchContracts.js +1 -0
- package/dist/commerce/outboxEventSchemas.d.ts +162 -0
- package/dist/commerce/outboxEventSchemas.js +164 -0
- package/dist/commerce/outboxOrderDraftEmailPorts.d.ts +207 -0
- package/dist/commerce/outboxOrderDraftEmailPorts.js +12 -0
- package/dist/commerce/paymentContinuation.d.ts +4 -0
- package/dist/commerce/paymentContinuation.js +4 -0
- package/dist/commerce/ports.d.ts +8 -0
- package/dist/commerce/ports.js +1 -0
- package/dist/commerce/recoveryDestination.d.ts +3 -0
- package/dist/commerce/recoveryDestination.js +17 -0
- package/dist/commerce/runtimeErrors.d.ts +8 -0
- package/dist/commerce/runtimeErrors.js +16 -0
- package/dist/commerce/salesChannelEnvelope.d.ts +20 -0
- package/dist/commerce/salesChannelEnvelope.js +7 -0
- package/dist/commerce/schemas.d.ts +174 -0
- package/dist/commerce/schemas.js +84 -0
- package/dist/commerce/server/checkoutCompensation.d.ts +21 -0
- package/dist/commerce/server/checkoutCompensation.js +32 -0
- package/dist/commerce/server/checkoutConflictClassifiers.d.ts +17 -0
- package/dist/commerce/server/checkoutConflictClassifiers.js +38 -0
- package/dist/commerce/server/checkoutExpiredRecoveryPolicy.d.ts +38 -0
- package/dist/commerce/server/checkoutExpiredRecoveryPolicy.js +85 -0
- package/dist/commerce/server/checkoutInvoiceBuyerSnapshot.d.ts +22 -0
- package/dist/commerce/server/checkoutInvoiceBuyerSnapshot.js +30 -0
- package/dist/commerce/server/checkoutOfferPolicyPort.d.ts +33 -0
- package/dist/commerce/server/checkoutOfferPolicyPort.js +49 -0
- package/dist/commerce/server/checkoutPaymentContinuationCredential.d.ts +58 -0
- package/dist/commerce/server/checkoutPaymentContinuationCredential.js +154 -0
- package/dist/commerce/server/checkoutQuoteTypes.d.ts +19 -0
- package/dist/commerce/server/checkoutQuoteTypes.js +1 -0
- package/dist/commerce/server/checkoutRecoveryOrderPort.d.ts +42 -0
- package/dist/commerce/server/checkoutRecoveryOrderPort.js +1 -0
- package/dist/commerce/server/checkoutRecoveryToken.d.ts +40 -0
- package/dist/commerce/server/checkoutRecoveryToken.js +26 -0
- package/dist/commerce/server/checkoutRefusalContinuation.d.ts +24 -0
- package/dist/commerce/server/checkoutRefusalContinuation.js +18 -0
- package/dist/commerce/server/checkoutRuntimeTypes.d.ts +81 -0
- package/dist/commerce/server/checkoutRuntimeTypes.js +1 -0
- package/dist/commerce/server/commerceCheckoutCommandExecution.d.ts +60 -0
- package/dist/commerce/server/commerceCheckoutCommandExecution.js +136 -0
- package/dist/commerce/server/commerceCheckoutCompensation.d.ts +26 -0
- package/dist/commerce/server/commerceCheckoutCompensation.js +46 -0
- package/dist/commerce/server/commerceCheckoutContinuationTerms.d.ts +50 -0
- package/dist/commerce/server/commerceCheckoutContinuationTerms.js +66 -0
- package/dist/commerce/server/commerceCheckoutCustomerDefaults.d.ts +18 -0
- package/dist/commerce/server/commerceCheckoutCustomerDefaults.js +17 -0
- package/dist/commerce/server/commerceCheckoutFailureHandler.d.ts +51 -0
- package/dist/commerce/server/commerceCheckoutFailureHandler.js +90 -0
- package/dist/commerce/server/commerceCheckoutHandler.d.ts +213 -0
- package/dist/commerce/server/commerceCheckoutHandler.js +196 -0
- package/dist/commerce/server/commerceCheckoutHandlerAdmission.d.ts +58 -0
- package/dist/commerce/server/commerceCheckoutHandlerAdmission.js +94 -0
- package/dist/commerce/server/commerceCheckoutHandlerHelpers.d.ts +67 -0
- package/dist/commerce/server/commerceCheckoutHandlerHelpers.js +155 -0
- package/dist/commerce/server/commerceCheckoutOrchestrationError.d.ts +9 -0
- package/dist/commerce/server/commerceCheckoutOrchestrationError.js +14 -0
- package/dist/commerce/server/commerceCheckoutPromotionPriceChange.d.ts +47 -0
- package/dist/commerce/server/commerceCheckoutPromotionPriceChange.js +43 -0
- package/dist/commerce/server/commerceCheckoutProviderPayment.d.ts +34 -0
- package/dist/commerce/server/commerceCheckoutProviderPayment.js +37 -0
- package/dist/commerce/server/commerceCheckoutQuoteGuard.d.ts +62 -0
- package/dist/commerce/server/commerceCheckoutQuoteGuard.js +106 -0
- package/dist/commerce/server/commerceCheckoutResume.d.ts +29 -0
- package/dist/commerce/server/commerceCheckoutResume.js +81 -0
- package/dist/commerce/server/commerceCheckoutResumeGuard.d.ts +54 -0
- package/dist/commerce/server/commerceCheckoutResumeGuard.js +138 -0
- package/dist/commerce/server/commerceCheckoutSavedPaymentMethod.d.ts +39 -0
- package/dist/commerce/server/commerceCheckoutSavedPaymentMethod.js +44 -0
- package/dist/commerce/server/commerceCheckoutStartRuntimeFailure.d.ts +7 -0
- package/dist/commerce/server/commerceCheckoutStartRuntimeFailure.js +39 -0
- package/dist/commerce/server/commerceCheckoutTiming.d.ts +8 -0
- package/dist/commerce/server/commerceCheckoutTiming.js +31 -0
- package/dist/commerce/server/commerceDiagnostics.d.ts +6 -0
- package/dist/commerce/server/commerceDiagnostics.js +31 -0
- package/dist/commerce/server/commerceOmsCancelOrderHandler.d.ts +7 -0
- package/dist/commerce/server/commerceOmsCancelOrderHandler.js +22 -0
- package/dist/commerce/server/commerceOmsControlPlaneHandlers.d.ts +18 -0
- package/dist/commerce/server/commerceOmsControlPlaneHandlers.js +60 -0
- package/dist/commerce/server/commerceOmsHandlers.d.ts +47 -0
- package/dist/commerce/server/commerceOmsHandlers.js +176 -0
- package/dist/commerce/server/commerceOmsMarkRefundedHandler.d.ts +7 -0
- package/dist/commerce/server/commerceOmsMarkRefundedHandler.js +19 -0
- package/dist/commerce/server/commerceOrderDraft.d.ts +24 -0
- package/dist/commerce/server/commerceOrderDraft.js +92 -0
- package/dist/commerce/server/commercePaidOrderOrchestration.d.ts +131 -0
- package/dist/commerce/server/commercePaidOrderOrchestration.js +140 -0
- package/dist/commerce/server/commerceProviderAttemptFailure.d.ts +133 -0
- package/dist/commerce/server/commerceProviderAttemptFailure.js +175 -0
- package/dist/commerce/server/commerceReturnsHandlers.d.ts +41 -0
- package/dist/commerce/server/commerceReturnsHandlers.js +100 -0
- package/dist/commerce/server/commerceRuntimePort.d.ts +16 -0
- package/dist/commerce/server/commerceRuntimePort.js +57 -0
- package/dist/commerce/server/commerceRuntimeService.d.ts +98 -0
- package/dist/commerce/server/commerceRuntimeService.js +186 -0
- package/dist/commerce/server/commerceRuntimeStartResponse.d.ts +37 -0
- package/dist/commerce/server/commerceRuntimeStartResponse.js +56 -0
- package/dist/commerce/server/commerceStarterOfferGuard.d.ts +55 -0
- package/dist/commerce/server/commerceStarterOfferGuard.js +128 -0
- package/dist/commerce/server/configuratorIntentPersistence.d.ts +47 -0
- package/dist/commerce/server/configuratorIntentPersistence.js +85 -0
- package/dist/commerce/server/configuratorIntentPersistenceHandler.d.ts +14 -0
- package/dist/commerce/server/configuratorIntentPersistenceHandler.js +42 -0
- package/dist/commerce/server/emailRuntime.d.ts +47 -0
- package/dist/commerce/server/emailRuntime.js +1 -0
- package/dist/commerce/server/handlerSupport.d.ts +68 -0
- package/dist/commerce/server/handlerSupport.js +1 -0
- package/dist/commerce/server/index.d.ts +178 -0
- package/dist/commerce/server/index.js +127 -0
- package/dist/commerce/server/offerAvailability.d.ts +21 -0
- package/dist/commerce/server/offerAvailability.js +163 -0
- package/dist/commerce/server/orderDraftRpcPayload.d.ts +20 -0
- package/dist/commerce/server/orderDraftRpcPayload.js +21 -0
- package/dist/commerce/server/orderFeedbackSubmit.d.ts +20 -0
- package/dist/commerce/server/orderFeedbackSubmit.js +16 -0
- package/dist/commerce/server/orderFeedbackTokenCheck.d.ts +17 -0
- package/dist/commerce/server/orderFeedbackTokenCheck.js +14 -0
- package/dist/commerce/server/orderReviewAdminHandlers.d.ts +47 -0
- package/dist/commerce/server/orderReviewAdminHandlers.js +41 -0
- package/dist/commerce/server/orderReviewHandlers.d.ts +114 -0
- package/dist/commerce/server/orderReviewHandlers.js +42 -0
- package/dist/commerce/server/orderReviewLifecycle.d.ts +10 -0
- package/dist/commerce/server/orderReviewLifecycle.js +121 -0
- package/dist/commerce/server/orderReviewMedia.d.ts +11 -0
- package/dist/commerce/server/orderReviewMedia.js +172 -0
- package/dist/commerce/server/orderReviewRawUploadHandler.d.ts +40 -0
- package/dist/commerce/server/orderReviewRawUploadHandler.js +316 -0
- package/dist/commerce/server/outboxCheckoutExpiredEmailHandler.d.ts +14 -0
- package/dist/commerce/server/outboxCheckoutExpiredEmailHandler.js +57 -0
- package/dist/commerce/server/outboxCheckoutRecoveryEmailHandler.d.ts +13 -0
- package/dist/commerce/server/outboxCheckoutRecoveryEmailHandler.js +150 -0
- package/dist/commerce/server/outboxDispatchRegistry.d.ts +46 -0
- package/dist/commerce/server/outboxDispatchRegistry.js +184 -0
- package/dist/commerce/server/outboxDispatchRegistryComposition.d.ts +6 -0
- package/dist/commerce/server/outboxDispatchRegistryComposition.js +23 -0
- package/dist/commerce/server/outboxOrderDraftEmailHandler.d.ts +14 -0
- package/dist/commerce/server/outboxOrderDraftEmailHandler.js +130 -0
- package/dist/commerce/server/outboxOrderPaidEmailHandler.d.ts +21 -0
- package/dist/commerce/server/outboxOrderPaidEmailHandler.js +93 -0
- package/dist/commerce/server/outboxOrderPaidFulfillmentHandler.d.ts +3 -0
- package/dist/commerce/server/outboxOrderPaidFulfillmentHandler.js +1 -0
- package/dist/commerce/server/outboxOrderPaidFulfillmentPorts.d.ts +3 -0
- package/dist/commerce/server/outboxOrderPaidFulfillmentPorts.js +1 -0
- package/dist/commerce/server/outboxOrderRefundedEmailHandler.d.ts +13 -0
- package/dist/commerce/server/outboxOrderRefundedEmailHandler.js +42 -0
- package/dist/commerce/server/outboxPaymentFailedEmailHandler.d.ts +14 -0
- package/dist/commerce/server/outboxPaymentFailedEmailHandler.js +65 -0
- package/dist/commerce/server/outboxReturnEmailHandlers.d.ts +26 -0
- package/dist/commerce/server/outboxReturnEmailHandlers.js +53 -0
- package/dist/commerce/server/outboxShipmentDeliveredEmailHandler.d.ts +17 -0
- package/dist/commerce/server/outboxShipmentDeliveredEmailHandler.js +52 -0
- package/dist/commerce/server/outboxShipmentDispatchedEmailHandler.d.ts +13 -0
- package/dist/commerce/server/outboxShipmentDispatchedEmailHandler.js +87 -0
- package/dist/commerce/server/outboxShipmentExceptionEmailHandler.d.ts +13 -0
- package/dist/commerce/server/outboxShipmentExceptionEmailHandler.js +46 -0
- package/dist/commerce/server/referenceCheckoutHandler.d.ts +48 -0
- package/dist/commerce/server/referenceCheckoutHandler.js +68 -0
- package/dist/commerce/server/reservationSweepPort.d.ts +31 -0
- package/dist/commerce/server/reservationSweepPort.js +45 -0
- package/dist/commerce/server/starterTermsPort.d.ts +22 -0
- package/dist/commerce/server/starterTermsPort.js +1 -0
- package/dist/commerce/server/supabaseCommerceReturnsPort.d.ts +13 -0
- package/dist/commerce/server/supabaseCommerceReturnsPort.js +56 -0
- package/dist/communications/consentPurposeRegistry.d.ts +1 -1
- package/dist/communications/newsletterIntegrationContracts.d.ts +10 -10
- package/dist/composition/accountSupportContribution.d.ts +18 -0
- package/dist/composition/accountSupportContribution.js +21 -0
- package/dist/composition/commerceContribution.d.ts +21 -0
- package/dist/composition/commerceContribution.js +27 -0
- package/dist/composition/index.d.ts +2 -0
- package/dist/composition/index.js +2 -0
- package/dist/fulfillment/handlerSchemas.d.ts +69 -69
- package/dist/fulfillment/index.d.ts +1 -1
- package/dist/fulfillment/index.js +1 -1
- package/dist/fulfillment/paidHandoff.d.ts +12 -1
- package/dist/fulfillment/paidHandoff.js +2 -2
- package/dist/fulfillment/providerDispatchWorker.d.ts +4 -4
- package/dist/identity/customerContracts.d.ts +4 -4
- package/dist/inventory/bindings.d.ts +3 -0
- package/dist/inventory/bindings.js +10 -4
- package/dist/inventory/index.d.ts +1 -0
- package/dist/inventory/index.js +1 -0
- package/dist/inventory/managedStockAvailability.d.ts +15 -0
- package/dist/inventory/managedStockAvailability.js +16 -0
- package/dist/inventory/postgresStockAvailability.js +2 -25
- package/dist/inventory/schemas.d.ts +1 -1
- package/dist/inventory/stockReadResponse.d.ts +4 -0
- package/dist/inventory/stockReadResponse.js +27 -0
- package/dist/invoicing/snapshot.d.ts +1 -1
- package/dist/pricing/acquisitionQuoteBinding.d.ts +1 -1
- package/dist/pricing/browser/index.d.ts +6 -0
- package/dist/pricing/browser/index.js +6 -0
- package/dist/pricing/catalogFactsSchemas.d.ts +1 -1
- package/dist/pricing/quotePromotionEvidence.d.ts +1 -1
- package/dist/pricing/quoteSchemas.d.ts +56 -56
- package/dist/promotions/adminPromotionCodesContracts.d.ts +30 -30
- package/dist/promotions/adminPromotionsContracts.d.ts +16 -16
- package/dist/subscriptions/index.d.ts +3 -2
- package/dist/subscriptions/index.js +3 -2
- package/package.json +32 -2
- package/release-gates.json +90 -8
- package/sql/20261026120000_account_support_operator_authority.sql +693 -0
- package/src/account-support/accountReadFacade.ts +15 -0
- package/src/account-support/accountReadModels.ts +371 -0
- package/src/account-support/bindings.ts +28 -0
- package/src/account-support/contracts/account.ts +306 -0
- package/src/account-support/contracts/capabilities.ts +30 -0
- package/src/account-support/contracts/commands.ts +243 -0
- package/src/account-support/contracts/customer360.ts +150 -0
- package/src/account-support/contracts/index.ts +141 -0
- package/src/account-support/contracts/invoice.ts +44 -0
- package/src/account-support/contracts/operator.ts +123 -0
- package/src/account-support/contribution.ts +35 -0
- package/src/account-support/customer360.ts +268 -0
- package/src/account-support/customerAccountReadDiagnostics.ts +83 -0
- package/src/account-support/index.ts +72 -0
- package/src/account-support/invoiceAccess.ts +63 -0
- package/src/account-support/migrations.ts +7 -0
- package/src/account-support/operatorAuthority.ts +393 -0
- package/src/account-support/operatorRecovery.ts +136 -0
- package/src/account-support/orderHistory.ts +309 -0
- package/src/account-support/paymentMethodComposition.ts +8 -0
- package/src/account-support/postgresOperatorAuthority.ts +92 -0
- package/src/account-support/selfService.ts +83 -0
- package/src/account-support/subscriptionCommandCodec.ts +48 -0
- package/src/commerce/adapters/managed/commerceOmsControlPlane.ts +80 -0
- package/src/commerce/adapters/managed/commerceOmsMutations.ts +145 -0
- package/src/commerce/adapters/managed/commerceOmsPort.ts +158 -0
- package/src/commerce/adapters/managed/oms/accounting.ts +18 -0
- package/src/commerce/adapters/managed/oms/fulfillmentReads.ts +82 -0
- package/src/commerce/adapters/managed/oms/inboundEvents.ts +45 -0
- package/src/commerce/adapters/managed/oms/outboxEvents.ts +30 -0
- package/src/commerce/adapters/managed/oms/paymentAttempts.ts +19 -0
- package/src/commerce/adapters/managed/oms/queueSelection.ts +132 -0
- package/src/commerce/adapters/managed/oms/readProjections.ts +22 -0
- package/src/commerce/adapters/managed/oms/readQueries.ts +292 -0
- package/src/commerce/adapters/managed/oms/types.ts +9 -0
- package/src/commerce/checkoutCommandSchemas.ts +93 -0
- package/src/commerce/checkoutHelpers.ts +47 -0
- package/src/commerce/checkoutResumeSchemas.ts +164 -0
- package/src/commerce/checkoutSchemas.ts +182 -0
- package/src/commerce/commerceReturnsPort.ts +67 -0
- package/src/commerce/configuratorIntentPersistenceSchemas.ts +26 -0
- package/src/commerce/configuratorIntentSchemas.ts +47 -0
- package/src/commerce/contractPrimitives.ts +30 -0
- package/src/commerce/contracts/availability.ts +21 -0
- package/src/commerce/contracts/fulfillmentRecovery.ts +26 -0
- package/src/commerce/contracts/index.ts +17 -0
- package/src/commerce/contracts/intent.ts +58 -0
- package/src/commerce/contracts/omsTypes.ts +1217 -0
- package/src/commerce/contracts/order.ts +44 -0
- package/src/commerce/contracts/orderMoney.ts +75 -0
- package/src/commerce/contracts/ports.ts +124 -0
- package/src/commerce/contracts/recovery.ts +24 -0
- package/src/commerce/contracts/runtimePorts.ts +201 -0
- package/src/commerce/contracts/state.ts +64 -0
- package/src/commerce/customerDefaultsSnapshotSchemas.ts +117 -0
- package/src/commerce/errors.ts +53 -0
- package/src/commerce/fulfillmentEligibility.ts +32 -0
- package/src/commerce/index.ts +82 -0
- package/src/commerce/model/customerFulfillmentRecovery.ts +185 -0
- package/src/commerce/model/fulfillmentCancellationEligibility.ts +18 -0
- package/src/commerce/model/omsAccountingVisibility.ts +135 -0
- package/src/commerce/model/omsBillingInvoiceBuyer.ts +20 -0
- package/src/commerce/model/omsCurrency.ts +8 -0
- package/src/commerce/model/omsFulfillmentDebug.ts +157 -0
- package/src/commerce/model/omsFulfillmentSummary.ts +225 -0
- package/src/commerce/model/omsListTotals.ts +38 -0
- package/src/commerce/model/omsOperationalLadder.ts +181 -0
- package/src/commerce/model/omsOrderLineMoney.ts +34 -0
- package/src/commerce/model/omsPaymentMethodSummary.ts +19 -0
- package/src/commerce/model/omsReadModel.ts +302 -0
- package/src/commerce/model/omsReadModelCommunication.ts +32 -0
- package/src/commerce/model/omsReadModelHelpers.ts +279 -0
- package/src/commerce/model/omsReadModelList.ts +90 -0
- package/src/commerce/model/omsReadModelListSummary.ts +19 -0
- package/src/commerce/model/omsReadModelPricing.ts +57 -0
- package/src/commerce/model/omsReadModelProjections.ts +1 -0
- package/src/commerce/model/omsReadModelRowCore.ts +193 -0
- package/src/commerce/model/omsReadModelRows.ts +7 -0
- package/src/commerce/offerAvailability.ts +75 -0
- package/src/commerce/offerAvailabilitySchemas.ts +56 -0
- package/src/commerce/offerEvidenceSchemas.ts +17 -0
- package/src/commerce/oms/omsContractBase.ts +92 -0
- package/src/commerce/oms/omsContractReadAuxSchemas.ts +130 -0
- package/src/commerce/oms/omsContractReadSchemas.ts +303 -0
- package/src/commerce/oms/omsContractRequests.ts +143 -0
- package/src/commerce/oms/omsContracts.ts +6 -0
- package/src/commerce/oms/omsControlPlane.ts +85 -0
- package/src/commerce/oms/omsFulfillmentContractSchemas.ts +113 -0
- package/src/commerce/oms/omsFulfillmentDebugSchemas.ts +38 -0
- package/src/commerce/oms/omsFulfillmentHealthSchemas.ts +46 -0
- package/src/commerce/oms/omsPorts.ts +165 -0
- package/src/commerce/oms/omsPrimitives.ts +3 -0
- package/src/commerce/oms/omsProviderEvidenceSchemas.ts +13 -0
- package/src/commerce/orderDraftErrors.ts +28 -0
- package/src/commerce/orderEmailEligibility.ts +131 -0
- package/src/commerce/orderEmailLines.ts +22 -0
- package/src/commerce/orderFeedbackContracts.ts +47 -0
- package/src/commerce/orderMoney.ts +207 -0
- package/src/commerce/orderReviewContracts.ts +124 -0
- package/src/commerce/orderReviewPorts.ts +94 -0
- package/src/commerce/outboxDispatchContracts.ts +30 -0
- package/src/commerce/outboxEventSchemas.ts +230 -0
- package/src/commerce/outboxOrderDraftEmailPorts.ts +241 -0
- package/src/commerce/paymentContinuation.ts +5 -0
- package/src/commerce/ports.ts +7 -0
- package/src/commerce/recoveryDestination.ts +23 -0
- package/src/commerce/runtimeErrors.ts +19 -0
- package/src/commerce/salesChannelEnvelope.ts +28 -0
- package/src/commerce/schemas.ts +104 -0
- package/src/commerce/server/checkoutCompensation.ts +49 -0
- package/src/commerce/server/checkoutConflictClassifiers.ts +53 -0
- package/src/commerce/server/checkoutExpiredRecoveryPolicy.ts +107 -0
- package/src/commerce/server/checkoutInvoiceBuyerSnapshot.ts +36 -0
- package/src/commerce/server/checkoutOfferPolicyPort.ts +60 -0
- package/src/commerce/server/checkoutPaymentContinuationCredential.ts +222 -0
- package/src/commerce/server/checkoutQuoteTypes.ts +9 -0
- package/src/commerce/server/checkoutRecoveryOrderPort.ts +40 -0
- package/src/commerce/server/checkoutRecoveryToken.ts +63 -0
- package/src/commerce/server/checkoutRefusalContinuation.ts +29 -0
- package/src/commerce/server/checkoutRuntimeTypes.ts +26 -0
- package/src/commerce/server/commerceCheckoutCommandExecution.ts +188 -0
- package/src/commerce/server/commerceCheckoutCompensation.ts +66 -0
- package/src/commerce/server/commerceCheckoutContinuationTerms.ts +87 -0
- package/src/commerce/server/commerceCheckoutCustomerDefaults.ts +24 -0
- package/src/commerce/server/commerceCheckoutFailureHandler.ts +144 -0
- package/src/commerce/server/commerceCheckoutHandler.ts +269 -0
- package/src/commerce/server/commerceCheckoutHandlerAdmission.ts +157 -0
- package/src/commerce/server/commerceCheckoutHandlerHelpers.ts +223 -0
- package/src/commerce/server/commerceCheckoutOrchestrationError.ts +15 -0
- package/src/commerce/server/commerceCheckoutPromotionPriceChange.ts +83 -0
- package/src/commerce/server/commerceCheckoutProviderPayment.ts +45 -0
- package/src/commerce/server/commerceCheckoutQuoteGuard.ts +172 -0
- package/src/commerce/server/commerceCheckoutResume.ts +132 -0
- package/src/commerce/server/commerceCheckoutResumeGuard.ts +195 -0
- package/src/commerce/server/commerceCheckoutSavedPaymentMethod.ts +85 -0
- package/src/commerce/server/commerceCheckoutStartRuntimeFailure.ts +59 -0
- package/src/commerce/server/commerceCheckoutTiming.ts +53 -0
- package/src/commerce/server/commerceDiagnostics.ts +37 -0
- package/src/commerce/server/commerceOmsCancelOrderHandler.ts +43 -0
- package/src/commerce/server/commerceOmsControlPlaneHandlers.ts +71 -0
- package/src/commerce/server/commerceOmsHandlers.ts +275 -0
- package/src/commerce/server/commerceOmsMarkRefundedHandler.ts +39 -0
- package/src/commerce/server/commerceOrderDraft.ts +131 -0
- package/src/commerce/server/commercePaidOrderOrchestration.ts +275 -0
- package/src/commerce/server/commerceProviderAttemptFailure.ts +257 -0
- package/src/commerce/server/commerceReturnsHandlers.ts +143 -0
- package/src/commerce/server/commerceRuntimePort.ts +75 -0
- package/src/commerce/server/commerceRuntimeService.ts +229 -0
- package/src/commerce/server/commerceRuntimeStartResponse.ts +76 -0
- package/src/commerce/server/commerceStarterOfferGuard.ts +200 -0
- package/src/commerce/server/configuratorIntentPersistence.ts +161 -0
- package/src/commerce/server/configuratorIntentPersistenceHandler.ts +54 -0
- package/src/commerce/server/emailRuntime.ts +30 -0
- package/src/commerce/server/handlerSupport.ts +22 -0
- package/src/commerce/server/index.ts +181 -0
- package/src/commerce/server/offerAvailability.ts +275 -0
- package/src/commerce/server/orderDraftRpcPayload.ts +39 -0
- package/src/commerce/server/orderFeedbackSubmit.ts +40 -0
- package/src/commerce/server/orderFeedbackTokenCheck.ts +28 -0
- package/src/commerce/server/orderReviewAdminHandlers.ts +43 -0
- package/src/commerce/server/orderReviewHandlers.ts +57 -0
- package/src/commerce/server/orderReviewLifecycle.ts +129 -0
- package/src/commerce/server/orderReviewMedia.ts +170 -0
- package/src/commerce/server/orderReviewRawUploadHandler.ts +300 -0
- package/src/commerce/server/outboxCheckoutExpiredEmailHandler.ts +86 -0
- package/src/commerce/server/outboxCheckoutRecoveryEmailHandler.ts +188 -0
- package/src/commerce/server/outboxDispatchRegistry.ts +269 -0
- package/src/commerce/server/outboxDispatchRegistryComposition.ts +31 -0
- package/src/commerce/server/outboxOrderDraftEmailHandler.ts +162 -0
- package/src/commerce/server/outboxOrderPaidEmailHandler.ts +147 -0
- package/src/commerce/server/outboxOrderPaidFulfillmentHandler.ts +4 -0
- package/src/commerce/server/outboxOrderPaidFulfillmentPorts.ts +3 -0
- package/src/commerce/server/outboxOrderRefundedEmailHandler.ts +58 -0
- package/src/commerce/server/outboxPaymentFailedEmailHandler.ts +99 -0
- package/src/commerce/server/outboxReturnEmailHandlers.ts +92 -0
- package/src/commerce/server/outboxShipmentDeliveredEmailHandler.ts +94 -0
- package/src/commerce/server/outboxShipmentDispatchedEmailHandler.ts +112 -0
- package/src/commerce/server/outboxShipmentExceptionEmailHandler.ts +73 -0
- package/src/commerce/server/referenceCheckoutHandler.ts +87 -0
- package/src/commerce/server/reservationSweepPort.ts +67 -0
- package/src/commerce/server/starterTermsPort.ts +22 -0
- package/src/commerce/server/supabaseCommerceReturnsPort.ts +81 -0
- package/src/composition/accountSupportContribution.ts +28 -0
- package/src/composition/commerceContribution.ts +35 -0
- package/src/composition/index.ts +2 -0
- package/src/fulfillment/index.ts +1 -1
- package/src/fulfillment/paidHandoff.ts +2 -2
- package/src/inventory/bindings.ts +12 -4
- package/src/inventory/index.ts +1 -0
- package/src/inventory/managedStockAvailability.ts +23 -0
- package/src/inventory/postgresStockAvailability.ts +2 -21
- package/src/inventory/stockReadResponse.ts +25 -0
- package/src/pricing/browser/index.ts +6 -0
- package/src/subscriptions/index.ts +3 -2
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/** Verified human administrator context, supplied by the host. */
|
|
2
|
+
export interface OperatorContext { operatorId: string; role: "admin"; isMachineActor: false; graph: "managed" | "native" }
|
|
3
|
+
/** Verbatim parsed customer-360 lookup vocabulary; defaults belong to the host codec. */
|
|
4
|
+
export interface Customer360Lookup {
|
|
5
|
+
query?: string; subjectId?: string; orderId?: string; subscriptionId?: string;
|
|
6
|
+
email?: string; pageSize: number; mode?: "search" | "snapshot";
|
|
7
|
+
}
|
|
8
|
+
/** The supplied search/snapshot DTOs preserve owner coverage and omitted enrichments. */
|
|
9
|
+
export interface Customer360ReadPort<Search, Snapshot> {
|
|
10
|
+
searchCustomerJourney(request: Customer360Lookup): Promise<Search>;
|
|
11
|
+
getCustomerJourney(request: Customer360Lookup): Promise<Snapshot | null>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type Customer360LifecycleStage = "lead" | "waitlist" | "tester" | "customer" | "inactive";
|
|
15
|
+
|
|
16
|
+
export interface Customer360Subject {
|
|
17
|
+
subjectId: string;
|
|
18
|
+
displayName: string | null;
|
|
19
|
+
email: string | null;
|
|
20
|
+
phone?: string | null;
|
|
21
|
+
lifecycleStage: Customer360LifecycleStage;
|
|
22
|
+
lifecycle: { stage: Customer360LifecycleStage; enteredAt: string | null; exitedAt: string | null }[];
|
|
23
|
+
firstSeenAt: string | null;
|
|
24
|
+
lastActivityAt: string | null;
|
|
25
|
+
authUserLinked?: boolean;
|
|
26
|
+
hasSignedIn?: boolean;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface Customer360Order {
|
|
30
|
+
orderId: string;
|
|
31
|
+
orderNumber: string | null;
|
|
32
|
+
status: string;
|
|
33
|
+
subscriptionId: string | null;
|
|
34
|
+
totalMinor: number | null;
|
|
35
|
+
currency: string | null;
|
|
36
|
+
createdAt: string | null
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface Customer360Subscription {
|
|
40
|
+
subscriptionId: string;
|
|
41
|
+
status: string;
|
|
42
|
+
nextCycleAt: string | null;
|
|
43
|
+
latestOrderId: string | null;
|
|
44
|
+
templateVersion?: number;
|
|
45
|
+
shippingAddressId?: string | null;
|
|
46
|
+
paymentMethodKind?: string | null;
|
|
47
|
+
paymentMethodStatus?: string | null
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface Customer360PaymentTruth {
|
|
51
|
+
orderId: string;
|
|
52
|
+
status: string;
|
|
53
|
+
recoverable: boolean;
|
|
54
|
+
amountMinor: number | null;
|
|
55
|
+
currency: string | null;
|
|
56
|
+
lastAttemptAt: string | null
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface Customer360DunningCase {
|
|
60
|
+
caseId: string;
|
|
61
|
+
subscriptionId: string;
|
|
62
|
+
orderId: string | null;
|
|
63
|
+
status: string;
|
|
64
|
+
retryAttempt: number;
|
|
65
|
+
nextRetryAt: string | null;
|
|
66
|
+
notificationStatus: string | null;
|
|
67
|
+
recoveryAvailable: boolean
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface Customer360Recovery {
|
|
71
|
+
caseId: string;
|
|
72
|
+
status: "available" | "unavailable";
|
|
73
|
+
actionAvailable: boolean;
|
|
74
|
+
lastIssuedAt: string | null;
|
|
75
|
+
lastDeliveryStatus: string | null
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface Customer360ContactHealth {
|
|
79
|
+
lastTerminalStatus: "delivered" | "bounced" | "complained" | "failed" | null;
|
|
80
|
+
lastTerminalAt: string | null;
|
|
81
|
+
reachable: boolean
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface Customer360Address {
|
|
85
|
+
addressId: string;
|
|
86
|
+
label: string | null;
|
|
87
|
+
recipientName: string | null;
|
|
88
|
+
line1: string;
|
|
89
|
+
line2: string | null;
|
|
90
|
+
postalCode: string;
|
|
91
|
+
city: string;
|
|
92
|
+
country: string;
|
|
93
|
+
contactPhone: string | null;
|
|
94
|
+
isDefault: boolean;
|
|
95
|
+
kind: "shipping" | "both"
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface Customer360AuditEvent {
|
|
99
|
+
eventId: string;
|
|
100
|
+
occurredAt: string;
|
|
101
|
+
action: string;
|
|
102
|
+
outcome: string;
|
|
103
|
+
entity: { kind: "subject" | "order" | "subscription" | "dunning_case" | "recovery"; id: string }
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface Customer360LookupResult {
|
|
107
|
+
query: string;
|
|
108
|
+
matchedBy: "subject_id" | "email" | "order_id" | "order_number" | "subscription_id" | "text";
|
|
109
|
+
confidence: "exact" | "high" | "medium";
|
|
110
|
+
warnings: string[]
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export interface Customer360SearchResponse {
|
|
114
|
+
contractVersion: "support.customer_360.v2";
|
|
115
|
+
query: string;
|
|
116
|
+
candidates: {
|
|
117
|
+
subjectId: string;
|
|
118
|
+
displayName: string | null;
|
|
119
|
+
email: string | null;
|
|
120
|
+
lifecycleStage: Customer360LifecycleStage;
|
|
121
|
+
matchedBy: Customer360LookupResult["matchedBy"];
|
|
122
|
+
confidence: Customer360LookupResult["confidence"];
|
|
123
|
+
lastActivityAt: string | null;
|
|
124
|
+
snapshotLookup: { subjectId: string }
|
|
125
|
+
}[];
|
|
126
|
+
warnings: string[];
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export interface Customer360Snapshot<Extension = unknown> {
|
|
130
|
+
contractVersion: "support.customer_360.v2";
|
|
131
|
+
lookup: Customer360LookupResult;
|
|
132
|
+
subject: Customer360Subject;
|
|
133
|
+
orders: Customer360Order[];
|
|
134
|
+
subscriptions: Customer360Subscription[];
|
|
135
|
+
payment: Customer360PaymentTruth[];
|
|
136
|
+
dunningCases: Customer360DunningCase[];
|
|
137
|
+
recovery: Customer360Recovery[];
|
|
138
|
+
auditTrail: Customer360AuditEvent[];
|
|
139
|
+
contactHealth?: Customer360ContactHealth;
|
|
140
|
+
addresses?: Customer360Address[];
|
|
141
|
+
extension?: Extension;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export interface Customer360SummaryReadPort<Request, Result> {
|
|
145
|
+
getPortableSummary(request: Request): Promise<Result>
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export interface DiagnosticHistoryReadPort<Request, Result> {
|
|
149
|
+
history(request: Request): Promise<Result>
|
|
150
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
export type {
|
|
2
|
+
CustomerContext,
|
|
3
|
+
AccountReadRefusal,
|
|
4
|
+
AccountReadPort,
|
|
5
|
+
AccountProfile,
|
|
6
|
+
AccountAddress,
|
|
7
|
+
AccountBillingProfile,
|
|
8
|
+
AccountPaymentPreference,
|
|
9
|
+
AccountPickupPoint,
|
|
10
|
+
AccountDeliverySelection,
|
|
11
|
+
AccountDeliveryPreference,
|
|
12
|
+
AccountEvent,
|
|
13
|
+
AccountSubscriptionLine,
|
|
14
|
+
AccountSubscription,
|
|
15
|
+
AccountTrackingReference,
|
|
16
|
+
AccountTrackingEvent,
|
|
17
|
+
AccountInvoiceSummary,
|
|
18
|
+
AccountInvoiceDocument,
|
|
19
|
+
AccountOrderSummary,
|
|
20
|
+
AccountOrderLine,
|
|
21
|
+
AccountFulfillmentSummary,
|
|
22
|
+
AccountOrderDetail,
|
|
23
|
+
AccountOrderList,
|
|
24
|
+
AccountOrderDetailResponse,
|
|
25
|
+
AccountActionRequired,
|
|
26
|
+
AccountActionMessage,
|
|
27
|
+
AccountSnapshot
|
|
28
|
+
} from "./account.js";
|
|
29
|
+
export type {
|
|
30
|
+
OperatorContext,
|
|
31
|
+
Customer360Lookup,
|
|
32
|
+
Customer360ReadPort,
|
|
33
|
+
Customer360LifecycleStage,
|
|
34
|
+
Customer360Subject,
|
|
35
|
+
Customer360Order,
|
|
36
|
+
Customer360Subscription,
|
|
37
|
+
Customer360PaymentTruth,
|
|
38
|
+
Customer360DunningCase,
|
|
39
|
+
Customer360Recovery,
|
|
40
|
+
Customer360ContactHealth,
|
|
41
|
+
Customer360Address,
|
|
42
|
+
Customer360AuditEvent,
|
|
43
|
+
Customer360LookupResult,
|
|
44
|
+
Customer360SearchResponse,
|
|
45
|
+
Customer360Snapshot,
|
|
46
|
+
Customer360SummaryReadPort,
|
|
47
|
+
DiagnosticHistoryReadPort
|
|
48
|
+
} from "./customer360.js";
|
|
49
|
+
export type {
|
|
50
|
+
SubscriptionCommandContext,
|
|
51
|
+
SubscriptionCommand,
|
|
52
|
+
SubscriptionBundleLine,
|
|
53
|
+
SubscriptionCommandReceipt,
|
|
54
|
+
SubscriptionCommandRefusal,
|
|
55
|
+
SubscriptionUnsupportedCode,
|
|
56
|
+
SubscriptionUnsupported,
|
|
57
|
+
SubscriptionCapabilities,
|
|
58
|
+
NativeSubscriptionCommand,
|
|
59
|
+
SelfServiceCommandFacade,
|
|
60
|
+
AccountSupportMoney,
|
|
61
|
+
SubscriptionPaymentMethodStatus,
|
|
62
|
+
SubscriptionRenewalBlockStatus,
|
|
63
|
+
EligibilityRefusal,
|
|
64
|
+
LegacySubscriptionPreviewResponse
|
|
65
|
+
} from "./commands.js";
|
|
66
|
+
export type {
|
|
67
|
+
OperatorSubscriptionAction,
|
|
68
|
+
OperatorNewShippingAddress,
|
|
69
|
+
OperatorShippingAddressPayload,
|
|
70
|
+
OperatorSubscriptionPayload,
|
|
71
|
+
OperatorSubscriptionRefusal,
|
|
72
|
+
RecoveryRefusal,
|
|
73
|
+
EmailCorrectionRefusal,
|
|
74
|
+
PhoneCorrectionRefusal,
|
|
75
|
+
LeadRefusal,
|
|
76
|
+
OperatorContactCommand,
|
|
77
|
+
OperatorLeadCommand,
|
|
78
|
+
OperatorRecoveryCommand,
|
|
79
|
+
OperatorRecoveryCommandEnvelope,
|
|
80
|
+
OperatorSubscriptionResult
|
|
81
|
+
} from "./operator.js";
|
|
82
|
+
export type {
|
|
83
|
+
InvoiceDocumentIdentity,
|
|
84
|
+
InvoiceUnsupported,
|
|
85
|
+
InvoiceClearanceState,
|
|
86
|
+
InvoiceAccessPort,
|
|
87
|
+
CustomerDocumentDeliveryStatus,
|
|
88
|
+
CustomerInvoiceDocumentRole,
|
|
89
|
+
CustomerInvoiceDownloadArtifact,
|
|
90
|
+
CustomerInvoiceDownloadRequest,
|
|
91
|
+
AccountInvoiceHistoryResult,
|
|
92
|
+
AccountInvoiceHistoryDocument
|
|
93
|
+
} from "./invoice.js";
|
|
94
|
+
export type { AccountSupportCapability, AccountSupportCapabilities } from "./capabilities.js";
|
|
95
|
+
export type {
|
|
96
|
+
LegacySubscriptionRequest,
|
|
97
|
+
RawSubscriptionCommands,
|
|
98
|
+
NativeSubscriptionPreview,
|
|
99
|
+
NativePreviewProjection,
|
|
100
|
+
SubscriptionDriver,
|
|
101
|
+
MethodSetupInput,
|
|
102
|
+
MethodSetupResult,
|
|
103
|
+
MethodSetupPort,
|
|
104
|
+
NativeLegacySubscriptionParts,
|
|
105
|
+
LegacySubscriptionPort,
|
|
106
|
+
SelfServiceCommandFacadeInput
|
|
107
|
+
} from "./commands.js";
|
|
108
|
+
export type { AccountSupportLaneUnavailable } from "./capabilities.js";
|
|
109
|
+
// R4's additive native result and graph-specific authority ports.
|
|
110
|
+
export type {
|
|
111
|
+
OperatorOwnerReceipt,
|
|
112
|
+
NativeOperatorSubscriptionResult,
|
|
113
|
+
OperatorAuthorityUnavailable,
|
|
114
|
+
OperatorEmailCorrectionResult,
|
|
115
|
+
OperatorPhoneCorrectionResult,
|
|
116
|
+
CustomerRecoveryAuthorityResult,
|
|
117
|
+
LeadAbsorptionCarried,
|
|
118
|
+
OperatorLeadAbsorptionResult,
|
|
119
|
+
OperatorEmailCorrectionClaim,
|
|
120
|
+
OperatorIdentityMovePort,
|
|
121
|
+
OperatorEmailCorrectionAdmission,
|
|
122
|
+
OperatorEmailCorrectionPhase,
|
|
123
|
+
OperatorEmailCorrectionSettlement,
|
|
124
|
+
OperatorEmailCorrectionExecution,
|
|
125
|
+
OperatorAccountLinkRefusal,
|
|
126
|
+
OperatorAccountLinkResult,
|
|
127
|
+
OperatorAccountLinkRequest,
|
|
128
|
+
OperatorAccountLinkIdentityPort,
|
|
129
|
+
OperatorSubscriptionInput,
|
|
130
|
+
OperatorEmailInput,
|
|
131
|
+
OperatorPhoneInput,
|
|
132
|
+
OperatorLinkInput,
|
|
133
|
+
OperatorRecoveryInput,
|
|
134
|
+
OperatorAbsorptionInput,
|
|
135
|
+
ManagedOperatorAuthorityPort,
|
|
136
|
+
NativeOperatorAuthorityPort,
|
|
137
|
+
LinkThenSubscriptionResult
|
|
138
|
+
} from "./operator.js";
|
|
139
|
+
export type {
|
|
140
|
+
OperatorAuthorityCapabilities
|
|
141
|
+
} from "./capabilities.js";
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/** Exact browser-safe transcriptions of M09 account-history inputs and outcomes. */
|
|
2
|
+
export interface InvoiceDocumentIdentity {
|
|
3
|
+
readonly providerRef: string;
|
|
4
|
+
readonly documentRef: string;
|
|
5
|
+
readonly providerDocumentRef: string | null;
|
|
6
|
+
readonly orderRef: string;
|
|
7
|
+
readonly invoiceRef: string;
|
|
8
|
+
readonly parentProviderDocumentRef: string | null;
|
|
9
|
+
}
|
|
10
|
+
export interface InvoiceUnsupported {
|
|
11
|
+
readonly kind: "unsupported";
|
|
12
|
+
readonly code: "host_binding_required" | "unsupported";
|
|
13
|
+
readonly retryable: false;
|
|
14
|
+
readonly effectMayHaveSucceeded: false;
|
|
15
|
+
}
|
|
16
|
+
export type InvoiceClearanceState = "accepted" | "not_submitted" | "pending" | "rejected" | "not_required" | "unsupported";
|
|
17
|
+
export type InvoiceAccessPort = {
|
|
18
|
+
read(input: { readonly accountRef: string; readonly orderId: string }): Promise<
|
|
19
|
+
| { readonly kind: "found"; readonly accountRef: string; readonly orderId: string; readonly documents: readonly { readonly documentRef: string; readonly invoiceRef: string; readonly parentDocumentRef: string | null; readonly role: "original" | "correction" | "replacement"; readonly status: string; readonly issuedAt: string | null; readonly clearance: { readonly state: InvoiceClearanceState; readonly reference: string | null } | null; readonly documentKind: string | null; readonly artifact: "invoice" | "correction"; readonly providerDocumentNumber: string | null; readonly totalGrossMinor: number | null; readonly currency: string; readonly emailState: "not_requested" | "pending" | "provider_accepted" | "failed"; readonly isCurrent: boolean; readonly createdAt: string; readonly downloadAvailable: boolean }[] }
|
|
20
|
+
| { readonly kind: "denied" }
|
|
21
|
+
| { readonly kind: "unknown"; readonly code: "unknown" }
|
|
22
|
+
| InvoiceUnsupported
|
|
23
|
+
>;
|
|
24
|
+
resolveDownload(input: { readonly accountRef: string; readonly orderId: string; readonly documentRef: string }): Promise<{ readonly kind: "authorized"; readonly identity: InvoiceDocumentIdentity; readonly artifactRef: string; readonly fileName: string; readonly parentDocumentRef: string | null } | { readonly kind: "denied" } | { readonly kind: "unknown"; readonly code: "unknown" } | InvoiceUnsupported>;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type CustomerDocumentDeliveryStatus = "not_ready"
|
|
28
|
+
| "pdf_ready"
|
|
29
|
+
| "ksef_pending"
|
|
30
|
+
| "email_pending"
|
|
31
|
+
| "email_provider_accepted"
|
|
32
|
+
| "email_sent"
|
|
33
|
+
| "requires_correction"
|
|
34
|
+
| "delivery_failed";
|
|
35
|
+
export type CustomerInvoiceDocumentRole = "original" | "correction" | "replacement";
|
|
36
|
+
export type CustomerInvoiceDownloadArtifact = "invoice" | "correction";
|
|
37
|
+
|
|
38
|
+
export interface CustomerInvoiceDownloadRequest {
|
|
39
|
+
invoiceId: string;
|
|
40
|
+
artifact: CustomerInvoiceDownloadArtifact
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type AccountInvoiceHistoryResult = Awaited<ReturnType<InvoiceAccessPort["read"]>>;
|
|
44
|
+
export type AccountInvoiceHistoryDocument = Extract<AccountInvoiceHistoryResult, { kind: "found" }>["documents"][number];
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import type { OperatorContext } from "./customer360.js";
|
|
2
|
+
export type OperatorSubscriptionAction = "pause" | "resume" | "slide_next_cycle" | "change_shipping_address";
|
|
3
|
+
export interface OperatorNewShippingAddress {
|
|
4
|
+
recipientName: string; line1: string; line2?: string; postalCode: string;
|
|
5
|
+
city: string; country: string; contactPhone?: string;
|
|
6
|
+
}
|
|
7
|
+
export type OperatorShippingAddressPayload = { shippingAddressId: string; reason?: string }
|
|
8
|
+
| { newAddress: OperatorNewShippingAddress; reason?: string };
|
|
9
|
+
export type OperatorSubscriptionPayload = {
|
|
10
|
+
pausePreset?: "2_weeks" | "1_month" | "indefinite"; reason?: string;
|
|
11
|
+
newNextCycleAt?: string; slideMinDays?: number; confirmedChargeTiming?: boolean;
|
|
12
|
+
} | OperatorShippingAddressPayload;
|
|
13
|
+
export type OperatorSubscriptionRefusal = "subscription_not_found" | "subject_not_found"
|
|
14
|
+
| "subject_account_unlinked" | "version_conflict" | "slide_target_invalid" | "slide_not_available"
|
|
15
|
+
| "slide_out_of_window" | "payment_blocked" | "invalid_transition" | "charge_timing_not_confirmed"
|
|
16
|
+
| "payment_method_not_chargeable" | "invalid_address";
|
|
17
|
+
export type RecoveryRefusal = "subject_not_found" | "case_not_found" | "lifecycle_not_eligible"
|
|
18
|
+
| "dunning_authority_unavailable" | "case_not_open" | "recoverable_order_unavailable";
|
|
19
|
+
export type EmailCorrectionRefusal = "subject_not_found" | "subject_account_linked" | "email_expectation_conflict" | "email_already_in_use";
|
|
20
|
+
export type PhoneCorrectionRefusal = "subject_not_found" | "phone_expectation_conflict";
|
|
21
|
+
export type LeadRefusal = "lead_not_found" | "customer_not_found" | "lead_email_expectation_conflict"
|
|
22
|
+
| "lead_has_identity" | "lead_has_commercial_footprint" | "unclassified_referencing_table";
|
|
23
|
+
export type OperatorContactCommand =
|
|
24
|
+
| { action: "correct_email"; subjectId: string; expectedEmail: string; newEmail: string; idempotencyKey: string }
|
|
25
|
+
| { action: "correct_phone"; subjectId: string; expectedPhone: string; newPhone: string; idempotencyKey: string };
|
|
26
|
+
export interface OperatorLeadCommand { action: "absorb_lead"; subjectId: string; leadId: string; expectedLeadEmail: string; idempotencyKey: string }
|
|
27
|
+
export type OperatorRecoveryCommand =
|
|
28
|
+
| { action: "issue_recovery"; subjectId: string; caseId: string; idempotencyKey: string }
|
|
29
|
+
| { action: "apply_subscription_action"; subscriptionId: string; subscriptionAction: OperatorSubscriptionAction;
|
|
30
|
+
expectedVersion: number; idempotencyKey: string; payload?: OperatorSubscriptionPayload }
|
|
31
|
+
| OperatorContactCommand | OperatorLeadCommand;
|
|
32
|
+
/** Carries trusted context and the original command; performs no authorization or writes.
|
|
33
|
+
* The host preserves the command key, optional reason and expected version.
|
|
34
|
+
*/
|
|
35
|
+
export interface OperatorRecoveryCommandEnvelope<Command = OperatorRecoveryCommand> {
|
|
36
|
+
actor: OperatorContext;
|
|
37
|
+
subject: { subjectId: string; subscriptionId?: string; orderId?: string; caseId?: string };
|
|
38
|
+
command: Command; reason: string | null; idempotencyKey: string; expectedVersion: number | null;
|
|
39
|
+
evidence: readonly { owner: string; resourceId: string; revision: string | null }[];
|
|
40
|
+
}
|
|
41
|
+
export type OperatorSubscriptionResult =
|
|
42
|
+
| { outcome: "applied" | "noop" | "replayed"; subscriptionStatus: string; nextCycleAt: string | null;
|
|
43
|
+
templateVersion: number; eventId: string | null; appliedBy: "operator_reschedule_band" | "customer_self_service_delegate" | null }
|
|
44
|
+
| { outcome: "refused" | "conflict"; refusalCode: OperatorSubscriptionRefusal };
|
|
45
|
+
|
|
46
|
+
/** Actual M10 receipt evidence; support never manufactures an audit identifier. */
|
|
47
|
+
export interface OperatorOwnerReceipt {
|
|
48
|
+
id: string; actorId: string; idempotencyKey: string; commandFingerprint: string;
|
|
49
|
+
result: Record<string, unknown>;
|
|
50
|
+
}
|
|
51
|
+
/** Additive native superset. The managed transcription above remains unchanged. */
|
|
52
|
+
export type NativeOperatorSubscriptionResult =
|
|
53
|
+
| (OperatorSubscriptionResult & { ownerReceipt?: OperatorOwnerReceipt })
|
|
54
|
+
| { outcome: "refused"; refusalCode: "operator_subscription_authority_unavailable"; ownerReceipt?: OperatorOwnerReceipt };
|
|
55
|
+
export type OperatorAuthorityUnavailable = { outcome: "refused"; refusalCode: "operator_subscription_authority_unavailable" };
|
|
56
|
+
export type OperatorEmailCorrectionResult =
|
|
57
|
+
| { outcome: "applied" | "noop" | "replayed"; authUserLinked: boolean }
|
|
58
|
+
| { outcome: "refused" | "conflict"; refusalCode: EmailCorrectionRefusal };
|
|
59
|
+
export type OperatorPhoneCorrectionResult = { outcome: "applied" | "noop" | "replayed" }
|
|
60
|
+
| { outcome: "refused" | "conflict"; refusalCode: PhoneCorrectionRefusal };
|
|
61
|
+
export type CustomerRecoveryAuthorityResult =
|
|
62
|
+
| { outcome: "issued"; deliveryStatus: string; auditEventId: string }
|
|
63
|
+
| { outcome: "replayed"; deliveryStatus: string; auditEventId: string }
|
|
64
|
+
| { outcome: "refused"; refusalCode: RecoveryRefusal }
|
|
65
|
+
| { outcome: "conflict"; conflictCode: "idempotency_conflict" };
|
|
66
|
+
export interface LeadAbsorptionCarried { personalization: number; consents: number; sourceLinks: number; deliveries: number }
|
|
67
|
+
export type OperatorLeadAbsorptionResult =
|
|
68
|
+
| { outcome: "applied" | "noop" | "replayed"; leadId: string; customerId: string; carried: LeadAbsorptionCarried }
|
|
69
|
+
| { outcome: "refused" | "conflict"; leadId: string; refusalCode: LeadRefusal; blockingTables: string[] };
|
|
70
|
+
export interface OperatorEmailCorrectionClaim { idempotencyKey: string; claimToken: string; sequence: string }
|
|
71
|
+
export interface OperatorIdentityMovePort {
|
|
72
|
+
findClientHoldingEmail(email: string): Promise<{ clientId: string } | null>;
|
|
73
|
+
readIdentityEmail(authUserId: string): Promise<string>;
|
|
74
|
+
moveIdentityEmail(authUserId: string, email: string, claim: OperatorEmailCorrectionClaim): Promise<void>;
|
|
75
|
+
}
|
|
76
|
+
export type OperatorEmailCorrectionAdmission = OperatorEmailCorrectionResult | {
|
|
77
|
+
outcome: "admitted"; authUserId: string | null; originalEmail: string; newEmail: string;
|
|
78
|
+
};
|
|
79
|
+
export type OperatorEmailCorrectionPhase = "complete" | "release" | "fail";
|
|
80
|
+
export type OperatorEmailCorrectionSettlement = OperatorEmailCorrectionResult | { outcome: "pending" } | { outcome: "failed" };
|
|
81
|
+
export type OperatorEmailCorrectionExecution = OperatorEmailCorrectionSettlement | (OperatorEmailCorrectionClaim & {
|
|
82
|
+
outcome: "claimed"; authUserId: string | null; originalEmail: string; newEmail: string;
|
|
83
|
+
});
|
|
84
|
+
export type OperatorAccountLinkRefusal = "subject_not_found" | "subject_not_customer" | "subject_email_missing"
|
|
85
|
+
| "email_expectation_conflict" | "subject_account_linked" | "identity_not_linkable" | "identity_linked_elsewhere";
|
|
86
|
+
export type OperatorAccountLinkResult = { outcome: "applied" | "noop" | "replayed" }
|
|
87
|
+
| { outcome: "refused" | "conflict"; refusalCode: OperatorAccountLinkRefusal };
|
|
88
|
+
export interface OperatorAccountLinkRequest { action: "link_account"; subjectId: string; expectedEmail: string; idempotencyKey: string }
|
|
89
|
+
export interface OperatorAccountLinkIdentityPort {
|
|
90
|
+
findSubject(clientId: string): Promise<{ identityKind: string | null; email: string | null; authUserId: string | null } | null>;
|
|
91
|
+
resolveIdentityForEmail(email: string): Promise<string>;
|
|
92
|
+
}
|
|
93
|
+
export interface OperatorSubscriptionInput {
|
|
94
|
+
subscriptionId: string; subscriptionAction: OperatorSubscriptionAction; expectedVersion: number;
|
|
95
|
+
payload: OperatorSubscriptionPayload; idempotencyKey: string; operatorId: string;
|
|
96
|
+
}
|
|
97
|
+
export interface OperatorEmailInput { subjectId: string; expectedEmail: string; newEmail: string; idempotencyKey: string; operatorId: string }
|
|
98
|
+
export interface OperatorPhoneInput { subjectId: string; expectedPhone: string; newPhone: string; idempotencyKey: string; operatorId: string }
|
|
99
|
+
export interface OperatorLinkInput { subjectId: string; expectedEmail: string; authUserId: string | null; idempotencyKey: string; operatorId: string }
|
|
100
|
+
export interface OperatorRecoveryInput { subjectId: string; caseId: string; idempotencyKey: string; operatorId: string }
|
|
101
|
+
export interface OperatorAbsorptionInput { customerId: string; leadId: string; expectedLeadEmail: string; idempotencyKey: string; operatorId: string }
|
|
102
|
+
export interface ManagedOperatorAuthorityPort {
|
|
103
|
+
applySubscriptionAction(input: OperatorSubscriptionInput): Promise<OperatorSubscriptionResult>;
|
|
104
|
+
correctSubjectEmail(input: OperatorEmailInput): Promise<OperatorEmailCorrectionAdmission>;
|
|
105
|
+
claimSubjectEmail(input: { idempotencyKey: string }): Promise<OperatorEmailCorrectionExecution>;
|
|
106
|
+
settleSubjectEmail(input: { idempotencyKey: string; claimToken: string; phase: OperatorEmailCorrectionPhase }): Promise<OperatorEmailCorrectionSettlement>;
|
|
107
|
+
correctSubjectPhone(input: OperatorPhoneInput): Promise<OperatorPhoneCorrectionResult>;
|
|
108
|
+
linkSubjectAccount(input: OperatorLinkInput): Promise<OperatorAccountLinkResult>;
|
|
109
|
+
issueRecovery(input: OperatorRecoveryInput): Promise<CustomerRecoveryAuthorityResult>;
|
|
110
|
+
absorbLead(input: OperatorAbsorptionInput): Promise<OperatorLeadAbsorptionResult>;
|
|
111
|
+
}
|
|
112
|
+
export interface NativeOperatorAuthorityPort {
|
|
113
|
+
applySubscriptionAction(input: OperatorSubscriptionInput): Promise<NativeOperatorSubscriptionResult>;
|
|
114
|
+
correctSubjectEmail(input: OperatorEmailInput): Promise<OperatorAuthorityUnavailable>;
|
|
115
|
+
correctSubjectPhone(input: OperatorPhoneInput): Promise<OperatorAuthorityUnavailable>;
|
|
116
|
+
linkSubjectAccount(input: OperatorLinkInput): Promise<OperatorAuthorityUnavailable>;
|
|
117
|
+
issueRecovery(input: OperatorRecoveryInput): Promise<CustomerRecoveryAuthorityResult>;
|
|
118
|
+
absorbLead(input: OperatorAbsorptionInput): Promise<OperatorLeadAbsorptionResult>;
|
|
119
|
+
}
|
|
120
|
+
export type LinkThenSubscriptionResult =
|
|
121
|
+
| { outcome: "link_refused"; link: OperatorAccountLinkResult | OperatorAuthorityUnavailable }
|
|
122
|
+
| { outcome: "completed"; link: OperatorAccountLinkResult; subscription: NativeOperatorSubscriptionResult }
|
|
123
|
+
| { outcome: "partial"; link: OperatorAccountLinkResult; subscription: NativeOperatorSubscriptionResult | null };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { AccountSupportCapabilities } from "./contracts/index.js";
|
|
2
|
+
import type { AccountSupportCallable, AccountSupportOperations } from "./bindings.js";
|
|
3
|
+
|
|
4
|
+
export type AccountSupportBindingRefusal = { readonly kind: "refused"; readonly code: "disabled" | "schema_unknown" | "schema_unsatisfied" };
|
|
5
|
+
export type AccountSupportReadiness = { readonly kind: "ready" } | AccountSupportBindingRefusal;
|
|
6
|
+
export type GuardedAccountSupportOperation<F> = F extends AccountSupportCallable
|
|
7
|
+
? (...args: Parameters<F>) => Promise<Awaited<ReturnType<F>> | AccountSupportBindingRefusal> : null;
|
|
8
|
+
export type GuardedAccountSupportOperations<O extends AccountSupportOperations> = { readonly [K in keyof O]: GuardedAccountSupportOperation<O[K]> };
|
|
9
|
+
|
|
10
|
+
/** One guard per callable identity, shared by service, port and route aliases. */
|
|
11
|
+
export function createAccountSupportServices<O extends AccountSupportOperations>(input: {
|
|
12
|
+
enabled?: boolean;
|
|
13
|
+
capabilities: AccountSupportCapabilities;
|
|
14
|
+
operations: O;
|
|
15
|
+
readiness(): Promise<AccountSupportReadiness>;
|
|
16
|
+
}) {
|
|
17
|
+
const enabled = input.enabled === true, observe = input.readiness;
|
|
18
|
+
async function readiness(): Promise<AccountSupportReadiness> {
|
|
19
|
+
return enabled ? observe() : { kind: "refused", code: "disabled" };
|
|
20
|
+
}
|
|
21
|
+
const guards = new Map<AccountSupportCallable, AccountSupportCallable>();
|
|
22
|
+
const operations = Object.fromEntries(Object.entries(input.operations).map(([key, operation]) => {
|
|
23
|
+
if (operation === null) return [key, null];
|
|
24
|
+
let guarded = guards.get(operation);
|
|
25
|
+
if (!guarded) {
|
|
26
|
+
guarded = async (...args: never[]) => {
|
|
27
|
+
const state = await readiness();
|
|
28
|
+
return state.kind === "ready" ? operation(...args) : state;
|
|
29
|
+
};
|
|
30
|
+
guards.set(operation, guarded);
|
|
31
|
+
}
|
|
32
|
+
return [key, guarded];
|
|
33
|
+
})) as GuardedAccountSupportOperations<O>;
|
|
34
|
+
return Object.freeze({ capabilities: input.capabilities, readiness, operations: Object.freeze(operations) });
|
|
35
|
+
}
|