@cimplify/sdk 0.5.2 → 0.6.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.
@@ -2078,6 +2078,7 @@ interface CheckoutCustomerInfo {
2078
2078
  }
2079
2079
  interface CheckoutFormData {
2080
2080
  cart_id: string;
2081
+ location_id?: string;
2081
2082
  customer: CheckoutCustomerInfo;
2082
2083
  order_type: CheckoutOrderType;
2083
2084
  address_info: CheckoutAddressInfo;
@@ -2089,6 +2090,8 @@ interface CheckoutFormData {
2089
2090
  idempotency_key?: string;
2090
2091
  /** Optional metadata passed through to the payment provider (e.g. success_url, cancel_url) */
2091
2092
  metadata?: Record<string, unknown>;
2093
+ pay_currency?: string;
2094
+ fx_quote_id?: string;
2092
2095
  }
2093
2096
  interface CheckoutResult {
2094
2097
  order_id: string;
@@ -2102,6 +2105,14 @@ interface CheckoutResult {
2102
2105
  provider?: string;
2103
2106
  client_secret?: string;
2104
2107
  public_key?: string;
2108
+ fx?: {
2109
+ base_currency: string;
2110
+ base_amount: number;
2111
+ pay_currency: string;
2112
+ pay_amount: number;
2113
+ rate: number;
2114
+ quote_id: string;
2115
+ };
2105
2116
  }
2106
2117
 
2107
2118
  declare function generateIdempotencyKey(): string;
@@ -2254,6 +2265,8 @@ interface Business {
2254
2265
  is_online_only: boolean;
2255
2266
  enabled_payment_types: string[];
2256
2267
  default_location_settings: Record<string, unknown>;
2268
+ country_code?: string;
2269
+ timezone?: string;
2257
2270
  metadata?: Record<string, unknown>;
2258
2271
  }
2259
2272
  interface LocationTaxBehavior {
@@ -2890,6 +2903,38 @@ declare class LiteService {
2890
2903
  getMenuByCategory(categoryId: string): Promise<Result<Product[], CimplifyError>>;
2891
2904
  }
2892
2905
 
2906
+ interface FxQuoteRequest {
2907
+ from: string;
2908
+ to: string;
2909
+ amount: number;
2910
+ }
2911
+ interface FxQuote {
2912
+ id: string;
2913
+ base_currency: string;
2914
+ pay_currency: string;
2915
+ rate: number;
2916
+ inverse_rate: number;
2917
+ base_amount: number;
2918
+ converted_amount: number;
2919
+ quoted_at: string;
2920
+ valid_until: string;
2921
+ }
2922
+ interface FxRateResponse {
2923
+ from: string;
2924
+ to: string;
2925
+ rate: number;
2926
+ inverse_rate: number;
2927
+ quoted_at: string;
2928
+ valid_until: string;
2929
+ }
2930
+
2931
+ declare class FxService {
2932
+ private client;
2933
+ constructor(client: CimplifyClient);
2934
+ getRate(from: string, to: string): Promise<Result<FxRateResponse, CimplifyError>>;
2935
+ lockQuote(request: FxQuoteRequest): Promise<Result<FxQuote, CimplifyError>>;
2936
+ }
2937
+
2893
2938
  declare const ELEMENT_TYPES: {
2894
2939
  readonly AUTH: "auth";
2895
2940
  readonly ADDRESS: "address";
@@ -3107,6 +3152,7 @@ declare class CimplifyClient {
3107
3152
  private maxRetries;
3108
3153
  private retryDelay;
3109
3154
  private hooks;
3155
+ private context;
3110
3156
  private inflightRequests;
3111
3157
  private _catalogue?;
3112
3158
  private _cart?;
@@ -3118,6 +3164,7 @@ declare class CimplifyClient {
3118
3164
  private _inventory?;
3119
3165
  private _scheduling?;
3120
3166
  private _lite?;
3167
+ private _fx?;
3121
3168
  constructor(config?: CimplifyConfig);
3122
3169
  /** @deprecated Use getAccessToken() instead */
3123
3170
  getSessionToken(): string | null;
@@ -3126,6 +3173,10 @@ declare class CimplifyClient {
3126
3173
  getAccessToken(): string | null;
3127
3174
  setAccessToken(token: string | null): void;
3128
3175
  clearSession(): void;
3176
+ /** Set the active location/branch for all subsequent requests */
3177
+ setLocationId(locationId: string | null): void;
3178
+ /** Get the currently active location ID */
3179
+ getLocationId(): string | null;
3129
3180
  private loadAccessToken;
3130
3181
  private saveAccessToken;
3131
3182
  private getHeaders;
@@ -3152,6 +3203,7 @@ declare class CimplifyClient {
3152
3203
  get inventory(): InventoryService;
3153
3204
  get scheduling(): SchedulingService;
3154
3205
  get lite(): LiteService;
3206
+ get fx(): FxService;
3155
3207
  /**
3156
3208
  * Create a CimplifyElements instance for embedding checkout components.
3157
3209
  * Like Stripe's stripe.elements().
@@ -3189,4 +3241,4 @@ interface AdContextValue {
3189
3241
  isLoading: boolean;
3190
3242
  }
3191
3243
 
3192
- export { PICKUP_TIME_TYPE as $, type ApiError as A, BusinessService as B, CimplifyClient as C, type CheckoutOrderType as D, EVENT_TYPES as E, type CheckoutPaymentMethod as F, type GetProductsOptions as G, type CheckoutStep as H, InventoryService as I, type CheckoutFormData as J, type KitchenOrderItem as K, LinkService as L, MESSAGE_TYPES as M, type CheckoutResult as N, OrderQueries as O, type PaymentErrorDetails as P, type MobileMoneyProvider as Q, type DeviceType as R, type SearchOptions as S, type TableInfo as T, type UpdateProfileInput as U, type ContactType as V, CHECKOUT_MODE as W, ORDER_TYPE as X, PAYMENT_METHOD as Y, CHECKOUT_STEP as Z, PAYMENT_STATE as _, type PaymentResponse as a, type CollectionProduct as a$, MOBILE_MONEY_PROVIDER as a0, AUTHORIZATION_TYPE as a1, DEVICE_TYPE as a2, CONTACT_TYPE as a3, LINK_QUERY as a4, LINK_MUTATION as a5, AUTH_MUTATION as a6, CHECKOUT_MUTATION as a7, PAYMENT_MUTATION as a8, ORDER_MUTATION as a9, combine as aA, combineObject as aB, type ProductType as aC, type InventoryType as aD, type VariantStrategy as aE, type DigitalProductType as aF, type DepositType as aG, type SalesChannel as aH, type Product as aI, type ProductWithDetails as aJ, type ProductVariant as aK, type VariantDisplayAttribute as aL, type VariantAxis as aM, type VariantAxisWithValues as aN, type VariantAxisValue as aO, type ProductVariantValue as aP, type VariantLocationAvailability as aQ, type VariantAxisSelection as aR, type AddOn as aS, type AddOnWithOptions as aT, type AddOnOption as aU, type AddOnOptionPrice as aV, type ProductAddOn as aW, type Category as aX, type CategorySummary as aY, type Collection as aZ, type CollectionSummary as a_, DEFAULT_CURRENCY as aa, DEFAULT_COUNTRY as ab, type Money as ac, type Currency as ad, type PaginationParams as ae, type Pagination as af, ErrorCode as ag, type ErrorCodeType as ah, CimplifyError as ai, isCimplifyError as aj, isRetryableError as ak, type Result as al, type Ok as am, type Err as an, ok as ao, err as ap, isOk as aq, isErr as ar, mapResult as as, mapError as at, flatMap as au, getOrElse as av, unwrap as aw, toNullable as ax, fromPromise as ay, tryCatch as az, type PaymentStatusResponse as b, type AddToCartInput as b$, type BundlePriceType as b0, type Bundle as b1, type BundleSummary as b2, type BundleProduct as b3, type BundleWithDetails as b4, type BundleComponentData as b5, type BundleComponentInfo as b6, type CompositePricingMode as b7, type GroupPricingBehavior as b8, type ComponentSourceType as b9, type SelectedAddOnOption as bA, type AddOnDetails as bB, type CartAddOn as bC, type VariantDetails as bD, type BundleSelectionInput as bE, type BundleStoredSelection as bF, type BundleSelectionData as bG, type CompositeStoredSelection as bH, type CompositePriceBreakdown as bI, type CompositeSelectionData as bJ, type LineConfiguration as bK, type Cart as bL, type CartItem as bM, type CartTotals as bN, type DisplayCart as bO, type DisplayCartItem as bP, type DisplayAddOn as bQ, type DisplayAddOnOption as bR, type UICartBusiness as bS, type UICartLocation as bT, type UICartCustomer as bU, type UICartPricing as bV, type AddOnOptionDetails as bW, type AddOnGroupDetails as bX, type VariantDetailsDTO as bY, type CartItemDetails as bZ, type UICart as b_, type Composite as ba, type CompositeWithDetails as bb, type ComponentGroup as bc, type ComponentGroupWithComponents as bd, type CompositeComponent as be, type ComponentSelectionInput as bf, type CompositePriceResult as bg, type ComponentPriceBreakdown as bh, type PriceEntryType as bi, type Price as bj, type LocationProductPrice as bk, type ProductAvailability as bl, type ProductTimeProfile as bm, type CartStatus as bn, type CartChannel as bo, type PriceSource as bp, type AdjustmentType as bq, type PriceAdjustment as br, type TaxPathComponent as bs, type PricePathTaxInfo as bt, type PriceDecisionPath as bu, type ChosenPrice as bv, type BenefitType as bw, type AppliedDiscount as bx, type DiscountBreakdown as by, type DiscountDetails as bz, createCimplifyClient as c, type LocationTimeProfile as c$, type UpdateCartItemInput as c0, type CartSummary as c1, type OrderStatus as c2, type PaymentState as c3, type OrderChannel as c4, type LineType as c5, type OrderLineState as c6, type OrderLineStatus as c7, type FulfillmentType as c8, type FulfillmentStatus as c9, type ServiceNotes as cA, type PricingOverrides as cB, type SchedulingMetadata as cC, type StaffAssignment as cD, type ResourceAssignment as cE, type SchedulingResult as cF, type DepositResult as cG, type ServiceScheduleRequest as cH, type StaffScheduleItem as cI, type LocationAppointment as cJ, type PaymentStatus as cK, type PaymentProvider as cL, type PaymentMethodType as cM, type AuthorizationType as cN, type PaymentProcessingState as cO, type PaymentMethod as cP, type Payment as cQ, type InitializePaymentResult as cR, type SubmitAuthorizationInput as cS, type BusinessType as cT, type BusinessPreferences as cU, type Business as cV, type LocationTaxBehavior as cW, type LocationTaxOverrides as cX, type Location as cY, type TimeRange as cZ, type TimeRanges as c_, type FulfillmentLink as ca, type OrderFulfillmentSummary as cb, type FeeBearerType as cc, type AmountToPay as cd, type LineItem as ce, type Order as cf, type OrderHistory as cg, type OrderGroupPaymentState as ch, type OrderGroup as ci, type OrderGroupPayment as cj, type OrderSplitDetail as ck, type OrderGroupPaymentSummary as cl, type OrderGroupDetails as cm, type OrderPaymentEvent as cn, type OrderFilter as co, type CheckoutInput as cp, type UpdateOrderStatusInput as cq, type CancelOrderInput as cr, type RefundOrderInput as cs, type ServiceStatus as ct, type StaffRole as cu, type ReminderMethod as cv, type CustomerServicePreferences as cw, type BufferTimes as cx, type ReminderSettings as cy, type CancellationPolicy as cz, type CimplifyConfig as d, type RequestOtpInput as d$, type Table as d0, type Room as d1, type ServiceCharge as d2, type StorefrontBootstrap as d3, type BusinessWithLocations as d4, type LocationWithDetails as d5, type BusinessSettings as d6, type BusinessHours as d7, type CategoryInfo as d8, type ServiceAvailabilityRule as d9, type StockStatus as dA, type Stock as dB, type StockLevel as dC, type ProductStock as dD, type VariantStock as dE, type LocationStock as dF, type AvailabilityCheck as dG, type AvailabilityResult as dH, type InventorySummary as dI, type Customer as dJ, type CustomerAddress as dK, type CustomerMobileMoney as dL, type CustomerLinkPreferences as dM, type LinkData as dN, type CreateAddressInput as dO, type UpdateAddressInput as dP, type CreateMobileMoneyInput as dQ, type EnrollmentData as dR, type AddressData as dS, type MobileMoneyData as dT, type EnrollAndLinkOrderInput as dU, type LinkStatusResult as dV, type LinkEnrollResult as dW, type EnrollAndLinkOrderResult as dX, type LinkSession as dY, type RevokeSessionResult as dZ, type RevokeAllSessionsResult as d_, type ServiceAvailabilityException as da, type StaffAvailabilityRule as db, type StaffAvailabilityException as dc, type ResourceAvailabilityRule as dd, type ResourceAvailabilityException as de, type StaffBookingProfile as df, type ServiceStaffRequirement as dg, type BookingRequirementOverride as dh, type ResourceType as di, type Service as dj, type ServiceWithStaff as dk, type Staff as dl, type TimeSlot as dm, type AvailableSlot as dn, type DayAvailability as dp, type BookingStatus as dq, type Booking as dr, type BookingWithDetails as ds, type GetAvailableSlotsInput as dt, type CheckSlotAvailabilityInput as du, type RescheduleBookingInput as dv, type CancelBookingInput as dw, type ServiceAvailabilityParams as dx, type ServiceAvailabilityResult as dy, type StockOwnershipType as dz, CatalogueQueries as e, type VerifyOtpInput as e0, type AuthResponse as e1, type PickupTimeType as e2, type PickupTime as e3, type CheckoutAddressInfo as e4, type MobileMoneyDetails as e5, type CheckoutCustomerInfo as e6, type RequestContext as e7, type RequestStartEvent as e8, type RequestSuccessEvent as e9, type RequestErrorEvent as ea, type RetryEvent as eb, type SessionChangeEvent as ec, type ObservabilityHooks as ed, type ElementAppearance as ee, type AddressInfo as ef, type PaymentMethodInfo as eg, type AuthenticatedData as eh, type ElementsCheckoutData as ei, type ElementsCheckoutResult as ej, type ParentToIframeMessage as ek, type IframeToParentMessage as el, type ElementEventHandler as em, type AdSlot as en, type AdPosition as eo, type AdTheme as ep, type AdConfig as eq, type AdCreative as er, type AdContextValue as es, CartOperations as f, CheckoutService as g, generateIdempotencyKey as h, type GetOrdersOptions as i, AuthService as j, type AuthStatus as k, type OtpResult as l, type ChangePasswordInput as m, SchedulingService as n, LiteService as o, type LiteBootstrap as p, type KitchenOrderResult as q, CimplifyElements as r, CimplifyElement as s, createElements as t, ELEMENT_TYPES as u, type ElementsOptions as v, type ElementOptions as w, type ElementType as x, type ElementEventType as y, type CheckoutMode as z };
3244
+ export { PAYMENT_STATE as $, type ApiError as A, BusinessService as B, CimplifyClient as C, type CheckoutOrderType as D, EVENT_TYPES as E, FxService as F, type GetProductsOptions as G, type CheckoutPaymentMethod as H, InventoryService as I, type CheckoutStep as J, type KitchenOrderItem as K, LinkService as L, MESSAGE_TYPES as M, type CheckoutFormData as N, OrderQueries as O, type PaymentErrorDetails as P, type CheckoutResult as Q, type MobileMoneyProvider as R, type SearchOptions as S, type TableInfo as T, type UpdateProfileInput as U, type DeviceType as V, type ContactType as W, CHECKOUT_MODE as X, ORDER_TYPE as Y, PAYMENT_METHOD as Z, CHECKOUT_STEP as _, type PaymentResponse as a, type CollectionSummary as a$, PICKUP_TIME_TYPE as a0, MOBILE_MONEY_PROVIDER as a1, AUTHORIZATION_TYPE as a2, DEVICE_TYPE as a3, CONTACT_TYPE as a4, LINK_QUERY as a5, LINK_MUTATION as a6, AUTH_MUTATION as a7, CHECKOUT_MUTATION as a8, PAYMENT_MUTATION as a9, tryCatch as aA, combine as aB, combineObject as aC, type ProductType as aD, type InventoryType as aE, type VariantStrategy as aF, type DigitalProductType as aG, type DepositType as aH, type SalesChannel as aI, type Product as aJ, type ProductWithDetails as aK, type ProductVariant as aL, type VariantDisplayAttribute as aM, type VariantAxis as aN, type VariantAxisWithValues as aO, type VariantAxisValue as aP, type ProductVariantValue as aQ, type VariantLocationAvailability as aR, type VariantAxisSelection as aS, type AddOn as aT, type AddOnWithOptions as aU, type AddOnOption as aV, type AddOnOptionPrice as aW, type ProductAddOn as aX, type Category as aY, type CategorySummary as aZ, type Collection as a_, ORDER_MUTATION as aa, DEFAULT_CURRENCY as ab, DEFAULT_COUNTRY as ac, type Money as ad, type Currency as ae, type PaginationParams as af, type Pagination as ag, ErrorCode as ah, type ErrorCodeType as ai, CimplifyError as aj, isCimplifyError as ak, isRetryableError as al, type Result as am, type Ok as an, type Err as ao, ok as ap, err as aq, isOk as ar, isErr as as, mapResult as at, mapError as au, flatMap as av, getOrElse as aw, unwrap as ax, toNullable as ay, fromPromise as az, type PaymentStatusResponse as b, type UICart as b$, type CollectionProduct as b0, type BundlePriceType as b1, type Bundle as b2, type BundleSummary as b3, type BundleProduct as b4, type BundleWithDetails as b5, type BundleComponentData as b6, type BundleComponentInfo as b7, type CompositePricingMode as b8, type GroupPricingBehavior as b9, 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 BundleStoredSelection as bG, type BundleSelectionData as bH, type CompositeStoredSelection as bI, type CompositePriceBreakdown as bJ, type CompositeSelectionData as bK, type LineConfiguration as bL, type Cart as bM, type CartItem as bN, type CartTotals as bO, type DisplayCart as bP, type DisplayCartItem as bQ, type DisplayAddOn as bR, type DisplayAddOnOption as bS, type UICartBusiness as bT, type UICartLocation as bU, type UICartCustomer as bV, type UICartPricing as bW, type AddOnOptionDetails as bX, type AddOnGroupDetails as bY, type VariantDetailsDTO as bZ, type CartItemDetails as b_, type ComponentSourceType as ba, type Composite as bb, type CompositeWithDetails as bc, type ComponentGroup as bd, type ComponentGroupWithComponents as be, type CompositeComponent as bf, type ComponentSelectionInput as bg, type CompositePriceResult as bh, type ComponentPriceBreakdown as bi, type PriceEntryType as bj, type Price as bk, type LocationProductPrice as bl, type ProductAvailability as bm, type ProductTimeProfile as bn, type CartStatus as bo, type CartChannel as bp, type PriceSource as bq, type AdjustmentType as br, type PriceAdjustment as bs, type TaxPathComponent as bt, type PricePathTaxInfo as bu, type PriceDecisionPath as bv, type ChosenPrice as bw, type BenefitType as bx, type AppliedDiscount as by, type DiscountBreakdown as bz, createCimplifyClient as c, type TimeRanges as c$, type AddToCartInput as c0, type UpdateCartItemInput as c1, type CartSummary as c2, type OrderStatus as c3, type PaymentState as c4, type OrderChannel as c5, type LineType as c6, type OrderLineState as c7, type OrderLineStatus as c8, type FulfillmentType as c9, type CancellationPolicy as cA, type ServiceNotes as cB, type PricingOverrides as cC, type SchedulingMetadata as cD, type StaffAssignment as cE, type ResourceAssignment as cF, type SchedulingResult as cG, type DepositResult as cH, type ServiceScheduleRequest as cI, type StaffScheduleItem as cJ, type LocationAppointment as cK, type PaymentStatus as cL, type PaymentProvider as cM, type PaymentMethodType as cN, type AuthorizationType as cO, type PaymentProcessingState as cP, type PaymentMethod as cQ, type Payment as cR, type InitializePaymentResult as cS, type SubmitAuthorizationInput as cT, type BusinessType as cU, type BusinessPreferences as cV, type Business as cW, type LocationTaxBehavior as cX, type LocationTaxOverrides as cY, type Location as cZ, type TimeRange as c_, type FulfillmentStatus as ca, type FulfillmentLink as cb, type OrderFulfillmentSummary as cc, type FeeBearerType as cd, type AmountToPay as ce, type LineItem as cf, type Order as cg, type OrderHistory as ch, type OrderGroupPaymentState as ci, type OrderGroup as cj, type OrderGroupPayment as ck, type OrderSplitDetail as cl, type OrderGroupPaymentSummary as cm, type OrderGroupDetails as cn, type OrderPaymentEvent as co, type OrderFilter as cp, type CheckoutInput as cq, type UpdateOrderStatusInput as cr, type CancelOrderInput as cs, type RefundOrderInput as ct, type ServiceStatus as cu, type StaffRole as cv, type ReminderMethod as cw, type CustomerServicePreferences as cx, type BufferTimes as cy, type ReminderSettings as cz, type CimplifyConfig as d, type RevokeAllSessionsResult as d$, type LocationTimeProfile as d0, type Table as d1, type Room as d2, type ServiceCharge as d3, type StorefrontBootstrap as d4, type BusinessWithLocations as d5, type LocationWithDetails as d6, type BusinessSettings as d7, type BusinessHours as d8, type CategoryInfo as d9, type StockOwnershipType as dA, type StockStatus as dB, type Stock as dC, type StockLevel as dD, type ProductStock as dE, type VariantStock as dF, type LocationStock as dG, type AvailabilityCheck as dH, type AvailabilityResult as dI, type InventorySummary as dJ, type Customer as dK, type CustomerAddress as dL, type CustomerMobileMoney as dM, type CustomerLinkPreferences as dN, type LinkData as dO, type CreateAddressInput as dP, type UpdateAddressInput as dQ, type CreateMobileMoneyInput as dR, type EnrollmentData as dS, type AddressData as dT, type MobileMoneyData as dU, type EnrollAndLinkOrderInput as dV, type LinkStatusResult as dW, type LinkEnrollResult as dX, type EnrollAndLinkOrderResult as dY, type LinkSession as dZ, type RevokeSessionResult as d_, type ServiceAvailabilityRule as da, type ServiceAvailabilityException as db, type StaffAvailabilityRule as dc, type StaffAvailabilityException as dd, type ResourceAvailabilityRule as de, type ResourceAvailabilityException as df, type StaffBookingProfile as dg, type ServiceStaffRequirement as dh, type BookingRequirementOverride as di, type ResourceType as dj, type Service as dk, type ServiceWithStaff as dl, type Staff as dm, type TimeSlot as dn, type AvailableSlot as dp, type DayAvailability as dq, type BookingStatus as dr, type Booking as ds, type BookingWithDetails as dt, type GetAvailableSlotsInput as du, type CheckSlotAvailabilityInput as dv, type RescheduleBookingInput as dw, type CancelBookingInput as dx, type ServiceAvailabilityParams as dy, type ServiceAvailabilityResult as dz, CatalogueQueries as e, type RequestOtpInput as e0, type VerifyOtpInput as e1, type AuthResponse as e2, type PickupTimeType as e3, type PickupTime as e4, type CheckoutAddressInfo as e5, type MobileMoneyDetails as e6, type CheckoutCustomerInfo as e7, type FxQuoteRequest as e8, type FxQuote as e9, type FxRateResponse as ea, type RequestContext as eb, type RequestStartEvent as ec, type RequestSuccessEvent as ed, type RequestErrorEvent as ee, type RetryEvent as ef, type SessionChangeEvent as eg, type ObservabilityHooks as eh, type ElementAppearance as ei, type AddressInfo as ej, type PaymentMethodInfo as ek, type AuthenticatedData as el, type ElementsCheckoutData as em, type ElementsCheckoutResult as en, type ParentToIframeMessage as eo, type IframeToParentMessage as ep, type ElementEventHandler as eq, type AdSlot as er, type AdPosition as es, type AdTheme as et, type AdConfig as eu, type AdCreative as ev, type AdContextValue as ew, CartOperations as f, CheckoutService as g, generateIdempotencyKey as h, type GetOrdersOptions as i, AuthService as j, type AuthStatus as k, type OtpResult as l, type ChangePasswordInput as m, SchedulingService as n, LiteService as o, type LiteBootstrap as p, type KitchenOrderResult as q, CimplifyElements as r, CimplifyElement as s, createElements as t, ELEMENT_TYPES as u, type ElementsOptions as v, type ElementOptions as w, type ElementType as x, type ElementEventType as y, type CheckoutMode as z };
@@ -2078,6 +2078,7 @@ interface CheckoutCustomerInfo {
2078
2078
  }
2079
2079
  interface CheckoutFormData {
2080
2080
  cart_id: string;
2081
+ location_id?: string;
2081
2082
  customer: CheckoutCustomerInfo;
2082
2083
  order_type: CheckoutOrderType;
2083
2084
  address_info: CheckoutAddressInfo;
@@ -2089,6 +2090,8 @@ interface CheckoutFormData {
2089
2090
  idempotency_key?: string;
2090
2091
  /** Optional metadata passed through to the payment provider (e.g. success_url, cancel_url) */
2091
2092
  metadata?: Record<string, unknown>;
2093
+ pay_currency?: string;
2094
+ fx_quote_id?: string;
2092
2095
  }
2093
2096
  interface CheckoutResult {
2094
2097
  order_id: string;
@@ -2102,6 +2105,14 @@ interface CheckoutResult {
2102
2105
  provider?: string;
2103
2106
  client_secret?: string;
2104
2107
  public_key?: string;
2108
+ fx?: {
2109
+ base_currency: string;
2110
+ base_amount: number;
2111
+ pay_currency: string;
2112
+ pay_amount: number;
2113
+ rate: number;
2114
+ quote_id: string;
2115
+ };
2105
2116
  }
2106
2117
 
2107
2118
  declare function generateIdempotencyKey(): string;
@@ -2254,6 +2265,8 @@ interface Business {
2254
2265
  is_online_only: boolean;
2255
2266
  enabled_payment_types: string[];
2256
2267
  default_location_settings: Record<string, unknown>;
2268
+ country_code?: string;
2269
+ timezone?: string;
2257
2270
  metadata?: Record<string, unknown>;
2258
2271
  }
2259
2272
  interface LocationTaxBehavior {
@@ -2890,6 +2903,38 @@ declare class LiteService {
2890
2903
  getMenuByCategory(categoryId: string): Promise<Result<Product[], CimplifyError>>;
2891
2904
  }
2892
2905
 
2906
+ interface FxQuoteRequest {
2907
+ from: string;
2908
+ to: string;
2909
+ amount: number;
2910
+ }
2911
+ interface FxQuote {
2912
+ id: string;
2913
+ base_currency: string;
2914
+ pay_currency: string;
2915
+ rate: number;
2916
+ inverse_rate: number;
2917
+ base_amount: number;
2918
+ converted_amount: number;
2919
+ quoted_at: string;
2920
+ valid_until: string;
2921
+ }
2922
+ interface FxRateResponse {
2923
+ from: string;
2924
+ to: string;
2925
+ rate: number;
2926
+ inverse_rate: number;
2927
+ quoted_at: string;
2928
+ valid_until: string;
2929
+ }
2930
+
2931
+ declare class FxService {
2932
+ private client;
2933
+ constructor(client: CimplifyClient);
2934
+ getRate(from: string, to: string): Promise<Result<FxRateResponse, CimplifyError>>;
2935
+ lockQuote(request: FxQuoteRequest): Promise<Result<FxQuote, CimplifyError>>;
2936
+ }
2937
+
2893
2938
  declare const ELEMENT_TYPES: {
2894
2939
  readonly AUTH: "auth";
2895
2940
  readonly ADDRESS: "address";
@@ -3107,6 +3152,7 @@ declare class CimplifyClient {
3107
3152
  private maxRetries;
3108
3153
  private retryDelay;
3109
3154
  private hooks;
3155
+ private context;
3110
3156
  private inflightRequests;
3111
3157
  private _catalogue?;
3112
3158
  private _cart?;
@@ -3118,6 +3164,7 @@ declare class CimplifyClient {
3118
3164
  private _inventory?;
3119
3165
  private _scheduling?;
3120
3166
  private _lite?;
3167
+ private _fx?;
3121
3168
  constructor(config?: CimplifyConfig);
3122
3169
  /** @deprecated Use getAccessToken() instead */
3123
3170
  getSessionToken(): string | null;
@@ -3126,6 +3173,10 @@ declare class CimplifyClient {
3126
3173
  getAccessToken(): string | null;
3127
3174
  setAccessToken(token: string | null): void;
3128
3175
  clearSession(): void;
3176
+ /** Set the active location/branch for all subsequent requests */
3177
+ setLocationId(locationId: string | null): void;
3178
+ /** Get the currently active location ID */
3179
+ getLocationId(): string | null;
3129
3180
  private loadAccessToken;
3130
3181
  private saveAccessToken;
3131
3182
  private getHeaders;
@@ -3152,6 +3203,7 @@ declare class CimplifyClient {
3152
3203
  get inventory(): InventoryService;
3153
3204
  get scheduling(): SchedulingService;
3154
3205
  get lite(): LiteService;
3206
+ get fx(): FxService;
3155
3207
  /**
3156
3208
  * Create a CimplifyElements instance for embedding checkout components.
3157
3209
  * Like Stripe's stripe.elements().
@@ -3189,4 +3241,4 @@ interface AdContextValue {
3189
3241
  isLoading: boolean;
3190
3242
  }
3191
3243
 
3192
- export { PICKUP_TIME_TYPE as $, type ApiError as A, BusinessService as B, CimplifyClient as C, type CheckoutOrderType as D, EVENT_TYPES as E, type CheckoutPaymentMethod as F, type GetProductsOptions as G, type CheckoutStep as H, InventoryService as I, type CheckoutFormData as J, type KitchenOrderItem as K, LinkService as L, MESSAGE_TYPES as M, type CheckoutResult as N, OrderQueries as O, type PaymentErrorDetails as P, type MobileMoneyProvider as Q, type DeviceType as R, type SearchOptions as S, type TableInfo as T, type UpdateProfileInput as U, type ContactType as V, CHECKOUT_MODE as W, ORDER_TYPE as X, PAYMENT_METHOD as Y, CHECKOUT_STEP as Z, PAYMENT_STATE as _, type PaymentResponse as a, type CollectionProduct as a$, MOBILE_MONEY_PROVIDER as a0, AUTHORIZATION_TYPE as a1, DEVICE_TYPE as a2, CONTACT_TYPE as a3, LINK_QUERY as a4, LINK_MUTATION as a5, AUTH_MUTATION as a6, CHECKOUT_MUTATION as a7, PAYMENT_MUTATION as a8, ORDER_MUTATION as a9, combine as aA, combineObject as aB, type ProductType as aC, type InventoryType as aD, type VariantStrategy as aE, type DigitalProductType as aF, type DepositType as aG, type SalesChannel as aH, type Product as aI, type ProductWithDetails as aJ, type ProductVariant as aK, type VariantDisplayAttribute as aL, type VariantAxis as aM, type VariantAxisWithValues as aN, type VariantAxisValue as aO, type ProductVariantValue as aP, type VariantLocationAvailability as aQ, type VariantAxisSelection as aR, type AddOn as aS, type AddOnWithOptions as aT, type AddOnOption as aU, type AddOnOptionPrice as aV, type ProductAddOn as aW, type Category as aX, type CategorySummary as aY, type Collection as aZ, type CollectionSummary as a_, DEFAULT_CURRENCY as aa, DEFAULT_COUNTRY as ab, type Money as ac, type Currency as ad, type PaginationParams as ae, type Pagination as af, ErrorCode as ag, type ErrorCodeType as ah, CimplifyError as ai, isCimplifyError as aj, isRetryableError as ak, type Result as al, type Ok as am, type Err as an, ok as ao, err as ap, isOk as aq, isErr as ar, mapResult as as, mapError as at, flatMap as au, getOrElse as av, unwrap as aw, toNullable as ax, fromPromise as ay, tryCatch as az, type PaymentStatusResponse as b, type AddToCartInput as b$, type BundlePriceType as b0, type Bundle as b1, type BundleSummary as b2, type BundleProduct as b3, type BundleWithDetails as b4, type BundleComponentData as b5, type BundleComponentInfo as b6, type CompositePricingMode as b7, type GroupPricingBehavior as b8, type ComponentSourceType as b9, type SelectedAddOnOption as bA, type AddOnDetails as bB, type CartAddOn as bC, type VariantDetails as bD, type BundleSelectionInput as bE, type BundleStoredSelection as bF, type BundleSelectionData as bG, type CompositeStoredSelection as bH, type CompositePriceBreakdown as bI, type CompositeSelectionData as bJ, type LineConfiguration as bK, type Cart as bL, type CartItem as bM, type CartTotals as bN, type DisplayCart as bO, type DisplayCartItem as bP, type DisplayAddOn as bQ, type DisplayAddOnOption as bR, type UICartBusiness as bS, type UICartLocation as bT, type UICartCustomer as bU, type UICartPricing as bV, type AddOnOptionDetails as bW, type AddOnGroupDetails as bX, type VariantDetailsDTO as bY, type CartItemDetails as bZ, type UICart as b_, type Composite as ba, type CompositeWithDetails as bb, type ComponentGroup as bc, type ComponentGroupWithComponents as bd, type CompositeComponent as be, type ComponentSelectionInput as bf, type CompositePriceResult as bg, type ComponentPriceBreakdown as bh, type PriceEntryType as bi, type Price as bj, type LocationProductPrice as bk, type ProductAvailability as bl, type ProductTimeProfile as bm, type CartStatus as bn, type CartChannel as bo, type PriceSource as bp, type AdjustmentType as bq, type PriceAdjustment as br, type TaxPathComponent as bs, type PricePathTaxInfo as bt, type PriceDecisionPath as bu, type ChosenPrice as bv, type BenefitType as bw, type AppliedDiscount as bx, type DiscountBreakdown as by, type DiscountDetails as bz, createCimplifyClient as c, type LocationTimeProfile as c$, type UpdateCartItemInput as c0, type CartSummary as c1, type OrderStatus as c2, type PaymentState as c3, type OrderChannel as c4, type LineType as c5, type OrderLineState as c6, type OrderLineStatus as c7, type FulfillmentType as c8, type FulfillmentStatus as c9, type ServiceNotes as cA, type PricingOverrides as cB, type SchedulingMetadata as cC, type StaffAssignment as cD, type ResourceAssignment as cE, type SchedulingResult as cF, type DepositResult as cG, type ServiceScheduleRequest as cH, type StaffScheduleItem as cI, type LocationAppointment as cJ, type PaymentStatus as cK, type PaymentProvider as cL, type PaymentMethodType as cM, type AuthorizationType as cN, type PaymentProcessingState as cO, type PaymentMethod as cP, type Payment as cQ, type InitializePaymentResult as cR, type SubmitAuthorizationInput as cS, type BusinessType as cT, type BusinessPreferences as cU, type Business as cV, type LocationTaxBehavior as cW, type LocationTaxOverrides as cX, type Location as cY, type TimeRange as cZ, type TimeRanges as c_, type FulfillmentLink as ca, type OrderFulfillmentSummary as cb, type FeeBearerType as cc, type AmountToPay as cd, type LineItem as ce, type Order as cf, type OrderHistory as cg, type OrderGroupPaymentState as ch, type OrderGroup as ci, type OrderGroupPayment as cj, type OrderSplitDetail as ck, type OrderGroupPaymentSummary as cl, type OrderGroupDetails as cm, type OrderPaymentEvent as cn, type OrderFilter as co, type CheckoutInput as cp, type UpdateOrderStatusInput as cq, type CancelOrderInput as cr, type RefundOrderInput as cs, type ServiceStatus as ct, type StaffRole as cu, type ReminderMethod as cv, type CustomerServicePreferences as cw, type BufferTimes as cx, type ReminderSettings as cy, type CancellationPolicy as cz, type CimplifyConfig as d, type RequestOtpInput as d$, type Table as d0, type Room as d1, type ServiceCharge as d2, type StorefrontBootstrap as d3, type BusinessWithLocations as d4, type LocationWithDetails as d5, type BusinessSettings as d6, type BusinessHours as d7, type CategoryInfo as d8, type ServiceAvailabilityRule as d9, type StockStatus as dA, type Stock as dB, type StockLevel as dC, type ProductStock as dD, type VariantStock as dE, type LocationStock as dF, type AvailabilityCheck as dG, type AvailabilityResult as dH, type InventorySummary as dI, type Customer as dJ, type CustomerAddress as dK, type CustomerMobileMoney as dL, type CustomerLinkPreferences as dM, type LinkData as dN, type CreateAddressInput as dO, type UpdateAddressInput as dP, type CreateMobileMoneyInput as dQ, type EnrollmentData as dR, type AddressData as dS, type MobileMoneyData as dT, type EnrollAndLinkOrderInput as dU, type LinkStatusResult as dV, type LinkEnrollResult as dW, type EnrollAndLinkOrderResult as dX, type LinkSession as dY, type RevokeSessionResult as dZ, type RevokeAllSessionsResult as d_, type ServiceAvailabilityException as da, type StaffAvailabilityRule as db, type StaffAvailabilityException as dc, type ResourceAvailabilityRule as dd, type ResourceAvailabilityException as de, type StaffBookingProfile as df, type ServiceStaffRequirement as dg, type BookingRequirementOverride as dh, type ResourceType as di, type Service as dj, type ServiceWithStaff as dk, type Staff as dl, type TimeSlot as dm, type AvailableSlot as dn, type DayAvailability as dp, type BookingStatus as dq, type Booking as dr, type BookingWithDetails as ds, type GetAvailableSlotsInput as dt, type CheckSlotAvailabilityInput as du, type RescheduleBookingInput as dv, type CancelBookingInput as dw, type ServiceAvailabilityParams as dx, type ServiceAvailabilityResult as dy, type StockOwnershipType as dz, CatalogueQueries as e, type VerifyOtpInput as e0, type AuthResponse as e1, type PickupTimeType as e2, type PickupTime as e3, type CheckoutAddressInfo as e4, type MobileMoneyDetails as e5, type CheckoutCustomerInfo as e6, type RequestContext as e7, type RequestStartEvent as e8, type RequestSuccessEvent as e9, type RequestErrorEvent as ea, type RetryEvent as eb, type SessionChangeEvent as ec, type ObservabilityHooks as ed, type ElementAppearance as ee, type AddressInfo as ef, type PaymentMethodInfo as eg, type AuthenticatedData as eh, type ElementsCheckoutData as ei, type ElementsCheckoutResult as ej, type ParentToIframeMessage as ek, type IframeToParentMessage as el, type ElementEventHandler as em, type AdSlot as en, type AdPosition as eo, type AdTheme as ep, type AdConfig as eq, type AdCreative as er, type AdContextValue as es, CartOperations as f, CheckoutService as g, generateIdempotencyKey as h, type GetOrdersOptions as i, AuthService as j, type AuthStatus as k, type OtpResult as l, type ChangePasswordInput as m, SchedulingService as n, LiteService as o, type LiteBootstrap as p, type KitchenOrderResult as q, CimplifyElements as r, CimplifyElement as s, createElements as t, ELEMENT_TYPES as u, type ElementsOptions as v, type ElementOptions as w, type ElementType as x, type ElementEventType as y, type CheckoutMode as z };
3244
+ export { PAYMENT_STATE as $, type ApiError as A, BusinessService as B, CimplifyClient as C, type CheckoutOrderType as D, EVENT_TYPES as E, FxService as F, type GetProductsOptions as G, type CheckoutPaymentMethod as H, InventoryService as I, type CheckoutStep as J, type KitchenOrderItem as K, LinkService as L, MESSAGE_TYPES as M, type CheckoutFormData as N, OrderQueries as O, type PaymentErrorDetails as P, type CheckoutResult as Q, type MobileMoneyProvider as R, type SearchOptions as S, type TableInfo as T, type UpdateProfileInput as U, type DeviceType as V, type ContactType as W, CHECKOUT_MODE as X, ORDER_TYPE as Y, PAYMENT_METHOD as Z, CHECKOUT_STEP as _, type PaymentResponse as a, type CollectionSummary as a$, PICKUP_TIME_TYPE as a0, MOBILE_MONEY_PROVIDER as a1, AUTHORIZATION_TYPE as a2, DEVICE_TYPE as a3, CONTACT_TYPE as a4, LINK_QUERY as a5, LINK_MUTATION as a6, AUTH_MUTATION as a7, CHECKOUT_MUTATION as a8, PAYMENT_MUTATION as a9, tryCatch as aA, combine as aB, combineObject as aC, type ProductType as aD, type InventoryType as aE, type VariantStrategy as aF, type DigitalProductType as aG, type DepositType as aH, type SalesChannel as aI, type Product as aJ, type ProductWithDetails as aK, type ProductVariant as aL, type VariantDisplayAttribute as aM, type VariantAxis as aN, type VariantAxisWithValues as aO, type VariantAxisValue as aP, type ProductVariantValue as aQ, type VariantLocationAvailability as aR, type VariantAxisSelection as aS, type AddOn as aT, type AddOnWithOptions as aU, type AddOnOption as aV, type AddOnOptionPrice as aW, type ProductAddOn as aX, type Category as aY, type CategorySummary as aZ, type Collection as a_, ORDER_MUTATION as aa, DEFAULT_CURRENCY as ab, DEFAULT_COUNTRY as ac, type Money as ad, type Currency as ae, type PaginationParams as af, type Pagination as ag, ErrorCode as ah, type ErrorCodeType as ai, CimplifyError as aj, isCimplifyError as ak, isRetryableError as al, type Result as am, type Ok as an, type Err as ao, ok as ap, err as aq, isOk as ar, isErr as as, mapResult as at, mapError as au, flatMap as av, getOrElse as aw, unwrap as ax, toNullable as ay, fromPromise as az, type PaymentStatusResponse as b, type UICart as b$, type CollectionProduct as b0, type BundlePriceType as b1, type Bundle as b2, type BundleSummary as b3, type BundleProduct as b4, type BundleWithDetails as b5, type BundleComponentData as b6, type BundleComponentInfo as b7, type CompositePricingMode as b8, type GroupPricingBehavior as b9, 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 BundleStoredSelection as bG, type BundleSelectionData as bH, type CompositeStoredSelection as bI, type CompositePriceBreakdown as bJ, type CompositeSelectionData as bK, type LineConfiguration as bL, type Cart as bM, type CartItem as bN, type CartTotals as bO, type DisplayCart as bP, type DisplayCartItem as bQ, type DisplayAddOn as bR, type DisplayAddOnOption as bS, type UICartBusiness as bT, type UICartLocation as bU, type UICartCustomer as bV, type UICartPricing as bW, type AddOnOptionDetails as bX, type AddOnGroupDetails as bY, type VariantDetailsDTO as bZ, type CartItemDetails as b_, type ComponentSourceType as ba, type Composite as bb, type CompositeWithDetails as bc, type ComponentGroup as bd, type ComponentGroupWithComponents as be, type CompositeComponent as bf, type ComponentSelectionInput as bg, type CompositePriceResult as bh, type ComponentPriceBreakdown as bi, type PriceEntryType as bj, type Price as bk, type LocationProductPrice as bl, type ProductAvailability as bm, type ProductTimeProfile as bn, type CartStatus as bo, type CartChannel as bp, type PriceSource as bq, type AdjustmentType as br, type PriceAdjustment as bs, type TaxPathComponent as bt, type PricePathTaxInfo as bu, type PriceDecisionPath as bv, type ChosenPrice as bw, type BenefitType as bx, type AppliedDiscount as by, type DiscountBreakdown as bz, createCimplifyClient as c, type TimeRanges as c$, type AddToCartInput as c0, type UpdateCartItemInput as c1, type CartSummary as c2, type OrderStatus as c3, type PaymentState as c4, type OrderChannel as c5, type LineType as c6, type OrderLineState as c7, type OrderLineStatus as c8, type FulfillmentType as c9, type CancellationPolicy as cA, type ServiceNotes as cB, type PricingOverrides as cC, type SchedulingMetadata as cD, type StaffAssignment as cE, type ResourceAssignment as cF, type SchedulingResult as cG, type DepositResult as cH, type ServiceScheduleRequest as cI, type StaffScheduleItem as cJ, type LocationAppointment as cK, type PaymentStatus as cL, type PaymentProvider as cM, type PaymentMethodType as cN, type AuthorizationType as cO, type PaymentProcessingState as cP, type PaymentMethod as cQ, type Payment as cR, type InitializePaymentResult as cS, type SubmitAuthorizationInput as cT, type BusinessType as cU, type BusinessPreferences as cV, type Business as cW, type LocationTaxBehavior as cX, type LocationTaxOverrides as cY, type Location as cZ, type TimeRange as c_, type FulfillmentStatus as ca, type FulfillmentLink as cb, type OrderFulfillmentSummary as cc, type FeeBearerType as cd, type AmountToPay as ce, type LineItem as cf, type Order as cg, type OrderHistory as ch, type OrderGroupPaymentState as ci, type OrderGroup as cj, type OrderGroupPayment as ck, type OrderSplitDetail as cl, type OrderGroupPaymentSummary as cm, type OrderGroupDetails as cn, type OrderPaymentEvent as co, type OrderFilter as cp, type CheckoutInput as cq, type UpdateOrderStatusInput as cr, type CancelOrderInput as cs, type RefundOrderInput as ct, type ServiceStatus as cu, type StaffRole as cv, type ReminderMethod as cw, type CustomerServicePreferences as cx, type BufferTimes as cy, type ReminderSettings as cz, type CimplifyConfig as d, type RevokeAllSessionsResult as d$, type LocationTimeProfile as d0, type Table as d1, type Room as d2, type ServiceCharge as d3, type StorefrontBootstrap as d4, type BusinessWithLocations as d5, type LocationWithDetails as d6, type BusinessSettings as d7, type BusinessHours as d8, type CategoryInfo as d9, type StockOwnershipType as dA, type StockStatus as dB, type Stock as dC, type StockLevel as dD, type ProductStock as dE, type VariantStock as dF, type LocationStock as dG, type AvailabilityCheck as dH, type AvailabilityResult as dI, type InventorySummary as dJ, type Customer as dK, type CustomerAddress as dL, type CustomerMobileMoney as dM, type CustomerLinkPreferences as dN, type LinkData as dO, type CreateAddressInput as dP, type UpdateAddressInput as dQ, type CreateMobileMoneyInput as dR, type EnrollmentData as dS, type AddressData as dT, type MobileMoneyData as dU, type EnrollAndLinkOrderInput as dV, type LinkStatusResult as dW, type LinkEnrollResult as dX, type EnrollAndLinkOrderResult as dY, type LinkSession as dZ, type RevokeSessionResult as d_, type ServiceAvailabilityRule as da, type ServiceAvailabilityException as db, type StaffAvailabilityRule as dc, type StaffAvailabilityException as dd, type ResourceAvailabilityRule as de, type ResourceAvailabilityException as df, type StaffBookingProfile as dg, type ServiceStaffRequirement as dh, type BookingRequirementOverride as di, type ResourceType as dj, type Service as dk, type ServiceWithStaff as dl, type Staff as dm, type TimeSlot as dn, type AvailableSlot as dp, type DayAvailability as dq, type BookingStatus as dr, type Booking as ds, type BookingWithDetails as dt, type GetAvailableSlotsInput as du, type CheckSlotAvailabilityInput as dv, type RescheduleBookingInput as dw, type CancelBookingInput as dx, type ServiceAvailabilityParams as dy, type ServiceAvailabilityResult as dz, CatalogueQueries as e, type RequestOtpInput as e0, type VerifyOtpInput as e1, type AuthResponse as e2, type PickupTimeType as e3, type PickupTime as e4, type CheckoutAddressInfo as e5, type MobileMoneyDetails as e6, type CheckoutCustomerInfo as e7, type FxQuoteRequest as e8, type FxQuote as e9, type FxRateResponse as ea, type RequestContext as eb, type RequestStartEvent as ec, type RequestSuccessEvent as ed, type RequestErrorEvent as ee, type RetryEvent as ef, type SessionChangeEvent as eg, type ObservabilityHooks as eh, type ElementAppearance as ei, type AddressInfo as ej, type PaymentMethodInfo as ek, type AuthenticatedData as el, type ElementsCheckoutData as em, type ElementsCheckoutResult as en, type ParentToIframeMessage as eo, type IframeToParentMessage as ep, type ElementEventHandler as eq, type AdSlot as er, type AdPosition as es, type AdTheme as et, type AdConfig as eu, type AdCreative as ev, type AdContextValue as ew, CartOperations as f, CheckoutService as g, generateIdempotencyKey as h, type GetOrdersOptions as i, AuthService as j, type AuthStatus as k, type OtpResult as l, type ChangePasswordInput as m, SchedulingService as n, LiteService as o, type LiteBootstrap as p, type KitchenOrderResult as q, CimplifyElements as r, CimplifyElement as s, createElements as t, ELEMENT_TYPES as u, type ElementsOptions as v, type ElementOptions as w, type ElementType as x, type ElementEventType as y, type CheckoutMode as z };
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { P as PaymentErrorDetails, a as PaymentResponse, b as PaymentStatusResponse, A as ApiError } from './ads-BNcVdZrK.mjs';
2
- export { a1 as AUTHORIZATION_TYPE, a6 as AUTH_MUTATION, eq as AdConfig, es as AdContextValue, er as AdCreative, eo as AdPosition, en as AdSlot, ep as AdTheme, aS as AddOn, bB as AddOnDetails, bX as AddOnGroupDetails, aU as AddOnOption, bW as AddOnOptionDetails, aV as AddOnOptionPrice, aT as AddOnWithOptions, b$ as AddToCartInput, dS as AddressData, ef as AddressInfo, bq as AdjustmentType, cd as AmountToPay, bx as AppliedDiscount, e1 as AuthResponse, j as AuthService, k as AuthStatus, eh as AuthenticatedData, cN as AuthorizationType, dG as AvailabilityCheck, dH as AvailabilityResult, dn as AvailableSlot, bw as BenefitType, dr as Booking, dh as BookingRequirementOverride, dq as BookingStatus, ds as BookingWithDetails, cx as BufferTimes, b1 as Bundle, b5 as BundleComponentData, b6 as BundleComponentInfo, b0 as BundlePriceType, b3 as BundleProduct, bG as BundleSelectionData, bE as BundleSelectionInput, bF as BundleStoredSelection, b2 as BundleSummary, b4 as BundleWithDetails, cV as Business, d7 as BusinessHours, cU as BusinessPreferences, B as BusinessService, d6 as BusinessSettings, cT as BusinessType, d4 as BusinessWithLocations, W as CHECKOUT_MODE, a7 as CHECKOUT_MUTATION, Z as CHECKOUT_STEP, a3 as CONTACT_TYPE, dw as CancelBookingInput, cr as CancelOrderInput, cz as CancellationPolicy, bL as Cart, bC as CartAddOn, bo as CartChannel, bM as CartItem, bZ as CartItemDetails, f as CartOperations, bn as CartStatus, c1 as CartSummary, bN as CartTotals, e as CatalogueQueries, aX as Category, d8 as CategoryInfo, aY as CategorySummary, m as ChangePasswordInput, du as CheckSlotAvailabilityInput, e4 as CheckoutAddressInfo, e6 as CheckoutCustomerInfo, J as CheckoutFormData, cp as CheckoutInput, z as CheckoutMode, g as CheckoutOperations, D as CheckoutOrderType, F as CheckoutPaymentMethod, N as CheckoutResult, g as CheckoutService, H as CheckoutStep, bv as ChosenPrice, C as CimplifyClient, d as CimplifyConfig, s as CimplifyElement, r as CimplifyElements, ai as CimplifyError, aZ as Collection, a$ as CollectionProduct, a_ as CollectionSummary, bc as ComponentGroup, bd as ComponentGroupWithComponents, bh as ComponentPriceBreakdown, bf as ComponentSelectionInput, b9 as ComponentSourceType, ba as Composite, be as CompositeComponent, bI as CompositePriceBreakdown, bg as CompositePriceResult, b7 as CompositePricingMode, bJ as CompositeSelectionData, bf as CompositeSelectionInput, bH as CompositeStoredSelection, bb as CompositeWithDetails, V as ContactType, dO as CreateAddressInput, dQ as CreateMobileMoneyInput, ad as Currency, dJ as Customer, dK as CustomerAddress, dM as CustomerLinkPreferences, dL as CustomerMobileMoney, cw as CustomerServicePreferences, ab as DEFAULT_COUNTRY, aa as DEFAULT_CURRENCY, a2 as DEVICE_TYPE, dp as DayAvailability, cG as DepositResult, aG as DepositType, R as DeviceType, aF as DigitalProductType, by as DiscountBreakdown, bz as DiscountDetails, bQ as DisplayAddOn, bR as DisplayAddOnOption, bO as DisplayCart, bP as DisplayCartItem, u as ELEMENT_TYPES, E as EVENT_TYPES, ee as ElementAppearance, em as ElementEventHandler, y as ElementEventType, w as ElementOptions, x as ElementType, ei as ElementsCheckoutData, ej as ElementsCheckoutResult, v as ElementsOptions, dU as EnrollAndLinkOrderInput, dX as EnrollAndLinkOrderResult, dR as EnrollmentData, an as Err, ag as ErrorCode, ah as ErrorCodeType, cc as FeeBearerType, ca as FulfillmentLink, c9 as FulfillmentStatus, c8 as FulfillmentType, dt as GetAvailableSlotsInput, i as GetOrdersOptions, G as GetProductsOptions, b8 as GroupPricingBehavior, el as IframeToParentMessage, cR as InitializePaymentResult, I as InventoryService, dI as InventorySummary, aD as InventoryType, K as KitchenOrderItem, q as KitchenOrderResult, a5 as LINK_MUTATION, a4 as LINK_QUERY, bK as LineConfiguration, ce as LineItem, c5 as LineType, dN as LinkData, dW as LinkEnrollResult, L as LinkService, dY as LinkSession, dV as LinkStatusResult, p as LiteBootstrap, o as LiteService, cY as Location, cJ as LocationAppointment, bk as LocationProductPrice, dF as LocationStock, cW as LocationTaxBehavior, cX as LocationTaxOverrides, c$ as LocationTimeProfile, d5 as LocationWithDetails, M as MESSAGE_TYPES, a0 as MOBILE_MONEY_PROVIDER, dT as MobileMoneyData, e5 as MobileMoneyDetails, Q as MobileMoneyProvider, ac as Money, a9 as ORDER_MUTATION, X as ORDER_TYPE, ed as ObservabilityHooks, am as Ok, cf as Order, c4 as OrderChannel, co as OrderFilter, cb as OrderFulfillmentSummary, ci as OrderGroup, cm as OrderGroupDetails, cj as OrderGroupPayment, ch as OrderGroupPaymentState, cl as OrderGroupPaymentSummary, cg as OrderHistory, c6 as OrderLineState, c7 as OrderLineStatus, cn as OrderPaymentEvent, O as OrderQueries, ck as OrderSplitDetail, c2 as OrderStatus, l as OtpResult, Y as PAYMENT_METHOD, a8 as PAYMENT_MUTATION, _ as PAYMENT_STATE, $ as PICKUP_TIME_TYPE, af as Pagination, ae as PaginationParams, ek as ParentToIframeMessage, cQ as Payment, cP as PaymentMethod, eg as PaymentMethodInfo, cM as PaymentMethodType, cO as PaymentProcessingState, cL as PaymentProvider, c3 as PaymentState, cK as PaymentStatus, e3 as PickupTime, e2 as PickupTimeType, bj as Price, br as PriceAdjustment, bu as PriceDecisionPath, bi as PriceEntryType, bt as PricePathTaxInfo, bp as PriceSource, cB as PricingOverrides, aI as Product, aW as ProductAddOn, bl as ProductAvailability, dD as ProductStock, bm as ProductTimeProfile, aC as ProductType, aK as ProductVariant, aP as ProductVariantValue, aJ as ProductWithDetails, cs as RefundOrderInput, cv as ReminderMethod, cy as ReminderSettings, e7 as RequestContext, ea as RequestErrorEvent, d$ as RequestOtpInput, e8 as RequestStartEvent, e9 as RequestSuccessEvent, dv as RescheduleBookingInput, cE as ResourceAssignment, de as ResourceAvailabilityException, dd as ResourceAvailabilityRule, di as ResourceType, al as Result, eb as RetryEvent, d_ as RevokeAllSessionsResult, dZ as RevokeSessionResult, d1 as Room, aH as SalesChannel, cC as SchedulingMetadata, cF as SchedulingResult, n as SchedulingService, S as SearchOptions, bA as SelectedAddOnOption, dj as Service, da as ServiceAvailabilityException, dx as ServiceAvailabilityParams, dy as ServiceAvailabilityResult, d9 as ServiceAvailabilityRule, d2 as ServiceCharge, cA as ServiceNotes, cH as ServiceScheduleRequest, dg as ServiceStaffRequirement, ct as ServiceStatus, dk as ServiceWithStaff, ec as SessionChangeEvent, dl as Staff, cD as StaffAssignment, dc as StaffAvailabilityException, db as StaffAvailabilityRule, df as StaffBookingProfile, cu as StaffRole, cI as StaffScheduleItem, dB as Stock, dC as StockLevel, dz as StockOwnershipType, dA as StockStatus, d3 as StorefrontBootstrap, cS as SubmitAuthorizationInput, d0 as Table, T as TableInfo, bs as TaxPathComponent, cZ as TimeRange, c_ as TimeRanges, dm as TimeSlot, b_ as UICart, bS as UICartBusiness, bU as UICartCustomer, bT as UICartLocation, bV as UICartPricing, dP as UpdateAddressInput, c0 as UpdateCartItemInput, cq as UpdateOrderStatusInput, U as UpdateProfileInput, aM as VariantAxis, aR as VariantAxisSelection, aO as VariantAxisValue, aN as VariantAxisWithValues, bD as VariantDetails, bY as VariantDetailsDTO, aL as VariantDisplayAttribute, aQ as VariantLocationAvailability, dE as VariantStock, aE as VariantStrategy, e0 as VerifyOtpInput, aA as combine, aB as combineObject, c as createCimplifyClient, t as createElements, ap as err, au as flatMap, ay as fromPromise, h as generateIdempotencyKey, av as getOrElse, aj as isCimplifyError, ar as isErr, aq as isOk, ak as isRetryableError, at as mapError, as as mapResult, ao as ok, ax as toNullable, az as tryCatch, aw as unwrap } from './ads-BNcVdZrK.mjs';
1
+ import { P as PaymentErrorDetails, a as PaymentResponse, b as PaymentStatusResponse, A as ApiError } from './ads-B5jcLFpD.mjs';
2
+ export { a2 as AUTHORIZATION_TYPE, a7 as AUTH_MUTATION, eu as AdConfig, ew as AdContextValue, ev as AdCreative, es as AdPosition, er as AdSlot, et as AdTheme, aT as AddOn, bC as AddOnDetails, bY as AddOnGroupDetails, aV as AddOnOption, bX as AddOnOptionDetails, aW as AddOnOptionPrice, aU as AddOnWithOptions, c0 as AddToCartInput, dT as AddressData, ej as AddressInfo, br as AdjustmentType, ce as AmountToPay, by as AppliedDiscount, e2 as AuthResponse, j as AuthService, k as AuthStatus, el as AuthenticatedData, cO as AuthorizationType, dH as AvailabilityCheck, dI as AvailabilityResult, dp as AvailableSlot, bx as BenefitType, ds as Booking, di as BookingRequirementOverride, dr as BookingStatus, dt as BookingWithDetails, cy as BufferTimes, b2 as Bundle, b6 as BundleComponentData, b7 as BundleComponentInfo, b1 as BundlePriceType, b4 as BundleProduct, bH as BundleSelectionData, bF as BundleSelectionInput, bG as BundleStoredSelection, b3 as BundleSummary, b5 as BundleWithDetails, cW as Business, d8 as BusinessHours, cV as BusinessPreferences, B as BusinessService, d7 as BusinessSettings, cU as BusinessType, d5 as BusinessWithLocations, X as CHECKOUT_MODE, a8 as CHECKOUT_MUTATION, _ as CHECKOUT_STEP, a4 as CONTACT_TYPE, dx as CancelBookingInput, cs as CancelOrderInput, cA as CancellationPolicy, bM as Cart, bD as CartAddOn, bp as CartChannel, bN as CartItem, b_ as CartItemDetails, f as CartOperations, bo as CartStatus, c2 as CartSummary, bO as CartTotals, e as CatalogueQueries, aY as Category, d9 as CategoryInfo, aZ as CategorySummary, m as ChangePasswordInput, dv as CheckSlotAvailabilityInput, e5 as CheckoutAddressInfo, e7 as CheckoutCustomerInfo, N as CheckoutFormData, cq as CheckoutInput, z as CheckoutMode, g as CheckoutOperations, D as CheckoutOrderType, H as CheckoutPaymentMethod, Q as CheckoutResult, g as CheckoutService, J as CheckoutStep, bw as ChosenPrice, C as CimplifyClient, d as CimplifyConfig, s as CimplifyElement, r as CimplifyElements, aj as CimplifyError, a_ as Collection, b0 as CollectionProduct, a$ as CollectionSummary, bd as ComponentGroup, be as ComponentGroupWithComponents, bi as ComponentPriceBreakdown, bg as ComponentSelectionInput, ba as ComponentSourceType, bb as Composite, bf as CompositeComponent, bJ as CompositePriceBreakdown, bh as CompositePriceResult, b8 as CompositePricingMode, bK as CompositeSelectionData, bg as CompositeSelectionInput, bI as CompositeStoredSelection, bc as CompositeWithDetails, W as ContactType, dP as CreateAddressInput, dR as CreateMobileMoneyInput, ae as Currency, dK as Customer, dL as CustomerAddress, dN as CustomerLinkPreferences, dM as CustomerMobileMoney, cx as CustomerServicePreferences, ac as DEFAULT_COUNTRY, ab as DEFAULT_CURRENCY, a3 as DEVICE_TYPE, dq as DayAvailability, cH as DepositResult, aH as DepositType, V as DeviceType, aG as DigitalProductType, bz as DiscountBreakdown, bA as DiscountDetails, bR as DisplayAddOn, bS as DisplayAddOnOption, bP as DisplayCart, bQ as DisplayCartItem, u as ELEMENT_TYPES, E as EVENT_TYPES, ei as ElementAppearance, eq as ElementEventHandler, y as ElementEventType, w as ElementOptions, x as ElementType, em as ElementsCheckoutData, en as ElementsCheckoutResult, v as ElementsOptions, dV as EnrollAndLinkOrderInput, dY as EnrollAndLinkOrderResult, dS as EnrollmentData, ao as Err, ah as ErrorCode, ai as ErrorCodeType, cd as FeeBearerType, cb as FulfillmentLink, ca as FulfillmentStatus, c9 as FulfillmentType, e9 as FxQuote, e8 as FxQuoteRequest, ea as FxRateResponse, F as FxService, du as GetAvailableSlotsInput, i as GetOrdersOptions, G as GetProductsOptions, b9 as GroupPricingBehavior, ep as IframeToParentMessage, cS as InitializePaymentResult, I as InventoryService, dJ as InventorySummary, aE as InventoryType, K as KitchenOrderItem, q as KitchenOrderResult, a6 as LINK_MUTATION, a5 as LINK_QUERY, bL as LineConfiguration, cf as LineItem, c6 as LineType, dO as LinkData, dX as LinkEnrollResult, L as LinkService, dZ as LinkSession, dW as LinkStatusResult, p as LiteBootstrap, o as LiteService, cZ as Location, cK as LocationAppointment, bl as LocationProductPrice, dG as LocationStock, cX as LocationTaxBehavior, cY as LocationTaxOverrides, d0 as LocationTimeProfile, d6 as LocationWithDetails, M as MESSAGE_TYPES, a1 as MOBILE_MONEY_PROVIDER, dU as MobileMoneyData, e6 as MobileMoneyDetails, R as MobileMoneyProvider, ad as Money, aa as ORDER_MUTATION, Y as ORDER_TYPE, eh as ObservabilityHooks, an as Ok, cg as Order, c5 as OrderChannel, cp as OrderFilter, cc as OrderFulfillmentSummary, cj as OrderGroup, cn as OrderGroupDetails, ck as OrderGroupPayment, ci as OrderGroupPaymentState, cm as OrderGroupPaymentSummary, ch as OrderHistory, c7 as OrderLineState, c8 as OrderLineStatus, co as OrderPaymentEvent, O as OrderQueries, cl as OrderSplitDetail, c3 as OrderStatus, l as OtpResult, Z as PAYMENT_METHOD, a9 as PAYMENT_MUTATION, $ as PAYMENT_STATE, a0 as PICKUP_TIME_TYPE, ag as Pagination, af as PaginationParams, eo as ParentToIframeMessage, cR as Payment, cQ as PaymentMethod, ek as PaymentMethodInfo, cN as PaymentMethodType, cP as PaymentProcessingState, cM as PaymentProvider, c4 as PaymentState, cL as PaymentStatus, e4 as PickupTime, e3 as PickupTimeType, bk as Price, bs as PriceAdjustment, bv as PriceDecisionPath, bj as PriceEntryType, bu as PricePathTaxInfo, bq as PriceSource, cC as PricingOverrides, aJ as Product, aX as ProductAddOn, bm as ProductAvailability, dE as ProductStock, bn as ProductTimeProfile, aD as ProductType, aL as ProductVariant, aQ as ProductVariantValue, aK as ProductWithDetails, ct as RefundOrderInput, cw as ReminderMethod, cz as ReminderSettings, eb as RequestContext, ee as RequestErrorEvent, e0 as RequestOtpInput, ec as RequestStartEvent, ed as RequestSuccessEvent, dw as RescheduleBookingInput, cF as ResourceAssignment, df as ResourceAvailabilityException, de as ResourceAvailabilityRule, dj as ResourceType, am as Result, ef as RetryEvent, d$ as RevokeAllSessionsResult, d_ as RevokeSessionResult, d2 as Room, aI as SalesChannel, cD as SchedulingMetadata, cG as SchedulingResult, n as SchedulingService, S as SearchOptions, bB as SelectedAddOnOption, dk as Service, db as ServiceAvailabilityException, dy as ServiceAvailabilityParams, dz as ServiceAvailabilityResult, da as ServiceAvailabilityRule, d3 as ServiceCharge, cB as ServiceNotes, cI as ServiceScheduleRequest, dh as ServiceStaffRequirement, cu as ServiceStatus, dl as ServiceWithStaff, eg as SessionChangeEvent, dm as Staff, cE as StaffAssignment, dd as StaffAvailabilityException, dc as StaffAvailabilityRule, dg as StaffBookingProfile, cv as StaffRole, cJ as StaffScheduleItem, dC as Stock, dD as StockLevel, dA as StockOwnershipType, dB as StockStatus, d4 as StorefrontBootstrap, cT as SubmitAuthorizationInput, d1 as Table, T as TableInfo, bt as TaxPathComponent, c_ as TimeRange, c$ as TimeRanges, dn as TimeSlot, b$ as UICart, bT as UICartBusiness, bV as UICartCustomer, bU as UICartLocation, bW as UICartPricing, dQ as UpdateAddressInput, c1 as UpdateCartItemInput, cr as UpdateOrderStatusInput, U as UpdateProfileInput, aN as VariantAxis, aS as VariantAxisSelection, aP as VariantAxisValue, aO as VariantAxisWithValues, bE as VariantDetails, bZ as VariantDetailsDTO, aM as VariantDisplayAttribute, aR as VariantLocationAvailability, dF as VariantStock, aF as VariantStrategy, e1 as VerifyOtpInput, aB as combine, aC as combineObject, c as createCimplifyClient, t as createElements, aq as err, av as flatMap, az as fromPromise, h as generateIdempotencyKey, aw as getOrElse, ak as isCimplifyError, as as isErr, ar as isOk, al as isRetryableError, au as mapError, at as mapResult, ap as ok, ay as toNullable, aA as tryCatch, ax as unwrap } from './ads-B5jcLFpD.mjs';
3
3
 
4
4
  type Operator = "==" | "!=" | ">" | "<" | ">=" | "<=" | "contains" | "startsWith";
5
5
  type SortOrder = "asc" | "desc";
@@ -408,16 +408,22 @@ declare const MOBILE_MONEY_PROVIDERS: {
408
408
  */
409
409
  declare function detectMobileMoneyProvider(phoneNumber: string): "mtn" | "vodafone" | "airtel" | null;
410
410
 
411
+ /** Context sent with every request to scope operations to a specific location/branch */
412
+ interface FrontendContext {
413
+ location_id?: string;
414
+ }
411
415
  /** Request body for POST /api/q */
412
416
  interface QueryRequest {
413
417
  query: string;
414
418
  variables?: Record<string, unknown>;
415
419
  cache_hint?: string;
420
+ context?: FrontendContext;
416
421
  }
417
422
  /** Request body for POST /api/m */
418
423
  interface MutationRequest {
419
424
  method: string;
420
425
  args: unknown[];
426
+ context?: FrontendContext;
421
427
  }
422
428
  /** Response metadata */
423
429
  interface ResponseMetadata {
@@ -432,4 +438,4 @@ interface ApiResponse<T> {
432
438
  metadata?: ResponseMetadata;
433
439
  }
434
440
 
435
- export { ApiError, type ApiResponse, CURRENCY_SYMBOLS, type FormatCompactOptions, type FormatPriceOptions, MOBILE_MONEY_PROVIDERS, type MutationRequest, type ParsedPrice, PaymentErrorDetails, PaymentResponse, PaymentStatusResponse, type PriceInfo, type ProductWithPrice, QueryBuilder, type QueryRequest, type ResponseMetadata, type TaxComponent, type TaxInfo, categorizePaymentError, detectMobileMoneyProvider, extractPriceInfo, formatMoney, formatNumberCompact, formatPrice, formatPriceAdjustment, formatPriceCompact, formatProductPrice, getBasePrice, getCurrencySymbol, getDiscountPercentage, getDisplayPrice, getMarkupPercentage, getProductCurrency, isOnSale, normalizePaymentResponse, normalizeStatusResponse, parsePrice, parsePricePath, parsedPriceToPriceInfo, query };
441
+ export { ApiError, type ApiResponse, CURRENCY_SYMBOLS, type FormatCompactOptions, type FormatPriceOptions, type FrontendContext, MOBILE_MONEY_PROVIDERS, type MutationRequest, type ParsedPrice, PaymentErrorDetails, PaymentResponse, PaymentStatusResponse, type PriceInfo, type ProductWithPrice, QueryBuilder, type QueryRequest, type ResponseMetadata, type TaxComponent, type TaxInfo, categorizePaymentError, detectMobileMoneyProvider, extractPriceInfo, formatMoney, formatNumberCompact, formatPrice, formatPriceAdjustment, formatPriceCompact, formatProductPrice, getBasePrice, getCurrencySymbol, getDiscountPercentage, getDisplayPrice, getMarkupPercentage, getProductCurrency, isOnSale, normalizePaymentResponse, normalizeStatusResponse, parsePrice, parsePricePath, parsedPriceToPriceInfo, query };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { P as PaymentErrorDetails, a as PaymentResponse, b as PaymentStatusResponse, A as ApiError } from './ads-BNcVdZrK.js';
2
- export { a1 as AUTHORIZATION_TYPE, a6 as AUTH_MUTATION, eq as AdConfig, es as AdContextValue, er as AdCreative, eo as AdPosition, en as AdSlot, ep as AdTheme, aS as AddOn, bB as AddOnDetails, bX as AddOnGroupDetails, aU as AddOnOption, bW as AddOnOptionDetails, aV as AddOnOptionPrice, aT as AddOnWithOptions, b$ as AddToCartInput, dS as AddressData, ef as AddressInfo, bq as AdjustmentType, cd as AmountToPay, bx as AppliedDiscount, e1 as AuthResponse, j as AuthService, k as AuthStatus, eh as AuthenticatedData, cN as AuthorizationType, dG as AvailabilityCheck, dH as AvailabilityResult, dn as AvailableSlot, bw as BenefitType, dr as Booking, dh as BookingRequirementOverride, dq as BookingStatus, ds as BookingWithDetails, cx as BufferTimes, b1 as Bundle, b5 as BundleComponentData, b6 as BundleComponentInfo, b0 as BundlePriceType, b3 as BundleProduct, bG as BundleSelectionData, bE as BundleSelectionInput, bF as BundleStoredSelection, b2 as BundleSummary, b4 as BundleWithDetails, cV as Business, d7 as BusinessHours, cU as BusinessPreferences, B as BusinessService, d6 as BusinessSettings, cT as BusinessType, d4 as BusinessWithLocations, W as CHECKOUT_MODE, a7 as CHECKOUT_MUTATION, Z as CHECKOUT_STEP, a3 as CONTACT_TYPE, dw as CancelBookingInput, cr as CancelOrderInput, cz as CancellationPolicy, bL as Cart, bC as CartAddOn, bo as CartChannel, bM as CartItem, bZ as CartItemDetails, f as CartOperations, bn as CartStatus, c1 as CartSummary, bN as CartTotals, e as CatalogueQueries, aX as Category, d8 as CategoryInfo, aY as CategorySummary, m as ChangePasswordInput, du as CheckSlotAvailabilityInput, e4 as CheckoutAddressInfo, e6 as CheckoutCustomerInfo, J as CheckoutFormData, cp as CheckoutInput, z as CheckoutMode, g as CheckoutOperations, D as CheckoutOrderType, F as CheckoutPaymentMethod, N as CheckoutResult, g as CheckoutService, H as CheckoutStep, bv as ChosenPrice, C as CimplifyClient, d as CimplifyConfig, s as CimplifyElement, r as CimplifyElements, ai as CimplifyError, aZ as Collection, a$ as CollectionProduct, a_ as CollectionSummary, bc as ComponentGroup, bd as ComponentGroupWithComponents, bh as ComponentPriceBreakdown, bf as ComponentSelectionInput, b9 as ComponentSourceType, ba as Composite, be as CompositeComponent, bI as CompositePriceBreakdown, bg as CompositePriceResult, b7 as CompositePricingMode, bJ as CompositeSelectionData, bf as CompositeSelectionInput, bH as CompositeStoredSelection, bb as CompositeWithDetails, V as ContactType, dO as CreateAddressInput, dQ as CreateMobileMoneyInput, ad as Currency, dJ as Customer, dK as CustomerAddress, dM as CustomerLinkPreferences, dL as CustomerMobileMoney, cw as CustomerServicePreferences, ab as DEFAULT_COUNTRY, aa as DEFAULT_CURRENCY, a2 as DEVICE_TYPE, dp as DayAvailability, cG as DepositResult, aG as DepositType, R as DeviceType, aF as DigitalProductType, by as DiscountBreakdown, bz as DiscountDetails, bQ as DisplayAddOn, bR as DisplayAddOnOption, bO as DisplayCart, bP as DisplayCartItem, u as ELEMENT_TYPES, E as EVENT_TYPES, ee as ElementAppearance, em as ElementEventHandler, y as ElementEventType, w as ElementOptions, x as ElementType, ei as ElementsCheckoutData, ej as ElementsCheckoutResult, v as ElementsOptions, dU as EnrollAndLinkOrderInput, dX as EnrollAndLinkOrderResult, dR as EnrollmentData, an as Err, ag as ErrorCode, ah as ErrorCodeType, cc as FeeBearerType, ca as FulfillmentLink, c9 as FulfillmentStatus, c8 as FulfillmentType, dt as GetAvailableSlotsInput, i as GetOrdersOptions, G as GetProductsOptions, b8 as GroupPricingBehavior, el as IframeToParentMessage, cR as InitializePaymentResult, I as InventoryService, dI as InventorySummary, aD as InventoryType, K as KitchenOrderItem, q as KitchenOrderResult, a5 as LINK_MUTATION, a4 as LINK_QUERY, bK as LineConfiguration, ce as LineItem, c5 as LineType, dN as LinkData, dW as LinkEnrollResult, L as LinkService, dY as LinkSession, dV as LinkStatusResult, p as LiteBootstrap, o as LiteService, cY as Location, cJ as LocationAppointment, bk as LocationProductPrice, dF as LocationStock, cW as LocationTaxBehavior, cX as LocationTaxOverrides, c$ as LocationTimeProfile, d5 as LocationWithDetails, M as MESSAGE_TYPES, a0 as MOBILE_MONEY_PROVIDER, dT as MobileMoneyData, e5 as MobileMoneyDetails, Q as MobileMoneyProvider, ac as Money, a9 as ORDER_MUTATION, X as ORDER_TYPE, ed as ObservabilityHooks, am as Ok, cf as Order, c4 as OrderChannel, co as OrderFilter, cb as OrderFulfillmentSummary, ci as OrderGroup, cm as OrderGroupDetails, cj as OrderGroupPayment, ch as OrderGroupPaymentState, cl as OrderGroupPaymentSummary, cg as OrderHistory, c6 as OrderLineState, c7 as OrderLineStatus, cn as OrderPaymentEvent, O as OrderQueries, ck as OrderSplitDetail, c2 as OrderStatus, l as OtpResult, Y as PAYMENT_METHOD, a8 as PAYMENT_MUTATION, _ as PAYMENT_STATE, $ as PICKUP_TIME_TYPE, af as Pagination, ae as PaginationParams, ek as ParentToIframeMessage, cQ as Payment, cP as PaymentMethod, eg as PaymentMethodInfo, cM as PaymentMethodType, cO as PaymentProcessingState, cL as PaymentProvider, c3 as PaymentState, cK as PaymentStatus, e3 as PickupTime, e2 as PickupTimeType, bj as Price, br as PriceAdjustment, bu as PriceDecisionPath, bi as PriceEntryType, bt as PricePathTaxInfo, bp as PriceSource, cB as PricingOverrides, aI as Product, aW as ProductAddOn, bl as ProductAvailability, dD as ProductStock, bm as ProductTimeProfile, aC as ProductType, aK as ProductVariant, aP as ProductVariantValue, aJ as ProductWithDetails, cs as RefundOrderInput, cv as ReminderMethod, cy as ReminderSettings, e7 as RequestContext, ea as RequestErrorEvent, d$ as RequestOtpInput, e8 as RequestStartEvent, e9 as RequestSuccessEvent, dv as RescheduleBookingInput, cE as ResourceAssignment, de as ResourceAvailabilityException, dd as ResourceAvailabilityRule, di as ResourceType, al as Result, eb as RetryEvent, d_ as RevokeAllSessionsResult, dZ as RevokeSessionResult, d1 as Room, aH as SalesChannel, cC as SchedulingMetadata, cF as SchedulingResult, n as SchedulingService, S as SearchOptions, bA as SelectedAddOnOption, dj as Service, da as ServiceAvailabilityException, dx as ServiceAvailabilityParams, dy as ServiceAvailabilityResult, d9 as ServiceAvailabilityRule, d2 as ServiceCharge, cA as ServiceNotes, cH as ServiceScheduleRequest, dg as ServiceStaffRequirement, ct as ServiceStatus, dk as ServiceWithStaff, ec as SessionChangeEvent, dl as Staff, cD as StaffAssignment, dc as StaffAvailabilityException, db as StaffAvailabilityRule, df as StaffBookingProfile, cu as StaffRole, cI as StaffScheduleItem, dB as Stock, dC as StockLevel, dz as StockOwnershipType, dA as StockStatus, d3 as StorefrontBootstrap, cS as SubmitAuthorizationInput, d0 as Table, T as TableInfo, bs as TaxPathComponent, cZ as TimeRange, c_ as TimeRanges, dm as TimeSlot, b_ as UICart, bS as UICartBusiness, bU as UICartCustomer, bT as UICartLocation, bV as UICartPricing, dP as UpdateAddressInput, c0 as UpdateCartItemInput, cq as UpdateOrderStatusInput, U as UpdateProfileInput, aM as VariantAxis, aR as VariantAxisSelection, aO as VariantAxisValue, aN as VariantAxisWithValues, bD as VariantDetails, bY as VariantDetailsDTO, aL as VariantDisplayAttribute, aQ as VariantLocationAvailability, dE as VariantStock, aE as VariantStrategy, e0 as VerifyOtpInput, aA as combine, aB as combineObject, c as createCimplifyClient, t as createElements, ap as err, au as flatMap, ay as fromPromise, h as generateIdempotencyKey, av as getOrElse, aj as isCimplifyError, ar as isErr, aq as isOk, ak as isRetryableError, at as mapError, as as mapResult, ao as ok, ax as toNullable, az as tryCatch, aw as unwrap } from './ads-BNcVdZrK.js';
1
+ import { P as PaymentErrorDetails, a as PaymentResponse, b as PaymentStatusResponse, A as ApiError } from './ads-B5jcLFpD.js';
2
+ export { a2 as AUTHORIZATION_TYPE, a7 as AUTH_MUTATION, eu as AdConfig, ew as AdContextValue, ev as AdCreative, es as AdPosition, er as AdSlot, et as AdTheme, aT as AddOn, bC as AddOnDetails, bY as AddOnGroupDetails, aV as AddOnOption, bX as AddOnOptionDetails, aW as AddOnOptionPrice, aU as AddOnWithOptions, c0 as AddToCartInput, dT as AddressData, ej as AddressInfo, br as AdjustmentType, ce as AmountToPay, by as AppliedDiscount, e2 as AuthResponse, j as AuthService, k as AuthStatus, el as AuthenticatedData, cO as AuthorizationType, dH as AvailabilityCheck, dI as AvailabilityResult, dp as AvailableSlot, bx as BenefitType, ds as Booking, di as BookingRequirementOverride, dr as BookingStatus, dt as BookingWithDetails, cy as BufferTimes, b2 as Bundle, b6 as BundleComponentData, b7 as BundleComponentInfo, b1 as BundlePriceType, b4 as BundleProduct, bH as BundleSelectionData, bF as BundleSelectionInput, bG as BundleStoredSelection, b3 as BundleSummary, b5 as BundleWithDetails, cW as Business, d8 as BusinessHours, cV as BusinessPreferences, B as BusinessService, d7 as BusinessSettings, cU as BusinessType, d5 as BusinessWithLocations, X as CHECKOUT_MODE, a8 as CHECKOUT_MUTATION, _ as CHECKOUT_STEP, a4 as CONTACT_TYPE, dx as CancelBookingInput, cs as CancelOrderInput, cA as CancellationPolicy, bM as Cart, bD as CartAddOn, bp as CartChannel, bN as CartItem, b_ as CartItemDetails, f as CartOperations, bo as CartStatus, c2 as CartSummary, bO as CartTotals, e as CatalogueQueries, aY as Category, d9 as CategoryInfo, aZ as CategorySummary, m as ChangePasswordInput, dv as CheckSlotAvailabilityInput, e5 as CheckoutAddressInfo, e7 as CheckoutCustomerInfo, N as CheckoutFormData, cq as CheckoutInput, z as CheckoutMode, g as CheckoutOperations, D as CheckoutOrderType, H as CheckoutPaymentMethod, Q as CheckoutResult, g as CheckoutService, J as CheckoutStep, bw as ChosenPrice, C as CimplifyClient, d as CimplifyConfig, s as CimplifyElement, r as CimplifyElements, aj as CimplifyError, a_ as Collection, b0 as CollectionProduct, a$ as CollectionSummary, bd as ComponentGroup, be as ComponentGroupWithComponents, bi as ComponentPriceBreakdown, bg as ComponentSelectionInput, ba as ComponentSourceType, bb as Composite, bf as CompositeComponent, bJ as CompositePriceBreakdown, bh as CompositePriceResult, b8 as CompositePricingMode, bK as CompositeSelectionData, bg as CompositeSelectionInput, bI as CompositeStoredSelection, bc as CompositeWithDetails, W as ContactType, dP as CreateAddressInput, dR as CreateMobileMoneyInput, ae as Currency, dK as Customer, dL as CustomerAddress, dN as CustomerLinkPreferences, dM as CustomerMobileMoney, cx as CustomerServicePreferences, ac as DEFAULT_COUNTRY, ab as DEFAULT_CURRENCY, a3 as DEVICE_TYPE, dq as DayAvailability, cH as DepositResult, aH as DepositType, V as DeviceType, aG as DigitalProductType, bz as DiscountBreakdown, bA as DiscountDetails, bR as DisplayAddOn, bS as DisplayAddOnOption, bP as DisplayCart, bQ as DisplayCartItem, u as ELEMENT_TYPES, E as EVENT_TYPES, ei as ElementAppearance, eq as ElementEventHandler, y as ElementEventType, w as ElementOptions, x as ElementType, em as ElementsCheckoutData, en as ElementsCheckoutResult, v as ElementsOptions, dV as EnrollAndLinkOrderInput, dY as EnrollAndLinkOrderResult, dS as EnrollmentData, ao as Err, ah as ErrorCode, ai as ErrorCodeType, cd as FeeBearerType, cb as FulfillmentLink, ca as FulfillmentStatus, c9 as FulfillmentType, e9 as FxQuote, e8 as FxQuoteRequest, ea as FxRateResponse, F as FxService, du as GetAvailableSlotsInput, i as GetOrdersOptions, G as GetProductsOptions, b9 as GroupPricingBehavior, ep as IframeToParentMessage, cS as InitializePaymentResult, I as InventoryService, dJ as InventorySummary, aE as InventoryType, K as KitchenOrderItem, q as KitchenOrderResult, a6 as LINK_MUTATION, a5 as LINK_QUERY, bL as LineConfiguration, cf as LineItem, c6 as LineType, dO as LinkData, dX as LinkEnrollResult, L as LinkService, dZ as LinkSession, dW as LinkStatusResult, p as LiteBootstrap, o as LiteService, cZ as Location, cK as LocationAppointment, bl as LocationProductPrice, dG as LocationStock, cX as LocationTaxBehavior, cY as LocationTaxOverrides, d0 as LocationTimeProfile, d6 as LocationWithDetails, M as MESSAGE_TYPES, a1 as MOBILE_MONEY_PROVIDER, dU as MobileMoneyData, e6 as MobileMoneyDetails, R as MobileMoneyProvider, ad as Money, aa as ORDER_MUTATION, Y as ORDER_TYPE, eh as ObservabilityHooks, an as Ok, cg as Order, c5 as OrderChannel, cp as OrderFilter, cc as OrderFulfillmentSummary, cj as OrderGroup, cn as OrderGroupDetails, ck as OrderGroupPayment, ci as OrderGroupPaymentState, cm as OrderGroupPaymentSummary, ch as OrderHistory, c7 as OrderLineState, c8 as OrderLineStatus, co as OrderPaymentEvent, O as OrderQueries, cl as OrderSplitDetail, c3 as OrderStatus, l as OtpResult, Z as PAYMENT_METHOD, a9 as PAYMENT_MUTATION, $ as PAYMENT_STATE, a0 as PICKUP_TIME_TYPE, ag as Pagination, af as PaginationParams, eo as ParentToIframeMessage, cR as Payment, cQ as PaymentMethod, ek as PaymentMethodInfo, cN as PaymentMethodType, cP as PaymentProcessingState, cM as PaymentProvider, c4 as PaymentState, cL as PaymentStatus, e4 as PickupTime, e3 as PickupTimeType, bk as Price, bs as PriceAdjustment, bv as PriceDecisionPath, bj as PriceEntryType, bu as PricePathTaxInfo, bq as PriceSource, cC as PricingOverrides, aJ as Product, aX as ProductAddOn, bm as ProductAvailability, dE as ProductStock, bn as ProductTimeProfile, aD as ProductType, aL as ProductVariant, aQ as ProductVariantValue, aK as ProductWithDetails, ct as RefundOrderInput, cw as ReminderMethod, cz as ReminderSettings, eb as RequestContext, ee as RequestErrorEvent, e0 as RequestOtpInput, ec as RequestStartEvent, ed as RequestSuccessEvent, dw as RescheduleBookingInput, cF as ResourceAssignment, df as ResourceAvailabilityException, de as ResourceAvailabilityRule, dj as ResourceType, am as Result, ef as RetryEvent, d$ as RevokeAllSessionsResult, d_ as RevokeSessionResult, d2 as Room, aI as SalesChannel, cD as SchedulingMetadata, cG as SchedulingResult, n as SchedulingService, S as SearchOptions, bB as SelectedAddOnOption, dk as Service, db as ServiceAvailabilityException, dy as ServiceAvailabilityParams, dz as ServiceAvailabilityResult, da as ServiceAvailabilityRule, d3 as ServiceCharge, cB as ServiceNotes, cI as ServiceScheduleRequest, dh as ServiceStaffRequirement, cu as ServiceStatus, dl as ServiceWithStaff, eg as SessionChangeEvent, dm as Staff, cE as StaffAssignment, dd as StaffAvailabilityException, dc as StaffAvailabilityRule, dg as StaffBookingProfile, cv as StaffRole, cJ as StaffScheduleItem, dC as Stock, dD as StockLevel, dA as StockOwnershipType, dB as StockStatus, d4 as StorefrontBootstrap, cT as SubmitAuthorizationInput, d1 as Table, T as TableInfo, bt as TaxPathComponent, c_ as TimeRange, c$ as TimeRanges, dn as TimeSlot, b$ as UICart, bT as UICartBusiness, bV as UICartCustomer, bU as UICartLocation, bW as UICartPricing, dQ as UpdateAddressInput, c1 as UpdateCartItemInput, cr as UpdateOrderStatusInput, U as UpdateProfileInput, aN as VariantAxis, aS as VariantAxisSelection, aP as VariantAxisValue, aO as VariantAxisWithValues, bE as VariantDetails, bZ as VariantDetailsDTO, aM as VariantDisplayAttribute, aR as VariantLocationAvailability, dF as VariantStock, aF as VariantStrategy, e1 as VerifyOtpInput, aB as combine, aC as combineObject, c as createCimplifyClient, t as createElements, aq as err, av as flatMap, az as fromPromise, h as generateIdempotencyKey, aw as getOrElse, ak as isCimplifyError, as as isErr, ar as isOk, al as isRetryableError, au as mapError, at as mapResult, ap as ok, ay as toNullable, aA as tryCatch, ax as unwrap } from './ads-B5jcLFpD.js';
3
3
 
4
4
  type Operator = "==" | "!=" | ">" | "<" | ">=" | "<=" | "contains" | "startsWith";
5
5
  type SortOrder = "asc" | "desc";
@@ -408,16 +408,22 @@ declare const MOBILE_MONEY_PROVIDERS: {
408
408
  */
409
409
  declare function detectMobileMoneyProvider(phoneNumber: string): "mtn" | "vodafone" | "airtel" | null;
410
410
 
411
+ /** Context sent with every request to scope operations to a specific location/branch */
412
+ interface FrontendContext {
413
+ location_id?: string;
414
+ }
411
415
  /** Request body for POST /api/q */
412
416
  interface QueryRequest {
413
417
  query: string;
414
418
  variables?: Record<string, unknown>;
415
419
  cache_hint?: string;
420
+ context?: FrontendContext;
416
421
  }
417
422
  /** Request body for POST /api/m */
418
423
  interface MutationRequest {
419
424
  method: string;
420
425
  args: unknown[];
426
+ context?: FrontendContext;
421
427
  }
422
428
  /** Response metadata */
423
429
  interface ResponseMetadata {
@@ -432,4 +438,4 @@ interface ApiResponse<T> {
432
438
  metadata?: ResponseMetadata;
433
439
  }
434
440
 
435
- export { ApiError, type ApiResponse, CURRENCY_SYMBOLS, type FormatCompactOptions, type FormatPriceOptions, MOBILE_MONEY_PROVIDERS, type MutationRequest, type ParsedPrice, PaymentErrorDetails, PaymentResponse, PaymentStatusResponse, type PriceInfo, type ProductWithPrice, QueryBuilder, type QueryRequest, type ResponseMetadata, type TaxComponent, type TaxInfo, categorizePaymentError, detectMobileMoneyProvider, extractPriceInfo, formatMoney, formatNumberCompact, formatPrice, formatPriceAdjustment, formatPriceCompact, formatProductPrice, getBasePrice, getCurrencySymbol, getDiscountPercentage, getDisplayPrice, getMarkupPercentage, getProductCurrency, isOnSale, normalizePaymentResponse, normalizeStatusResponse, parsePrice, parsePricePath, parsedPriceToPriceInfo, query };
441
+ export { ApiError, type ApiResponse, CURRENCY_SYMBOLS, type FormatCompactOptions, type FormatPriceOptions, type FrontendContext, MOBILE_MONEY_PROVIDERS, type MutationRequest, type ParsedPrice, PaymentErrorDetails, PaymentResponse, PaymentStatusResponse, type PriceInfo, type ProductWithPrice, QueryBuilder, type QueryRequest, type ResponseMetadata, type TaxComponent, type TaxInfo, categorizePaymentError, detectMobileMoneyProvider, extractPriceInfo, formatMoney, formatNumberCompact, formatPrice, formatPriceAdjustment, formatPriceCompact, formatProductPrice, getBasePrice, getCurrencySymbol, getDiscountPercentage, getDisplayPrice, getMarkupPercentage, getProductCurrency, isOnSale, normalizePaymentResponse, normalizeStatusResponse, parsePrice, parsePricePath, parsedPriceToPriceInfo, query };
package/dist/index.js CHANGED
@@ -1230,6 +1230,33 @@ var LiteService = class {
1230
1230
  }
1231
1231
  };
1232
1232
 
1233
+ // src/fx.ts
1234
+ function toCimplifyError11(error) {
1235
+ if (error instanceof CimplifyError) return error;
1236
+ if (error instanceof Error) {
1237
+ return new CimplifyError("UNKNOWN_ERROR", error.message, false);
1238
+ }
1239
+ return new CimplifyError("UNKNOWN_ERROR", String(error), false);
1240
+ }
1241
+ async function safe11(promise) {
1242
+ try {
1243
+ return ok(await promise);
1244
+ } catch (error) {
1245
+ return err(toCimplifyError11(error));
1246
+ }
1247
+ }
1248
+ var FxService = class {
1249
+ constructor(client) {
1250
+ this.client = client;
1251
+ }
1252
+ async getRate(from, to) {
1253
+ return safe11(this.client.call("fx.getRate", { from, to }));
1254
+ }
1255
+ async lockQuote(request) {
1256
+ return safe11(this.client.call("fx.lockQuote", request));
1257
+ }
1258
+ };
1259
+
1233
1260
  // src/types/elements.ts
1234
1261
  var ELEMENT_TYPES = {
1235
1262
  AUTH: "auth",
@@ -1653,6 +1680,7 @@ function getEnvPublicKey() {
1653
1680
  var CimplifyClient = class {
1654
1681
  constructor(config = {}) {
1655
1682
  this.accessToken = null;
1683
+ this.context = {};
1656
1684
  this.inflightRequests = /* @__PURE__ */ new Map();
1657
1685
  this.publicKey = config.publicKey || getEnvPublicKey() || "";
1658
1686
  const urls = deriveUrls();
@@ -1701,6 +1729,18 @@ var CimplifyClient = class {
1701
1729
  source: "clear"
1702
1730
  });
1703
1731
  }
1732
+ /** Set the active location/branch for all subsequent requests */
1733
+ setLocationId(locationId) {
1734
+ if (locationId) {
1735
+ this.context.location_id = locationId;
1736
+ } else {
1737
+ delete this.context.location_id;
1738
+ }
1739
+ }
1740
+ /** Get the currently active location ID */
1741
+ getLocationId() {
1742
+ return this.context.location_id ?? null;
1743
+ }
1704
1744
  loadAccessToken() {
1705
1745
  if (typeof window !== "undefined" && window.localStorage) {
1706
1746
  return localStorage.getItem(ACCESS_TOKEN_STORAGE_KEY);
@@ -1829,6 +1869,9 @@ var CimplifyClient = class {
1829
1869
  if (variables) {
1830
1870
  body.variables = variables;
1831
1871
  }
1872
+ if (Object.keys(this.context).length > 0) {
1873
+ body.context = this.context;
1874
+ }
1832
1875
  const key = this.getDedupeKey("query", body);
1833
1876
  return this.deduplicatedRequest(key, async () => {
1834
1877
  const response = await this.resilientFetch(`${this.baseUrl}/api/q`, {
@@ -1845,6 +1888,9 @@ var CimplifyClient = class {
1845
1888
  method,
1846
1889
  args: args !== void 0 ? [args] : []
1847
1890
  };
1891
+ if (Object.keys(this.context).length > 0) {
1892
+ body.context = this.context;
1893
+ }
1848
1894
  const response = await this.resilientFetch(`${this.baseUrl}/api/m`, {
1849
1895
  method: "POST",
1850
1896
  credentials: this.credentials,
@@ -1991,6 +2037,12 @@ var CimplifyClient = class {
1991
2037
  }
1992
2038
  return this._lite;
1993
2039
  }
2040
+ get fx() {
2041
+ if (!this._fx) {
2042
+ this._fx = new FxService(this);
2043
+ }
2044
+ return this._fx;
2045
+ }
1994
2046
  /**
1995
2047
  * Create a CimplifyElements instance for embedding checkout components.
1996
2048
  * Like Stripe's stripe.elements().
@@ -2587,6 +2639,7 @@ exports.DEVICE_TYPE = DEVICE_TYPE;
2587
2639
  exports.ELEMENT_TYPES = ELEMENT_TYPES;
2588
2640
  exports.EVENT_TYPES = EVENT_TYPES;
2589
2641
  exports.ErrorCode = ErrorCode;
2642
+ exports.FxService = FxService;
2590
2643
  exports.InventoryService = InventoryService;
2591
2644
  exports.LINK_MUTATION = LINK_MUTATION;
2592
2645
  exports.LINK_QUERY = LINK_QUERY;
package/dist/index.mjs CHANGED
@@ -1228,6 +1228,33 @@ var LiteService = class {
1228
1228
  }
1229
1229
  };
1230
1230
 
1231
+ // src/fx.ts
1232
+ function toCimplifyError11(error) {
1233
+ if (error instanceof CimplifyError) return error;
1234
+ if (error instanceof Error) {
1235
+ return new CimplifyError("UNKNOWN_ERROR", error.message, false);
1236
+ }
1237
+ return new CimplifyError("UNKNOWN_ERROR", String(error), false);
1238
+ }
1239
+ async function safe11(promise) {
1240
+ try {
1241
+ return ok(await promise);
1242
+ } catch (error) {
1243
+ return err(toCimplifyError11(error));
1244
+ }
1245
+ }
1246
+ var FxService = class {
1247
+ constructor(client) {
1248
+ this.client = client;
1249
+ }
1250
+ async getRate(from, to) {
1251
+ return safe11(this.client.call("fx.getRate", { from, to }));
1252
+ }
1253
+ async lockQuote(request) {
1254
+ return safe11(this.client.call("fx.lockQuote", request));
1255
+ }
1256
+ };
1257
+
1231
1258
  // src/types/elements.ts
1232
1259
  var ELEMENT_TYPES = {
1233
1260
  AUTH: "auth",
@@ -1651,6 +1678,7 @@ function getEnvPublicKey() {
1651
1678
  var CimplifyClient = class {
1652
1679
  constructor(config = {}) {
1653
1680
  this.accessToken = null;
1681
+ this.context = {};
1654
1682
  this.inflightRequests = /* @__PURE__ */ new Map();
1655
1683
  this.publicKey = config.publicKey || getEnvPublicKey() || "";
1656
1684
  const urls = deriveUrls();
@@ -1699,6 +1727,18 @@ var CimplifyClient = class {
1699
1727
  source: "clear"
1700
1728
  });
1701
1729
  }
1730
+ /** Set the active location/branch for all subsequent requests */
1731
+ setLocationId(locationId) {
1732
+ if (locationId) {
1733
+ this.context.location_id = locationId;
1734
+ } else {
1735
+ delete this.context.location_id;
1736
+ }
1737
+ }
1738
+ /** Get the currently active location ID */
1739
+ getLocationId() {
1740
+ return this.context.location_id ?? null;
1741
+ }
1702
1742
  loadAccessToken() {
1703
1743
  if (typeof window !== "undefined" && window.localStorage) {
1704
1744
  return localStorage.getItem(ACCESS_TOKEN_STORAGE_KEY);
@@ -1827,6 +1867,9 @@ var CimplifyClient = class {
1827
1867
  if (variables) {
1828
1868
  body.variables = variables;
1829
1869
  }
1870
+ if (Object.keys(this.context).length > 0) {
1871
+ body.context = this.context;
1872
+ }
1830
1873
  const key = this.getDedupeKey("query", body);
1831
1874
  return this.deduplicatedRequest(key, async () => {
1832
1875
  const response = await this.resilientFetch(`${this.baseUrl}/api/q`, {
@@ -1843,6 +1886,9 @@ var CimplifyClient = class {
1843
1886
  method,
1844
1887
  args: args !== void 0 ? [args] : []
1845
1888
  };
1889
+ if (Object.keys(this.context).length > 0) {
1890
+ body.context = this.context;
1891
+ }
1846
1892
  const response = await this.resilientFetch(`${this.baseUrl}/api/m`, {
1847
1893
  method: "POST",
1848
1894
  credentials: this.credentials,
@@ -1989,6 +2035,12 @@ var CimplifyClient = class {
1989
2035
  }
1990
2036
  return this._lite;
1991
2037
  }
2038
+ get fx() {
2039
+ if (!this._fx) {
2040
+ this._fx = new FxService(this);
2041
+ }
2042
+ return this._fx;
2043
+ }
1992
2044
  /**
1993
2045
  * Create a CimplifyElements instance for embedding checkout components.
1994
2046
  * Like Stripe's stripe.elements().
@@ -2562,4 +2614,4 @@ function detectMobileMoneyProvider(phoneNumber) {
2562
2614
  return null;
2563
2615
  }
2564
2616
 
2565
- export { AUTHORIZATION_TYPE, AUTH_MUTATION, AuthService, BusinessService, CHECKOUT_MODE, CHECKOUT_MUTATION, CHECKOUT_STEP, CONTACT_TYPE, CURRENCY_SYMBOLS, CartOperations, CatalogueQueries, CheckoutService as CheckoutOperations, CheckoutService, CimplifyClient, CimplifyElement, CimplifyElements, CimplifyError, DEFAULT_COUNTRY, DEFAULT_CURRENCY, DEVICE_TYPE, ELEMENT_TYPES, EVENT_TYPES, ErrorCode, InventoryService, LINK_MUTATION, LINK_QUERY, LinkService, LiteService, MESSAGE_TYPES, MOBILE_MONEY_PROVIDER, MOBILE_MONEY_PROVIDERS, ORDER_MUTATION, ORDER_TYPE, OrderQueries, PAYMENT_METHOD, PAYMENT_MUTATION, PAYMENT_STATE, PICKUP_TIME_TYPE, QueryBuilder, SchedulingService, categorizePaymentError, combine, combineObject, createCimplifyClient, createElements, detectMobileMoneyProvider, err, extractPriceInfo, flatMap, formatMoney, formatNumberCompact, formatPrice, formatPriceAdjustment, formatPriceCompact, formatProductPrice, fromPromise, generateIdempotencyKey, getBasePrice, getCurrencySymbol, getDiscountPercentage, getDisplayPrice, getMarkupPercentage, getOrElse, getProductCurrency, isCimplifyError, isErr, isOk, isOnSale, isRetryableError, mapError, mapResult, normalizePaymentResponse, normalizeStatusResponse, ok, parsePrice, parsePricePath, parsedPriceToPriceInfo, query, toNullable, tryCatch, unwrap };
2617
+ export { AUTHORIZATION_TYPE, AUTH_MUTATION, AuthService, BusinessService, CHECKOUT_MODE, CHECKOUT_MUTATION, CHECKOUT_STEP, CONTACT_TYPE, CURRENCY_SYMBOLS, CartOperations, CatalogueQueries, CheckoutService as CheckoutOperations, CheckoutService, CimplifyClient, CimplifyElement, CimplifyElements, CimplifyError, DEFAULT_COUNTRY, DEFAULT_CURRENCY, DEVICE_TYPE, ELEMENT_TYPES, EVENT_TYPES, ErrorCode, FxService, InventoryService, LINK_MUTATION, LINK_QUERY, LinkService, LiteService, MESSAGE_TYPES, MOBILE_MONEY_PROVIDER, MOBILE_MONEY_PROVIDERS, ORDER_MUTATION, ORDER_TYPE, OrderQueries, PAYMENT_METHOD, PAYMENT_MUTATION, PAYMENT_STATE, PICKUP_TIME_TYPE, QueryBuilder, SchedulingService, categorizePaymentError, combine, combineObject, createCimplifyClient, createElements, detectMobileMoneyProvider, err, extractPriceInfo, flatMap, formatMoney, formatNumberCompact, formatPrice, formatPriceAdjustment, formatPriceCompact, formatProductPrice, fromPromise, generateIdempotencyKey, getBasePrice, getCurrencySymbol, getDiscountPercentage, getDisplayPrice, getMarkupPercentage, getOrElse, getProductCurrency, isCimplifyError, isErr, isOk, isOnSale, isRetryableError, mapError, mapResult, normalizePaymentResponse, normalizeStatusResponse, ok, parsePrice, parsePricePath, parsedPriceToPriceInfo, query, toNullable, tryCatch, unwrap };
package/dist/react.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { en as AdSlot, eo as AdPosition, es as AdContextValue, r as CimplifyElements, C as CimplifyClient, v as ElementsOptions, eh as AuthenticatedData, ef as AddressInfo, eg as PaymentMethodInfo, ej as ElementsCheckoutResult } from './ads-BNcVdZrK.mjs';
2
- export { eq as AdConfig } from './ads-BNcVdZrK.mjs';
1
+ import { er as AdSlot, es as AdPosition, ew as AdContextValue, r as CimplifyElements, C as CimplifyClient, v as ElementsOptions, el as AuthenticatedData, ej as AddressInfo, ek as PaymentMethodInfo, en as ElementsCheckoutResult } from './ads-B5jcLFpD.mjs';
2
+ export { eu as AdConfig } from './ads-B5jcLFpD.mjs';
3
3
  import React, { ReactNode } from 'react';
4
4
 
5
5
  interface UserIdentity {
package/dist/react.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { en as AdSlot, eo as AdPosition, es as AdContextValue, r as CimplifyElements, C as CimplifyClient, v as ElementsOptions, eh as AuthenticatedData, ef as AddressInfo, eg as PaymentMethodInfo, ej as ElementsCheckoutResult } from './ads-BNcVdZrK.js';
2
- export { eq as AdConfig } from './ads-BNcVdZrK.js';
1
+ import { er as AdSlot, es as AdPosition, ew as AdContextValue, r as CimplifyElements, C as CimplifyClient, v as ElementsOptions, el as AuthenticatedData, ej as AddressInfo, ek as PaymentMethodInfo, en as ElementsCheckoutResult } from './ads-B5jcLFpD.js';
2
+ export { eu as AdConfig } from './ads-B5jcLFpD.js';
3
3
  import React, { ReactNode } from 'react';
4
4
 
5
5
  interface UserIdentity {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cimplify/sdk",
3
- "version": "0.5.2",
3
+ "version": "0.6.0",
4
4
  "description": "Cimplify Commerce SDK for storefronts",
5
5
  "keywords": [
6
6
  "cimplify",