@cimplify/sdk 0.103.0 → 0.104.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.
Files changed (72) hide show
  1. package/dist/advanced.d.mts +3 -7
  2. package/dist/advanced.d.ts +3 -7
  3. package/dist/advanced.js +23 -23
  4. package/dist/advanced.mjs +4 -4
  5. package/dist/{client-DHBwvh7U.d.ts → catalogue-BlQ85Uma.d.mts} +492 -748
  6. package/dist/{client-BfpNjJ_a.d.mts → catalogue-C8TqOj9K.d.ts} +492 -748
  7. package/dist/{payment-H5LoIvXU.d.mts → checkout-BqK9XUz5.d.mts} +4338 -1495
  8. package/dist/{payment-H5LoIvXU.d.ts → checkout-BqK9XUz5.d.ts} +4338 -1495
  9. package/dist/{chunk-GOHSXBKW.mjs → chunk-33VCYWVL.mjs} +25 -1
  10. package/dist/{chunk-C2JSNJUC.mjs → chunk-6G3ANKQA.mjs} +1080 -369
  11. package/dist/{chunk-QOWPGS7Z.js → chunk-BWEIMKLF.js} +572 -17
  12. package/dist/{chunk-JSWJ4XDE.js → chunk-DQEXY542.js} +1630 -824
  13. package/dist/{chunk-CNN7Z2IP.js → chunk-EV2EVOYS.js} +27 -0
  14. package/dist/{chunk-VIL6IQCG.js → chunk-HYFA67A7.js} +1084 -373
  15. package/dist/{chunk-H7ACMHM3.mjs → chunk-L5SNEU2O.mjs} +553 -16
  16. package/dist/{chunk-JG5CQNCB.js → chunk-RBNBSQI7.mjs} +221 -19
  17. package/dist/{chunk-VNPEYLB2.mjs → chunk-SFUJMS5E.js} +265 -2
  18. package/dist/{chunk-M4URVKHE.mjs → chunk-U54CWUUT.mjs} +11 -2
  19. package/dist/{chunk-GERXZQSX.mjs → chunk-UFOWPN3D.mjs} +967 -582
  20. package/dist/{chunk-J6PNHDHL.mjs → chunk-V4457OKB.mjs} +1580 -785
  21. package/dist/{chunk-R6OLQ33I.js → chunk-WXREIBFW.js} +1041 -654
  22. package/dist/{chunk-NNG6IFFX.js → chunk-XAUSDMMZ.js} +13 -3
  23. package/dist/{client-DpqRobY9.d.mts → client-DhXeiUrf.d.ts} +2 -2
  24. package/dist/{client-Dqg2mc-7.d.ts → client-mXiUrV4X.d.mts} +2 -2
  25. package/dist/{index-C8uDqLwJ.d.ts → index-B0AdZvrM.d.mts} +9 -4
  26. package/dist/{index-e2y6AK70.d.mts → index-CK8Nk5uQ.d.ts} +9 -4
  27. package/dist/index-DPWI5XcU.d.ts +8 -0
  28. package/dist/index-DVfUh-ci.d.mts +8 -0
  29. package/dist/index.d.mts +34 -15
  30. package/dist/index.d.ts +34 -15
  31. package/dist/index.js +306 -133
  32. package/dist/index.mjs +7 -6
  33. package/dist/mock/cli.mjs +1494 -395
  34. package/dist/mock/library.js +1220 -361
  35. package/dist/mock/library.mjs +1220 -361
  36. package/dist/mock/msw.js +1220 -361
  37. package/dist/mock/msw.mjs +1220 -361
  38. package/dist/{price-C2RqscMY.d.ts → price-6hQIIac9.d.ts} +1 -1
  39. package/dist/{price-BvePgDXe.d.mts → price-BUDv1rI7.d.mts} +1 -1
  40. package/dist/react.d.mts +10 -5
  41. package/dist/react.d.ts +10 -5
  42. package/dist/react.js +279 -225
  43. package/dist/react.mjs +140 -86
  44. package/dist/{server-DoXIpSd7.d.ts → server-DJ0mSs9i.d.mts} +33 -57
  45. package/dist/{server-C7FyLdrz.d.mts → server-DSTX76Ki.d.ts} +33 -57
  46. package/dist/server.d.mts +3 -4
  47. package/dist/server.d.ts +3 -4
  48. package/dist/server.js +12 -11
  49. package/dist/server.mjs +6 -5
  50. package/dist/styles.css +2 -2
  51. package/dist/testing/msw.d.mts +2 -2
  52. package/dist/testing/msw.d.ts +2 -2
  53. package/dist/testing/msw.js +4 -4
  54. package/dist/testing/msw.mjs +3 -3
  55. package/dist/testing/suite.d.mts +5 -6
  56. package/dist/testing/suite.d.ts +5 -6
  57. package/dist/testing/suite.js +29 -28
  58. package/dist/testing/suite.mjs +10 -9
  59. package/dist/testing.d.mts +2217 -14
  60. package/dist/testing.d.ts +2217 -14
  61. package/dist/testing.js +173 -83
  62. package/dist/testing.mjs +28 -10
  63. package/dist/utils.d.mts +3 -4
  64. package/dist/utils.d.ts +3 -4
  65. package/dist/utils.js +35 -31
  66. package/dist/utils.mjs +2 -2
  67. package/package.json +9 -9
  68. package/registry/chat-widget.json +1 -1
  69. package/registry/order-history.json +1 -1
  70. package/registry/order-summary.json +1 -1
  71. package/dist/link-cuNVYc2s.d.mts +0 -297
  72. package/dist/link-cuNVYc2s.d.ts +0 -297
@@ -1,5 +1,4 @@
1
- import { X as CimplifyError, U as Category, be as Product, f as AddOnWithOptions, aW as Pagination, bs as ProductWithDetails, bq as ProductVariant, bY as VariantAxis, bZ as VariantAxisSelection, A as AddOn, Y as Collection, I as BundleSummary, w as Bundle, a5 as Composite, a3 as ComponentSelectionInput, aa as CompositePriceResult, af as CurrencyCode, W as ChosenPrice, bz as SaleInfo, bn as ProductTaxonomy, bQ as TaxonomyWithChildren, aC as EligiblePlansQuery, bi as ProductBillingPlan, bo as ProductTimeProfile, bh as ProductAvailabilityNow, al as Deal, bj as ProductDealInfo, au as DiscountValidation, bM as TagsResponse, ag as CustomAttributeDefinition, ah as CustomAttributeValue, bt as PropertyFacet, bP as TaxonomyAttributeTemplate, aP as KnowledgeArticle, bR as UICart, N as CartItem, aq as DestinationQuoteInput, ao as DestinationQuote, S as CartSummary, g as AddToCartInput, P as CartMutationResult, bX as UpdateCartItemInput, at as DiscountDetails, aU as Money, aQ as LineConfiguration, bO as TaxPriceDisplayMode, q as AuthorizationType, aZ as PaymentAuthorizationKind, a_ as PaymentAuthorizationSubmission, b0 as PaymentMethod, aL as InitializePaymentResult, bF as SubmitAuthorizationInput, b6 as PaymentStatusResponse, c2 as VariantDetails, c3 as VariantDetailsDTO, a as AddOnDetails, d as AddOnOptionDetails, b as AddOnGroupDetails, F as BundleSelectionData, ac as CompositeSelectionData, ai as CustomerInputValue, c9 as components, bB as SchedulingMode, aA as DurationUnit, bG as Subscription, bK as SubscriptionWithDetails } from './payment-H5LoIvXU.mjs';
2
- import { P as PAYMENT_METHOD, B as ORDER_TYPE, z as MobileMoneyProvider, C as CHECKOUT_MODE, e as CHECKOUT_STEP, H as PICKUP_TIME_TYPE, R as RequestOtpInput, V as VerifyOtpInput, c as AuthResponse, w as LinkStatusResult, t as LinkData, k as CustomerAddress, m as CustomerMobileMoney, l as CustomerLinkPreferences, j as Customer, r as EnrollmentData, u as LinkEnrollResult, E as EnrollAndLinkOrderInput, q as EnrollAndLinkOrderResult, h as CreateAddressInput, U as UpdateAddressInput, i as CreateMobileMoneyInput, v as LinkSession, J as RevokeSessionResult, I as RevokeAllSessionsResult } from './link-cuNVYc2s.mjs';
1
+ import { c as CimplifyError, ex as UICart, an as CartItem, bx as DestinationQuoteInput, bv as DestinationQuote, as as CartSummary, t as AddToCartInput, ap as CartMutationResult, eE as UpdateCartItemInput, bB as DiscountDetails, cC as Money, a as ChosenPrice, C as CurrencyCode, cl as LineConfiguration, cE as NextAction, ab as CHECKOUT_NEXT_ACTION, c3 as ErrorCode, aA as CheckoutCollectionOptions, aG as CheckoutFormData, aP as CheckoutResult, dd as PaymentMethod, cc as InitializePaymentResult, el as SubmitAuthorizationInput, dn as PaymentStatusResponse, aE as CheckoutCustomerInfo, dz as ProcessAndResolveOptions, dB as ProcessCheckoutResult, i as ConfirmPurchaseIntentRequest, bc as ConfirmPurchaseIntentResponse, c$ as PURCHASE_INTENT_RESOLVE_STATUS, dR as PurchaseIntentActionResponse, cS as PURCHASE_INTENT_ACTION_DECISION, em as SubmitPurchaseIntentActionRequest, cT as PURCHASE_INTENT_CONFIRM_STATUS, dY as PurchaseIntentResolution, cx as MintPurchaseIntentRequest, e3 as PurchaseIntentView, ds as PreparePurchaseIntentRequest, eL as VariantDetails, eM as VariantDetailsDTO, n as AddOnDetails, q as AddOnOptionDetails, o as AddOnGroupDetails, a0 as BundleSelectionData, b9 as CompositeSelectionData, bk as CustomerInputValue, e9 as RequestOtpInput, ea as RequestOtpResult$1, eR as VerifyOtpInput, H as AuthResponse, cp as LinkStatusResult, cm as LinkData, bj as CustomerAddress, bm as CustomerMobileMoney, bl as CustomerLinkPreferences, bi as Customer, c2 as EnrollmentData, cn as LinkEnrollResult, c0 as EnrollAndLinkOrderInput, c1 as EnrollAndLinkOrderResult, be as CreateAddressInput, eD as UpdateAddressInput, bf as CreateMobileMoneyInput, co as LinkSession, ec as RevokeSessionResult, eb as RevokeAllSessionsResult, f2 as components, ef as SchedulingMode, D as DurationUnit, P as Product, en as Subscription, er as SubscriptionWithDetails, b_ as ElementsOptions, bS as ElementType, bR as ElementOptions, bQ as ElementEventType, bP as ElementEventHandler, aw as CheckoutCartData, d6 as ParentToIframeMessage, cb as IframeToParentMessage, J as AuthenticatedData, bX as ElementsCheckoutData, bY as ElementsCheckoutResult, dA as ProcessCheckoutOptions, l as AbortablePromise, w as AddressInfo, de as PaymentMethodInfo, bT as ElementsAuthContactType, b as Category, s as AddOnWithOptions, d4 as Pagination, e as ProductWithDetails, dN as ProductVariant, eF as VariantAxis, eG as VariantAxisSelection, m as AddOn, d as Collection, a3 as BundleSummary, V as Bundle, b2 as Composite, b0 as ComponentSelectionInput, b7 as CompositePriceResult, S as SaleInfo, dK as ProductTaxonomy, ew as TaxonomyWithChildren, b$ as EligiblePlansQuery, dF as ProductBillingPlan, dL as ProductTimeProfile, dE as ProductAvailabilityNow, bs as Deal, dG as ProductDealInfo, bC as DiscountValidation, et as TagsResponse, bg as CustomAttributeDefinition, bh as CustomAttributeValue, dP as PropertyFacet, ev as TaxonomyAttributeTemplate, cg as KnowledgeArticle } from './checkout-BqK9XUz5.js';
3
2
 
4
3
  interface RequestContext {
5
4
  method: "GET" | "POST" | "PATCH" | "DELETE";
@@ -26,10 +25,16 @@ interface RetryEvent extends RequestContext {
26
25
  delayMs: number;
27
26
  error: Error;
28
27
  }
28
+ declare const SESSION_CHANGE_SOURCE: {
29
+ readonly RESPONSE: "response";
30
+ readonly MANUAL: "manual";
31
+ readonly CLEAR: "clear";
32
+ };
33
+ type SessionChangeSource = (typeof SESSION_CHANGE_SOURCE)[keyof typeof SESSION_CHANGE_SOURCE];
29
34
  interface SessionChangeEvent {
30
35
  previousToken: string | null;
31
36
  newToken: string | null;
32
- source: "response" | "manual" | "clear";
37
+ source: SessionChangeSource;
33
38
  }
34
39
  interface ObservabilityHooks {
35
40
  onRequestStart?: (event: RequestStartEvent) => void;
@@ -111,21 +116,6 @@ interface ClientEvents {
111
116
  emit<K extends ClientEventName>(name: K, payload: ClientEventMap[K]): void;
112
117
  }
113
118
 
114
- interface CatalogueResult<T> {
115
- items: T[];
116
- is_complete: boolean;
117
- total_available?: number;
118
- pagination?: Pagination;
119
- }
120
- interface CatalogueSnapshot {
121
- categories: Category[];
122
- products: Product[];
123
- add_ons: AddOnWithOptions[];
124
- is_complete: boolean;
125
- total_available?: number;
126
- pagination?: Pagination;
127
- }
128
-
129
119
  type Result<T, E = Error> = Ok<T> | Err<E>;
130
120
  interface Ok<T> {
131
121
  readonly ok: true;
@@ -155,188 +145,6 @@ declare function combineObject<T extends Record<string, Result<unknown, unknown>
155
145
  interface IdempotencyOption$9 {
156
146
  idempotencyKey?: string;
157
147
  }
158
- interface GetProductsOptions {
159
- category?: string;
160
- taxonomy?: string;
161
- search?: string;
162
- page?: number;
163
- limit?: number;
164
- offset?: number;
165
- cursor?: string;
166
- tags?: string[];
167
- featured?: boolean;
168
- in_stock?: boolean;
169
- min_price?: number;
170
- max_price?: number;
171
- sort_by?: "name" | "price" | "created_at" | "updated_at";
172
- sort_order?: "asc" | "desc";
173
- /** Property filters — e.g. { material: "Cotton", size: "M,L" }. Values are comma-separated for multi-value. */
174
- properties?: Record<string, string>;
175
- }
176
- interface QuoteCompositeSelectionInput {
177
- component_id: string;
178
- quantity: number;
179
- variant_id?: string;
180
- add_on_option_id?: string;
181
- }
182
- interface QuoteBundleSelectionInput {
183
- component_id: string;
184
- quantity: number;
185
- variant_id?: string;
186
- }
187
- interface FetchQuoteInput {
188
- product_id: string;
189
- variant_id?: string;
190
- location_id?: string;
191
- quantity?: number;
192
- add_on_option_ids?: string[];
193
- bundle_selections?: QuoteBundleSelectionInput[];
194
- composite_selections?: QuoteCompositeSelectionInput[];
195
- }
196
- interface RefreshQuoteInput {
197
- quote_id: string;
198
- product_id?: string;
199
- variant_id?: string;
200
- location_id?: string;
201
- quantity?: number;
202
- add_on_option_ids?: string[];
203
- bundle_selections?: QuoteBundleSelectionInput[];
204
- composite_selections?: QuoteCompositeSelectionInput[];
205
- }
206
- type QuoteStatus = "pending" | "used" | "expired";
207
- interface QuoteDynamicBuckets {
208
- intent?: string;
209
- demand?: string;
210
- inventory?: string;
211
- competition?: string;
212
- }
213
- interface QuoteUiMessage {
214
- code: string;
215
- level: "info" | "warn" | "error" | string;
216
- text: string;
217
- countdown_seconds?: number;
218
- }
219
- type RequestSource = "web" | "qr_code" | "order_taker" | "ucp_a2a";
220
- interface PriceQuote {
221
- quote_id: string;
222
- business_id: string;
223
- product_id: string;
224
- variant_id?: string | null;
225
- location_id?: string | null;
226
- source: RequestSource;
227
- customer_id?: string | null;
228
- customer_segment_id?: string | null;
229
- storefront_id?: string | null;
230
- attribution_id?: string | null;
231
- quantity: number;
232
- currency?: CurrencyCode | null;
233
- snapshot_id?: string | null;
234
- snapshot_markup_version?: string | null;
235
- snapshot_tax_version?: string | null;
236
- item_price_info: ChosenPrice;
237
- variant_price_info?: ChosenPrice | null;
238
- final_price_info: ChosenPrice;
239
- sale?: SaleInfo | null;
240
- add_on_option_ids: string[];
241
- bundle_selections?: QuoteBundleSelectionInput[];
242
- add_ons_price_info?: ChosenPrice | null;
243
- quoted_total_price_info?: ChosenPrice | null;
244
- composite_selections?: QuoteCompositeSelectionInput[];
245
- dynamic_buckets: QuoteDynamicBuckets;
246
- ui_messages: QuoteUiMessage[];
247
- created_at: string;
248
- expires_at: string;
249
- next_change_at?: string | null;
250
- status: QuoteStatus;
251
- }
252
- interface RefreshQuoteResult {
253
- previous_quote_id: string;
254
- quote: PriceQuote;
255
- }
256
- declare class CatalogueQueries {
257
- private client;
258
- constructor(client: CimplifyClient);
259
- getCatalogue(opts?: ReadRequestOptions): Promise<Result<CatalogueSnapshot, CimplifyError>>;
260
- getProducts(options?: GetProductsOptions, opts?: ReadRequestOptions): Promise<Result<CatalogueResult<Product>, CimplifyError>>;
261
- getProduct(id: string, opts?: ReadRequestOptions): Promise<Result<ProductWithDetails, CimplifyError>>;
262
- getProductBySlug(slug: string, opts?: ReadRequestOptions): Promise<Result<ProductWithDetails, CimplifyError>>;
263
- getVariants(productId: string): Promise<Result<ProductVariant[], CimplifyError>>;
264
- getVariantAxes(productId: string): Promise<Result<VariantAxis[], CimplifyError>>;
265
- getVariantByAxisSelections(productId: string, selections: VariantAxisSelection): Promise<Result<ProductVariant | null, CimplifyError>>;
266
- getVariantById(productId: string, variantId: string): Promise<Result<ProductVariant, CimplifyError>>;
267
- getAddOns(productId: string, opts?: ReadRequestOptions): Promise<Result<AddOn[], CimplifyError>>;
268
- getCategories(opts?: ReadRequestOptions): Promise<Result<Category[], CimplifyError>>;
269
- getCategory(id: string, opts?: ReadRequestOptions): Promise<Result<Category, CimplifyError>>;
270
- getCategoryBySlug(slug: string, opts?: ReadRequestOptions): Promise<Result<Category, CimplifyError>>;
271
- getCategoryProducts(categoryId: string, options?: {
272
- limit?: number;
273
- offset?: number;
274
- }, opts?: ReadRequestOptions): Promise<Result<Product[], CimplifyError>>;
275
- getCollections(opts?: ReadRequestOptions): Promise<Result<Collection[], CimplifyError>>;
276
- getCollection(id: string, opts?: ReadRequestOptions): Promise<Result<Collection, CimplifyError>>;
277
- getCollectionBySlug(slug: string, opts?: ReadRequestOptions): Promise<Result<Collection, CimplifyError>>;
278
- getCollectionProducts(collectionId: string, options?: {
279
- limit?: number;
280
- offset?: number;
281
- }, opts?: ReadRequestOptions): Promise<Result<Product[], CimplifyError>>;
282
- searchCollections(query: string, limit?: number): Promise<Result<Collection[], CimplifyError>>;
283
- getBundles(): Promise<Result<BundleSummary[], CimplifyError>>;
284
- getBundle(id: string): Promise<Result<Bundle, CimplifyError>>;
285
- getBundleBySlug(slug: string): Promise<Result<Bundle, CimplifyError>>;
286
- searchBundles(query: string, limit?: number): Promise<Result<Bundle[], CimplifyError>>;
287
- getComposites(options?: {
288
- limit?: number;
289
- }): Promise<Result<Composite[], CimplifyError>>;
290
- getComposite(id: string): Promise<Result<Composite, CimplifyError>>;
291
- getCompositeByProduct(productId: string): Promise<Result<Composite, CimplifyError>>;
292
- calculateCompositePrice(compositeId: string, selections: ComponentSelectionInput[], locationId?: string): Promise<Result<CompositePriceResult, CimplifyError>>;
293
- fetchQuote(input: FetchQuoteInput, opts?: IdempotencyOption$9): Promise<Result<PriceQuote, CimplifyError>>;
294
- getQuote(quoteId: string): Promise<Result<PriceQuote, CimplifyError>>;
295
- refreshQuote(input: RefreshQuoteInput): Promise<Result<RefreshQuoteResult, CimplifyError>>;
296
- getTaxonomies(parentId?: string): Promise<Result<ProductTaxonomy[], CimplifyError>>;
297
- getTaxonomy(id: string): Promise<Result<TaxonomyWithChildren, CimplifyError>>;
298
- getTaxonomyPath(id: string): Promise<Result<ProductTaxonomy[], CimplifyError>>;
299
- searchTaxonomies(query: string, limit?: number): Promise<Result<ProductTaxonomy[], CimplifyError>>;
300
- getEligibleBillingPlans(productId: string, query?: EligiblePlansQuery): Promise<Result<ProductBillingPlan[], CimplifyError>>;
301
- getProductSchedules(productId: string): Promise<Result<ProductTimeProfile[], CimplifyError>>;
302
- checkProductAvailableNow(productId: string, locationId: string): Promise<Result<ProductAvailabilityNow, CimplifyError>>;
303
- getDeals(locationId?: string): Promise<Result<Deal[], CimplifyError>>;
304
- getProductsOnSale(): Promise<Result<ProductDealInfo[], CimplifyError>>;
305
- getProductDeals(productId: string): Promise<Result<Deal[], CimplifyError>>;
306
- getCategoryDeals(categoryId: string): Promise<Result<Deal[], CimplifyError>>;
307
- getCollectionDeals(collectionId: string): Promise<Result<Deal[], CimplifyError>>;
308
- validateDiscountCode(code: string, orderSubtotal: string, locationId?: string): Promise<Result<DiscountValidation, CimplifyError>>;
309
- search(query: string, options?: Omit<GetProductsOptions, "search">, opts?: ReadRequestOptions): Promise<Result<Product[], CimplifyError>>;
310
- searchProducts(query: string, options?: Omit<GetProductsOptions, "search">, opts?: ReadRequestOptions): Promise<Result<Product[], CimplifyError>>;
311
- getMenu(options?: {
312
- category?: string;
313
- limit?: number;
314
- }): Promise<Result<Product[], CimplifyError>>;
315
- getMenuCategory(categoryId: string): Promise<Result<Product[], CimplifyError>>;
316
- getMenuItem(itemId: string): Promise<Result<ProductWithDetails, CimplifyError>>;
317
- getTags(options?: {
318
- tag_group?: string;
319
- search?: string;
320
- min_usage?: number;
321
- limit?: number;
322
- offset?: number;
323
- }): Promise<Result<TagsResponse, CimplifyError>>;
324
- getAttributeDefinitions(namespace?: string): Promise<Result<CustomAttributeDefinition[], CimplifyError>>;
325
- getProductAttributes(productId: string): Promise<Result<CustomAttributeValue[], CimplifyError>>;
326
- getCategoryAttributes(categoryId: string): Promise<Result<CustomAttributeValue[], CimplifyError>>;
327
- getCollectionAttributes(collectionId: string): Promise<Result<CustomAttributeValue[], CimplifyError>>;
328
- getPropertyFacets(options?: {
329
- category_id?: string;
330
- product_type?: string;
331
- }): Promise<Result<PropertyFacet[], CimplifyError>>;
332
- getTaxonomyAttributes(taxonomyId: string): Promise<Result<TaxonomyAttributeTemplate[], CimplifyError>>;
333
- searchKnowledge(query: string, limit?: number): Promise<Result<KnowledgeArticle[], CimplifyError>>;
334
- getKnowledgeArticles(): Promise<Result<KnowledgeArticle[], CimplifyError>>;
335
- }
336
-
337
- interface IdempotencyOption$8 {
338
- idempotencyKey?: string;
339
- }
340
148
  interface ReorderResult {
341
149
  added: {
342
150
  item_id: string;
@@ -355,12 +163,12 @@ declare class CartOperations {
355
163
  getTotal(): Promise<Result<string, CimplifyError>>;
356
164
  quoteDestination(input: DestinationQuoteInput): Promise<Result<DestinationQuote, CimplifyError>>;
357
165
  getSummary(): Promise<Result<CartSummary, CimplifyError>>;
358
- addItem(input: AddToCartInput, opts?: IdempotencyOption$8): Promise<Result<CartMutationResult, CimplifyError>>;
166
+ addItem(input: AddToCartInput, opts?: IdempotencyOption$9): Promise<Result<CartMutationResult, CimplifyError>>;
359
167
  updateItem(cartItemId: string, updates: UpdateCartItemInput): Promise<Result<CartMutationResult, CimplifyError>>;
360
168
  updateQuantity(cartItemId: string, quantity: number): Promise<Result<CartMutationResult, CimplifyError>>;
361
169
  removeItem(cartItemId: string): Promise<Result<CartMutationResult, CimplifyError>>;
362
170
  clear(): Promise<Result<CartMutationResult, CimplifyError>>;
363
- applyCoupon(code: string, opts?: IdempotencyOption$8): Promise<Result<CartMutationResult, CimplifyError>>;
171
+ applyCoupon(code: string, opts?: IdempotencyOption$9): Promise<Result<CartMutationResult, CimplifyError>>;
364
172
  removeCoupon(): Promise<Result<CartMutationResult, CimplifyError>>;
365
173
  reorderFromOrder(orderId: string): Promise<Result<ReorderResult, CimplifyError>>;
366
174
  isEmpty(): Promise<Result<boolean, CimplifyError>>;
@@ -368,7 +176,7 @@ declare class CartOperations {
368
176
  findItem(productId: string, variantId?: string): Promise<Result<CartItem | undefined, CimplifyError>>;
369
177
  }
370
178
 
371
- type OrderStatus = "pending" | "created" | "confirmed" | "in_preparation" | "ready_to_serve" | "partially_served" | "served" | "delivered" | "picked_up" | "completed" | "cancelled" | "refunded";
179
+ type OrderStatus = "pending" | "created" | "confirmed" | "in_preparation" | "ready_to_serve" | "partially_served" | "served" | "delivered" | "picked_up" | "completed" | "cancelled";
372
180
  type PaymentState = "not_paid" | "partially_paid" | "paid" | "partially_refunded" | "refunded";
373
181
  type OriginChannel = "web" | "qr" | "desk" | "tap" | "chat" | "whatsapp" | "instagram" | "telegram" | "messenger" | "sms" | "email" | "agent";
374
182
  type OriginActor = "customer" | "staff" | "agent" | "system";
@@ -735,11 +543,13 @@ interface LocationBooking {
735
543
  service_status: ServiceStatus;
736
544
  }
737
545
  type ProviderResolutionSource = "zone" | "hint" | "fallback" | "rate" | "best_price";
546
+ type DeliveryFeeStatus$1 = "priced" | "arranged";
738
547
  interface DeliveryFeeDetails {
739
548
  zone_id?: string;
740
549
  zone_name?: string;
741
550
  provider: string;
742
551
  provider_resolved_from: ProviderResolutionSource;
552
+ fee_status?: DeliveryFeeStatus$1;
743
553
  /** Named rate this fee was priced under, if any. */
744
554
  rate_id?: string;
745
555
  rate_name?: string;
@@ -774,499 +584,20 @@ interface RelatedCandidate {
774
584
  }
775
585
  interface RelatedProductsEnrichment {
776
586
  upsells: RelatedCandidate[];
777
- cross_sells: RelatedCandidate[];
778
- }
779
-
780
- type OrderType = "delivery" | "pickup" | "dine-in" | "walk-in";
781
- declare const ELEMENT_TYPES: {
782
- readonly AUTH: "auth";
783
- readonly ADDRESS: "address";
784
- readonly PAYMENT: "payment";
785
- readonly CHECKOUT: "checkout";
786
- readonly ACCOUNT: "account";
787
- };
788
- type ElementType = (typeof ELEMENT_TYPES)[keyof typeof ELEMENT_TYPES];
789
- declare const MESSAGE_TYPES: {
790
- readonly INIT: "init";
791
- readonly SET_TOKEN: "set_token";
792
- readonly SET_SESSION: "set_session";
793
- readonly SET_CART: "set_cart";
794
- readonly GET_DATA: "get_data";
795
- readonly NAVIGATE: "navigate";
796
- readonly REFRESH_TOKEN: "refresh_token";
797
- readonly LOGOUT: "logout";
798
- readonly PROCESS_CHECKOUT: "process_checkout";
799
- readonly ABORT_CHECKOUT: "abort_checkout";
800
- readonly READY: "ready";
801
- readonly HEIGHT_CHANGE: "height_change";
802
- readonly ERROR: "error";
803
- readonly ADDRESS_CHANGED: "address_changed";
804
- readonly ADDRESS_SELECTED: "address_selected";
805
- readonly PAYMENT_METHOD_SELECTED: "payment_method_selected";
806
- readonly LOGOUT_COMPLETE: "logout_complete";
807
- readonly AUTH_REQUESTED: "auth_requested";
808
- readonly SESSION_ESTABLISHED: "session_established";
809
- readonly CONTACT_PROVIDED: "contact_provided";
810
- readonly CHECKOUT_STATUS: "checkout_status";
811
- readonly CHECKOUT_COMPLETE: "checkout_complete";
812
- readonly ORDER_TYPE_CHANGED: "order_type_changed";
813
- readonly REQUEST_SUBMIT: "request_submit";
814
- };
815
- interface ElementsOptions {
816
- linkUrl?: string;
817
- appearance?: ElementAppearance;
818
- auth?: ElementsAuthOptions;
819
- }
820
- interface ElementsAuthOptions {
821
- clientId?: string;
822
- redirectUri?: string;
823
- callbackUri?: string;
824
- scope?: string;
825
- issuer?: string;
826
- authUrl?: string;
827
- }
828
- interface ElementAppearance {
829
- theme?: "light" | "dark";
830
- variables?: {
831
- primaryColor?: string;
832
- fontFamily?: string;
833
- borderRadius?: string;
834
- };
835
- }
836
- interface ElementOptions {
837
- mode?: "shipping" | "billing";
838
- prefillEmail?: string;
839
- amount?: number;
840
- currency?: CurrencyCode;
841
- orderTypes?: OrderType[];
842
- defaultOrderType?: OrderType;
843
- submitLabel?: string;
844
- }
845
- interface AddressInfo {
846
- id?: string;
847
- latitude?: number;
848
- longitude?: number;
849
- street_address: string;
850
- apartment?: string;
851
- city: string;
852
- region: string;
853
- postal_code?: string;
854
- country?: string;
855
- delivery_instructions?: string;
856
- phone_for_delivery?: string;
857
- }
858
- interface PaymentMethodInfo {
859
- id?: string;
860
- type: "mobile_money" | "card" | "cash";
861
- provider?: string;
862
- last_four?: string;
863
- phone_number?: string;
864
- label?: string;
865
- }
866
- interface AuthenticatedCustomer {
867
- name: string;
868
- email: string | null;
869
- phone: string | null;
870
- }
871
- type ElementsCustomerInfo = {
872
- name: string;
873
- email: string | null;
874
- phone: string | null;
875
- } | null;
876
- declare const ELEMENTS_AUTH_CONTACT_TYPES: {
877
- readonly EMAIL: "email";
878
- readonly PHONE: "phone";
879
- };
880
- type ElementsAuthContactType = (typeof ELEMENTS_AUTH_CONTACT_TYPES)[keyof typeof ELEMENTS_AUTH_CONTACT_TYPES];
881
- declare const ELEMENTS_AUTH_PROMPTS: {
882
- readonly LOGIN: "login";
883
- };
884
- type ElementsAuthPrompt = (typeof ELEMENTS_AUTH_PROMPTS)[keyof typeof ELEMENTS_AUTH_PROMPTS];
885
- declare const ELEMENTS_AUTH_MODES: {
886
- readonly CHECKOUT: "checkout";
887
- readonly DEFAULT: "default";
888
- };
889
- type ElementsAuthMode = (typeof ELEMENTS_AUTH_MODES)[keyof typeof ELEMENTS_AUTH_MODES];
890
- interface AuthenticatedData {
891
- accountId: string;
892
- customerId: string;
893
- token: string;
894
- customer: AuthenticatedCustomer;
895
- }
896
- interface ElementsCheckoutData {
897
- cart_id: string;
898
- order_type?: OrderType;
899
- location_id?: string;
900
- scheduled_time?: string;
901
- tip_amount?: number;
902
- notes?: string;
903
- }
904
- interface ElementsCheckoutResult {
905
- success: boolean;
906
- order?: {
907
- id: string;
908
- status: string;
909
- total: string;
910
- };
911
- error?: {
912
- code: string;
913
- message: string;
914
- };
915
- }
916
- interface CheckoutCartItem {
917
- name: string;
918
- quantity: number;
919
- unit_price: string;
920
- total_price: string;
921
- image_url?: string;
922
- line_type: "simple" | "service" | "bundle" | "composite" | "digital";
923
- variant_name?: string;
924
- scheduled_start?: string;
925
- scheduled_end?: string;
926
- selections?: {
927
- name: string;
928
- quantity: number;
929
- variant_name?: string;
930
- }[];
931
- add_ons?: {
932
- name: string;
933
- price: string;
934
- }[];
935
- special_instructions?: string;
936
- }
937
- interface CheckoutCartData {
938
- items: CheckoutCartItem[];
939
- subtotal: string;
940
- tax_amount: string;
941
- total_discounts: string;
942
- service_charge: string;
943
- /** Server-quoted delivery fee selected in checkout. The cart total excludes
944
- * this value until checkout has a delivery address and rate. */
945
- delivery_fee?: string;
946
- total: string;
947
- currency: string;
948
- /** Tax is baked into the prices (e.g. Ghana VAT), so `tax_amount` is already
949
- * inside `subtotal`/`total`. Checkout labels it "included" rather than
950
- * summing it onto the total. */
951
- tax_inclusive: boolean;
952
- /** Tax rate in percentage points (8.25 means 8.25%). */
953
- tax_rate?: string | number;
954
- /** Reviewed presentation policy; `gross_required` markets show inclusive
955
- * prices even when the tax arithmetic is exclusive. */
956
- price_display_mode?: TaxPriceDisplayMode;
957
- /** Deposit due now when the cart has deposit-eligible service items, so the
958
- * checkout can offer "pay deposit now, balance later". Absent/0 otherwise. */
959
- deposit_required?: boolean;
960
- deposit_amount?: string;
961
- requires_delivery?: boolean;
962
- }
963
- type ParentToIframeMessage = {
964
- type: typeof MESSAGE_TYPES.INIT;
965
- businessId: string;
966
- publicKey: string;
967
- prefillEmail?: string;
968
- appearance?: ElementAppearance;
969
- orderTypes?: OrderType[];
970
- defaultOrderType?: OrderType;
971
- renderSubmitButton?: boolean;
972
- submitLabel?: string;
973
- token?: string;
974
- merchantName?: string;
975
- } | {
976
- type: typeof MESSAGE_TYPES.SET_TOKEN;
977
- token: string;
978
- } | {
979
- /** Host cart session; the iframe adopts it so destination quotes read the host's cart. */
980
- type: typeof MESSAGE_TYPES.SET_SESSION;
981
- sessionToken: string;
982
- } | {
983
- type: typeof MESSAGE_TYPES.NAVIGATE;
984
- path: string;
985
- } | {
986
- type: typeof MESSAGE_TYPES.SET_CART;
987
- cart: CheckoutCartData;
988
- } | {
989
- type: typeof MESSAGE_TYPES.GET_DATA;
990
- } | {
991
- type: typeof MESSAGE_TYPES.REFRESH_TOKEN;
992
- } | {
993
- type: typeof MESSAGE_TYPES.LOGOUT;
994
- } | {
995
- type: typeof MESSAGE_TYPES.PROCESS_CHECKOUT;
996
- cart_id: string;
997
- order_type?: OrderType;
998
- location_id?: string;
999
- notes?: string;
1000
- scheduled_time?: string;
1001
- tip_amount?: number;
1002
- pay_currency?: CurrencyCode;
1003
- enroll_in_link?: boolean;
1004
- address?: AddressInfo;
1005
- customer?: ElementsCustomerInfo;
1006
- account_id?: string;
1007
- customer_id?: string;
1008
- } | {
1009
- type: typeof MESSAGE_TYPES.ABORT_CHECKOUT;
1010
- };
1011
- type IframeToParentMessage = {
1012
- type: typeof MESSAGE_TYPES.READY;
1013
- height: number;
1014
- } | {
1015
- type: typeof MESSAGE_TYPES.HEIGHT_CHANGE;
1016
- height: number;
1017
- } | {
1018
- type: typeof MESSAGE_TYPES.CONTACT_PROVIDED;
1019
- contact: string;
1020
- contactType: ElementsAuthContactType;
1021
- } | {
1022
- type: typeof MESSAGE_TYPES.ERROR;
1023
- code: string;
1024
- message: string;
1025
- } | {
1026
- type: typeof MESSAGE_TYPES.ADDRESS_CHANGED;
1027
- address: AddressInfo;
1028
- saveToLink: boolean;
1029
- } | {
1030
- type: typeof MESSAGE_TYPES.ADDRESS_SELECTED;
1031
- address: AddressInfo;
1032
- } | {
1033
- type: typeof MESSAGE_TYPES.PAYMENT_METHOD_SELECTED;
1034
- method: PaymentMethodInfo;
1035
- saveToLink: boolean;
1036
- } | {
1037
- type: typeof MESSAGE_TYPES.LOGOUT_COMPLETE;
1038
- } | {
1039
- type: typeof MESSAGE_TYPES.SESSION_ESTABLISHED;
1040
- accessToken: string;
1041
- refreshToken?: string;
1042
- } | {
1043
- type: typeof MESSAGE_TYPES.AUTH_REQUESTED;
1044
- loginHint?: string;
1045
- contactType?: ElementsAuthContactType;
1046
- mode?: ElementsAuthMode;
1047
- prompt?: ElementsAuthPrompt;
1048
- } | {
1049
- type: typeof MESSAGE_TYPES.CHECKOUT_STATUS;
1050
- status: CheckoutStatus;
1051
- context: CheckoutStatusContext;
1052
- } | {
1053
- type: typeof MESSAGE_TYPES.CHECKOUT_COMPLETE;
1054
- success: boolean;
1055
- order?: {
1056
- id: string;
1057
- order_number: string;
1058
- status: string;
1059
- total: string;
1060
- currency: CurrencyCode;
1061
- };
1062
- error?: {
1063
- code: string;
1064
- message: string;
1065
- recoverable: boolean;
1066
- };
1067
- enrolled_in_link?: boolean;
1068
- } | {
1069
- type: typeof MESSAGE_TYPES.ORDER_TYPE_CHANGED;
1070
- orderType: OrderType;
1071
- } | {
1072
- type: typeof MESSAGE_TYPES.REQUEST_SUBMIT;
1073
- };
1074
- declare const EVENT_TYPES: {
1075
- readonly READY: "ready";
1076
- readonly AUTHENTICATED: "authenticated";
1077
- readonly ERROR: "error";
1078
- readonly CHANGE: "change";
1079
- readonly BLUR: "blur";
1080
- readonly FOCUS: "focus";
1081
- readonly ORDER_TYPE_CHANGED: "order_type_changed";
1082
- readonly REQUEST_SUBMIT: "request_submit";
1083
- };
1084
- type ElementEventType = (typeof EVENT_TYPES)[keyof typeof EVENT_TYPES];
1085
- type ElementEventHandler<T = unknown> = (data: T) => void;
1086
-
1087
- type CheckoutMode = (typeof CHECKOUT_MODE)[keyof typeof CHECKOUT_MODE];
1088
- type CheckoutOrderType = (typeof ORDER_TYPE)[keyof typeof ORDER_TYPE];
1089
- type CheckoutPaymentMethod = (typeof PAYMENT_METHOD)[keyof typeof PAYMENT_METHOD];
1090
- type CheckoutStep = (typeof CHECKOUT_STEP)[keyof typeof CHECKOUT_STEP];
1091
- type PickupTimeType = (typeof PICKUP_TIME_TYPE)[keyof typeof PICKUP_TIME_TYPE];
1092
- type CheckoutCollectionMethod = (typeof PAYMENT_METHOD)[keyof typeof PAYMENT_METHOD];
1093
- /** Storefront-safe collection capability. Provider and route identities stay server-side. */
1094
- type CheckoutCollectionOption = {
1095
- method: typeof PAYMENT_METHOD.CARD;
1096
- network: null;
1097
- } | {
1098
- method: typeof PAYMENT_METHOD.MOBILE_MONEY;
1099
- network: string;
1100
- };
1101
- interface CheckoutCollectionOptions {
1102
- presentment_currency: CurrencyCode;
1103
- options: CheckoutCollectionOption[];
1104
- }
1105
- interface PickupTime {
1106
- type: PickupTimeType;
1107
- scheduled_time?: string;
1108
- }
1109
- interface CheckoutAddressInfo {
1110
- street_address?: string;
1111
- apartment?: string;
1112
- city?: string;
1113
- region?: string;
1114
- postal_code?: string;
1115
- country?: string;
1116
- delivery_instructions?: string;
1117
- phone_for_delivery?: string;
1118
- latitude?: number;
1119
- longitude?: number;
1120
- pickup_time?: string;
1121
- guest_count?: number;
1122
- seating_time?: string;
1123
- seating_requests?: string;
1124
- }
1125
- interface MobileMoneyDetails {
1126
- phone_number: string;
1127
- provider: MobileMoneyProvider;
1128
- provider_other?: string;
1129
- }
1130
- interface CheckoutCustomerInfo {
1131
- name: string;
1132
- email: string;
1133
- phone: string;
1134
- notes?: string;
1135
- save_details: boolean;
1136
- }
1137
- interface CheckoutFormData {
1138
- cart_id: string;
1139
- location_id?: string;
1140
- customer: CheckoutCustomerInfo;
1141
- order_type: CheckoutOrderType;
1142
- address_info: CheckoutAddressInfo;
1143
- /** Named delivery rate the customer selected (from `delivery.getOptions`).
1144
- * Selection only — the fee is always recomputed server-side. Omit for the
1145
- * merchant's default option. */
1146
- delivery_rate_id?: string;
1147
- payment_method: string;
1148
- mobile_money_details?: MobileMoneyDetails;
1149
- special_instructions?: string;
1150
- link_address_id?: string;
1151
- link_payment_method_id?: string;
1152
- idempotency_key?: string;
1153
- metadata?: Record<string, unknown>;
1154
- pay_currency?: CurrencyCode;
1155
- fx_quote_id?: string;
1156
- /** Apply the shopper's available store credit (capped at the amount owed) as a
1157
- * fee-exempt tender before charging the rail. */
1158
- use_store_credit?: boolean;
1159
- /** Store-credit voucher / gift code to claim into the wallet and apply to this
1160
- * order. Presenting a code implies applying store credit. */
1161
- voucher_code?: string;
1162
- /** Pay only the required deposit now (balance collected later) instead of the
1163
- * full total. Only honored when the order is deposit-eligible and paying in
1164
- * the order's native currency. */
1165
- pay_deposit?: boolean;
1166
- }
1167
- type NextAction = {
1168
- type: "none";
1169
- } | {
1170
- type: "card_popup";
1171
- provider: string;
1172
- client_secret: string;
1173
- public_key: string;
1174
- } | {
1175
- type: "redirect";
1176
- authorization_url: string;
1177
- } | {
1178
- type: "authorization";
1179
- authorization_type: AuthorizationType;
1180
- display_text?: string;
1181
- } | {
1182
- type: "poll";
1183
- };
1184
- interface CheckoutResult {
1185
- order_id: string;
1186
- order_number: string;
1187
- bill_token?: string;
1188
- /** Tenant-scoped Cimplify payment id used for payment mutations. */
1189
- payment_id?: string;
1190
- payment_reference?: string;
1191
- payment_status: string;
1192
- requires_authorization: boolean;
1193
- authorization_type?: AuthorizationType;
1194
- authorization_url?: string;
1195
- display_text?: string;
1196
- provider?: string;
1197
- client_secret?: string;
1198
- public_key?: string;
1199
- next_action?: NextAction;
1200
- fx?: {
1201
- base_currency: CurrencyCode;
1202
- base_amount: Money;
1203
- pay_currency: CurrencyCode;
1204
- pay_amount: Money;
1205
- rate: number;
1206
- quote_id: string;
1207
- };
1208
- }
1209
- type CheckoutStatus = "preparing" | "recovering" | "processing" | "awaiting_authorization" | "polling" | "finalizing" | "success" | "failed";
1210
- interface CheckoutStatusContext {
1211
- display_text?: string;
1212
- authorization_type?: PaymentAuthorizationKind;
1213
- poll_attempt?: number;
1214
- max_poll_attempts?: number;
1215
- order_id?: string;
1216
- order_number?: string;
1217
- provider?: string;
1218
- }
1219
- interface ProcessCheckoutOptions {
1220
- cart_id: string;
1221
- order_type: OrderType;
1222
- location_id?: string;
1223
- notes?: string;
1224
- scheduled_time?: string;
1225
- tip_amount?: number;
1226
- enroll_in_link?: boolean;
1227
- pay_currency?: CurrencyCode;
1228
- timeout_ms?: number;
1229
- on_status_change?: (status: CheckoutStatus, context: CheckoutStatusContext) => void;
1230
- }
1231
- interface ProcessCheckoutResult {
1232
- success: boolean;
1233
- order?: {
1234
- id: string;
1235
- order_number: string;
1236
- status: string;
1237
- total: string;
1238
- currency: CurrencyCode;
1239
- };
1240
- error?: {
1241
- code: string;
1242
- message: string;
1243
- recoverable: boolean;
1244
- docs_url?: string;
1245
- suggestion?: string;
1246
- };
1247
- enrolled_in_link?: boolean;
1248
- }
1249
- interface ProcessAndResolveOptions {
1250
- enroll_in_link?: boolean;
1251
- allow_popups?: boolean;
1252
- poll_interval_ms?: number;
1253
- max_poll_attempts?: number;
1254
- on_status_change?: (status: CheckoutStatus, context: CheckoutStatusContext) => void;
1255
- /**
1256
- * Reports the lifetime of provider-owned authorization UI. Hosts with their
1257
- * own modal focus boundary can suspend it while the provider surface is open.
1258
- */
1259
- on_authorization_ui_change?: (open: boolean) => void;
1260
- on_authorization_required?: (type: PaymentAuthorizationKind, submit: (authorization: PaymentAuthorizationSubmission) => Promise<void>) => void | Promise<void>;
1261
- return_url?: string;
1262
- signal?: AbortSignal;
587
+ cross_sells: RelatedCandidate[];
1263
588
  }
1264
- type AbortablePromise<T> = Promise<T> & {
1265
- abort: () => void;
1266
- };
1267
589
 
590
+ declare const PAYMENT_AUTHORIZATION_OUTCOME_STATUS: {
591
+ readonly SUBMITTED: "submitted";
592
+ readonly CANCELLED: "cancelled";
593
+ readonly FAILED: "failed";
594
+ };
595
+ declare const PAYMENT_AUTHORIZATION_PROVIDER: {
596
+ readonly PAYSTACK: "paystack";
597
+ readonly STRIPE: "stripe";
598
+ };
1268
599
  type CardPopupAction = Extract<NextAction, {
1269
- type: "card_popup";
600
+ type: typeof CHECKOUT_NEXT_ACTION.CARD_POPUP;
1270
601
  }>;
1271
602
  interface PaymentAuthorizationContext {
1272
603
  action: CardPopupAction;
@@ -1283,13 +614,13 @@ type AuthorizeCardPopupOptions = Omit<PaymentAuthorizationContext, "action">;
1283
614
  * that money was collected.
1284
615
  */
1285
616
  type PaymentAuthorizationOutcome = {
1286
- status: "submitted";
617
+ status: typeof PAYMENT_AUTHORIZATION_OUTCOME_STATUS.SUBMITTED;
1287
618
  reference?: string;
1288
619
  } | {
1289
- status: "cancelled";
620
+ status: typeof PAYMENT_AUTHORIZATION_OUTCOME_STATUS.CANCELLED;
1290
621
  } | {
1291
- status: "failed";
1292
- code: "POPUP_BLOCKED" | "PROVIDER_UNAVAILABLE" | "AUTHORIZATION_FAILED" | "PAYMENT_FAILED";
622
+ status: typeof PAYMENT_AUTHORIZATION_OUTCOME_STATUS.FAILED;
623
+ code: typeof ErrorCode.POPUP_BLOCKED | typeof ErrorCode.PROVIDER_UNAVAILABLE | typeof ErrorCode.AUTHORIZATION_FAILED | typeof ErrorCode.PAYMENT_FAILED;
1293
624
  message: string;
1294
625
  recoverable: boolean;
1295
626
  };
@@ -1317,6 +648,10 @@ declare function createDefaultPaymentAuthorizationAdapterRegistry(): PaymentAuth
1317
648
 
1318
649
  declare class CheckoutService {
1319
650
  private client;
651
+ /** Raw checkout material is component-lifetime only, never browser storage. */
652
+ private readonly intentCommands;
653
+ /** Opaque owner/attempt authority for deprecated action submission. */
654
+ private readonly actionAuthorities;
1320
655
  constructor(client: CimplifyClient);
1321
656
  private validateCheckoutData;
1322
657
  private orderTokenParam;
@@ -1327,15 +662,131 @@ declare class CheckoutService {
1327
662
  * outcome is not proof of payment; callers must poll/verify with Cimplify.
1328
663
  */
1329
664
  authorizeCardPopup(action: CardPopupAction, options: AuthorizeCardPopupOptions): Promise<PaymentAuthorizationOutcome>;
1330
- process(data: CheckoutFormData): Promise<Result<CheckoutResult, CimplifyError>>;
665
+ private startIntentCheckout;
666
+ /** @deprecated Use `client.purchaseIntents.mint()` then `confirm()`. */
667
+ process(data: CheckoutFormData, options?: RequestOptions): Promise<Result<CheckoutResult, CimplifyError>>;
1331
668
  initializePayment(_orderId: string, _method: PaymentMethod): Promise<Result<InitializePaymentResult, CimplifyError>>;
1332
- submitAuthorization(input: SubmitAuthorizationInput): Promise<Result<CheckoutResult, CimplifyError>>;
1333
- pollPaymentStatus(orderId: string): Promise<Result<PaymentStatusResponse, CimplifyError>>;
669
+ /**
670
+ * @deprecated Use `client.purchaseIntents.submitAction()`. This adapter works
671
+ * only while this CheckoutService instance retains the opaque authority
672
+ * returned by its own `process()` call; it never falls back to a payment-id
673
+ * mutation.
674
+ */
675
+ submitAuthorization(input: SubmitAuthorizationInput, options?: RequestOptions): Promise<Result<CheckoutResult, CimplifyError>>;
676
+ private reconcileActionAuthority;
677
+ pollPaymentStatus(orderId: string, options?: ReadRequestOptions): Promise<Result<PaymentStatusResponse, CimplifyError>>;
1334
678
  updateOrderCustomer(orderId: string, customer: CheckoutCustomerInfo): Promise<Result<Order, CimplifyError>>;
1335
679
  verifyPayment(orderId: string): Promise<Result<Order, CimplifyError>>;
680
+ private maybeEnrollResolvedOrder;
681
+ /** @deprecated Use `client.purchaseIntents.resolve()`. */
1336
682
  processAndResolve(data: CheckoutFormData & ProcessAndResolveOptions): Promise<Result<ProcessCheckoutResult, CimplifyError>>;
1337
683
  }
1338
684
 
685
+ type PurchaseIntentResolveStatus = (typeof PURCHASE_INTENT_RESOLVE_STATUS)[keyof typeof PURCHASE_INTENT_RESOLVE_STATUS];
686
+ type PurchaseIntentActionDecision = typeof PURCHASE_INTENT_ACTION_DECISION.CONTINUE | typeof PURCHASE_INTENT_ACTION_DECISION.STOP | {
687
+ kind: typeof PURCHASE_INTENT_ACTION_DECISION.SUBMIT;
688
+ request: SubmitPurchaseIntentActionRequest;
689
+ };
690
+ interface PurchaseIntentResolveOptions {
691
+ confirmation: ConfirmPurchaseIntentRequest;
692
+ initialResponse?: ConfirmPurchaseIntentResponse;
693
+ pollIntervalMs?: number;
694
+ maxPollAttempts?: number;
695
+ maxActionSteps?: number;
696
+ maxTermsReviewSteps?: number;
697
+ signal?: AbortSignal;
698
+ onStatusChange?: (status: PurchaseIntentResolveStatus, response?: ConfirmPurchaseIntentResponse) => void;
699
+ /**
700
+ * Run provider-owned UI, then return `continue` to replay the same durable
701
+ * attempt. For a typed provider challenge, return `submit` with only the
702
+ * requested authorization value; the SDK sends it through the owner-fenced
703
+ * attempt endpoint. Neither arm can alter the accepted terms.
704
+ */
705
+ onActionRequired?: (action: PurchaseIntentActionResponse) => PurchaseIntentActionDecision | Promise<PurchaseIntentActionDecision>;
706
+ /** Returning a request is explicit consent to replacement terms. */
707
+ onTermsChanged?: (response: Extract<ConfirmPurchaseIntentResponse, {
708
+ status: typeof PURCHASE_INTENT_CONFIRM_STATUS.TERMS_CHANGED;
709
+ }>) => ConfirmPurchaseIntentRequest | null | Promise<ConfirmPurchaseIntentRequest | null>;
710
+ }
711
+ interface PurchaseIntentConfirmationPort {
712
+ confirm(intentId: string, request: ConfirmPurchaseIntentRequest, options?: {
713
+ signal?: AbortSignal;
714
+ }): Promise<Result<ConfirmPurchaseIntentResponse, CimplifyError>>;
715
+ submitAction?(intentId: string, attemptId: string, request: SubmitPurchaseIntentActionRequest, options?: {
716
+ signal?: AbortSignal;
717
+ }): Promise<Result<ConfirmPurchaseIntentResponse, CimplifyError>>;
718
+ }
719
+ interface PurchaseIntentResolverDependencies {
720
+ confirmation: PurchaseIntentConfirmationPort;
721
+ wait?: (milliseconds: number, signal?: AbortSignal) => Promise<void>;
722
+ }
723
+ /**
724
+ * Pure purchase-intent state machine. Transport stays behind the narrow
725
+ * confirmation port, while UI policy is supplied through callbacks.
726
+ */
727
+ declare class PurchaseIntentResolver {
728
+ private readonly confirmation;
729
+ private readonly wait;
730
+ constructor(dependencies: PurchaseIntentResolverDependencies);
731
+ resolve(intentId: string, options: PurchaseIntentResolveOptions): Promise<Result<PurchaseIntentResolution, CimplifyError>>;
732
+ private ensureActive;
733
+ private notify;
734
+ }
735
+
736
+ declare const PURCHASE_INTENT_ROUTE: {
737
+ readonly DIRECT_COLLECTION: "/api/v1/purchase-intents";
738
+ readonly HOSTED_SESSION_COLLECTION: "/v1/checkout/sessions";
739
+ readonly PREPARE: "prepare";
740
+ readonly REFRESH: "refresh";
741
+ readonly CONFIRM: "confirm";
742
+ readonly REPLAY: "replay";
743
+ readonly ATTEMPTS: "attempts";
744
+ readonly ACTIONS: "actions";
745
+ };
746
+ /** Narrow transport port keeps the service independent of client internals. */
747
+ interface PurchaseIntentTransport {
748
+ get<T = unknown>(path: string, opts?: ReadRequestOptions): Promise<T>;
749
+ post<T = unknown>(path: string, body?: unknown, opts?: RequestOptions): Promise<T>;
750
+ }
751
+ interface PurchaseIntentRequestOptions {
752
+ signal?: AbortSignal;
753
+ timeoutMs?: number;
754
+ }
755
+ declare class PurchaseIntentService {
756
+ private readonly transport;
757
+ private readonly resolver;
758
+ constructor(transport: PurchaseIntentTransport);
759
+ mint(request: MintPurchaseIntentRequest, options?: PurchaseIntentRequestOptions): Promise<Result<PurchaseIntentView, CimplifyError>>;
760
+ get(intentId: string, options?: PurchaseIntentRequestOptions): Promise<Result<PurchaseIntentView, CimplifyError>>;
761
+ refresh(intentId: string, expectedRevision: number, options?: PurchaseIntentRequestOptions): Promise<Result<PurchaseIntentView, CimplifyError>>;
762
+ confirm(intentId: string, request: ConfirmPurchaseIntentRequest, options?: PurchaseIntentRequestOptions): Promise<Result<ConfirmPurchaseIntentResponse, CimplifyError>>;
763
+ submitAction(intentId: string, attemptId: string, request: SubmitPurchaseIntentActionRequest, options?: PurchaseIntentRequestOptions): Promise<Result<ConfirmPurchaseIntentResponse, CimplifyError>>;
764
+ resolve(intentId: string, options: PurchaseIntentResolveOptions): Promise<Result<PurchaseIntentResolution, CimplifyError>>;
765
+ /**
766
+ * Bind subsequent preparation/confirmation to one hosted checkout-session
767
+ * owner. The session ID is a route authority, not an intent-owner rewrite.
768
+ */
769
+ forHostedSession(sessionId: string): HostedPurchaseIntentService;
770
+ private intentPath;
771
+ }
772
+ /**
773
+ * Owner-specific hosted checkout port. Hosted drafts belong to the durable
774
+ * checkout session ID, whereas direct storefront intents belong to the API
775
+ * session/account; keeping separate route objects makes that distinction
776
+ * unrepresentable as a caller-supplied owner field.
777
+ */
778
+ declare class HostedPurchaseIntentService {
779
+ private readonly transport;
780
+ private readonly resolver;
781
+ private readonly sessionPath;
782
+ constructor(transport: PurchaseIntentTransport, sessionId: string);
783
+ prepare(request: PreparePurchaseIntentRequest, options?: PurchaseIntentRequestOptions): Promise<Result<PurchaseIntentView, CimplifyError>>;
784
+ confirm(_intentId: string, request: ConfirmPurchaseIntentRequest, options?: PurchaseIntentRequestOptions): Promise<Result<ConfirmPurchaseIntentResponse, CimplifyError>>;
785
+ replay(options?: PurchaseIntentRequestOptions): Promise<Result<ConfirmPurchaseIntentResponse, CimplifyError>>;
786
+ submitAction(_intentId: string, attemptId: string, request: SubmitPurchaseIntentActionRequest, options?: PurchaseIntentRequestOptions): Promise<Result<ConfirmPurchaseIntentResponse, CimplifyError>>;
787
+ resolve(intentId: string, options: PurchaseIntentResolveOptions): Promise<Result<PurchaseIntentResolution, CimplifyError>>;
788
+ }
789
+
1339
790
  interface BusinessDetailsDTO {
1340
791
  name: string;
1341
792
  logo_url?: string;
@@ -1483,7 +934,7 @@ interface EnrichedOrder {
1483
934
  metadata?: Record<string, unknown>;
1484
935
  }
1485
936
 
1486
- interface IdempotencyOption$7 {
937
+ interface IdempotencyOption$8 {
1487
938
  idempotencyKey?: string;
1488
939
  }
1489
940
  interface GetOrdersOptions {
@@ -1505,7 +956,7 @@ declare class OrderQueries {
1505
956
  getDetail(orderId: string): Promise<Result<EnrichedOrder, CimplifyError>>;
1506
957
  getRecent(limit?: number): Promise<Result<Order[], CimplifyError>>;
1507
958
  getByStatus(status: OrderStatus): Promise<Result<Order[], CimplifyError>>;
1508
- cancel(orderId: string, reason?: string, opts?: IdempotencyOption$7): Promise<Result<Order, CimplifyError>>;
959
+ cancel(orderId: string, reason?: string, opts?: IdempotencyOption$8): Promise<Result<Order, CimplifyError>>;
1509
960
  }
1510
961
 
1511
962
  interface StoreCreditBalance {
@@ -1543,9 +994,13 @@ interface GetLinkOrderOptions {
1543
994
  */
1544
995
  businessId?: string;
1545
996
  }
1546
- interface IdempotencyOption$6 {
997
+ interface IdempotencyOption$7 {
1547
998
  idempotencyKey?: string;
1548
999
  }
1000
+ interface LinkAuthOption extends IdempotencyOption$7 {
1001
+ /** Return verified credentials without installing them on the shared client. */
1002
+ activateSession?: boolean;
1003
+ }
1549
1004
  interface SuccessResult {
1550
1005
  success: boolean;
1551
1006
  message?: string;
@@ -1576,10 +1031,15 @@ interface SuccessResult {
1576
1031
  */
1577
1032
  declare class LinkService {
1578
1033
  private client;
1034
+ private activationGeneration;
1579
1035
  constructor(client: CimplifyClient);
1580
- requestOtp(input: RequestOtpInput, opts?: IdempotencyOption$6): Promise<Result<SuccessResult, CimplifyError>>;
1581
- verifyOtp(input: VerifyOtpInput, opts?: IdempotencyOption$6): Promise<Result<AuthResponse, CimplifyError>>;
1582
- refreshSession(sessionToken?: string, opts?: IdempotencyOption$6): Promise<Result<AuthResponse, CimplifyError>>;
1036
+ private beginActivation;
1037
+ private isActivationFenceCurrent;
1038
+ private supersededActivation;
1039
+ private activateAuthenticatedSession;
1040
+ requestOtp(input: RequestOtpInput, opts?: IdempotencyOption$7): Promise<Result<RequestOtpResult$1, CimplifyError>>;
1041
+ verifyOtp(input: VerifyOtpInput, opts?: LinkAuthOption): Promise<Result<AuthResponse, CimplifyError>>;
1042
+ refreshSession(sessionToken?: string, opts?: LinkAuthOption): Promise<Result<AuthResponse, CimplifyError>>;
1583
1043
  logout(): Promise<Result<SuccessResult, CimplifyError>>;
1584
1044
  checkStatus(contact: string): Promise<Result<LinkStatusResult, CimplifyError>>;
1585
1045
  getLinkData(): Promise<Result<LinkData, CimplifyError>>;
@@ -1593,25 +1053,25 @@ declare class LinkService {
1593
1053
  }): Promise<Result<Customer, CimplifyError>>;
1594
1054
  getOrders(options?: GetLinkOrdersOptions): Promise<Result<Order[], CimplifyError>>;
1595
1055
  getOrder(orderId: string, options?: GetLinkOrderOptions): Promise<Result<Order, CimplifyError>>;
1596
- enroll(data: EnrollmentData, opts?: IdempotencyOption$6): Promise<Result<LinkEnrollResult, CimplifyError>>;
1597
- enrollAndLinkOrder(data: EnrollAndLinkOrderInput, opts?: IdempotencyOption$6): Promise<Result<EnrollAndLinkOrderResult, CimplifyError>>;
1056
+ enroll(data: EnrollmentData, opts?: IdempotencyOption$7): Promise<Result<LinkEnrollResult, CimplifyError>>;
1057
+ enrollAndLinkOrder(data: EnrollAndLinkOrderInput, opts?: IdempotencyOption$7): Promise<Result<EnrollAndLinkOrderResult, CimplifyError>>;
1598
1058
  updatePreferences(preferences: Partial<CustomerLinkPreferences>): Promise<Result<SuccessResult, CimplifyError>>;
1599
- createAddress(input: CreateAddressInput, opts?: IdempotencyOption$6): Promise<Result<CustomerAddress, CimplifyError>>;
1059
+ createAddress(input: CreateAddressInput, opts?: IdempotencyOption$7): Promise<Result<CustomerAddress, CimplifyError>>;
1600
1060
  updateAddress(input: UpdateAddressInput): Promise<Result<SuccessResult, CimplifyError>>;
1601
1061
  deleteAddress(addressId: string): Promise<Result<SuccessResult, CimplifyError>>;
1602
1062
  setDefaultAddress(addressId: string): Promise<Result<SuccessResult, CimplifyError>>;
1603
1063
  trackAddressUsage(addressId: string): Promise<Result<SuccessResult, CimplifyError>>;
1604
- createMobileMoney(input: CreateMobileMoneyInput, opts?: IdempotencyOption$6): Promise<Result<CustomerMobileMoney, CimplifyError>>;
1064
+ createMobileMoney(input: CreateMobileMoneyInput, opts?: IdempotencyOption$7): Promise<Result<CustomerMobileMoney, CimplifyError>>;
1605
1065
  deleteMobileMoney(mobileMoneyId: string): Promise<Result<SuccessResult, CimplifyError>>;
1606
1066
  setDefaultMobileMoney(mobileMoneyId: string): Promise<Result<SuccessResult, CimplifyError>>;
1607
1067
  trackMobileMoneyUsage(mobileMoneyId: string): Promise<Result<SuccessResult, CimplifyError>>;
1608
- verifyMobileMoney(mobileMoneyId: string, opts?: IdempotencyOption$6): Promise<Result<SuccessResult, CimplifyError>>;
1068
+ verifyMobileMoney(mobileMoneyId: string, opts?: IdempotencyOption$7): Promise<Result<SuccessResult, CimplifyError>>;
1609
1069
  getSessions(): Promise<Result<LinkSession[], CimplifyError>>;
1610
1070
  revokeSession(sessionId: string): Promise<Result<RevokeSessionResult, CimplifyError>>;
1611
1071
  revokeAllSessions(): Promise<Result<RevokeAllSessionsResult, CimplifyError>>;
1612
1072
  }
1613
1073
 
1614
- interface IdempotencyOption$5 {
1074
+ interface IdempotencyOption$6 {
1615
1075
  idempotencyKey?: string;
1616
1076
  }
1617
1077
  interface AuthStatus {
@@ -1650,8 +1110,8 @@ declare class AuthService {
1650
1110
  getStatus(): Promise<Result<AuthStatus, CimplifyError>>;
1651
1111
  getCurrentUser(): Promise<Result<Customer | null, CimplifyError>>;
1652
1112
  isAuthenticated(): Promise<Result<boolean, CimplifyError>>;
1653
- requestOtp(contact: string, contactType?: "phone" | "email", opts?: IdempotencyOption$5): Promise<Result<RequestOtpResult, CimplifyError>>;
1654
- verifyOtp(code: string, contact?: string, opts?: IdempotencyOption$5): Promise<Result<OtpResult, CimplifyError>>;
1113
+ requestOtp(contact: string, contactType?: "phone" | "email", opts?: IdempotencyOption$6): Promise<Result<RequestOtpResult, CimplifyError>>;
1114
+ verifyOtp(code: string, contact?: string, opts?: IdempotencyOption$6): Promise<Result<OtpResult, CimplifyError>>;
1655
1115
  logout(): Promise<Result<LogoutResult, CimplifyError>>;
1656
1116
  updateProfile(input: UpdateProfileInput): Promise<Result<UpdateProfileResult, CimplifyError>>;
1657
1117
  }
@@ -2048,7 +1508,7 @@ interface RescheduleHistoryRecord {
2048
1508
  metadata?: Record<string, unknown> | null;
2049
1509
  }
2050
1510
 
2051
- interface IdempotencyOption$4 {
1511
+ interface IdempotencyOption$5 {
2052
1512
  idempotencyKey?: string;
2053
1513
  }
2054
1514
  declare class SchedulingService {
@@ -2063,8 +1523,8 @@ declare class SchedulingService {
2063
1523
  getCustomerBookings(customerId?: string): Promise<Result<CustomerBooking[], CimplifyError>>;
2064
1524
  getUpcomingBookings(): Promise<Result<CustomerBooking[], CimplifyError>>;
2065
1525
  getPastBookings(limit?: number): Promise<Result<CustomerBooking[], CimplifyError>>;
2066
- cancelBooking(input: CancelBookingInput, opts?: IdempotencyOption$4): Promise<Result<CancelBookingResult, CimplifyError>>;
2067
- rescheduleBooking(input: RescheduleBookingInput, opts?: IdempotencyOption$4): Promise<Result<RescheduleBookingResult, CimplifyError>>;
1526
+ cancelBooking(input: CancelBookingInput, opts?: IdempotencyOption$5): Promise<Result<CancelBookingResult, CimplifyError>>;
1527
+ rescheduleBooking(input: RescheduleBookingInput, opts?: IdempotencyOption$5): Promise<Result<RescheduleBookingResult, CimplifyError>>;
2068
1528
  getNextAvailableSlot(serviceId: string, fromDate?: string): Promise<Result<AvailableSlot | null, CimplifyError>>;
2069
1529
  hasAvailabilityOn(serviceId: string, date: string): Promise<Result<boolean, CimplifyError>>;
2070
1530
  }
@@ -2145,14 +1605,14 @@ type FxQuote = S["LockedFxQuote"];
2145
1605
  type FxRateResponse = S["FxQuote"];
2146
1606
  type FxQuoteStatus = S["FxQuoteStatus"];
2147
1607
 
2148
- interface IdempotencyOption$3 {
1608
+ interface IdempotencyOption$4 {
2149
1609
  idempotencyKey?: string;
2150
1610
  }
2151
1611
  declare class FxService {
2152
1612
  private client;
2153
1613
  constructor(client: CimplifyClient);
2154
1614
  getRate(from: CurrencyCode, to: CurrencyCode): Promise<Result<FxRateResponse, CimplifyError>>;
2155
- lockQuote(request: FxQuoteRequest, opts?: IdempotencyOption$3): Promise<Result<FxQuote, CimplifyError>>;
1615
+ lockQuote(request: FxQuoteRequest, opts?: IdempotencyOption$4): Promise<Result<FxQuote, CimplifyError>>;
2156
1616
  }
2157
1617
 
2158
1618
  interface TrackPageViewOptions {
@@ -2225,7 +1685,8 @@ interface DismissMessageResponse {
2225
1685
  }
2226
1686
  declare class ActivityService {
2227
1687
  private client;
2228
- private readonly sessions;
1688
+ private sessions;
1689
+ private localGeneration;
2229
1690
  private bootstrapRequest;
2230
1691
  constructor(client: CimplifyClient);
2231
1692
  /**
@@ -2238,6 +1699,8 @@ declare class ActivityService {
2238
1699
  refreshIdentity(): void;
2239
1700
  /** A signed-out browser starts a fresh anonymous analytics session. */
2240
1701
  resetSession(): void;
1702
+ /** Drop the old storefront's analytics state before binding this service to the new one. */
1703
+ resetForStorefrontIdentityChange(): void;
2241
1704
  private buildSessionPayload;
2242
1705
  /** Route-level page view. Product/category interactions are tracked separately. */
2243
1706
  trackPageView(options?: TrackPageViewOptions): void;
@@ -2254,9 +1717,13 @@ declare class ActivityService {
2254
1717
  private sendEvents;
2255
1718
  private postEvents;
2256
1719
  private bootstrapSession;
1720
+ private captureGeneration;
1721
+ private isCurrentGeneration;
1722
+ private invalidatePendingActivity;
1723
+ private createSessionCoordinator;
2257
1724
  }
2258
1725
 
2259
- interface IdempotencyOption$2 {
1726
+ interface IdempotencyOption$3 {
2260
1727
  idempotencyKey?: string;
2261
1728
  }
2262
1729
  declare class SubscriptionService {
@@ -2264,7 +1731,7 @@ declare class SubscriptionService {
2264
1731
  constructor(client: CimplifyClient);
2265
1732
  list(): Promise<Result<Subscription[], CimplifyError>>;
2266
1733
  get(id: string): Promise<Result<SubscriptionWithDetails, CimplifyError>>;
2267
- cancel(id: string, reason?: string, opts?: IdempotencyOption$2): Promise<Result<{
1734
+ cancel(id: string, reason?: string, opts?: IdempotencyOption$3): Promise<Result<{
2268
1735
  success: boolean;
2269
1736
  }, CimplifyError>>;
2270
1737
  pause(id: string): Promise<Result<{
@@ -2273,12 +1740,12 @@ declare class SubscriptionService {
2273
1740
  resume(id: string): Promise<Result<{
2274
1741
  success: boolean;
2275
1742
  }, CimplifyError>>;
2276
- skipNextRenewal(id: string, opts?: IdempotencyOption$2): Promise<Result<{
1743
+ skipNextRenewal(id: string, opts?: IdempotencyOption$3): Promise<Result<{
2277
1744
  success: boolean;
2278
1745
  }, CimplifyError>>;
2279
1746
  }
2280
1747
 
2281
- interface IdempotencyOption$1 {
1748
+ interface IdempotencyOption$2 {
2282
1749
  idempotencyKey?: string;
2283
1750
  }
2284
1751
  interface UploadInitResponse {
@@ -2296,7 +1763,7 @@ interface UploadResult {
2296
1763
  declare class UploadService {
2297
1764
  private client;
2298
1765
  constructor(client: CimplifyClient);
2299
- init(filename: string, contentType: string, sizeBytes: number, opts?: IdempotencyOption$1): Promise<Result<UploadInitResponse, CimplifyError>>;
1766
+ init(filename: string, contentType: string, sizeBytes: number, opts?: IdempotencyOption$2): Promise<Result<UploadInitResponse, CimplifyError>>;
2300
1767
  confirm(uploadId: string): Promise<Result<UploadResult, CimplifyError>>;
2301
1768
  upload(file: File): Promise<Result<UploadResult, CimplifyError>>;
2302
1769
  }
@@ -2333,6 +1800,8 @@ interface DeliveryFeeResponse {
2333
1800
  currency: string | null;
2334
1801
  details: DeliveryFeeDetails | null;
2335
1802
  }
1803
+ /** Whether delivery is priced on-platform or arranged directly with the seller. */
1804
+ type DeliveryFeeStatus = "priced" | "arranged";
2336
1805
  /** One entry on the delivery menu — a merchant-named rate ("Standard",
2337
1806
  * "Express", "Outside Accra") priced for the address when required, or the
2338
1807
  * synthesized default when the business has no named rates (`rate_id: null`). */
@@ -2341,6 +1810,7 @@ interface DeliveryOption {
2341
1810
  name: string;
2342
1811
  description?: string;
2343
1812
  fee: Money;
1813
+ fee_status: DeliveryFeeStatus;
2344
1814
  currency: string;
2345
1815
  free_delivery_applied: boolean;
2346
1816
  /** Order value at/above this makes the option free — render "Free over X". */
@@ -2385,6 +1855,8 @@ type SenderType = "customer" | "agent" | "system" | "bot";
2385
1855
  type ContentType = "text" | "image" | "video" | "audio" | "voice" | "document" | "sticker" | "location" | "contact" | "reaction" | "interactive" | "story_mention" | "share";
2386
1856
  interface ChatMessage {
2387
1857
  id: string;
1858
+ /** Monotonic server sequence; absent only on a local optimistic bubble. */
1859
+ sequence?: number;
2388
1860
  sender_type: SenderType;
2389
1861
  content: string;
2390
1862
  content_type: ContentType;
@@ -2394,6 +1866,9 @@ interface ChatMessage {
2394
1866
  reply_to?: ChatReplyContext | null;
2395
1867
  /** Echo of the sender's idempotency key on widget customer messages. */
2396
1868
  client_id?: string | null;
1869
+ /** Trusted provider mutation stamps; deleted messages are removed by the hook. */
1870
+ edited_at?: string | null;
1871
+ deleted_at?: string | null;
2397
1872
  created_at: string;
2398
1873
  }
2399
1874
  /**
@@ -2420,17 +1895,26 @@ interface ChatAttachment {
2420
1895
  interface ChatUploadAttachment extends ChatAttachment {
2421
1896
  upload_id: string;
2422
1897
  }
1898
+ interface ChatPersona {
1899
+ persona_type: "account" | "business";
1900
+ persona_id: string;
1901
+ }
1902
+ /** Direct Account↔Business thread projection from the Chat core. */
2423
1903
  interface ChatConversation {
2424
1904
  id: string;
2425
- status: "open" | "assigned" | "waiting" | "resolved" | "closed";
2426
- ai_enabled: boolean;
2427
- /** The customer asked for a person (or the AI escalated). */
2428
- needs_human_review?: boolean;
1905
+ account_id: string;
1906
+ business_id: string;
1907
+ kind: "direct";
1908
+ ai_mode: "auto" | "assist" | "off";
1909
+ ai_mode_version: number;
2429
1910
  message_count: number;
2430
- created_at: string;
1911
+ last_message_id?: string | null;
2431
1912
  last_message_at: string | null;
2432
- /** Team-wide read watermark; messages at or before it have been seen. */
2433
- team_read_at?: string | null;
1913
+ created_at: string;
1914
+ updated_at: string;
1915
+ archived_at?: string | null;
1916
+ account: ChatPersona;
1917
+ business: ChatPersona;
2434
1918
  }
2435
1919
  /** Structured card references an AI reply may carry in `metadata.cards`. */
2436
1920
  type ChatReplyCard = {
@@ -2452,16 +1936,37 @@ interface ChatConversationResponse {
2452
1936
  interface ClaimConversationResult {
2453
1937
  /** The rotated, customer-bound session token; the SDK adopts it automatically. */
2454
1938
  session_token: string;
2455
- /** The adopted (or merged-into) conversation; null when there was nothing to adopt. */
2456
- thread_id?: string | null;
1939
+ /** The account's canonical direct Chat thread for this business. */
1940
+ thread: ChatConversation;
2457
1941
  customer_name: string;
1942
+ /** Per-envelope, PII-minimal WhatsApp history claim outcomes. */
1943
+ external_claims: ExternalChatClaimAttempt[];
1944
+ /** Candidate discovery failed; retry `claimExternalChats()` later. */
1945
+ external_claims_unavailable: boolean;
1946
+ }
1947
+ type ExternalChatClaimDisposition = "claimed" | "replayed" | "conflict" | "contact_unverified" | "business_unavailable" | "history_empty" | "history_oversize" | "failed";
1948
+ interface ExternalChatClaimAttempt {
1949
+ status: ExternalChatClaimDisposition;
1950
+ thread_id: string | null;
1951
+ imported_message_count: number | null;
1952
+ replayed: boolean;
1953
+ observed_message_count: number | null;
1954
+ maximum_message_count: number | null;
1955
+ }
1956
+ interface ClaimExternalChatsResult {
1957
+ claims: ExternalChatClaimAttempt[];
1958
+ }
1959
+ interface ChatHandoffResponse {
1960
+ thread: ChatConversation;
1961
+ cancelled_turns: number;
1962
+ spending_turns: number;
2458
1963
  }
2459
1964
  interface ChatWidgetStarter {
2460
1965
  icon?: string;
2461
1966
  text: string;
2462
1967
  }
2463
1968
 
2464
- interface IdempotencyOption {
1969
+ interface IdempotencyOption$1 {
2465
1970
  idempotencyKey?: string;
2466
1971
  }
2467
1972
  declare class SupportService {
@@ -2477,13 +1982,22 @@ declare class SupportService {
2477
1982
  * Claim the anonymous session for the verified Link identity: the server
2478
1983
  * verifies the access token, rotates the session token (adopted here, so
2479
1984
  * every subsequent request rides the bound session), folds the guest cart
2480
- * in, and adopts or merges the widget conversation.
1985
+ * in, and opens or reuses the account's canonical direct Chat thread.
2481
1986
  *
2482
1987
  * Idempotent and single-flight: concurrent calls share one request, and a
2483
1988
  * token already claimed by this instance short-circuits without a network
2484
- * round trip. Emits `session:claimed` on the client's event channel.
1989
+ * round trip. A session already bound to another Link account is rejected
1990
+ * rather than transferring that account's cart. Emits `session:claimed` on
1991
+ * the client's event channel.
2485
1992
  */
2486
1993
  claimConversation(): Promise<Result<ClaimConversationResult, CimplifyError>>;
1994
+ /**
1995
+ * Retry verified external-history discovery for the current storefront.
1996
+ * Launch scope is intentionally WhatsApp-only because it is the registered
1997
+ * bidirectional transport. Results are per envelope and omit provider ids,
1998
+ * contact values, account ids, and message bodies.
1999
+ */
2000
+ claimExternalChats(): Promise<Result<ClaimExternalChatsResult, CimplifyError>>;
2487
2001
  /**
2488
2002
  * Peek at the conversation without creating one: resolves the existing
2489
2003
  * thread (or null) so a page load can hydrate history without littering
@@ -2491,7 +2005,7 @@ declare class SupportService {
2491
2005
  */
2492
2006
  peekConversation(): Promise<Result<ChatConversationResponse | null, CimplifyError>>;
2493
2007
  /** Open (or resume) the customer's widget conversation. */
2494
- openConversation(opts?: IdempotencyOption): Promise<Result<ChatConversationResponse, CimplifyError>>;
2008
+ openConversation(opts?: IdempotencyOption$1): Promise<Result<ChatConversationResponse, CimplifyError>>;
2495
2009
  /**
2496
2010
  * Send a message in the active conversation.
2497
2011
  *
@@ -2500,7 +2014,7 @@ declare class SupportService {
2500
2014
  * `replyToMessageId` quotes another message by its `ChatMessage.id`; the
2501
2015
  * server resolves it thread-scoped and echoes the quote as `reply_to`.
2502
2016
  */
2503
- sendMessage(content: string, opts?: IdempotencyOption & {
2017
+ sendMessage(content: string, opts?: IdempotencyOption$1 & {
2504
2018
  replyToMessageId?: string;
2505
2019
  attachments?: ChatUploadAttachment[];
2506
2020
  }): Promise<Result<ChatMessage, CimplifyError>>;
@@ -2509,16 +2023,14 @@ declare class SupportService {
2509
2023
  * backward for scrollback into older history.
2510
2024
  */
2511
2025
  getMessages(options?: {
2512
- after?: string;
2513
- before?: string;
2026
+ afterSequence?: number;
2027
+ beforeSequence?: number;
2514
2028
  limit?: number;
2515
2029
  }): Promise<Result<ChatMessage[], CimplifyError>>;
2516
2030
  /** React to a message in the active conversation by its `ChatMessage.id`. */
2517
2031
  reactToMessage(messageId: string, emoji: string): Promise<Result<ChatMessage, CimplifyError>>;
2518
2032
  /** Ask for a person: flags the thread for the merchant's inbox. */
2519
- requestHuman(opts?: IdempotencyOption): Promise<Result<{
2520
- requested: boolean;
2521
- }, CimplifyError>>;
2033
+ requestHuman(opts?: IdempotencyOption$1): Promise<Result<ChatHandoffResponse, CimplifyError>>;
2522
2034
  }
2523
2035
 
2524
2036
  declare class CimplifyElements {
@@ -2535,6 +2047,8 @@ declare class CimplifyElements {
2535
2047
  private paymentData;
2536
2048
  private checkoutInProgress;
2537
2049
  private authInProgress;
2050
+ private authEstablishmentInProgress;
2051
+ private authGeneration;
2538
2052
  private activeCheckoutAbort;
2539
2053
  private boundHandleMessage;
2540
2054
  private businessIdResolvePromise;
@@ -2553,19 +2067,23 @@ declare class CimplifyElements {
2553
2067
  getBusinessId(): string | null;
2554
2068
  resolveBusinessId(): Promise<string | null>;
2555
2069
  getAppearance(): ElementsOptions["appearance"];
2070
+ private isAuthGenerationCurrent;
2556
2071
  private hydrateCustomerData;
2557
2072
  private sourceElementFor;
2558
2073
  private sessionStorageKey;
2559
2074
  private persistRefreshToken;
2560
2075
  private clearPersistedSession;
2076
+ private clearClaimedAuthorityAfterRestoreFailure;
2561
2077
  private restoreSession;
2562
2078
  private applyAccessToken;
2079
+ private waitForAuthEstablishment;
2563
2080
  private broadcastAccessToken;
2081
+ private broadcastClearedSession;
2564
2082
  private startEmbeddedAuth;
2565
2083
  private handleMessage;
2566
2084
  _setAddressData(data: AddressInfo): void;
2567
2085
  _setPaymentData(data: PaymentMethodInfo): void;
2568
- _setGuestContact(contact: string, contactType: "email" | "phone"): void;
2086
+ _setGuestContact(contact: string, contactType: ElementsAuthContactType): void;
2569
2087
  }
2570
2088
  declare class CimplifyElement {
2571
2089
  private type;
@@ -2618,10 +2136,18 @@ declare class CimplifyElement {
2618
2136
  }
2619
2137
  declare function createElements(client: CimplifyClient, businessId?: string, options?: ElementsOptions): CimplifyElements;
2620
2138
 
2139
+ interface RequestRetryPolicy {
2140
+ /** Per-call retry ceiling after the initial attempt; never raises the client-wide limit. */
2141
+ maxRetries: number;
2142
+ /** Positive jitter range as a fraction of the base delay. */
2143
+ jitterRatio?: number;
2144
+ }
2621
2145
  interface RequestOptions {
2622
2146
  idempotencyKey?: string;
2623
2147
  headers?: Record<string, string>;
2624
2148
  timeoutMs?: number;
2149
+ retryPolicy?: RequestRetryPolicy;
2150
+ signal?: AbortSignal;
2625
2151
  }
2626
2152
  /**
2627
2153
  * Per-call cache hints for server-side reads. Forwarded as `next: { revalidate, tags }`
@@ -2640,6 +2166,9 @@ interface CacheOptions {
2640
2166
  }
2641
2167
  interface ReadRequestOptions {
2642
2168
  cacheOptions?: CacheOptions;
2169
+ timeoutMs?: number;
2170
+ retryPolicy?: RequestRetryPolicy;
2171
+ signal?: AbortSignal;
2643
2172
  }
2644
2173
  interface CimplifyConfig {
2645
2174
  publicKey?: string;
@@ -2683,6 +2212,9 @@ declare class CimplifyClient {
2683
2212
  private businessId;
2684
2213
  private businessIdResolvePromise;
2685
2214
  private publicKeyEpoch;
2215
+ private stopCrossTabSessionWatch;
2216
+ private latestSessionSyncAt;
2217
+ private latestSessionSyncOrderKey;
2686
2218
  readonly authorizationAdapters: PaymentAuthorizationAdapterRegistry;
2687
2219
  private inflightRequests;
2688
2220
  /**
@@ -2696,6 +2228,7 @@ declare class CimplifyClient {
2696
2228
  private _catalogue?;
2697
2229
  private _cart?;
2698
2230
  private _checkout?;
2231
+ private _purchaseIntents?;
2699
2232
  private _orders?;
2700
2233
  private _storeCredit?;
2701
2234
  private _subscriptions?;
@@ -2714,6 +2247,8 @@ declare class CimplifyClient {
2714
2247
  constructor(config?: CimplifyConfig);
2715
2248
  private stopPageViewTracking;
2716
2249
  stopTrackingPageViews(): void;
2250
+ /** Release window-level subscriptions and automatic tracking owned by this client. */
2251
+ destroy(): void;
2717
2252
  getAccessToken(): string | null;
2718
2253
  getPublicKey(): string;
2719
2254
  getBaseUrl(): string;
@@ -2726,7 +2261,8 @@ declare class CimplifyClient {
2726
2261
  * refresh restore) binds the anonymous session so the conversation, cart
2727
2262
  * and orders survive a cleared browser. Best-effort by design — a failed
2728
2263
  * claim leaves the session anonymous, exactly as it was. Called by the
2729
- * auth flows, never by the raw token setter.
2264
+ * merchant auth flows, never by the raw token setter. Global Link clients
2265
+ * have no storefront tenant and therefore activate without this step.
2730
2266
  */
2731
2267
  autoClaimChatIdentity(): void;
2732
2268
  /**
@@ -2737,10 +2273,19 @@ declare class CimplifyClient {
2737
2273
  adoptSessionToken(token: string): void;
2738
2274
  clearSession(): void;
2739
2275
  getSessionEpoch(): number;
2276
+ /** Monotonic fence for async work scoped to the current storefront tenant. */
2277
+ getPublicKeyEpoch(): number;
2740
2278
  getSessionToken(): string | null;
2279
+ /** Whether the current transport session is known to have been claimed for
2280
+ * a Link identity, even when its in-memory bearer is absent after reload or
2281
+ * a failed refresh. The sync marker is written only after canonical claim
2282
+ * rotation and is replaced with `cleared` when a fresh session is minted. */
2283
+ hasClaimedSessionAuthority(): boolean;
2741
2284
  publishSessionClaimed(customerName: string | null): void;
2742
2285
  private broadcastSessionSync;
2743
- private watchCrossTabSession;
2286
+ private applyCrossTabSession;
2287
+ private observeSessionSync;
2288
+ private nextSessionSyncTimestamp;
2744
2289
  setOrderToken(orderId: string, token: string): void;
2745
2290
  getOrderToken(orderId: string): string | null;
2746
2291
  clearOrderTokens(): void;
@@ -2753,6 +2298,7 @@ declare class CimplifyClient {
2753
2298
  private authedFetch;
2754
2299
  private safeStorage;
2755
2300
  private loadSessionToken;
2301
+ private loadSessionSyncPayload;
2756
2302
  /**
2757
2303
  * Mint the session token client-side so the very first request already
2758
2304
  * carries it. Without this, parallel first-load requests each get a
@@ -2780,6 +2326,7 @@ declare class CimplifyClient {
2780
2326
  get catalogue(): CatalogueQueries;
2781
2327
  get cart(): CartOperations;
2782
2328
  get checkout(): CheckoutService;
2329
+ get purchaseIntents(): PurchaseIntentService;
2783
2330
  get orders(): OrderQueries;
2784
2331
  get storeCredit(): StoreCreditQueries;
2785
2332
  get subscriptions(): SubscriptionService;
@@ -2800,4 +2347,201 @@ declare class CimplifyClient {
2800
2347
  }
2801
2348
  declare function createCimplifyClient(config?: CimplifyConfig): CimplifyClient;
2802
2349
 
2803
- export { type CheckoutCollectionOption as $, type AbortablePromise as A, type Booking as B, type CacheOptions as C, type CancelBookingInput as D, type CancelBookingResult as E, type CancelOrderInput as F, type CancellationPolicy as G, type CardPopupAction as H, CartOperations as I, CatalogueQueries as J, type CatalogueResult as K, type CatalogueSnapshot as L, type CategoryInfo as M, type ChatAttachment as N, type ChatConversation as O, type ChatConversationResponse as P, type ChatMessage as Q, type ChatReplyCard as R, type ChatReplyContext as S, type ChatUploadAttachment as T, type ChatWidgetStarter as U, type CheckSlotAvailabilityInput as V, type CheckSlotAvailabilityResult as W, type CheckoutAddressInfo as X, type CheckoutCartData as Y, type CheckoutCartItem as Z, type CheckoutCollectionMethod as _, type ActivityRecommendation as a, type GetDeliveryOptionsParams as a$, type CheckoutCollectionOptions as a0, type CheckoutCustomerInfo as a1, type CheckoutFormData as a2, type CheckoutInput as a3, type CheckoutMode as a4, type CheckoutOrderType as a5, type CheckoutPaymentMethod as a6, type CheckoutResult as a7, CheckoutService as a8, type CheckoutStatus as a9, type ElementEventHandler as aA, type ElementEventType as aB, type ElementOptions as aC, type ElementType as aD, type ElementsAuthContactType as aE, type ElementsAuthMode as aF, type ElementsAuthOptions as aG, type ElementsAuthPrompt as aH, type ElementsCheckoutData as aI, type ElementsCheckoutResult as aJ, type ElementsCustomerInfo as aK, type ElementsOptions as aL, type EnrichedOrder as aM, type EnrichedOrderItem as aN, type Err as aO, type FeeBearerType as aP, type FetchQuoteInput as aQ, type FulfillmentLink as aR, type FulfillmentStatus as aS, type FulfillmentSummaryDTO as aT, type FulfillmentType as aU, type FxQuote as aV, type FxQuoteRequest as aW, type FxQuoteStatus as aX, type FxRateResponse as aY, FxService as aZ, type GetAvailableSlotsInput as a_, type CheckoutStatusContext as aa, type CheckoutStep as ab, CimplifyClient as ac, type CimplifyConfig as ad, CimplifyElement as ae, CimplifyElements as af, type ClaimConversationResult as ag, type ContentType as ah, type CustomerBooking as ai, type CustomerBookingServiceItem as aj, type CustomerServicePreferences as ak, type DayAvailability as al, type DeliveryFeeDetails as am, type DeliveryFeeResponse as an, type DeliveryOption as ao, type DeliveryOptionsQuery as ap, type DeliveryOptionsResponse as aq, DeliveryService as ar, type DepositResult as as, type DismissMessageResponse as at, ELEMENTS_AUTH_CONTACT_TYPES as au, ELEMENTS_AUTH_MODES as av, ELEMENTS_AUTH_PROMPTS as aw, ELEMENT_TYPES as ax, EVENT_TYPES as ay, type ElementAppearance as az, type ActivityRecommendationsResponse as b, PlacesService as b$, type GetOrdersOptions as b0, type GetProductsOptions as b1, type GroupOrderInfo as b2, type IframeToParentMessage as b3, InventoryService as b4, type LifecyclePhase as b5, type LineItem as b6, type LineType as b7, LinkService as b8, type LiteBootstrap as b9, type OrderHistory as bA, type OrderLineState as bB, type OrderLineStatus as bC, type OrderLocationInfo as bD, type OrderPaymentEvent as bE, type OrderPricingView as bF, OrderQueries as bG, type OrderSplitDetail as bH, type OrderStaffInfo as bI, type OrderStatus as bJ, type OrderTimestampsDTO as bK, type OrderType as bL, type Origin as bM, type OriginActor as bN, type OriginChannel as bO, type OtpResult as bP, type ParentToIframeMessage as bQ, type PaymentAuthorizationAdapter as bR, PaymentAuthorizationAdapterRegistry as bS, type PaymentAuthorizationContext as bT, type PaymentAuthorizationOutcome as bU, type PaymentInfoDTO as bV, type PaymentMethodInfo as bW, type PaymentState as bX, type PickupTime as bY, type PickupTimeType as bZ, type PlaceDetailsResponse as b_, type LiteDayHours as ba, type LiteHoursRange as bb, LiteService as bc, type Location as bd, type LocationBooking as be, type LocationTaxBehavior as bf, type LocationTaxOverrides as bg, type LocationTimeProfile as bh, type LocationWithDetails as bi, MESSAGE_TYPES as bj, type MobileMoneyDetails as bk, type NextAction as bl, type ObservabilityHooks as bm, type Ok as bn, type Order as bo, type OrderCustomerInfo as bp, type OrderDiscountInfo as bq, type OrderFilter as br, type OrderFulfillmentSummary as bs, type OrderGroup as bt, type OrderGroupDetails as bu, type OrderGroupPayment as bv, type OrderGroupPaymentState as bw, type OrderGroupPaymentStatus as bx, type OrderGroupPaymentSummary as by, type OrderGroupStatus as bz, ActivityService as c, type Table as c$, type PriceQuote as c0, type PricingOverrides as c1, type ProcessAndResolveOptions as c2, type ProcessCheckoutOptions as c3, type ProcessCheckoutResult as c4, type ProviderResolutionSource as c5, type QuoteBundleSelectionInput as c6, type QuoteCompositeSelectionInput as c7, type QuoteDynamicBuckets as c8, type QuoteStatus as c9, type SchedulingMetadata as cA, type SchedulingResult as cB, SchedulingService as cC, type SenderType as cD, type Service as cE, type ServiceAvailabilityParams as cF, type ServiceAvailabilityResult as cG, type ServiceCharge as cH, type ServiceNotes as cI, type ServiceScheduleRequest as cJ, type ServiceStatus as cK, type SessionActivityData as cL, type SessionChangeEvent as cM, type SessionMessage as cN, type SlotResourceInfo as cO, type SlotStaffInfo as cP, type Staff as cQ, type StaffAssignment as cR, type StaffRole as cS, type StaffScheduleItem as cT, type StockLevel as cU, type StockStatus as cV, type StoreCreditBalance as cW, StoreCreditQueries as cX, type StorefrontBootstrap as cY, SubscriptionService as cZ, SupportService as c_, type QuoteUiMessage as ca, type ReadRequestOptions as cb, type RefreshQuoteInput as cc, type RefreshQuoteResult as cd, type RefundOrderInput as ce, type RelatedCandidate as cf, type RelatedProduct as cg, type RelatedProductsEnrichment as ch, type RelationType as ci, type ReminderMethod as cj, type ReminderSettings as ck, type ReorderResult as cl, type RequestContext as cm, type RequestErrorEvent as cn, type RequestOptions as co, type RequestSource as cp, type RequestStartEvent as cq, type RequestSuccessEvent as cr, type RescheduleBookingInput as cs, type RescheduleBookingResult as ct, type RescheduleHistoryRecord as cu, type ResourceAssignment as cv, type ResourceInfo as cw, type Result as cx, type RetryEvent as cy, type Room as cz, type ActivityStateResponse as d, type TimeRange as d0, type TimeRanges as d1, type TimeSlot as d2, type TrackCategoryViewOptions as d3, type TrackProductViewOptions as d4, type UpdateOrderStatusInput as d5, type UpdateProfileInput as d6, type UploadInitResponse as d7, type UploadResult as d8, UploadService as d9, combine as da, combineObject as db, createCimplifyClient as dc, createDefaultPaymentAuthorizationAdapterRegistry as dd, createElements as de, err as df, flatMap as dg, fromPromise as dh, getOrElse as di, isErr as dj, isOk as dk, mapError as dl, mapResult as dm, ok as dn, toNullable as dp, tryCatch as dq, unwrap as dr, type AddressInfo as e, type AmountToPay as f, AuthService as g, type AuthStatus as h, type AuthenticatedCustomer as i, type AuthenticatedData as j, type AuthorizeCardPopupOptions as k, type AutocompletePrediction as l, type AutocompleteResponse as m, type AvailabilityResult as n, type AvailableSlot as o, type BookingModificationType as p, type BookingStatus as q, type BookingWithDetails as r, type BufferTimes as s, type Business as t, type BusinessDetailsDTO as u, type BusinessHours as v, type BusinessPreferences as w, BusinessService as x, type BusinessSettings as y, type BusinessWithLocations as z };
2350
+ interface CatalogueResult<T> {
2351
+ items: T[];
2352
+ is_complete: boolean;
2353
+ total_available?: number;
2354
+ pagination?: Pagination;
2355
+ }
2356
+ interface CatalogueSnapshot {
2357
+ categories: Category[];
2358
+ products: Product[];
2359
+ add_ons: AddOnWithOptions[];
2360
+ is_complete: boolean;
2361
+ total_available?: number;
2362
+ pagination?: Pagination;
2363
+ }
2364
+
2365
+ interface IdempotencyOption {
2366
+ idempotencyKey?: string;
2367
+ }
2368
+ interface GetProductsOptions {
2369
+ category?: string;
2370
+ taxonomy?: string;
2371
+ search?: string;
2372
+ page?: number;
2373
+ limit?: number;
2374
+ offset?: number;
2375
+ cursor?: string;
2376
+ tags?: string[];
2377
+ featured?: boolean;
2378
+ in_stock?: boolean;
2379
+ min_price?: number;
2380
+ max_price?: number;
2381
+ sort_by?: "name" | "price" | "created_at" | "updated_at";
2382
+ sort_order?: "asc" | "desc";
2383
+ /** Property filters — e.g. { material: "Cotton", size: "M,L" }. Values are comma-separated for multi-value. */
2384
+ properties?: Record<string, string>;
2385
+ }
2386
+ interface QuoteCompositeSelectionInput {
2387
+ component_id: string;
2388
+ quantity: number;
2389
+ variant_id?: string;
2390
+ add_on_option_id?: string;
2391
+ }
2392
+ interface QuoteBundleSelectionInput {
2393
+ component_id: string;
2394
+ quantity: number;
2395
+ variant_id?: string;
2396
+ }
2397
+ interface FetchQuoteInput {
2398
+ product_id: string;
2399
+ variant_id?: string;
2400
+ location_id?: string;
2401
+ quantity?: number;
2402
+ add_on_option_ids?: string[];
2403
+ bundle_selections?: QuoteBundleSelectionInput[];
2404
+ composite_selections?: QuoteCompositeSelectionInput[];
2405
+ }
2406
+ interface RefreshQuoteInput {
2407
+ quote_id: string;
2408
+ product_id?: string;
2409
+ variant_id?: string;
2410
+ location_id?: string;
2411
+ quantity?: number;
2412
+ add_on_option_ids?: string[];
2413
+ bundle_selections?: QuoteBundleSelectionInput[];
2414
+ composite_selections?: QuoteCompositeSelectionInput[];
2415
+ }
2416
+ type QuoteStatus = "pending" | "used" | "expired";
2417
+ interface QuoteDynamicBuckets {
2418
+ intent?: string;
2419
+ demand?: string;
2420
+ inventory?: string;
2421
+ competition?: string;
2422
+ }
2423
+ interface QuoteUiMessage {
2424
+ code: string;
2425
+ level: "info" | "warn" | "error" | string;
2426
+ text: string;
2427
+ countdown_seconds?: number;
2428
+ }
2429
+ type RequestSource = "web" | "qr_code" | "order_taker" | "ucp_a2a";
2430
+ interface PriceQuote {
2431
+ quote_id: string;
2432
+ business_id: string;
2433
+ product_id: string;
2434
+ variant_id?: string | null;
2435
+ location_id?: string | null;
2436
+ source: RequestSource;
2437
+ customer_id?: string | null;
2438
+ customer_segment_id?: string | null;
2439
+ storefront_id?: string | null;
2440
+ attribution_id?: string | null;
2441
+ quantity: number;
2442
+ currency?: CurrencyCode | null;
2443
+ snapshot_id?: string | null;
2444
+ snapshot_markup_version?: string | null;
2445
+ snapshot_tax_version?: string | null;
2446
+ item_price_info: ChosenPrice;
2447
+ variant_price_info?: ChosenPrice | null;
2448
+ final_price_info: ChosenPrice;
2449
+ sale?: SaleInfo | null;
2450
+ add_on_option_ids: string[];
2451
+ bundle_selections?: QuoteBundleSelectionInput[];
2452
+ add_ons_price_info?: ChosenPrice | null;
2453
+ quoted_total_price_info?: ChosenPrice | null;
2454
+ composite_selections?: QuoteCompositeSelectionInput[];
2455
+ dynamic_buckets: QuoteDynamicBuckets;
2456
+ ui_messages: QuoteUiMessage[];
2457
+ created_at: string;
2458
+ expires_at: string;
2459
+ next_change_at?: string | null;
2460
+ status: QuoteStatus;
2461
+ }
2462
+ interface RefreshQuoteResult {
2463
+ previous_quote_id: string;
2464
+ quote: PriceQuote;
2465
+ }
2466
+ declare class CatalogueQueries {
2467
+ private client;
2468
+ constructor(client: CimplifyClient);
2469
+ getCatalogue(opts?: ReadRequestOptions): Promise<Result<CatalogueSnapshot, CimplifyError>>;
2470
+ getProducts(options?: GetProductsOptions, opts?: ReadRequestOptions): Promise<Result<CatalogueResult<Product>, CimplifyError>>;
2471
+ getProduct(id: string, opts?: ReadRequestOptions): Promise<Result<ProductWithDetails, CimplifyError>>;
2472
+ getProductBySlug(slug: string, opts?: ReadRequestOptions): Promise<Result<ProductWithDetails, CimplifyError>>;
2473
+ getVariants(productId: string): Promise<Result<ProductVariant[], CimplifyError>>;
2474
+ getVariantAxes(productId: string): Promise<Result<VariantAxis[], CimplifyError>>;
2475
+ getVariantByAxisSelections(productId: string, selections: VariantAxisSelection): Promise<Result<ProductVariant | null, CimplifyError>>;
2476
+ getVariantById(productId: string, variantId: string): Promise<Result<ProductVariant, CimplifyError>>;
2477
+ getAddOns(productId: string, opts?: ReadRequestOptions): Promise<Result<AddOn[], CimplifyError>>;
2478
+ getCategories(opts?: ReadRequestOptions): Promise<Result<Category[], CimplifyError>>;
2479
+ getCategory(id: string, opts?: ReadRequestOptions): Promise<Result<Category, CimplifyError>>;
2480
+ getCategoryBySlug(slug: string, opts?: ReadRequestOptions): Promise<Result<Category, CimplifyError>>;
2481
+ getCategoryProducts(categoryId: string, options?: {
2482
+ limit?: number;
2483
+ offset?: number;
2484
+ }, opts?: ReadRequestOptions): Promise<Result<Product[], CimplifyError>>;
2485
+ getCollections(opts?: ReadRequestOptions): Promise<Result<Collection[], CimplifyError>>;
2486
+ getCollection(id: string, opts?: ReadRequestOptions): Promise<Result<Collection, CimplifyError>>;
2487
+ getCollectionBySlug(slug: string, opts?: ReadRequestOptions): Promise<Result<Collection, CimplifyError>>;
2488
+ getCollectionProducts(collectionId: string, options?: {
2489
+ limit?: number;
2490
+ offset?: number;
2491
+ }, opts?: ReadRequestOptions): Promise<Result<Product[], CimplifyError>>;
2492
+ searchCollections(query: string, limit?: number): Promise<Result<Collection[], CimplifyError>>;
2493
+ getBundles(): Promise<Result<BundleSummary[], CimplifyError>>;
2494
+ getBundle(id: string): Promise<Result<Bundle, CimplifyError>>;
2495
+ getBundleBySlug(slug: string): Promise<Result<Bundle, CimplifyError>>;
2496
+ searchBundles(query: string, limit?: number): Promise<Result<Bundle[], CimplifyError>>;
2497
+ getComposites(options?: {
2498
+ limit?: number;
2499
+ }): Promise<Result<Composite[], CimplifyError>>;
2500
+ getComposite(id: string): Promise<Result<Composite, CimplifyError>>;
2501
+ getCompositeByProduct(productId: string): Promise<Result<Composite, CimplifyError>>;
2502
+ calculateCompositePrice(compositeId: string, selections: ComponentSelectionInput[], locationId?: string): Promise<Result<CompositePriceResult, CimplifyError>>;
2503
+ fetchQuote(input: FetchQuoteInput, opts?: IdempotencyOption): Promise<Result<PriceQuote, CimplifyError>>;
2504
+ getQuote(quoteId: string): Promise<Result<PriceQuote, CimplifyError>>;
2505
+ refreshQuote(input: RefreshQuoteInput): Promise<Result<RefreshQuoteResult, CimplifyError>>;
2506
+ getTaxonomies(parentId?: string): Promise<Result<ProductTaxonomy[], CimplifyError>>;
2507
+ getTaxonomy(id: string): Promise<Result<TaxonomyWithChildren, CimplifyError>>;
2508
+ getTaxonomyPath(id: string): Promise<Result<ProductTaxonomy[], CimplifyError>>;
2509
+ searchTaxonomies(query: string, limit?: number): Promise<Result<ProductTaxonomy[], CimplifyError>>;
2510
+ getEligibleBillingPlans(productId: string, query?: EligiblePlansQuery): Promise<Result<ProductBillingPlan[], CimplifyError>>;
2511
+ getProductSchedules(productId: string): Promise<Result<ProductTimeProfile[], CimplifyError>>;
2512
+ checkProductAvailableNow(productId: string, locationId: string): Promise<Result<ProductAvailabilityNow, CimplifyError>>;
2513
+ getDeals(locationId?: string): Promise<Result<Deal[], CimplifyError>>;
2514
+ getProductsOnSale(): Promise<Result<ProductDealInfo[], CimplifyError>>;
2515
+ getProductDeals(productId: string): Promise<Result<Deal[], CimplifyError>>;
2516
+ getCategoryDeals(categoryId: string): Promise<Result<Deal[], CimplifyError>>;
2517
+ getCollectionDeals(collectionId: string): Promise<Result<Deal[], CimplifyError>>;
2518
+ validateDiscountCode(code: string, orderSubtotal: string, locationId?: string): Promise<Result<DiscountValidation, CimplifyError>>;
2519
+ search(query: string, options?: Omit<GetProductsOptions, "search">, opts?: ReadRequestOptions): Promise<Result<Product[], CimplifyError>>;
2520
+ searchProducts(query: string, options?: Omit<GetProductsOptions, "search">, opts?: ReadRequestOptions): Promise<Result<Product[], CimplifyError>>;
2521
+ getMenu(options?: {
2522
+ category?: string;
2523
+ limit?: number;
2524
+ }): Promise<Result<Product[], CimplifyError>>;
2525
+ getMenuCategory(categoryId: string): Promise<Result<Product[], CimplifyError>>;
2526
+ getMenuItem(itemId: string): Promise<Result<ProductWithDetails, CimplifyError>>;
2527
+ getTags(options?: {
2528
+ tag_group?: string;
2529
+ search?: string;
2530
+ min_usage?: number;
2531
+ limit?: number;
2532
+ offset?: number;
2533
+ }): Promise<Result<TagsResponse, CimplifyError>>;
2534
+ getAttributeDefinitions(namespace?: string): Promise<Result<CustomAttributeDefinition[], CimplifyError>>;
2535
+ getProductAttributes(productId: string): Promise<Result<CustomAttributeValue[], CimplifyError>>;
2536
+ getCategoryAttributes(categoryId: string): Promise<Result<CustomAttributeValue[], CimplifyError>>;
2537
+ getCollectionAttributes(collectionId: string): Promise<Result<CustomAttributeValue[], CimplifyError>>;
2538
+ getPropertyFacets(options?: {
2539
+ category_id?: string;
2540
+ product_type?: string;
2541
+ }): Promise<Result<PropertyFacet[], CimplifyError>>;
2542
+ getTaxonomyAttributes(taxonomyId: string): Promise<Result<TaxonomyAttributeTemplate[], CimplifyError>>;
2543
+ searchKnowledge(query: string, limit?: number): Promise<Result<KnowledgeArticle[], CimplifyError>>;
2544
+ getKnowledgeArticles(): Promise<Result<KnowledgeArticle[], CimplifyError>>;
2545
+ }
2546
+
2547
+ export { type CimplifyConfig as $, type ActivityRecommendation as A, type Booking as B, CimplifyClient as C, type BusinessWithLocations as D, type CancelBookingInput as E, type CancelBookingResult as F, type CancelOrderInput as G, type CancellationPolicy as H, type CardPopupAction as I, CartOperations as J, CatalogueQueries as K, type CatalogueResult as L, type CatalogueSnapshot as M, type CategoryInfo as N, type ChatAttachment as O, type PaymentAuthorizationAdapter as P, type ChatConversation as Q, type ReadRequestOptions as R, type ChatConversationResponse as S, type ChatMessage as T, type ChatReplyContext as U, type ChatUploadAttachment as V, type ChatWidgetStarter as W, type CheckSlotAvailabilityInput as X, type CheckSlotAvailabilityResult as Y, type CheckoutInput as Z, CheckoutService as _, type CacheOptions as a, type OrderGroupDetails as a$, CimplifyElement as a0, CimplifyElements as a1, type ClaimConversationResult as a2, type ClaimExternalChatsResult as a3, type ContentType as a4, type CustomerBooking as a5, type CustomerBookingServiceItem as a6, type CustomerServicePreferences as a7, type DayAvailability as a8, type DeliveryFeeDetails as a9, type GetOrdersOptions as aA, type GetProductsOptions as aB, type GroupOrderInfo as aC, HostedPurchaseIntentService as aD, InventoryService as aE, type LifecyclePhase as aF, type LineItem as aG, type LineType as aH, LinkService as aI, type LiteBootstrap as aJ, type LiteDayHours as aK, type LiteHoursRange as aL, LiteService as aM, type Location as aN, type LocationBooking as aO, type LocationTaxBehavior as aP, type LocationTaxOverrides as aQ, type LocationTimeProfile as aR, type LocationWithDetails as aS, type ObservabilityHooks as aT, type Ok as aU, type Order as aV, type OrderCustomerInfo as aW, type OrderDiscountInfo as aX, type OrderFilter as aY, type OrderFulfillmentSummary as aZ, type OrderGroup as a_, type DeliveryFeeResponse as aa, type DeliveryFeeStatus as ab, type DeliveryOption as ac, type DeliveryOptionsQuery as ad, type DeliveryOptionsResponse as ae, DeliveryService as af, type DepositResult as ag, type DismissMessageResponse as ah, type EnrichedOrder as ai, type EnrichedOrderItem as aj, type Err as ak, type ExternalChatClaimAttempt as al, type ExternalChatClaimDisposition as am, type FeeBearerType as an, type FetchQuoteInput as ao, type FulfillmentLink as ap, type FulfillmentStatus as aq, type FulfillmentSummaryDTO as ar, type FulfillmentType as as, type FxQuote as at, type FxQuoteRequest as au, type FxQuoteStatus as av, type FxRateResponse as aw, FxService as ax, type GetAvailableSlotsInput as ay, type GetDeliveryOptionsParams as az, type Result as b, type ResourceAssignment as b$, type OrderGroupPayment as b0, type OrderGroupPaymentState as b1, type OrderGroupPaymentStatus as b2, type OrderGroupPaymentSummary as b3, type OrderGroupStatus as b4, type OrderHistory as b5, type OrderLineState as b6, type OrderLineStatus as b7, type OrderLocationInfo as b8, type OrderPaymentEvent as b9, PurchaseIntentService as bA, type PurchaseIntentTransport as bB, type QuoteBundleSelectionInput as bC, type QuoteCompositeSelectionInput as bD, type QuoteDynamicBuckets as bE, type QuoteStatus as bF, type QuoteUiMessage as bG, type RefreshQuoteInput as bH, type RefreshQuoteResult as bI, type RefundOrderInput as bJ, type RelatedCandidate as bK, type RelatedProduct as bL, type RelatedProductsEnrichment as bM, type RelationType as bN, type ReminderMethod as bO, type ReminderSettings as bP, type ReorderResult as bQ, type RequestContext as bR, type RequestErrorEvent as bS, type RequestOptions as bT, type RequestRetryPolicy as bU, type RequestSource as bV, type RequestStartEvent as bW, type RequestSuccessEvent as bX, type RescheduleBookingInput as bY, type RescheduleBookingResult as bZ, type RescheduleHistoryRecord as b_, type OrderPricingView as ba, OrderQueries as bb, type OrderSplitDetail as bc, type OrderStaffInfo as bd, type OrderStatus as be, type OrderTimestampsDTO as bf, type Origin as bg, type OriginActor as bh, type OriginChannel as bi, type OtpResult as bj, PAYMENT_AUTHORIZATION_OUTCOME_STATUS as bk, PAYMENT_AUTHORIZATION_PROVIDER as bl, PURCHASE_INTENT_ROUTE as bm, PaymentAuthorizationAdapterRegistry as bn, type PaymentInfoDTO as bo, type PaymentState as bp, type PlaceDetailsResponse as bq, PlacesService as br, type PriceQuote as bs, type PricingOverrides as bt, type ProviderResolutionSource as bu, type PurchaseIntentActionDecision as bv, type PurchaseIntentRequestOptions as bw, type PurchaseIntentResolveOptions as bx, type PurchaseIntentResolveStatus as by, PurchaseIntentResolver as bz, type PaymentAuthorizationContext as c, type ResourceInfo as c0, type RetryEvent as c1, type Room as c2, SESSION_CHANGE_SOURCE as c3, type SchedulingMetadata as c4, type SchedulingResult as c5, SchedulingService as c6, type SenderType as c7, type Service as c8, type ServiceAvailabilityParams as c9, type TrackCategoryViewOptions as cA, type TrackProductViewOptions as cB, type UpdateOrderStatusInput as cC, type UpdateProfileInput as cD, type UploadInitResponse as cE, type UploadResult as cF, UploadService as cG, combine as cH, combineObject as cI, createCimplifyClient as cJ, createDefaultPaymentAuthorizationAdapterRegistry as cK, createElements as cL, err as cM, flatMap as cN, fromPromise as cO, getOrElse as cP, isErr as cQ, isOk as cR, mapError as cS, mapResult as cT, ok as cU, toNullable as cV, tryCatch as cW, unwrap as cX, type ServiceAvailabilityResult as ca, type ServiceCharge as cb, type ServiceNotes as cc, type ServiceScheduleRequest as cd, type ServiceStatus as ce, type SessionActivityData as cf, type SessionChangeEvent as cg, type SessionChangeSource as ch, type SessionMessage as ci, type SlotResourceInfo as cj, type SlotStaffInfo as ck, type Staff as cl, type StaffAssignment as cm, type StaffRole as cn, type StaffScheduleItem as co, type StockLevel as cp, type StockStatus as cq, type StoreCreditBalance as cr, StoreCreditQueries as cs, type StorefrontBootstrap as ct, SubscriptionService as cu, SupportService as cv, type Table as cw, type TimeRange as cx, type TimeRanges as cy, type TimeSlot as cz, type PaymentAuthorizationOutcome as d, type ChatReplyCard as e, type ActivityRecommendationsResponse as f, ActivityService as g, type ActivityStateResponse as h, type AmountToPay as i, AuthService as j, type AuthStatus as k, type AuthorizeCardPopupOptions as l, type AutocompletePrediction as m, type AutocompleteResponse as n, type AvailabilityResult as o, type AvailableSlot as p, type BookingModificationType as q, type BookingStatus as r, type BookingWithDetails as s, type BufferTimes as t, type Business as u, type BusinessDetailsDTO as v, type BusinessHours as w, type BusinessPreferences as x, BusinessService as y, type BusinessSettings as z };