@cimplify/sdk 0.31.0 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/advanced.d.mts +6 -2
- package/dist/advanced.d.ts +6 -2
- package/dist/advanced.js +21 -21
- package/dist/advanced.mjs +2 -2
- package/dist/{chunk-46BDUSJX.mjs → chunk-2X6P5WJZ.mjs} +108 -32
- package/dist/{chunk-E3HC2YAE.mjs → chunk-6TVQQYQ5.mjs} +14 -1
- package/dist/{chunk-2CGA3MUW.js → chunk-HKVRUGM6.js} +142 -91
- package/dist/{chunk-3J4PPSMI.mjs → chunk-TFHKVQLL.mjs} +123 -72
- package/dist/{chunk-PEDLCL72.js → chunk-V2O5AO7I.js} +15 -0
- package/dist/{chunk-6HCBOIZ4.js → chunk-ZYACIPKO.js} +160 -84
- package/dist/{index-BpyFcJVv.d.ts → client-CkGlXZRd.d.mts} +121 -72
- package/dist/{index-m8zGQUda.d.mts → client-lvLvB1_K.d.ts} +121 -72
- package/dist/{index-D4oNCc37.d.mts → index-CC1JPhB2.d.mts} +2 -2
- package/dist/{index-BHVJgyqM.d.ts → index-CPcFayQg.d.ts} +2 -2
- package/dist/index.d.mts +6 -5
- package/dist/index.d.ts +6 -5
- package/dist/index.js +117 -109
- package/dist/index.mjs +3 -3
- package/dist/{payment-DnU_eLuT.d.ts → payment-DA1i5hhk.d.mts} +13 -12
- package/dist/{payment-DnU_eLuT.d.mts → payment-DA1i5hhk.d.ts} +13 -12
- package/dist/{price-DUVmRTaz.d.ts → price-Bv4G8aOO.d.ts} +1 -1
- package/dist/{price-D-hso3np.d.mts → price-s1XN0edJ.d.mts} +1 -1
- package/dist/react.d.mts +21 -4
- package/dist/react.d.ts +21 -4
- package/dist/react.js +835 -715
- package/dist/react.mjs +725 -605
- package/dist/styles.css +1 -1
- package/dist/utils.d.mts +3 -3
- package/dist/utils.d.ts +3 -3
- package/dist/utils.js +28 -28
- package/dist/utils.mjs +1 -1
- package/package.json +8 -8
- package/registry/cart-summary.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ActivityService, CimplifyClient, DURATION_UNIT, DeliveryService, INPUT_FIELD_TYPE, PRODUCT_TYPE, PlacesService, RENDER_HINT, SubscriptionService, SupportService, UploadService, createCimplifyClient, getVariantDisplayName } from './chunk-
|
|
1
|
+
export { ActivityService, CimplifyClient, DURATION_UNIT, DeliveryService, INPUT_FIELD_TYPE, PRODUCT_TYPE, PlacesService, RENDER_HINT, SubscriptionService, SupportService, UploadService, createCimplifyClient, getVariantDisplayName } from './chunk-2X6P5WJZ.mjs';
|
|
2
2
|
export { isValidPhoneForContext, normalizePhoneToE164, resolvePhoneCountryCode } from './chunk-YOIVZ6OA.mjs';
|
|
3
|
-
export { AUTHORIZATION_TYPE, AUTH_MUTATION, AuthService, BusinessService, CHECKOUT_MODE, CHECKOUT_MUTATION, CHECKOUT_STEP, CONTACT_TYPE, CartOperations, CatalogueQueries, CheckoutService as CheckoutOperations, CheckoutService, CimplifyElement, CimplifyElements, DEFAULT_COUNTRY, DEFAULT_CURRENCY, DEVICE_TYPE, ELEMENT_TYPES, EVENT_TYPES, FxService, InventoryService, LINK_MUTATION, LINK_QUERY, LinkService, LiteService, MESSAGE_TYPES, MOBILE_MONEY_PROVIDER, ORDER_MUTATION, ORDER_TYPE, OrderQueries, PAYMENT_METHOD, PAYMENT_MUTATION, PAYMENT_STATE, PICKUP_TIME_TYPE, SchedulingService, combine, combineObject, createElements, err, flatMap, fromPromise, generateIdempotencyKey, getOrElse, isErr, isOk, mapError, mapResult, ok, toNullable, tryCatch, unwrap } from './chunk-
|
|
4
|
-
export { CURRENCY_SYMBOLS, CimplifyError, ERROR_HINTS, ErrorCode, MOBILE_MONEY_PROVIDERS, ZERO, categorizePaymentError, currencyCode, detectMobileMoneyProvider, enrichError, formatMoney, formatNumberCompact, formatPrice, formatPriceAdjustment, formatPriceCompact, formatPriceRange, formatPriceWithTax, formatProductPrice, getBasePrice, getCurrencySymbol, getDiscountPercentage, getDisplayPrice, getErrorHint, getMarkupPercentage, getPriceRange, getProductCurrency, getTaxAmount, getUnitPriceAtQuantity, hasTaxInfo, isCimplifyError, isOnSale, isPaymentStatusFailure, isPaymentStatusRequiresAction, isPaymentStatusSuccess, isRetryableError, isSupportedCurrency, isTaxInclusive, money, moneyFromNumber, normalizePaymentResponse, normalizeStatusResponse, parsePrice } from './chunk-
|
|
3
|
+
export { AUTHORIZATION_TYPE, AUTH_MUTATION, AuthService, BusinessService, CHECKOUT_MODE, CHECKOUT_MUTATION, CHECKOUT_STEP, CONTACT_TYPE, CartOperations, CatalogueQueries, CheckoutService as CheckoutOperations, CheckoutService, CimplifyElement, CimplifyElements, DEFAULT_COUNTRY, DEFAULT_CURRENCY, DEVICE_TYPE, ELEMENT_TYPES, EVENT_TYPES, FxService, InventoryService, LINK_MUTATION, LINK_QUERY, LinkService, LiteService, MESSAGE_TYPES, MOBILE_MONEY_PROVIDER, ORDER_MUTATION, ORDER_TYPE, OrderQueries, PAYMENT_METHOD, PAYMENT_MUTATION, PAYMENT_STATE, PICKUP_TIME_TYPE, SchedulingService, combine, combineObject, createElements, err, flatMap, fromPromise, generateIdempotencyKey, getOrElse, isErr, isOk, mapError, mapResult, ok, toNullable, tryCatch, unwrap } from './chunk-TFHKVQLL.mjs';
|
|
4
|
+
export { CURRENCY_SYMBOLS, CimplifyError, ERROR_HINTS, ErrorCode, IdempotencyMismatchError, MOBILE_MONEY_PROVIDERS, ZERO, categorizePaymentError, currencyCode, detectMobileMoneyProvider, enrichError, formatMoney, formatNumberCompact, formatPrice, formatPriceAdjustment, formatPriceCompact, formatPriceRange, formatPriceWithTax, formatProductPrice, getBasePrice, getCurrencySymbol, getDiscountPercentage, getDisplayPrice, getErrorHint, getMarkupPercentage, getPriceRange, getProductCurrency, getTaxAmount, getUnitPriceAtQuantity, hasTaxInfo, isCimplifyError, isIdempotencyMismatchError, isOnSale, isPaymentStatusFailure, isPaymentStatusRequiresAction, isPaymentStatusSuccess, isRetryableError, isSupportedCurrency, isTaxInclusive, money, moneyFromNumber, normalizePaymentResponse, normalizeStatusResponse, parsePrice } from './chunk-6TVQQYQ5.mjs';
|
|
@@ -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
|
|
548
|
+
interface CartNotice {
|
|
549
|
+
kind: "info" | "warning";
|
|
550
|
+
text: string;
|
|
551
|
+
}
|
|
552
|
+
interface CartMutationResult {
|
|
544
553
|
cart: UICart;
|
|
545
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
548
|
+
interface CartNotice {
|
|
549
|
+
kind: "info" | "warning";
|
|
550
|
+
text: string;
|
|
551
|
+
}
|
|
552
|
+
interface CartMutationResult {
|
|
544
553
|
cart: UICart;
|
|
545
|
-
|
|
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
|
-
|
|
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
|
|
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 };
|
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,
|
|
5
|
-
import { a as CurrencyCode,
|
|
6
|
-
import { P as ProductWithPrice } from './price-
|
|
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,
|
|
5
|
-
import { a as CurrencyCode,
|
|
6
|
-
import { P as ProductWithPrice } from './price-
|
|
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>;
|