@everfur/sdk 0.12.0 → 0.13.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 +174 -0
- package/README.md +2 -1
- package/dist/{Chat-BOG0SXKV.d.cts → Chat.d-DUNTfzqC.d.ts} +170 -8
- package/dist/{Chat-CIolBgjJ.d.ts → Chat.d-Dts8u_1a.d.cts} +170 -8
- package/dist/{DepthViews-BR6VQ3Ta.d.cts → DepthViews.d-BIp599lz.d.cts} +1 -1
- package/dist/{DepthViews-280t3BcQ.d.ts → DepthViews.d-BMU2jFPw.d.cts} +1 -1
- package/dist/{DepthViews-DlBuFsgN.d.ts → DepthViews.d-Ce2Zhnrb.d.ts} +1 -1
- package/dist/{DepthViews-BTbF_DJY.d.cts → DepthViews.d-CubkMPbU.d.ts} +1 -1
- package/dist/{ErrorPolicyPort-10s3HJCt.d.cts → ErrorPolicyPort.d-68yrE3BE.d.ts} +1 -1
- package/dist/{ErrorPolicyPort-C3nNSS_j.d.ts → ErrorPolicyPort.d-DirW9hgO.d.cts} +1 -1
- package/dist/{EverfurError-DeBqRpQV.d.cts → EverfurError.d-8NHtlgzA.d.cts} +11 -1
- package/dist/{EverfurError-DeBqRpQV.d.ts → EverfurError.d-8NHtlgzA.d.ts} +11 -1
- package/dist/{EverfurResult-ClPTS0P2.d.ts → EverfurResult.d-BFH-3s6E.d.cts} +1 -1
- package/dist/{EverfurResult-COlXj1wq.d.cts → EverfurResult.d-D_-254ZY.d.ts} +1 -1
- package/dist/{IntakeMedia-BH0fYDT2.d.cts → IntakeMedia.d-4a89XrP7.d.ts} +1 -1
- package/dist/{IntakeMedia-B-_vA9ZB.d.cts → IntakeMedia.d-DGxrhgIW.d.ts} +1 -1
- package/dist/{IntakeMedia-CIoTXAWs.d.ts → IntakeMedia.d-DUPR4lVM.d.cts} +1 -1
- package/dist/{IntakeMedia-Bavl7E4Z.d.ts → IntakeMedia.d-JJCUvQu7.d.cts} +1 -1
- package/dist/LifecyclePort.d-Cr1p33a7.d.cts +23 -0
- package/dist/LifecyclePort.d-Cr1p33a7.d.ts +23 -0
- package/dist/{PhotoController-vzY5bfY_.d.ts → PhotoController.d-BzCJOE7e.d.cts} +2 -2
- package/dist/{PhotoController-3l7MT9jA.d.cts → PhotoController.d-D0XiUUOl.d.ts} +2 -2
- package/dist/animations/index.cjs +5 -1
- package/dist/animations/index.d.cts +24 -24
- package/dist/animations/index.d.ts +24 -24
- package/dist/animations/index.js +5 -1
- package/dist/{attachments-CGxvnYu4.d.ts → attachments.d-Bp2qbHxn.d.cts} +22 -26
- package/dist/{attachments-CWNj1ZkM.d.ts → attachments.d-D1yhJjcZ.d.ts} +4 -4
- package/dist/{attachments-waXcJWCp.d.cts → attachments.d-DisnvB9R.d.cts} +4 -4
- package/dist/{attachments-B6h4cJU-.d.cts → attachments.d-Djy9z_0Z.d.ts} +22 -26
- package/dist/{bookingCopy-CjPKeg75.d.ts → bookingCopy.d-BJF6gd1A.d.ts} +24 -9
- package/dist/{bookingCopy-8aEU6ZmR.d.cts → bookingCopy.d-BlBmhAJc.d.cts} +24 -9
- package/dist/{branding-DJf4h12Q.d.ts → branding.d-DI8S400y.d.cts} +9 -2
- package/dist/{branding-BCfwLj0h.d.cts → branding.d-OIGLbQeM.d.ts} +9 -2
- package/dist/{callRoom-BhIdadyV.d.cts → callRoom.d-B1DoYdJe.d.cts} +1 -1
- package/dist/{callRoom-B92eH_ij.d.ts → callRoom.d-Dqm1rUqT.d.ts} +1 -1
- package/dist/{casesRepository-CGdhvzTu.d.cts → casesRepository.d-CT2LTicS.d.cts} +3 -3
- package/dist/{casesRepository-ZG9Sg0e4.d.ts → casesRepository.d-UsWOz9bv.d.ts} +3 -3
- package/dist/chat/index.cjs +132 -57
- package/dist/chat/index.d.cts +18 -16
- package/dist/chat/index.d.ts +18 -16
- package/dist/chat/index.js +133 -58
- package/dist/client/index.cjs +15 -10
- package/dist/client/index.d.cts +19 -18
- package/dist/client/index.d.ts +19 -18
- package/dist/client/index.js +15 -10
- package/dist/{config-B0p6Lygh.d.cts → config.d-BR3DT9ho.d.cts} +3 -3
- package/dist/{config-DmFAZJOx.d.ts → config.d-Dy6igYlH.d.ts} +3 -3
- package/dist/consent/index.cjs +5 -1
- package/dist/consent/index.d.cts +10 -10
- package/dist/consent/index.d.ts +10 -10
- package/dist/consent/index.js +5 -1
- package/dist/{context-BNreNLtL.d.ts → context.d-Cwks0p3C.d.cts} +15 -15
- package/dist/{context-BgS2a57J.d.cts → context.d-QcCgguzA.d.ts} +15 -15
- package/dist/{copy-DLJriGQS.d.ts → copy.d-CiMn2IIt.d.ts} +6 -6
- package/dist/{copy-lWp-Lkv5.d.cts → copy.d-DLJTyRfT.d.cts} +6 -6
- package/dist/core/index.cjs +17 -13
- package/dist/core/index.d.cts +33 -29
- package/dist/core/index.d.ts +33 -29
- package/dist/core/index.js +17 -13
- package/dist/{depth-BYb3RXoA.d.cts → depth.d-CjPGVPDL.d.cts} +9 -115
- package/dist/{depth-COz-sSG5.d.ts → depth.d-OSALbYM7.d.ts} +9 -115
- package/dist/{entitlementRepository-D-Lse67w.d.cts → entitlementRepository.d-CVQa1DA1.d.cts} +10 -5
- package/dist/{entitlementRepository-CrTOP_-o.d.ts → entitlementRepository.d-Cf3LbTwD.d.ts} +10 -5
- package/dist/features.d-fNsGcg0R.d.cts +108 -0
- package/dist/features.d-fNsGcg0R.d.ts +108 -0
- package/dist/focus.d-DMg2ngHI.d.ts +1178 -0
- package/dist/focus.d-az9cqUz3.d.cts +1178 -0
- package/dist/health-plan/index.cjs +370 -0
- package/dist/health-plan/index.d.cts +251 -0
- package/dist/health-plan/index.d.ts +251 -0
- package/dist/health-plan/index.js +370 -0
- package/dist/idempotency.d-D461_DPD.d.cts +910 -0
- package/dist/idempotency.d-WpXx9zQo.d.ts +910 -0
- package/dist/{identity-Cw07BKZp.d.ts → identity.d-60LeJt_s.d.cts} +3 -3
- package/dist/{identity-DFVGYn1o.d.cts → identity.d-DzTijonw.d.ts} +3 -3
- package/dist/index.cjs +141 -66
- package/dist/index.d.cts +31 -29
- package/dist/index.d.ts +31 -29
- package/dist/index.js +142 -67
- package/dist/{models-A4A5S7AG.d.cts → models.d-BagXhafD.d.ts} +8 -3
- package/dist/{models-CnXY5LuO.d.ts → models.d-BnLm3VAA.d.cts} +8 -3
- package/dist/notifications/index.cjs +5 -1
- package/dist/notifications/index.d.cts +9 -9
- package/dist/notifications/index.d.ts +9 -9
- package/dist/notifications/index.js +5 -1
- package/dist/optInView.d-CEyHR6PK.d.cts +325 -0
- package/dist/optInView.d-acKpV8V2.d.ts +325 -0
- package/dist/parse.d-C8CXyS58.d.ts +210 -0
- package/dist/parse.d-tEzufgJX.d.cts +210 -0
- package/dist/{pets-BYALZTSu.d.ts → pets.d-C_53_fzo.d.ts} +3 -3
- package/dist/{pets-CcyPQS-H.d.cts → pets.d-NbJvP_kh.d.cts} +3 -3
- package/dist/{petsRepository-B_Q1gFkE.d.cts → petsRepository.d-BuGHymNx.d.ts} +4 -4
- package/dist/{petsRepository-518QkPxH.d.ts → petsRepository.d-lp1BHRqM.d.cts} +4 -4
- package/dist/photo/index.cjs +6 -2
- package/dist/photo/index.d.cts +9 -9
- package/dist/photo/index.d.ts +9 -9
- package/dist/photo/index.js +6 -2
- package/dist/{ports-BN6RHF9W.d.ts → ports.d-BX4f4UsB.d.cts} +14 -1
- package/dist/{ports-BN6RHF9W.d.cts → ports.d-BX4f4UsB.d.ts} +14 -1
- package/dist/{ports-RuNJmBA-.d.cts → ports.d-CEROoqnA.d.cts} +16 -10
- package/dist/{ports-DmQeMArX.d.ts → ports.d-COIyN624.d.ts} +16 -10
- package/dist/presentation.d-DMbdad7G.d.cts +90 -0
- package/dist/presentation.d-DMbdad7G.d.ts +90 -0
- package/dist/records/depth/index.cjs +11 -7
- package/dist/records/depth/index.d.cts +14 -12
- package/dist/records/depth/index.d.ts +14 -12
- package/dist/records/depth/index.js +11 -7
- package/dist/records/index.cjs +225 -62
- package/dist/records/index.d.cts +159 -20
- package/dist/records/index.d.ts +159 -20
- package/dist/records/index.js +225 -62
- package/dist/recordsAsk.d-C5CGSi3j.d.cts +14 -0
- package/dist/recordsAsk.d-C5CGSi3j.d.ts +14 -0
- package/dist/{requestFunnel-B9fdXMi5.d.ts → requestFunnel.d-CXUMPw1K.d.ts} +5 -5
- package/dist/{requestFunnel-BBjNNwc9.d.cts → requestFunnel.d-DWQQpjFR.d.cts} +5 -5
- package/dist/{resolve-D4Ywz5OS.d.ts → resolve.d-jI8FmBj3.d.cts} +3 -3
- package/dist/{resolve-D4Ywz5OS.d.cts → resolve.d-jI8FmBj3.d.ts} +3 -3
- package/dist/{runtimeTypes-CstDBX8w.d.cts → runtimeTypes.d-4yFNNuYR.d.ts} +20 -13
- package/dist/{runtimeTypes-N_K4BVZB.d.ts → runtimeTypes.d-D6N_fhxx.d.cts} +20 -13
- package/dist/server/events/index.cjs +7 -3
- package/dist/server/events/index.d.cts +51 -9
- package/dist/server/events/index.d.ts +51 -9
- package/dist/server/events/index.js +7 -3
- package/dist/server/index.cjs +12 -6
- package/dist/server/index.d.cts +152 -8
- package/dist/server/index.d.ts +152 -8
- package/dist/server/index.js +12 -6
- package/dist/sheetCopy.d-CAhLOxjc.d.cts +4 -0
- package/dist/sheetCopy.d-CAhLOxjc.d.ts +4 -0
- package/dist/sheetSeam.d-Cviqk89n.d.ts +45 -0
- package/dist/sheetSeam.d-DCS3LW8g.d.cts +45 -0
- package/dist/shop/index.cjs +262 -0
- package/dist/shop/index.d.cts +193 -0
- package/dist/shop/index.d.ts +193 -0
- package/dist/shop/index.js +262 -0
- package/dist/televet/booking/index.cjs +16 -12
- package/dist/televet/booking/index.d.cts +36 -22
- package/dist/televet/booking/index.d.ts +36 -22
- package/dist/televet/booking/index.js +16 -12
- package/dist/televet/call/index.d.cts +5 -5
- package/dist/televet/call/index.d.ts +5 -5
- package/dist/televet/index.cjs +7 -3
- package/dist/televet/index.d.cts +12 -12
- package/dist/televet/index.d.ts +12 -12
- package/dist/televet/index.js +7 -3
- package/dist/{televetGlobal-C5dTUACe.d.cts → televetGlobal.d-CC-DrqkQ.d.ts} +7 -2
- package/dist/{televetGlobal-CnjrfhT4.d.ts → televetGlobal.d-CKwDCbmN.d.cts} +7 -2
- package/dist/testing/index.cjs +7 -3
- package/dist/testing/index.d.cts +3 -3
- package/dist/testing/index.d.ts +3 -3
- package/dist/testing/index.js +7 -3
- package/dist/testing/rn/index.cjs +5 -1
- package/dist/testing/rn/index.d.cts +23 -22
- package/dist/testing/rn/index.d.ts +23 -22
- package/dist/testing/rn/index.js +5 -1
- package/dist/testing/web/index.cjs +5 -1
- package/dist/testing/web/index.d.cts +23 -22
- package/dist/testing/web/index.d.ts +23 -22
- package/dist/testing/web/index.js +5 -1
- package/dist/texting/index.cjs +158 -0
- package/dist/texting/index.d.cts +36 -0
- package/dist/texting/index.d.ts +36 -0
- package/dist/texting/index.js +158 -0
- package/dist/threadOptions.d-B1pTMmDF.d.cts +260 -0
- package/dist/threadOptions.d-B1pTMmDF.d.ts +260 -0
- package/dist/{timelineRows-7yjHyh8i.d.ts → timelineRows.d-BNxgzYRW.d.cts} +1 -1
- package/dist/{timelineRows-WvnL-Lds.d.cts → timelineRows.d-CU5GvvLk.d.ts} +1 -1
- package/dist/{tokens-DLj8OnLH.d.cts → tokens.d-DarDaV39.d.cts} +10 -2
- package/dist/{tokens-DLj8OnLH.d.ts → tokens.d-DarDaV39.d.ts} +10 -2
- package/dist/{typeStyle-BxVyF71R.d.ts → typeStyle.d-Bl8pzbBy.d.cts} +2 -2
- package/dist/{typeStyle-DJedEu14.d.cts → typeStyle.d-C1HBRAI3.d.ts} +2 -2
- package/dist/{uploadTransport-BM_pnEWj.d.cts → uploadTransport.d-CWL7CdWP.d.cts} +1 -1
- package/dist/{uploadTransport-C6kGP1Kd.d.ts → uploadTransport.d-EGoUl7gX.d.ts} +1 -1
- package/dist/usePresentation.d-D6qsFzBz.d.cts +9 -0
- package/dist/usePresentation.d-DuGQe_Do.d.ts +9 -0
- package/dist/useRecords.d-Cb-36SF5.d.cts +121 -0
- package/dist/useRecords.d-aQTzQZoV.d.ts +121 -0
- package/dist/{useRecordsDepth-Bp6L4M5P.d.ts → useRecordsDepth.d-DFcCfiXm.d.ts} +8 -20
- package/dist/{useRecordsDepth-DPdAK_81.d.cts → useRecordsDepth.d-sAq2Qkhr.d.cts} +8 -20
- package/dist/{useVetVisit-DmWa7lt1.d.ts → useVetVisit.d-BtdwhmgD.d.cts} +15 -4
- package/dist/{useVetVisit-PtBjNwZr.d.cts → useVetVisit.d-DoYQimyt.d.ts} +15 -4
- package/dist/video/index.cjs +6 -2
- package/dist/video/index.d.cts +7 -7
- package/dist/video/index.d.ts +7 -7
- package/dist/video/index.js +6 -2
- package/dist/{view-C6go2uUt.d.ts → view.d-C-SNpDJX.d.ts} +10 -122
- package/dist/{view-CiF_HVFQ.d.cts → view.d-Dps5C8-s.d.cts} +10 -122
- package/dist/web/consent/index.cjs +5 -1
- package/dist/web/consent/index.d.cts +10 -10
- package/dist/web/consent/index.d.ts +10 -10
- package/dist/web/consent/index.js +5 -1
- package/dist/web/health-plan/index.cjs +414 -0
- package/dist/web/health-plan/index.d.cts +335 -0
- package/dist/web/health-plan/index.d.ts +335 -0
- package/dist/web/health-plan/index.js +414 -0
- package/dist/web/index.cjs +150 -82
- package/dist/web/index.d.cts +152 -38
- package/dist/web/index.d.ts +152 -38
- package/dist/web/index.js +150 -82
- package/dist/web/notifications/index.cjs +16 -3
- package/dist/web/notifications/index.d.cts +39 -209
- package/dist/web/notifications/index.d.ts +39 -209
- package/dist/web/notifications/index.js +16 -3
- package/dist/web/records/depth/index.cjs +11 -7
- package/dist/web/records/depth/index.d.cts +14 -12
- package/dist/web/records/depth/index.d.ts +14 -12
- package/dist/web/records/depth/index.js +11 -7
- package/dist/web/records/index.cjs +95 -68
- package/dist/web/records/index.d.cts +66 -21
- package/dist/web/records/index.d.ts +66 -21
- package/dist/web/records/index.js +95 -68
- package/dist/web/records/upload/index.d.cts +2 -2
- package/dist/web/records/upload/index.d.ts +2 -2
- package/dist/web/records-sheet/index.cjs +278 -0
- package/dist/web/records-sheet/index.d.cts +102 -0
- package/dist/web/records-sheet/index.d.ts +102 -0
- package/dist/web/records-sheet/index.js +278 -0
- package/dist/web/shop/index.cjs +301 -0
- package/dist/web/shop/index.d.cts +42 -0
- package/dist/web/shop/index.d.ts +42 -0
- package/dist/web/shop/index.js +301 -0
- package/dist/web/televet/booking/index.cjs +16 -12
- package/dist/web/televet/booking/index.d.cts +37 -23
- package/dist/web/televet/booking/index.d.ts +37 -23
- package/dist/web/televet/booking/index.js +16 -12
- package/dist/web/televet/call/index.d.cts +4 -4
- package/dist/web/televet/call/index.d.ts +4 -4
- package/dist/web/televet/index.cjs +7 -3
- package/dist/web/televet/index.d.cts +12 -12
- package/dist/web/televet/index.d.ts +12 -12
- package/dist/web/televet/index.js +7 -3
- package/dist/web/texting/index.cjs +157 -0
- package/dist/web/texting/index.d.cts +36 -0
- package/dist/web/texting/index.d.ts +36 -0
- package/dist/web/texting/index.js +157 -0
- package/health-plan/package.json +8 -0
- package/package.json +106 -4
- package/shop/package.json +8 -0
- package/texting/package.json +8 -0
- package/web/health-plan/native-blocked.cjs +12 -0
- package/web/health-plan/package.json +8 -0
- package/web/records-sheet/native-blocked.cjs +12 -0
- package/web/records-sheet/package.json +8 -0
- package/web/shop/native-blocked.cjs +12 -0
- package/web/shop/package.json +8 -0
- package/web/texting/native-blocked.cjs +12 -0
- package/web/texting/package.json +8 -0
- /package/dist/{CameraPort-Cv31Pz7g.d.cts → CameraPort.d-Cv31Pz7g.d.cts} +0 -0
- /package/dist/{CameraPort-Cv31Pz7g.d.ts → CameraPort.d-Cv31Pz7g.d.ts} +0 -0
- /package/dist/{TelemetryPort-BDNr00hu.d.cts → TelemetryPort.d-BDNr00hu.d.cts} +0 -0
- /package/dist/{TelemetryPort-BDNr00hu.d.ts → TelemetryPort.d-BDNr00hu.d.ts} +0 -0
- /package/dist/{cacheEpoch-DknKn3S0.d.cts → cacheEpoch.d-DknKn3S0.d.cts} +0 -0
- /package/dist/{cacheEpoch-DknKn3S0.d.ts → cacheEpoch.d-DknKn3S0.d.ts} +0 -0
- /package/dist/{callCopy-Bw6oZT54.d.cts → callCopy.d-Bw6oZT54.d.cts} +0 -0
- /package/dist/{callCopy-Bw6oZT54.d.ts → callCopy.d-Bw6oZT54.d.ts} +0 -0
- /package/dist/{ids-B2GAAifq.d.cts → ids.d-B2GAAifq.d.cts} +0 -0
- /package/dist/{ids-B2GAAifq.d.ts → ids.d-B2GAAifq.d.ts} +0 -0
- /package/dist/{optionalModule-DbJmsq5f.d.cts → optionalModule.d-DbJmsq5f.d.cts} +0 -0
- /package/dist/{optionalModule-DbJmsq5f.d.ts → optionalModule.d-DbJmsq5f.d.ts} +0 -0
- /package/dist/{profile-CSs1wlXT.d.cts → profile.d-CSs1wlXT.d.cts} +0 -0
- /package/dist/{profile-CSs1wlXT.d.ts → profile.d-CSs1wlXT.d.ts} +0 -0
- /package/dist/{projection-CeIUsbSk.d.cts → projection.d-CeIUsbSk.d.cts} +0 -0
- /package/dist/{projection-CeIUsbSk.d.ts → projection.d-CeIUsbSk.d.ts} +0 -0
- /package/dist/{species-BXAIMh7I.d.cts → species.d-BXAIMh7I.d.cts} +0 -0
- /package/dist/{species-BXAIMh7I.d.ts → species.d-BXAIMh7I.d.ts} +0 -0
- /package/dist/{visitIntent-D7_yVp1I.d.cts → visitIntent.d-D7_yVp1I.d.cts} +0 -0
- /package/dist/{visitIntent-D7_yVp1I.d.ts → visitIntent.d-D7_yVp1I.d.ts} +0 -0
|
@@ -0,0 +1,910 @@
|
|
|
1
|
+
import { j as FetchLike } from './config.d-Dy6igYlH.js';
|
|
2
|
+
|
|
3
|
+
type OmsError =
|
|
4
|
+
/** 404: hidden. The shop, the gate, the record, or the account is not available to this viewer. */
|
|
5
|
+
{
|
|
6
|
+
readonly kind: 'unavailable';
|
|
7
|
+
readonly requestId?: string;
|
|
8
|
+
}
|
|
9
|
+
/** The host's `getToken` returned nothing or failed (or a gateway answered 401): no request was sent. */
|
|
10
|
+
| {
|
|
11
|
+
readonly kind: 'signedOut';
|
|
12
|
+
}
|
|
13
|
+
/** 402, 409, 422: a business refusal the customer can act on. */
|
|
14
|
+
| {
|
|
15
|
+
readonly kind: 'refused';
|
|
16
|
+
readonly status: 402 | 409 | 422;
|
|
17
|
+
readonly reasonCode: string | null;
|
|
18
|
+
/** The contract's product copy, safe to show; null when absent. */
|
|
19
|
+
readonly message: string | null;
|
|
20
|
+
readonly requestId?: string;
|
|
21
|
+
}
|
|
22
|
+
/** 400: the SDK sent something the server would not take (a bug), or a local check refused it first. */
|
|
23
|
+
| {
|
|
24
|
+
readonly kind: 'invalidRequest';
|
|
25
|
+
readonly requestId?: string;
|
|
26
|
+
}
|
|
27
|
+
/** 429: past the per-user hourly limit on checkout, pay or card setup. */
|
|
28
|
+
| {
|
|
29
|
+
readonly kind: 'rateLimited';
|
|
30
|
+
readonly retryAfterSeconds: number | null;
|
|
31
|
+
readonly requestId?: string;
|
|
32
|
+
}
|
|
33
|
+
/** 503: a dependency (pharmacy, Stripe, database) is down. Retry later. */
|
|
34
|
+
| {
|
|
35
|
+
readonly kind: 'serviceUnavailable';
|
|
36
|
+
readonly requestId?: string;
|
|
37
|
+
}
|
|
38
|
+
/** 500 or any other status. */
|
|
39
|
+
| {
|
|
40
|
+
readonly kind: 'serverError';
|
|
41
|
+
readonly status: number;
|
|
42
|
+
readonly requestId?: string;
|
|
43
|
+
}
|
|
44
|
+
/** The request never got an answer (offline, DNS, CORS). */
|
|
45
|
+
| {
|
|
46
|
+
readonly kind: 'network';
|
|
47
|
+
}
|
|
48
|
+
/** The request ran past the SDK's deadline. */
|
|
49
|
+
| {
|
|
50
|
+
readonly kind: 'timeout';
|
|
51
|
+
}
|
|
52
|
+
/** A 2xx answer the SDK could not read (a field missing or of the wrong type). */
|
|
53
|
+
| {
|
|
54
|
+
readonly kind: 'badResponse';
|
|
55
|
+
readonly requestId?: string;
|
|
56
|
+
};
|
|
57
|
+
type OmsResult<T> = {
|
|
58
|
+
readonly ok: true;
|
|
59
|
+
readonly value: T;
|
|
60
|
+
} | {
|
|
61
|
+
readonly ok: false;
|
|
62
|
+
readonly error: OmsError;
|
|
63
|
+
};
|
|
64
|
+
/** True for a refusal with this `reason_code`. */
|
|
65
|
+
declare function isOmsRefusal(error: OmsError, reasonCode?: string): boolean;
|
|
66
|
+
/** True when the answer means "this is not for this viewer": hide it, never show an error. */
|
|
67
|
+
declare function isOmsUnavailable(error: OmsError): boolean;
|
|
68
|
+
/** Worth one more try by the same user action (with the SAME idempotency key). */
|
|
69
|
+
declare function isOmsRetryable(error: OmsError): boolean;
|
|
70
|
+
|
|
71
|
+
/** Integer cents, USD (`4599` is $45.99). Never a float. */
|
|
72
|
+
type OmsCents = number;
|
|
73
|
+
type OmsDeliverySpeed = 'ground' | 'two_day' | 'next_day';
|
|
74
|
+
/** `GET /oms/shop-config`. Each null hides one feature (contract 4.17). */
|
|
75
|
+
interface OmsShopConfig {
|
|
76
|
+
/** Null hides auto-ship (plans). */
|
|
77
|
+
readonly recurringTermsVersion: string | null;
|
|
78
|
+
readonly recurringTermsUrl: string | null;
|
|
79
|
+
/** Null hides card entry. */
|
|
80
|
+
readonly stripePublishableKey: string | null;
|
|
81
|
+
/** Null means the shop's terms are not written yet: a quote would answer 409. */
|
|
82
|
+
readonly delivery: {
|
|
83
|
+
readonly firstFill: OmsDeliverySpeed | null;
|
|
84
|
+
readonly refill: OmsDeliverySpeed | null;
|
|
85
|
+
} | null;
|
|
86
|
+
}
|
|
87
|
+
type OmsPackUnit = 'each' | 'gram' | 'milliliter';
|
|
88
|
+
/** One active offer (contract 4.1). */
|
|
89
|
+
interface OmsOffer {
|
|
90
|
+
readonly offerId: string;
|
|
91
|
+
readonly sku: string;
|
|
92
|
+
readonly title: string;
|
|
93
|
+
readonly fulfillmentType: string;
|
|
94
|
+
readonly requiresRx: boolean;
|
|
95
|
+
readonly compounded: boolean;
|
|
96
|
+
/** A decimal string ("30"), or null. */
|
|
97
|
+
readonly packQuantity: string | null;
|
|
98
|
+
readonly packUnit: OmsPackUnit | null;
|
|
99
|
+
/** One unit before any discount; null until the shop's commercial terms are written (contract 8.1). */
|
|
100
|
+
readonly price: OmsCents | null;
|
|
101
|
+
}
|
|
102
|
+
interface OmsOfferPage {
|
|
103
|
+
readonly offers: readonly OmsOffer[];
|
|
104
|
+
/** Pass back as `cursor`; null is the last page. */
|
|
105
|
+
readonly nextCursor: string | null;
|
|
106
|
+
}
|
|
107
|
+
/** A cart or plan line. A prescription line names the pet and the prescription (contract 3.5). */
|
|
108
|
+
interface OmsCartLine {
|
|
109
|
+
readonly offerId: string;
|
|
110
|
+
/** 1 to 99. */
|
|
111
|
+
readonly quantity: number;
|
|
112
|
+
readonly petId?: string;
|
|
113
|
+
readonly rxId?: string;
|
|
114
|
+
}
|
|
115
|
+
interface OmsQuoteLine {
|
|
116
|
+
readonly offerId: string;
|
|
117
|
+
readonly quantity: number;
|
|
118
|
+
readonly petId: string | null;
|
|
119
|
+
readonly unitPrice: OmsCents;
|
|
120
|
+
readonly discount: OmsCents;
|
|
121
|
+
readonly tax: OmsCents;
|
|
122
|
+
}
|
|
123
|
+
/** `POST /oms/cart/quote`. Creates nothing; good for 30 minutes. */
|
|
124
|
+
interface OmsQuote {
|
|
125
|
+
readonly lines: readonly OmsQuoteLine[];
|
|
126
|
+
readonly shipping: OmsCents;
|
|
127
|
+
readonly tax: OmsCents;
|
|
128
|
+
readonly total: OmsCents;
|
|
129
|
+
readonly expiresAt: string;
|
|
130
|
+
}
|
|
131
|
+
type OmsCheckoutState = 'draft' | 'authorizing' | 'confirmed' | 'compensating' | 'failed' | 'expired';
|
|
132
|
+
/** `POST /oms/checkouts` (201). `total` is what confirm will charge. */
|
|
133
|
+
interface OmsCheckout {
|
|
134
|
+
readonly checkoutId: string;
|
|
135
|
+
readonly state: OmsCheckoutState | string;
|
|
136
|
+
readonly orderIds: readonly string[];
|
|
137
|
+
readonly createdAt: string;
|
|
138
|
+
readonly total: OmsCents;
|
|
139
|
+
readonly shipping: OmsCents;
|
|
140
|
+
readonly tax: OmsCents;
|
|
141
|
+
}
|
|
142
|
+
interface OmsResaleOutcome {
|
|
143
|
+
readonly outcome: 'confirmed' | 'action_required';
|
|
144
|
+
readonly orderId: string;
|
|
145
|
+
/** A Stripe PaymentIntent client secret when `action_required` (3-D Secure); null when confirmed. */
|
|
146
|
+
readonly payerAction: string | null;
|
|
147
|
+
}
|
|
148
|
+
/** `POST /oms/checkouts/{id}/confirm`. */
|
|
149
|
+
interface OmsConfirmation {
|
|
150
|
+
readonly checkoutId: string;
|
|
151
|
+
readonly resale: readonly OmsResaleOutcome[];
|
|
152
|
+
}
|
|
153
|
+
type OmsOrderStatus = 'pending_placement' | 'placement_unknown' | 'placed' | 'accepted' | 'release_sent' | 'release_unknown' | 'released' | 'shipped' | 'delivered' | 'needs_support' | 'rejected' | 'cancelled' | 'pending_handoff';
|
|
154
|
+
interface OmsOrderSummary {
|
|
155
|
+
readonly orderId: string;
|
|
156
|
+
/** The number the customer sees (`EF-26-0004817`); null until placed. */
|
|
157
|
+
readonly referenceNumber: string | null;
|
|
158
|
+
/** One of `OmsOrderStatus`; an unknown future value is carried as sent. */
|
|
159
|
+
readonly status: OmsOrderStatus | string;
|
|
160
|
+
readonly total: OmsCents;
|
|
161
|
+
readonly placedAt: string | null;
|
|
162
|
+
}
|
|
163
|
+
interface OmsOrderPage {
|
|
164
|
+
readonly orders: readonly OmsOrderSummary[];
|
|
165
|
+
readonly nextCursor: string | null;
|
|
166
|
+
}
|
|
167
|
+
interface OmsOrderLine {
|
|
168
|
+
readonly lineId: string;
|
|
169
|
+
readonly offerId: string;
|
|
170
|
+
readonly sku: string;
|
|
171
|
+
readonly title: string;
|
|
172
|
+
readonly requiresRx: boolean;
|
|
173
|
+
readonly compounded: boolean;
|
|
174
|
+
readonly packQuantity: string | null;
|
|
175
|
+
readonly packUnit: OmsPackUnit | null;
|
|
176
|
+
readonly quantity: number;
|
|
177
|
+
readonly unitPrice: OmsCents;
|
|
178
|
+
readonly discount: OmsCents;
|
|
179
|
+
readonly tax: OmsCents;
|
|
180
|
+
readonly fulfillmentType: string;
|
|
181
|
+
readonly petId: string | null;
|
|
182
|
+
}
|
|
183
|
+
type OmsShipmentState = 'label_created' | 'in_transit' | 'exception' | 'delivered' | 'returned_to_sender';
|
|
184
|
+
interface OmsTrackingEvent {
|
|
185
|
+
readonly carrier: string | null;
|
|
186
|
+
readonly trackingNumber: string | null;
|
|
187
|
+
readonly status: OmsShipmentState | string;
|
|
188
|
+
readonly occurredAt: string | null;
|
|
189
|
+
/** An https link, else null (contract 8.3). */
|
|
190
|
+
readonly trackingUrl: string | null;
|
|
191
|
+
/** A date, or null. */
|
|
192
|
+
readonly deliveryBy: string | null;
|
|
193
|
+
}
|
|
194
|
+
interface OmsShipment {
|
|
195
|
+
readonly shipmentId: string;
|
|
196
|
+
readonly state: OmsShipmentState | string;
|
|
197
|
+
readonly lines: readonly {
|
|
198
|
+
readonly lineId: string;
|
|
199
|
+
readonly quantity: number;
|
|
200
|
+
}[];
|
|
201
|
+
readonly tracking: readonly OmsTrackingEvent[];
|
|
202
|
+
}
|
|
203
|
+
type OmsPaymentStatus = 'processing' | 'requires_action' | 'authorized' | 'captured' | 'voided' | 'expired' | 'failed';
|
|
204
|
+
interface OmsRefund {
|
|
205
|
+
readonly refundId: string;
|
|
206
|
+
readonly amount: OmsCents;
|
|
207
|
+
readonly state: string;
|
|
208
|
+
}
|
|
209
|
+
/** `GET /oms/orders/{id}`. */
|
|
210
|
+
interface OmsOrder {
|
|
211
|
+
readonly summary: OmsOrderSummary;
|
|
212
|
+
readonly lines: readonly OmsOrderLine[];
|
|
213
|
+
readonly shipping: OmsCents;
|
|
214
|
+
readonly shippingTax: OmsCents;
|
|
215
|
+
readonly shipments: readonly OmsShipment[];
|
|
216
|
+
readonly canCancel: boolean;
|
|
217
|
+
readonly canReturn: boolean;
|
|
218
|
+
readonly canPay: boolean;
|
|
219
|
+
readonly paymentStatus: OmsPaymentStatus | string | null;
|
|
220
|
+
readonly refunds: readonly OmsRefund[];
|
|
221
|
+
readonly returnIds: readonly string[];
|
|
222
|
+
}
|
|
223
|
+
interface OmsCancelOutcome {
|
|
224
|
+
readonly outcome: 'cancelled' | 'requested' | 'not_cancellable' | string;
|
|
225
|
+
/** Cents given back when cancelled (0 when only a hold was voided). */
|
|
226
|
+
readonly refunded: OmsCents | null;
|
|
227
|
+
/** `too_late` or `cancel_with_partner` when not cancellable. */
|
|
228
|
+
readonly reasonCode: string | null;
|
|
229
|
+
}
|
|
230
|
+
interface OmsPayOutcome {
|
|
231
|
+
readonly outcome: 'authorized' | 'action_required';
|
|
232
|
+
readonly orderId: string;
|
|
233
|
+
readonly payerAction: string | null;
|
|
234
|
+
}
|
|
235
|
+
interface OmsReturnLine {
|
|
236
|
+
readonly lineId: string;
|
|
237
|
+
readonly quantity: number;
|
|
238
|
+
readonly reasonCode: string;
|
|
239
|
+
}
|
|
240
|
+
interface OmsReturn {
|
|
241
|
+
readonly returnId: string;
|
|
242
|
+
readonly orderId: string;
|
|
243
|
+
readonly lines: readonly OmsReturnLine[];
|
|
244
|
+
readonly state: string;
|
|
245
|
+
readonly rma: string | null;
|
|
246
|
+
readonly labelUrl: string | null;
|
|
247
|
+
}
|
|
248
|
+
interface OmsCase {
|
|
249
|
+
readonly caseId: string;
|
|
250
|
+
readonly orderId: string;
|
|
251
|
+
readonly reasonCode: string;
|
|
252
|
+
readonly message: string;
|
|
253
|
+
readonly openedAt: string;
|
|
254
|
+
readonly closedAt: string | null;
|
|
255
|
+
}
|
|
256
|
+
type OmsPrescriptionStatus = 'ready' | 'being_prepared' | 'too_soon' | 'refills_used' | 'expired';
|
|
257
|
+
/** `GET /oms/prescriptions` (contract 4.12). */
|
|
258
|
+
interface OmsPrescription {
|
|
259
|
+
readonly rxId: string;
|
|
260
|
+
readonly petId: string;
|
|
261
|
+
readonly drug: string;
|
|
262
|
+
readonly strength: string | null;
|
|
263
|
+
readonly form: string | null;
|
|
264
|
+
readonly status: OmsPrescriptionStatus | string;
|
|
265
|
+
/** Set when `ready`. */
|
|
266
|
+
readonly offerId: string | null;
|
|
267
|
+
readonly packCount: number | null;
|
|
268
|
+
readonly fillsUsed: number | null;
|
|
269
|
+
readonly fillsTotal: number | null;
|
|
270
|
+
readonly expiresOn: string | null;
|
|
271
|
+
/** Set when `too_soon`. */
|
|
272
|
+
readonly nextFillOn: string | null;
|
|
273
|
+
}
|
|
274
|
+
/** A saved address, as listed: a label only, the address is sealed at rest (contract 4.13). */
|
|
275
|
+
interface OmsAddressEntry {
|
|
276
|
+
readonly ref: string;
|
|
277
|
+
readonly label: string;
|
|
278
|
+
readonly isDefault: boolean;
|
|
279
|
+
/** False: no recipient name, checkout refuses it (`address_incomplete`). */
|
|
280
|
+
readonly isComplete: boolean;
|
|
281
|
+
}
|
|
282
|
+
interface OmsAddress {
|
|
283
|
+
readonly recipientName: string | null;
|
|
284
|
+
readonly line1: string;
|
|
285
|
+
readonly line2: string | null;
|
|
286
|
+
readonly city: string;
|
|
287
|
+
readonly region: string;
|
|
288
|
+
readonly postalCode: string;
|
|
289
|
+
/** Two capital letters. */
|
|
290
|
+
readonly country: string;
|
|
291
|
+
}
|
|
292
|
+
interface OmsAddressDetail extends OmsAddressEntry {
|
|
293
|
+
readonly address: OmsAddress;
|
|
294
|
+
}
|
|
295
|
+
interface OmsAddressInput {
|
|
296
|
+
/** 1 to 60 characters. */
|
|
297
|
+
readonly label: string;
|
|
298
|
+
readonly makeDefault?: boolean;
|
|
299
|
+
readonly address: OmsAddress;
|
|
300
|
+
}
|
|
301
|
+
interface OmsPaymentMethod {
|
|
302
|
+
/** Stripe's `pm_...`. */
|
|
303
|
+
readonly paymentMethodId: string;
|
|
304
|
+
readonly brand: string;
|
|
305
|
+
readonly last4: string;
|
|
306
|
+
readonly wallet: 'apple_pay' | 'google_pay' | string | null;
|
|
307
|
+
}
|
|
308
|
+
/** `POST /oms/payment-methods/setup`: a Stripe SetupIntent and its client secret. */
|
|
309
|
+
interface OmsPaymentSetup {
|
|
310
|
+
readonly setupId: string;
|
|
311
|
+
/** The SetupIntent client secret. Hand it to Stripe, never log or store it. */
|
|
312
|
+
readonly payerAction: string;
|
|
313
|
+
}
|
|
314
|
+
/** Stripe's hosted page that saves a card (a Checkout Session in setup mode), for an app with no Stripe SDK. */
|
|
315
|
+
interface OmsCardSetupLink {
|
|
316
|
+
/** `https://checkout.stripe.com/...`. Open it in an in-app browser; it carries no secret. */
|
|
317
|
+
readonly url: string;
|
|
318
|
+
}
|
|
319
|
+
/** Everfur's hosted page that runs an order's open 3-D Secure step, for an app with no Stripe SDK. */
|
|
320
|
+
interface OmsCardActionLink {
|
|
321
|
+
/** The web page with a short-lived ticket in its fragment. Open it once, in an in-app browser; never log it. */
|
|
322
|
+
readonly url: string;
|
|
323
|
+
/** When the ticket stops working (ISO 8601), about 15 minutes after it was made. */
|
|
324
|
+
readonly expiresAt: string;
|
|
325
|
+
}
|
|
326
|
+
type OmsPlanState = 'active' | 'paused' | 'needs_address' | 'cancelled';
|
|
327
|
+
type OmsPlanStopReason = 'customer' | 'consent_revoked' | 'needs_address' | 'payment_declined' | 'needs_prescription' | 'item_unavailable' | 'order_refused';
|
|
328
|
+
interface OmsPlanLine {
|
|
329
|
+
readonly offerId: string;
|
|
330
|
+
readonly quantity: number;
|
|
331
|
+
readonly petId: string | null;
|
|
332
|
+
}
|
|
333
|
+
/** An auto-ship plan (contract 4.15, 8.5). */
|
|
334
|
+
interface OmsPlan {
|
|
335
|
+
readonly planId: string;
|
|
336
|
+
readonly lines: readonly OmsPlanLine[];
|
|
337
|
+
readonly cadenceDays: number;
|
|
338
|
+
/** An address ref. */
|
|
339
|
+
readonly destination: string | null;
|
|
340
|
+
readonly paymentMethodId: string | null;
|
|
341
|
+
/** 1000 is the 10% subscribe-and-save discount. */
|
|
342
|
+
readonly discountBps: number;
|
|
343
|
+
readonly nextRun: string | null;
|
|
344
|
+
readonly state: OmsPlanState | string;
|
|
345
|
+
readonly stopReason: OmsPlanStopReason | string | null;
|
|
346
|
+
}
|
|
347
|
+
interface OmsPlanPage {
|
|
348
|
+
readonly plans: readonly OmsPlan[];
|
|
349
|
+
readonly nextCursor: string | null;
|
|
350
|
+
}
|
|
351
|
+
interface OmsPlanInput {
|
|
352
|
+
readonly idempotencyKey: string;
|
|
353
|
+
/** 7 to 365. */
|
|
354
|
+
readonly cadenceDays: number;
|
|
355
|
+
readonly destination: string;
|
|
356
|
+
readonly paymentMethodId: string;
|
|
357
|
+
/** Must equal `shop-config.recurringTermsVersion`, else 409 `terms_outdated`. */
|
|
358
|
+
readonly consentTermsVersion: string;
|
|
359
|
+
readonly lines: readonly OmsCartLine[];
|
|
360
|
+
}
|
|
361
|
+
interface OmsPlanPatch {
|
|
362
|
+
readonly idempotencyKey: string;
|
|
363
|
+
readonly lines?: readonly OmsCartLine[];
|
|
364
|
+
readonly cadenceDays?: number;
|
|
365
|
+
readonly destination?: string;
|
|
366
|
+
readonly paymentMethodId?: string;
|
|
367
|
+
}
|
|
368
|
+
type OmsPlanOperation = 'pause' | 'skip' | 'resume';
|
|
369
|
+
type OmsCycleReviewState = 'open' | 'approving' | 'approved' | 'skipped' | 'withdrawn' | 'failed';
|
|
370
|
+
/** `GET /oms/subscriptions/{plan_id}/cycle`. */
|
|
371
|
+
interface OmsCycleReview {
|
|
372
|
+
readonly planId: string;
|
|
373
|
+
/** Null when no review is open: `cycle`, `shipsOn` and `approveBy` then name the next one. */
|
|
374
|
+
readonly reviewId: string | null;
|
|
375
|
+
readonly cycle: number;
|
|
376
|
+
readonly state: OmsCycleReviewState | string | null;
|
|
377
|
+
readonly lines: readonly OmsPlanLine[];
|
|
378
|
+
readonly shipsOn: string | null;
|
|
379
|
+
readonly approveBy: string | null;
|
|
380
|
+
/** The pre-tax quote of the open review's lines (price and discount per line), when one is open. */
|
|
381
|
+
readonly quoteLines: readonly OmsQuoteLine[];
|
|
382
|
+
}
|
|
383
|
+
/** `POST /oms/subscriptions/{plan_id}/cycles/{cycle}/draft`: the taxed draft the owner approves. */
|
|
384
|
+
interface OmsCycleDraft {
|
|
385
|
+
readonly checkoutId: string;
|
|
386
|
+
readonly shipping: OmsCents;
|
|
387
|
+
readonly tax: OmsCents;
|
|
388
|
+
readonly total: OmsCents;
|
|
389
|
+
readonly expiresAt: string | null;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
/** The member's own Cognito id token, asked for on every request. Null (or a throw) means signed out. */
|
|
393
|
+
type OmsGetToken = () => Promise<string | null | undefined> | string | null | undefined;
|
|
394
|
+
interface OmsConsumerAuth {
|
|
395
|
+
readonly kind: 'everfur_consumer';
|
|
396
|
+
readonly getToken: OmsGetToken;
|
|
397
|
+
}
|
|
398
|
+
interface OmsClientConfig {
|
|
399
|
+
/** The API origin, e.g. `https://api.everfur.com`. https only (http is allowed for localhost). */
|
|
400
|
+
readonly baseUrl: string;
|
|
401
|
+
/** Default `/api/v1/oms`. */
|
|
402
|
+
readonly path?: string;
|
|
403
|
+
readonly auth: OmsConsumerAuth;
|
|
404
|
+
/** Default `globalThis.fetch`. */
|
|
405
|
+
readonly fetch?: FetchLike;
|
|
406
|
+
/** Sent on `POST /checkouts`. Default `web`. */
|
|
407
|
+
readonly channel?: 'web' | 'app';
|
|
408
|
+
/** Per-request deadline. Default 30 s. */
|
|
409
|
+
readonly timeoutMs?: number;
|
|
410
|
+
}
|
|
411
|
+
interface OmsOfferQuery {
|
|
412
|
+
readonly text?: string;
|
|
413
|
+
readonly requiresRx?: boolean;
|
|
414
|
+
readonly cursor?: string;
|
|
415
|
+
readonly limit?: number;
|
|
416
|
+
}
|
|
417
|
+
interface OmsPageQuery {
|
|
418
|
+
readonly cursor?: string;
|
|
419
|
+
readonly limit?: number;
|
|
420
|
+
}
|
|
421
|
+
interface OmsQuoteRequest {
|
|
422
|
+
readonly lines: readonly OmsCartLine[];
|
|
423
|
+
readonly shipTo: string;
|
|
424
|
+
readonly promoCode?: string;
|
|
425
|
+
}
|
|
426
|
+
interface OmsCheckoutRequest extends OmsQuoteRequest {
|
|
427
|
+
readonly idempotencyKey: string;
|
|
428
|
+
readonly receiptEmail?: string;
|
|
429
|
+
}
|
|
430
|
+
interface OmsConfirmRequest {
|
|
431
|
+
readonly idempotencyKey: string;
|
|
432
|
+
/** The total the customer saw (the draft's `total`); a mismatch is 409 `price_changed`. */
|
|
433
|
+
readonly expectedTotal: number;
|
|
434
|
+
readonly paymentMethodId: string;
|
|
435
|
+
}
|
|
436
|
+
interface OmsReturnRequest {
|
|
437
|
+
readonly idempotencyKey: string;
|
|
438
|
+
readonly lines: readonly {
|
|
439
|
+
readonly lineId: string;
|
|
440
|
+
readonly quantity: number;
|
|
441
|
+
readonly reasonCode: string;
|
|
442
|
+
}[];
|
|
443
|
+
}
|
|
444
|
+
interface OmsCaseRequest {
|
|
445
|
+
readonly idempotencyKey: string;
|
|
446
|
+
readonly reasonCode: string;
|
|
447
|
+
/** At most 4000 characters. */
|
|
448
|
+
readonly message: string;
|
|
449
|
+
}
|
|
450
|
+
interface OmsCycleApproval {
|
|
451
|
+
readonly idempotencyKey: string;
|
|
452
|
+
readonly checkoutId: string;
|
|
453
|
+
readonly expectedTotal: number;
|
|
454
|
+
}
|
|
455
|
+
interface OmsClient {
|
|
456
|
+
shopConfig(): Promise<OmsResult<OmsShopConfig>>;
|
|
457
|
+
offers(query?: OmsOfferQuery): Promise<OmsResult<OmsOfferPage>>;
|
|
458
|
+
offer(offerId: string): Promise<OmsResult<OmsOffer>>;
|
|
459
|
+
prescriptions(): Promise<OmsResult<readonly OmsPrescription[]>>;
|
|
460
|
+
addresses(): Promise<OmsResult<readonly OmsAddressEntry[]>>;
|
|
461
|
+
address(ref: string): Promise<OmsResult<OmsAddressDetail>>;
|
|
462
|
+
addAddress(input: OmsAddressInput): Promise<OmsResult<OmsAddressEntry>>;
|
|
463
|
+
updateAddress(ref: string, input: OmsAddressInput): Promise<OmsResult<OmsAddressEntry>>;
|
|
464
|
+
removeAddress(ref: string): Promise<OmsResult<void>>;
|
|
465
|
+
makeDefaultAddress(ref: string): Promise<OmsResult<OmsAddressEntry>>;
|
|
466
|
+
paymentMethods(): Promise<OmsResult<readonly OmsPaymentMethod[]>>;
|
|
467
|
+
/** A new SetupIntent each call (5 an hour). Hand `payerAction` to Stripe; never keep it. */
|
|
468
|
+
setupPaymentMethod(): Promise<OmsResult<OmsPaymentSetup>>;
|
|
469
|
+
/**
|
|
470
|
+
* Stripe's hosted card setup page for an app with no Stripe SDK (shares setup's 5 an hour). Stripe sends the member
|
|
471
|
+
* back to `returnUrl` with `oms_card=done` or `oms_card=canceled`; the backend refuses a URL off its allowlist (400).
|
|
472
|
+
* The same key inside 24 hours answers the same page.
|
|
473
|
+
*/
|
|
474
|
+
startCardSetupSession(request: {
|
|
475
|
+
readonly idempotencyKey: string;
|
|
476
|
+
readonly returnUrl: string;
|
|
477
|
+
}): Promise<OmsResult<OmsCardSetupLink>>;
|
|
478
|
+
removePaymentMethod(paymentMethodId: string): Promise<OmsResult<void>>;
|
|
479
|
+
quote(request: OmsQuoteRequest): Promise<OmsResult<OmsQuote>>;
|
|
480
|
+
createCheckout(request: OmsCheckoutRequest): Promise<OmsResult<OmsCheckout>>;
|
|
481
|
+
confirmCheckout(checkoutId: string, request: OmsConfirmRequest): Promise<OmsResult<OmsConfirmation>>;
|
|
482
|
+
orders(query?: OmsPageQuery & {
|
|
483
|
+
readonly reference?: string;
|
|
484
|
+
}): Promise<OmsResult<OmsOrderPage>>;
|
|
485
|
+
order(orderId: string): Promise<OmsResult<OmsOrder>>;
|
|
486
|
+
cancelOrder(orderId: string, request: {
|
|
487
|
+
readonly idempotencyKey: string;
|
|
488
|
+
readonly reasonCode: string;
|
|
489
|
+
}): Promise<OmsResult<OmsCancelOutcome>>;
|
|
490
|
+
payOrder(orderId: string, request: {
|
|
491
|
+
readonly idempotencyKey: string;
|
|
492
|
+
readonly paymentMethodId?: string;
|
|
493
|
+
}): Promise<OmsResult<OmsPayOutcome>>;
|
|
494
|
+
/**
|
|
495
|
+
* The hosted 3-D Secure page for one of the member's orders whose hold needs them, for an app with no Stripe SDK.
|
|
496
|
+
* The page sends the member back to `returnUrl` with `oms_card_action=succeeded`, `failed` or `canceled`. 409 when
|
|
497
|
+
* the order has nothing to pay; counts in checkout's rate limit.
|
|
498
|
+
*/
|
|
499
|
+
cardActionLink(orderId: string, request: {
|
|
500
|
+
readonly returnUrl: string;
|
|
501
|
+
}): Promise<OmsResult<OmsCardActionLink>>;
|
|
502
|
+
requestReturn(orderId: string, request: OmsReturnRequest): Promise<OmsResult<OmsReturn>>;
|
|
503
|
+
getReturn(returnId: string): Promise<OmsResult<OmsReturn>>;
|
|
504
|
+
cancelReturn(returnId: string): Promise<OmsResult<OmsReturn>>;
|
|
505
|
+
openCase(orderId: string, request: OmsCaseRequest): Promise<OmsResult<OmsCase>>;
|
|
506
|
+
orderCases(orderId: string): Promise<OmsResult<readonly OmsCase[]>>;
|
|
507
|
+
plans(query?: OmsPageQuery): Promise<OmsResult<OmsPlanPage>>;
|
|
508
|
+
createPlan(input: OmsPlanInput): Promise<OmsResult<OmsPlan>>;
|
|
509
|
+
updatePlan(planId: string, patch: OmsPlanPatch): Promise<OmsResult<OmsPlan>>;
|
|
510
|
+
planAction(planId: string, request: {
|
|
511
|
+
readonly idempotencyKey: string;
|
|
512
|
+
readonly operation: OmsPlanOperation;
|
|
513
|
+
}): Promise<OmsResult<OmsPlan>>;
|
|
514
|
+
cancelPlan(planId: string): Promise<OmsResult<OmsPlan>>;
|
|
515
|
+
/** PROVISIONAL (PLAN-APPROVAL-BUILD.md 3.8): not in the contract yet. 404 while the review flag is off. */
|
|
516
|
+
cycleReview(planId: string): Promise<OmsResult<OmsCycleReview>>;
|
|
517
|
+
editCycle(planId: string, cycle: number, request: {
|
|
518
|
+
readonly idempotencyKey: string;
|
|
519
|
+
readonly lines: readonly OmsCartLine[];
|
|
520
|
+
}): Promise<OmsResult<OmsCycleReview>>;
|
|
521
|
+
draftCycle(planId: string, cycle: number): Promise<OmsResult<OmsCycleDraft>>;
|
|
522
|
+
approveCycle(planId: string, cycle: number, request: OmsCycleApproval): Promise<OmsResult<OmsConfirmation>>;
|
|
523
|
+
skipCycle(planId: string, cycle: number, request: {
|
|
524
|
+
readonly idempotencyKey: string;
|
|
525
|
+
}): Promise<OmsResult<OmsPlan>>;
|
|
526
|
+
}
|
|
527
|
+
declare function createOmsClient(config: OmsClientConfig): OmsClient;
|
|
528
|
+
|
|
529
|
+
type ShopPaymentStepResult = {
|
|
530
|
+
readonly ok: true;
|
|
531
|
+
}
|
|
532
|
+
/**
|
|
533
|
+
* The step did not finish. `message` is Stripe's own line, shown as is. `closed` is true when the customer left the
|
|
534
|
+
* step themselves (closed the in-app browser or cancelled the hosted page): not a failure, nothing was refused, and
|
|
535
|
+
* the shop says so with its own line (`cardStepClosed`) instead of `cardStepFailed`.
|
|
536
|
+
*/
|
|
537
|
+
| {
|
|
538
|
+
readonly ok: false;
|
|
539
|
+
readonly message: string | null;
|
|
540
|
+
readonly closed?: boolean;
|
|
541
|
+
};
|
|
542
|
+
/** What the shop knows about the step it hands over: the order whose hold needs the customer. */
|
|
543
|
+
interface ShopPayerActionContext {
|
|
544
|
+
readonly orderId: string;
|
|
545
|
+
}
|
|
546
|
+
interface ShopPaymentsPort {
|
|
547
|
+
/** Finish a SetupIntent (save a card). The card then shows in `GET /payment-methods`. */
|
|
548
|
+
confirmCardSetup(clientSecret: string): Promise<ShopPaymentStepResult>;
|
|
549
|
+
/**
|
|
550
|
+
* Run a PaymentIntent's next action (3-D Secure). The shop confirms again with a new key afterwards. `context` names
|
|
551
|
+
* the order, for a port that runs the step on a hosted page (React Native's `createInAppBrowserCard`) and so never
|
|
552
|
+
* uses the client secret.
|
|
553
|
+
*/
|
|
554
|
+
handleNextAction(clientSecret: string, context?: ShopPayerActionContext): Promise<ShopPaymentStepResult>;
|
|
555
|
+
}
|
|
556
|
+
/** The two Stripe.js calls the shop uses, as Stripe.js declares them (structural; no Stripe import). */
|
|
557
|
+
interface StripeJsLike {
|
|
558
|
+
handleNextAction(options: {
|
|
559
|
+
clientSecret: string;
|
|
560
|
+
}): Promise<{
|
|
561
|
+
error?: {
|
|
562
|
+
message?: string;
|
|
563
|
+
};
|
|
564
|
+
}>;
|
|
565
|
+
confirmSetup(options: {
|
|
566
|
+
clientSecret: string;
|
|
567
|
+
elements?: unknown;
|
|
568
|
+
confirmParams?: Record<string, unknown>;
|
|
569
|
+
redirect?: 'if_required' | 'always';
|
|
570
|
+
}): Promise<{
|
|
571
|
+
error?: {
|
|
572
|
+
message?: string;
|
|
573
|
+
};
|
|
574
|
+
}>;
|
|
575
|
+
}
|
|
576
|
+
interface StripeJsPaymentsOptions {
|
|
577
|
+
/** The Payment Element instance the host mounted for card entry (`stripe.elements({clientSecret})`). */
|
|
578
|
+
readonly elementsFor?: (clientSecret: string) => unknown;
|
|
579
|
+
/** Where Stripe returns after a redirect-based method. Https only. */
|
|
580
|
+
readonly returnUrl?: string;
|
|
581
|
+
}
|
|
582
|
+
/** A `ShopPaymentsPort` over a Stripe.js instance the host loaded with the shop's publishable key. */
|
|
583
|
+
declare function createStripeJsPayments(stripe: StripeJsLike, options?: StripeJsPaymentsOptions): ShopPaymentsPort;
|
|
584
|
+
|
|
585
|
+
/** Keys for one user action. `key(step)` is stable until `next(step)`. */
|
|
586
|
+
declare class ShopActionKeys {
|
|
587
|
+
private readonly make;
|
|
588
|
+
private readonly keys;
|
|
589
|
+
constructor(make?: () => string);
|
|
590
|
+
key(step: string): string;
|
|
591
|
+
/** A fresh key for this step (after 3-D Secure, or after a refusal the customer fixed). */
|
|
592
|
+
next(step: string): string;
|
|
593
|
+
}
|
|
594
|
+
type ShopConfirmOutcome = {
|
|
595
|
+
readonly kind: 'confirmed';
|
|
596
|
+
readonly orderIds: readonly string[];
|
|
597
|
+
}
|
|
598
|
+
/** The bank wants 3-D Secure and the host gave no payments port; the order can be paid later from its page. */
|
|
599
|
+
| {
|
|
600
|
+
readonly kind: 'needsPayerAction';
|
|
601
|
+
readonly orderIds: readonly string[];
|
|
602
|
+
}
|
|
603
|
+
/** The step failed (the bank refused it, or it could not run). Stripe's own line when it gave one. */
|
|
604
|
+
| {
|
|
605
|
+
readonly kind: 'payerActionFailed';
|
|
606
|
+
readonly orderIds: readonly string[];
|
|
607
|
+
readonly message: string | null;
|
|
608
|
+
}
|
|
609
|
+
/** The customer closed the step themselves. Nothing was refused; the order can be paid later from its page. */
|
|
610
|
+
| {
|
|
611
|
+
readonly kind: 'payerActionClosed';
|
|
612
|
+
readonly orderIds: readonly string[];
|
|
613
|
+
} | {
|
|
614
|
+
readonly kind: 'failed';
|
|
615
|
+
readonly error: OmsError;
|
|
616
|
+
};
|
|
617
|
+
|
|
618
|
+
interface ShopPackageLine {
|
|
619
|
+
readonly offerId: string;
|
|
620
|
+
readonly quantity: number;
|
|
621
|
+
readonly petId: string | null;
|
|
622
|
+
/** Null when the offer could not be read (no longer sold): the row shows as out of stock. */
|
|
623
|
+
readonly offer: OmsOffer | null;
|
|
624
|
+
}
|
|
625
|
+
interface ShopPackage {
|
|
626
|
+
readonly plan: OmsPlan;
|
|
627
|
+
readonly review: OmsCycleReview;
|
|
628
|
+
readonly lines: readonly ShopPackageLine[];
|
|
629
|
+
/** The taxed draft the owner approves; null when no review is open or the draft was refused. */
|
|
630
|
+
readonly draft: OmsCycleDraft | null;
|
|
631
|
+
}
|
|
632
|
+
interface ShopPackageSource {
|
|
633
|
+
/** The household's package this month; `ok(null)` when there is no plan yet (first run, not designed). */
|
|
634
|
+
load(): Promise<OmsResult<ShopPackage | null>>;
|
|
635
|
+
/** Take one line out of this month's package only. */
|
|
636
|
+
removeLine(pkg: ShopPackage, index: number, keys: ShopActionKeys): Promise<OmsResult<ShopPackage | null>>;
|
|
637
|
+
skip(pkg: ShopPackage, keys: ShopActionKeys): Promise<OmsResult<void>>;
|
|
638
|
+
approve(pkg: ShopPackage, keys: ShopActionKeys, payments: ShopPaymentsPort | null): Promise<ShopConfirmOutcome>;
|
|
639
|
+
}
|
|
640
|
+
/** The stub: no package, ever. The Package tab stays hidden. */
|
|
641
|
+
declare const UNAVAILABLE_PACKAGE_SOURCE: ShopPackageSource;
|
|
642
|
+
/** The package over the OMS plan review routes (PROVISIONAL, see the header). */
|
|
643
|
+
declare function createOmsPackageSource(client: OmsClient): ShopPackageSource;
|
|
644
|
+
|
|
645
|
+
declare const SHOP_COPY: {
|
|
646
|
+
tabsLabel: string;
|
|
647
|
+
tabPackage: string;
|
|
648
|
+
tabShop: string;
|
|
649
|
+
tabOrders: string;
|
|
650
|
+
tabPlan: string;
|
|
651
|
+
/** careShop.ts CARE_LEGAL: the packet's legal line without "Sample products and prices." (HANDOFF). */
|
|
652
|
+
legal: string;
|
|
653
|
+
/** care-tracking.html legal line, without "Sample products and prices." */
|
|
654
|
+
legalTracking: string;
|
|
655
|
+
loadFailed: (thing: string) => string;
|
|
656
|
+
tryAgain: string;
|
|
657
|
+
actionFailed: string;
|
|
658
|
+
saving: string;
|
|
659
|
+
keepIt: string;
|
|
660
|
+
/** pet-pack.html sheet close button. */
|
|
661
|
+
close: string;
|
|
662
|
+
thingPackage: string;
|
|
663
|
+
thingShop: string;
|
|
664
|
+
thingProduct: string;
|
|
665
|
+
thingPlan: string;
|
|
666
|
+
/** WebOrdersPage.tsx: "We couldn’t load your orders." */
|
|
667
|
+
thingOrders: string;
|
|
668
|
+
/** WebOrderPage.tsx: "We couldn’t load this order." */
|
|
669
|
+
thingOrder: string;
|
|
670
|
+
packageTitle: (month: string) => string;
|
|
671
|
+
packageSub: (names: readonly string[], reviewBy: string | null, arrives: string | null) => string | null;
|
|
672
|
+
inThisPackage: string;
|
|
673
|
+
reviewBy: (day: string) => string;
|
|
674
|
+
forPet: (name: string) => string;
|
|
675
|
+
details: string;
|
|
676
|
+
remove: string;
|
|
677
|
+
removed: string;
|
|
678
|
+
total: string;
|
|
679
|
+
items: string;
|
|
680
|
+
shipping: string;
|
|
681
|
+
tax: string;
|
|
682
|
+
free: string;
|
|
683
|
+
approveAndShip: string;
|
|
684
|
+
/** Raph's phone Care (care, card head pill): "4 items". No phone line for one item yet. */
|
|
685
|
+
itemCount: (n: number) => string;
|
|
686
|
+
/** Raph's phone Care tray bar: "Approve and ship · $138.26". */
|
|
687
|
+
withTotal: (label: string, total: string) => string;
|
|
688
|
+
/** care.html aside aria-label. */
|
|
689
|
+
approveRegion: string;
|
|
690
|
+
/** care-tracking.html / care-plan.html / care-product.html aside aria-labels. */
|
|
691
|
+
packageDetailsRegion: string;
|
|
692
|
+
deliveryPaymentRegion: string;
|
|
693
|
+
questionsRegion: string;
|
|
694
|
+
approving: string;
|
|
695
|
+
skipThisMonth: string;
|
|
696
|
+
/** careShop.ts chargedLine. Raph's line; see the report: the card is HELD at approval, captured after acceptance. */
|
|
697
|
+
chargedWhenShips: (card: string) => string;
|
|
698
|
+
rxCheckedFirst: string;
|
|
699
|
+
delivery: string;
|
|
700
|
+
arrives: (day: string) => string;
|
|
701
|
+
change: string;
|
|
702
|
+
outOfStock: string;
|
|
703
|
+
/** careShop.ts PACKAGE_OUT_OF_STOCK. */
|
|
704
|
+
packageOutOfStock: string;
|
|
705
|
+
/** careShop.ts packageEmptyLine. */
|
|
706
|
+
packageEmpty: (month: string) => string;
|
|
707
|
+
/** A line whose offer is no longer sold: no packet line names it. */
|
|
708
|
+
itemNoLongerSold: string;
|
|
709
|
+
/** PLAN-APPROVAL-BUILD 8: review closed, approval in progress, draft expired, price changed. */
|
|
710
|
+
reviewClosed: string;
|
|
711
|
+
approvalInProgress: string;
|
|
712
|
+
priceChanged: string;
|
|
713
|
+
cardStepFailed: string;
|
|
714
|
+
/** The member closed the card step (the in-app browser or the hosted page) without finishing: no line names it. */
|
|
715
|
+
cardStepClosed: string;
|
|
716
|
+
noCardOnFile: string;
|
|
717
|
+
shopTitle: string;
|
|
718
|
+
searchLabel: string;
|
|
719
|
+
searchPlaceholder: string;
|
|
720
|
+
filtersLabel: string;
|
|
721
|
+
filterAll: string;
|
|
722
|
+
refillSoon: string;
|
|
723
|
+
inMonthsPackage: (month: string) => string;
|
|
724
|
+
forPets: (names: readonly string[]) => string;
|
|
725
|
+
/** A shelf with no pet names to put in "For Evie and Toast". */
|
|
726
|
+
allProducts: string;
|
|
727
|
+
rx: string;
|
|
728
|
+
/** careShop.ts tileMeta. */
|
|
729
|
+
hasPrescription: (name: string) => string;
|
|
730
|
+
needsPrescription: string;
|
|
731
|
+
noMatches: (q: string) => string;
|
|
732
|
+
nothingHereYet: string;
|
|
733
|
+
photoToCome: string;
|
|
734
|
+
backToShop: string;
|
|
735
|
+
howOften: string;
|
|
736
|
+
/** careShop.ts everyMonthTitle. */
|
|
737
|
+
everyMonthIn: (name: string) => string;
|
|
738
|
+
skipOrStop: string;
|
|
739
|
+
justOnce: string;
|
|
740
|
+
shipsWith: (month: string) => string;
|
|
741
|
+
/** "Just once" is a buy-now checkout on the OMS, not a line in the package: no packet line says so. */
|
|
742
|
+
justOnceShipsNow: string;
|
|
743
|
+
oneFewer: string;
|
|
744
|
+
oneMore: string;
|
|
745
|
+
quantity: string;
|
|
746
|
+
/** careShop.ts addLabel. */
|
|
747
|
+
addToPackage: (month: string) => string;
|
|
748
|
+
refillInPackage: (month: string) => string;
|
|
749
|
+
/** The buy-now and the start-a-plan buttons: no packet line. */
|
|
750
|
+
buyNow: string;
|
|
751
|
+
startPlan: string;
|
|
752
|
+
adding: string;
|
|
753
|
+
outOfStockNow: string;
|
|
754
|
+
prescription: string;
|
|
755
|
+
noPrescriptionFor: (name: string) => string;
|
|
756
|
+
bookVideoVisit: string;
|
|
757
|
+
refillsLeft: (n: number) => string;
|
|
758
|
+
/** Contract 2.1, `rx_being_prepared`. */
|
|
759
|
+
rxBeingPrepared: string;
|
|
760
|
+
/** Contract 5.3 `too_soon` / `refills_used` / `expired`: meanings, no lines yet. */
|
|
761
|
+
rxTooSoon: string;
|
|
762
|
+
rxRenew: string;
|
|
763
|
+
rxPick: string;
|
|
764
|
+
educational: string;
|
|
765
|
+
planTitle: string;
|
|
766
|
+
whatRepeats: string;
|
|
767
|
+
repeatsLabel: (title: string) => string;
|
|
768
|
+
/** careShop.ts cadence. */
|
|
769
|
+
cadenceMonths: (months: number) => string;
|
|
770
|
+
cadenceDays: string;
|
|
771
|
+
/** careShop.ts REPEATS_EMPTY. */
|
|
772
|
+
repeatsEmpty: string;
|
|
773
|
+
nextPackage: string;
|
|
774
|
+
reviewByLabel: string;
|
|
775
|
+
ships: string;
|
|
776
|
+
reviewMonthsPackage: (month: string) => string;
|
|
777
|
+
deliveryAndPayment: string;
|
|
778
|
+
shipTo: string;
|
|
779
|
+
payWith: string;
|
|
780
|
+
needABreak: string;
|
|
781
|
+
skipMonth: (month: string) => string;
|
|
782
|
+
skipMonthAsk: (month: string) => string;
|
|
783
|
+
skipMonthBody: string;
|
|
784
|
+
pausePlan: string;
|
|
785
|
+
pausePlanAsk: string;
|
|
786
|
+
pausePlanBody: string;
|
|
787
|
+
/** careShop.ts declinedLine. */
|
|
788
|
+
declined: (month: string | null) => string;
|
|
789
|
+
resumePlan: string;
|
|
790
|
+
/** Contract 8.5 stop reasons other than payment_declined: no lines yet. */
|
|
791
|
+
stopReason: (reason: string) => string;
|
|
792
|
+
consentTitle: string;
|
|
793
|
+
consentBody: string;
|
|
794
|
+
consentTermsLink: string;
|
|
795
|
+
consentAgree: string;
|
|
796
|
+
ordersTitle: string;
|
|
797
|
+
ordersSub: (names: readonly string[]) => string;
|
|
798
|
+
allOrders: string;
|
|
799
|
+
/** careOrders.ts orderRow. */
|
|
800
|
+
placed: (day: string) => string;
|
|
801
|
+
/** HANDOFF care-orders Empty. */
|
|
802
|
+
ordersEmpty: string;
|
|
803
|
+
paymentFailed: string;
|
|
804
|
+
backToCare: string;
|
|
805
|
+
onItsWay: (title: string) => string;
|
|
806
|
+
shouldArrive: (day: string) => string;
|
|
807
|
+
whereItStands: string;
|
|
808
|
+
stepApproved: string;
|
|
809
|
+
stepChecking: string;
|
|
810
|
+
stepFilled: string;
|
|
811
|
+
stepShipped: string;
|
|
812
|
+
stepDelivered: string;
|
|
813
|
+
now: string;
|
|
814
|
+
expected: (day: string) => string;
|
|
815
|
+
inTheBox: string;
|
|
816
|
+
payment: string;
|
|
817
|
+
cancelOrder: string;
|
|
818
|
+
payOrder: string;
|
|
819
|
+
trackPackage: string;
|
|
820
|
+
/** Contract 5.1 "Show as". */
|
|
821
|
+
orderStatus: Readonly<Record<string, string>>;
|
|
822
|
+
addressTitle: string;
|
|
823
|
+
addressLabel: string;
|
|
824
|
+
addressRecipient: string;
|
|
825
|
+
addressLine1: string;
|
|
826
|
+
addressLine2: string;
|
|
827
|
+
addressCity: string;
|
|
828
|
+
addressRegion: string;
|
|
829
|
+
addressPostal: string;
|
|
830
|
+
addressSave: string;
|
|
831
|
+
addressNeeded: string;
|
|
832
|
+
cardTitle: string;
|
|
833
|
+
cardBody: string;
|
|
834
|
+
cardStart: string;
|
|
835
|
+
cardUnavailable: string;
|
|
836
|
+
confirmTitle: string;
|
|
837
|
+
confirmPay: string;
|
|
838
|
+
/** Contract 2.1 "Show" lines. */
|
|
839
|
+
refusal: Readonly<Record<string, string>>;
|
|
840
|
+
rateLimited: string;
|
|
841
|
+
};
|
|
842
|
+
type ShopCopy = typeof SHOP_COPY;
|
|
843
|
+
/** The placeholder keys in `SHOP_COPY`, for the report and for a host filling them in. */
|
|
844
|
+
declare const SHOP_COPY_PLACEHOLDERS: readonly string[];
|
|
845
|
+
/** The host's words over the defaults. */
|
|
846
|
+
declare function shopCopy(overrides?: Partial<ShopCopy>): ShopCopy;
|
|
847
|
+
|
|
848
|
+
interface ShopPet {
|
|
849
|
+
readonly petId: string;
|
|
850
|
+
readonly name: string;
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
type ShopRoute = {
|
|
854
|
+
readonly name: 'package';
|
|
855
|
+
} | {
|
|
856
|
+
readonly name: 'shop';
|
|
857
|
+
readonly query?: string;
|
|
858
|
+
} | {
|
|
859
|
+
readonly name: 'product';
|
|
860
|
+
readonly offerId: string;
|
|
861
|
+
readonly petId?: string;
|
|
862
|
+
} | {
|
|
863
|
+
readonly name: 'plan';
|
|
864
|
+
} | {
|
|
865
|
+
readonly name: 'orders';
|
|
866
|
+
} | {
|
|
867
|
+
readonly name: 'order';
|
|
868
|
+
readonly orderId: string;
|
|
869
|
+
} | {
|
|
870
|
+
readonly name: 'address';
|
|
871
|
+
readonly then?: ShopRoute;
|
|
872
|
+
} | {
|
|
873
|
+
readonly name: 'card';
|
|
874
|
+
readonly then?: ShopRoute;
|
|
875
|
+
} | {
|
|
876
|
+
readonly name: 'buy';
|
|
877
|
+
readonly offerId: string;
|
|
878
|
+
readonly quantity: number;
|
|
879
|
+
readonly petId?: string;
|
|
880
|
+
readonly rxId?: string;
|
|
881
|
+
} | {
|
|
882
|
+
readonly name: 'consent';
|
|
883
|
+
readonly offerId: string;
|
|
884
|
+
readonly quantity: number;
|
|
885
|
+
readonly petId?: string;
|
|
886
|
+
readonly rxId?: string;
|
|
887
|
+
};
|
|
888
|
+
type ShopTabName = 'package' | 'shop' | 'orders' | 'plan';
|
|
889
|
+
|
|
890
|
+
/**
|
|
891
|
+
* How a card step that left the page came back, for a host whose card steps are full-page redirects (the web): the
|
|
892
|
+
* host reads its return URL and hands the outcome to the shop once. `card` is saving a card (shown on the card page),
|
|
893
|
+
* `cardAction` an order's 3-D Secure step (shown on that order's page). `done` shows no line: the page reads the
|
|
894
|
+
* saved cards or the order again.
|
|
895
|
+
*/
|
|
896
|
+
interface ShopCardReturn {
|
|
897
|
+
readonly step: 'card' | 'cardAction';
|
|
898
|
+
readonly outcome: 'done' | 'closed' | 'failed';
|
|
899
|
+
}
|
|
900
|
+
/**
|
|
901
|
+
* A card saved outside the shop's own Stripe step: React Native opens a hosted page in an in-app browser and reports
|
|
902
|
+
* how it ended (`closed` when the member left it themselves). The shop then reads the saved cards again; no card data
|
|
903
|
+
* or secret passes through the shop. On the web it sends the page to the hosted setup page and need not resolve; the
|
|
904
|
+
* outcome comes back through the host's URL as `cardReturn`.
|
|
905
|
+
*/
|
|
906
|
+
type ShopCardHandoff = () => Promise<ShopPaymentStepResult>;
|
|
907
|
+
|
|
908
|
+
declare function newIdempotencyKey(): string;
|
|
909
|
+
|
|
910
|
+
export { isOmsUnavailable as A, newIdempotencyKey as B, shopCopy as C, type OmsCardActionLink as D, type OmsCardSetupLink as E, type ShopPayerActionContext as F, type OmsClient as O, type ShopPet as S, UNAVAILABLE_PACKAGE_SOURCE as U, type ShopPaymentsPort as a, type ShopPackageSource as b, type ShopCopy as c, type ShopRoute as d, type ShopCardHandoff as e, type ShopCardReturn as f, type OmsCartLine as g, type OmsClientConfig as h, type OmsConsumerAuth as i, type OmsError as j, type OmsGetToken as k, type OmsPlanOperation as l, type OmsResult as m, SHOP_COPY as n, SHOP_COPY_PLACEHOLDERS as o, type ShopPackage as p, type ShopPackageLine as q, type ShopPaymentStepResult as r, type ShopTabName as s, type StripeJsLike as t, type StripeJsPaymentsOptions as u, createOmsClient as v, createOmsPackageSource as w, createStripeJsPayments as x, isOmsRefusal as y, isOmsRetryable as z };
|