@apextelemed/partner-core 0.10.0-dev.22 → 0.10.0-dev.24

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 (43) hide show
  1. package/README.md +21 -2
  2. package/dist/api/index.d.ts +1 -1
  3. package/dist/api/index.js +3 -3
  4. package/dist/api/index.jsx +5 -3
  5. package/dist/chunk/{NSEWFPUP.js → 7MCMXXYQ.js} +50 -3
  6. package/dist/chunk/7MCMXXYQ.js.map +1 -0
  7. package/dist/chunk/{TYXWVNC3.js → BNH4UOGN.js} +55 -12
  8. package/dist/chunk/BNH4UOGN.js.map +1 -0
  9. package/dist/chunk/{ET3GPUTR.jsx → CLNLTAG7.jsx} +59 -12
  10. package/dist/chunk/{BALHOD46.jsx → EZG74SQL.jsx} +49 -1
  11. package/dist/chunk/{DHVOZQQ2.js → FA4D2S5A.js} +3 -3
  12. package/dist/chunk/{DHVOZQQ2.js.map → FA4D2S5A.js.map} +1 -1
  13. package/dist/chunk/{OA3A3PUC.jsx → FM3JH2ZD.jsx} +1638 -860
  14. package/dist/chunk/{L2ZMGXWR.js → JKUWPGEW.js} +31 -6
  15. package/dist/chunk/JKUWPGEW.js.map +1 -0
  16. package/dist/chunk/{JL7B6RHG.js → M2LV5JQD.js} +3 -3
  17. package/dist/chunk/{JL7B6RHG.js.map → M2LV5JQD.js.map} +1 -1
  18. package/dist/chunk/{CYGHTTCA.js → NHNMRJL6.js} +1715 -905
  19. package/dist/chunk/NHNMRJL6.js.map +1 -0
  20. package/dist/chunk/{DBW2RWHV.jsx → RRKAKQ77.jsx} +2 -2
  21. package/dist/chunk/{QIBVNW2V.jsx → VF7FTWCG.jsx} +2 -2
  22. package/dist/chunk/{75F4YFYC.jsx → VG35MW6B.jsx} +33 -4
  23. package/dist/chunk/{ZW2HBOS5.jsx → XW4PEQPI.jsx} +2 -2
  24. package/dist/chunk/{4CTTOSOW.js → XZXPLS3K.js} +3 -3
  25. package/dist/chunk/{4CTTOSOW.js.map → XZXPLS3K.js.map} +1 -1
  26. package/dist/{client-CDpCqI4d.d.ts → client-DsIvVM5a.d.ts} +143 -1
  27. package/dist/flows/index.d.ts +213 -141
  28. package/dist/flows/index.js +6 -6
  29. package/dist/flows/index.jsx +16 -6
  30. package/dist/index/index.d.ts +2 -2
  31. package/dist/index/index.js +7 -7
  32. package/dist/index/index.jsx +19 -7
  33. package/dist/pages/index.d.ts +2 -2
  34. package/dist/pages/index.js +5 -5
  35. package/dist/pages/index.jsx +5 -5
  36. package/dist/stores/index.d.ts +1 -1
  37. package/dist/stores/index.js +2 -2
  38. package/dist/stores/index.jsx +2 -2
  39. package/package.json +1 -1
  40. package/dist/chunk/CYGHTTCA.js.map +0 -1
  41. package/dist/chunk/L2ZMGXWR.js.map +0 -1
  42. package/dist/chunk/NSEWFPUP.js.map +0 -1
  43. package/dist/chunk/TYXWVNC3.js.map +0 -1
package/README.md CHANGED
@@ -416,6 +416,16 @@ address and subscription-status vocabularies). Signatures are on the
416
416
  `useAffiliateDownline`, `useAffiliateLinks`
417
417
  - **Forms** — `useAddressPair`
418
418
 
419
+ `useSubscriptionIntakeFlow` quotes the member's own **offer** as well as a
420
+ typed promo code: with a session it reads `offersApi.mine()` and `pricing()`
421
+ applies whichever of the two is worth more (never both; a tie goes to the
422
+ code), the same rule the server charges by. `pricing().offer` is set only when
423
+ the offer is the one applied — render it as its own line
424
+ (`offerSummaryText(offer)` gives "$10 off every month", `offer.deadlineText`
425
+ the "claim by" date) — and `promoNotice()` explains a valid code that lost to
426
+ it. A site that totals a cart itself uses the same rule through
427
+ `bestOfferDiscount(offers, { productIds, baseCents })`.
428
+
419
429
  Hooks with no shared JSX (dashboard, messages, catalog, affiliate) are Tier 2
420
430
  only: the site renders its own page on top.
421
431
 
@@ -469,10 +479,19 @@ export default defineConfig({
469
479
 
470
480
  The full variable list is exported as `ADMIN_CSS_VARIABLES` from `/theme` for sites that want to generate override stylesheets programmatically.
471
481
 
472
- `<AdminDashboard>` has no single Promotions tab: Sales and Promo Codes are
473
- separate tabs, grouped under Marketing with Affiliates and Funnel. They are
482
+ `<AdminDashboard>` has no single Promotions tab: Sales, Promo Codes and Offers
483
+ are separate tabs, grouped under Marketing with Affiliates and Funnel. They are
474
484
  tabs of the dashboard, not separate pages.
475
485
 
486
+ The three are different things. A sale is for everyone and a promo code for
487
+ whoever types it; an **offer** (`offers` tab, `adminApi.getOffers()` and
488
+ friends) is a discount one person holds before they subscribe, with their own
489
+ deadline to claim it. The tab lists offers with their grant counts and the
490
+ sequences handing each out, and each offer has a grants page for giving it to
491
+ a person by hand or taking an unclaimed grant back. A sequence hands an offer
492
+ out from its Settings (Offer + valid-for days), next to the savings-members-only
493
+ switch.
494
+
476
495
  #### Customers and the detail-view standard
477
496
 
478
497
  The Customers tab is a customer 360: the list carries a lifecycle bucket per
@@ -1,4 +1,4 @@
1
- export { A as AddressVerifyResult, a as AdminApexDrug, b as AdminApexItemStatus, c as AdminBillingAttempt, d as AdminCategory, e as AdminCategoryInput, f as AdminCategoryUpdate, g as AdminCustomer, h as AdminCustomerFacts, i as AdminCustomerFunnel, j as AdminCustomerListParams, k as AdminCustomerOverview, l as AdminCustomerProfile, m as AdminCustomerRequest, n as AdminCustomerRow, o as AdminCustomerSupport, p as AdminCustomerSupportThread, q as AdminDashboardStats, r as AdminLifecycle, s as AdminLifecycleBucket, t as AdminListParams, u as AdminOrderSummary, v as AdminOrphanReason, w as AdminOrphanedDosePrice, x as AdminPayment, y as AdminPaymentDetail, z as AdminProduct, B as AdminProductOverlayField, C as AdminProductStrength, D as AdminPromoCode, E as AdminPromoCodeInput, F as AdminRefundResult, G as AdminSale, H as AdminSaleInput, I as AdminSubscription, J as AdminSubscriptionDetail, K as AdminSubscriptionPatch, L as AdminSubscriptionWriteResult, M as AdminSupportCustomer, N as AdminSupportStats, O as AdminSupportThread, P as AdminWebhookEvent, Q as Affiliate, R as AffiliateAuthTokens, S as AffiliateClickRecord, T as AffiliateConversion, U as AffiliateDashboardLinks, V as AffiliateDashboardProfile, W as AffiliateDashboardStats, X as AffiliateDownlineMember, Y as AffiliateEarningsBreakdown, Z as AffiliatePaymentMethod, _ as AffiliateProgram, $ as AffiliateRegisterInput, a0 as AffiliateRegisterResponse, a1 as AffiliateSession, a2 as AffiliateStatsResponse, a3 as AffiliateStatus, a4 as AffiliateTrackResponse, a5 as ApiError, a6 as ApiResponse, a7 as AttributionMethod, a8 as AuthTokens, a9 as BillingReminderSettings, aa as CatalogAvailabilityItem, ab as CatalogAvailabilityReason, ac as CatalogAvailabilityResult, ad as CatalogClassification, ae as CatalogDose, af as CatalogDoseInput, ag as CatalogDoseModel, ah as CatalogDoseSuggestion, ai as CatalogDoseSuggestions, aj as CatalogEquivalentSuggestions, ak as CatalogFulfillment, al as CatalogFulfillmentInput, am as CatalogItem, an as CatalogItemInput, ao as CatalogMappableDrug, ap as CatalogMatrixCell, aq as CatalogProduct, ar as CatalogReadiness, as as CategoryMetadata, at as CheckoutAddress, au as CheckoutPayload, av as CheckoutResult, aw as CommissionConfig, ax as CommissionStatus, ay as CompleteSurveyPayload, az as CreateAffiliatePayload, aA as CreateAffiliateProgramPayload, aB as CreateOrderPayload, aC as CreateRequestPayload, aD as CreateSubscriptionPayload, aE as CustomTemplate, aF as CustomTemplateInput, aG as CustomerDiscountConfig, aH as DeliveryInfo, aI as DiscountType, aJ as EmailNotificationSettings, aK as EmailTemplatesMap, aL as LoginPayload, aM as MemberPrescriptionRequest, aN as MemberSurveyMode, aO as MemberSurveyResponseSummary, aP as MemberSurveyTranscript, aQ as MemberSurveyTranscriptItem, aR as MemberSurveyTranscriptSection, aS as MembersMeResponse, aT as Order, aU as OrderItemInput, aV as PaginationParams, aW as PaymentCallbackPayload, aX as PaymentInitiatePayload, aY as PaymentType, aZ as PendingRenewalSurvey, a_ as Placeholder, a$ as PlaceholderKind, b0 as ProductSaleSummary, b1 as PromoValidationResponse, b2 as PublicCategory, b3 as RegisterAndSubscribePayload, b4 as RegisterPayload, b5 as RenewalStatus, b6 as SUPPORT_ATTACHMENT_MAX_BYTES, b7 as SUPPORT_ATTACHMENT_MIME_TYPES, b8 as SelectDrugPayload, b9 as SendMessagePayload, ba as SendToPharmacyPayload, bb as SubscriptionPreview, bc as SubscriptionPreviewLine, bd as SubscriptionPreviewPayload, be as SupportAttachment, bf as SupportMessage, bg as SupportRealtimeToken, bh as SupportThread, bi as SupportThreadCategory, bj as SupportThreadStatus, bk as SurveySubmitPayload, bl as TemplatePlaceholdersMap, bm as TemplateText, bn as TenantFeature, bo as TenantFeatureAccess, bp as TokenTrackName, bq as UpdateAffiliatePayload, br as UpdateAffiliateProgramPayload, bs as UpdatePaymentMethodPayload, bt as UpdateProfilePayload, bu as User, bv as addressesApi, bw as adminAffiliatesApi, bx as adminApi, by as adminCatalogApi, bz as affiliateAuthStorageKey, bA as affiliatePortalApi, bB as apexApi, bC as apiFetch, bD as authApi, bE as authStorageKey, bF as catalogApi, bG as clearAffiliateTokens, bH as clearTokens, bI as getAffiliateTokens, bJ as getTokens, bK as membersApi, bL as messagesApi, bM as newIdempotencyKey, bN as onTokensCleared, bO as ordersApi, bP as paymentsApi, bQ as productsApi, bR as promoCodesApi, bS as setAffiliateTokens, bT as setTokens, bU as subscriptionsApi, bV as supportApi, bW as usersApi } from '../client-CDpCqI4d.js';
1
+ export { A as AddressVerifyResult, a as AdminApexDrug, b as AdminApexItemStatus, c as AdminBillingAttempt, d as AdminCategory, e as AdminCategoryInput, f as AdminCategoryUpdate, g as AdminCustomer, h as AdminCustomerFacts, i as AdminCustomerFunnel, j as AdminCustomerListParams, k as AdminCustomerOverview, l as AdminCustomerProfile, m as AdminCustomerRequest, n as AdminCustomerRow, o as AdminCustomerSupport, p as AdminCustomerSupportThread, q as AdminDashboardStats, r as AdminLifecycle, s as AdminLifecycleBucket, t as AdminListParams, u as AdminOffer, v as AdminOfferBase, w as AdminOfferGrant, x as AdminOfferGrantBase, y as AdminOfferInput, z as AdminOrderSummary, B as AdminOrphanReason, C as AdminOrphanedDosePrice, D as AdminPayment, E as AdminPaymentDetail, F as AdminProduct, G as AdminProductOverlayField, H as AdminProductStrength, I as AdminPromoCode, J as AdminPromoCodeInput, K as AdminRefundResult, L as AdminSale, M as AdminSaleInput, N as AdminSubscription, O as AdminSubscriptionDetail, P as AdminSubscriptionPatch, Q as AdminSubscriptionWriteResult, R as AdminSupportCustomer, S as AdminSupportStats, T as AdminSupportThread, U as AdminWebhookEvent, V as Affiliate, W as AffiliateAuthTokens, X as AffiliateClickRecord, Y as AffiliateConversion, Z as AffiliateDashboardLinks, _ as AffiliateDashboardProfile, $ as AffiliateDashboardStats, a0 as AffiliateDownlineMember, a1 as AffiliateEarningsBreakdown, a2 as AffiliatePaymentMethod, a3 as AffiliateProgram, a4 as AffiliateRegisterInput, a5 as AffiliateRegisterResponse, a6 as AffiliateSession, a7 as AffiliateStatsResponse, a8 as AffiliateStatus, a9 as AffiliateTrackResponse, aa as ApiError, ab as ApiResponse, ac as AttributionMethod, ad as AuthTokens, ae as BillingReminderSettings, af as CatalogAvailabilityItem, ag as CatalogAvailabilityReason, ah as CatalogAvailabilityResult, ai as CatalogClassification, aj as CatalogDose, ak as CatalogDoseInput, al as CatalogDoseModel, am as CatalogDoseSuggestion, an as CatalogDoseSuggestions, ao as CatalogEquivalentSuggestions, ap as CatalogFulfillment, aq as CatalogFulfillmentInput, ar as CatalogItem, as as CatalogItemInput, at as CatalogMappableDrug, au as CatalogMatrixCell, av as CatalogProduct, aw as CatalogReadiness, ax as CategoryMetadata, ay as CheckoutAddress, az as CheckoutPayload, aA as CheckoutResult, aB as CommissionConfig, aC as CommissionStatus, aD as CompleteSurveyPayload, aE as CreateAffiliatePayload, aF as CreateAffiliateProgramPayload, aG as CreateOrderPayload, aH as CreateRequestPayload, aI as CreateSubscriptionPayload, aJ as CustomTemplate, aK as CustomTemplateInput, aL as CustomerDiscountConfig, aM as DeliveryInfo, aN as DiscountType, aO as EmailNotificationSettings, aP as EmailTemplatesMap, aQ as LoginPayload, aR as MemberOffer, aS as MemberPrescriptionRequest, aT as MemberSurveyMode, aU as MemberSurveyResponseSummary, aV as MemberSurveyTranscript, aW as MemberSurveyTranscriptItem, aX as MemberSurveyTranscriptSection, aY as MembersMeResponse, aZ as OfferGrantState, a_ as Order, a$ as OrderItemInput, b0 as PaginationParams, b1 as PaymentCallbackPayload, b2 as PaymentInitiatePayload, b3 as PaymentType, b4 as PendingRenewalSurvey, b5 as Placeholder, b6 as PlaceholderKind, b7 as ProductSaleSummary, b8 as PromoValidationResponse, b9 as PublicCategory, ba as RegisterAndSubscribePayload, bb as RegisterPayload, bc as RenewalStatus, bd as SUPPORT_ATTACHMENT_MAX_BYTES, be as SUPPORT_ATTACHMENT_MIME_TYPES, bf as SelectDrugPayload, bg as SendMessagePayload, bh as SendToPharmacyPayload, bi as SubscriptionPreview, bj as SubscriptionPreviewLine, bk as SubscriptionPreviewPayload, bl as SupportAttachment, bm as SupportMessage, bn as SupportRealtimeToken, bo as SupportThread, bp as SupportThreadCategory, bq as SupportThreadStatus, br as SurveySubmitPayload, bs as TemplatePlaceholdersMap, bt as TemplateText, bu as TenantFeature, bv as TenantFeatureAccess, bw as TokenTrackName, bx as UpdateAffiliatePayload, by as UpdateAffiliateProgramPayload, bz as UpdatePaymentMethodPayload, bA as UpdateProfilePayload, bB as User, bC as addressesApi, bD as adminAffiliatesApi, bE as adminApi, bF as adminCatalogApi, bG as affiliateAuthStorageKey, bH as affiliatePortalApi, bI as apexApi, bJ as apiFetch, bK as authApi, bL as authStorageKey, bM as catalogApi, bN as clearAffiliateTokens, bO as clearTokens, bP as getAffiliateTokens, bQ as getTokens, bR as membersApi, bS as messagesApi, bT as newIdempotencyKey, bU as offersApi, bV as onTokensCleared, bW as ordersApi, bX as paymentsApi, bY as productsApi, bZ as promoCodesApi, b_ as setAffiliateTokens, b$ as setTokens, c0 as subscriptionsApi, c1 as supportApi, c2 as usersApi } from '../client-DsIvVM5a.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
 
package/dist/api/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import '../chunk/JSHO46VZ.js';
2
- export { adoptCartId, capturePromoCode, cartId, clearPromoCode, fetchCartConfig, fetchResumedCart, postCartSnapshot, readCartToken, readPromoCode, resetCartConfigCache, resetCartId, stripCartToken } from '../chunk/4CTTOSOW.js';
2
+ export { adoptCartId, capturePromoCode, cartId, clearPromoCode, fetchCartConfig, fetchResumedCart, postCartSnapshot, readCartToken, readPromoCode, resetCartConfigCache, resetCartId, stripCartToken } from '../chunk/XZXPLS3K.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/JL7B6RHG.js';
5
- export { ApiError, SUPPORT_ATTACHMENT_MAX_BYTES, SUPPORT_ATTACHMENT_MIME_TYPES, addressesApi, adminAffiliatesApi, adminApi, adminCatalogApi, affiliateAuthStorageKey, affiliatePortalApi, apexApi, apiFetch, authApi, authStorageKey, captureAffiliateRef, catalogApi, clearAffiliateRef, clearAffiliateTokens, clearTokens, getAffiliateTokens, getTokens, membersApi, messagesApi, newIdempotencyKey, onTokensCleared, ordersApi, paymentsApi, productsApi, promoCodesApi, readAffiliateRef, setAffiliateTokens, setTokens, subscriptionsApi, supportApi, usersApi } from '../chunk/NSEWFPUP.js';
4
+ export { adoptFunnelSessionId, captureAuthHeader, fetchFunnelConfig, fetchResumedDraft, funnelSessionId, peekFunnelSessionId, postFunnelEvent, readResumeToken, resetFunnelConfigCache, saveFunnelDraft, stripResumeToken } from '../chunk/M2LV5JQD.js';
5
+ export { ApiError, SUPPORT_ATTACHMENT_MAX_BYTES, SUPPORT_ATTACHMENT_MIME_TYPES, addressesApi, adminAffiliatesApi, adminApi, adminCatalogApi, 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/7MCMXXYQ.js';
6
6
  import '../chunk/5XGPFYIJ.js';
7
7
  //# sourceMappingURL=index.js.map
8
8
  //# sourceMappingURL=index.js.map
@@ -12,7 +12,7 @@ import {
12
12
  resetCartConfigCache,
13
13
  resetCartId,
14
14
  stripCartToken
15
- } from "../chunk/QIBVNW2V.jsx";
15
+ } from "../chunk/VF7FTWCG.jsx";
16
16
  import {
17
17
  EmbedApiError,
18
18
  EmbedApiError2,
@@ -33,7 +33,7 @@ import {
33
33
  resetFunnelConfigCache,
34
34
  saveFunnelDraft,
35
35
  stripResumeToken
36
- } from "../chunk/ZW2HBOS5.jsx";
36
+ } from "../chunk/XW4PEQPI.jsx";
37
37
  import {
38
38
  ApiError,
39
39
  SUPPORT_ATTACHMENT_MAX_BYTES,
@@ -58,6 +58,7 @@ import {
58
58
  membersApi,
59
59
  messagesApi,
60
60
  newIdempotencyKey,
61
+ offersApi,
61
62
  onTokensCleared,
62
63
  ordersApi,
63
64
  paymentsApi,
@@ -69,7 +70,7 @@ import {
69
70
  subscriptionsApi,
70
71
  supportApi,
71
72
  usersApi
72
- } from "../chunk/BALHOD46.jsx";
73
+ } from "../chunk/EZG74SQL.jsx";
73
74
  import "../chunk/LDZIUFDM.jsx";
74
75
  export {
75
76
  EmbedApiError2 as ApexV2ApiError,
@@ -111,6 +112,7 @@ export {
111
112
  membersApi,
112
113
  messagesApi,
113
114
  newIdempotencyKey,
115
+ offersApi,
114
116
  onTokensCleared,
115
117
  ordersApi,
116
118
  paymentsApi,
@@ -756,6 +756,21 @@ var promoCodesApi = {
756
756
  return apiFetch(`/promo-codes/validate${qs(params)}`);
757
757
  }
758
758
  };
759
+ var offersApi = {
760
+ /** The signed-in member's unclaimed offers (member JWT). */
761
+ mine() {
762
+ return apiFetch("/offers/mine");
763
+ },
764
+ /**
765
+ * The offers waiting for someone with no account yet, by the address they
766
+ * are registering with — so a guest is shown the price they will be charged.
767
+ * Empty for an address that already has an account. POST: the address never
768
+ * goes in a URL.
769
+ */
770
+ forEmail(email) {
771
+ return post("/offers/for-email", { email });
772
+ }
773
+ };
759
774
  var ordersApi = {
760
775
  create(payload) {
761
776
  return post("/orders", payload);
@@ -1100,6 +1115,38 @@ var adminApi = {
1100
1115
  deletePromoCode(id) {
1101
1116
  return del(`/admin/promo-codes/${id}`);
1102
1117
  },
1118
+ // ── Offers ─────────────────────────────────────────────────────
1119
+ // A discount one person holds before they subscribe. The offer is the
1120
+ // definition; a grant is one person holding it, with their own deadline.
1121
+ getOffers() {
1122
+ return apiFetch("/admin/offers");
1123
+ },
1124
+ createOffer(payload) {
1125
+ return post("/admin/offers", payload);
1126
+ },
1127
+ /** Whole object. Grants already issued keep the terms they were issued with. */
1128
+ updateOffer(id, payload) {
1129
+ return put(`/admin/offers/${id}`, payload);
1130
+ },
1131
+ /** Archive. 409 (the message names the sequence) while a sequence hands it out. */
1132
+ archiveOffer(id) {
1133
+ return del(`/admin/offers/${id}`);
1134
+ },
1135
+ getOfferGrants(offerId, params) {
1136
+ return apiFetch(`/admin/offers/${offerId}/grants${qs(params)}`);
1137
+ },
1138
+ /**
1139
+ * Give the offer to one person. Idempotent: a person holds an offer once, so
1140
+ * `created: false` returns the grant they already have, original deadline
1141
+ * included.
1142
+ */
1143
+ issueOfferGrant(offerId, payload) {
1144
+ return post(`/admin/offers/${offerId}/grants`, payload);
1145
+ },
1146
+ /** Take back an unclaimed grant. 409 once it has been claimed. */
1147
+ revokeOfferGrant(grantId) {
1148
+ return apiFetch(`/admin/offers/grants/${grantId}`, { method: "DELETE" });
1149
+ },
1103
1150
  // ── Categories ─────────────────────────────────────────────────
1104
1151
  getCategories() {
1105
1152
  return apiFetch("/admin/categories");
@@ -1393,6 +1440,6 @@ var affiliatePortalApi = {
1393
1440
  }
1394
1441
  };
1395
1442
 
1396
- export { ApiError, SUPPORT_ATTACHMENT_MAX_BYTES, SUPPORT_ATTACHMENT_MIME_TYPES, addressesApi, adminAffiliatesApi, adminApi, adminCatalogApi, affiliateAuthStorageKey, affiliatePortalApi, apexApi, apiFetch, authApi, authStorageKey, captureAffiliateRef, catalogApi, clearAffiliateRef, clearAffiliateTokens, clearTokens, getAffiliateTokens, getTokens, membersApi, messagesApi, newIdempotencyKey, onTokensCleared, ordersApi, paymentsApi, productsApi, promoCodesApi, readAffiliateRef, setAffiliateTokens, setTokens, subscriptionsApi, supportApi, usersApi };
1397
- //# sourceMappingURL=NSEWFPUP.js.map
1398
- //# sourceMappingURL=NSEWFPUP.js.map
1443
+ export { ApiError, SUPPORT_ATTACHMENT_MAX_BYTES, SUPPORT_ATTACHMENT_MIME_TYPES, addressesApi, adminAffiliatesApi, adminApi, adminCatalogApi, 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 };
1444
+ //# sourceMappingURL=7MCMXXYQ.js.map
1445
+ //# sourceMappingURL=7MCMXXYQ.js.map