@apextelemed/partner-core 0.19.0-dev.61 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/index.d.ts +23 -2
- package/dist/api/index.js +4 -4
- package/dist/api/index.jsx +8 -4
- package/dist/chunk/{HEQLEGHI.js → BTDK3J34.js} +51 -3
- package/dist/chunk/BTDK3J34.js.map +1 -0
- package/dist/chunk/ESNAWOHG.jsx +1 -0
- package/dist/chunk/{TFJKTKZ3.jsx → FKEDRIA7.jsx} +2986 -2099
- package/dist/chunk/{CDRUVUTJ.js → FZ4LIOG2.js} +18 -8
- package/dist/chunk/FZ4LIOG2.js.map +1 -0
- package/dist/chunk/{OZHJ5IGL.jsx → HEXXZYK4.jsx} +370 -131
- package/dist/chunk/{ZWAZNB4Y.jsx → HSBATWVL.jsx} +2 -2
- package/dist/chunk/{WTHAR2P2.js → LJAMZMRF.js} +3 -3
- package/dist/chunk/{WTHAR2P2.js.map → LJAMZMRF.js.map} +1 -1
- package/dist/chunk/{33BDC6MT.jsx → MVWCKLRH.jsx} +2 -2
- package/dist/chunk/{GJSE37VN.js → O2VF7KNG.js} +3 -3
- package/dist/chunk/{GJSE37VN.js.map → O2VF7KNG.js.map} +1 -1
- package/dist/chunk/{UZ2K7HBG.js → P6YCW73X.js} +2475 -1202
- package/dist/chunk/P6YCW73X.js.map +1 -0
- package/dist/chunk/{X6WJQ47H.jsx → PZ4BRSEK.jsx} +50 -2
- package/dist/chunk/{EED3KNR7.jsx → UAZK2UTR.jsx} +41 -3
- package/dist/chunk/{VGF2LLAD.js → WM5KNUNX.js} +240 -14
- package/dist/chunk/WM5KNUNX.js.map +1 -0
- package/dist/chunk/{OOMMZESR.js → WUVYCWKW.js} +40 -4
- package/dist/chunk/WUVYCWKW.js.map +1 -0
- package/dist/chunk/XZVVZIRZ.js +3 -0
- package/dist/chunk/XZVVZIRZ.js.map +1 -0
- package/dist/chunk/{LA6F37YV.jsx → ZEQ5TNDM.jsx} +20 -7
- package/dist/{client-CMbSYUam.d.ts → client-C0MG1mOg.d.ts} +178 -2
- package/dist/flows/index.d.ts +113 -2
- package/dist/flows/index.js +6 -6
- package/dist/flows/index.jsx +14 -6
- package/dist/index/index.d.ts +26 -5
- package/dist/index/index.js +8 -8
- package/dist/index/index.jsx +22 -8
- package/dist/pages/index.d.ts +2 -2
- package/dist/pages/index.js +5 -5
- package/dist/pages/index.jsx +5 -5
- package/dist/stores/index.d.ts +1 -1
- package/dist/stores/index.js +2 -2
- package/dist/stores/index.jsx +2 -2
- package/dist/theme/admin.css +3 -0
- package/dist/theme/member-portal.css +43 -0
- package/package.json +1 -1
- package/dist/chunk/ACE7M2YA.jsx +0 -1
- package/dist/chunk/CDRUVUTJ.js.map +0 -1
- package/dist/chunk/HEQLEGHI.js.map +0 -1
- package/dist/chunk/JSHO46VZ.js +0 -3
- package/dist/chunk/JSHO46VZ.js.map +0 -1
- package/dist/chunk/OOMMZESR.js.map +0 -1
- package/dist/chunk/UZ2K7HBG.js.map +0 -1
- package/dist/chunk/VGF2LLAD.js.map +0 -1
package/dist/api/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as ADMIN_ROLES, a as AddPharmacyBody, b as AddPharmacyDoseMatch, c as AddPharmacyDoseOption, d as AddPharmacyFinding, e as AddPharmacyMatchQuestion, f as AddPharmacyMatchSource, g as AddPharmacyPlan, h as AddPharmacyPrice, i as AddPharmacyResult, j as AddPharmacyStrengthAfter, k as AddPharmacyStrengthBefore, l as AddressVerifyResult, m as AdminApexDrug, n as AdminApexItemStatus, o as AdminBillingAttempt, p as
|
|
1
|
+
export { A as ADMIN_ROLES, a as AddPharmacyBody, b as AddPharmacyDoseMatch, c as AddPharmacyDoseOption, d as AddPharmacyFinding, e as AddPharmacyMatchQuestion, f as AddPharmacyMatchSource, g as AddPharmacyPlan, h as AddPharmacyPrice, i as AddPharmacyResult, j as AddPharmacyStrengthAfter, k as AddPharmacyStrengthBefore, l as AddressVerifyResult, m as AdminApexDrug, n as AdminApexItemStatus, o as AdminBillingAttempt, p as AdminBillingForecast, q as AdminBillingForecastDay, r as AdminCategory, s as AdminCategoryInput, t as AdminCategoryUpdate, u as AdminCustomer, v as AdminCustomerFacts, w as AdminCustomerFunnel, x as AdminCustomerListParams, y as AdminCustomerOverview, z as AdminCustomerProfile, B as AdminCustomerRequest, C as AdminCustomerRow, D as AdminCustomerSupport, E as AdminCustomerSupportThread, F as AdminDashboardStats, G as AdminFillAnchor, H as AdminFillSchedule, I as AdminInviteResult, J as AdminLifecycle, K as AdminLifecycleBucket, L as AdminListParams, M as AdminMe, N as AdminOffer, O as AdminOfferBase, P as AdminOfferGrant, Q as AdminOfferGrantBase, R as AdminOfferInput, S as AdminOrderSummary, T as AdminOrphanReason, U as AdminOrphanedDosePrice, V as AdminPayment, W as AdminPaymentDetail, X as AdminProduct, Y as AdminProductOverlayField, Z as AdminProductPharmacy, _ as AdminProductStrength, $ as AdminPromoCode, a0 as AdminPromoCodeInput, a1 as AdminRecurringPricePoint, a2 as AdminRecurringRevenue, a3 as AdminRefundResult, a4 as AdminRetimeFillBody, a5 as AdminRetimeFillResult, a6 as AdminRetimeSnapshot, a7 as AdminRole, a8 as AdminSale, a9 as AdminSaleInput, aa as AdminScheduledRefund, ab as AdminScheduledRefundProblem, ac as AdminSmsMessage, ad as AdminSmsMessagesParams, ae as AdminSmsNotReadyReason, af as AdminSmsSegmentInfo, ag as AdminSmsSettings, ah as AdminSmsTemplate, ai as AdminSmsTemplateChange, aj as AdminSmsTemplateChanges, ak as AdminSmsTestResult, al as AdminSmsTestStatus, am as AdminSubscription, an as AdminSubscriptionDetail, ao as AdminSubscriptionPatch, ap as AdminSubscriptionWriteResult, aq as AdminSupportCustomer, ar as AdminSupportStats, as as AdminSupportThread, at as AdminTeamInvite, au as AdminTeamMember, av as AdminWebhookEvent, aw as Affiliate, ax as AffiliateAuthTokens, ay as AffiliateClickRecord, az as AffiliateConversion, aA as AffiliateDashboardLinks, aB as AffiliateDashboardProfile, aC as AffiliateDashboardStats, aD as AffiliateDownlineMember, aE as AffiliateEarningsBreakdown, aF as AffiliatePaymentMethod, aG as AffiliateProgram, aH as AffiliateRegisterInput, aI as AffiliateRegisterResponse, aJ as AffiliateSession, aK as AffiliateStatsResponse, aL as AffiliateStatus, aM as AffiliateTrackResponse, aN as ApiError, aO as ApiResponse, aP as AttributionMethod, aQ as AuthTokens, aR as BillingReminderSettings, aS as CatalogAvailabilityItem, aT as CatalogAvailabilityReason, aU as CatalogAvailabilityResult, aV as CatalogClassification, aW as CatalogConversionChoice, aX as CatalogConversionCommitResult, aY as CatalogConversionDose, aZ as CatalogConversionDoseMatch, a_ as CatalogConversionFinding, a$ as CatalogConversionPointers, b0 as CatalogConversionPrepareResult, b1 as CatalogConversionPreview, b2 as CatalogConversionRun, b3 as CatalogConversionSource, b4 as CatalogConversionStage, b5 as CatalogConversionTarget, b6 as CatalogConversionUndoOptions, b7 as CatalogConversionUndoResult, b8 as CatalogDose, b9 as CatalogDoseInput, ba as CatalogDoseModel, bb as CatalogDoseSuggestion, bc as CatalogDoseSuggestions, bd as CatalogEquivalentSuggestions, be as CatalogFulfillment, bf as CatalogFulfillmentInput, bg as CatalogItem, bh as CatalogItemInput, bi as CatalogMappableDrug, bj as CatalogMatrixCell, bk as CatalogProduct, bl as CatalogReadiness, bm as CategoryMetadata, bn as CheckoutAddress, bo as CheckoutPayload, bp as CheckoutResult, bq as CommissionConfig, br as CommissionStatus, bs as CompleteSurveyPayload, bt as CreateAffiliatePayload, bu as CreateAffiliateProgramPayload, bv as CreateOrderPayload, bw as CreateRequestPayload, bx as CreateSubscriptionPayload, by as CustomTemplate, bz as CustomTemplateInput, bA as CustomerDiscountConfig, bB as DeliveryInfo, bC as DiscountType, bD as EmailNotificationSettings, bE as EmailTemplatesMap, bF as LoginPayload, bG as MemberOffer, bH as MemberPrescriptionRequest, bI as MemberSurveyMode, bJ as MemberSurveyResponseSummary, bK as MemberSurveyTranscript, bL as MemberSurveyTranscriptItem, bM as MemberSurveyTranscriptSection, bN as MembersMeResponse, bO as OfferGrantState, bP as Order, bQ as OrderItemInput, bR as PaginationParams, bS as PaymentCallbackPayload, bT as PaymentInitiatePayload, bU as PaymentType, bV as PendingRenewalSurvey, bW as Placeholder, bX as PlaceholderKind, bY as ProductSaleSummary, bZ as PromoValidationResponse, b_ as PublicCategory, b$ as RegisterAndSubscribePayload, c0 as RegisterPayload, c1 as RenewalStatus, c2 as SUPPORT_ATTACHMENT_MAX_BYTES, c3 as SUPPORT_ATTACHMENT_MIME_TYPES, c4 as SelectDrugPayload, c5 as SendMessagePayload, c6 as SendToPharmacyPayload, c7 as SmsConsentResult, c8 as SmsConsentStatus, c9 as SmsRefusalReason, ca as SubscriptionPreview, cb as SubscriptionPreviewLine, cc as SubscriptionPreviewPayload, cd as SupportAttachment, ce as SupportChannel, cf as SupportChannelSettings, cg as SupportMessage, ch as SupportRealtimeToken, ci as SupportThread, cj as SupportThreadCategory, ck as SupportThreadStatus, cl as SurveySubmitPayload, cm as TemplatePlaceholdersMap, cn as TemplateText, co as TenantFeature, cp as TenantFeatureAccess, cq as TokenTrackName, cr as UpdateAffiliatePayload, cs as UpdateAffiliateProgramPayload, ct as UpdatePaymentMethodPayload, cu as UpdateProfilePayload, cv as UpdateProfileResponse, cw as User, cx as UserSmsEvent, cy as UserSmsState, cz as addressesApi, cA as adminAffiliatesApi, cB as adminApi, cC as adminCatalogApi, cD as adminCatalogConversionApi, cE as adminProductPharmaciesApi, cF as affiliateAuthStorageKey, cG as affiliatePortalApi, cH as apexApi, cI as apiFetch, cJ as authApi, cK as authStorageKey, cL as catalogApi, cM as clearAffiliateTokens, cN as clearTokens, cO as getAffiliateTokens, cP as getTokens, cQ as membersApi, cR as messagesApi, cS as newIdempotencyKey, cT as offersApi, cU as onTokensCleared, cV as ordersApi, cW as paymentsApi, cX as productsApi, cY as promoCodesApi, cZ as setAffiliateTokens, c_ as setTokens, c$ as subscriptionsApi, d0 as supportApi, d1 as usersApi } from '../client-C0MG1mOg.js';
|
|
2
2
|
export { EmbedApiError as ApexV2ApiError, EmbedApiClient, EmbedApiClientOptions, EmbedApiError, EmbedEvent, EmbedEventType, FetchLike, PatientInfo, V2Answer, V2ComposedSurvey, V2DrugResult, V2QualificationResult, V2Question, V2QuestionOption, V2Section, V2Step, V2SubmitResult, V2VisibilityCondition, createEmbedApiClient, disqualificationReasonText, disqualifiedDrugIds, qualifiedDrugIds } from '@apextelemed/survey-core';
|
|
3
3
|
export { C as CartCaptureConfig, a as CartSnapshotLine, F as FunnelConfig, b as FunnelDraftPayload, R as ResumedCart, c as ResumedCartLine, d as ResumedDraft, e as adoptCartId, f as adoptFunnelSessionId, g as captureAuthHeader, h as cartId, i as fetchCartConfig, j as fetchFunnelConfig, k as fetchResumedCart, l as fetchResumedDraft, m as funnelSessionId, p as peekFunnelSessionId, n as postCartSnapshot, o as postFunnelEvent, r as readCartToken, q as readResumeToken, s as resetCartConfigCache, t as resetCartId, u as resetFunnelConfigCache, v as saveFunnelDraft, w as stripCartToken, x as stripResumeToken } from '../cart-BwUwSzWh.js';
|
|
4
4
|
|
|
@@ -22,4 +22,25 @@ declare function readPromoCode(): string | null;
|
|
|
22
22
|
/** Drop the stored promo code. */
|
|
23
23
|
declare function clearPromoCode(): void;
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
interface SmsConfig {
|
|
26
|
+
/** Tenant texts customers (feature on, number registered, switched on). false = show nothing. */
|
|
27
|
+
enabled: boolean;
|
|
28
|
+
/** The sender the consent wording names, e.g. "Acme Health". */
|
|
29
|
+
brandName?: string;
|
|
30
|
+
/** The consent wording, verbatim. Never reword it: what the person saw is what the record holds. */
|
|
31
|
+
consentText?: string;
|
|
32
|
+
/** Identifies `consentText`; sent back with a grant so the server knows which words were shown. */
|
|
33
|
+
consentTextVersion?: string;
|
|
34
|
+
termsUrl?: string;
|
|
35
|
+
privacyUrl?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The tenant's text-message posture, fetched once per page load and cached.
|
|
39
|
+
* Fails closed: any error — and an "enabled" reply that arrives without the
|
|
40
|
+
* wording or its version — reads as "off".
|
|
41
|
+
*/
|
|
42
|
+
declare function fetchSmsConfig(): Promise<SmsConfig>;
|
|
43
|
+
/** Test seam: forget the cached config so the next fetch re-resolves. */
|
|
44
|
+
declare function resetSmsConfigCache(): void;
|
|
45
|
+
|
|
46
|
+
export { type SmsConfig, captureAffiliateRef, capturePromoCode, clearAffiliateRef, clearPromoCode, fetchSmsConfig, readAffiliateRef, readPromoCode, resetSmsConfigCache };
|
package/dist/api/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import '../chunk/
|
|
2
|
-
export { adoptCartId, capturePromoCode, cartId, clearPromoCode, fetchCartConfig, fetchResumedCart, postCartSnapshot, readCartToken, readPromoCode, resetCartConfigCache, resetCartId, stripCartToken } from '../chunk/
|
|
1
|
+
import '../chunk/XZVVZIRZ.js';
|
|
2
|
+
export { adoptCartId, capturePromoCode, cartId, clearPromoCode, fetchCartConfig, fetchResumedCart, postCartSnapshot, readCartToken, readPromoCode, resetCartConfigCache, resetCartId, stripCartToken } from '../chunk/LJAMZMRF.js';
|
|
3
3
|
export { EmbedApiError2 as ApexV2ApiError, EmbedApiError, createEmbedApiClient, disqualificationReasonText, disqualifiedDrugIds, qualifiedDrugIds } from '../chunk/LZWA44KD.js';
|
|
4
|
-
export { adoptFunnelSessionId, captureAuthHeader, fetchFunnelConfig, fetchResumedDraft, funnelSessionId, peekFunnelSessionId, postFunnelEvent, readResumeToken, resetFunnelConfigCache, saveFunnelDraft, stripResumeToken } from '../chunk/
|
|
5
|
-
export { ADMIN_ROLES, ApiError, SUPPORT_ATTACHMENT_MAX_BYTES, SUPPORT_ATTACHMENT_MIME_TYPES, addressesApi, adminAffiliatesApi, adminApi, adminCatalogApi, adminCatalogConversionApi, adminProductPharmaciesApi, affiliateAuthStorageKey, affiliatePortalApi, apexApi, apiFetch, authApi, authStorageKey, captureAffiliateRef, catalogApi, clearAffiliateRef, clearAffiliateTokens, clearTokens, getAffiliateTokens, getTokens, membersApi, messagesApi, newIdempotencyKey, offersApi, onTokensCleared, ordersApi, paymentsApi, productsApi, promoCodesApi, readAffiliateRef, setAffiliateTokens, setTokens, subscriptionsApi, supportApi, usersApi } from '../chunk/
|
|
4
|
+
export { adoptFunnelSessionId, captureAuthHeader, fetchFunnelConfig, fetchResumedDraft, fetchSmsConfig, funnelSessionId, peekFunnelSessionId, postFunnelEvent, readResumeToken, resetFunnelConfigCache, resetSmsConfigCache, saveFunnelDraft, stripResumeToken } from '../chunk/WUVYCWKW.js';
|
|
5
|
+
export { ADMIN_ROLES, ApiError, SUPPORT_ATTACHMENT_MAX_BYTES, SUPPORT_ATTACHMENT_MIME_TYPES, addressesApi, adminAffiliatesApi, adminApi, adminCatalogApi, adminCatalogConversionApi, adminProductPharmaciesApi, affiliateAuthStorageKey, affiliatePortalApi, apexApi, apiFetch, authApi, authStorageKey, captureAffiliateRef, catalogApi, clearAffiliateRef, clearAffiliateTokens, clearTokens, getAffiliateTokens, getTokens, membersApi, messagesApi, newIdempotencyKey, offersApi, onTokensCleared, ordersApi, paymentsApi, productsApi, promoCodesApi, readAffiliateRef, setAffiliateTokens, setTokens, subscriptionsApi, supportApi, usersApi } from '../chunk/BTDK3J34.js';
|
|
6
6
|
import '../chunk/2IFPDU4D.js';
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
package/dist/api/index.jsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../chunk/
|
|
1
|
+
import "../chunk/ESNAWOHG.jsx";
|
|
2
2
|
import {
|
|
3
3
|
adoptCartId,
|
|
4
4
|
capturePromoCode,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
resetCartConfigCache,
|
|
13
13
|
resetCartId,
|
|
14
14
|
stripCartToken
|
|
15
|
-
} from "../chunk/
|
|
15
|
+
} from "../chunk/MVWCKLRH.jsx";
|
|
16
16
|
import {
|
|
17
17
|
EmbedApiError,
|
|
18
18
|
EmbedApiError2,
|
|
@@ -26,14 +26,16 @@ import {
|
|
|
26
26
|
captureAuthHeader,
|
|
27
27
|
fetchFunnelConfig,
|
|
28
28
|
fetchResumedDraft,
|
|
29
|
+
fetchSmsConfig,
|
|
29
30
|
funnelSessionId,
|
|
30
31
|
peekFunnelSessionId,
|
|
31
32
|
postFunnelEvent,
|
|
32
33
|
readResumeToken,
|
|
33
34
|
resetFunnelConfigCache,
|
|
35
|
+
resetSmsConfigCache,
|
|
34
36
|
saveFunnelDraft,
|
|
35
37
|
stripResumeToken
|
|
36
|
-
} from "../chunk/
|
|
38
|
+
} from "../chunk/UAZK2UTR.jsx";
|
|
37
39
|
import {
|
|
38
40
|
ADMIN_ROLES,
|
|
39
41
|
ApiError,
|
|
@@ -73,7 +75,7 @@ import {
|
|
|
73
75
|
subscriptionsApi,
|
|
74
76
|
supportApi,
|
|
75
77
|
usersApi
|
|
76
|
-
} from "../chunk/
|
|
78
|
+
} from "../chunk/PZ4BRSEK.jsx";
|
|
77
79
|
import "../chunk/QVZ7BRNO.jsx";
|
|
78
80
|
export {
|
|
79
81
|
ADMIN_ROLES,
|
|
@@ -112,6 +114,7 @@ export {
|
|
|
112
114
|
fetchFunnelConfig,
|
|
113
115
|
fetchResumedCart,
|
|
114
116
|
fetchResumedDraft,
|
|
117
|
+
fetchSmsConfig,
|
|
115
118
|
funnelSessionId,
|
|
116
119
|
getAffiliateTokens,
|
|
117
120
|
getTokens,
|
|
@@ -135,6 +138,7 @@ export {
|
|
|
135
138
|
resetCartConfigCache,
|
|
136
139
|
resetCartId,
|
|
137
140
|
resetFunnelConfigCache,
|
|
141
|
+
resetSmsConfigCache,
|
|
138
142
|
saveFunnelDraft,
|
|
139
143
|
setAffiliateTokens,
|
|
140
144
|
setTokens,
|
|
@@ -290,6 +290,9 @@ var ApiError = class extends Error {
|
|
|
290
290
|
/** The response body's `details`, untouched, for the few refusals whose
|
|
291
291
|
* specifics a caller acts on (e.g. which prices are missing). Never shown as prose. */
|
|
292
292
|
details;
|
|
293
|
+
/** The response body's `reason`, when the endpoint names why it refused (e.g.
|
|
294
|
+
* `stale_text` on a text-message consent). Branch on this, never on message. */
|
|
295
|
+
reason;
|
|
293
296
|
constructor(message, opts = {}) {
|
|
294
297
|
super(message);
|
|
295
298
|
this.name = "ApiError";
|
|
@@ -297,6 +300,7 @@ var ApiError = class extends Error {
|
|
|
297
300
|
this.ambiguous = opts.ambiguous ?? false;
|
|
298
301
|
this.code = opts.code;
|
|
299
302
|
this.details = opts.details;
|
|
303
|
+
this.reason = opts.reason;
|
|
300
304
|
if (opts.cause !== void 0) this.cause = opts.cause;
|
|
301
305
|
}
|
|
302
306
|
};
|
|
@@ -374,11 +378,13 @@ async function coreFetch(endpoint, fetchOpts, track, call = {}) {
|
|
|
374
378
|
let errorMsg = `Request failed: ${res.status}`;
|
|
375
379
|
let errorCode;
|
|
376
380
|
let errorDetails;
|
|
381
|
+
let errorReason;
|
|
377
382
|
try {
|
|
378
383
|
const body = await res.json();
|
|
379
384
|
errorMsg = body.error || body.message || errorMsg;
|
|
380
385
|
errorCode = typeof body.code === "string" ? body.code : void 0;
|
|
381
386
|
errorDetails = body.details;
|
|
387
|
+
errorReason = typeof body.reason === "string" ? body.reason : void 0;
|
|
382
388
|
if (track.enrichErrorDetails && Array.isArray(body.details) && body.details.length > 0) {
|
|
383
389
|
const lines = body.details.map(
|
|
384
390
|
(d) => typeof d === "string" ? d : d?.message
|
|
@@ -394,7 +400,8 @@ async function coreFetch(endpoint, fetchOpts, track, call = {}) {
|
|
|
394
400
|
status: res.status,
|
|
395
401
|
ambiguous: res.status >= 500,
|
|
396
402
|
code: errorCode,
|
|
397
|
-
...errorDetails !== void 0 ? { details: errorDetails } : {}
|
|
403
|
+
...errorDetails !== void 0 ? { details: errorDetails } : {},
|
|
404
|
+
...errorReason !== void 0 ? { reason: errorReason } : {}
|
|
398
405
|
});
|
|
399
406
|
}
|
|
400
407
|
if (res.status === 204) return void 0;
|
|
@@ -833,6 +840,13 @@ var usersApi = {
|
|
|
833
840
|
},
|
|
834
841
|
updateProfile(payload) {
|
|
835
842
|
return patch("/users/me", payload);
|
|
843
|
+
},
|
|
844
|
+
getSmsState() {
|
|
845
|
+
return apiFetch("/users/me/sms");
|
|
846
|
+
},
|
|
847
|
+
/** Only the named events change; the reply is the full state again. */
|
|
848
|
+
setSmsEvents(events) {
|
|
849
|
+
return put("/users/me/sms/preferences", { events });
|
|
836
850
|
}
|
|
837
851
|
};
|
|
838
852
|
var membersApi = {
|
|
@@ -978,6 +992,14 @@ var adminApi = {
|
|
|
978
992
|
getRecurringRevenue() {
|
|
979
993
|
return apiFetch("/admin/dashboard/recurring-revenue");
|
|
980
994
|
},
|
|
995
|
+
/**
|
|
996
|
+
* Charges due on each of the next `days` days (1–92, default 31), bucketed by
|
|
997
|
+
* calendar day in `timeZone` (an IANA zone; default the browser's).
|
|
998
|
+
*/
|
|
999
|
+
getBillingForecast(days = 31, timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone) {
|
|
1000
|
+
const q = new URLSearchParams({ days: String(days), tz: timeZone || "UTC" });
|
|
1001
|
+
return apiFetch(`/admin/dashboard/billing-forecast?${q}`);
|
|
1002
|
+
},
|
|
981
1003
|
getCustomers(params) {
|
|
982
1004
|
const query = params ? { ...params, facets: params.facets ? 1 : void 0 } : void 0;
|
|
983
1005
|
return apiFetch(`/admin/customers${qs(query)}`);
|
|
@@ -1138,6 +1160,32 @@ var adminApi = {
|
|
|
1138
1160
|
note ? { note } : {}
|
|
1139
1161
|
);
|
|
1140
1162
|
},
|
|
1163
|
+
// ── Text messages (settings.write / emailTemplates.write / patient.support) ──
|
|
1164
|
+
/** Is this site set up to text customers, and from what number. Needs `settings.write`. */
|
|
1165
|
+
getSmsSettings() {
|
|
1166
|
+
return apiFetch("/admin/sms/settings");
|
|
1167
|
+
},
|
|
1168
|
+
/** Every event's text, as saved. Needs `emailTemplates.write`. */
|
|
1169
|
+
getSmsTemplates() {
|
|
1170
|
+
return apiFetch("/admin/sms/templates");
|
|
1171
|
+
},
|
|
1172
|
+
/**
|
|
1173
|
+
* Change some events' texts. Send ONLY what changed: a missing event or field
|
|
1174
|
+
* is kept, `null` resets to the default. Rejects (400) with the server's
|
|
1175
|
+
* reason when a body doesn't start with `{{siteName}}`, runs past 300
|
|
1176
|
+
* characters, or uses a token the event doesn't have. Returns the full list.
|
|
1177
|
+
*/
|
|
1178
|
+
saveSmsTemplates(templates) {
|
|
1179
|
+
return put("/admin/sms/templates", { templates });
|
|
1180
|
+
},
|
|
1181
|
+
/** Text the SAVED version of an event to the signed-in admin's own phone. */
|
|
1182
|
+
sendSmsTemplateTest(key) {
|
|
1183
|
+
return post(`/admin/sms/templates/${encodeURIComponent(key)}/test`);
|
|
1184
|
+
},
|
|
1185
|
+
/** The send log, newest first. Needs `patient.support`. Page with `nextBefore`. */
|
|
1186
|
+
listSmsMessages(params) {
|
|
1187
|
+
return apiFetch(`/admin/sms/messages${qs(params)}`);
|
|
1188
|
+
},
|
|
1141
1189
|
getEmailNotifications() {
|
|
1142
1190
|
return apiFetch("/admin/settings/email-notifications");
|
|
1143
1191
|
},
|
|
@@ -1564,5 +1612,5 @@ var affiliatePortalApi = {
|
|
|
1564
1612
|
};
|
|
1565
1613
|
|
|
1566
1614
|
export { ADMIN_ROLES, ApiError, SUPPORT_ATTACHMENT_MAX_BYTES, SUPPORT_ATTACHMENT_MIME_TYPES, addressesApi, adminAffiliatesApi, adminApi, adminCatalogApi, adminCatalogConversionApi, adminProductPharmaciesApi, affiliateAuthStorageKey, affiliatePortalApi, apexApi, apiFetch, authApi, authStorageKey, captureAffiliateRef, catalogApi, clearAffiliateRef, clearAffiliateTokens, clearTokens, getAffiliateTokens, getTokens, membersApi, messagesApi, newIdempotencyKey, offersApi, onTokensCleared, ordersApi, paymentsApi, productsApi, promoCodesApi, readAffiliateRef, setAffiliateTokens, setTokens, subscriptionsApi, supportApi, usersApi };
|
|
1567
|
-
//# sourceMappingURL=
|
|
1568
|
-
//# sourceMappingURL=
|
|
1615
|
+
//# sourceMappingURL=BTDK3J34.js.map
|
|
1616
|
+
//# sourceMappingURL=BTDK3J34.js.map
|