@cimplify/sdk 0.6.10 → 0.6.11

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.
@@ -0,0 +1,38 @@
1
+ export { ad as AUTHORIZATION_TYPE, ai as AUTH_MUTATION, a2 as AbortablePromise, aV as AddOn, bE as AddOnDetails, b_ as AddOnGroupDetails, aX as AddOnOption, bZ as AddOnOptionDetails, aY as AddOnOptionPrice, aW as AddOnWithOptions, c3 as AddToCartInput, dN as AddressData, ed as AddressInfo, bt as AdjustmentType, ch as AmountToPay, bA as AppliedDiscount, dY as AuthResponse, A as AuthService, m as AuthStatus, ef as AuthenticatedCustomer, eh as AuthenticatedData, dB as AvailabilityCheck, dC as AvailabilityResult, di as AvailableSlot, bz as BenefitType, dl as Booking, dc as BookingRequirementOverride, dk as BookingStatus, dm as BookingWithDetails, cB as BufferTimes, b4 as Bundle, b8 as BundleComponentData, b9 as BundleComponentInfo, b3 as BundlePriceType, b6 as BundleProduct, bJ as BundleSelectionData, bH as BundleSelectionInput, bI as BundleStoredSelection, b5 as BundleSummary, b7 as BundleWithDetails, cQ as Business, d2 as BusinessHours, cP as BusinessPreferences, B as BusinessService, d1 as BusinessSettings, cO as BusinessType, c$ as BusinessWithLocations, a6 as CHECKOUT_MODE, aj as CHECKOUT_MUTATION, a9 as CHECKOUT_STEP, af as CONTACT_TYPE, dr as CancelBookingInput, cv as CancelOrderInput, cD as CancellationPolicy, bO as Cart, bF as CartAddOn, br as CartChannel, bP as CartItem, c0 as CartItemDetails, i as CartOperations, bq as CartStatus, c5 as CartSummary, bQ as CartTotals, b as CatalogueQueries, a_ as Category, d3 as CategoryInfo, a$ as CategorySummary, o as ChangePasswordInput, dp as CheckSlotAvailabilityInput, d$ as CheckoutAddressInfo, e1 as CheckoutCustomerInfo, X as CheckoutFormData, ct as CheckoutInput, J as CheckoutMode, j as CheckoutOperations, N as CheckoutOrderType, V as CheckoutPaymentMethod, Y as CheckoutResult, j as CheckoutService, a0 as CheckoutStatus, a1 as CheckoutStatusContext, W as CheckoutStep, by as ChosenPrice, C as CimplifyClient, a as CimplifyConfig, v as CimplifyElement, u as CimplifyElements, b0 as Collection, b2 as CollectionProduct, b1 as CollectionSummary, bf as ComponentGroup, bg as ComponentGroupWithComponents, bk as ComponentPriceBreakdown, bi as ComponentSelectionInput, bc as ComponentSourceType, bd as Composite, bh as CompositeComponent, bL as CompositePriceBreakdown, bj as CompositePriceResult, ba as CompositePricingMode, bM as CompositeSelectionData, bi as CompositeSelectionInput, bK as CompositeStoredSelection, be as CompositeWithDetails, a5 as ContactType, dJ as CreateAddressInput, dL as CreateMobileMoneyInput, dE as Customer, dF as CustomerAddress, dH as CustomerLinkPreferences, dG as CustomerMobileMoney, cA as CustomerServicePreferences, an as DEFAULT_COUNTRY, am as DEFAULT_CURRENCY, ae as DEVICE_TYPE, dj as DayAvailability, cK as DepositResult, aJ as DepositType, a4 as DeviceType, aI as DigitalProductType, bB as DiscountBreakdown, bC as DiscountDetails, bT as DisplayAddOn, bU as DisplayAddOnOption, bR as DisplayCart, bS as DisplayCartItem, x as ELEMENT_TYPES, E as EVENT_TYPES, ec as ElementAppearance, em as ElementEventHandler, H as ElementEventType, z as ElementOptions, D as ElementType, ei as ElementsCheckoutData, ej as ElementsCheckoutResult, eg as ElementsCustomerInfo, y as ElementsOptions, dP as EnrollAndLinkOrderInput, dS as EnrollAndLinkOrderResult, dM as EnrollmentData, aq as Err, cg as FeeBearerType, F as FetchQuoteInput, ce as FulfillmentLink, cd as FulfillmentStatus, cc as FulfillmentType, e3 as FxQuote, e2 as FxQuoteRequest, e4 as FxRateResponse, r as FxService, dn as GetAvailableSlotsInput, l as GetOrdersOptions, G as GetProductsOptions, bb as GroupPricingBehavior, el as IframeToParentMessage, I as InventoryService, dD as InventorySummary, aG as InventoryType, K as KitchenOrderItem, t as KitchenOrderResult, ah as LINK_MUTATION, ag as LINK_QUERY, bN as LineConfiguration, ci as LineItem, c9 as LineType, dI as LinkData, dR as LinkEnrollResult, L as LinkService, dT as LinkSession, dQ as LinkStatusResult, s as LiteBootstrap, q as LiteService, cT as Location, cN as LocationAppointment, bn as LocationProductPrice, dA as LocationStock, cR as LocationTaxBehavior, cS as LocationTaxOverrides, cW as LocationTimeProfile, d0 as LocationWithDetails, M as MESSAGE_TYPES, ac as MOBILE_MONEY_PROVIDER, dO as MobileMoneyData, e0 as MobileMoneyDetails, a3 as MobileMoneyProvider, al as ORDER_MUTATION, a7 as ORDER_TYPE, eb as ObservabilityHooks, ap as Ok, cj as Order, c8 as OrderChannel, cs as OrderFilter, cf as OrderFulfillmentSummary, cm as OrderGroup, cq as OrderGroupDetails, cn as OrderGroupPayment, cl as OrderGroupPaymentState, cp as OrderGroupPaymentSummary, ck as OrderHistory, ca as OrderLineState, cb as OrderLineStatus, cr as OrderPaymentEvent, O as OrderQueries, co as OrderSplitDetail, c6 as OrderStatus, n as OtpResult, a8 as PAYMENT_METHOD, ak as PAYMENT_MUTATION, aa as PAYMENT_STATE, ab as PICKUP_TIME_TYPE, ek as ParentToIframeMessage, ee as PaymentMethodInfo, c7 as PaymentState, d_ as PickupTime, dZ as PickupTimeType, bm as Price, bu as PriceAdjustment, bx as PriceDecisionPath, bl as PriceEntryType, bw as PricePathTaxInfo, P as PriceQuote, bs as PriceSource, cF as PricingOverrides, $ as ProcessAndResolveOptions, Z as ProcessCheckoutOptions, _ as ProcessCheckoutResult, aL as Product, aZ as ProductAddOn, bo as ProductAvailability, dy as ProductStock, bp as ProductTimeProfile, aF as ProductType, aN as ProductVariant, aS as ProductVariantValue, aM as ProductWithDetails, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, h as RefreshQuoteResult, cw as RefundOrderInput, cz as ReminderMethod, cC as ReminderSettings, e5 as RequestContext, e8 as RequestErrorEvent, dW as RequestOtpInput, e6 as RequestStartEvent, e7 as RequestSuccessEvent, dq as RescheduleBookingInput, cI as ResourceAssignment, d9 as ResourceAvailabilityException, d8 as ResourceAvailabilityRule, dd as ResourceType, ao as Result, e9 as RetryEvent, dV as RevokeAllSessionsResult, dU as RevokeSessionResult, cY as Room, aK as SalesChannel, cG as SchedulingMetadata, cJ as SchedulingResult, p as SchedulingService, S as SearchOptions, bD as SelectedAddOnOption, de as Service, d5 as ServiceAvailabilityException, ds as ServiceAvailabilityParams, dt as ServiceAvailabilityResult, d4 as ServiceAvailabilityRule, cZ as ServiceCharge, cE as ServiceNotes, cL as ServiceScheduleRequest, db as ServiceStaffRequirement, cx as ServiceStatus, df as ServiceWithStaff, ea as SessionChangeEvent, dg as Staff, cH as StaffAssignment, d7 as StaffAvailabilityException, d6 as StaffAvailabilityRule, da as StaffBookingProfile, cy as StaffRole, cM as StaffScheduleItem, dw as Stock, dx as StockLevel, du as StockOwnershipType, dv as StockStatus, c_ as StorefrontBootstrap, cX as Table, T as TableInfo, bv as TaxPathComponent, cU as TimeRange, cV as TimeRanges, dh as TimeSlot, c1 as UICart, bV as UICartBusiness, bX as UICartCustomer, bW as UICartLocation, bY as UICartPricing, c2 as UICartResponse, dK as UpdateAddressInput, c4 as UpdateCartItemInput, cu as UpdateOrderStatusInput, U as UpdateProfileInput, aP as VariantAxis, aU as VariantAxisSelection, aR as VariantAxisValue, aQ as VariantAxisWithValues, bG as VariantDetails, b$ as VariantDetailsDTO, aO as VariantDisplayAttribute, aT as VariantLocationAvailability, dz as VariantStock, aH as VariantStrategy, dX as VerifyOtpInput, aD as combine, aE as combineObject, c as createCimplifyClient, w as createElements, as as err, ax as flatMap, aB as fromPromise, k as generateIdempotencyKey, ay as getOrElse, au as isErr, at as isOk, aw as mapError, av as mapResult, ar as ok, aA as toNullable, aC as tryCatch, az as unwrap } from './client-BngAGN0v.mjs';
2
+ export { QueryBuilder, query } from './advanced.mjs';
3
+ import { A as ApiError } from './payment-Cu75tmUc.mjs';
4
+ export { q as AuthorizationType, h as CimplifyError, b as Currency, C as CurrencyCode, g as ERROR_HINTS, E as ErrorCode, e as ErrorCodeType, f as ErrorHint, I as InitializePaymentResult, M as Money, d as Pagination, P as PaginationParams, t as Payment, w as PaymentErrorDetails, s as PaymentMethod, p as PaymentMethodType, r as PaymentProcessingState, o as PaymentProvider, u as PaymentResponse, n as PaymentStatus, v as PaymentStatusResponse, S as SubmitAuthorizationInput, Z as ZERO, c as currencyCode, k as enrichError, j as getErrorHint, i as isCimplifyError, l as isRetryableError, m as money, a as moneyFromNumber } from './payment-Cu75tmUc.mjs';
5
+ export { C as CURRENCY_SYMBOLS, x as FormatCompactOptions, F as FormatPriceOptions, M as MOBILE_MONEY_PROVIDERS, P as PriceInfo, w as ProductWithPrice, T as TaxComponent, v as TaxInfo, n as categorizePaymentError, u as detectMobileMoneyProvider, c as formatMoney, d as formatNumberCompact, f as formatPrice, a as formatPriceAdjustment, b as formatPriceCompact, e as formatProductPrice, i as getBasePrice, g as getCurrencySymbol, k as getDiscountPercentage, h as getDisplayPrice, l as getMarkupPercentage, m as getProductCurrency, j as isOnSale, r as isPaymentStatusFailure, s as isPaymentStatusRequiresAction, t as isPaymentStatusSuccess, o as normalizePaymentResponse, q as normalizeStatusResponse, p as parsePrice } from './index-DaKJxoEh.mjs';
6
+ export { c as AdConfig, e as AdContextValue, d as AdCreative, a as AdPosition, A as AdSlot, b as AdTheme } from './ads-t3FBTU8p.mjs';
7
+
8
+ /** Context sent with every request to scope operations to a specific location/branch */
9
+ interface FrontendContext {
10
+ location_id?: string;
11
+ }
12
+ /** Request body for POST /api/q */
13
+ interface QueryRequest {
14
+ query: string;
15
+ variables?: Record<string, unknown>;
16
+ cache_hint?: string;
17
+ context?: FrontendContext;
18
+ }
19
+ /** Request body for POST /api/m */
20
+ interface MutationRequest {
21
+ method: string;
22
+ args: unknown[];
23
+ context?: FrontendContext;
24
+ }
25
+ /** Response metadata */
26
+ interface ResponseMetadata {
27
+ execution_time_ms: number;
28
+ cache_hit: boolean;
29
+ }
30
+ /** Standard API response wrapper */
31
+ interface ApiResponse<T> {
32
+ success: boolean;
33
+ data?: T;
34
+ error?: ApiError;
35
+ metadata?: ResponseMetadata;
36
+ }
37
+
38
+ export { ApiError, type ApiResponse, type FrontendContext, type MutationRequest, type QueryRequest, type ResponseMetadata };
@@ -0,0 +1,38 @@
1
+ export { ad as AUTHORIZATION_TYPE, ai as AUTH_MUTATION, a2 as AbortablePromise, aV as AddOn, bE as AddOnDetails, b_ as AddOnGroupDetails, aX as AddOnOption, bZ as AddOnOptionDetails, aY as AddOnOptionPrice, aW as AddOnWithOptions, c3 as AddToCartInput, dN as AddressData, ed as AddressInfo, bt as AdjustmentType, ch as AmountToPay, bA as AppliedDiscount, dY as AuthResponse, A as AuthService, m as AuthStatus, ef as AuthenticatedCustomer, eh as AuthenticatedData, dB as AvailabilityCheck, dC as AvailabilityResult, di as AvailableSlot, bz as BenefitType, dl as Booking, dc as BookingRequirementOverride, dk as BookingStatus, dm as BookingWithDetails, cB as BufferTimes, b4 as Bundle, b8 as BundleComponentData, b9 as BundleComponentInfo, b3 as BundlePriceType, b6 as BundleProduct, bJ as BundleSelectionData, bH as BundleSelectionInput, bI as BundleStoredSelection, b5 as BundleSummary, b7 as BundleWithDetails, cQ as Business, d2 as BusinessHours, cP as BusinessPreferences, B as BusinessService, d1 as BusinessSettings, cO as BusinessType, c$ as BusinessWithLocations, a6 as CHECKOUT_MODE, aj as CHECKOUT_MUTATION, a9 as CHECKOUT_STEP, af as CONTACT_TYPE, dr as CancelBookingInput, cv as CancelOrderInput, cD as CancellationPolicy, bO as Cart, bF as CartAddOn, br as CartChannel, bP as CartItem, c0 as CartItemDetails, i as CartOperations, bq as CartStatus, c5 as CartSummary, bQ as CartTotals, b as CatalogueQueries, a_ as Category, d3 as CategoryInfo, a$ as CategorySummary, o as ChangePasswordInput, dp as CheckSlotAvailabilityInput, d$ as CheckoutAddressInfo, e1 as CheckoutCustomerInfo, X as CheckoutFormData, ct as CheckoutInput, J as CheckoutMode, j as CheckoutOperations, N as CheckoutOrderType, V as CheckoutPaymentMethod, Y as CheckoutResult, j as CheckoutService, a0 as CheckoutStatus, a1 as CheckoutStatusContext, W as CheckoutStep, by as ChosenPrice, C as CimplifyClient, a as CimplifyConfig, v as CimplifyElement, u as CimplifyElements, b0 as Collection, b2 as CollectionProduct, b1 as CollectionSummary, bf as ComponentGroup, bg as ComponentGroupWithComponents, bk as ComponentPriceBreakdown, bi as ComponentSelectionInput, bc as ComponentSourceType, bd as Composite, bh as CompositeComponent, bL as CompositePriceBreakdown, bj as CompositePriceResult, ba as CompositePricingMode, bM as CompositeSelectionData, bi as CompositeSelectionInput, bK as CompositeStoredSelection, be as CompositeWithDetails, a5 as ContactType, dJ as CreateAddressInput, dL as CreateMobileMoneyInput, dE as Customer, dF as CustomerAddress, dH as CustomerLinkPreferences, dG as CustomerMobileMoney, cA as CustomerServicePreferences, an as DEFAULT_COUNTRY, am as DEFAULT_CURRENCY, ae as DEVICE_TYPE, dj as DayAvailability, cK as DepositResult, aJ as DepositType, a4 as DeviceType, aI as DigitalProductType, bB as DiscountBreakdown, bC as DiscountDetails, bT as DisplayAddOn, bU as DisplayAddOnOption, bR as DisplayCart, bS as DisplayCartItem, x as ELEMENT_TYPES, E as EVENT_TYPES, ec as ElementAppearance, em as ElementEventHandler, H as ElementEventType, z as ElementOptions, D as ElementType, ei as ElementsCheckoutData, ej as ElementsCheckoutResult, eg as ElementsCustomerInfo, y as ElementsOptions, dP as EnrollAndLinkOrderInput, dS as EnrollAndLinkOrderResult, dM as EnrollmentData, aq as Err, cg as FeeBearerType, F as FetchQuoteInput, ce as FulfillmentLink, cd as FulfillmentStatus, cc as FulfillmentType, e3 as FxQuote, e2 as FxQuoteRequest, e4 as FxRateResponse, r as FxService, dn as GetAvailableSlotsInput, l as GetOrdersOptions, G as GetProductsOptions, bb as GroupPricingBehavior, el as IframeToParentMessage, I as InventoryService, dD as InventorySummary, aG as InventoryType, K as KitchenOrderItem, t as KitchenOrderResult, ah as LINK_MUTATION, ag as LINK_QUERY, bN as LineConfiguration, ci as LineItem, c9 as LineType, dI as LinkData, dR as LinkEnrollResult, L as LinkService, dT as LinkSession, dQ as LinkStatusResult, s as LiteBootstrap, q as LiteService, cT as Location, cN as LocationAppointment, bn as LocationProductPrice, dA as LocationStock, cR as LocationTaxBehavior, cS as LocationTaxOverrides, cW as LocationTimeProfile, d0 as LocationWithDetails, M as MESSAGE_TYPES, ac as MOBILE_MONEY_PROVIDER, dO as MobileMoneyData, e0 as MobileMoneyDetails, a3 as MobileMoneyProvider, al as ORDER_MUTATION, a7 as ORDER_TYPE, eb as ObservabilityHooks, ap as Ok, cj as Order, c8 as OrderChannel, cs as OrderFilter, cf as OrderFulfillmentSummary, cm as OrderGroup, cq as OrderGroupDetails, cn as OrderGroupPayment, cl as OrderGroupPaymentState, cp as OrderGroupPaymentSummary, ck as OrderHistory, ca as OrderLineState, cb as OrderLineStatus, cr as OrderPaymentEvent, O as OrderQueries, co as OrderSplitDetail, c6 as OrderStatus, n as OtpResult, a8 as PAYMENT_METHOD, ak as PAYMENT_MUTATION, aa as PAYMENT_STATE, ab as PICKUP_TIME_TYPE, ek as ParentToIframeMessage, ee as PaymentMethodInfo, c7 as PaymentState, d_ as PickupTime, dZ as PickupTimeType, bm as Price, bu as PriceAdjustment, bx as PriceDecisionPath, bl as PriceEntryType, bw as PricePathTaxInfo, P as PriceQuote, bs as PriceSource, cF as PricingOverrides, $ as ProcessAndResolveOptions, Z as ProcessCheckoutOptions, _ as ProcessCheckoutResult, aL as Product, aZ as ProductAddOn, bo as ProductAvailability, dy as ProductStock, bp as ProductTimeProfile, aF as ProductType, aN as ProductVariant, aS as ProductVariantValue, aM as ProductWithDetails, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, h as RefreshQuoteResult, cw as RefundOrderInput, cz as ReminderMethod, cC as ReminderSettings, e5 as RequestContext, e8 as RequestErrorEvent, dW as RequestOtpInput, e6 as RequestStartEvent, e7 as RequestSuccessEvent, dq as RescheduleBookingInput, cI as ResourceAssignment, d9 as ResourceAvailabilityException, d8 as ResourceAvailabilityRule, dd as ResourceType, ao as Result, e9 as RetryEvent, dV as RevokeAllSessionsResult, dU as RevokeSessionResult, cY as Room, aK as SalesChannel, cG as SchedulingMetadata, cJ as SchedulingResult, p as SchedulingService, S as SearchOptions, bD as SelectedAddOnOption, de as Service, d5 as ServiceAvailabilityException, ds as ServiceAvailabilityParams, dt as ServiceAvailabilityResult, d4 as ServiceAvailabilityRule, cZ as ServiceCharge, cE as ServiceNotes, cL as ServiceScheduleRequest, db as ServiceStaffRequirement, cx as ServiceStatus, df as ServiceWithStaff, ea as SessionChangeEvent, dg as Staff, cH as StaffAssignment, d7 as StaffAvailabilityException, d6 as StaffAvailabilityRule, da as StaffBookingProfile, cy as StaffRole, cM as StaffScheduleItem, dw as Stock, dx as StockLevel, du as StockOwnershipType, dv as StockStatus, c_ as StorefrontBootstrap, cX as Table, T as TableInfo, bv as TaxPathComponent, cU as TimeRange, cV as TimeRanges, dh as TimeSlot, c1 as UICart, bV as UICartBusiness, bX as UICartCustomer, bW as UICartLocation, bY as UICartPricing, c2 as UICartResponse, dK as UpdateAddressInput, c4 as UpdateCartItemInput, cu as UpdateOrderStatusInput, U as UpdateProfileInput, aP as VariantAxis, aU as VariantAxisSelection, aR as VariantAxisValue, aQ as VariantAxisWithValues, bG as VariantDetails, b$ as VariantDetailsDTO, aO as VariantDisplayAttribute, aT as VariantLocationAvailability, dz as VariantStock, aH as VariantStrategy, dX as VerifyOtpInput, aD as combine, aE as combineObject, c as createCimplifyClient, w as createElements, as as err, ax as flatMap, aB as fromPromise, k as generateIdempotencyKey, ay as getOrElse, au as isErr, at as isOk, aw as mapError, av as mapResult, ar as ok, aA as toNullable, aC as tryCatch, az as unwrap } from './client-DM3-ZG29.js';
2
+ export { QueryBuilder, query } from './advanced.js';
3
+ import { A as ApiError } from './payment-Cu75tmUc.js';
4
+ export { q as AuthorizationType, h as CimplifyError, b as Currency, C as CurrencyCode, g as ERROR_HINTS, E as ErrorCode, e as ErrorCodeType, f as ErrorHint, I as InitializePaymentResult, M as Money, d as Pagination, P as PaginationParams, t as Payment, w as PaymentErrorDetails, s as PaymentMethod, p as PaymentMethodType, r as PaymentProcessingState, o as PaymentProvider, u as PaymentResponse, n as PaymentStatus, v as PaymentStatusResponse, S as SubmitAuthorizationInput, Z as ZERO, c as currencyCode, k as enrichError, j as getErrorHint, i as isCimplifyError, l as isRetryableError, m as money, a as moneyFromNumber } from './payment-Cu75tmUc.js';
5
+ export { C as CURRENCY_SYMBOLS, x as FormatCompactOptions, F as FormatPriceOptions, M as MOBILE_MONEY_PROVIDERS, P as PriceInfo, w as ProductWithPrice, T as TaxComponent, v as TaxInfo, n as categorizePaymentError, u as detectMobileMoneyProvider, c as formatMoney, d as formatNumberCompact, f as formatPrice, a as formatPriceAdjustment, b as formatPriceCompact, e as formatProductPrice, i as getBasePrice, g as getCurrencySymbol, k as getDiscountPercentage, h as getDisplayPrice, l as getMarkupPercentage, m as getProductCurrency, j as isOnSale, r as isPaymentStatusFailure, s as isPaymentStatusRequiresAction, t as isPaymentStatusSuccess, o as normalizePaymentResponse, q as normalizeStatusResponse, p as parsePrice } from './index-pztT_bcJ.js';
6
+ export { c as AdConfig, e as AdContextValue, d as AdCreative, a as AdPosition, A as AdSlot, b as AdTheme } from './ads-t3FBTU8p.js';
7
+
8
+ /** Context sent with every request to scope operations to a specific location/branch */
9
+ interface FrontendContext {
10
+ location_id?: string;
11
+ }
12
+ /** Request body for POST /api/q */
13
+ interface QueryRequest {
14
+ query: string;
15
+ variables?: Record<string, unknown>;
16
+ cache_hint?: string;
17
+ context?: FrontendContext;
18
+ }
19
+ /** Request body for POST /api/m */
20
+ interface MutationRequest {
21
+ method: string;
22
+ args: unknown[];
23
+ context?: FrontendContext;
24
+ }
25
+ /** Response metadata */
26
+ interface ResponseMetadata {
27
+ execution_time_ms: number;
28
+ cache_hit: boolean;
29
+ }
30
+ /** Standard API response wrapper */
31
+ interface ApiResponse<T> {
32
+ success: boolean;
33
+ data?: T;
34
+ error?: ApiError;
35
+ metadata?: ResponseMetadata;
36
+ }
37
+
38
+ export { ApiError, type ApiResponse, type FrontendContext, type MutationRequest, type QueryRequest, type ResponseMetadata };
@@ -0,0 +1,196 @@
1
+ declare const __money: unique symbol;
2
+ /** Decimal monetary amount as a string (e.g. "29.99"). Branded to prevent mixing with plain strings. */
3
+ type Money = string & {
4
+ readonly [__money]: true;
5
+ };
6
+ /** Create a Money value from a string decimal. */
7
+ declare function money(value: string): Money;
8
+ /** Create a Money value from a number. Converts to a 2-decimal string. */
9
+ declare function moneyFromNumber(value: number): Money;
10
+ /** Zero money constant. */
11
+ declare const ZERO: Money;
12
+ /** ISO 4217 currency codes supported by the platform */
13
+ type CurrencyCode = "USD" | "EUR" | "GBP" | "JPY" | "CNY" | "CHF" | "CAD" | "AUD" | "GHS" | "NGN" | "KES" | "ZAR" | "XOF" | "XAF" | "EGP" | "TZS" | "UGX" | "RWF" | "ETB" | "ZMW" | "BWP" | "MUR" | "NAD" | "MWK" | "AOA" | "CDF" | "GMD" | "GNF" | "LRD" | "SLL" | "MZN" | "BIF" | "INR" | "BRL" | "MXN" | "KRW" | "TRY" | "THB" | "MYR" | "PHP" | "IDR" | "VND" | "SGD" | "HKD" | "TWD" | "AED" | "SAR" | "ILS";
14
+ /** Assert a string as CurrencyCode at API boundaries. */
15
+ declare function currencyCode(value: string): CurrencyCode;
16
+ /**
17
+ * @deprecated Use `CurrencyCode` instead. Kept for backward compatibility.
18
+ */
19
+ type Currency = CurrencyCode;
20
+ /** Pagination parameters */
21
+ interface PaginationParams {
22
+ page?: number;
23
+ limit?: number;
24
+ offset?: number;
25
+ }
26
+ /** Pagination metadata in response */
27
+ interface Pagination {
28
+ total_count: number;
29
+ current_page: number;
30
+ page_size: number;
31
+ total_pages: number;
32
+ }
33
+ /** Strongly-typed error codes for better DX */
34
+ declare const ErrorCode: {
35
+ readonly UNKNOWN_ERROR: "UNKNOWN_ERROR";
36
+ readonly NETWORK_ERROR: "NETWORK_ERROR";
37
+ readonly TIMEOUT: "TIMEOUT";
38
+ readonly UNAUTHORIZED: "UNAUTHORIZED";
39
+ readonly FORBIDDEN: "FORBIDDEN";
40
+ readonly NOT_FOUND: "NOT_FOUND";
41
+ readonly VALIDATION_ERROR: "VALIDATION_ERROR";
42
+ readonly CART_EMPTY: "CART_EMPTY";
43
+ readonly CART_EXPIRED: "CART_EXPIRED";
44
+ readonly CART_NOT_FOUND: "CART_NOT_FOUND";
45
+ readonly ITEM_UNAVAILABLE: "ITEM_UNAVAILABLE";
46
+ readonly VARIANT_NOT_FOUND: "VARIANT_NOT_FOUND";
47
+ readonly VARIANT_OUT_OF_STOCK: "VARIANT_OUT_OF_STOCK";
48
+ readonly ADDON_REQUIRED: "ADDON_REQUIRED";
49
+ readonly ADDON_MAX_EXCEEDED: "ADDON_MAX_EXCEEDED";
50
+ readonly CHECKOUT_VALIDATION_FAILED: "CHECKOUT_VALIDATION_FAILED";
51
+ readonly DELIVERY_ADDRESS_REQUIRED: "DELIVERY_ADDRESS_REQUIRED";
52
+ readonly CUSTOMER_INFO_REQUIRED: "CUSTOMER_INFO_REQUIRED";
53
+ readonly PAYMENT_FAILED: "PAYMENT_FAILED";
54
+ readonly PAYMENT_CANCELLED: "PAYMENT_CANCELLED";
55
+ readonly INSUFFICIENT_FUNDS: "INSUFFICIENT_FUNDS";
56
+ readonly CARD_DECLINED: "CARD_DECLINED";
57
+ readonly INVALID_OTP: "INVALID_OTP";
58
+ readonly OTP_EXPIRED: "OTP_EXPIRED";
59
+ readonly AUTHORIZATION_FAILED: "AUTHORIZATION_FAILED";
60
+ readonly PAYMENT_ACTION_NOT_COMPLETED: "PAYMENT_ACTION_NOT_COMPLETED";
61
+ readonly SLOT_UNAVAILABLE: "SLOT_UNAVAILABLE";
62
+ readonly BOOKING_CONFLICT: "BOOKING_CONFLICT";
63
+ readonly SERVICE_NOT_FOUND: "SERVICE_NOT_FOUND";
64
+ readonly OUT_OF_STOCK: "OUT_OF_STOCK";
65
+ readonly INSUFFICIENT_QUANTITY: "INSUFFICIENT_QUANTITY";
66
+ };
67
+ type ErrorCodeType = (typeof ErrorCode)[keyof typeof ErrorCode];
68
+ /** API error structure */
69
+ interface ApiError {
70
+ code: string;
71
+ message: string;
72
+ retryable: boolean;
73
+ }
74
+ interface ErrorHint {
75
+ docs_url: string;
76
+ suggestion: string;
77
+ }
78
+ declare const ERROR_HINTS: Record<string, ErrorHint>;
79
+ /**
80
+ * Custom error class for SDK errors with typed error codes.
81
+ *
82
+ * @example
83
+ * ```typescript
84
+ * try {
85
+ * await client.cart.addItem({ item_id: "prod_123" });
86
+ * } catch (error) {
87
+ * if (isCimplifyError(error)) {
88
+ * switch (error.code) {
89
+ * case ErrorCode.ITEM_UNAVAILABLE:
90
+ * toast.error("This item is no longer available");
91
+ * break;
92
+ * case ErrorCode.VARIANT_OUT_OF_STOCK:
93
+ * toast.error("Selected option is out of stock");
94
+ * break;
95
+ * default:
96
+ * toast.error(error.message);
97
+ * }
98
+ * }
99
+ * }
100
+ * ```
101
+ */
102
+ declare class CimplifyError extends Error {
103
+ code: string;
104
+ retryable: boolean;
105
+ docs_url?: string | undefined;
106
+ suggestion?: string | undefined;
107
+ constructor(code: string, message: string, retryable?: boolean, docs_url?: string | undefined, suggestion?: string | undefined);
108
+ /** User-friendly message safe to display */
109
+ get userMessage(): string;
110
+ }
111
+ /** Type guard for CimplifyError */
112
+ declare function isCimplifyError(error: unknown): error is CimplifyError;
113
+ declare function getErrorHint(code: string): ErrorHint | undefined;
114
+ declare function enrichError(error: CimplifyError, options?: {
115
+ isTestMode?: boolean;
116
+ }): CimplifyError;
117
+ /** Check if error is retryable */
118
+ declare function isRetryableError(error: unknown): boolean;
119
+
120
+ type PaymentStatus = "pending" | "processing" | "created" | "pending_confirmation" | "success" | "succeeded" | "failed" | "declined" | "authorized" | "refunded" | "partially_refunded" | "partially_paid" | "paid" | "unpaid" | "requires_action" | "requires_payment_method" | "requires_capture" | "captured" | "cancelled" | "completed" | "voided" | "error" | "unknown";
121
+ type PaymentProvider = "stripe" | "paystack" | "mtn" | "vodafone" | "airtel" | "cellulant" | "offline" | "cash" | "manual";
122
+ type PaymentMethodType = "card" | "mobile_money" | "bank_transfer" | "cash" | "custom";
123
+ /** Authorization types for payment verification (OTP, PIN, etc.) */
124
+ type AuthorizationType = "otp" | "pin" | "phone" | "birthday" | "address";
125
+ /** Payment processing state machine states (for UI) */
126
+ type PaymentProcessingState = "initial" | "preparing" | "processing" | "verifying" | "awaiting_authorization" | "success" | "error" | "timeout";
127
+ interface PaymentMethod {
128
+ type: PaymentMethodType;
129
+ provider?: string;
130
+ phone_number?: string;
131
+ card_last_four?: string;
132
+ custom_value?: string;
133
+ }
134
+ interface Payment {
135
+ id: string;
136
+ order_id: string;
137
+ business_id: string;
138
+ amount: Money;
139
+ currency: CurrencyCode;
140
+ payment_method: PaymentMethod;
141
+ status: PaymentStatus;
142
+ provider: PaymentProvider;
143
+ provider_reference?: string;
144
+ failure_reason?: string;
145
+ created_at: string;
146
+ updated_at: string;
147
+ }
148
+ interface InitializePaymentResult {
149
+ payment_id: string;
150
+ status: PaymentStatus;
151
+ redirect_url?: string;
152
+ authorization_url?: string;
153
+ reference: string;
154
+ provider: PaymentProvider;
155
+ }
156
+ /** Normalized payment response from checkout or payment initialization */
157
+ interface PaymentResponse {
158
+ method: string;
159
+ provider: string;
160
+ requires_action: boolean;
161
+ public_key?: string;
162
+ client_secret?: string;
163
+ access_code?: string;
164
+ redirect_url?: string;
165
+ transaction_id?: string;
166
+ order_id?: string;
167
+ reference?: string;
168
+ metadata?: Record<string, unknown>;
169
+ instructions?: string;
170
+ display_text?: string;
171
+ requires_authorization?: boolean;
172
+ authorization_type?: AuthorizationType;
173
+ provider_payment_id?: string;
174
+ }
175
+ /** Payment status polling response */
176
+ interface PaymentStatusResponse {
177
+ status: PaymentStatus;
178
+ paid: boolean;
179
+ amount?: Money;
180
+ currency?: CurrencyCode;
181
+ reference?: string;
182
+ message?: string;
183
+ }
184
+ interface PaymentErrorDetails {
185
+ code: string;
186
+ message: string;
187
+ recoverable: boolean;
188
+ technical?: string;
189
+ }
190
+ interface SubmitAuthorizationInput {
191
+ reference: string;
192
+ auth_type: AuthorizationType;
193
+ value: string;
194
+ }
195
+
196
+ export { type ApiError as A, type CurrencyCode as C, ErrorCode as E, type InitializePaymentResult as I, type Money as M, type PaginationParams as P, type SubmitAuthorizationInput as S, ZERO as Z, moneyFromNumber as a, type Currency as b, currencyCode as c, type Pagination as d, type ErrorCodeType as e, type ErrorHint as f, ERROR_HINTS as g, CimplifyError as h, isCimplifyError as i, getErrorHint as j, enrichError as k, isRetryableError as l, money as m, type PaymentStatus as n, type PaymentProvider as o, type PaymentMethodType as p, type AuthorizationType as q, type PaymentProcessingState as r, type PaymentMethod as s, type Payment as t, type PaymentResponse as u, type PaymentStatusResponse as v, type PaymentErrorDetails as w };
@@ -0,0 +1,196 @@
1
+ declare const __money: unique symbol;
2
+ /** Decimal monetary amount as a string (e.g. "29.99"). Branded to prevent mixing with plain strings. */
3
+ type Money = string & {
4
+ readonly [__money]: true;
5
+ };
6
+ /** Create a Money value from a string decimal. */
7
+ declare function money(value: string): Money;
8
+ /** Create a Money value from a number. Converts to a 2-decimal string. */
9
+ declare function moneyFromNumber(value: number): Money;
10
+ /** Zero money constant. */
11
+ declare const ZERO: Money;
12
+ /** ISO 4217 currency codes supported by the platform */
13
+ type CurrencyCode = "USD" | "EUR" | "GBP" | "JPY" | "CNY" | "CHF" | "CAD" | "AUD" | "GHS" | "NGN" | "KES" | "ZAR" | "XOF" | "XAF" | "EGP" | "TZS" | "UGX" | "RWF" | "ETB" | "ZMW" | "BWP" | "MUR" | "NAD" | "MWK" | "AOA" | "CDF" | "GMD" | "GNF" | "LRD" | "SLL" | "MZN" | "BIF" | "INR" | "BRL" | "MXN" | "KRW" | "TRY" | "THB" | "MYR" | "PHP" | "IDR" | "VND" | "SGD" | "HKD" | "TWD" | "AED" | "SAR" | "ILS";
14
+ /** Assert a string as CurrencyCode at API boundaries. */
15
+ declare function currencyCode(value: string): CurrencyCode;
16
+ /**
17
+ * @deprecated Use `CurrencyCode` instead. Kept for backward compatibility.
18
+ */
19
+ type Currency = CurrencyCode;
20
+ /** Pagination parameters */
21
+ interface PaginationParams {
22
+ page?: number;
23
+ limit?: number;
24
+ offset?: number;
25
+ }
26
+ /** Pagination metadata in response */
27
+ interface Pagination {
28
+ total_count: number;
29
+ current_page: number;
30
+ page_size: number;
31
+ total_pages: number;
32
+ }
33
+ /** Strongly-typed error codes for better DX */
34
+ declare const ErrorCode: {
35
+ readonly UNKNOWN_ERROR: "UNKNOWN_ERROR";
36
+ readonly NETWORK_ERROR: "NETWORK_ERROR";
37
+ readonly TIMEOUT: "TIMEOUT";
38
+ readonly UNAUTHORIZED: "UNAUTHORIZED";
39
+ readonly FORBIDDEN: "FORBIDDEN";
40
+ readonly NOT_FOUND: "NOT_FOUND";
41
+ readonly VALIDATION_ERROR: "VALIDATION_ERROR";
42
+ readonly CART_EMPTY: "CART_EMPTY";
43
+ readonly CART_EXPIRED: "CART_EXPIRED";
44
+ readonly CART_NOT_FOUND: "CART_NOT_FOUND";
45
+ readonly ITEM_UNAVAILABLE: "ITEM_UNAVAILABLE";
46
+ readonly VARIANT_NOT_FOUND: "VARIANT_NOT_FOUND";
47
+ readonly VARIANT_OUT_OF_STOCK: "VARIANT_OUT_OF_STOCK";
48
+ readonly ADDON_REQUIRED: "ADDON_REQUIRED";
49
+ readonly ADDON_MAX_EXCEEDED: "ADDON_MAX_EXCEEDED";
50
+ readonly CHECKOUT_VALIDATION_FAILED: "CHECKOUT_VALIDATION_FAILED";
51
+ readonly DELIVERY_ADDRESS_REQUIRED: "DELIVERY_ADDRESS_REQUIRED";
52
+ readonly CUSTOMER_INFO_REQUIRED: "CUSTOMER_INFO_REQUIRED";
53
+ readonly PAYMENT_FAILED: "PAYMENT_FAILED";
54
+ readonly PAYMENT_CANCELLED: "PAYMENT_CANCELLED";
55
+ readonly INSUFFICIENT_FUNDS: "INSUFFICIENT_FUNDS";
56
+ readonly CARD_DECLINED: "CARD_DECLINED";
57
+ readonly INVALID_OTP: "INVALID_OTP";
58
+ readonly OTP_EXPIRED: "OTP_EXPIRED";
59
+ readonly AUTHORIZATION_FAILED: "AUTHORIZATION_FAILED";
60
+ readonly PAYMENT_ACTION_NOT_COMPLETED: "PAYMENT_ACTION_NOT_COMPLETED";
61
+ readonly SLOT_UNAVAILABLE: "SLOT_UNAVAILABLE";
62
+ readonly BOOKING_CONFLICT: "BOOKING_CONFLICT";
63
+ readonly SERVICE_NOT_FOUND: "SERVICE_NOT_FOUND";
64
+ readonly OUT_OF_STOCK: "OUT_OF_STOCK";
65
+ readonly INSUFFICIENT_QUANTITY: "INSUFFICIENT_QUANTITY";
66
+ };
67
+ type ErrorCodeType = (typeof ErrorCode)[keyof typeof ErrorCode];
68
+ /** API error structure */
69
+ interface ApiError {
70
+ code: string;
71
+ message: string;
72
+ retryable: boolean;
73
+ }
74
+ interface ErrorHint {
75
+ docs_url: string;
76
+ suggestion: string;
77
+ }
78
+ declare const ERROR_HINTS: Record<string, ErrorHint>;
79
+ /**
80
+ * Custom error class for SDK errors with typed error codes.
81
+ *
82
+ * @example
83
+ * ```typescript
84
+ * try {
85
+ * await client.cart.addItem({ item_id: "prod_123" });
86
+ * } catch (error) {
87
+ * if (isCimplifyError(error)) {
88
+ * switch (error.code) {
89
+ * case ErrorCode.ITEM_UNAVAILABLE:
90
+ * toast.error("This item is no longer available");
91
+ * break;
92
+ * case ErrorCode.VARIANT_OUT_OF_STOCK:
93
+ * toast.error("Selected option is out of stock");
94
+ * break;
95
+ * default:
96
+ * toast.error(error.message);
97
+ * }
98
+ * }
99
+ * }
100
+ * ```
101
+ */
102
+ declare class CimplifyError extends Error {
103
+ code: string;
104
+ retryable: boolean;
105
+ docs_url?: string | undefined;
106
+ suggestion?: string | undefined;
107
+ constructor(code: string, message: string, retryable?: boolean, docs_url?: string | undefined, suggestion?: string | undefined);
108
+ /** User-friendly message safe to display */
109
+ get userMessage(): string;
110
+ }
111
+ /** Type guard for CimplifyError */
112
+ declare function isCimplifyError(error: unknown): error is CimplifyError;
113
+ declare function getErrorHint(code: string): ErrorHint | undefined;
114
+ declare function enrichError(error: CimplifyError, options?: {
115
+ isTestMode?: boolean;
116
+ }): CimplifyError;
117
+ /** Check if error is retryable */
118
+ declare function isRetryableError(error: unknown): boolean;
119
+
120
+ type PaymentStatus = "pending" | "processing" | "created" | "pending_confirmation" | "success" | "succeeded" | "failed" | "declined" | "authorized" | "refunded" | "partially_refunded" | "partially_paid" | "paid" | "unpaid" | "requires_action" | "requires_payment_method" | "requires_capture" | "captured" | "cancelled" | "completed" | "voided" | "error" | "unknown";
121
+ type PaymentProvider = "stripe" | "paystack" | "mtn" | "vodafone" | "airtel" | "cellulant" | "offline" | "cash" | "manual";
122
+ type PaymentMethodType = "card" | "mobile_money" | "bank_transfer" | "cash" | "custom";
123
+ /** Authorization types for payment verification (OTP, PIN, etc.) */
124
+ type AuthorizationType = "otp" | "pin" | "phone" | "birthday" | "address";
125
+ /** Payment processing state machine states (for UI) */
126
+ type PaymentProcessingState = "initial" | "preparing" | "processing" | "verifying" | "awaiting_authorization" | "success" | "error" | "timeout";
127
+ interface PaymentMethod {
128
+ type: PaymentMethodType;
129
+ provider?: string;
130
+ phone_number?: string;
131
+ card_last_four?: string;
132
+ custom_value?: string;
133
+ }
134
+ interface Payment {
135
+ id: string;
136
+ order_id: string;
137
+ business_id: string;
138
+ amount: Money;
139
+ currency: CurrencyCode;
140
+ payment_method: PaymentMethod;
141
+ status: PaymentStatus;
142
+ provider: PaymentProvider;
143
+ provider_reference?: string;
144
+ failure_reason?: string;
145
+ created_at: string;
146
+ updated_at: string;
147
+ }
148
+ interface InitializePaymentResult {
149
+ payment_id: string;
150
+ status: PaymentStatus;
151
+ redirect_url?: string;
152
+ authorization_url?: string;
153
+ reference: string;
154
+ provider: PaymentProvider;
155
+ }
156
+ /** Normalized payment response from checkout or payment initialization */
157
+ interface PaymentResponse {
158
+ method: string;
159
+ provider: string;
160
+ requires_action: boolean;
161
+ public_key?: string;
162
+ client_secret?: string;
163
+ access_code?: string;
164
+ redirect_url?: string;
165
+ transaction_id?: string;
166
+ order_id?: string;
167
+ reference?: string;
168
+ metadata?: Record<string, unknown>;
169
+ instructions?: string;
170
+ display_text?: string;
171
+ requires_authorization?: boolean;
172
+ authorization_type?: AuthorizationType;
173
+ provider_payment_id?: string;
174
+ }
175
+ /** Payment status polling response */
176
+ interface PaymentStatusResponse {
177
+ status: PaymentStatus;
178
+ paid: boolean;
179
+ amount?: Money;
180
+ currency?: CurrencyCode;
181
+ reference?: string;
182
+ message?: string;
183
+ }
184
+ interface PaymentErrorDetails {
185
+ code: string;
186
+ message: string;
187
+ recoverable: boolean;
188
+ technical?: string;
189
+ }
190
+ interface SubmitAuthorizationInput {
191
+ reference: string;
192
+ auth_type: AuthorizationType;
193
+ value: string;
194
+ }
195
+
196
+ export { type ApiError as A, type CurrencyCode as C, ErrorCode as E, type InitializePaymentResult as I, type Money as M, type PaginationParams as P, type SubmitAuthorizationInput as S, ZERO as Z, moneyFromNumber as a, type Currency as b, currencyCode as c, type Pagination as d, type ErrorCodeType as e, type ErrorHint as f, ERROR_HINTS as g, CimplifyError as h, isCimplifyError as i, getErrorHint as j, enrichError as k, isRetryableError as l, money as m, type PaymentStatus as n, type PaymentProvider as o, type PaymentMethodType as p, type AuthorizationType as q, type PaymentProcessingState as r, type PaymentMethod as s, type Payment as t, type PaymentResponse as u, type PaymentStatusResponse as v, type PaymentErrorDetails as w };