@apextelemed/partner-core 0.18.0-dev.59 → 0.18.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.
Files changed (50) hide show
  1. package/dist/api/index.d.ts +23 -2
  2. package/dist/api/index.js +4 -4
  3. package/dist/api/index.jsx +8 -4
  4. package/dist/chunk/{AXCXMZKP.js → 22EFLJGO.js} +18 -8
  5. package/dist/chunk/22EFLJGO.js.map +1 -0
  6. package/dist/chunk/{P6RRDH3K.jsx → 2Q4GK4WD.jsx} +41 -3
  7. package/dist/chunk/{C4V7G2WO.js → BPF2SSKF.js} +3 -3
  8. package/dist/chunk/{C4V7G2WO.js.map → BPF2SSKF.js.map} +1 -1
  9. package/dist/chunk/{HWUNDWNY.js → CED3IYWX.js} +40 -4
  10. package/dist/chunk/CED3IYWX.js.map +1 -0
  11. package/dist/chunk/ESNAWOHG.jsx +1 -0
  12. package/dist/chunk/{23TRH45I.jsx → FL3DS5WN.jsx} +370 -131
  13. package/dist/chunk/{B3IHYFCS.js → GSYL4J57.js} +2712 -1452
  14. package/dist/chunk/GSYL4J57.js.map +1 -0
  15. package/dist/chunk/{HECRSRX5.jsx → GULO22W6.jsx} +2 -2
  16. package/dist/chunk/{IJR3CERD.js → GYAT2X65.js} +51 -3
  17. package/dist/chunk/GYAT2X65.js.map +1 -0
  18. package/dist/chunk/{QMMIJ5T5.jsx → I7L5WVA2.jsx} +20 -7
  19. package/dist/chunk/{WSP34CNN.jsx → PWEK34Q4.jsx} +50 -2
  20. package/dist/chunk/{OMHZD4JU.jsx → U5DE7VZP.jsx} +3156 -2314
  21. package/dist/chunk/{6D2HEGRD.js → UM5K75Y4.js} +3 -3
  22. package/dist/chunk/{6D2HEGRD.js.map → UM5K75Y4.js.map} +1 -1
  23. package/dist/chunk/{QN3GGUYU.jsx → W5QWCMTE.jsx} +2 -2
  24. package/dist/chunk/{PJVEDHQN.js → XPYBZU45.js} +240 -14
  25. package/dist/chunk/XPYBZU45.js.map +1 -0
  26. package/dist/chunk/XZVVZIRZ.js +3 -0
  27. package/dist/chunk/XZVVZIRZ.js.map +1 -0
  28. package/dist/{client-DUg3WI5F.d.ts → client-BQ8AEx5S.d.ts} +191 -2
  29. package/dist/flows/index.d.ts +113 -2
  30. package/dist/flows/index.js +6 -6
  31. package/dist/flows/index.jsx +14 -6
  32. package/dist/index/index.d.ts +26 -5
  33. package/dist/index/index.js +8 -8
  34. package/dist/index/index.jsx +22 -8
  35. package/dist/pages/index.d.ts +2 -2
  36. package/dist/pages/index.js +5 -5
  37. package/dist/pages/index.jsx +5 -5
  38. package/dist/stores/index.d.ts +1 -1
  39. package/dist/stores/index.js +2 -2
  40. package/dist/stores/index.jsx +2 -2
  41. package/dist/theme/member-portal.css +43 -0
  42. package/package.json +1 -1
  43. package/dist/chunk/ACE7M2YA.jsx +0 -1
  44. package/dist/chunk/AXCXMZKP.js.map +0 -1
  45. package/dist/chunk/B3IHYFCS.js.map +0 -1
  46. package/dist/chunk/HWUNDWNY.js.map +0 -1
  47. package/dist/chunk/IJR3CERD.js.map +0 -1
  48. package/dist/chunk/JSHO46VZ.js +0 -3
  49. package/dist/chunk/JSHO46VZ.js.map +0 -1
  50. package/dist/chunk/PJVEDHQN.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  captureAuthHeader,
3
3
  peekFunnelSessionId
4
- } from "./P6RRDH3K.jsx";
4
+ } from "./2Q4GK4WD.jsx";
5
5
  import {
6
6
  getConfig
7
7
  } from "./QVZ7BRNO.jsx";
@@ -174,4 +174,4 @@ export {
174
174
  readCartToken,
175
175
  stripCartToken
176
176
  };
177
- //# sourceMappingURL=HECRSRX5.jsx.map
177
+ //# sourceMappingURL=GULO22W6.jsx.map
@@ -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 = {
@@ -996,6 +1010,14 @@ var adminApi = {
996
1010
  updateSubscription(id, body) {
997
1011
  return patch(`/admin/subscriptions/${id}`, body);
998
1012
  },
1013
+ /**
1014
+ * Move a subscription's next refill and its check-in while unopened. Never
1015
+ * touches billing (use `updateSubscription` for that). 409 once the refill is
1016
+ * ordered or before the last order has gone out (`fillSchedule.retime.reason`).
1017
+ */
1018
+ retimeNextFill(subscriptionId, body) {
1019
+ return post(`/admin/subscriptions/${subscriptionId}/retime-fill`, body);
1020
+ },
999
1021
  pauseSubscription(id) {
1000
1022
  return post(`/admin/subscriptions/${id}/pause`, {});
1001
1023
  },
@@ -1130,6 +1152,32 @@ var adminApi = {
1130
1152
  note ? { note } : {}
1131
1153
  );
1132
1154
  },
1155
+ // ── Text messages (settings.write / emailTemplates.write / patient.support) ──
1156
+ /** Is this site set up to text customers, and from what number. Needs `settings.write`. */
1157
+ getSmsSettings() {
1158
+ return apiFetch("/admin/sms/settings");
1159
+ },
1160
+ /** Every event's text, as saved. Needs `emailTemplates.write`. */
1161
+ getSmsTemplates() {
1162
+ return apiFetch("/admin/sms/templates");
1163
+ },
1164
+ /**
1165
+ * Change some events' texts. Send ONLY what changed: a missing event or field
1166
+ * is kept, `null` resets to the default. Rejects (400) with the server's
1167
+ * reason when a body doesn't start with `{{siteName}}`, runs past 300
1168
+ * characters, or uses a token the event doesn't have. Returns the full list.
1169
+ */
1170
+ saveSmsTemplates(templates) {
1171
+ return put("/admin/sms/templates", { templates });
1172
+ },
1173
+ /** Text the SAVED version of an event to the signed-in admin's own phone. */
1174
+ sendSmsTemplateTest(key) {
1175
+ return post(`/admin/sms/templates/${encodeURIComponent(key)}/test`);
1176
+ },
1177
+ /** The send log, newest first. Needs `patient.support`. Page with `nextBefore`. */
1178
+ listSmsMessages(params) {
1179
+ return apiFetch(`/admin/sms/messages${qs(params)}`);
1180
+ },
1133
1181
  getEmailNotifications() {
1134
1182
  return apiFetch("/admin/settings/email-notifications");
1135
1183
  },
@@ -1556,5 +1604,5 @@ var affiliatePortalApi = {
1556
1604
  };
1557
1605
 
1558
1606
  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 };
1559
- //# sourceMappingURL=IJR3CERD.js.map
1560
- //# sourceMappingURL=IJR3CERD.js.map
1607
+ //# sourceMappingURL=GYAT2X65.js.map
1608
+ //# sourceMappingURL=GYAT2X65.js.map