@cimplify/sdk 0.6.7 → 0.6.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -0
- package/dist/advanced.d.mts +2 -2
- package/dist/advanced.d.ts +2 -2
- package/dist/advanced.js +127 -98
- package/dist/advanced.mjs +127 -98
- package/dist/{client-B4etj3AD.d.mts → client-COpV6Yuu.d.ts} +39 -34
- package/dist/{client-CYVVuP5J.d.ts → client-vmXPt1j0.d.mts} +39 -34
- package/dist/{index-DzNb32O3.d.mts → index-DaKJxoEh.d.mts} +13 -12
- package/dist/{index-BOYF-efj.d.ts → index-pztT_bcJ.d.ts} +13 -12
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +165 -99
- package/dist/index.mjs +162 -100
- package/dist/{payment-pjpfIKX8.d.mts → payment-Cu75tmUc.d.mts} +22 -7
- package/dist/{payment-pjpfIKX8.d.ts → payment-Cu75tmUc.d.ts} +22 -7
- package/dist/react.d.mts +99 -4
- package/dist/react.d.ts +99 -4
- package/dist/react.js +845 -39
- package/dist/react.mjs +840 -40
- package/dist/utils.d.mts +2 -2
- package/dist/utils.d.ts +2 -2
- package/dist/utils.js +76 -4
- package/dist/utils.mjs +76 -4
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as Money,
|
|
1
|
+
import { M as Money, C as CurrencyCode, h as CimplifyError, q as AuthorizationType, s as PaymentMethod, I as InitializePaymentResult, S as SubmitAuthorizationInput, v as PaymentStatusResponse } from './payment-Cu75tmUc.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Observability hooks for monitoring SDK behavior.
|
|
@@ -50,6 +50,8 @@ interface RequestSuccessEvent extends RequestContext {
|
|
|
50
50
|
interface RequestErrorEvent extends RequestContext {
|
|
51
51
|
/** The error that occurred */
|
|
52
52
|
error: Error;
|
|
53
|
+
/** HTTP status code (when available) */
|
|
54
|
+
status?: number;
|
|
53
55
|
/** Duration in milliseconds */
|
|
54
56
|
durationMs: number;
|
|
55
57
|
/** Number of retries attempted before giving up */
|
|
@@ -84,7 +86,7 @@ interface ObservabilityHooks {
|
|
|
84
86
|
onRequestStart?: (event: RequestStartEvent) => void;
|
|
85
87
|
/** Called when a request completes successfully */
|
|
86
88
|
onRequestSuccess?: (event: RequestSuccessEvent) => void;
|
|
87
|
-
/** Called when a request fails (after
|
|
89
|
+
/** Called when a request fails (4xx/5xx responses or network errors after retries) */
|
|
88
90
|
onRequestError?: (event: RequestErrorEvent) => void;
|
|
89
91
|
/** Called before each retry attempt */
|
|
90
92
|
onRetry?: (event: RetryEvent) => void;
|
|
@@ -152,7 +154,7 @@ interface Product {
|
|
|
152
154
|
access_duration_days?: number;
|
|
153
155
|
code_type?: string;
|
|
154
156
|
code_value?: Money;
|
|
155
|
-
code_currency?:
|
|
157
|
+
code_currency?: CurrencyCode;
|
|
156
158
|
duration_minutes?: number;
|
|
157
159
|
preparation_time_minutes?: number;
|
|
158
160
|
staff_required_count?: number;
|
|
@@ -613,7 +615,7 @@ interface ChosenPrice {
|
|
|
613
615
|
markup_amount: Money;
|
|
614
616
|
markup_discount_percentage: Money;
|
|
615
617
|
markup_discount_amount: Money;
|
|
616
|
-
currency?:
|
|
618
|
+
currency?: CurrencyCode;
|
|
617
619
|
custom_fields?: Record<string, unknown>;
|
|
618
620
|
decision_path?: PriceDecisionPath;
|
|
619
621
|
tax_info?: PricePathTaxInfo;
|
|
@@ -758,7 +760,7 @@ interface Cart {
|
|
|
758
760
|
applied_discount_ids: string[];
|
|
759
761
|
applied_discount_codes: string[];
|
|
760
762
|
discount_details?: DiscountDetails;
|
|
761
|
-
currency:
|
|
763
|
+
currency: CurrencyCode;
|
|
762
764
|
customer_name?: string;
|
|
763
765
|
customer_email?: string;
|
|
764
766
|
customer_phone?: string;
|
|
@@ -813,7 +815,7 @@ interface DisplayCart {
|
|
|
813
815
|
total_items: number;
|
|
814
816
|
tax_rate?: Money;
|
|
815
817
|
service_charge_rate?: Money;
|
|
816
|
-
currency:
|
|
818
|
+
currency: CurrencyCode;
|
|
817
819
|
channel: string;
|
|
818
820
|
status: string;
|
|
819
821
|
business_name: string;
|
|
@@ -888,7 +890,7 @@ interface UICartPricing {
|
|
|
888
890
|
total_price: Money;
|
|
889
891
|
tax_rate?: Money;
|
|
890
892
|
service_charge_rate?: Money;
|
|
891
|
-
currency:
|
|
893
|
+
currency: CurrencyCode;
|
|
892
894
|
}
|
|
893
895
|
interface AddOnOptionDetails {
|
|
894
896
|
id: string;
|
|
@@ -1015,7 +1017,7 @@ interface CartSummary {
|
|
|
1015
1017
|
discount_amount: Money;
|
|
1016
1018
|
tax_amount: Money;
|
|
1017
1019
|
total: Money;
|
|
1018
|
-
currency:
|
|
1020
|
+
currency: CurrencyCode;
|
|
1019
1021
|
}
|
|
1020
1022
|
|
|
1021
1023
|
/**
|
|
@@ -1442,7 +1444,7 @@ interface Order {
|
|
|
1442
1444
|
service_charge?: Money;
|
|
1443
1445
|
tax?: Money;
|
|
1444
1446
|
price_info: ChosenPrice;
|
|
1445
|
-
currency:
|
|
1447
|
+
currency: CurrencyCode;
|
|
1446
1448
|
bill_token?: string;
|
|
1447
1449
|
order_group_id?: string;
|
|
1448
1450
|
paid_via_group: boolean;
|
|
@@ -1490,7 +1492,7 @@ interface OrderGroup {
|
|
|
1490
1492
|
payment_status: OrderGroupPaymentState;
|
|
1491
1493
|
split_method?: string;
|
|
1492
1494
|
max_orders?: number;
|
|
1493
|
-
currency?:
|
|
1495
|
+
currency?: CurrencyCode;
|
|
1494
1496
|
amount_to_pay: AmountToPay;
|
|
1495
1497
|
metadata?: Record<string, unknown>;
|
|
1496
1498
|
}
|
|
@@ -2004,7 +2006,7 @@ interface CheckoutFormData {
|
|
|
2004
2006
|
idempotency_key?: string;
|
|
2005
2007
|
/** Optional metadata passed through to the payment provider (e.g. success_url, cancel_url) */
|
|
2006
2008
|
metadata?: Record<string, unknown>;
|
|
2007
|
-
pay_currency?:
|
|
2009
|
+
pay_currency?: CurrencyCode;
|
|
2008
2010
|
fx_quote_id?: string;
|
|
2009
2011
|
}
|
|
2010
2012
|
interface CheckoutResult {
|
|
@@ -2020,10 +2022,10 @@ interface CheckoutResult {
|
|
|
2020
2022
|
client_secret?: string;
|
|
2021
2023
|
public_key?: string;
|
|
2022
2024
|
fx?: {
|
|
2023
|
-
base_currency:
|
|
2024
|
-
base_amount:
|
|
2025
|
-
pay_currency:
|
|
2026
|
-
pay_amount:
|
|
2025
|
+
base_currency: CurrencyCode;
|
|
2026
|
+
base_amount: Money;
|
|
2027
|
+
pay_currency: CurrencyCode;
|
|
2028
|
+
pay_amount: Money;
|
|
2027
2029
|
rate: number;
|
|
2028
2030
|
quote_id: string;
|
|
2029
2031
|
};
|
|
@@ -2046,7 +2048,7 @@ interface ProcessCheckoutOptions {
|
|
|
2046
2048
|
scheduled_time?: string;
|
|
2047
2049
|
tip_amount?: number;
|
|
2048
2050
|
enroll_in_link?: boolean;
|
|
2049
|
-
pay_currency?:
|
|
2051
|
+
pay_currency?: CurrencyCode;
|
|
2050
2052
|
timeout_ms?: number;
|
|
2051
2053
|
on_status_change?: (status: CheckoutStatus, context: CheckoutStatusContext) => void;
|
|
2052
2054
|
}
|
|
@@ -2057,7 +2059,7 @@ interface ProcessCheckoutResult {
|
|
|
2057
2059
|
order_number: string;
|
|
2058
2060
|
status: string;
|
|
2059
2061
|
total: string;
|
|
2060
|
-
currency:
|
|
2062
|
+
currency: CurrencyCode;
|
|
2061
2063
|
};
|
|
2062
2064
|
error?: {
|
|
2063
2065
|
code: string;
|
|
@@ -2139,6 +2141,7 @@ interface SuccessResult$2 {
|
|
|
2139
2141
|
declare class LinkService {
|
|
2140
2142
|
private client;
|
|
2141
2143
|
constructor(client: CimplifyClient);
|
|
2144
|
+
getProfile(): Promise<Result<LinkData["customer"], CimplifyError>>;
|
|
2142
2145
|
requestOtp(input: RequestOtpInput): Promise<Result<SuccessResult$2, CimplifyError>>;
|
|
2143
2146
|
verifyOtp(input: VerifyOtpInput): Promise<Result<AuthResponse, CimplifyError>>;
|
|
2144
2147
|
logout(): Promise<Result<SuccessResult$2, CimplifyError>>;
|
|
@@ -2218,7 +2221,7 @@ interface Business {
|
|
|
2218
2221
|
handle: string;
|
|
2219
2222
|
business_type: BusinessType;
|
|
2220
2223
|
email: string;
|
|
2221
|
-
default_currency:
|
|
2224
|
+
default_currency: CurrencyCode;
|
|
2222
2225
|
default_phone?: string;
|
|
2223
2226
|
default_address?: string;
|
|
2224
2227
|
default_offers_table_service: boolean;
|
|
@@ -2256,7 +2259,7 @@ interface Location {
|
|
|
2256
2259
|
phone?: string;
|
|
2257
2260
|
address?: string;
|
|
2258
2261
|
service_charge_rate?: number;
|
|
2259
|
-
currency:
|
|
2262
|
+
currency: CurrencyCode;
|
|
2260
2263
|
capacity: number;
|
|
2261
2264
|
status: string;
|
|
2262
2265
|
enabled_payment_types?: string[];
|
|
@@ -2323,7 +2326,7 @@ interface StorefrontBootstrap {
|
|
|
2323
2326
|
location?: Location;
|
|
2324
2327
|
locations: Location[];
|
|
2325
2328
|
categories: CategoryInfo[];
|
|
2326
|
-
currency:
|
|
2329
|
+
currency: CurrencyCode;
|
|
2327
2330
|
is_open: boolean;
|
|
2328
2331
|
accepts_orders: boolean;
|
|
2329
2332
|
time_profiles?: LocationTimeProfile[];
|
|
@@ -2653,7 +2656,7 @@ interface Service {
|
|
|
2653
2656
|
buffer_after_minutes: number;
|
|
2654
2657
|
max_participants: number;
|
|
2655
2658
|
price: Money;
|
|
2656
|
-
currency:
|
|
2659
|
+
currency: CurrencyCode;
|
|
2657
2660
|
requires_staff: boolean;
|
|
2658
2661
|
is_active: boolean;
|
|
2659
2662
|
image_url?: string;
|
|
@@ -2873,24 +2876,24 @@ declare class LiteService {
|
|
|
2873
2876
|
}
|
|
2874
2877
|
|
|
2875
2878
|
interface FxQuoteRequest {
|
|
2876
|
-
from:
|
|
2877
|
-
to:
|
|
2878
|
-
amount:
|
|
2879
|
+
from: CurrencyCode;
|
|
2880
|
+
to: CurrencyCode;
|
|
2881
|
+
amount: Money;
|
|
2879
2882
|
}
|
|
2880
2883
|
interface FxQuote {
|
|
2881
2884
|
id: string;
|
|
2882
|
-
base_currency:
|
|
2883
|
-
pay_currency:
|
|
2885
|
+
base_currency: CurrencyCode;
|
|
2886
|
+
pay_currency: CurrencyCode;
|
|
2884
2887
|
rate: number;
|
|
2885
2888
|
inverse_rate: number;
|
|
2886
|
-
base_amount:
|
|
2887
|
-
converted_amount:
|
|
2889
|
+
base_amount: Money;
|
|
2890
|
+
converted_amount: Money;
|
|
2888
2891
|
quoted_at: string;
|
|
2889
2892
|
valid_until: string;
|
|
2890
2893
|
}
|
|
2891
2894
|
interface FxRateResponse {
|
|
2892
|
-
from:
|
|
2893
|
-
to:
|
|
2895
|
+
from: CurrencyCode;
|
|
2896
|
+
to: CurrencyCode;
|
|
2894
2897
|
rate: number;
|
|
2895
2898
|
inverse_rate: number;
|
|
2896
2899
|
quoted_at: string;
|
|
@@ -2900,7 +2903,7 @@ interface FxRateResponse {
|
|
|
2900
2903
|
declare class FxService {
|
|
2901
2904
|
private client;
|
|
2902
2905
|
constructor(client: CimplifyClient);
|
|
2903
|
-
getRate(from:
|
|
2906
|
+
getRate(from: CurrencyCode, to: CurrencyCode): Promise<Result<FxRateResponse, CimplifyError>>;
|
|
2904
2907
|
lockQuote(request: FxQuoteRequest): Promise<Result<FxQuote, CimplifyError>>;
|
|
2905
2908
|
}
|
|
2906
2909
|
|
|
@@ -2947,7 +2950,7 @@ interface ElementOptions {
|
|
|
2947
2950
|
mode?: "shipping" | "billing";
|
|
2948
2951
|
prefillEmail?: string;
|
|
2949
2952
|
amount?: number;
|
|
2950
|
-
currency?:
|
|
2953
|
+
currency?: CurrencyCode;
|
|
2951
2954
|
}
|
|
2952
2955
|
interface AddressInfo {
|
|
2953
2956
|
id?: string;
|
|
@@ -3028,7 +3031,7 @@ type ParentToIframeMessage = {
|
|
|
3028
3031
|
notes?: string;
|
|
3029
3032
|
scheduled_time?: string;
|
|
3030
3033
|
tip_amount?: number;
|
|
3031
|
-
pay_currency?:
|
|
3034
|
+
pay_currency?: CurrencyCode;
|
|
3032
3035
|
enroll_in_link?: boolean;
|
|
3033
3036
|
address?: AddressInfo;
|
|
3034
3037
|
customer: ElementsCustomerInfo;
|
|
@@ -3084,7 +3087,7 @@ type IframeToParentMessage = {
|
|
|
3084
3087
|
order_number: string;
|
|
3085
3088
|
status: string;
|
|
3086
3089
|
total: string;
|
|
3087
|
-
currency:
|
|
3090
|
+
currency: CurrencyCode;
|
|
3088
3091
|
};
|
|
3089
3092
|
error?: {
|
|
3090
3093
|
code: string;
|
|
@@ -3170,6 +3173,8 @@ declare function createElements(client: CimplifyClient, businessId?: string, opt
|
|
|
3170
3173
|
interface CimplifyConfig {
|
|
3171
3174
|
publicKey?: string;
|
|
3172
3175
|
credentials?: RequestCredentials;
|
|
3176
|
+
/** Disable console warning when no public key is provided (for Link REST-only portal usage). */
|
|
3177
|
+
suppressPublicKeyWarning?: boolean;
|
|
3173
3178
|
/** Request timeout in milliseconds (default: 30000) */
|
|
3174
3179
|
timeout?: number;
|
|
3175
3180
|
/** Maximum retry attempts for retryable errors (default: 3) */
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as CurrencyCode, M as Money, w as PaymentErrorDetails, u as PaymentResponse, v as PaymentStatusResponse } from './payment-Cu75tmUc.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Price Types
|
|
5
5
|
*
|
|
6
6
|
* Types for price parsing, formatting, and display utilities.
|
|
7
7
|
*/
|
|
8
|
+
|
|
8
9
|
/**
|
|
9
10
|
* Individual tax component (e.g., VAT, NHIL, GETFund)
|
|
10
11
|
*/
|
|
@@ -41,7 +42,7 @@ interface PriceInfo {
|
|
|
41
42
|
/** Markup amount if applicable */
|
|
42
43
|
markup_amount?: number;
|
|
43
44
|
/** Currency code (e.g., "GHS", "USD") */
|
|
44
|
-
currency?:
|
|
45
|
+
currency?: CurrencyCode;
|
|
45
46
|
/** Tax information */
|
|
46
47
|
tax_info?: TaxInfo;
|
|
47
48
|
/** Decision path showing pricing adjustments */
|
|
@@ -61,14 +62,14 @@ interface ProductWithPrice {
|
|
|
61
62
|
/** Default/indicative price in plain field form */
|
|
62
63
|
default_price?: number | string | null;
|
|
63
64
|
/** Currency in plain field form */
|
|
64
|
-
currency?:
|
|
65
|
+
currency?: CurrencyCode | null;
|
|
65
66
|
}
|
|
66
67
|
/**
|
|
67
68
|
* Options for price formatting functions
|
|
68
69
|
*/
|
|
69
70
|
interface FormatPriceOptions {
|
|
70
71
|
/** Currency code (default: "GHS") */
|
|
71
|
-
currency?:
|
|
72
|
+
currency?: CurrencyCode;
|
|
72
73
|
/** Locale for Intl.NumberFormat (default: "en-US") */
|
|
73
74
|
locale?: string;
|
|
74
75
|
/** Minimum fraction digits (default: 2) */
|
|
@@ -81,7 +82,7 @@ interface FormatPriceOptions {
|
|
|
81
82
|
*/
|
|
82
83
|
interface FormatCompactOptions {
|
|
83
84
|
/** Currency code (default: "GHS") */
|
|
84
|
-
currency?:
|
|
85
|
+
currency?: CurrencyCode;
|
|
85
86
|
/** Number of decimal places for compact notation (default: 1) */
|
|
86
87
|
decimals?: number;
|
|
87
88
|
}
|
|
@@ -128,7 +129,7 @@ declare const CURRENCY_SYMBOLS: Record<string, string>;
|
|
|
128
129
|
* getCurrencySymbol('GHS') // "GH₵"
|
|
129
130
|
* getCurrencySymbol('XYZ') // "XYZ"
|
|
130
131
|
*/
|
|
131
|
-
declare function getCurrencySymbol(currencyCode:
|
|
132
|
+
declare function getCurrencySymbol(currencyCode: CurrencyCode): string;
|
|
132
133
|
/**
|
|
133
134
|
* Format a number compactly with K/M/B suffixes
|
|
134
135
|
* @param value - Number to format
|
|
@@ -156,7 +157,7 @@ declare function formatNumberCompact(value: number, decimals?: number): string;
|
|
|
156
157
|
* formatPrice('29.99', 'EUR') // "€29.99"
|
|
157
158
|
* formatPrice(1234.56, 'USD', 'de-DE') // "1.234,56 $"
|
|
158
159
|
*/
|
|
159
|
-
declare function formatPrice(amount: number |
|
|
160
|
+
declare function formatPrice(amount: number | Money, currency?: CurrencyCode, locale?: string): string;
|
|
160
161
|
/**
|
|
161
162
|
* Format a price with +/- sign for adjustments
|
|
162
163
|
* Useful for showing price changes, modifiers, or discounts
|
|
@@ -171,7 +172,7 @@ declare function formatPrice(amount: number | string, currency?: string, locale?
|
|
|
171
172
|
* formatPriceAdjustment(-3.50, 'GHS') // "-GH₵3.50"
|
|
172
173
|
* formatPriceAdjustment(0, 'EUR') // "€0.00"
|
|
173
174
|
*/
|
|
174
|
-
declare function formatPriceAdjustment(amount: number, currency?:
|
|
175
|
+
declare function formatPriceAdjustment(amount: number, currency?: CurrencyCode, locale?: string): string;
|
|
175
176
|
/**
|
|
176
177
|
* Format a price compactly for large numbers
|
|
177
178
|
* Uses K/M/B suffixes for thousands, millions, billions
|
|
@@ -187,7 +188,7 @@ declare function formatPriceAdjustment(amount: number, currency?: string, locale
|
|
|
187
188
|
* formatPriceCompact(2500000, 'USD') // "$2.5M"
|
|
188
189
|
* formatPriceCompact(1200000000, 'EUR') // "€1.2B"
|
|
189
190
|
*/
|
|
190
|
-
declare function formatPriceCompact(amount: number |
|
|
191
|
+
declare function formatPriceCompact(amount: number | Money, currency?: CurrencyCode, decimals?: number): string;
|
|
191
192
|
/**
|
|
192
193
|
* Simple currency symbol + amount format
|
|
193
194
|
* Lighter alternative to formatPrice without Intl
|
|
@@ -200,7 +201,7 @@ declare function formatPriceCompact(amount: number | string, currency?: string,
|
|
|
200
201
|
* formatMoney(29.99, 'USD') // "$29.99"
|
|
201
202
|
* formatMoney('15.00', 'GHS') // "GH₵15.00"
|
|
202
203
|
*/
|
|
203
|
-
declare function formatMoney(amount:
|
|
204
|
+
declare function formatMoney(amount: Money | number, currency?: CurrencyCode): string;
|
|
204
205
|
/**
|
|
205
206
|
* Parse a price string or number to a numeric value
|
|
206
207
|
* Handles various input formats gracefully
|
|
@@ -215,7 +216,7 @@ declare function formatMoney(amount: string | number, currency?: string): string
|
|
|
215
216
|
* parsePrice(undefined) // 0
|
|
216
217
|
* parsePrice('invalid') // 0
|
|
217
218
|
*/
|
|
218
|
-
declare function parsePrice(value: string | number | undefined | null): number;
|
|
219
|
+
declare function parsePrice(value: Money | string | number | undefined | null): number;
|
|
219
220
|
/**
|
|
220
221
|
* Get the display price from a product.
|
|
221
222
|
* Prefers quote-aware price_info, then plain price fields.
|
|
@@ -273,7 +274,7 @@ declare function getMarkupPercentage(product: ProductWithPrice): number;
|
|
|
273
274
|
* @param product - Product with price data
|
|
274
275
|
* @returns Currency code (default: "GHS")
|
|
275
276
|
*/
|
|
276
|
-
declare function getProductCurrency(product: ProductWithPrice):
|
|
277
|
+
declare function getProductCurrency(product: ProductWithPrice): CurrencyCode;
|
|
277
278
|
/**
|
|
278
279
|
* Format a product's display price
|
|
279
280
|
* Convenience function combining getDisplayPrice and formatPrice
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as CurrencyCode, M as Money, w as PaymentErrorDetails, u as PaymentResponse, v as PaymentStatusResponse } from './payment-Cu75tmUc.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Price Types
|
|
5
5
|
*
|
|
6
6
|
* Types for price parsing, formatting, and display utilities.
|
|
7
7
|
*/
|
|
8
|
+
|
|
8
9
|
/**
|
|
9
10
|
* Individual tax component (e.g., VAT, NHIL, GETFund)
|
|
10
11
|
*/
|
|
@@ -41,7 +42,7 @@ interface PriceInfo {
|
|
|
41
42
|
/** Markup amount if applicable */
|
|
42
43
|
markup_amount?: number;
|
|
43
44
|
/** Currency code (e.g., "GHS", "USD") */
|
|
44
|
-
currency?:
|
|
45
|
+
currency?: CurrencyCode;
|
|
45
46
|
/** Tax information */
|
|
46
47
|
tax_info?: TaxInfo;
|
|
47
48
|
/** Decision path showing pricing adjustments */
|
|
@@ -61,14 +62,14 @@ interface ProductWithPrice {
|
|
|
61
62
|
/** Default/indicative price in plain field form */
|
|
62
63
|
default_price?: number | string | null;
|
|
63
64
|
/** Currency in plain field form */
|
|
64
|
-
currency?:
|
|
65
|
+
currency?: CurrencyCode | null;
|
|
65
66
|
}
|
|
66
67
|
/**
|
|
67
68
|
* Options for price formatting functions
|
|
68
69
|
*/
|
|
69
70
|
interface FormatPriceOptions {
|
|
70
71
|
/** Currency code (default: "GHS") */
|
|
71
|
-
currency?:
|
|
72
|
+
currency?: CurrencyCode;
|
|
72
73
|
/** Locale for Intl.NumberFormat (default: "en-US") */
|
|
73
74
|
locale?: string;
|
|
74
75
|
/** Minimum fraction digits (default: 2) */
|
|
@@ -81,7 +82,7 @@ interface FormatPriceOptions {
|
|
|
81
82
|
*/
|
|
82
83
|
interface FormatCompactOptions {
|
|
83
84
|
/** Currency code (default: "GHS") */
|
|
84
|
-
currency?:
|
|
85
|
+
currency?: CurrencyCode;
|
|
85
86
|
/** Number of decimal places for compact notation (default: 1) */
|
|
86
87
|
decimals?: number;
|
|
87
88
|
}
|
|
@@ -128,7 +129,7 @@ declare const CURRENCY_SYMBOLS: Record<string, string>;
|
|
|
128
129
|
* getCurrencySymbol('GHS') // "GH₵"
|
|
129
130
|
* getCurrencySymbol('XYZ') // "XYZ"
|
|
130
131
|
*/
|
|
131
|
-
declare function getCurrencySymbol(currencyCode:
|
|
132
|
+
declare function getCurrencySymbol(currencyCode: CurrencyCode): string;
|
|
132
133
|
/**
|
|
133
134
|
* Format a number compactly with K/M/B suffixes
|
|
134
135
|
* @param value - Number to format
|
|
@@ -156,7 +157,7 @@ declare function formatNumberCompact(value: number, decimals?: number): string;
|
|
|
156
157
|
* formatPrice('29.99', 'EUR') // "€29.99"
|
|
157
158
|
* formatPrice(1234.56, 'USD', 'de-DE') // "1.234,56 $"
|
|
158
159
|
*/
|
|
159
|
-
declare function formatPrice(amount: number |
|
|
160
|
+
declare function formatPrice(amount: number | Money, currency?: CurrencyCode, locale?: string): string;
|
|
160
161
|
/**
|
|
161
162
|
* Format a price with +/- sign for adjustments
|
|
162
163
|
* Useful for showing price changes, modifiers, or discounts
|
|
@@ -171,7 +172,7 @@ declare function formatPrice(amount: number | string, currency?: string, locale?
|
|
|
171
172
|
* formatPriceAdjustment(-3.50, 'GHS') // "-GH₵3.50"
|
|
172
173
|
* formatPriceAdjustment(0, 'EUR') // "€0.00"
|
|
173
174
|
*/
|
|
174
|
-
declare function formatPriceAdjustment(amount: number, currency?:
|
|
175
|
+
declare function formatPriceAdjustment(amount: number, currency?: CurrencyCode, locale?: string): string;
|
|
175
176
|
/**
|
|
176
177
|
* Format a price compactly for large numbers
|
|
177
178
|
* Uses K/M/B suffixes for thousands, millions, billions
|
|
@@ -187,7 +188,7 @@ declare function formatPriceAdjustment(amount: number, currency?: string, locale
|
|
|
187
188
|
* formatPriceCompact(2500000, 'USD') // "$2.5M"
|
|
188
189
|
* formatPriceCompact(1200000000, 'EUR') // "€1.2B"
|
|
189
190
|
*/
|
|
190
|
-
declare function formatPriceCompact(amount: number |
|
|
191
|
+
declare function formatPriceCompact(amount: number | Money, currency?: CurrencyCode, decimals?: number): string;
|
|
191
192
|
/**
|
|
192
193
|
* Simple currency symbol + amount format
|
|
193
194
|
* Lighter alternative to formatPrice without Intl
|
|
@@ -200,7 +201,7 @@ declare function formatPriceCompact(amount: number | string, currency?: string,
|
|
|
200
201
|
* formatMoney(29.99, 'USD') // "$29.99"
|
|
201
202
|
* formatMoney('15.00', 'GHS') // "GH₵15.00"
|
|
202
203
|
*/
|
|
203
|
-
declare function formatMoney(amount:
|
|
204
|
+
declare function formatMoney(amount: Money | number, currency?: CurrencyCode): string;
|
|
204
205
|
/**
|
|
205
206
|
* Parse a price string or number to a numeric value
|
|
206
207
|
* Handles various input formats gracefully
|
|
@@ -215,7 +216,7 @@ declare function formatMoney(amount: string | number, currency?: string): string
|
|
|
215
216
|
* parsePrice(undefined) // 0
|
|
216
217
|
* parsePrice('invalid') // 0
|
|
217
218
|
*/
|
|
218
|
-
declare function parsePrice(value: string | number | undefined | null): number;
|
|
219
|
+
declare function parsePrice(value: Money | string | number | undefined | null): number;
|
|
219
220
|
/**
|
|
220
221
|
* Get the display price from a product.
|
|
221
222
|
* Prefers quote-aware price_info, then plain price fields.
|
|
@@ -273,7 +274,7 @@ declare function getMarkupPercentage(product: ProductWithPrice): number;
|
|
|
273
274
|
* @param product - Product with price data
|
|
274
275
|
* @returns Currency code (default: "GHS")
|
|
275
276
|
*/
|
|
276
|
-
declare function getProductCurrency(product: ProductWithPrice):
|
|
277
|
+
declare function getProductCurrency(product: ProductWithPrice): CurrencyCode;
|
|
277
278
|
/**
|
|
278
279
|
* Format a product's display price
|
|
279
280
|
* Convenience function combining getDisplayPrice and formatPrice
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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-
|
|
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-vmXPt1j0.mjs';
|
|
2
2
|
export { QueryBuilder, query } from './advanced.mjs';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export {
|
|
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
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
7
|
|
|
8
8
|
/** Context sent with every request to scope operations to a specific location/branch */
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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-
|
|
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-COpV6Yuu.js';
|
|
2
2
|
export { QueryBuilder, query } from './advanced.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export {
|
|
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
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
7
|
|
|
8
8
|
/** Context sent with every request to scope operations to a specific location/branch */
|