@cimplify/sdk 0.9.10 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ads-MkGm5l1T.d.mts → ads-BxbWrwqp.d.mts} +0 -8
- package/dist/{ads-MkGm5l1T.d.ts → ads-BxbWrwqp.d.ts} +0 -8
- package/dist/advanced.d.mts +2 -2
- package/dist/advanced.d.ts +2 -2
- package/dist/advanced.js +93 -80
- package/dist/advanced.mjs +93 -80
- package/dist/cli.js +184 -0
- package/dist/{client-BQ1gIg8t.d.mts → client-BSrq89H1.d.mts} +42 -374
- package/dist/{client-C3TQtGuy.d.ts → client-xBhdHLq4.d.ts} +42 -374
- package/dist/index.d.mts +6 -10
- package/dist/index.d.ts +6 -10
- package/dist/index.js +98 -126
- package/dist/index.mjs +98 -126
- package/dist/{payment-CTalZM5l.d.mts → payment-CrNyrc-D.d.mts} +145 -95
- package/dist/{payment-CTalZM5l.d.ts → payment-CrNyrc-D.d.ts} +145 -95
- package/dist/price-C9Z-hr49.d.mts +21 -0
- package/dist/price-RKKoTz-9.d.ts +21 -0
- package/dist/react.d.mts +1285 -35
- package/dist/react.d.ts +1285 -35
- package/dist/react.js +6596 -2598
- package/dist/react.mjs +6550 -2600
- package/dist/utils.d.mts +55 -2
- package/dist/utils.d.ts +55 -2
- package/dist/utils.js +23 -20
- package/dist/utils.mjs +23 -20
- package/package.json +13 -3
- package/registry/add-on-selector.json +15 -0
- package/registry/availability-badge.json +15 -0
- package/registry/booking-card.json +16 -0
- package/registry/booking-list.json +16 -0
- package/registry/booking-page.json +18 -0
- package/registry/bookings-page.json +17 -0
- package/registry/bundle-selector.json +15 -0
- package/registry/cart-page.json +17 -0
- package/registry/cart-summary.json +16 -0
- package/registry/catalogue-page.json +18 -0
- package/registry/category-filter.json +15 -0
- package/registry/category-grid.json +15 -0
- package/registry/checkout-page.json +15 -0
- package/registry/cn.json +13 -0
- package/registry/collection-page.json +16 -0
- package/registry/composite-selector.json +15 -0
- package/registry/date-slot-picker.json +16 -0
- package/registry/deal-banner.json +16 -0
- package/registry/deals-page.json +19 -0
- package/registry/discount-input.json +16 -0
- package/registry/index.json +411 -0
- package/registry/order-detail-page.json +16 -0
- package/registry/order-history-page.json +17 -0
- package/registry/order-history.json +16 -0
- package/registry/order-summary.json +16 -0
- package/registry/price.json +13 -0
- package/registry/product-card.json +17 -0
- package/registry/product-customizer.json +20 -0
- package/registry/product-grid.json +16 -0
- package/registry/product-image-gallery.json +13 -0
- package/registry/product-page.json +19 -0
- package/registry/product-sheet.json +18 -0
- package/registry/quantity-selector.json +13 -0
- package/registry/sale-badge.json +16 -0
- package/registry/search-input.json +15 -0
- package/registry/search-page.json +16 -0
- package/registry/service-card.json +16 -0
- package/registry/service-grid.json +16 -0
- package/registry/slot-picker.json +16 -0
- package/registry/staff-picker.json +15 -0
- package/registry/store-nav.json +15 -0
- package/registry/variant-selector.json +15 -0
- package/dist/index-B_25cFc1.d.ts +0 -320
- package/dist/index-Cd0shhZU.d.mts +0 -320
|
@@ -1,30 +1,18 @@
|
|
|
1
1
|
declare const __money: unique symbol;
|
|
2
|
-
|
|
3
|
-
type Money = string & {
|
|
2
|
+
type Money = number & {
|
|
4
3
|
readonly [__money]: true;
|
|
5
4
|
};
|
|
6
|
-
|
|
7
|
-
declare function money(value: string): Money;
|
|
8
|
-
/** Create a Money value from a number. Converts to a 2-decimal string. */
|
|
5
|
+
declare function money(value: string | number): Money;
|
|
9
6
|
declare function moneyFromNumber(value: number): Money;
|
|
10
|
-
/** Zero money constant. */
|
|
11
7
|
declare const ZERO: Money;
|
|
12
|
-
/** ISO 4217 currency codes supported by the platform */
|
|
13
8
|
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
9
|
declare function isSupportedCurrency(code: string): code is CurrencyCode;
|
|
15
|
-
/** Assert a string as CurrencyCode at API boundaries. */
|
|
16
10
|
declare function currencyCode(value: string): CurrencyCode;
|
|
17
|
-
/**
|
|
18
|
-
* @deprecated Use `CurrencyCode` instead. Kept for backward compatibility.
|
|
19
|
-
*/
|
|
20
|
-
type Currency = CurrencyCode;
|
|
21
|
-
/** Pagination parameters */
|
|
22
11
|
interface PaginationParams {
|
|
23
12
|
page?: number;
|
|
24
13
|
limit?: number;
|
|
25
14
|
offset?: number;
|
|
26
15
|
}
|
|
27
|
-
/** Pagination metadata in response */
|
|
28
16
|
interface Pagination {
|
|
29
17
|
total_count: number;
|
|
30
18
|
current_page: number;
|
|
@@ -33,7 +21,6 @@ interface Pagination {
|
|
|
33
21
|
has_more: boolean;
|
|
34
22
|
next_cursor?: string;
|
|
35
23
|
}
|
|
36
|
-
/** Strongly-typed error codes for better DX */
|
|
37
24
|
declare const ErrorCode: {
|
|
38
25
|
readonly UNKNOWN_ERROR: "UNKNOWN_ERROR";
|
|
39
26
|
readonly NETWORK_ERROR: "NETWORK_ERROR";
|
|
@@ -72,7 +59,6 @@ declare const ErrorCode: {
|
|
|
72
59
|
readonly INSUFFICIENT_QUANTITY: "INSUFFICIENT_QUANTITY";
|
|
73
60
|
};
|
|
74
61
|
type ErrorCodeType = (typeof ErrorCode)[keyof typeof ErrorCode];
|
|
75
|
-
/** API error structure */
|
|
76
62
|
interface ApiError {
|
|
77
63
|
code: string;
|
|
78
64
|
message: string;
|
|
@@ -83,45 +69,19 @@ interface ErrorHint {
|
|
|
83
69
|
suggestion: string;
|
|
84
70
|
}
|
|
85
71
|
declare const ERROR_HINTS: Record<string, ErrorHint>;
|
|
86
|
-
/**
|
|
87
|
-
* Custom error class for SDK errors with typed error codes.
|
|
88
|
-
*
|
|
89
|
-
* @example
|
|
90
|
-
* ```typescript
|
|
91
|
-
* try {
|
|
92
|
-
* await client.cart.addItem({ item_id: "prod_123" });
|
|
93
|
-
* } catch (error) {
|
|
94
|
-
* if (isCimplifyError(error)) {
|
|
95
|
-
* switch (error.code) {
|
|
96
|
-
* case ErrorCode.ITEM_UNAVAILABLE:
|
|
97
|
-
* toast.error("This item is no longer available");
|
|
98
|
-
* break;
|
|
99
|
-
* case ErrorCode.VARIANT_OUT_OF_STOCK:
|
|
100
|
-
* toast.error("Selected option is out of stock");
|
|
101
|
-
* break;
|
|
102
|
-
* default:
|
|
103
|
-
* toast.error(error.message);
|
|
104
|
-
* }
|
|
105
|
-
* }
|
|
106
|
-
* }
|
|
107
|
-
* ```
|
|
108
|
-
*/
|
|
109
72
|
declare class CimplifyError extends Error {
|
|
110
73
|
code: string;
|
|
111
74
|
retryable: boolean;
|
|
112
75
|
docs_url?: string | undefined;
|
|
113
76
|
suggestion?: string | undefined;
|
|
114
77
|
constructor(code: string, message: string, retryable?: boolean, docs_url?: string | undefined, suggestion?: string | undefined);
|
|
115
|
-
/** User-friendly message safe to display */
|
|
116
78
|
get userMessage(): string;
|
|
117
79
|
}
|
|
118
|
-
/** Type guard for CimplifyError */
|
|
119
80
|
declare function isCimplifyError(error: unknown): error is CimplifyError;
|
|
120
81
|
declare function getErrorHint(code: string): ErrorHint | undefined;
|
|
121
82
|
declare function enrichError(error: CimplifyError, options?: {
|
|
122
83
|
isTestMode?: boolean;
|
|
123
84
|
}): CimplifyError;
|
|
124
|
-
/** Check if error is retryable */
|
|
125
85
|
declare function isRetryableError(error: unknown): boolean;
|
|
126
86
|
|
|
127
87
|
type ProductType = "product" | "service" | "digital" | "bundle" | "composite";
|
|
@@ -129,7 +89,7 @@ type ProductRenderHint = "food" | "physical" | "general";
|
|
|
129
89
|
type DisplayMode = "card" | "page";
|
|
130
90
|
type InventoryType = "one_to_one" | "composition" | "none";
|
|
131
91
|
type VariantStrategy = "fetch_all" | "use_axes";
|
|
132
|
-
type DigitalProductType = "download" | "
|
|
92
|
+
type DigitalProductType = "download" | "license" | "event_ticket" | "access_pass" | "gift_code";
|
|
133
93
|
type DepositType = "none" | "fixed" | "percentage";
|
|
134
94
|
type SalesChannel = "pos" | "online" | "marketplace" | "partners";
|
|
135
95
|
interface Product {
|
|
@@ -142,11 +102,15 @@ interface Product {
|
|
|
142
102
|
image_url?: string;
|
|
143
103
|
default_price: Money;
|
|
144
104
|
type: ProductType;
|
|
145
|
-
/** Server-derived UI hint for conditional rendering. */
|
|
146
105
|
render_hint?: ProductRenderHint;
|
|
147
106
|
display_mode?: DisplayMode;
|
|
148
107
|
inventory_type: InventoryType;
|
|
149
108
|
variant_strategy: VariantStrategy;
|
|
109
|
+
inventory_status?: {
|
|
110
|
+
in_stock: boolean;
|
|
111
|
+
stock_level?: number;
|
|
112
|
+
low_stock: boolean;
|
|
113
|
+
};
|
|
150
114
|
is_active: boolean;
|
|
151
115
|
created_at: string;
|
|
152
116
|
updated_at: string;
|
|
@@ -313,7 +277,6 @@ interface VariantLocationAvailability {
|
|
|
313
277
|
updated_at: string;
|
|
314
278
|
metadata?: Record<string, unknown>;
|
|
315
279
|
}
|
|
316
|
-
/** Input for selecting a variant by axis values */
|
|
317
280
|
interface VariantAxisSelection {
|
|
318
281
|
[axisName: string]: string;
|
|
319
282
|
}
|
|
@@ -372,6 +335,7 @@ interface Category {
|
|
|
372
335
|
name: string;
|
|
373
336
|
slug: string;
|
|
374
337
|
description?: string;
|
|
338
|
+
product_count?: number;
|
|
375
339
|
created_at: string;
|
|
376
340
|
updated_at: string;
|
|
377
341
|
metadata?: Record<string, unknown>;
|
|
@@ -388,6 +352,7 @@ interface Collection {
|
|
|
388
352
|
tags?: string[];
|
|
389
353
|
image_url?: string;
|
|
390
354
|
channels?: SalesChannel[];
|
|
355
|
+
product_count?: number;
|
|
391
356
|
created_at: string;
|
|
392
357
|
updated_at: string;
|
|
393
358
|
metadata?: Record<string, unknown>;
|
|
@@ -416,6 +381,7 @@ interface Bundle {
|
|
|
416
381
|
pricing_type: BundlePriceType;
|
|
417
382
|
bundle_price?: Money;
|
|
418
383
|
discount_value?: Money;
|
|
384
|
+
product_count?: number;
|
|
419
385
|
created_at: string;
|
|
420
386
|
updated_at: string;
|
|
421
387
|
metadata?: Record<string, unknown>;
|
|
@@ -460,7 +426,7 @@ interface BundleComponentView {
|
|
|
460
426
|
product_name: string;
|
|
461
427
|
product_description?: string;
|
|
462
428
|
product_image_url?: string;
|
|
463
|
-
|
|
429
|
+
effective_price: Money;
|
|
464
430
|
quantity: number;
|
|
465
431
|
variant_id?: string;
|
|
466
432
|
allow_variant_choice: boolean;
|
|
@@ -570,14 +536,12 @@ interface CompositeComponent {
|
|
|
570
536
|
created_at: string;
|
|
571
537
|
updated_at: string;
|
|
572
538
|
}
|
|
573
|
-
/** Input for calculating composite price or adding to cart */
|
|
574
539
|
interface ComponentSelectionInput {
|
|
575
540
|
component_id: string;
|
|
576
541
|
quantity: number;
|
|
577
542
|
variant_id?: string;
|
|
578
543
|
add_on_option_id?: string;
|
|
579
544
|
}
|
|
580
|
-
/** Result of composite price calculation */
|
|
581
545
|
interface CompositePriceResult {
|
|
582
546
|
base_price: Money;
|
|
583
547
|
components_total: Money;
|
|
@@ -631,53 +595,106 @@ interface ProductTimeProfile {
|
|
|
631
595
|
updated_at: string;
|
|
632
596
|
metadata?: Record<string, unknown>;
|
|
633
597
|
}
|
|
598
|
+
interface ProductTaxonomy {
|
|
599
|
+
id: string;
|
|
600
|
+
code: string;
|
|
601
|
+
name: string;
|
|
602
|
+
description?: string;
|
|
603
|
+
parent_id?: string;
|
|
604
|
+
level: number;
|
|
605
|
+
is_active: boolean;
|
|
606
|
+
created_at: string;
|
|
607
|
+
updated_at: string;
|
|
608
|
+
}
|
|
609
|
+
interface TaxonomyWithChildren extends ProductTaxonomy {
|
|
610
|
+
children: ProductTaxonomy[];
|
|
611
|
+
}
|
|
612
|
+
interface ProductAvailabilityNow {
|
|
613
|
+
is_available: boolean;
|
|
614
|
+
schedules_today: ProductTimeProfile[];
|
|
615
|
+
}
|
|
616
|
+
type DealBenefitType = "percentage" | "fixed" | "free_item" | "buy_x_get_y_free" | "points";
|
|
617
|
+
interface Deal {
|
|
618
|
+
id: string;
|
|
619
|
+
description: string;
|
|
620
|
+
benefit_type: DealBenefitType;
|
|
621
|
+
value: Money;
|
|
622
|
+
min_order_value?: Money;
|
|
623
|
+
buy_quantity?: number;
|
|
624
|
+
get_quantity?: number;
|
|
625
|
+
stackable: boolean;
|
|
626
|
+
starts_at: string;
|
|
627
|
+
ends_at: string;
|
|
628
|
+
product_ids: string[];
|
|
629
|
+
category_ids: string[];
|
|
630
|
+
collection_ids: string[];
|
|
631
|
+
}
|
|
632
|
+
interface ProductDealInfo {
|
|
633
|
+
product_id: string;
|
|
634
|
+
deal_id: string;
|
|
635
|
+
deal_name: string;
|
|
636
|
+
benefit_type: DealBenefitType;
|
|
637
|
+
value: Money;
|
|
638
|
+
label: string;
|
|
639
|
+
}
|
|
640
|
+
interface DiscountValidation {
|
|
641
|
+
is_eligible: boolean;
|
|
642
|
+
discount_amount?: Money;
|
|
643
|
+
deal?: Deal;
|
|
644
|
+
ineligibility_reason?: string;
|
|
645
|
+
}
|
|
646
|
+
interface Tag {
|
|
647
|
+
id: string;
|
|
648
|
+
name: string;
|
|
649
|
+
slug: string;
|
|
650
|
+
color?: string;
|
|
651
|
+
icon?: string;
|
|
652
|
+
description?: string;
|
|
653
|
+
tag_group?: string;
|
|
654
|
+
sort_order: number;
|
|
655
|
+
usage_count: number;
|
|
656
|
+
created_at: string;
|
|
657
|
+
updated_at: string;
|
|
658
|
+
}
|
|
659
|
+
interface TagsResponse {
|
|
660
|
+
items: Tag[];
|
|
661
|
+
total: number;
|
|
662
|
+
limit: number;
|
|
663
|
+
offset: number;
|
|
664
|
+
}
|
|
634
665
|
|
|
635
666
|
type CartStatus = "active" | "converting" | "converted" | "expired" | "abandoned";
|
|
636
667
|
type CartChannel = "qr" | "taker" | "staff" | "web" | "dashboard";
|
|
637
|
-
type PriceSource = {
|
|
638
|
-
|
|
668
|
+
type PriceSource = "default_item" | "custom" | {
|
|
669
|
+
location_specific: string;
|
|
639
670
|
} | {
|
|
640
|
-
|
|
641
|
-
location_id: string;
|
|
671
|
+
variant: string;
|
|
642
672
|
} | {
|
|
643
|
-
|
|
644
|
-
variant_id: string;
|
|
645
|
-
} | {
|
|
646
|
-
type: "composite";
|
|
647
|
-
composite_id: string;
|
|
673
|
+
composite: string;
|
|
648
674
|
} | {
|
|
649
|
-
|
|
675
|
+
bundle: string;
|
|
650
676
|
};
|
|
651
|
-
type AdjustmentType = {
|
|
652
|
-
|
|
653
|
-
location_id: string;
|
|
654
|
-
} | {
|
|
655
|
-
type: "variant_based";
|
|
656
|
-
variant_id: string;
|
|
677
|
+
type AdjustmentType = "time_based" | {
|
|
678
|
+
location_based: string;
|
|
657
679
|
} | {
|
|
658
|
-
|
|
680
|
+
variant_based: string;
|
|
659
681
|
} | {
|
|
660
|
-
|
|
661
|
-
segment_id: string;
|
|
682
|
+
customer_segment: string;
|
|
662
683
|
} | {
|
|
663
|
-
|
|
664
|
-
tier: string;
|
|
684
|
+
customer_loyalty: string;
|
|
665
685
|
} | {
|
|
666
|
-
|
|
667
|
-
channel: string;
|
|
686
|
+
channel_markup: string;
|
|
668
687
|
} | {
|
|
669
|
-
|
|
670
|
-
discount_id: string;
|
|
688
|
+
discount: string;
|
|
671
689
|
} | {
|
|
672
|
-
|
|
673
|
-
bundle_id: string;
|
|
690
|
+
bundle: string;
|
|
674
691
|
} | {
|
|
675
|
-
|
|
676
|
-
reason: string;
|
|
692
|
+
manual: string;
|
|
677
693
|
} | {
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
694
|
+
time_limited_promotion: {
|
|
695
|
+
promotion_id: string;
|
|
696
|
+
valid_until: string;
|
|
697
|
+
};
|
|
681
698
|
};
|
|
682
699
|
interface PriceAdjustment {
|
|
683
700
|
adjustment_type: AdjustmentType;
|
|
@@ -713,7 +730,7 @@ interface ChosenPrice {
|
|
|
713
730
|
decision_path?: PriceDecisionPath;
|
|
714
731
|
tax_info?: PricePathTaxInfo;
|
|
715
732
|
}
|
|
716
|
-
type BenefitType = "percentage" | "
|
|
733
|
+
type BenefitType = "percentage" | "fixed" | "points" | "free_item" | "buy_x_get_y_free";
|
|
717
734
|
interface AppliedDiscount {
|
|
718
735
|
discount_id: string;
|
|
719
736
|
discount_code?: string;
|
|
@@ -721,6 +738,7 @@ interface AppliedDiscount {
|
|
|
721
738
|
discount_value: Money;
|
|
722
739
|
discount_amount: Money;
|
|
723
740
|
applied_at: string;
|
|
741
|
+
targeted_item_ids?: string[];
|
|
724
742
|
}
|
|
725
743
|
interface DiscountBreakdown {
|
|
726
744
|
item_discounts: Record<string, AppliedDiscount[]>;
|
|
@@ -1053,7 +1071,6 @@ interface CartItemDetails {
|
|
|
1053
1071
|
updated_at: string;
|
|
1054
1072
|
metadata?: Record<string, unknown>;
|
|
1055
1073
|
}
|
|
1056
|
-
/** Enriched cart returned by cart#enriched - matches cart_dto.rs UICart */
|
|
1057
1074
|
interface UICart {
|
|
1058
1075
|
id: string;
|
|
1059
1076
|
business_id: string;
|
|
@@ -1073,7 +1090,6 @@ interface UICart {
|
|
|
1073
1090
|
pricing: UICartPricing;
|
|
1074
1091
|
metadata?: Record<string, unknown>;
|
|
1075
1092
|
}
|
|
1076
|
-
/** Envelope returned by cart#enriched query */
|
|
1077
1093
|
interface UICartResponse {
|
|
1078
1094
|
cart: UICart;
|
|
1079
1095
|
cart_count: number;
|
|
@@ -1113,12 +1129,48 @@ interface CartSummary {
|
|
|
1113
1129
|
currency: CurrencyCode;
|
|
1114
1130
|
}
|
|
1115
1131
|
|
|
1116
|
-
type PaymentStatus = "pending" | "processing" | "
|
|
1117
|
-
type PaymentProvider = "stripe" | "paystack" | "
|
|
1118
|
-
type PaymentMethodType = "card" | "
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1132
|
+
type PaymentStatus = "initialized" | "pending" | "processing" | "authorized" | "captured" | "failed" | "cancelled" | "refunded" | "unknown" | "voided" | "requires_action" | "abandoned" | "reversed" | "disputed" | "refund_pending" | "created" | "pending_confirmation" | "success" | "succeeded" | "declined" | "partially_refunded" | "partially_paid" | "paid" | "unpaid" | "requires_payment_method" | "requires_capture" | "completed" | "error";
|
|
1133
|
+
type PaymentProvider = "stripe" | "paystack" | "cellulant" | "mtnmomo" | "offline" | "mtn" | "vodafone" | "airtel" | "cash" | "manual";
|
|
1134
|
+
type PaymentMethodType = "card" | "bank_transfer" | "cash" | {
|
|
1135
|
+
mobile_money: {
|
|
1136
|
+
provider: string;
|
|
1137
|
+
phone_number: string;
|
|
1138
|
+
};
|
|
1139
|
+
} | {
|
|
1140
|
+
ussd: {
|
|
1141
|
+
provider: string;
|
|
1142
|
+
};
|
|
1143
|
+
} | {
|
|
1144
|
+
bank: {
|
|
1145
|
+
bank_code: string;
|
|
1146
|
+
account_number: string;
|
|
1147
|
+
account_name?: string;
|
|
1148
|
+
bank_name?: string;
|
|
1149
|
+
};
|
|
1150
|
+
} | {
|
|
1151
|
+
qr: {
|
|
1152
|
+
provider: string;
|
|
1153
|
+
};
|
|
1154
|
+
} | {
|
|
1155
|
+
wallet: {
|
|
1156
|
+
provider: string;
|
|
1157
|
+
};
|
|
1158
|
+
} | {
|
|
1159
|
+
crypto: {
|
|
1160
|
+
currency: string;
|
|
1161
|
+
};
|
|
1162
|
+
} | {
|
|
1163
|
+
custom: string;
|
|
1164
|
+
};
|
|
1165
|
+
interface AddressAuthorizationData {
|
|
1166
|
+
address: string;
|
|
1167
|
+
city: string;
|
|
1168
|
+
state: string;
|
|
1169
|
+
zip_code: string;
|
|
1170
|
+
}
|
|
1171
|
+
type AuthorizationType = "otp" | "pin" | "phone" | "birthday" | {
|
|
1172
|
+
address: AddressAuthorizationData;
|
|
1173
|
+
};
|
|
1122
1174
|
type PaymentProcessingState = "initial" | "preparing" | "processing" | "verifying" | "awaiting_authorization" | "success" | "error" | "timeout";
|
|
1123
1175
|
interface PaymentMethod {
|
|
1124
1176
|
type: PaymentMethodType;
|
|
@@ -1149,7 +1201,6 @@ interface InitializePaymentResult {
|
|
|
1149
1201
|
reference: string;
|
|
1150
1202
|
provider: PaymentProvider;
|
|
1151
1203
|
}
|
|
1152
|
-
/** Normalized payment response from checkout or payment initialization */
|
|
1153
1204
|
interface PaymentResponse {
|
|
1154
1205
|
method: string;
|
|
1155
1206
|
provider: string;
|
|
@@ -1168,14 +1219,13 @@ interface PaymentResponse {
|
|
|
1168
1219
|
authorization_type?: AuthorizationType;
|
|
1169
1220
|
provider_payment_id?: string;
|
|
1170
1221
|
}
|
|
1171
|
-
/** Payment status polling response */
|
|
1172
1222
|
interface PaymentStatusResponse {
|
|
1173
1223
|
status: PaymentStatus;
|
|
1174
1224
|
paid: boolean;
|
|
1175
|
-
amount
|
|
1176
|
-
currency
|
|
1225
|
+
amount: Money;
|
|
1226
|
+
currency: string;
|
|
1177
1227
|
reference?: string;
|
|
1178
|
-
message
|
|
1228
|
+
message: string;
|
|
1179
1229
|
}
|
|
1180
1230
|
interface PaymentErrorDetails {
|
|
1181
1231
|
code: string;
|
|
@@ -1189,4 +1239,4 @@ interface SubmitAuthorizationInput {
|
|
|
1189
1239
|
value: string;
|
|
1190
1240
|
}
|
|
1191
1241
|
|
|
1192
|
-
export { type
|
|
1242
|
+
export { type BundleComponentInfo as $, type ApiError as A, type VariantAxisSelection as B, type CurrencyCode as C, type DisplayMode as D, ErrorCode as E, type AddOn as F, type AddOnWithOptions as G, type AddOnOption as H, type InventoryType as I, type AddOnOptionPrice as J, type ProductAddOn as K, type Category as L, type Money as M, type CategorySummary as N, type Collection as O, type PaginationParams as P, type CollectionSummary as Q, type CollectionProduct as R, type SalesChannel as S, type BundlePriceType as T, type Bundle as U, type VariantStrategy as V, type BundleSummary as W, type BundleProduct as X, type BundleWithDetails as Y, ZERO as Z, type BundleComponentData as _, moneyFromNumber as a, type UICartLocation as a$, type BundleComponentView as a0, type BundleComponentVariantView as a1, type VariantAxisView as a2, type VariantAxisValueView as a3, type CompositePricingMode as a4, type GroupPricingBehavior as a5, type ComponentSourceType as a6, type Composite as a7, type CompositeWithDetails as a8, type ComponentGroup as a9, type TaxPathComponent as aA, type PricePathTaxInfo as aB, type PriceDecisionPath as aC, type ChosenPrice as aD, type BenefitType as aE, type AppliedDiscount as aF, type DiscountBreakdown as aG, type DiscountDetails as aH, type SelectedAddOnOption as aI, type AddOnDetails as aJ, type CartAddOn as aK, type VariantDetails as aL, type BundleSelectionInput as aM, type BundleStoredSelection as aN, type BundleSelectionData as aO, type CompositeStoredSelection as aP, type CompositePriceBreakdown as aQ, type CompositeSelectionData as aR, type LineConfiguration as aS, type Cart as aT, type CartItem as aU, type CartTotals as aV, type DisplayCart as aW, type DisplayCartItem as aX, type DisplayAddOn as aY, type DisplayAddOnOption as aZ, type UICartBusiness as a_, type ComponentGroupWithComponents as aa, type CompositeGroupView as ab, type CompositeComponentView as ac, type CompositeComponent as ad, type ComponentSelectionInput as ae, type CompositePriceResult as af, type ComponentPriceBreakdown as ag, type PriceEntryType as ah, type Price as ai, type LocationProductPrice as aj, type ProductAvailability as ak, type ProductTimeProfile as al, type ProductTaxonomy as am, type TaxonomyWithChildren as an, type ProductAvailabilityNow as ao, type DealBenefitType as ap, type Deal as aq, type ProductDealInfo as ar, type DiscountValidation as as, type Tag as at, type TagsResponse as au, type CartStatus as av, type CartChannel as aw, type PriceSource as ax, type AdjustmentType as ay, type PriceAdjustment as az, type Pagination as b, type UICartCustomer as b0, type UICartPricing as b1, type AddOnOptionDetails as b2, type AddOnGroupDetails as b3, type VariantDetailsDTO as b4, type CartItemDetails as b5, type UICart as b6, type UICartResponse as b7, type AddToCartInput as b8, type UpdateCartItemInput as b9, type CartSummary as ba, type PaymentStatus as bb, type PaymentProvider as bc, type PaymentMethodType as bd, type AddressAuthorizationData as be, type AuthorizationType as bf, type PaymentProcessingState as bg, type PaymentMethod as bh, type Payment as bi, type InitializePaymentResult as bj, type PaymentResponse as bk, type PaymentStatusResponse as bl, type PaymentErrorDetails as bm, type SubmitAuthorizationInput as bn, currencyCode as c, type ErrorCodeType as d, type ErrorHint as e, ERROR_HINTS as f, CimplifyError as g, isCimplifyError as h, isSupportedCurrency as i, getErrorHint as j, enrichError as k, isRetryableError as l, money as m, type ProductType as n, type ProductRenderHint as o, type DigitalProductType as p, type DepositType as q, type Product as r, type ProductWithDetails as s, type ProductVariant as t, type VariantDisplayAttribute as u, type VariantAxis as v, type VariantAxisWithValues as w, type VariantAxisValue as x, type ProductVariantValue as y, type VariantLocationAvailability as z };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { aD as ChosenPrice, C as CurrencyCode } from './payment-CrNyrc-D.mjs';
|
|
2
|
+
|
|
3
|
+
interface ProductWithPrice {
|
|
4
|
+
price_info?: ChosenPrice;
|
|
5
|
+
final_price?: number | string | null;
|
|
6
|
+
base_price?: number | string | null;
|
|
7
|
+
default_price?: number | string | null;
|
|
8
|
+
currency?: CurrencyCode | null;
|
|
9
|
+
}
|
|
10
|
+
interface FormatPriceOptions {
|
|
11
|
+
currency?: CurrencyCode;
|
|
12
|
+
locale?: string;
|
|
13
|
+
minimumFractionDigits?: number;
|
|
14
|
+
maximumFractionDigits?: number;
|
|
15
|
+
}
|
|
16
|
+
interface FormatCompactOptions {
|
|
17
|
+
currency?: CurrencyCode;
|
|
18
|
+
decimals?: number;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type { FormatPriceOptions as F, ProductWithPrice as P, FormatCompactOptions as a };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { aD as ChosenPrice, C as CurrencyCode } from './payment-CrNyrc-D.js';
|
|
2
|
+
|
|
3
|
+
interface ProductWithPrice {
|
|
4
|
+
price_info?: ChosenPrice;
|
|
5
|
+
final_price?: number | string | null;
|
|
6
|
+
base_price?: number | string | null;
|
|
7
|
+
default_price?: number | string | null;
|
|
8
|
+
currency?: CurrencyCode | null;
|
|
9
|
+
}
|
|
10
|
+
interface FormatPriceOptions {
|
|
11
|
+
currency?: CurrencyCode;
|
|
12
|
+
locale?: string;
|
|
13
|
+
minimumFractionDigits?: number;
|
|
14
|
+
maximumFractionDigits?: number;
|
|
15
|
+
}
|
|
16
|
+
interface FormatCompactOptions {
|
|
17
|
+
currency?: CurrencyCode;
|
|
18
|
+
decimals?: number;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type { FormatPriceOptions as F, ProductWithPrice as P, FormatCompactOptions as a };
|