@cimplify/sdk 0.31.0 → 0.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/advanced.d.mts +6 -2
  2. package/dist/advanced.d.ts +6 -2
  3. package/dist/advanced.js +21 -21
  4. package/dist/advanced.mjs +2 -2
  5. package/dist/{chunk-46BDUSJX.mjs → chunk-2X6P5WJZ.mjs} +108 -32
  6. package/dist/{chunk-E3HC2YAE.mjs → chunk-6TVQQYQ5.mjs} +14 -1
  7. package/dist/{chunk-2CGA3MUW.js → chunk-HKVRUGM6.js} +142 -91
  8. package/dist/{chunk-3J4PPSMI.mjs → chunk-TFHKVQLL.mjs} +123 -72
  9. package/dist/{chunk-PEDLCL72.js → chunk-V2O5AO7I.js} +15 -0
  10. package/dist/{chunk-6HCBOIZ4.js → chunk-ZYACIPKO.js} +160 -84
  11. package/dist/{index-BpyFcJVv.d.ts → client-CkGlXZRd.d.mts} +121 -72
  12. package/dist/{index-m8zGQUda.d.mts → client-lvLvB1_K.d.ts} +121 -72
  13. package/dist/{index-D4oNCc37.d.mts → index-CC1JPhB2.d.mts} +2 -2
  14. package/dist/{index-BHVJgyqM.d.ts → index-CPcFayQg.d.ts} +2 -2
  15. package/dist/index.d.mts +6 -5
  16. package/dist/index.d.ts +6 -5
  17. package/dist/index.js +117 -109
  18. package/dist/index.mjs +3 -3
  19. package/dist/mock/cli.mjs +8086 -0
  20. package/dist/mock/library.d.mts +15 -0
  21. package/dist/mock/library.d.ts +15 -0
  22. package/dist/mock/library.js +7285 -0
  23. package/dist/mock/library.mjs +7278 -0
  24. package/dist/mock/msw.d.mts +14 -0
  25. package/dist/mock/msw.d.ts +14 -0
  26. package/dist/mock/msw.js +7280 -0
  27. package/dist/mock/msw.mjs +7278 -0
  28. package/dist/{payment-DnU_eLuT.d.ts → payment-DA1i5hhk.d.mts} +13 -12
  29. package/dist/{payment-DnU_eLuT.d.mts → payment-DA1i5hhk.d.ts} +13 -12
  30. package/dist/{price-DUVmRTaz.d.ts → price-Bv4G8aOO.d.ts} +1 -1
  31. package/dist/{price-D-hso3np.d.mts → price-s1XN0edJ.d.mts} +1 -1
  32. package/dist/react.d.mts +21 -4
  33. package/dist/react.d.ts +21 -4
  34. package/dist/react.js +835 -715
  35. package/dist/react.mjs +725 -605
  36. package/dist/server-B8TeE2OD.d.mts +915 -0
  37. package/dist/server-B8TeE2OD.d.ts +915 -0
  38. package/dist/styles.css +1 -1
  39. package/dist/utils.d.mts +3 -3
  40. package/dist/utils.d.ts +3 -3
  41. package/dist/utils.js +28 -28
  42. package/dist/utils.mjs +1 -1
  43. package/package.json +32 -12
  44. package/registry/cart-summary.json +1 -1
@@ -77,7 +77,12 @@ declare class CimplifyError extends Error {
77
77
  constructor(code: string, message: string, retryable?: boolean, docs_url?: string | undefined, suggestion?: string | undefined);
78
78
  get userMessage(): string;
79
79
  }
80
+ declare class IdempotencyMismatchError extends CimplifyError {
81
+ originalCreatedAt: string;
82
+ constructor(message: string, originalCreatedAt: string);
83
+ }
80
84
  declare function isCimplifyError(error: unknown): error is CimplifyError;
85
+ declare function isIdempotencyMismatchError(error: unknown): error is IdempotencyMismatchError;
81
86
  declare function getErrorHint(code: string): ErrorHint | undefined;
82
87
  declare function enrichError(error: CimplifyError, options?: {
83
88
  isTestMode?: boolean;
@@ -540,10 +545,13 @@ interface UICart {
540
545
  pricing: UICartPricing;
541
546
  metadata?: Record<string, unknown>;
542
547
  }
543
- interface UICartResponse {
548
+ interface CartNotice {
549
+ kind: "info" | "warning";
550
+ text: string;
551
+ }
552
+ interface CartMutationResult {
544
553
  cart: UICart;
545
- cart_count: number;
546
- message?: string | null;
554
+ notice?: CartNotice;
547
555
  }
548
556
  interface AddToCartInput {
549
557
  item_id: string;
@@ -566,14 +574,7 @@ interface AddToCartInput {
566
574
  }
567
575
  interface UpdateCartItemInput {
568
576
  quantity?: number;
569
- variant_id?: string;
570
- add_on_options?: string[];
571
- notes?: string;
572
- bundle_selections?: BundleSelectionInput[];
573
- composite_selections?: ComponentSelectionInput[];
574
- scheduled_start?: string;
575
- scheduled_end?: string;
576
- staff_id?: string;
577
+ special_instructions?: string;
577
578
  }
578
579
  interface CartSummary {
579
580
  item_count: number;
@@ -1623,4 +1624,4 @@ interface SubmitAuthorizationInput {
1623
1624
  value: string;
1624
1625
  }
1625
1626
 
1626
- export { type SignatureValue as $, type ApiError as A, type AttributeValidationRules as B, type ChosenPrice as C, type DisplayMode as D, ErrorCode as E, type CustomAttributeDefinition as F, type CustomAttributeValue as G, type PropertySource as H, type InventoryType as I, type ProductProperty as J, type PropertyFacet as K, type FacetValue as L, type Money as M, type KnowledgeArticle as N, type Product as O, type PaginationParams as P, type InputFieldType as Q, RENDER_HINT as R, type SchedulingMode as S, type TaxonomyAttributeTemplate as T, INPUT_FIELD_TYPE as U, type VariantStrategy as V, type AddressValue as W, type PhoneValue as X, type DateRangeValue as Y, ZERO as Z, type LocationValue as _, type CurrencyCode as a, type CartStatus as a$, type InputFieldValidation as a0, type ProductInputField as a1, type CustomerInputValue as a2, type QuantityPricingTier as a3, type RelatedProductView as a4, type ProductWithDetails as a5, type VariantView as a6, type ProductVariant as a7, type VariantDisplayAttribute as a8, type VariantAxis as a9, type CompositePricingMode as aA, type GroupPricingBehavior as aB, type ComponentSourceType as aC, type Composite as aD, type CompositeWithDetails as aE, type ComponentGroup as aF, type ComponentGroupWithComponents as aG, type CompositeGroupView as aH, type CompositeComponentView as aI, type CompositeComponent as aJ, type ComponentSelectionInput as aK, type CompositePriceResult as aL, type ComponentPriceBreakdown as aM, type PriceEntryType as aN, type Price as aO, type LocationProductPrice as aP, type ProductAvailability as aQ, type ProductTimeProfile as aR, type ProductTaxonomy as aS, type TaxonomyWithChildren as aT, type ProductAvailabilityNow as aU, type DealBenefitType as aV, type Deal as aW, type ProductDealInfo as aX, type DiscountValidation as aY, type Tag as aZ, type TagsResponse as a_, type VariantAxisWithValues as aa, type VariantAxisValue as ab, type ProductVariantValue as ac, type VariantLocationAvailability as ad, type VariantAxisSelection as ae, type AddOn as af, type AddOnWithOptions as ag, type AddOnOption as ah, type AddOnOptionPrice as ai, type ProductAddOn as aj, type Category as ak, type CategorySummary as al, type Collection as am, type CollectionSummary as an, type CollectionProduct as ao, type BundlePriceType as ap, type Bundle as aq, type BundleSummary as ar, type BundleProduct as as, type BundleWithDetails as at, type BundleComponentData as au, type BundleComponentInfo as av, type BundleComponentView as aw, type BundleComponentVariantView as ax, type VariantAxisView as ay, type VariantAxisValueView as az, moneyFromNumber as b, type Subscription as b$, type CartChannel as b0, type PriceSource as b1, type AdjustmentType as b2, type PriceAdjustment as b3, type TaxPathComponent as b4, type PricePathTaxInfo as b5, type PriceDecisionPath as b6, type BenefitType as b7, type AppliedDiscount as b8, type DiscountBreakdown as b9, type VariantDetailsDTO as bA, type CartItemDetails as bB, type UICart as bC, type UICartResponse as bD, type AddToCartInput as bE, type UpdateCartItemInput as bF, type CartSummary as bG, type PaymentStatus as bH, type PaymentProvider as bI, type PaymentMethodType as bJ, type AddressAuthorizationData as bK, type AuthorizationType as bL, type PaymentProcessingState as bM, type PaymentMethod as bN, type Payment as bO, type InitializePaymentResult as bP, type PaymentResponse as bQ, type PaymentStatusResponse as bR, type PaymentErrorDetails as bS, type SubmitAuthorizationInput as bT, type BillingFrequency as bU, type BillingPlanType as bV, type BillingMarkupType as bW, type ProductBillingPlan as bX, type EligiblePlansQuery as bY, type FormattedPlanOption as bZ, type SubscriptionStatus as b_, type DiscountDetails as ba, type SelectedAddOnOption as bb, type AddOnDetails as bc, type CartAddOn as bd, type VariantDetails as be, type BundleSelectionInput as bf, type ComponentSchedulingData as bg, type BundleStoredSelection as bh, type BundleSelectionData as bi, type CompositeStoredSelection as bj, type CompositePriceBreakdown as bk, type CompositeSelectionData as bl, type LineConfiguration as bm, type Cart as bn, type CartItem as bo, type CartTotals as bp, type DisplayCart as bq, type DisplayCartItem as br, type DisplayAddOn as bs, type DisplayAddOnOption as bt, type UICartBusiness as bu, type UICartLocation as bv, type UICartCustomer as bw, type UICartPricing as bx, type AddOnOptionDetails as by, type AddOnGroupDetails as bz, currencyCode as c, type SubscriptionItem as c0, type SubscriptionInvoice as c1, type SubscriptionWithDetails as c2, type Pagination as d, type ErrorCodeType as e, type ErrorHint as f, ERROR_HINTS as g, CimplifyError as h, isSupportedCurrency as i, isCimplifyError as j, getErrorHint as k, enrichError as l, money as m, isRetryableError as n, type ProductType as o, PRODUCT_TYPE as p, type ProductRenderHint as q, type DigitalProductType as r, type DepositType as s, type DurationUnit as t, DURATION_UNIT as u, type SalesChannel as v, type AttributeType as w, type AttributeAppliesTo as x, type AttributeVisibility as y, type MeasurementValue as z };
1627
+ export { type DateRangeValue as $, type ApiError as A, type AttributeVisibility as B, type ChosenPrice as C, type DisplayMode as D, ErrorCode as E, type MeasurementValue as F, type AttributeValidationRules as G, type CustomAttributeDefinition as H, IdempotencyMismatchError as I, type CustomAttributeValue as J, type PropertySource as K, type ProductProperty as L, type Money as M, type PropertyFacet as N, type FacetValue as O, type PaginationParams as P, type KnowledgeArticle as Q, RENDER_HINT as R, type SchedulingMode as S, type TaxonomyAttributeTemplate as T, type Product as U, type VariantStrategy as V, type InputFieldType as W, INPUT_FIELD_TYPE as X, type AddressValue as Y, ZERO as Z, type PhoneValue as _, type CurrencyCode as a, type Tag as a$, type LocationValue as a0, type SignatureValue as a1, type InputFieldValidation as a2, type ProductInputField as a3, type CustomerInputValue as a4, type QuantityPricingTier as a5, type RelatedProductView as a6, type ProductWithDetails as a7, type VariantView as a8, type ProductVariant as a9, type VariantAxisView as aA, type VariantAxisValueView as aB, type CompositePricingMode as aC, type GroupPricingBehavior as aD, type ComponentSourceType as aE, type Composite as aF, type CompositeWithDetails as aG, type ComponentGroup as aH, type ComponentGroupWithComponents as aI, type CompositeGroupView as aJ, type CompositeComponentView as aK, type CompositeComponent as aL, type ComponentSelectionInput as aM, type CompositePriceResult as aN, type ComponentPriceBreakdown as aO, type PriceEntryType as aP, type Price as aQ, type LocationProductPrice as aR, type ProductAvailability as aS, type ProductTimeProfile as aT, type ProductTaxonomy as aU, type TaxonomyWithChildren as aV, type ProductAvailabilityNow as aW, type DealBenefitType as aX, type Deal as aY, type ProductDealInfo as aZ, type DiscountValidation as a_, type VariantDisplayAttribute as aa, type VariantAxis as ab, type VariantAxisWithValues as ac, type VariantAxisValue as ad, type ProductVariantValue as ae, type VariantLocationAvailability as af, type VariantAxisSelection as ag, type AddOn as ah, type AddOnWithOptions as ai, type AddOnOption as aj, type AddOnOptionPrice as ak, type ProductAddOn as al, type Category as am, type CategorySummary as an, type Collection as ao, type CollectionSummary as ap, type CollectionProduct as aq, type BundlePriceType as ar, type Bundle as as, type BundleSummary as at, type BundleProduct as au, type BundleWithDetails as av, type BundleComponentData as aw, type BundleComponentInfo as ax, type BundleComponentView as ay, type BundleComponentVariantView as az, moneyFromNumber as b, type EligiblePlansQuery as b$, type TagsResponse as b0, type CartStatus as b1, type CartChannel as b2, type PriceSource as b3, type AdjustmentType as b4, type PriceAdjustment as b5, type TaxPathComponent as b6, type PricePathTaxInfo as b7, type PriceDecisionPath as b8, type BenefitType as b9, type AddOnOptionDetails as bA, type AddOnGroupDetails as bB, type VariantDetailsDTO as bC, type CartItemDetails as bD, type UICart as bE, type CartNotice as bF, type CartMutationResult as bG, type AddToCartInput as bH, type UpdateCartItemInput as bI, type CartSummary as bJ, type PaymentStatus as bK, type PaymentProvider as bL, type PaymentMethodType as bM, type AddressAuthorizationData as bN, type AuthorizationType as bO, type PaymentProcessingState as bP, type PaymentMethod as bQ, type Payment as bR, type InitializePaymentResult as bS, type PaymentResponse as bT, type PaymentStatusResponse as bU, type PaymentErrorDetails as bV, type SubmitAuthorizationInput as bW, type BillingFrequency as bX, type BillingPlanType as bY, type BillingMarkupType as bZ, type ProductBillingPlan as b_, type AppliedDiscount as ba, type DiscountBreakdown as bb, type DiscountDetails as bc, type SelectedAddOnOption as bd, type AddOnDetails as be, type CartAddOn as bf, type VariantDetails as bg, type BundleSelectionInput as bh, type ComponentSchedulingData as bi, type BundleStoredSelection as bj, type BundleSelectionData as bk, type CompositeStoredSelection as bl, type CompositePriceBreakdown as bm, type CompositeSelectionData as bn, type LineConfiguration as bo, type Cart as bp, type CartItem as bq, type CartTotals as br, type DisplayCart as bs, type DisplayCartItem as bt, type DisplayAddOn as bu, type DisplayAddOnOption as bv, type UICartBusiness as bw, type UICartLocation as bx, type UICartCustomer as by, type UICartPricing as bz, currencyCode as c, type FormattedPlanOption as c0, type SubscriptionStatus as c1, type Subscription as c2, type SubscriptionItem as c3, type SubscriptionInvoice as c4, type SubscriptionWithDetails as c5, type Pagination as d, type ErrorCodeType as e, type ErrorHint as f, ERROR_HINTS as g, CimplifyError as h, isSupportedCurrency as i, isCimplifyError as j, isIdempotencyMismatchError as k, getErrorHint as l, money as m, enrichError as n, isRetryableError as o, type ProductType as p, PRODUCT_TYPE as q, type ProductRenderHint as r, type InventoryType as s, type DigitalProductType as t, type DepositType as u, type DurationUnit as v, DURATION_UNIT as w, type SalesChannel as x, type AttributeType as y, type AttributeAppliesTo as z };
@@ -77,7 +77,12 @@ declare class CimplifyError extends Error {
77
77
  constructor(code: string, message: string, retryable?: boolean, docs_url?: string | undefined, suggestion?: string | undefined);
78
78
  get userMessage(): string;
79
79
  }
80
+ declare class IdempotencyMismatchError extends CimplifyError {
81
+ originalCreatedAt: string;
82
+ constructor(message: string, originalCreatedAt: string);
83
+ }
80
84
  declare function isCimplifyError(error: unknown): error is CimplifyError;
85
+ declare function isIdempotencyMismatchError(error: unknown): error is IdempotencyMismatchError;
81
86
  declare function getErrorHint(code: string): ErrorHint | undefined;
82
87
  declare function enrichError(error: CimplifyError, options?: {
83
88
  isTestMode?: boolean;
@@ -540,10 +545,13 @@ interface UICart {
540
545
  pricing: UICartPricing;
541
546
  metadata?: Record<string, unknown>;
542
547
  }
543
- interface UICartResponse {
548
+ interface CartNotice {
549
+ kind: "info" | "warning";
550
+ text: string;
551
+ }
552
+ interface CartMutationResult {
544
553
  cart: UICart;
545
- cart_count: number;
546
- message?: string | null;
554
+ notice?: CartNotice;
547
555
  }
548
556
  interface AddToCartInput {
549
557
  item_id: string;
@@ -566,14 +574,7 @@ interface AddToCartInput {
566
574
  }
567
575
  interface UpdateCartItemInput {
568
576
  quantity?: number;
569
- variant_id?: string;
570
- add_on_options?: string[];
571
- notes?: string;
572
- bundle_selections?: BundleSelectionInput[];
573
- composite_selections?: ComponentSelectionInput[];
574
- scheduled_start?: string;
575
- scheduled_end?: string;
576
- staff_id?: string;
577
+ special_instructions?: string;
577
578
  }
578
579
  interface CartSummary {
579
580
  item_count: number;
@@ -1623,4 +1624,4 @@ interface SubmitAuthorizationInput {
1623
1624
  value: string;
1624
1625
  }
1625
1626
 
1626
- export { type SignatureValue as $, type ApiError as A, type AttributeValidationRules as B, type ChosenPrice as C, type DisplayMode as D, ErrorCode as E, type CustomAttributeDefinition as F, type CustomAttributeValue as G, type PropertySource as H, type InventoryType as I, type ProductProperty as J, type PropertyFacet as K, type FacetValue as L, type Money as M, type KnowledgeArticle as N, type Product as O, type PaginationParams as P, type InputFieldType as Q, RENDER_HINT as R, type SchedulingMode as S, type TaxonomyAttributeTemplate as T, INPUT_FIELD_TYPE as U, type VariantStrategy as V, type AddressValue as W, type PhoneValue as X, type DateRangeValue as Y, ZERO as Z, type LocationValue as _, type CurrencyCode as a, type CartStatus as a$, type InputFieldValidation as a0, type ProductInputField as a1, type CustomerInputValue as a2, type QuantityPricingTier as a3, type RelatedProductView as a4, type ProductWithDetails as a5, type VariantView as a6, type ProductVariant as a7, type VariantDisplayAttribute as a8, type VariantAxis as a9, type CompositePricingMode as aA, type GroupPricingBehavior as aB, type ComponentSourceType as aC, type Composite as aD, type CompositeWithDetails as aE, type ComponentGroup as aF, type ComponentGroupWithComponents as aG, type CompositeGroupView as aH, type CompositeComponentView as aI, type CompositeComponent as aJ, type ComponentSelectionInput as aK, type CompositePriceResult as aL, type ComponentPriceBreakdown as aM, type PriceEntryType as aN, type Price as aO, type LocationProductPrice as aP, type ProductAvailability as aQ, type ProductTimeProfile as aR, type ProductTaxonomy as aS, type TaxonomyWithChildren as aT, type ProductAvailabilityNow as aU, type DealBenefitType as aV, type Deal as aW, type ProductDealInfo as aX, type DiscountValidation as aY, type Tag as aZ, type TagsResponse as a_, type VariantAxisWithValues as aa, type VariantAxisValue as ab, type ProductVariantValue as ac, type VariantLocationAvailability as ad, type VariantAxisSelection as ae, type AddOn as af, type AddOnWithOptions as ag, type AddOnOption as ah, type AddOnOptionPrice as ai, type ProductAddOn as aj, type Category as ak, type CategorySummary as al, type Collection as am, type CollectionSummary as an, type CollectionProduct as ao, type BundlePriceType as ap, type Bundle as aq, type BundleSummary as ar, type BundleProduct as as, type BundleWithDetails as at, type BundleComponentData as au, type BundleComponentInfo as av, type BundleComponentView as aw, type BundleComponentVariantView as ax, type VariantAxisView as ay, type VariantAxisValueView as az, moneyFromNumber as b, type Subscription as b$, type CartChannel as b0, type PriceSource as b1, type AdjustmentType as b2, type PriceAdjustment as b3, type TaxPathComponent as b4, type PricePathTaxInfo as b5, type PriceDecisionPath as b6, type BenefitType as b7, type AppliedDiscount as b8, type DiscountBreakdown as b9, type VariantDetailsDTO as bA, type CartItemDetails as bB, type UICart as bC, type UICartResponse as bD, type AddToCartInput as bE, type UpdateCartItemInput as bF, type CartSummary as bG, type PaymentStatus as bH, type PaymentProvider as bI, type PaymentMethodType as bJ, type AddressAuthorizationData as bK, type AuthorizationType as bL, type PaymentProcessingState as bM, type PaymentMethod as bN, type Payment as bO, type InitializePaymentResult as bP, type PaymentResponse as bQ, type PaymentStatusResponse as bR, type PaymentErrorDetails as bS, type SubmitAuthorizationInput as bT, type BillingFrequency as bU, type BillingPlanType as bV, type BillingMarkupType as bW, type ProductBillingPlan as bX, type EligiblePlansQuery as bY, type FormattedPlanOption as bZ, type SubscriptionStatus as b_, type DiscountDetails as ba, type SelectedAddOnOption as bb, type AddOnDetails as bc, type CartAddOn as bd, type VariantDetails as be, type BundleSelectionInput as bf, type ComponentSchedulingData as bg, type BundleStoredSelection as bh, type BundleSelectionData as bi, type CompositeStoredSelection as bj, type CompositePriceBreakdown as bk, type CompositeSelectionData as bl, type LineConfiguration as bm, type Cart as bn, type CartItem as bo, type CartTotals as bp, type DisplayCart as bq, type DisplayCartItem as br, type DisplayAddOn as bs, type DisplayAddOnOption as bt, type UICartBusiness as bu, type UICartLocation as bv, type UICartCustomer as bw, type UICartPricing as bx, type AddOnOptionDetails as by, type AddOnGroupDetails as bz, currencyCode as c, type SubscriptionItem as c0, type SubscriptionInvoice as c1, type SubscriptionWithDetails as c2, type Pagination as d, type ErrorCodeType as e, type ErrorHint as f, ERROR_HINTS as g, CimplifyError as h, isSupportedCurrency as i, isCimplifyError as j, getErrorHint as k, enrichError as l, money as m, isRetryableError as n, type ProductType as o, PRODUCT_TYPE as p, type ProductRenderHint as q, type DigitalProductType as r, type DepositType as s, type DurationUnit as t, DURATION_UNIT as u, type SalesChannel as v, type AttributeType as w, type AttributeAppliesTo as x, type AttributeVisibility as y, type MeasurementValue as z };
1627
+ export { type DateRangeValue as $, type ApiError as A, type AttributeVisibility as B, type ChosenPrice as C, type DisplayMode as D, ErrorCode as E, type MeasurementValue as F, type AttributeValidationRules as G, type CustomAttributeDefinition as H, IdempotencyMismatchError as I, type CustomAttributeValue as J, type PropertySource as K, type ProductProperty as L, type Money as M, type PropertyFacet as N, type FacetValue as O, type PaginationParams as P, type KnowledgeArticle as Q, RENDER_HINT as R, type SchedulingMode as S, type TaxonomyAttributeTemplate as T, type Product as U, type VariantStrategy as V, type InputFieldType as W, INPUT_FIELD_TYPE as X, type AddressValue as Y, ZERO as Z, type PhoneValue as _, type CurrencyCode as a, type Tag as a$, type LocationValue as a0, type SignatureValue as a1, type InputFieldValidation as a2, type ProductInputField as a3, type CustomerInputValue as a4, type QuantityPricingTier as a5, type RelatedProductView as a6, type ProductWithDetails as a7, type VariantView as a8, type ProductVariant as a9, type VariantAxisView as aA, type VariantAxisValueView as aB, type CompositePricingMode as aC, type GroupPricingBehavior as aD, type ComponentSourceType as aE, type Composite as aF, type CompositeWithDetails as aG, type ComponentGroup as aH, type ComponentGroupWithComponents as aI, type CompositeGroupView as aJ, type CompositeComponentView as aK, type CompositeComponent as aL, type ComponentSelectionInput as aM, type CompositePriceResult as aN, type ComponentPriceBreakdown as aO, type PriceEntryType as aP, type Price as aQ, type LocationProductPrice as aR, type ProductAvailability as aS, type ProductTimeProfile as aT, type ProductTaxonomy as aU, type TaxonomyWithChildren as aV, type ProductAvailabilityNow as aW, type DealBenefitType as aX, type Deal as aY, type ProductDealInfo as aZ, type DiscountValidation as a_, type VariantDisplayAttribute as aa, type VariantAxis as ab, type VariantAxisWithValues as ac, type VariantAxisValue as ad, type ProductVariantValue as ae, type VariantLocationAvailability as af, type VariantAxisSelection as ag, type AddOn as ah, type AddOnWithOptions as ai, type AddOnOption as aj, type AddOnOptionPrice as ak, type ProductAddOn as al, type Category as am, type CategorySummary as an, type Collection as ao, type CollectionSummary as ap, type CollectionProduct as aq, type BundlePriceType as ar, type Bundle as as, type BundleSummary as at, type BundleProduct as au, type BundleWithDetails as av, type BundleComponentData as aw, type BundleComponentInfo as ax, type BundleComponentView as ay, type BundleComponentVariantView as az, moneyFromNumber as b, type EligiblePlansQuery as b$, type TagsResponse as b0, type CartStatus as b1, type CartChannel as b2, type PriceSource as b3, type AdjustmentType as b4, type PriceAdjustment as b5, type TaxPathComponent as b6, type PricePathTaxInfo as b7, type PriceDecisionPath as b8, type BenefitType as b9, type AddOnOptionDetails as bA, type AddOnGroupDetails as bB, type VariantDetailsDTO as bC, type CartItemDetails as bD, type UICart as bE, type CartNotice as bF, type CartMutationResult as bG, type AddToCartInput as bH, type UpdateCartItemInput as bI, type CartSummary as bJ, type PaymentStatus as bK, type PaymentProvider as bL, type PaymentMethodType as bM, type AddressAuthorizationData as bN, type AuthorizationType as bO, type PaymentProcessingState as bP, type PaymentMethod as bQ, type Payment as bR, type InitializePaymentResult as bS, type PaymentResponse as bT, type PaymentStatusResponse as bU, type PaymentErrorDetails as bV, type SubmitAuthorizationInput as bW, type BillingFrequency as bX, type BillingPlanType as bY, type BillingMarkupType as bZ, type ProductBillingPlan as b_, type AppliedDiscount as ba, type DiscountBreakdown as bb, type DiscountDetails as bc, type SelectedAddOnOption as bd, type AddOnDetails as be, type CartAddOn as bf, type VariantDetails as bg, type BundleSelectionInput as bh, type ComponentSchedulingData as bi, type BundleStoredSelection as bj, type BundleSelectionData as bk, type CompositeStoredSelection as bl, type CompositePriceBreakdown as bm, type CompositeSelectionData as bn, type LineConfiguration as bo, type Cart as bp, type CartItem as bq, type CartTotals as br, type DisplayCart as bs, type DisplayCartItem as bt, type DisplayAddOn as bu, type DisplayAddOnOption as bv, type UICartBusiness as bw, type UICartLocation as bx, type UICartCustomer as by, type UICartPricing as bz, currencyCode as c, type FormattedPlanOption as c0, type SubscriptionStatus as c1, type Subscription as c2, type SubscriptionItem as c3, type SubscriptionInvoice as c4, type SubscriptionWithDetails as c5, type Pagination as d, type ErrorCodeType as e, type ErrorHint as f, ERROR_HINTS as g, CimplifyError as h, isSupportedCurrency as i, isCimplifyError as j, isIdempotencyMismatchError as k, getErrorHint as l, money as m, enrichError as n, isRetryableError as o, type ProductType as p, PRODUCT_TYPE as q, type ProductRenderHint as r, type InventoryType as s, type DigitalProductType as t, type DepositType as u, type DurationUnit as v, DURATION_UNIT as w, type SalesChannel as x, type AttributeType as y, type AttributeAppliesTo as z };
@@ -1,4 +1,4 @@
1
- import { C as ChosenPrice, a as CurrencyCode } from './payment-DnU_eLuT.js';
1
+ import { C as ChosenPrice, a as CurrencyCode } from './payment-DA1i5hhk.js';
2
2
 
3
3
  interface ProductWithPrice {
4
4
  price_info?: ChosenPrice;
@@ -1,4 +1,4 @@
1
- import { C as ChosenPrice, a as CurrencyCode } from './payment-DnU_eLuT.mjs';
1
+ import { C as ChosenPrice, a as CurrencyCode } from './payment-DA1i5hhk.mjs';
2
2
 
3
3
  interface ProductWithPrice {
4
4
  price_info?: ChosenPrice;
package/dist/react.d.mts CHANGED
@@ -1,9 +1,9 @@
1
1
  import React$1, { ReactNode } from 'react';
2
2
  import { A as AdSlot, a as AdPosition, e as AdContextValue } from './ads-BxbWrwqp.mjs';
3
3
  export { c as AdConfig, g as getVariantDisplayName } from './ads-BxbWrwqp.mjs';
4
- import { C as CimplifyClient, ao as ProcessCheckoutResult, aq as CheckoutStatus, ar as CheckoutStatusContext, b_ as Location, bX as Business, k as ReorderResult, b5 as OrderStatus, bi as Order, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, P as PriceQuote, g as QuoteUiMessage, cb as Service, cg as AvailableSlot, ch as DayAvailability, cm as CustomerBooking, cs as CancelBookingResult, K as ActivityStateResponse, H as SessionMessage, M as ActivityRecommendation, X as DeliveryFeeResponse, d4 as FxRateResponse, c5 as StorefrontBootstrap, a1 as ChatWidgetStarter, Z as ChatMessage, ac as ElementsOptions, di as AuthenticatedData, de as AddressInfo, df as PaymentMethodInfo, a6 as CimplifyElements, dk as ElementsCheckoutResult, an as ProcessCheckoutOptions, bh as LineItem, cc as Staff, c3 as Room } from './index-m8zGQUda.mjs';
5
- import { a as CurrencyCode, O as Product, d as Pagination, h as CimplifyError, a5 as ProductWithDetails, ak as Category, M as Money, bf as BundleSelectionInput, aK as ComponentSelectionInput, bi as BundleSelectionData, bl as CompositeSelectionData, am as Collection, aS as ProductTaxonomy, aT as TaxonomyWithChildren, aR as ProductTimeProfile, aW as Deal, aX as ProductDealInfo, aY as DiscountValidation, ar as BundleSummary, aL as CompositePriceResult, b_ as SubscriptionStatus, b$ as Subscription, c2 as SubscriptionWithDetails, F as CustomAttributeDefinition, K as PropertyFacet, bX as ProductBillingPlan, a6 as VariantView, aa as VariantAxisWithValues, ag as AddOnWithOptions, aw as BundleComponentView, ap as BundlePriceType, aH as CompositeGroupView, bq as DisplayCart, a1 as ProductInputField, G as CustomAttributeValue, J as ProductProperty, a3 as QuantityPricingTier } from './payment-DnU_eLuT.mjs';
6
- import { P as ProductWithPrice } from './price-D-hso3np.mjs';
4
+ import { C as CimplifyClient, an as ProcessCheckoutResult, ap as CheckoutStatus, aq as CheckoutStatusContext, bZ as Location, bW as Business, k as ReorderResult, b4 as OrderStatus, bh as Order, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, P as PriceQuote, g as QuoteUiMessage, ca as Service, cf as AvailableSlot, cg as DayAvailability, cl as CustomerBooking, cr as CancelBookingResult, J as ActivityStateResponse, E as SessionMessage, K as ActivityRecommendation, W as DeliveryFeeResponse, d0 as FxRateResponse, c4 as StorefrontBootstrap, a0 as ChatWidgetStarter, Y as ChatMessage, ab as ElementsOptions, de as AuthenticatedData, da as AddressInfo, db as PaymentMethodInfo, a5 as CimplifyElements, dg as ElementsCheckoutResult, am as ProcessCheckoutOptions, bg as LineItem, cb as Staff, c2 as Room } from './client-CkGlXZRd.mjs';
5
+ import { a as CurrencyCode, U as Product, d as Pagination, h as CimplifyError, a7 as ProductWithDetails, am as Category, M as Money, bh as BundleSelectionInput, aM as ComponentSelectionInput, bk as BundleSelectionData, bn as CompositeSelectionData, ao as Collection, aU as ProductTaxonomy, aV as TaxonomyWithChildren, aT as ProductTimeProfile, aY as Deal, aZ as ProductDealInfo, a_ as DiscountValidation, at as BundleSummary, aN as CompositePriceResult, c1 as SubscriptionStatus, c2 as Subscription, c5 as SubscriptionWithDetails, H as CustomAttributeDefinition, N as PropertyFacet, b_ as ProductBillingPlan, a8 as VariantView, ac as VariantAxisWithValues, ai as AddOnWithOptions, ay as BundleComponentView, ar as BundlePriceType, aJ as CompositeGroupView, bs as DisplayCart, a3 as ProductInputField, J as CustomAttributeValue, L as ProductProperty, a5 as QuantityPricingTier } from './payment-DA1i5hhk.mjs';
6
+ import { P as ProductWithPrice } from './price-s1XN0edJ.mjs';
7
7
  import { ClassValue } from 'clsx';
8
8
  import * as react_jsx_runtime from 'react/jsx-runtime';
9
9
 
@@ -136,6 +136,13 @@ interface CimplifyClientContextValue {
136
136
  isDemoMode: boolean;
137
137
  /** The business's pricing currency (always the base, for API calls). */
138
138
  baseCurrency: string;
139
+ /**
140
+ * When false, collection-backed hooks (`useCart`, etc.) skip optimistic
141
+ * updates and fall back to fire-and-refetch. Default true. Mainly useful
142
+ * for e2e test environments where deterministic UI is preferred over
143
+ * perceived speed.
144
+ */
145
+ optimistic: boolean;
139
146
  }
140
147
  interface CimplifyStateContextValue {
141
148
  currentLocation: Location | null;
@@ -155,8 +162,13 @@ interface CimplifyProviderProps {
155
162
  client?: CimplifyClient;
156
163
  children: ReactNode;
157
164
  onLocationChange?: (location: Location) => void;
165
+ /**
166
+ * Toggle hidden optimistic UI for collection-backed hooks. Default true.
167
+ * Set to false to disable optimistic updates app-wide (e.g. e2e tests).
168
+ */
169
+ optimistic?: boolean;
158
170
  }
159
- declare function CimplifyProvider({ client, children, onLocationChange, }: CimplifyProviderProps): React$1.ReactElement;
171
+ declare function CimplifyProvider({ client, children, onLocationChange, optimistic, }: CimplifyProviderProps): React$1.ReactElement;
160
172
  declare function useCimplify(): CimplifyContextValue;
161
173
  declare function useOptionalCimplify(): CimplifyContextValue | null;
162
174
  declare function useCimplifyClient(): CimplifyClientContextValue;
@@ -271,6 +283,7 @@ interface AddToCartOptions {
271
283
  value: unknown;
272
284
  }>;
273
285
  }
286
+
274
287
  interface UseCartOptions {
275
288
  client?: CimplifyClient;
276
289
  demoMode?: boolean;
@@ -286,6 +299,10 @@ interface UseCartResult {
286
299
  currency: string;
287
300
  isEmpty: boolean;
288
301
  isLoading: boolean;
302
+ /** Any pending optimistic op is in flight. */
303
+ isOptimistic: boolean;
304
+ /** Number of pending ops contributing to the rendered view. */
305
+ pendingOpCount: number;
289
306
  addItem: (product: Product, quantity?: number, options?: AddToCartOptions) => Promise<void>;
290
307
  removeItem: (itemId: string) => Promise<void>;
291
308
  updateQuantity: (itemId: string, quantity: number) => Promise<void>;
package/dist/react.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import React$1, { ReactNode } from 'react';
2
2
  import { A as AdSlot, a as AdPosition, e as AdContextValue } from './ads-BxbWrwqp.js';
3
3
  export { c as AdConfig, g as getVariantDisplayName } from './ads-BxbWrwqp.js';
4
- import { C as CimplifyClient, ao as ProcessCheckoutResult, aq as CheckoutStatus, ar as CheckoutStatusContext, b_ as Location, bX as Business, k as ReorderResult, b5 as OrderStatus, bi as Order, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, P as PriceQuote, g as QuoteUiMessage, cb as Service, cg as AvailableSlot, ch as DayAvailability, cm as CustomerBooking, cs as CancelBookingResult, K as ActivityStateResponse, H as SessionMessage, M as ActivityRecommendation, X as DeliveryFeeResponse, d4 as FxRateResponse, c5 as StorefrontBootstrap, a1 as ChatWidgetStarter, Z as ChatMessage, ac as ElementsOptions, di as AuthenticatedData, de as AddressInfo, df as PaymentMethodInfo, a6 as CimplifyElements, dk as ElementsCheckoutResult, an as ProcessCheckoutOptions, bh as LineItem, cc as Staff, c3 as Room } from './index-BpyFcJVv.js';
5
- import { a as CurrencyCode, O as Product, d as Pagination, h as CimplifyError, a5 as ProductWithDetails, ak as Category, M as Money, bf as BundleSelectionInput, aK as ComponentSelectionInput, bi as BundleSelectionData, bl as CompositeSelectionData, am as Collection, aS as ProductTaxonomy, aT as TaxonomyWithChildren, aR as ProductTimeProfile, aW as Deal, aX as ProductDealInfo, aY as DiscountValidation, ar as BundleSummary, aL as CompositePriceResult, b_ as SubscriptionStatus, b$ as Subscription, c2 as SubscriptionWithDetails, F as CustomAttributeDefinition, K as PropertyFacet, bX as ProductBillingPlan, a6 as VariantView, aa as VariantAxisWithValues, ag as AddOnWithOptions, aw as BundleComponentView, ap as BundlePriceType, aH as CompositeGroupView, bq as DisplayCart, a1 as ProductInputField, G as CustomAttributeValue, J as ProductProperty, a3 as QuantityPricingTier } from './payment-DnU_eLuT.js';
6
- import { P as ProductWithPrice } from './price-DUVmRTaz.js';
4
+ import { C as CimplifyClient, an as ProcessCheckoutResult, ap as CheckoutStatus, aq as CheckoutStatusContext, bZ as Location, bW as Business, k as ReorderResult, b4 as OrderStatus, bh as Order, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, P as PriceQuote, g as QuoteUiMessage, ca as Service, cf as AvailableSlot, cg as DayAvailability, cl as CustomerBooking, cr as CancelBookingResult, J as ActivityStateResponse, E as SessionMessage, K as ActivityRecommendation, W as DeliveryFeeResponse, d0 as FxRateResponse, c4 as StorefrontBootstrap, a0 as ChatWidgetStarter, Y as ChatMessage, ab as ElementsOptions, de as AuthenticatedData, da as AddressInfo, db as PaymentMethodInfo, a5 as CimplifyElements, dg as ElementsCheckoutResult, am as ProcessCheckoutOptions, bg as LineItem, cb as Staff, c2 as Room } from './client-lvLvB1_K.js';
5
+ import { a as CurrencyCode, U as Product, d as Pagination, h as CimplifyError, a7 as ProductWithDetails, am as Category, M as Money, bh as BundleSelectionInput, aM as ComponentSelectionInput, bk as BundleSelectionData, bn as CompositeSelectionData, ao as Collection, aU as ProductTaxonomy, aV as TaxonomyWithChildren, aT as ProductTimeProfile, aY as Deal, aZ as ProductDealInfo, a_ as DiscountValidation, at as BundleSummary, aN as CompositePriceResult, c1 as SubscriptionStatus, c2 as Subscription, c5 as SubscriptionWithDetails, H as CustomAttributeDefinition, N as PropertyFacet, b_ as ProductBillingPlan, a8 as VariantView, ac as VariantAxisWithValues, ai as AddOnWithOptions, ay as BundleComponentView, ar as BundlePriceType, aJ as CompositeGroupView, bs as DisplayCart, a3 as ProductInputField, J as CustomAttributeValue, L as ProductProperty, a5 as QuantityPricingTier } from './payment-DA1i5hhk.js';
6
+ import { P as ProductWithPrice } from './price-Bv4G8aOO.js';
7
7
  import { ClassValue } from 'clsx';
8
8
  import * as react_jsx_runtime from 'react/jsx-runtime';
9
9
 
@@ -136,6 +136,13 @@ interface CimplifyClientContextValue {
136
136
  isDemoMode: boolean;
137
137
  /** The business's pricing currency (always the base, for API calls). */
138
138
  baseCurrency: string;
139
+ /**
140
+ * When false, collection-backed hooks (`useCart`, etc.) skip optimistic
141
+ * updates and fall back to fire-and-refetch. Default true. Mainly useful
142
+ * for e2e test environments where deterministic UI is preferred over
143
+ * perceived speed.
144
+ */
145
+ optimistic: boolean;
139
146
  }
140
147
  interface CimplifyStateContextValue {
141
148
  currentLocation: Location | null;
@@ -155,8 +162,13 @@ interface CimplifyProviderProps {
155
162
  client?: CimplifyClient;
156
163
  children: ReactNode;
157
164
  onLocationChange?: (location: Location) => void;
165
+ /**
166
+ * Toggle hidden optimistic UI for collection-backed hooks. Default true.
167
+ * Set to false to disable optimistic updates app-wide (e.g. e2e tests).
168
+ */
169
+ optimistic?: boolean;
158
170
  }
159
- declare function CimplifyProvider({ client, children, onLocationChange, }: CimplifyProviderProps): React$1.ReactElement;
171
+ declare function CimplifyProvider({ client, children, onLocationChange, optimistic, }: CimplifyProviderProps): React$1.ReactElement;
160
172
  declare function useCimplify(): CimplifyContextValue;
161
173
  declare function useOptionalCimplify(): CimplifyContextValue | null;
162
174
  declare function useCimplifyClient(): CimplifyClientContextValue;
@@ -271,6 +283,7 @@ interface AddToCartOptions {
271
283
  value: unknown;
272
284
  }>;
273
285
  }
286
+
274
287
  interface UseCartOptions {
275
288
  client?: CimplifyClient;
276
289
  demoMode?: boolean;
@@ -286,6 +299,10 @@ interface UseCartResult {
286
299
  currency: string;
287
300
  isEmpty: boolean;
288
301
  isLoading: boolean;
302
+ /** Any pending optimistic op is in flight. */
303
+ isOptimistic: boolean;
304
+ /** Number of pending ops contributing to the rendered view. */
305
+ pendingOpCount: number;
289
306
  addItem: (product: Product, quantity?: number, options?: AddToCartOptions) => Promise<void>;
290
307
  removeItem: (itemId: string) => Promise<void>;
291
308
  updateQuantity: (itemId: string, quantity: number) => Promise<void>;