@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
|
@@ -1,627 +1,6 @@
|
|
|
1
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
|
-
import { j as FetchLike } from './config.d-
|
|
3
|
-
|
|
4
|
-
type OmsError =
|
|
5
|
-
/** 404: hidden. The shop, the gate, the record, or the account is not available to this viewer. */
|
|
6
|
-
{
|
|
7
|
-
readonly kind: 'unavailable';
|
|
8
|
-
readonly requestId?: string;
|
|
9
|
-
}
|
|
10
|
-
/** The host's `getToken` returned nothing or failed (or a gateway answered 401): no request was sent. */
|
|
11
|
-
| {
|
|
12
|
-
readonly kind: 'signedOut';
|
|
13
|
-
}
|
|
14
|
-
/** 402, 409, 422: a business refusal the customer can act on. */
|
|
15
|
-
| {
|
|
16
|
-
readonly kind: 'refused';
|
|
17
|
-
readonly status: 402 | 409 | 422;
|
|
18
|
-
readonly reasonCode: string | null;
|
|
19
|
-
/** The contract's product copy, safe to show; null when absent. */
|
|
20
|
-
readonly message: string | null;
|
|
21
|
-
readonly requestId?: string;
|
|
22
|
-
}
|
|
23
|
-
/** 400: the SDK sent something the server would not take (a bug), or a local check refused it first. */
|
|
24
|
-
| {
|
|
25
|
-
readonly kind: 'invalidRequest';
|
|
26
|
-
readonly requestId?: string;
|
|
27
|
-
}
|
|
28
|
-
/** 429: past the per-user hourly limit on checkout, pay or card setup. */
|
|
29
|
-
| {
|
|
30
|
-
readonly kind: 'rateLimited';
|
|
31
|
-
readonly retryAfterSeconds: number | null;
|
|
32
|
-
readonly requestId?: string;
|
|
33
|
-
}
|
|
34
|
-
/** 503: a dependency (pharmacy, Stripe, database) is down. Retry later. */
|
|
35
|
-
| {
|
|
36
|
-
readonly kind: 'serviceUnavailable';
|
|
37
|
-
readonly requestId?: string;
|
|
38
|
-
}
|
|
39
|
-
/** 500 or any other status. */
|
|
40
|
-
| {
|
|
41
|
-
readonly kind: 'serverError';
|
|
42
|
-
readonly status: number;
|
|
43
|
-
readonly requestId?: string;
|
|
44
|
-
}
|
|
45
|
-
/** The request never got an answer (offline, DNS, CORS). */
|
|
46
|
-
| {
|
|
47
|
-
readonly kind: 'network';
|
|
48
|
-
}
|
|
49
|
-
/** The request ran past the SDK's deadline. */
|
|
50
|
-
| {
|
|
51
|
-
readonly kind: 'timeout';
|
|
52
|
-
}
|
|
53
|
-
/** A 2xx answer the SDK could not read (a field missing or of the wrong type). */
|
|
54
|
-
| {
|
|
55
|
-
readonly kind: 'badResponse';
|
|
56
|
-
readonly requestId?: string;
|
|
57
|
-
};
|
|
58
|
-
type OmsResult<T> = {
|
|
59
|
-
readonly ok: true;
|
|
60
|
-
readonly value: T;
|
|
61
|
-
} | {
|
|
62
|
-
readonly ok: false;
|
|
63
|
-
readonly error: OmsError;
|
|
64
|
-
};
|
|
65
|
-
/** True for a refusal with this `reason_code`. */
|
|
66
|
-
declare function isOmsRefusal(error: OmsError, reasonCode?: string): boolean;
|
|
67
|
-
/** True when the answer means "this is not for this viewer": hide it, never show an error. */
|
|
68
|
-
declare function isOmsUnavailable(error: OmsError): boolean;
|
|
69
|
-
/** Worth one more try by the same user action (with the SAME idempotency key). */
|
|
70
|
-
declare function isOmsRetryable(error: OmsError): boolean;
|
|
71
|
-
|
|
72
|
-
/** Integer cents, USD (`4599` is $45.99). Never a float. */
|
|
73
|
-
type OmsCents = number;
|
|
74
|
-
type OmsDeliverySpeed = 'ground' | 'two_day' | 'next_day';
|
|
75
|
-
/** `GET /oms/shop-config`. Each null hides one feature (contract 4.17). */
|
|
76
|
-
interface OmsShopConfig {
|
|
77
|
-
/** Null hides auto-ship (plans). */
|
|
78
|
-
readonly recurringTermsVersion: string | null;
|
|
79
|
-
readonly recurringTermsUrl: string | null;
|
|
80
|
-
/** Null hides card entry. */
|
|
81
|
-
readonly stripePublishableKey: string | null;
|
|
82
|
-
/** Null means the shop's terms are not written yet: a quote would answer 409. */
|
|
83
|
-
readonly delivery: {
|
|
84
|
-
readonly firstFill: OmsDeliverySpeed | null;
|
|
85
|
-
readonly refill: OmsDeliverySpeed | null;
|
|
86
|
-
} | null;
|
|
87
|
-
/**
|
|
88
|
-
* The parts of the member's own profile a prescription order needs and lacks (`first_name`, `last_name`, `email`,
|
|
89
|
-
* `phone`); empty when nothing is missing. Optional: older servers do not send it (CONTRACT-NOTES section 2).
|
|
90
|
-
*/
|
|
91
|
-
readonly rxContactMissing?: readonly string[] | null;
|
|
92
|
-
/**
|
|
93
|
-
* Everyday orders at or over this ship free (`free_shipping_threshold_cents`, Care > Orders v2). Optional: older
|
|
94
|
-
* servers do not send it; absent or null, the cart bar says nothing about shipping.
|
|
95
|
-
*/
|
|
96
|
-
readonly freeShippingThresholdCents?: OmsCents | null;
|
|
97
|
-
/**
|
|
98
|
-
* The cents off an eligible owner's first prescription once it is filled (`first_rx_discount_cents`, VET50, 5000).
|
|
99
|
-
* Optional: older servers do not send it; absent or null, the cart bar shows no discount (CONTRACT.md section 10).
|
|
100
|
-
*/
|
|
101
|
-
readonly firstRxDiscountCents?: OmsCents | null;
|
|
102
|
-
}
|
|
103
|
-
type OmsPackUnit = 'each' | 'gram' | 'milliliter';
|
|
104
|
-
/** One active offer (contract 4.1). */
|
|
105
|
-
interface OmsOffer {
|
|
106
|
-
readonly offerId: string;
|
|
107
|
-
readonly sku: string;
|
|
108
|
-
readonly title: string;
|
|
109
|
-
readonly fulfillmentType: string;
|
|
110
|
-
readonly requiresRx: boolean;
|
|
111
|
-
readonly compounded: boolean;
|
|
112
|
-
/** A decimal string ("30"), or null. */
|
|
113
|
-
readonly packQuantity: string | null;
|
|
114
|
-
readonly packUnit: OmsPackUnit | null;
|
|
115
|
-
/** One unit before any discount; null until the shop's commercial terms are written (contract 8.1). */
|
|
116
|
-
readonly price: OmsCents | null;
|
|
117
|
-
/**
|
|
118
|
-
* The product's photo, an https URL, when the catalog sends one (`image_url`; not in the contract yet, the pharmacy
|
|
119
|
-
* feed sends none today). Absent or null: the shop draws the drug-form tile.
|
|
120
|
-
*/
|
|
121
|
-
readonly imageUrl?: string | null;
|
|
122
|
-
}
|
|
123
|
-
interface OmsOfferPage {
|
|
124
|
-
readonly offers: readonly OmsOffer[];
|
|
125
|
-
/** Pass back as `cursor`; null is the last page. */
|
|
126
|
-
readonly nextCursor: string | null;
|
|
127
|
-
}
|
|
128
|
-
/** A cart or plan line. A prescription line names the pet and the prescription (contract 3.5). */
|
|
129
|
-
interface OmsCartLine {
|
|
130
|
-
readonly offerId: string;
|
|
131
|
-
/** 1 to 99. */
|
|
132
|
-
readonly quantity: number;
|
|
133
|
-
readonly petId?: string;
|
|
134
|
-
readonly rxId?: string;
|
|
135
|
-
}
|
|
136
|
-
interface OmsQuoteLine {
|
|
137
|
-
readonly offerId: string;
|
|
138
|
-
readonly quantity: number;
|
|
139
|
-
readonly petId: string | null;
|
|
140
|
-
readonly unitPrice: OmsCents;
|
|
141
|
-
readonly discount: OmsCents;
|
|
142
|
-
readonly tax: OmsCents;
|
|
143
|
-
/**
|
|
144
|
-
* The part of `discount` taken off once the line is filled (`when_filled_discount_cents`, VET50); 0 for a line
|
|
145
|
-
* charged today. Optional: older servers do not send it (CONTRACT.md section 10).
|
|
146
|
-
*/
|
|
147
|
-
readonly whenFilledDiscountCents?: OmsCents | null;
|
|
148
|
-
/** Sold on a prescription (`is_rx`). Optional: older servers do not send it (null is unknown). */
|
|
149
|
-
readonly isRx?: boolean | null;
|
|
150
|
-
/**
|
|
151
|
-
* The line's order is charged once the pharmacy fills it, not today (`charged_when_filled`). Optional: older servers
|
|
152
|
-
* do not send it (null is unknown).
|
|
153
|
-
*/
|
|
154
|
-
readonly chargedWhenFilled?: boolean | null;
|
|
155
|
-
}
|
|
156
|
-
/** `POST /oms/cart/quote`. Creates nothing; good for 30 minutes. */
|
|
157
|
-
interface OmsQuote {
|
|
158
|
-
readonly lines: readonly OmsQuoteLine[];
|
|
159
|
-
readonly shipping: OmsCents;
|
|
160
|
-
readonly tax: OmsCents;
|
|
161
|
-
readonly total: OmsCents;
|
|
162
|
-
readonly expiresAt: string;
|
|
163
|
-
/** The lines' `whenFilledDiscountCents` summed (`when_filled_discount_cents`). Optional, as on the lines. */
|
|
164
|
-
readonly whenFilledDiscountCents?: OmsCents | null;
|
|
165
|
-
/**
|
|
166
|
-
* The part of `total` charged today (`due_today_cents`). With `dueWhenFilledCents` it splits `total` by when each
|
|
167
|
-
* order is charged. Optional: null where the server made no split or is older.
|
|
168
|
-
*/
|
|
169
|
-
readonly dueTodayCents?: OmsCents | null;
|
|
170
|
-
/** The part of `total` charged once the pharmacy fills it (`due_when_filled_cents`). Optional, as `dueTodayCents`. */
|
|
171
|
-
readonly dueWhenFilledCents?: OmsCents | null;
|
|
172
|
-
}
|
|
173
|
-
type OmsCheckoutState = 'draft' | 'authorizing' | 'confirmed' | 'compensating' | 'failed' | 'expired';
|
|
174
|
-
/** `POST /oms/checkouts` (201). `total` is what confirm will charge. */
|
|
175
|
-
interface OmsCheckout {
|
|
176
|
-
readonly checkoutId: string;
|
|
177
|
-
readonly state: OmsCheckoutState | string;
|
|
178
|
-
readonly orderIds: readonly string[];
|
|
179
|
-
readonly createdAt: string;
|
|
180
|
-
readonly total: OmsCents;
|
|
181
|
-
readonly shipping: OmsCents;
|
|
182
|
-
readonly tax: OmsCents;
|
|
183
|
-
}
|
|
184
|
-
interface OmsResaleOutcome {
|
|
185
|
-
readonly outcome: 'confirmed' | 'action_required';
|
|
186
|
-
readonly orderId: string;
|
|
187
|
-
/** A Stripe PaymentIntent client secret when `action_required` (3-D Secure); null when confirmed. */
|
|
188
|
-
readonly payerAction: string | null;
|
|
189
|
-
}
|
|
190
|
-
/** `POST /oms/checkouts/{id}/confirm`. */
|
|
191
|
-
interface OmsConfirmation {
|
|
192
|
-
readonly checkoutId: string;
|
|
193
|
-
readonly resale: readonly OmsResaleOutcome[];
|
|
194
|
-
}
|
|
195
|
-
type OmsOrderStatus = 'pending_placement' | 'placement_unknown' | 'placed' | 'accepted' | 'release_sent' | 'release_unknown' | 'released' | 'shipped' | 'delivered' | 'needs_support' | 'rejected' | 'cancelled' | 'pending_handoff';
|
|
196
|
-
interface OmsOrderSummary {
|
|
197
|
-
readonly orderId: string;
|
|
198
|
-
/** The number the customer sees (`EF-26-0004817`); null until placed. */
|
|
199
|
-
readonly referenceNumber: string | null;
|
|
200
|
-
/** One of `OmsOrderStatus`; an unknown future value is carried as sent. */
|
|
201
|
-
readonly status: OmsOrderStatus | string;
|
|
202
|
-
readonly total: OmsCents;
|
|
203
|
-
readonly placedAt: string | null;
|
|
204
|
-
/** Sum of the line quantities. Optional: older servers do not send it (CONTRACT-NOTES section 2). */
|
|
205
|
-
readonly itemCount?: number | null;
|
|
206
|
-
/** The first lines (at most 3, line order), so a list row can name what is in the order. Optional, as above. */
|
|
207
|
-
readonly items?: readonly OmsOrderItem[] | null;
|
|
208
|
-
/** Who fills it: the pharmacy (a prescription) or Everfur's box. */
|
|
209
|
-
readonly fulfiller?: OmsOrderFulfiller | null;
|
|
210
|
-
/** The day it is expected (a date), the same value the order page has. */
|
|
211
|
-
readonly arrivesBy?: string | null;
|
|
212
|
-
/** Its tracking steps in order: Rx `ordered`, `vet_approved`, `filled`, `delivered`; box `ordered`, `packing`, `delivered`. */
|
|
213
|
-
readonly steps?: readonly OmsOrderListStep[] | null;
|
|
214
|
-
/** The key of the step in progress. */
|
|
215
|
-
readonly currentStep?: string | null;
|
|
216
|
-
/** Which status line the list shows (the SDK owns the words). An unknown future key is carried as sent. */
|
|
217
|
-
readonly statusLineKey?: OmsOrderStatusLineKey | string | null;
|
|
218
|
-
/** The prescribing vet's display name ("Dr. Goode"), on prescription orders. */
|
|
219
|
-
readonly prescriberName?: string | null;
|
|
220
|
-
}
|
|
221
|
-
type OmsOrderFulfiller = 'pharmacy' | 'everfur_box';
|
|
222
|
-
type OmsOrderStatusLineKey = 'ships_tomorrow' | 'needs_vet_ok' | 'being_filled' | 'packing' | 'shipped' | 'out_for_delivery' | 'delivered' | 'tracking_unavailable';
|
|
223
|
-
/** One step on an orders list row (`steps[]`). */
|
|
224
|
-
interface OmsOrderListStep {
|
|
225
|
-
readonly key: string;
|
|
226
|
-
/** When it was done (ISO time); null while it is not. */
|
|
227
|
-
readonly doneAt: string | null;
|
|
228
|
-
}
|
|
229
|
-
/** One line named on an order summary (`items[]`). */
|
|
230
|
-
interface OmsOrderItem {
|
|
231
|
-
readonly offerId: string;
|
|
232
|
-
readonly title: string;
|
|
233
|
-
readonly quantity: number;
|
|
234
|
-
/**
|
|
235
|
-
* The product's photo, an https URL (`image_url`). Optional: older servers do not send it. Absent or null: the
|
|
236
|
-
* shop draws the drug-form tile.
|
|
237
|
-
*/
|
|
238
|
-
readonly imageUrl?: string | null;
|
|
239
|
-
}
|
|
240
|
-
/** The order's four customer steps (`steps[]` on the order detail). */
|
|
241
|
-
type OmsOrderStepKey = 'ordered' | 'shipped' | 'out_for_delivery' | 'delivered';
|
|
242
|
-
interface OmsOrderStep {
|
|
243
|
-
readonly key: OmsOrderStepKey | string;
|
|
244
|
-
readonly done: boolean;
|
|
245
|
-
/** When the step happened, when known. */
|
|
246
|
-
readonly at: string | null;
|
|
247
|
-
}
|
|
248
|
-
interface OmsOrderPage {
|
|
249
|
-
readonly orders: readonly OmsOrderSummary[];
|
|
250
|
-
readonly nextCursor: string | null;
|
|
251
|
-
}
|
|
252
|
-
interface OmsOrderLine {
|
|
253
|
-
readonly lineId: string;
|
|
254
|
-
readonly offerId: string;
|
|
255
|
-
readonly sku: string;
|
|
256
|
-
readonly title: string;
|
|
257
|
-
readonly requiresRx: boolean;
|
|
258
|
-
readonly compounded: boolean;
|
|
259
|
-
readonly packQuantity: string | null;
|
|
260
|
-
readonly packUnit: OmsPackUnit | null;
|
|
261
|
-
readonly quantity: number;
|
|
262
|
-
readonly unitPrice: OmsCents;
|
|
263
|
-
readonly discount: OmsCents;
|
|
264
|
-
readonly tax: OmsCents;
|
|
265
|
-
readonly fulfillmentType: string;
|
|
266
|
-
readonly petId: string | null;
|
|
267
|
-
/**
|
|
268
|
-
* The product's photo, an https URL (`image_url`). Optional: older servers do not send it. Absent or null: the
|
|
269
|
-
* shop draws the drug-form tile.
|
|
270
|
-
*/
|
|
271
|
-
readonly imageUrl?: string | null;
|
|
272
|
-
}
|
|
273
|
-
type OmsShipmentState = 'label_created' | 'in_transit' | 'exception' | 'delivered' | 'returned_to_sender';
|
|
274
|
-
interface OmsTrackingEvent {
|
|
275
|
-
readonly carrier: string | null;
|
|
276
|
-
readonly trackingNumber: string | null;
|
|
277
|
-
readonly status: OmsShipmentState | string;
|
|
278
|
-
readonly occurredAt: string | null;
|
|
279
|
-
/** An https link, else null (contract 8.3). */
|
|
280
|
-
readonly trackingUrl: string | null;
|
|
281
|
-
/** A date, or null. */
|
|
282
|
-
readonly deliveryBy: string | null;
|
|
283
|
-
}
|
|
284
|
-
interface OmsShipment {
|
|
285
|
-
readonly shipmentId: string;
|
|
286
|
-
readonly state: OmsShipmentState | string;
|
|
287
|
-
readonly lines: readonly {
|
|
288
|
-
readonly lineId: string;
|
|
289
|
-
readonly quantity: number;
|
|
290
|
-
}[];
|
|
291
|
-
readonly tracking: readonly OmsTrackingEvent[];
|
|
292
|
-
}
|
|
293
|
-
type OmsPaymentStatus = 'processing' | 'requires_action' | 'authorized' | 'captured' | 'voided' | 'expired' | 'failed';
|
|
294
|
-
interface OmsRefund {
|
|
295
|
-
readonly refundId: string;
|
|
296
|
-
readonly amount: OmsCents;
|
|
297
|
-
readonly state: string;
|
|
298
|
-
}
|
|
299
|
-
/** `GET /oms/orders/{id}`. */
|
|
300
|
-
interface OmsOrder {
|
|
301
|
-
readonly summary: OmsOrderSummary;
|
|
302
|
-
readonly lines: readonly OmsOrderLine[];
|
|
303
|
-
readonly shipping: OmsCents;
|
|
304
|
-
readonly shippingTax: OmsCents;
|
|
305
|
-
readonly shipments: readonly OmsShipment[];
|
|
306
|
-
readonly canCancel: boolean;
|
|
307
|
-
readonly canReturn: boolean;
|
|
308
|
-
readonly canPay: boolean;
|
|
309
|
-
readonly paymentStatus: OmsPaymentStatus | string | null;
|
|
310
|
-
readonly refunds: readonly OmsRefund[];
|
|
311
|
-
readonly returnIds: readonly string[];
|
|
312
|
-
/** Sum of unit price x quantity. Optional: older servers do not send it (CONTRACT-NOTES section 2). */
|
|
313
|
-
readonly subtotal?: OmsCents | null;
|
|
314
|
-
/** Sum of the line discounts. Optional, as above. */
|
|
315
|
-
readonly discount?: OmsCents | null;
|
|
316
|
-
/** Line tax plus shipping tax. Optional, as above. */
|
|
317
|
-
readonly tax?: OmsCents | null;
|
|
318
|
-
/** The partner's latest promised delivery day (a date), when it gave one. Optional, as above. */
|
|
319
|
-
readonly arrivesBy?: string | null;
|
|
320
|
-
/** The newest tracking event, when any. Optional, as above. */
|
|
321
|
-
readonly tracking?: OmsTrackingEvent | null;
|
|
322
|
-
/** The four customer steps in order. Optional, as above: empty or missing on older servers. */
|
|
323
|
-
readonly steps?: readonly OmsOrderStep[] | null;
|
|
324
|
-
/** The card the order is held or charged on (match it against the saved cards). Optional, as above. */
|
|
325
|
-
readonly paymentMethodId?: string | null;
|
|
326
|
-
}
|
|
327
|
-
interface OmsCancelOutcome {
|
|
328
|
-
readonly outcome: 'cancelled' | 'requested' | 'not_cancellable' | string;
|
|
329
|
-
/** Cents given back when cancelled (0 when only a hold was voided). */
|
|
330
|
-
readonly refunded: OmsCents | null;
|
|
331
|
-
/** `too_late` or `cancel_with_partner` when not cancellable. */
|
|
332
|
-
readonly reasonCode: string | null;
|
|
333
|
-
}
|
|
334
|
-
interface OmsPayOutcome {
|
|
335
|
-
readonly outcome: 'authorized' | 'action_required';
|
|
336
|
-
readonly orderId: string;
|
|
337
|
-
readonly payerAction: string | null;
|
|
338
|
-
}
|
|
339
|
-
interface OmsReturnLine {
|
|
340
|
-
readonly lineId: string;
|
|
341
|
-
readonly quantity: number;
|
|
342
|
-
readonly reasonCode: string;
|
|
343
|
-
}
|
|
344
|
-
interface OmsReturn {
|
|
345
|
-
readonly returnId: string;
|
|
346
|
-
readonly orderId: string;
|
|
347
|
-
readonly lines: readonly OmsReturnLine[];
|
|
348
|
-
readonly state: string;
|
|
349
|
-
readonly rma: string | null;
|
|
350
|
-
readonly labelUrl: string | null;
|
|
351
|
-
}
|
|
352
|
-
interface OmsCase {
|
|
353
|
-
readonly caseId: string;
|
|
354
|
-
readonly orderId: string;
|
|
355
|
-
readonly reasonCode: string;
|
|
356
|
-
readonly message: string;
|
|
357
|
-
readonly openedAt: string;
|
|
358
|
-
readonly closedAt: string | null;
|
|
359
|
-
}
|
|
360
|
-
type OmsPrescriptionStatus = 'ready' | 'being_prepared' | 'too_soon' | 'refills_used' | 'expired';
|
|
361
|
-
/** `GET /oms/prescriptions` (contract 4.12). */
|
|
362
|
-
interface OmsPrescription {
|
|
363
|
-
readonly rxId: string;
|
|
364
|
-
readonly petId: string;
|
|
365
|
-
/** The drug's name. The server allows null; the SDK then carries an empty string. */
|
|
366
|
-
readonly drug: string;
|
|
367
|
-
readonly strength: string | null;
|
|
368
|
-
readonly form: string | null;
|
|
369
|
-
readonly status: OmsPrescriptionStatus | string;
|
|
370
|
-
/** Set when `ready`. */
|
|
371
|
-
readonly offerId: string | null;
|
|
372
|
-
readonly packCount: number | null;
|
|
373
|
-
readonly fillsUsed: number | null;
|
|
374
|
-
readonly fillsTotal: number | null;
|
|
375
|
-
readonly expiresOn: string | null;
|
|
376
|
-
/** Set when `too_soon`. */
|
|
377
|
-
readonly nextFillOn: string | null;
|
|
378
|
-
/** What is left and when it runs out; null when there is not enough data to count. */
|
|
379
|
-
readonly supply?: OmsSupply | null;
|
|
380
|
-
/** The prescribing vet's display name ("Dr. Goode"). */
|
|
381
|
-
readonly prescriberName?: string | null;
|
|
382
|
-
readonly refillsTotal?: number | null;
|
|
383
|
-
readonly refillsLeft?: number | null;
|
|
384
|
-
}
|
|
385
|
-
/** A prescription's supply (`supply`). */
|
|
386
|
-
interface OmsSupply {
|
|
387
|
-
/** Units left today, floored at 0. */
|
|
388
|
-
readonly unitsLeft: number;
|
|
389
|
-
/** The dosage-form noun ("tablet", "chew"). */
|
|
390
|
-
readonly unitLabel: string;
|
|
391
|
-
readonly dailyUnits: number;
|
|
392
|
-
/** The day it runs out (a date). */
|
|
393
|
-
readonly runsOutOn: string;
|
|
394
|
-
/**
|
|
395
|
-
* When a refill ordered today would arrive (a date), from the fulfiller's real lead times; null (or absent, from an
|
|
396
|
-
* older OMS) when there is no real source. Never a guess.
|
|
397
|
-
*/
|
|
398
|
-
readonly refillArrivesOn?: string | null;
|
|
399
|
-
}
|
|
400
|
-
/** A saved address, as listed: a label only, the address is sealed at rest (contract 4.13). */
|
|
401
|
-
interface OmsAddressEntry {
|
|
402
|
-
readonly ref: string;
|
|
403
|
-
readonly label: string;
|
|
404
|
-
readonly isDefault: boolean;
|
|
405
|
-
/** False: no recipient name, checkout refuses it (`address_incomplete`). */
|
|
406
|
-
readonly isComplete: boolean;
|
|
407
|
-
}
|
|
408
|
-
interface OmsAddress {
|
|
409
|
-
readonly recipientName: string | null;
|
|
410
|
-
readonly line1: string;
|
|
411
|
-
readonly line2: string | null;
|
|
412
|
-
readonly city: string;
|
|
413
|
-
/** The state or region. The server allows null; the SDK then carries an empty string. */
|
|
414
|
-
readonly region: string;
|
|
415
|
-
readonly postalCode: string;
|
|
416
|
-
/** Two capital letters. */
|
|
417
|
-
readonly country: string;
|
|
418
|
-
}
|
|
419
|
-
interface OmsAddressDetail extends OmsAddressEntry {
|
|
420
|
-
readonly address: OmsAddress;
|
|
421
|
-
}
|
|
422
|
-
interface OmsAddressInput {
|
|
423
|
-
/** 1 to 60 characters. */
|
|
424
|
-
readonly label: string;
|
|
425
|
-
readonly makeDefault?: boolean;
|
|
426
|
-
readonly address: OmsAddress;
|
|
427
|
-
}
|
|
428
|
-
interface OmsPaymentMethod {
|
|
429
|
-
/** Stripe's `pm_...`. */
|
|
430
|
-
readonly paymentMethodId: string;
|
|
431
|
-
readonly brand: string;
|
|
432
|
-
readonly last4: string;
|
|
433
|
-
readonly wallet: 'apple_pay' | 'google_pay' | string | null;
|
|
434
|
-
}
|
|
435
|
-
/** `POST /oms/payment-methods/setup`: a Stripe SetupIntent and its client secret. */
|
|
436
|
-
interface OmsPaymentSetup {
|
|
437
|
-
readonly setupId: string;
|
|
438
|
-
/** The SetupIntent client secret. Hand it to Stripe, never log or store it. */
|
|
439
|
-
readonly payerAction: string;
|
|
440
|
-
}
|
|
441
|
-
/** Stripe's hosted page that saves a card (a Checkout Session in setup mode), for an app with no Stripe SDK. */
|
|
442
|
-
interface OmsCardSetupLink {
|
|
443
|
-
/** `https://checkout.stripe.com/...`. Open it in an in-app browser; it carries no secret. */
|
|
444
|
-
readonly url: string;
|
|
445
|
-
}
|
|
446
|
-
/** Everfur's hosted page that runs an order's open 3-D Secure step, for an app with no Stripe SDK. */
|
|
447
|
-
interface OmsCardActionLink {
|
|
448
|
-
/** The web page with a short-lived ticket in its fragment. Open it once, in an in-app browser; never log it. */
|
|
449
|
-
readonly url: string;
|
|
450
|
-
/** When the ticket stops working (ISO 8601), about 15 minutes after it was made. */
|
|
451
|
-
readonly expiresAt: string;
|
|
452
|
-
}
|
|
453
|
-
type OmsPlanState = 'active' | 'paused' | 'needs_address' | 'cancelled';
|
|
454
|
-
type OmsPlanStopReason = 'customer' | 'consent_revoked' | 'needs_address' | 'payment_declined' | 'needs_prescription' | 'item_unavailable' | 'order_refused';
|
|
455
|
-
interface OmsPlanLine {
|
|
456
|
-
readonly offerId: string;
|
|
457
|
-
readonly quantity: number;
|
|
458
|
-
readonly petId: string | null;
|
|
459
|
-
}
|
|
460
|
-
/** An auto-ship plan (contract 4.15, 8.5). */
|
|
461
|
-
interface OmsPlan {
|
|
462
|
-
readonly planId: string;
|
|
463
|
-
readonly lines: readonly OmsPlanLine[];
|
|
464
|
-
readonly cadenceDays: number;
|
|
465
|
-
/** An address ref. */
|
|
466
|
-
readonly destination: string | null;
|
|
467
|
-
readonly paymentMethodId: string | null;
|
|
468
|
-
/** 1000 is the 10% subscribe-and-save discount. */
|
|
469
|
-
readonly discountBps: number;
|
|
470
|
-
readonly nextRun: string | null;
|
|
471
|
-
readonly state: OmsPlanState | string;
|
|
472
|
-
readonly stopReason: OmsPlanStopReason | string | null;
|
|
473
|
-
readonly priceCentsPerCycle?: OmsCents | null;
|
|
474
|
-
/** True on prescription plans: the card is charged once the pharmacy fills it. */
|
|
475
|
-
readonly chargedWhenFilled?: boolean | null;
|
|
476
|
-
/** The next ship day (a date). */
|
|
477
|
-
readonly nextShipOn?: string | null;
|
|
478
|
-
/** The skipped cycle's day (a date), after a skip; null otherwise. */
|
|
479
|
-
readonly skippedCycleOn?: string | null;
|
|
480
|
-
/** Prescription plans only. */
|
|
481
|
-
readonly prescriberName?: string | null;
|
|
482
|
-
readonly refillsLeft?: number | null;
|
|
483
|
-
readonly refillsTotal?: number | null;
|
|
484
|
-
/** The everyday auto discount, in percent (10 is 10% off); null when none is configured. */
|
|
485
|
-
readonly autoDiscountPct?: number | null;
|
|
486
|
-
/** The packs and cadences the plan can change to (CARE-ORDERS-V2 contract section 9); null or absent: cadences only. */
|
|
487
|
-
readonly changeOptions?: readonly OmsPlanChangeOption[] | null;
|
|
488
|
-
/**
|
|
489
|
-
* The Skip sheet's supply warning on a prescription plan: which of Raph's two sentences fits, and the values it is
|
|
490
|
-
* filled with (the host owns the words, as with `statusLineKey`). Null when absent, malformed or an unknown key.
|
|
491
|
-
*/
|
|
492
|
-
readonly skipWarning?: OmsPlanSkipWarning | null;
|
|
493
|
-
}
|
|
494
|
-
/** `last_dose`: one unit left and nothing on its way. `bottle_gap`: the bottle on its way runs out before the next. */
|
|
495
|
-
type OmsPlanSkipWarningKey = 'last_dose' | 'bottle_gap';
|
|
496
|
-
/** A plan's `skip_warning`. Each value is null when the key does not use it, or when the server sent none. */
|
|
497
|
-
interface OmsPlanSkipWarning {
|
|
498
|
-
readonly key: OmsPlanSkipWarningKey;
|
|
499
|
-
readonly values: {
|
|
500
|
-
/** `last_dose`: the counted noun ("chew", "tablet"). */
|
|
501
|
-
readonly unitLabel: string | null;
|
|
502
|
-
/** `last_dose`: the day of the dose the unit left is for (a date). */
|
|
503
|
-
readonly doseOn: string | null;
|
|
504
|
-
/** `last_dose`: the first dose day with none left (a date). */
|
|
505
|
-
readonly noneFor: string | null;
|
|
506
|
-
/** `bottle_gap`: the day what she has plus the fill on its way runs out (a date). */
|
|
507
|
-
readonly lastsTo: string | null;
|
|
508
|
-
/** `bottle_gap`: the gap after a skip, in whole weeks (2 or more). */
|
|
509
|
-
readonly weeks: number | null;
|
|
510
|
-
};
|
|
511
|
-
}
|
|
512
|
-
/** One pack a plan can change to, priced per cycle, with the cadences it allows (CARE-ORDERS-V2 contract section 9). */
|
|
513
|
-
interface OmsPlanChangeOption {
|
|
514
|
-
readonly offerId: string;
|
|
515
|
-
readonly title: string;
|
|
516
|
-
/** The catalog size after the item's name ("90 ct"); null when the title has none. */
|
|
517
|
-
readonly size: string | null;
|
|
518
|
-
readonly packQuantity: string | null;
|
|
519
|
-
readonly packUnit: OmsPackUnit | null;
|
|
520
|
-
/** Prescription plans: the counted noun ("tablet", "chew"); null for everyday items. */
|
|
521
|
-
readonly unitLabel: string | null;
|
|
522
|
-
/** Packs per cycle on this choice. */
|
|
523
|
-
readonly quantity: number;
|
|
524
|
-
readonly priceCentsPerCycle: OmsCents;
|
|
525
|
-
readonly cadenceDays: readonly number[];
|
|
526
|
-
/** The plan's own pack. */
|
|
527
|
-
readonly current: boolean;
|
|
528
|
-
}
|
|
529
|
-
interface OmsPlanPage {
|
|
530
|
-
readonly plans: readonly OmsPlan[];
|
|
531
|
-
readonly nextCursor: string | null;
|
|
532
|
-
}
|
|
533
|
-
interface OmsPlanInput {
|
|
534
|
-
readonly idempotencyKey: string;
|
|
535
|
-
/** 7 to 365. */
|
|
536
|
-
readonly cadenceDays: number;
|
|
537
|
-
readonly destination: string;
|
|
538
|
-
readonly paymentMethodId: string;
|
|
539
|
-
/** Must equal `shop-config.recurringTermsVersion`, else 409 `terms_outdated`. */
|
|
540
|
-
readonly consentTermsVersion: string;
|
|
541
|
-
readonly lines: readonly OmsCartLine[];
|
|
542
|
-
}
|
|
543
|
-
interface OmsPlanPatch {
|
|
544
|
-
readonly idempotencyKey: string;
|
|
545
|
-
readonly lines?: readonly OmsCartLine[];
|
|
546
|
-
readonly cadenceDays?: number;
|
|
547
|
-
/** Another pack from the plan's `changeOptions`, sent with its `cadenceDays` and without `lines`. */
|
|
548
|
-
readonly offerId?: string;
|
|
549
|
-
readonly destination?: string;
|
|
550
|
-
readonly paymentMethodId?: string;
|
|
551
|
-
}
|
|
552
|
-
/** `unskip` (Care > Orders v2) gives back the skipped cycle; idempotent. */
|
|
553
|
-
type OmsPlanOperation = 'pause' | 'skip' | 'resume' | 'unskip';
|
|
554
|
-
/** `GET /oms/buy-again` (Care > Orders v2): one item from delivered orders, deduped by offer, newest first. */
|
|
555
|
-
interface OmsBuyAgainItem {
|
|
556
|
-
readonly offerId: string;
|
|
557
|
-
readonly title: string;
|
|
558
|
-
/** An https URL, else null. */
|
|
559
|
-
readonly imageUrl: string | null;
|
|
560
|
-
readonly priceCents: OmsCents | null;
|
|
561
|
-
/** A date, or null. */
|
|
562
|
-
readonly lastOrderedOn: string | null;
|
|
563
|
-
readonly isRx: boolean;
|
|
564
|
-
/** True when the pack should have run out by now (false when unknown). */
|
|
565
|
-
readonly likelyOut: boolean;
|
|
566
|
-
}
|
|
567
|
-
/** One line of an order's receipt. `total` is `unitPrice` x `quantity` - `discount` + `tax`. */
|
|
568
|
-
interface OmsReceiptLine {
|
|
569
|
-
readonly title: string;
|
|
570
|
-
readonly quantity: number;
|
|
571
|
-
readonly unitPrice: OmsCents;
|
|
572
|
-
readonly discount: OmsCents;
|
|
573
|
-
readonly tax: OmsCents;
|
|
574
|
-
readonly total: OmsCents;
|
|
575
|
-
}
|
|
576
|
-
/** The card a receipt was charged to. */
|
|
577
|
-
interface OmsReceiptCard {
|
|
578
|
-
readonly brand: string;
|
|
579
|
-
readonly last4: string;
|
|
580
|
-
}
|
|
581
|
-
/**
|
|
582
|
-
* `GET /oms/orders/{order_id}/receipt` (Care > Orders v2): `subtotal` - `discounts` + `shipping` + `tax` is `total`.
|
|
583
|
-
* 404 for an unknown order, someone else's, or an older server.
|
|
584
|
-
*/
|
|
585
|
-
interface OmsReceipt {
|
|
586
|
-
readonly orderId: string;
|
|
587
|
-
/** The order number the member sees (`reference.number`), or null. */
|
|
588
|
-
readonly referenceNumber: string | null;
|
|
589
|
-
readonly placedAt: string;
|
|
590
|
-
readonly lines: readonly OmsReceiptLine[];
|
|
591
|
-
readonly subtotal: OmsCents;
|
|
592
|
-
readonly shipping: OmsCents;
|
|
593
|
-
readonly tax: OmsCents;
|
|
594
|
-
readonly discounts: OmsCents;
|
|
595
|
-
readonly total: OmsCents;
|
|
596
|
-
/** Set once the card was charged, else null. */
|
|
597
|
-
readonly paidAt: string | null;
|
|
598
|
-
/** Null when it cannot be read now. */
|
|
599
|
-
readonly card: OmsReceiptCard | null;
|
|
600
|
-
/** Null when it cannot be read now. */
|
|
601
|
-
readonly shipTo: OmsAddress | null;
|
|
602
|
-
}
|
|
603
|
-
type OmsCycleReviewState = 'open' | 'approving' | 'approved' | 'skipped' | 'withdrawn' | 'failed';
|
|
604
|
-
/** `GET /oms/subscriptions/{plan_id}/cycle`. */
|
|
605
|
-
interface OmsCycleReview {
|
|
606
|
-
readonly planId: string;
|
|
607
|
-
/** Null when no review is open: `cycle`, `shipsOn` and `approveBy` then name the next one. */
|
|
608
|
-
readonly reviewId: string | null;
|
|
609
|
-
readonly cycle: number;
|
|
610
|
-
readonly state: OmsCycleReviewState | string | null;
|
|
611
|
-
readonly lines: readonly OmsPlanLine[];
|
|
612
|
-
readonly shipsOn: string | null;
|
|
613
|
-
readonly approveBy: string | null;
|
|
614
|
-
/** The pre-tax quote of the open review's lines (price and discount per line), when one is open. */
|
|
615
|
-
readonly quoteLines: readonly OmsQuoteLine[];
|
|
616
|
-
}
|
|
617
|
-
/** `POST /oms/subscriptions/{plan_id}/cycles/{cycle}/draft`: the taxed draft the owner approves. */
|
|
618
|
-
interface OmsCycleDraft {
|
|
619
|
-
readonly checkoutId: string;
|
|
620
|
-
readonly shipping: OmsCents;
|
|
621
|
-
readonly tax: OmsCents;
|
|
622
|
-
readonly total: OmsCents;
|
|
623
|
-
readonly expiresAt: string | null;
|
|
624
|
-
}
|
|
2
|
+
import { j as FetchLike } from './config.d-cqyvpzDb.js';
|
|
3
|
+
import { y as OmsResult, i as OmsShopConfig, Q as OmsOfferPage, r as OmsOffer, n as OmsPrescription, D as OmsAddressEntry, k as OmsAddressDetail, O as OmsAddressInput, l as OmsPaymentMethod, _ as OmsPaymentSetup, G as OmsCardSetupLink, p as OmsCartLine, g as OmsQuote, I as OmsCheckout, K as OmsConfirmation, e as OmsOrderPage, b as OmsOrder, E as OmsCancelOutcome, Z as OmsPayOutcome, F as OmsCardActionLink, h as OmsReceipt, a9 as OmsReturn, H as OmsCase, a2 as OmsPlanPage, a as OmsBuyAgainItem, a0 as OmsPlanInput, f as OmsPlan, a3 as OmsPlanPatch, t as OmsPlanOperation, M as OmsCycleReview, L as OmsCycleDraft, j as OmsError } from './omsErrors.d-VF5tnr20.js';
|
|
625
4
|
|
|
626
5
|
/** The member's own Cognito id token, asked for on every request. Null (or a throw) means signed out. */
|
|
627
6
|
type OmsGetToken = () => Promise<string | null | undefined> | string | null | undefined;
|
|
@@ -924,9 +303,9 @@ declare const SHOP_COPY: {
|
|
|
924
303
|
tax: string;
|
|
925
304
|
free: string;
|
|
926
305
|
approveAndShip: string;
|
|
927
|
-
/**
|
|
306
|
+
/** The design's phone Care (care, card head pill): "4 items". No phone line for one item yet. */
|
|
928
307
|
itemCount: (n: number) => string;
|
|
929
|
-
/**
|
|
308
|
+
/** The design's phone Care tray bar: "Approve and ship · $138.26". */
|
|
930
309
|
withTotal: (label: string, total: string) => string;
|
|
931
310
|
/** care.html aside aria-label. */
|
|
932
311
|
approveRegion: string;
|
|
@@ -936,7 +315,7 @@ declare const SHOP_COPY: {
|
|
|
936
315
|
questionsRegion: string;
|
|
937
316
|
approving: string;
|
|
938
317
|
skipThisMonth: string;
|
|
939
|
-
/** careShop.ts chargedLine.
|
|
318
|
+
/** careShop.ts chargedLine. The design's line; see the report: the card is HELD at approval, captured after acceptance. */
|
|
940
319
|
chargedWhenShips: (card: string) => string;
|
|
941
320
|
rxCheckedFirst: string;
|
|
942
321
|
delivery: string;
|
|
@@ -963,11 +342,11 @@ declare const SHOP_COPY: {
|
|
|
963
342
|
filtersLabel: string;
|
|
964
343
|
filterAll: string;
|
|
965
344
|
refillSoon: string;
|
|
966
|
-
/** The shelf of ready prescriptions never filled yet, above "Refill soon". DRAFT (pending
|
|
345
|
+
/** The shelf of ready prescriptions never filled yet, above "Refill soon". DRAFT (pending the designer). */
|
|
967
346
|
prescribedFor: (names: readonly string[]) => string;
|
|
968
347
|
inMonthsPackage: (month: string) => string;
|
|
969
348
|
forPets: (names: readonly string[]) => string;
|
|
970
|
-
/** A shelf with no pet names to put in "For
|
|
349
|
+
/** A shelf with no pet names to put in "For {a} and {b}". */
|
|
971
350
|
allProducts: string;
|
|
972
351
|
rx: string;
|
|
973
352
|
/** careShop.ts tileMeta. */
|
|
@@ -1098,9 +477,9 @@ declare const SHOP_COPY_PLACEHOLDERS: readonly string[];
|
|
|
1098
477
|
/** The host's words over the defaults. */
|
|
1099
478
|
declare function shopCopy(overrides?: Partial<ShopCopy>): ShopCopy;
|
|
1100
479
|
|
|
1101
|
-
/**
|
|
480
|
+
/** The design's Care > Orders v2 words. Every function takes values already formatted for display. */
|
|
1102
481
|
declare const SHOP_ORDERS_V2_COPY: {
|
|
1103
|
-
/** "
|
|
482
|
+
/** "{pet}’s orders". */
|
|
1104
483
|
readonly title: (pet: string) => string;
|
|
1105
484
|
/** "3 on auto-refill". */
|
|
1106
485
|
readonly onAuto: (n: number) => string;
|
|
@@ -1109,7 +488,7 @@ declare const SHOP_ORDERS_V2_COPY: {
|
|
|
1109
488
|
readonly onTheWay: (n: number) => string;
|
|
1110
489
|
/** The date block's top line on today's row. */
|
|
1111
490
|
readonly today: "Today";
|
|
1112
|
-
/** "
|
|
491
|
+
/** "{pet} has 8 Apoquel left". */
|
|
1113
492
|
readonly hasLeft: (pet: string, units: number, drug: string) => string;
|
|
1114
493
|
/** "Enough until Thu, Oct 1". */
|
|
1115
494
|
readonly enoughUntil: (day: string) => string;
|
|
@@ -1121,7 +500,7 @@ declare const SHOP_ORDERS_V2_COPY: {
|
|
|
1121
500
|
/** "30 tablets", "1 chew": the pack, from the supply's unit noun. */
|
|
1122
501
|
readonly units: (n: number, unit: string) => string;
|
|
1123
502
|
readonly shipsTomorrow: "Ships tomorrow";
|
|
1124
|
-
/** "Needs
|
|
503
|
+
/** "Needs {vet}’s OK". */
|
|
1125
504
|
readonly needsVetOk: (prescriber: string) => string;
|
|
1126
505
|
readonly trackingDown: "Tracking isn’t loading. Pull down to try again.";
|
|
1127
506
|
readonly wontRunOut: "She won’t run out";
|
|
@@ -1151,7 +530,7 @@ declare const SHOP_ORDERS_V2_COPY: {
|
|
|
1151
530
|
readonly everyMonths: (n: number) => string;
|
|
1152
531
|
/** "30 tablets, every 30 days". */
|
|
1153
532
|
readonly amountEvery: (amount: string, every: string) => string;
|
|
1154
|
-
/** "
|
|
533
|
+
/** "{vet} OKs each refill". */
|
|
1155
534
|
readonly vetOks: (prescriber: string) => string;
|
|
1156
535
|
/** "8 left on her prescription". */
|
|
1157
536
|
readonly leftOnRx: (n: number) => string;
|
|
@@ -1176,10 +555,10 @@ declare const SHOP_ORDERS_V2_COPY: {
|
|
|
1176
555
|
readonly skipSay: (day: string) => string;
|
|
1177
556
|
/** "Skip, next ships Nov 5". */
|
|
1178
557
|
readonly skipGo: (short: string) => string;
|
|
1179
|
-
/** "
|
|
558
|
+
/** "{vet} OKs a new amount before the next one ships." */
|
|
1180
559
|
readonly changeRxSay: (prescriber: string) => string;
|
|
1181
560
|
readonly save: "Save";
|
|
1182
|
-
/** "Nothing ships until you resume.
|
|
561
|
+
/** "Nothing ships until you resume. {vet}’s prescription stays on file, with its 8 refills." ("its 1 refill"). */
|
|
1183
562
|
readonly pauseRxSay: (prescriber: string, refills: number) => string;
|
|
1184
563
|
readonly pauseSay: "Nothing ships until you resume. Resume any time, here.";
|
|
1185
564
|
readonly pauseGo: "Pause it";
|
|
@@ -1200,7 +579,7 @@ declare const SHOP_ORDERS_V2_COPY: {
|
|
|
1200
579
|
readonly addOne: (name: string) => string;
|
|
1201
580
|
/** "One less Vetradent dental chews" (the - button's label). */
|
|
1202
581
|
readonly oneLess: (name: string) => string;
|
|
1203
|
-
/** "Everything else for
|
|
582
|
+
/** "Everything else for {pet}". */
|
|
1204
583
|
readonly everythingElse: (pet: string) => string;
|
|
1205
584
|
readonly pastTitle: "Past orders";
|
|
1206
585
|
readonly pastSub: "Last 3 months";
|
|
@@ -1224,7 +603,7 @@ declare const SHOP_ORDERS_V2_COPY: {
|
|
|
1224
603
|
readonly whenFilled: (off: string | null) => string;
|
|
1225
604
|
readonly checkout: "Checkout";
|
|
1226
605
|
};
|
|
1227
|
-
/**
|
|
606
|
+
/** The design's Care > Orders v2 words (`SHOP_ORDERS_V2_COPY`); a host may replace any of them. */
|
|
1228
607
|
type ShopOrdersV2Copy = {
|
|
1229
608
|
readonly [K in keyof typeof SHOP_ORDERS_V2_COPY]: (typeof SHOP_ORDERS_V2_COPY)[K] extends (...args: infer A) => string ? (...args: A) => string : string;
|
|
1230
609
|
};
|
|
@@ -1256,7 +635,7 @@ declare const SHOP_V3_COPY: {
|
|
|
1256
635
|
shipsTo: string;
|
|
1257
636
|
payWith: string;
|
|
1258
637
|
placeOrder: (total: string) => string;
|
|
1259
|
-
/** The ship-to and pay-with choices have no
|
|
638
|
+
/** The ship-to and pay-with choices have no the design: the rows open plain lists. */
|
|
1260
639
|
chooseAddress: string;
|
|
1261
640
|
chooseCard: string;
|
|
1262
641
|
addAddress: string;
|
|
@@ -1391,4 +770,4 @@ type ShopCardHandoff = () => Promise<ShopPaymentStepResult>;
|
|
|
1391
770
|
|
|
1392
771
|
declare function newIdempotencyKey(): string;
|
|
1393
772
|
|
|
1394
|
-
export {
|
|
773
|
+
export { newIdempotencyKey as A, shopCopy as B, shopOrdersV2Copy as C, shopV3Copy as D, type ShopPayerActionContext as E, 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 ShopV3Copy as d, type ShopRoute as e, type ShopCardHandoff as f, type ShopCardReturn as g, type ShopProfileName as h, type ShopOrdersV2Copy as i, type OmsClientConfig as j, type OmsConsumerAuth as k, type OmsGetToken as l, SHOP_COPY as m, SHOP_COPY_PLACEHOLDERS as n, SHOP_ORDERS_V2_COPY as o, SHOP_V3_COPY as p, SHOP_V3_COPY_PLACEHOLDERS as q, type ShopPackage as r, type ShopPackageLine as s, type ShopPaymentStepResult as t, type ShopTabName as u, type StripeJsLike as v, type StripeJsPaymentsOptions as w, createOmsClient as x, createOmsPackageSource as y, createStripeJsPayments as z };
|