@everfur/sdk 0.17.0 → 0.18.1
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 +167 -26
- package/care/package.json +8 -0
- package/dist/{Chat.d-uETscjrL.d.ts → Chat.d-Bz4iJ7d2.d.ts} +1 -1
- package/dist/{Chat.d-BYY1U61e.d.cts → Chat.d-C2ddC2u7.d.cts} +1 -1
- package/dist/{DepthViews.d-BsZ73mzL.d.ts → DepthViews.d-C6-Kzs6H.d.ts} +1 -1
- package/dist/{DepthViews.d-D_Qp4glO.d.cts → DepthViews.d-Chjs8H9V.d.cts} +1 -1
- package/dist/{DepthViews.d-DL8MP_kA.d.cts → DepthViews.d-pFL_ZBZT.d.cts} +1 -1
- package/dist/{DepthViews.d-B4SE5GUD.d.ts → DepthViews.d-qXt9OMgz.d.ts} +1 -1
- package/dist/{RecordsPage.d-CYotk2R9.d.cts → RecordsPage.d-Cmny6Q7g.d.cts} +2 -2
- package/dist/{RecordsPage.d-D4gP4leq.d.ts → RecordsPage.d-sNRolVdy.d.ts} +2 -2
- package/dist/animations/index.d.cts +5 -5
- package/dist/animations/index.d.ts +5 -5
- package/dist/{appStateLifecycle.d-DJXdDOJY.d.cts → appStateLifecycle.d-Bt70TQog.d.cts} +7 -7
- package/dist/{appStateLifecycle.d-CXJzBS3c.d.ts → appStateLifecycle.d-Jdg9_PFt.d.ts} +7 -7
- package/dist/{attachments.d-B8kOCb6q.d.cts → attachments.d-BVp3r6Ms.d.cts} +5 -5
- package/dist/{attachments.d-C61URT8r.d.cts → attachments.d-CF4_n-DZ.d.cts} +2 -2
- package/dist/{attachments.d-BTIGzXWD.d.ts → attachments.d-DnSCMjH0.d.ts} +5 -5
- package/dist/{attachments.d-BgatKf7d.d.ts → attachments.d-DsUZpMad.d.ts} +2 -2
- package/dist/{bookingCopy.d-B-bSYgqS.d.cts → bookingCopy.d-BHqE9Ozq.d.cts} +16 -16
- package/dist/{bookingCopy.d-JQW2SLM-.d.ts → bookingCopy.d-Ca4AQGZ7.d.ts} +16 -16
- package/dist/{branding.d-Bbc6p1XY.d.cts → branding.d-BFauULV6.d.cts} +1 -1
- package/dist/{branding.d-y6c0UwhE.d.ts → branding.d-DpNGEdDL.d.ts} +1 -1
- package/dist/care/index.cjs +3 -0
- package/dist/care/index.d.cts +434 -0
- package/dist/care/index.d.ts +434 -0
- package/dist/care/index.js +3 -0
- package/dist/{casesRepository.d-CVG2EXcg.d.cts → casesRepository.d-DFwD2kiS.d.cts} +1 -1
- package/dist/{casesRepository.d-CHEjzT4h.d.ts → casesRepository.d-VzxEyq2N.d.ts} +1 -1
- package/dist/chat/index.cjs +14 -13
- package/dist/chat/index.d.cts +13 -13
- package/dist/chat/index.d.ts +13 -13
- package/dist/chat/index.js +14 -13
- package/dist/chat/lite/index.cjs +14 -13
- package/dist/chat/lite/index.d.cts +13 -13
- package/dist/chat/lite/index.d.ts +13 -13
- package/dist/chat/lite/index.js +14 -13
- package/dist/chunk-Y3Q4GW47.js +31 -0
- package/dist/client/index.cjs +1 -1
- package/dist/client/index.d.cts +10 -10
- package/dist/client/index.d.ts +10 -10
- package/dist/client/index.js +1 -1
- package/dist/{clinicBatch.d-DdlFy4pD.d.cts → clinicBatch.d-CLqaih2C.d.cts} +2 -2
- package/dist/{clinicBatch.d-oNwH_dbI.d.ts → clinicBatch.d-DXDIL1lC.d.ts} +2 -2
- package/dist/{config.d-Cy_hJBJG.d.cts → config.d-7bCXvOGn.d.cts} +1 -1
- package/dist/{config.d-DopRLD4f.d.ts → config.d-cqyvpzDb.d.ts} +1 -1
- package/dist/consent/index.d.cts +5 -5
- package/dist/consent/index.d.ts +5 -5
- package/dist/{context.d-C42juGn6.d.cts → context.d-BeRanUXQ.d.cts} +7 -7
- package/dist/{context.d-Ban-Hhqu.d.ts → context.d-DAnmDYGr.d.ts} +7 -7
- package/dist/{copy.d-BTS5l6Ri.d.cts → copy.d-BPqs8swm.d.cts} +2 -2
- package/dist/{copy.d-qdbygul9.d.ts → copy.d-CxFzeuvo.d.ts} +2 -2
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.cts +17 -17
- package/dist/core/index.d.ts +17 -17
- package/dist/core/index.js +1 -1
- package/dist/{depth.d-BGkHm2Se.d.ts → depth.d-C6XbnFig.d.ts} +2 -2
- package/dist/{depth.d-BfVrhq9o.d.cts → depth.d-qHdXHDd-.d.cts} +2 -2
- package/dist/{entitlementRepository.d-npT7L_7_.d.cts → entitlementRepository.d-C6uTDswj.d.cts} +4 -4
- package/dist/{entitlementRepository.d-CjwqCyhS.d.ts → entitlementRepository.d-D_cc7g4l.d.ts} +4 -4
- package/dist/{focus.d-S0nq_k1A.d.ts → focus.d-DiWvQR2j.d.ts} +193 -21
- package/dist/{focus.d-DS7Ze1Pp.d.cts → focus.d-HSkMHd-i.d.cts} +193 -21
- package/dist/health-plan/index.cjs +261 -176
- package/dist/health-plan/index.d.cts +627 -19
- package/dist/health-plan/index.d.ts +627 -19
- package/dist/health-plan/index.js +261 -176
- package/dist/{idempotency.d-COIrwuCb.d.ts → idempotency.d-CF5AvlYp.d.ts} +18 -639
- package/dist/{idempotency.d-gfiN4Qnp.d.cts → idempotency.d-DrO2zEZO.d.cts} +18 -639
- package/dist/{identity.d-D76vXtkJ.d.cts → identity.d-84x0dV7-.d.cts} +1 -1
- package/dist/{identity.d-B3mFvvRq.d.ts → identity.d-BXztMVYM.d.ts} +1 -1
- package/dist/index.cjs +12 -11
- package/dist/index.d.cts +21 -21
- package/dist/index.d.ts +21 -21
- package/dist/index.js +12 -11
- package/dist/{introEvents.d-3FLEemX3.d.cts → introEvents.d-Cwv72ER-.d.cts} +11 -11
- package/dist/{introEvents.d-BYnr37bd.d.ts → introEvents.d-DYU3znJs.d.ts} +11 -11
- package/dist/notifications/index.d.cts +4 -4
- package/dist/notifications/index.d.ts +4 -4
- package/dist/omsErrors.d-VF5tnr20.d.cts +633 -0
- package/dist/omsErrors.d-VF5tnr20.d.ts +633 -0
- package/dist/omsFields.d-BHntKIAH.d.cts +153 -0
- package/dist/omsFields.d-Cvfw8wWU.d.ts +153 -0
- package/dist/{optInView.d-DXRUGDiD.d.cts → optInView.d-4Hl4HbQh.d.cts} +3 -3
- package/dist/{optInView.d-BqFMcum4.d.ts → optInView.d-pq8tUTf6.d.ts} +3 -3
- package/dist/{parse.d-CY22hFxb.d.ts → parse.d-BJhhYfkv.d.ts} +1 -1
- package/dist/{parse.d-rvA_aRSO.d.cts → parse.d-D0v06qxx.d.cts} +1 -1
- package/dist/{pets.d-Cicz-aIO.d.ts → pets.d-1_CHpfgB.d.ts} +1 -1
- package/dist/{pets.d-RoHTZsaV.d.cts → pets.d-C4n-MDC4.d.cts} +1 -1
- package/dist/{petsRepository.d-DtAZf_Ja.d.ts → petsRepository.d-BuomdFjZ.d.ts} +1 -1
- package/dist/{petsRepository.d-BxMyt6Aj.d.cts → petsRepository.d-Dd95xh-M.d.cts} +1 -1
- package/dist/{ports.d-D7cjFUoL.d.cts → ports.d-Bf3tp7Pn.d.cts} +4 -4
- package/dist/{ports.d-DrgKa73F.d.ts → ports.d-ChZHFd-q.d.ts} +4 -4
- package/dist/{presentation.d-vy8kTGfR.d.cts → presentation.d-Bs8xQ4gD.d.cts} +4 -4
- package/dist/{presentation.d-vy8kTGfR.d.ts → presentation.d-Bs8xQ4gD.d.ts} +4 -4
- package/dist/records/depth/index.d.cts +9 -9
- package/dist/records/depth/index.d.ts +9 -9
- package/dist/records/index.cjs +11 -10
- package/dist/records/index.d.cts +24 -23
- package/dist/records/index.d.ts +24 -23
- package/dist/records/index.js +11 -10
- package/dist/{requestFunnel.d-BdQf53zs.d.cts → requestFunnel.d-CWI2pD3V.d.cts} +2 -2
- package/dist/{requestFunnel.d-B5y7Py8Z.d.ts → requestFunnel.d-DcQIAs45.d.ts} +2 -2
- package/dist/{resolve.d-CoQWUy1Y.d.cts → resolve.d-BTC3b6FW.d.cts} +1 -1
- package/dist/{resolve.d-CoQWUy1Y.d.ts → resolve.d-BTC3b6FW.d.ts} +1 -1
- package/dist/{runtimeTypes.d-r4Q5vASZ.d.cts → runtimeTypes.d-CIOVzjEK.d.cts} +6 -6
- package/dist/{runtimeTypes.d-D5EDgS3Y.d.ts → runtimeTypes.d-rbuONrIv.d.ts} +6 -6
- package/dist/{screenProps.d-v4a4kzxA.d.cts → screenProps.d-CFZe27oI.d.cts} +1 -1
- package/dist/{screenProps.d-KLCrP43b.d.ts → screenProps.d-yUA4k6yK.d.ts} +1 -1
- package/dist/server/events/index.cjs +2 -2
- package/dist/server/events/index.d.cts +49 -6
- package/dist/server/events/index.d.ts +49 -6
- package/dist/server/events/index.js +2 -2
- package/dist/server/index.cjs +1 -1
- package/dist/server/index.d.cts +3 -3
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +1 -1
- package/dist/shop/index.cjs +6 -6
- package/dist/shop/index.d.cts +9 -8
- package/dist/shop/index.d.ts +9 -8
- package/dist/shop/index.js +6 -6
- package/dist/shop/orders-v2/index.d.cts +2 -2
- package/dist/shop/orders-v2/index.d.ts +2 -2
- package/dist/tabs/index.cjs +4 -4
- package/dist/tabs/index.d.cts +14 -14
- package/dist/tabs/index.d.ts +14 -14
- package/dist/tabs/index.js +4 -4
- package/dist/{tabsModel.d-B7QMug1u.d.ts → tabsModel.d-D9GWPFrL.d.cts} +1 -1
- package/dist/{tabsModel.d-B7QMug1u.d.cts → tabsModel.d-D9GWPFrL.d.ts} +1 -1
- package/dist/televet/booking/index.d.cts +6 -6
- package/dist/televet/booking/index.d.ts +6 -6
- package/dist/testing/index.cjs +1 -1
- package/dist/testing/index.d.cts +85 -2
- package/dist/testing/index.d.ts +85 -2
- package/dist/testing/index.js +1 -1
- package/dist/testing/rn/index.d.cts +10 -10
- package/dist/testing/rn/index.d.ts +10 -10
- package/dist/testing/web/index.d.cts +10 -10
- package/dist/testing/web/index.d.ts +10 -10
- package/dist/texting/index.d.cts +6 -6
- package/dist/texting/index.d.ts +6 -6
- package/dist/{threadOptions.d-EFJaNBP1.d.cts → threadOptions.d-CRbFXnlq.d.cts} +66 -11
- package/dist/{threadOptions.d-GPJPprkn.d.cts → threadOptions.d-CW51PyVd.d.cts} +28 -1
- package/dist/{threadOptions.d-GPJPprkn.d.ts → threadOptions.d-CW51PyVd.d.ts} +28 -1
- package/dist/{threadOptions.d-B0folrKm.d.cts → threadOptions.d-U5YBUKM-.d.ts} +2 -2
- package/dist/{threadOptions.d-Crh_LiDe.d.ts → threadOptions.d-aK8FkszA.d.ts} +66 -11
- package/dist/{threadOptions.d-DTsJFkL-.d.ts → threadOptions.d-bEAFkIsC.d.cts} +2 -2
- package/dist/{timelineRows.d-DpSis9HR.d.ts → timelineRows.d-BbCLvjy1.d.ts} +1 -1
- package/dist/{timelineRows.d-6-Cw8xGd.d.cts → timelineRows.d-BvA_BoOe.d.cts} +1 -1
- package/dist/{typeStyle.d-B3Kdtjie.d.ts → typeStyle.d-B9Jo5mDX.d.ts} +1 -1
- package/dist/{typeStyle.d-DmlwyJq-.d.cts → typeStyle.d-Ckdh_S-t.d.cts} +1 -1
- package/dist/types.d-d3RdaeAA.d.cts +317 -0
- package/dist/types.d-d3RdaeAA.d.ts +317 -0
- package/dist/ui/index.cjs +68 -0
- package/dist/ui/index.d.cts +73 -0
- package/dist/ui/index.d.ts +73 -0
- package/dist/ui/index.js +68 -0
- package/dist/useHealthPlanSubscription.d-BN40CVK6.d.cts +756 -0
- package/dist/useHealthPlanSubscription.d-BYehTI7R.d.ts +756 -0
- package/dist/{usePresentation.d-CRG3Gaaq.d.ts → usePresentation.d-BfcyAEFt.d.ts} +66 -7
- package/dist/{usePresentation.d-C8rqY56C.d.cts → usePresentation.d-C39kKhoO.d.cts} +66 -7
- package/dist/{useRecordsDepth.d-DlRda5jp.d.ts → useRecordsDepth.d-B2ewVbRm.d.ts} +1 -1
- package/dist/{useRecordsDepth.d-BYk7m7gF.d.cts → useRecordsDepth.d-CKXAAHXI.d.cts} +1 -1
- package/dist/{view.d-DuIXHr08.d.ts → view.d-BnUDSQXz.d.ts} +3 -3
- package/dist/{view.d-B31M8rCG.d.cts → view.d-CbcJKNJj.d.cts} +1 -1
- package/dist/{view.d-B31M8rCG.d.ts → view.d-CbcJKNJj.d.ts} +1 -1
- package/dist/{view.d-CLpEHKOp.d.cts → view.d-DTNPjiZ1.d.cts} +3 -3
- package/dist/web/consent/index.d.cts +5 -5
- package/dist/web/consent/index.d.ts +5 -5
- package/dist/web/health-plan/index.cjs +335 -180
- package/dist/web/health-plan/index.d.cts +576 -19
- package/dist/web/health-plan/index.d.ts +576 -19
- package/dist/web/health-plan/index.js +297 -162
- package/dist/web/health-plan/styles.css +233 -0
- package/dist/web/health-plan/today/index.cjs +7 -0
- package/dist/web/health-plan/today/index.d.cts +15 -0
- package/dist/web/health-plan/today/index.d.ts +15 -0
- package/dist/web/health-plan/today/index.js +7 -0
- package/dist/web/index.cjs +36 -33
- package/dist/web/index.d.cts +60 -37
- package/dist/web/index.d.ts +60 -37
- package/dist/web/index.js +36 -33
- package/dist/web/intro/index.cjs +2 -2
- package/dist/web/intro/index.d.cts +8 -8
- package/dist/web/intro/index.d.ts +8 -8
- package/dist/web/intro/index.js +2 -2
- package/dist/web/notifications/index.d.cts +3 -3
- package/dist/web/notifications/index.d.ts +3 -3
- package/dist/web/records/depth/index.d.cts +9 -9
- package/dist/web/records/depth/index.d.ts +9 -9
- package/dist/web/records/index.cjs +1 -1
- package/dist/web/records/index.d.cts +11 -11
- package/dist/web/records/index.d.ts +11 -11
- package/dist/web/records/index.js +1 -1
- package/dist/web/records-sheet/index.cjs +13 -12
- package/dist/web/records-sheet/index.d.cts +13 -10
- package/dist/web/records-sheet/index.d.ts +13 -10
- package/dist/web/records-sheet/index.js +13 -12
- package/dist/web/shop/index.cjs +6 -6
- package/dist/web/shop/index.d.cts +8 -7
- package/dist/web/shop/index.d.ts +8 -7
- package/dist/web/shop/index.js +6 -6
- package/dist/web/shop/orders-v2/index.d.cts +1 -1
- package/dist/web/shop/orders-v2/index.d.ts +1 -1
- package/dist/web/televet/booking/index.cjs +1 -1
- package/dist/web/televet/booking/index.d.cts +6 -6
- package/dist/web/televet/booking/index.d.ts +6 -6
- package/dist/web/televet/booking/index.js +1 -1
- package/dist/web/texting/index.cjs +1 -1
- package/dist/web/texting/index.d.cts +6 -6
- package/dist/web/texting/index.d.ts +6 -6
- package/dist/web/texting/index.js +1 -1
- package/dist/web/ui/index.cjs +70 -0
- package/dist/web/ui/index.d.cts +78 -0
- package/dist/web/ui/index.d.ts +78 -0
- package/dist/web/ui/index.js +48 -0
- package/dist/web/ui/styles.css +244 -0
- package/package.json +71 -5
- package/ui/package.json +8 -0
- package/web/health-plan/today/native-blocked.cjs +12 -0
- package/web/health-plan/today/package.json +8 -0
- package/web/ui/native-blocked.cjs +12 -0
- package/web/ui/package.json +8 -0
- package/dist/useHealthPlanSubscription.d-DD30EkUR.d.ts +0 -205
- package/dist/useHealthPlanSubscription.d-DWrzUXf4.d.cts +0 -205
|
@@ -0,0 +1,633 @@
|
|
|
1
|
+
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
|
+
/** Integer cents, USD (`4599` is $45.99). Never a float. */
|
|
3
|
+
type OmsCents = number;
|
|
4
|
+
type OmsDeliverySpeed = 'ground' | 'two_day' | 'next_day';
|
|
5
|
+
/** `GET /oms/shop-config`. Each null hides one feature (contract 4.17). */
|
|
6
|
+
interface OmsShopConfig {
|
|
7
|
+
/** Null hides auto-ship (plans). */
|
|
8
|
+
readonly recurringTermsVersion: string | null;
|
|
9
|
+
readonly recurringTermsUrl: string | null;
|
|
10
|
+
/** Null hides card entry. */
|
|
11
|
+
readonly stripePublishableKey: string | null;
|
|
12
|
+
/** Null means the shop's terms are not written yet: a quote would answer 409. */
|
|
13
|
+
readonly delivery: {
|
|
14
|
+
readonly firstFill: OmsDeliverySpeed | null;
|
|
15
|
+
readonly refill: OmsDeliverySpeed | null;
|
|
16
|
+
} | null;
|
|
17
|
+
/**
|
|
18
|
+
* The parts of the member's own profile a prescription order needs and lacks (`first_name`, `last_name`, `email`,
|
|
19
|
+
* `phone`); empty when nothing is missing. Optional: older servers do not send it (CONTRACT-NOTES section 2).
|
|
20
|
+
*/
|
|
21
|
+
readonly rxContactMissing?: readonly string[] | null;
|
|
22
|
+
/**
|
|
23
|
+
* Everyday orders at or over this ship free (`free_shipping_threshold_cents`, Care > Orders v2). Optional: older
|
|
24
|
+
* servers do not send it; absent or null, the cart bar says nothing about shipping.
|
|
25
|
+
*/
|
|
26
|
+
readonly freeShippingThresholdCents?: OmsCents | null;
|
|
27
|
+
/**
|
|
28
|
+
* The cents off an eligible owner's first prescription once it is filled (`first_rx_discount_cents`, VET50, 5000).
|
|
29
|
+
* Optional: older servers do not send it; absent or null, the cart bar shows no discount (CONTRACT.md section 10).
|
|
30
|
+
*/
|
|
31
|
+
readonly firstRxDiscountCents?: OmsCents | null;
|
|
32
|
+
}
|
|
33
|
+
type OmsPackUnit = 'each' | 'gram' | 'milliliter';
|
|
34
|
+
/** One active offer (contract 4.1). */
|
|
35
|
+
interface OmsOffer {
|
|
36
|
+
readonly offerId: string;
|
|
37
|
+
readonly sku: string;
|
|
38
|
+
readonly title: string;
|
|
39
|
+
readonly fulfillmentType: string;
|
|
40
|
+
readonly requiresRx: boolean;
|
|
41
|
+
readonly compounded: boolean;
|
|
42
|
+
/** A decimal string ("30"), or null. */
|
|
43
|
+
readonly packQuantity: string | null;
|
|
44
|
+
readonly packUnit: OmsPackUnit | null;
|
|
45
|
+
/** One unit before any discount; null until the shop's commercial terms are written (contract 8.1). */
|
|
46
|
+
readonly price: OmsCents | null;
|
|
47
|
+
/**
|
|
48
|
+
* The product's photo, an https URL, when the catalog sends one (`image_url`; not in the contract yet, the pharmacy
|
|
49
|
+
* feed sends none today). Absent or null: the shop draws the drug-form tile.
|
|
50
|
+
*/
|
|
51
|
+
readonly imageUrl?: string | null;
|
|
52
|
+
}
|
|
53
|
+
interface OmsOfferPage {
|
|
54
|
+
readonly offers: readonly OmsOffer[];
|
|
55
|
+
/** Pass back as `cursor`; null is the last page. */
|
|
56
|
+
readonly nextCursor: string | null;
|
|
57
|
+
}
|
|
58
|
+
/** A cart or plan line. A prescription line names the pet and the prescription (contract 3.5). */
|
|
59
|
+
interface OmsCartLine {
|
|
60
|
+
readonly offerId: string;
|
|
61
|
+
/** 1 to 99. */
|
|
62
|
+
readonly quantity: number;
|
|
63
|
+
readonly petId?: string;
|
|
64
|
+
readonly rxId?: string;
|
|
65
|
+
/**
|
|
66
|
+
* The plan picked for this line: `auto` (auto-ship) or `once`. Absent is `once`. The OMS prices a first order's
|
|
67
|
+
* `auto` line at the auto-ship price when the offer has an auto-ship plan in the Care shop.
|
|
68
|
+
*/
|
|
69
|
+
readonly plan?: 'auto' | 'once';
|
|
70
|
+
}
|
|
71
|
+
interface OmsQuoteLine {
|
|
72
|
+
readonly offerId: string;
|
|
73
|
+
readonly quantity: number;
|
|
74
|
+
readonly petId: string | null;
|
|
75
|
+
readonly unitPrice: OmsCents;
|
|
76
|
+
readonly discount: OmsCents;
|
|
77
|
+
readonly tax: OmsCents;
|
|
78
|
+
/**
|
|
79
|
+
* The part of `discount` taken off once the line is filled (`when_filled_discount_cents`, VET50); 0 for a line
|
|
80
|
+
* charged today. Optional: older servers do not send it (CONTRACT.md section 10).
|
|
81
|
+
*/
|
|
82
|
+
readonly whenFilledDiscountCents?: OmsCents | null;
|
|
83
|
+
/** Sold on a prescription (`is_rx`). Optional: older servers do not send it (null is unknown). */
|
|
84
|
+
readonly isRx?: boolean | null;
|
|
85
|
+
/**
|
|
86
|
+
* The line's order is charged once the pharmacy fills it, not today (`charged_when_filled`). Optional: older servers
|
|
87
|
+
* do not send it (null is unknown).
|
|
88
|
+
*/
|
|
89
|
+
readonly chargedWhenFilled?: boolean | null;
|
|
90
|
+
}
|
|
91
|
+
/** `POST /oms/cart/quote`. Creates nothing; good for 30 minutes. */
|
|
92
|
+
interface OmsQuote {
|
|
93
|
+
readonly lines: readonly OmsQuoteLine[];
|
|
94
|
+
readonly shipping: OmsCents;
|
|
95
|
+
readonly tax: OmsCents;
|
|
96
|
+
readonly total: OmsCents;
|
|
97
|
+
readonly expiresAt: string;
|
|
98
|
+
/** The lines' `whenFilledDiscountCents` summed (`when_filled_discount_cents`). Optional, as on the lines. */
|
|
99
|
+
readonly whenFilledDiscountCents?: OmsCents | null;
|
|
100
|
+
/**
|
|
101
|
+
* The part of `total` charged today (`due_today_cents`). With `dueWhenFilledCents` it splits `total` by when each
|
|
102
|
+
* order is charged. Optional: null where the server made no split or is older.
|
|
103
|
+
*/
|
|
104
|
+
readonly dueTodayCents?: OmsCents | null;
|
|
105
|
+
/** The part of `total` charged once the pharmacy fills it (`due_when_filled_cents`). Optional, as `dueTodayCents`. */
|
|
106
|
+
readonly dueWhenFilledCents?: OmsCents | null;
|
|
107
|
+
/** The box's estimated ship day (`ships_on`, YYYY-MM-DD). Optional: null where the server sends none or is older. */
|
|
108
|
+
readonly shipsOn?: string | null;
|
|
109
|
+
/** The box's estimated arrival day (`arrives_on`, YYYY-MM-DD). Optional, as `shipsOn`. */
|
|
110
|
+
readonly arrivesOn?: string | null;
|
|
111
|
+
}
|
|
112
|
+
type OmsCheckoutState = 'draft' | 'authorizing' | 'confirmed' | 'compensating' | 'failed' | 'expired';
|
|
113
|
+
/** `POST /oms/checkouts` (201). `total` is what confirm will charge. */
|
|
114
|
+
interface OmsCheckout {
|
|
115
|
+
readonly checkoutId: string;
|
|
116
|
+
readonly state: OmsCheckoutState | string;
|
|
117
|
+
readonly orderIds: readonly string[];
|
|
118
|
+
readonly createdAt: string;
|
|
119
|
+
readonly total: OmsCents;
|
|
120
|
+
readonly shipping: OmsCents;
|
|
121
|
+
readonly tax: OmsCents;
|
|
122
|
+
}
|
|
123
|
+
interface OmsResaleOutcome {
|
|
124
|
+
readonly outcome: 'confirmed' | 'action_required';
|
|
125
|
+
readonly orderId: string;
|
|
126
|
+
/** A Stripe PaymentIntent client secret when `action_required` (3-D Secure); null when confirmed. */
|
|
127
|
+
readonly payerAction: string | null;
|
|
128
|
+
}
|
|
129
|
+
/** `POST /oms/checkouts/{id}/confirm`. */
|
|
130
|
+
interface OmsConfirmation {
|
|
131
|
+
readonly checkoutId: string;
|
|
132
|
+
readonly resale: readonly OmsResaleOutcome[];
|
|
133
|
+
}
|
|
134
|
+
type OmsOrderStatus = 'pending_placement' | 'placement_unknown' | 'placed' | 'accepted' | 'release_sent' | 'release_unknown' | 'released' | 'shipped' | 'delivered' | 'needs_support' | 'rejected' | 'cancelled' | 'pending_handoff';
|
|
135
|
+
interface OmsOrderSummary {
|
|
136
|
+
readonly orderId: string;
|
|
137
|
+
/** The number the customer sees (`EF-26-0004817`); null until placed. */
|
|
138
|
+
readonly referenceNumber: string | null;
|
|
139
|
+
/** One of `OmsOrderStatus`; an unknown future value is carried as sent. */
|
|
140
|
+
readonly status: OmsOrderStatus | string;
|
|
141
|
+
readonly total: OmsCents;
|
|
142
|
+
readonly placedAt: string | null;
|
|
143
|
+
/** Sum of the line quantities. Optional: older servers do not send it (CONTRACT-NOTES section 2). */
|
|
144
|
+
readonly itemCount?: number | null;
|
|
145
|
+
/** The first lines (at most 3, line order), so a list row can name what is in the order. Optional, as above. */
|
|
146
|
+
readonly items?: readonly OmsOrderItem[] | null;
|
|
147
|
+
/** Who fills it: the pharmacy (a prescription) or Everfur's box. */
|
|
148
|
+
readonly fulfiller?: OmsOrderFulfiller | null;
|
|
149
|
+
/** The day it is expected (a date), the same value the order page has. */
|
|
150
|
+
readonly arrivesBy?: string | null;
|
|
151
|
+
/** Its tracking steps in order: Rx `ordered`, `vet_approved`, `filled`, `delivered`; box `ordered`, `packing`, `delivered`. */
|
|
152
|
+
readonly steps?: readonly OmsOrderListStep[] | null;
|
|
153
|
+
/** The key of the step in progress. */
|
|
154
|
+
readonly currentStep?: string | null;
|
|
155
|
+
/** Which status line the list shows (the SDK owns the words). An unknown future key is carried as sent. */
|
|
156
|
+
readonly statusLineKey?: OmsOrderStatusLineKey | string | null;
|
|
157
|
+
/** The prescribing vet's display name ("{vet}"), on prescription orders. */
|
|
158
|
+
readonly prescriberName?: string | null;
|
|
159
|
+
}
|
|
160
|
+
type OmsOrderFulfiller = 'pharmacy' | 'everfur_box';
|
|
161
|
+
type OmsOrderStatusLineKey = 'ships_tomorrow' | 'needs_vet_ok' | 'being_filled' | 'packing' | 'shipped' | 'out_for_delivery' | 'delivered' | 'tracking_unavailable';
|
|
162
|
+
/** One step on an orders list row (`steps[]`). */
|
|
163
|
+
interface OmsOrderListStep {
|
|
164
|
+
readonly key: string;
|
|
165
|
+
/** When it was done (ISO time); null while it is not. */
|
|
166
|
+
readonly doneAt: string | null;
|
|
167
|
+
}
|
|
168
|
+
/** One line named on an order summary (`items[]`). */
|
|
169
|
+
interface OmsOrderItem {
|
|
170
|
+
readonly offerId: string;
|
|
171
|
+
readonly title: string;
|
|
172
|
+
readonly quantity: number;
|
|
173
|
+
/**
|
|
174
|
+
* The product's photo, an https URL (`image_url`). Optional: older servers do not send it. Absent or null: the
|
|
175
|
+
* shop draws the drug-form tile.
|
|
176
|
+
*/
|
|
177
|
+
readonly imageUrl?: string | null;
|
|
178
|
+
}
|
|
179
|
+
/** The order's four customer steps (`steps[]` on the order detail). */
|
|
180
|
+
type OmsOrderStepKey = 'ordered' | 'shipped' | 'out_for_delivery' | 'delivered';
|
|
181
|
+
interface OmsOrderStep {
|
|
182
|
+
readonly key: OmsOrderStepKey | string;
|
|
183
|
+
readonly done: boolean;
|
|
184
|
+
/** When the step happened, when known. */
|
|
185
|
+
readonly at: string | null;
|
|
186
|
+
}
|
|
187
|
+
interface OmsOrderPage {
|
|
188
|
+
readonly orders: readonly OmsOrderSummary[];
|
|
189
|
+
readonly nextCursor: string | null;
|
|
190
|
+
}
|
|
191
|
+
interface OmsOrderLine {
|
|
192
|
+
readonly lineId: string;
|
|
193
|
+
readonly offerId: string;
|
|
194
|
+
readonly sku: string;
|
|
195
|
+
readonly title: string;
|
|
196
|
+
readonly requiresRx: boolean;
|
|
197
|
+
readonly compounded: boolean;
|
|
198
|
+
readonly packQuantity: string | null;
|
|
199
|
+
readonly packUnit: OmsPackUnit | null;
|
|
200
|
+
readonly quantity: number;
|
|
201
|
+
readonly unitPrice: OmsCents;
|
|
202
|
+
readonly discount: OmsCents;
|
|
203
|
+
readonly tax: OmsCents;
|
|
204
|
+
readonly fulfillmentType: string;
|
|
205
|
+
readonly petId: string | null;
|
|
206
|
+
/**
|
|
207
|
+
* The product's photo, an https URL (`image_url`). Optional: older servers do not send it. Absent or null: the
|
|
208
|
+
* shop draws the drug-form tile.
|
|
209
|
+
*/
|
|
210
|
+
readonly imageUrl?: string | null;
|
|
211
|
+
}
|
|
212
|
+
type OmsShipmentState = 'label_created' | 'in_transit' | 'exception' | 'delivered' | 'returned_to_sender';
|
|
213
|
+
interface OmsTrackingEvent {
|
|
214
|
+
readonly carrier: string | null;
|
|
215
|
+
readonly trackingNumber: string | null;
|
|
216
|
+
readonly status: OmsShipmentState | string;
|
|
217
|
+
readonly occurredAt: string | null;
|
|
218
|
+
/** An https link, else null (contract 8.3). */
|
|
219
|
+
readonly trackingUrl: string | null;
|
|
220
|
+
/** A date, or null. */
|
|
221
|
+
readonly deliveryBy: string | null;
|
|
222
|
+
}
|
|
223
|
+
interface OmsShipment {
|
|
224
|
+
readonly shipmentId: string;
|
|
225
|
+
readonly state: OmsShipmentState | string;
|
|
226
|
+
readonly lines: readonly {
|
|
227
|
+
readonly lineId: string;
|
|
228
|
+
readonly quantity: number;
|
|
229
|
+
}[];
|
|
230
|
+
readonly tracking: readonly OmsTrackingEvent[];
|
|
231
|
+
}
|
|
232
|
+
type OmsPaymentStatus = 'processing' | 'requires_action' | 'authorized' | 'captured' | 'voided' | 'expired' | 'failed';
|
|
233
|
+
interface OmsRefund {
|
|
234
|
+
readonly refundId: string;
|
|
235
|
+
readonly amount: OmsCents;
|
|
236
|
+
readonly state: string;
|
|
237
|
+
}
|
|
238
|
+
/** `GET /oms/orders/{id}`. */
|
|
239
|
+
interface OmsOrder {
|
|
240
|
+
readonly summary: OmsOrderSummary;
|
|
241
|
+
readonly lines: readonly OmsOrderLine[];
|
|
242
|
+
readonly shipping: OmsCents;
|
|
243
|
+
readonly shippingTax: OmsCents;
|
|
244
|
+
readonly shipments: readonly OmsShipment[];
|
|
245
|
+
readonly canCancel: boolean;
|
|
246
|
+
readonly canReturn: boolean;
|
|
247
|
+
readonly canPay: boolean;
|
|
248
|
+
readonly paymentStatus: OmsPaymentStatus | string | null;
|
|
249
|
+
readonly refunds: readonly OmsRefund[];
|
|
250
|
+
readonly returnIds: readonly string[];
|
|
251
|
+
/** Sum of unit price x quantity. Optional: older servers do not send it (CONTRACT-NOTES section 2). */
|
|
252
|
+
readonly subtotal?: OmsCents | null;
|
|
253
|
+
/** Sum of the line discounts. Optional, as above. */
|
|
254
|
+
readonly discount?: OmsCents | null;
|
|
255
|
+
/** Line tax plus shipping tax. Optional, as above. */
|
|
256
|
+
readonly tax?: OmsCents | null;
|
|
257
|
+
/** The partner's latest promised delivery day (a date), when it gave one. Optional, as above. */
|
|
258
|
+
readonly arrivesBy?: string | null;
|
|
259
|
+
/** The newest tracking event, when any. Optional, as above. */
|
|
260
|
+
readonly tracking?: OmsTrackingEvent | null;
|
|
261
|
+
/** The four customer steps in order. Optional, as above: empty or missing on older servers. */
|
|
262
|
+
readonly steps?: readonly OmsOrderStep[] | null;
|
|
263
|
+
/** The card the order is held or charged on (match it against the saved cards). Optional, as above. */
|
|
264
|
+
readonly paymentMethodId?: string | null;
|
|
265
|
+
}
|
|
266
|
+
interface OmsCancelOutcome {
|
|
267
|
+
readonly outcome: 'cancelled' | 'requested' | 'not_cancellable' | string;
|
|
268
|
+
/** Cents given back when cancelled (0 when only a hold was voided). */
|
|
269
|
+
readonly refunded: OmsCents | null;
|
|
270
|
+
/** `too_late` or `cancel_with_partner` when not cancellable. */
|
|
271
|
+
readonly reasonCode: string | null;
|
|
272
|
+
}
|
|
273
|
+
interface OmsPayOutcome {
|
|
274
|
+
readonly outcome: 'authorized' | 'action_required';
|
|
275
|
+
readonly orderId: string;
|
|
276
|
+
readonly payerAction: string | null;
|
|
277
|
+
}
|
|
278
|
+
interface OmsReturnLine {
|
|
279
|
+
readonly lineId: string;
|
|
280
|
+
readonly quantity: number;
|
|
281
|
+
readonly reasonCode: string;
|
|
282
|
+
}
|
|
283
|
+
interface OmsReturn {
|
|
284
|
+
readonly returnId: string;
|
|
285
|
+
readonly orderId: string;
|
|
286
|
+
readonly lines: readonly OmsReturnLine[];
|
|
287
|
+
readonly state: string;
|
|
288
|
+
readonly rma: string | null;
|
|
289
|
+
readonly labelUrl: string | null;
|
|
290
|
+
}
|
|
291
|
+
interface OmsCase {
|
|
292
|
+
readonly caseId: string;
|
|
293
|
+
readonly orderId: string;
|
|
294
|
+
readonly reasonCode: string;
|
|
295
|
+
readonly message: string;
|
|
296
|
+
readonly openedAt: string;
|
|
297
|
+
readonly closedAt: string | null;
|
|
298
|
+
}
|
|
299
|
+
type OmsPrescriptionStatus = 'ready' | 'being_prepared' | 'too_soon' | 'refills_used' | 'expired';
|
|
300
|
+
/** `GET /oms/prescriptions` (contract 4.12). */
|
|
301
|
+
interface OmsPrescription {
|
|
302
|
+
readonly rxId: string;
|
|
303
|
+
readonly petId: string;
|
|
304
|
+
/** The drug's name. The server allows null; the SDK then carries an empty string. */
|
|
305
|
+
readonly drug: string;
|
|
306
|
+
readonly strength: string | null;
|
|
307
|
+
readonly form: string | null;
|
|
308
|
+
readonly status: OmsPrescriptionStatus | string;
|
|
309
|
+
/** Set when `ready`. */
|
|
310
|
+
readonly offerId: string | null;
|
|
311
|
+
readonly packCount: number | null;
|
|
312
|
+
readonly fillsUsed: number | null;
|
|
313
|
+
readonly fillsTotal: number | null;
|
|
314
|
+
readonly expiresOn: string | null;
|
|
315
|
+
/** Set when `too_soon`. */
|
|
316
|
+
readonly nextFillOn: string | null;
|
|
317
|
+
/** What is left and when it runs out; null when there is not enough data to count. */
|
|
318
|
+
readonly supply?: OmsSupply | null;
|
|
319
|
+
/** The prescribing vet's display name ("{vet}"). */
|
|
320
|
+
readonly prescriberName?: string | null;
|
|
321
|
+
readonly refillsTotal?: number | null;
|
|
322
|
+
readonly refillsLeft?: number | null;
|
|
323
|
+
}
|
|
324
|
+
/** A prescription's supply (`supply`). */
|
|
325
|
+
interface OmsSupply {
|
|
326
|
+
/** Units left today, floored at 0. */
|
|
327
|
+
readonly unitsLeft: number;
|
|
328
|
+
/** The dosage-form noun ("tablet", "chew"). */
|
|
329
|
+
readonly unitLabel: string;
|
|
330
|
+
readonly dailyUnits: number;
|
|
331
|
+
/** The day it runs out (a date). */
|
|
332
|
+
readonly runsOutOn: string;
|
|
333
|
+
/**
|
|
334
|
+
* When a refill ordered today would arrive (a date), from the fulfiller's real lead times; null (or absent, from an
|
|
335
|
+
* older OMS) when there is no real source. Never a guess.
|
|
336
|
+
*/
|
|
337
|
+
readonly refillArrivesOn?: string | null;
|
|
338
|
+
}
|
|
339
|
+
/** A saved address, as listed: a label only, the address is sealed at rest (contract 4.13). */
|
|
340
|
+
interface OmsAddressEntry {
|
|
341
|
+
readonly ref: string;
|
|
342
|
+
readonly label: string;
|
|
343
|
+
readonly isDefault: boolean;
|
|
344
|
+
/** False: no recipient name, checkout refuses it (`address_incomplete`). */
|
|
345
|
+
readonly isComplete: boolean;
|
|
346
|
+
}
|
|
347
|
+
interface OmsAddress {
|
|
348
|
+
readonly recipientName: string | null;
|
|
349
|
+
readonly line1: string;
|
|
350
|
+
readonly line2: string | null;
|
|
351
|
+
readonly city: string;
|
|
352
|
+
/** The state or region. The server allows null; the SDK then carries an empty string. */
|
|
353
|
+
readonly region: string;
|
|
354
|
+
readonly postalCode: string;
|
|
355
|
+
/** Two capital letters. */
|
|
356
|
+
readonly country: string;
|
|
357
|
+
}
|
|
358
|
+
interface OmsAddressDetail extends OmsAddressEntry {
|
|
359
|
+
readonly address: OmsAddress;
|
|
360
|
+
}
|
|
361
|
+
interface OmsAddressInput {
|
|
362
|
+
/** 1 to 60 characters. */
|
|
363
|
+
readonly label: string;
|
|
364
|
+
readonly makeDefault?: boolean;
|
|
365
|
+
readonly address: OmsAddress;
|
|
366
|
+
}
|
|
367
|
+
interface OmsPaymentMethod {
|
|
368
|
+
/** Stripe's `pm_...`. */
|
|
369
|
+
readonly paymentMethodId: string;
|
|
370
|
+
readonly brand: string;
|
|
371
|
+
readonly last4: string;
|
|
372
|
+
readonly wallet: 'apple_pay' | 'google_pay' | string | null;
|
|
373
|
+
}
|
|
374
|
+
/** `POST /oms/payment-methods/setup`: a Stripe SetupIntent and its client secret. */
|
|
375
|
+
interface OmsPaymentSetup {
|
|
376
|
+
readonly setupId: string;
|
|
377
|
+
/** The SetupIntent client secret. Hand it to Stripe, never log or store it. */
|
|
378
|
+
readonly payerAction: string;
|
|
379
|
+
}
|
|
380
|
+
/** Stripe's hosted page that saves a card (a Checkout Session in setup mode), for an app with no Stripe SDK. */
|
|
381
|
+
interface OmsCardSetupLink {
|
|
382
|
+
/** `https://checkout.stripe.com/...`. Open it in an in-app browser; it carries no secret. */
|
|
383
|
+
readonly url: string;
|
|
384
|
+
}
|
|
385
|
+
/** Everfur's hosted page that runs an order's open 3-D Secure step, for an app with no Stripe SDK. */
|
|
386
|
+
interface OmsCardActionLink {
|
|
387
|
+
/** The web page with a short-lived ticket in its fragment. Open it once, in an in-app browser; never log it. */
|
|
388
|
+
readonly url: string;
|
|
389
|
+
/** When the ticket stops working (ISO 8601), about 15 minutes after it was made. */
|
|
390
|
+
readonly expiresAt: string;
|
|
391
|
+
}
|
|
392
|
+
type OmsPlanState = 'active' | 'paused' | 'needs_address' | 'cancelled';
|
|
393
|
+
type OmsPlanStopReason = 'customer' | 'consent_revoked' | 'needs_address' | 'payment_declined' | 'needs_prescription' | 'item_unavailable' | 'order_refused';
|
|
394
|
+
interface OmsPlanLine {
|
|
395
|
+
readonly offerId: string;
|
|
396
|
+
readonly quantity: number;
|
|
397
|
+
readonly petId: string | null;
|
|
398
|
+
}
|
|
399
|
+
/** An auto-ship plan (contract 4.15, 8.5). */
|
|
400
|
+
interface OmsPlan {
|
|
401
|
+
readonly planId: string;
|
|
402
|
+
readonly lines: readonly OmsPlanLine[];
|
|
403
|
+
readonly cadenceDays: number;
|
|
404
|
+
/** An address ref. */
|
|
405
|
+
readonly destination: string | null;
|
|
406
|
+
readonly paymentMethodId: string | null;
|
|
407
|
+
/** 1000 is the 10% subscribe-and-save discount. */
|
|
408
|
+
readonly discountBps: number;
|
|
409
|
+
readonly nextRun: string | null;
|
|
410
|
+
readonly state: OmsPlanState | string;
|
|
411
|
+
readonly stopReason: OmsPlanStopReason | string | null;
|
|
412
|
+
readonly priceCentsPerCycle?: OmsCents | null;
|
|
413
|
+
/** True on prescription plans: the card is charged once the pharmacy fills it. */
|
|
414
|
+
readonly chargedWhenFilled?: boolean | null;
|
|
415
|
+
/** The next ship day (a date). */
|
|
416
|
+
readonly nextShipOn?: string | null;
|
|
417
|
+
/** The skipped cycle's day (a date), after a skip; null otherwise. */
|
|
418
|
+
readonly skippedCycleOn?: string | null;
|
|
419
|
+
/** Prescription plans only. */
|
|
420
|
+
readonly prescriberName?: string | null;
|
|
421
|
+
readonly refillsLeft?: number | null;
|
|
422
|
+
readonly refillsTotal?: number | null;
|
|
423
|
+
/** The everyday auto discount, in percent (10 is 10% off); null when none is configured. */
|
|
424
|
+
readonly autoDiscountPct?: number | null;
|
|
425
|
+
/** The packs and cadences the plan can change to (CARE-ORDERS-V2 contract section 9); null or absent: cadences only. */
|
|
426
|
+
readonly changeOptions?: readonly OmsPlanChangeOption[] | null;
|
|
427
|
+
/**
|
|
428
|
+
* The Skip sheet's supply warning on a prescription plan: which of the design's two sentences fits, and the values it is
|
|
429
|
+
* filled with (the host owns the words, as with `statusLineKey`). Null when absent, malformed or an unknown key.
|
|
430
|
+
*/
|
|
431
|
+
readonly skipWarning?: OmsPlanSkipWarning | null;
|
|
432
|
+
}
|
|
433
|
+
/** `last_dose`: one unit left and nothing on its way. `bottle_gap`: the bottle on its way runs out before the next. */
|
|
434
|
+
type OmsPlanSkipWarningKey = 'last_dose' | 'bottle_gap';
|
|
435
|
+
/** A plan's `skip_warning`. Each value is null when the key does not use it, or when the server sent none. */
|
|
436
|
+
interface OmsPlanSkipWarning {
|
|
437
|
+
readonly key: OmsPlanSkipWarningKey;
|
|
438
|
+
readonly values: {
|
|
439
|
+
/** `last_dose`: the counted noun ("chew", "tablet"). */
|
|
440
|
+
readonly unitLabel: string | null;
|
|
441
|
+
/** `last_dose`: the day of the dose the unit left is for (a date). */
|
|
442
|
+
readonly doseOn: string | null;
|
|
443
|
+
/** `last_dose`: the first dose day with none left (a date). */
|
|
444
|
+
readonly noneFor: string | null;
|
|
445
|
+
/** `bottle_gap`: the day what she has plus the fill on its way runs out (a date). */
|
|
446
|
+
readonly lastsTo: string | null;
|
|
447
|
+
/** `bottle_gap`: the gap after a skip, in whole weeks (2 or more). */
|
|
448
|
+
readonly weeks: number | null;
|
|
449
|
+
};
|
|
450
|
+
}
|
|
451
|
+
/** One pack a plan can change to, priced per cycle, with the cadences it allows (CARE-ORDERS-V2 contract section 9). */
|
|
452
|
+
interface OmsPlanChangeOption {
|
|
453
|
+
readonly offerId: string;
|
|
454
|
+
readonly title: string;
|
|
455
|
+
/** The catalog size after the item's name ("90 ct"); null when the title has none. */
|
|
456
|
+
readonly size: string | null;
|
|
457
|
+
readonly packQuantity: string | null;
|
|
458
|
+
readonly packUnit: OmsPackUnit | null;
|
|
459
|
+
/** Prescription plans: the counted noun ("tablet", "chew"); null for everyday items. */
|
|
460
|
+
readonly unitLabel: string | null;
|
|
461
|
+
/** Packs per cycle on this choice. */
|
|
462
|
+
readonly quantity: number;
|
|
463
|
+
readonly priceCentsPerCycle: OmsCents;
|
|
464
|
+
readonly cadenceDays: readonly number[];
|
|
465
|
+
/** The plan's own pack. */
|
|
466
|
+
readonly current: boolean;
|
|
467
|
+
}
|
|
468
|
+
interface OmsPlanPage {
|
|
469
|
+
readonly plans: readonly OmsPlan[];
|
|
470
|
+
readonly nextCursor: string | null;
|
|
471
|
+
}
|
|
472
|
+
interface OmsPlanInput {
|
|
473
|
+
readonly idempotencyKey: string;
|
|
474
|
+
/** 7 to 365. */
|
|
475
|
+
readonly cadenceDays: number;
|
|
476
|
+
readonly destination: string;
|
|
477
|
+
readonly paymentMethodId: string;
|
|
478
|
+
/** Must equal `shop-config.recurringTermsVersion`, else 409 `terms_outdated`. */
|
|
479
|
+
readonly consentTermsVersion: string;
|
|
480
|
+
readonly lines: readonly OmsCartLine[];
|
|
481
|
+
}
|
|
482
|
+
interface OmsPlanPatch {
|
|
483
|
+
readonly idempotencyKey: string;
|
|
484
|
+
readonly lines?: readonly OmsCartLine[];
|
|
485
|
+
readonly cadenceDays?: number;
|
|
486
|
+
/** Another pack from the plan's `changeOptions`, sent with its `cadenceDays` and without `lines`. */
|
|
487
|
+
readonly offerId?: string;
|
|
488
|
+
readonly destination?: string;
|
|
489
|
+
readonly paymentMethodId?: string;
|
|
490
|
+
}
|
|
491
|
+
/** `unskip` (Care > Orders v2) gives back the skipped cycle; idempotent. */
|
|
492
|
+
type OmsPlanOperation = 'pause' | 'skip' | 'resume' | 'unskip';
|
|
493
|
+
/** `GET /oms/buy-again` (Care > Orders v2): one item from delivered orders, deduped by offer, newest first. */
|
|
494
|
+
interface OmsBuyAgainItem {
|
|
495
|
+
readonly offerId: string;
|
|
496
|
+
readonly title: string;
|
|
497
|
+
/** An https URL, else null. */
|
|
498
|
+
readonly imageUrl: string | null;
|
|
499
|
+
readonly priceCents: OmsCents | null;
|
|
500
|
+
/** A date, or null. */
|
|
501
|
+
readonly lastOrderedOn: string | null;
|
|
502
|
+
readonly isRx: boolean;
|
|
503
|
+
/** True when the pack should have run out by now (false when unknown). */
|
|
504
|
+
readonly likelyOut: boolean;
|
|
505
|
+
}
|
|
506
|
+
/** One line of an order's receipt. `total` is `unitPrice` x `quantity` - `discount` + `tax`. */
|
|
507
|
+
interface OmsReceiptLine {
|
|
508
|
+
readonly title: string;
|
|
509
|
+
readonly quantity: number;
|
|
510
|
+
readonly unitPrice: OmsCents;
|
|
511
|
+
readonly discount: OmsCents;
|
|
512
|
+
readonly tax: OmsCents;
|
|
513
|
+
readonly total: OmsCents;
|
|
514
|
+
}
|
|
515
|
+
/** The card a receipt was charged to. */
|
|
516
|
+
interface OmsReceiptCard {
|
|
517
|
+
readonly brand: string;
|
|
518
|
+
readonly last4: string;
|
|
519
|
+
}
|
|
520
|
+
/**
|
|
521
|
+
* `GET /oms/orders/{order_id}/receipt` (Care > Orders v2): `subtotal` - `discounts` + `shipping` + `tax` is `total`.
|
|
522
|
+
* 404 for an unknown order, someone else's, or an older server.
|
|
523
|
+
*/
|
|
524
|
+
interface OmsReceipt {
|
|
525
|
+
readonly orderId: string;
|
|
526
|
+
/** The order number the member sees (`reference.number`), or null. */
|
|
527
|
+
readonly referenceNumber: string | null;
|
|
528
|
+
readonly placedAt: string;
|
|
529
|
+
readonly lines: readonly OmsReceiptLine[];
|
|
530
|
+
readonly subtotal: OmsCents;
|
|
531
|
+
readonly shipping: OmsCents;
|
|
532
|
+
readonly tax: OmsCents;
|
|
533
|
+
readonly discounts: OmsCents;
|
|
534
|
+
readonly total: OmsCents;
|
|
535
|
+
/** Set once the card was charged, else null. */
|
|
536
|
+
readonly paidAt: string | null;
|
|
537
|
+
/** Null when it cannot be read now. */
|
|
538
|
+
readonly card: OmsReceiptCard | null;
|
|
539
|
+
/** Null when it cannot be read now. */
|
|
540
|
+
readonly shipTo: OmsAddress | null;
|
|
541
|
+
}
|
|
542
|
+
type OmsCycleReviewState = 'open' | 'approving' | 'approved' | 'skipped' | 'withdrawn' | 'failed';
|
|
543
|
+
/** `GET /oms/subscriptions/{plan_id}/cycle`. */
|
|
544
|
+
interface OmsCycleReview {
|
|
545
|
+
readonly planId: string;
|
|
546
|
+
/** Null when no review is open: `cycle`, `shipsOn` and `approveBy` then name the next one. */
|
|
547
|
+
readonly reviewId: string | null;
|
|
548
|
+
readonly cycle: number;
|
|
549
|
+
readonly state: OmsCycleReviewState | string | null;
|
|
550
|
+
readonly lines: readonly OmsPlanLine[];
|
|
551
|
+
readonly shipsOn: string | null;
|
|
552
|
+
readonly approveBy: string | null;
|
|
553
|
+
/** The pre-tax quote of the open review's lines (price and discount per line), when one is open. */
|
|
554
|
+
readonly quoteLines: readonly OmsQuoteLine[];
|
|
555
|
+
}
|
|
556
|
+
/** `POST /oms/subscriptions/{plan_id}/cycles/{cycle}/draft`: the taxed draft the owner approves. */
|
|
557
|
+
interface OmsCycleDraft {
|
|
558
|
+
readonly checkoutId: string;
|
|
559
|
+
readonly shipping: OmsCents;
|
|
560
|
+
readonly tax: OmsCents;
|
|
561
|
+
readonly total: OmsCents;
|
|
562
|
+
readonly expiresAt: string | null;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
type OmsError =
|
|
566
|
+
/** 404: hidden. The shop, the gate, the record, or the account is not available to this viewer. */
|
|
567
|
+
{
|
|
568
|
+
readonly kind: 'unavailable';
|
|
569
|
+
readonly requestId?: string;
|
|
570
|
+
}
|
|
571
|
+
/** The host's `getToken` returned nothing or failed (or a gateway answered 401): no request was sent. */
|
|
572
|
+
| {
|
|
573
|
+
readonly kind: 'signedOut';
|
|
574
|
+
}
|
|
575
|
+
/** 402, 409, 422: a business refusal the customer can act on. */
|
|
576
|
+
| {
|
|
577
|
+
readonly kind: 'refused';
|
|
578
|
+
readonly status: 402 | 409 | 422;
|
|
579
|
+
readonly reasonCode: string | null;
|
|
580
|
+
/** The contract's product copy, safe to show; null when absent. */
|
|
581
|
+
readonly message: string | null;
|
|
582
|
+
readonly requestId?: string;
|
|
583
|
+
}
|
|
584
|
+
/** 400: the SDK sent something the server would not take (a bug), or a local check refused it first. */
|
|
585
|
+
| {
|
|
586
|
+
readonly kind: 'invalidRequest';
|
|
587
|
+
readonly requestId?: string;
|
|
588
|
+
}
|
|
589
|
+
/** 429: past the per-user hourly limit on checkout, pay or card setup. */
|
|
590
|
+
| {
|
|
591
|
+
readonly kind: 'rateLimited';
|
|
592
|
+
readonly retryAfterSeconds: number | null;
|
|
593
|
+
readonly requestId?: string;
|
|
594
|
+
}
|
|
595
|
+
/** 503: a dependency (pharmacy, Stripe, database) is down. Retry later. */
|
|
596
|
+
| {
|
|
597
|
+
readonly kind: 'serviceUnavailable';
|
|
598
|
+
readonly requestId?: string;
|
|
599
|
+
}
|
|
600
|
+
/** 500 or any other status. */
|
|
601
|
+
| {
|
|
602
|
+
readonly kind: 'serverError';
|
|
603
|
+
readonly status: number;
|
|
604
|
+
readonly requestId?: string;
|
|
605
|
+
}
|
|
606
|
+
/** The request never got an answer (offline, DNS, CORS). */
|
|
607
|
+
| {
|
|
608
|
+
readonly kind: 'network';
|
|
609
|
+
}
|
|
610
|
+
/** The request ran past the SDK's deadline. */
|
|
611
|
+
| {
|
|
612
|
+
readonly kind: 'timeout';
|
|
613
|
+
}
|
|
614
|
+
/** A 2xx answer the SDK could not read (a field missing or of the wrong type). */
|
|
615
|
+
| {
|
|
616
|
+
readonly kind: 'badResponse';
|
|
617
|
+
readonly requestId?: string;
|
|
618
|
+
};
|
|
619
|
+
type OmsResult<T> = {
|
|
620
|
+
readonly ok: true;
|
|
621
|
+
readonly value: T;
|
|
622
|
+
} | {
|
|
623
|
+
readonly ok: false;
|
|
624
|
+
readonly error: OmsError;
|
|
625
|
+
};
|
|
626
|
+
/** True for a refusal with this `reason_code`. */
|
|
627
|
+
declare function isOmsRefusal(error: OmsError, reasonCode?: string): boolean;
|
|
628
|
+
/** True when the answer means "this is not for this viewer": hide it, never show an error. */
|
|
629
|
+
declare function isOmsUnavailable(error: OmsError): boolean;
|
|
630
|
+
/** Worth one more try by the same user action (with the SAME idempotency key). */
|
|
631
|
+
declare function isOmsRetryable(error: OmsError): boolean;
|
|
632
|
+
|
|
633
|
+
export { type OmsPaymentStatus as $, isOmsRefusal as A, isOmsRetryable as B, isOmsUnavailable as C, type OmsAddressEntry as D, type OmsCancelOutcome as E, type OmsCardActionLink as F, type OmsCardSetupLink as G, type OmsCase as H, type OmsCheckout as I, type OmsCheckoutState as J, type OmsConfirmation as K, type OmsCycleDraft as L, type OmsCycleReview as M, type OmsCycleReviewState as N, type OmsAddressInput as O, type OmsDeliverySpeed as P, type OmsOfferPage as Q, type OmsOrderFulfiller as R, type OmsOrderLine as S, type OmsOrderListStep as T, type OmsOrderStatus as U, type OmsOrderStatusLineKey as V, type OmsOrderStep as W, type OmsOrderStepKey as X, type OmsPackUnit as Y, type OmsPayOutcome as Z, type OmsPaymentSetup as _, type OmsBuyAgainItem as a, type OmsPlanInput as a0, type OmsPlanLine as a1, type OmsPlanPage as a2, type OmsPlanPatch as a3, type OmsPlanState as a4, type OmsPlanStopReason as a5, type OmsPrescriptionStatus as a6, type OmsRefund as a7, type OmsResaleOutcome as a8, type OmsReturn as a9, type OmsReturnLine as aa, type OmsShipment as ab, type OmsShipmentState as ac, type OmsTrackingEvent as ad, type OmsOrder as b, type OmsOrderSummary as c, type OmsOrderItem as d, type OmsOrderPage as e, type OmsPlan as f, type OmsQuote as g, type OmsReceipt as h, type OmsShopConfig as i, type OmsError as j, type OmsAddressDetail as k, type OmsPaymentMethod as l, type OmsPlanSkipWarning as m, type OmsPrescription as n, type OmsAddress as o, type OmsCartLine as p, type OmsCents as q, type OmsOffer as r, type OmsPlanChangeOption as s, type OmsPlanOperation as t, type OmsPlanSkipWarningKey as u, type OmsQuoteLine as v, type OmsReceiptCard as w, type OmsReceiptLine as x, type OmsResult as y, type OmsSupply as z };
|