@cimplify/sdk 0.22.1 → 0.22.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/advanced.d.mts +1 -24
- package/dist/advanced.d.ts +1 -24
- package/dist/advanced.js +20 -29
- package/dist/advanced.mjs +1 -2
- package/dist/{chunk-A7IQN5EK.js → chunk-7QQOYYEB.js} +17 -17
- package/dist/{chunk-W3DMONZR.mjs → chunk-KBKAYGMI.mjs} +1 -1
- package/dist/{chunk-S6TU55KP.js → chunk-L5GKVQVJ.js} +16 -0
- package/dist/{chunk-VYSXEDBV.js → chunk-RETQI2CJ.js} +37 -2
- package/dist/{chunk-R4EYMPSN.mjs → chunk-X7FRCS2Q.mjs} +37 -2
- package/dist/{chunk-WDIMISRC.mjs → chunk-YOIVZ6OA.mjs} +16 -0
- package/dist/index.d.mts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +62 -71
- package/dist/index.mjs +3 -4
- package/dist/react.d.mts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +44 -19
- package/dist/react.mjs +28 -3
- package/dist/utils.js +4 -4
- package/dist/utils.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-FLPI2VVJ.js +0 -72
- package/dist/chunk-LM3CJ4L7.mjs +0 -69
- /package/dist/{client-uvCOGdBp.d.ts → index-uvCOGdBp.d.ts} +0 -0
- /package/dist/{client-v1NFqZFG.d.mts → index-v1NFqZFG.d.mts} +0 -0
package/dist/advanced.d.mts
CHANGED
|
@@ -1,25 +1,2 @@
|
|
|
1
|
-
export { A as AuthService, B as BusinessService, j as CartOperations, b as CatalogueQueries, l as CheckoutOperations, l as CheckoutService, M as CimplifyElement, K as CimplifyElements, X as ELEMENT_TYPES, W as EVENT_TYPES, $ as ElementEventType, Z as ElementOptions, _ as ElementType, Y as ElementsOptions, F as FetchQuoteInput, r as FxService, G as GetProductsOptions, I as InventoryService, L as LinkService, q as LiteService, V as MESSAGE_TYPES, O as OrderQueries, P as PriceQuote, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, i as RefreshQuoteResult, S as SchedulingService, N as createElements, m as generateIdempotencyKey } from './
|
|
1
|
+
export { A as AuthService, B as BusinessService, j as CartOperations, b as CatalogueQueries, l as CheckoutOperations, l as CheckoutService, M as CimplifyElement, K as CimplifyElements, X as ELEMENT_TYPES, W as EVENT_TYPES, $ as ElementEventType, Z as ElementOptions, _ as ElementType, Y as ElementsOptions, F as FetchQuoteInput, r as FxService, G as GetProductsOptions, I as InventoryService, L as LinkService, q as LiteService, V as MESSAGE_TYPES, O as OrderQueries, P as PriceQuote, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, i as RefreshQuoteResult, S as SchedulingService, N as createElements, m as generateIdempotencyKey } from './index-v1NFqZFG.mjs';
|
|
2
2
|
import './payment-DazihbCY.mjs';
|
|
3
|
-
|
|
4
|
-
type Operator = "==" | "!=" | ">" | "<" | ">=" | "<=" | "contains" | "startsWith";
|
|
5
|
-
type SortOrder = "asc" | "desc";
|
|
6
|
-
declare class QueryBuilder {
|
|
7
|
-
private entity;
|
|
8
|
-
private filters;
|
|
9
|
-
private modifiers;
|
|
10
|
-
private pathSegments;
|
|
11
|
-
constructor(entity: string);
|
|
12
|
-
path(segment: string): this;
|
|
13
|
-
where(field: string, op: Operator, value: unknown): this;
|
|
14
|
-
and(field: string, op: Operator, value: unknown): this;
|
|
15
|
-
sort(field: string, order?: SortOrder): this;
|
|
16
|
-
limit(n: number): this;
|
|
17
|
-
offset(n: number): this;
|
|
18
|
-
count(): this;
|
|
19
|
-
enriched(): this;
|
|
20
|
-
build(): string;
|
|
21
|
-
toString(): string;
|
|
22
|
-
}
|
|
23
|
-
declare function query(entity: string): QueryBuilder;
|
|
24
|
-
|
|
25
|
-
export { QueryBuilder, query };
|
package/dist/advanced.d.ts
CHANGED
|
@@ -1,25 +1,2 @@
|
|
|
1
|
-
export { A as AuthService, B as BusinessService, j as CartOperations, b as CatalogueQueries, l as CheckoutOperations, l as CheckoutService, M as CimplifyElement, K as CimplifyElements, X as ELEMENT_TYPES, W as EVENT_TYPES, $ as ElementEventType, Z as ElementOptions, _ as ElementType, Y as ElementsOptions, F as FetchQuoteInput, r as FxService, G as GetProductsOptions, I as InventoryService, L as LinkService, q as LiteService, V as MESSAGE_TYPES, O as OrderQueries, P as PriceQuote, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, i as RefreshQuoteResult, S as SchedulingService, N as createElements, m as generateIdempotencyKey } from './
|
|
1
|
+
export { A as AuthService, B as BusinessService, j as CartOperations, b as CatalogueQueries, l as CheckoutOperations, l as CheckoutService, M as CimplifyElement, K as CimplifyElements, X as ELEMENT_TYPES, W as EVENT_TYPES, $ as ElementEventType, Z as ElementOptions, _ as ElementType, Y as ElementsOptions, F as FetchQuoteInput, r as FxService, G as GetProductsOptions, I as InventoryService, L as LinkService, q as LiteService, V as MESSAGE_TYPES, O as OrderQueries, P as PriceQuote, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, i as RefreshQuoteResult, S as SchedulingService, N as createElements, m as generateIdempotencyKey } from './index-uvCOGdBp.js';
|
|
2
2
|
import './payment-DazihbCY.js';
|
|
3
|
-
|
|
4
|
-
type Operator = "==" | "!=" | ">" | "<" | ">=" | "<=" | "contains" | "startsWith";
|
|
5
|
-
type SortOrder = "asc" | "desc";
|
|
6
|
-
declare class QueryBuilder {
|
|
7
|
-
private entity;
|
|
8
|
-
private filters;
|
|
9
|
-
private modifiers;
|
|
10
|
-
private pathSegments;
|
|
11
|
-
constructor(entity: string);
|
|
12
|
-
path(segment: string): this;
|
|
13
|
-
where(field: string, op: Operator, value: unknown): this;
|
|
14
|
-
and(field: string, op: Operator, value: unknown): this;
|
|
15
|
-
sort(field: string, order?: SortOrder): this;
|
|
16
|
-
limit(n: number): this;
|
|
17
|
-
offset(n: number): this;
|
|
18
|
-
count(): this;
|
|
19
|
-
enriched(): this;
|
|
20
|
-
build(): string;
|
|
21
|
-
toString(): string;
|
|
22
|
-
}
|
|
23
|
-
declare function query(entity: string): QueryBuilder;
|
|
24
|
-
|
|
25
|
-
export { QueryBuilder, query };
|
package/dist/advanced.js
CHANGED
|
@@ -1,92 +1,83 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var chunkVYSXEDBV_js = require('./chunk-VYSXEDBV.js');
|
|
3
|
+
var chunkRETQI2CJ_js = require('./chunk-RETQI2CJ.js');
|
|
5
4
|
require('./chunk-64OCG2TJ.js');
|
|
6
5
|
|
|
7
6
|
|
|
8
7
|
|
|
9
|
-
Object.defineProperty(exports, "QueryBuilder", {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
get: function () { return chunkFLPI2VVJ_js.QueryBuilder; }
|
|
12
|
-
});
|
|
13
|
-
Object.defineProperty(exports, "query", {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: function () { return chunkFLPI2VVJ_js.query; }
|
|
16
|
-
});
|
|
17
8
|
Object.defineProperty(exports, "AuthService", {
|
|
18
9
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkRETQI2CJ_js.AuthService; }
|
|
20
11
|
});
|
|
21
12
|
Object.defineProperty(exports, "BusinessService", {
|
|
22
13
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkRETQI2CJ_js.BusinessService; }
|
|
24
15
|
});
|
|
25
16
|
Object.defineProperty(exports, "CartOperations", {
|
|
26
17
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkRETQI2CJ_js.CartOperations; }
|
|
28
19
|
});
|
|
29
20
|
Object.defineProperty(exports, "CatalogueQueries", {
|
|
30
21
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkRETQI2CJ_js.CatalogueQueries; }
|
|
32
23
|
});
|
|
33
24
|
Object.defineProperty(exports, "CheckoutOperations", {
|
|
34
25
|
enumerable: true,
|
|
35
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkRETQI2CJ_js.CheckoutService; }
|
|
36
27
|
});
|
|
37
28
|
Object.defineProperty(exports, "CheckoutService", {
|
|
38
29
|
enumerable: true,
|
|
39
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunkRETQI2CJ_js.CheckoutService; }
|
|
40
31
|
});
|
|
41
32
|
Object.defineProperty(exports, "CimplifyElement", {
|
|
42
33
|
enumerable: true,
|
|
43
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunkRETQI2CJ_js.CimplifyElement; }
|
|
44
35
|
});
|
|
45
36
|
Object.defineProperty(exports, "CimplifyElements", {
|
|
46
37
|
enumerable: true,
|
|
47
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunkRETQI2CJ_js.CimplifyElements; }
|
|
48
39
|
});
|
|
49
40
|
Object.defineProperty(exports, "ELEMENT_TYPES", {
|
|
50
41
|
enumerable: true,
|
|
51
|
-
get: function () { return
|
|
42
|
+
get: function () { return chunkRETQI2CJ_js.ELEMENT_TYPES; }
|
|
52
43
|
});
|
|
53
44
|
Object.defineProperty(exports, "EVENT_TYPES", {
|
|
54
45
|
enumerable: true,
|
|
55
|
-
get: function () { return
|
|
46
|
+
get: function () { return chunkRETQI2CJ_js.EVENT_TYPES; }
|
|
56
47
|
});
|
|
57
48
|
Object.defineProperty(exports, "FxService", {
|
|
58
49
|
enumerable: true,
|
|
59
|
-
get: function () { return
|
|
50
|
+
get: function () { return chunkRETQI2CJ_js.FxService; }
|
|
60
51
|
});
|
|
61
52
|
Object.defineProperty(exports, "InventoryService", {
|
|
62
53
|
enumerable: true,
|
|
63
|
-
get: function () { return
|
|
54
|
+
get: function () { return chunkRETQI2CJ_js.InventoryService; }
|
|
64
55
|
});
|
|
65
56
|
Object.defineProperty(exports, "LinkService", {
|
|
66
57
|
enumerable: true,
|
|
67
|
-
get: function () { return
|
|
58
|
+
get: function () { return chunkRETQI2CJ_js.LinkService; }
|
|
68
59
|
});
|
|
69
60
|
Object.defineProperty(exports, "LiteService", {
|
|
70
61
|
enumerable: true,
|
|
71
|
-
get: function () { return
|
|
62
|
+
get: function () { return chunkRETQI2CJ_js.LiteService; }
|
|
72
63
|
});
|
|
73
64
|
Object.defineProperty(exports, "MESSAGE_TYPES", {
|
|
74
65
|
enumerable: true,
|
|
75
|
-
get: function () { return
|
|
66
|
+
get: function () { return chunkRETQI2CJ_js.MESSAGE_TYPES; }
|
|
76
67
|
});
|
|
77
68
|
Object.defineProperty(exports, "OrderQueries", {
|
|
78
69
|
enumerable: true,
|
|
79
|
-
get: function () { return
|
|
70
|
+
get: function () { return chunkRETQI2CJ_js.OrderQueries; }
|
|
80
71
|
});
|
|
81
72
|
Object.defineProperty(exports, "SchedulingService", {
|
|
82
73
|
enumerable: true,
|
|
83
|
-
get: function () { return
|
|
74
|
+
get: function () { return chunkRETQI2CJ_js.SchedulingService; }
|
|
84
75
|
});
|
|
85
76
|
Object.defineProperty(exports, "createElements", {
|
|
86
77
|
enumerable: true,
|
|
87
|
-
get: function () { return
|
|
78
|
+
get: function () { return chunkRETQI2CJ_js.createElements; }
|
|
88
79
|
});
|
|
89
80
|
Object.defineProperty(exports, "generateIdempotencyKey", {
|
|
90
81
|
enumerable: true,
|
|
91
|
-
get: function () { return
|
|
82
|
+
get: function () { return chunkRETQI2CJ_js.generateIdempotencyKey; }
|
|
92
83
|
});
|
package/dist/advanced.mjs
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { AuthService, BusinessService, CartOperations, CatalogueQueries, CheckoutService as CheckoutOperations, CheckoutService, CimplifyElement, CimplifyElements, ELEMENT_TYPES, EVENT_TYPES, FxService, InventoryService, LinkService, LiteService, MESSAGE_TYPES, OrderQueries, SchedulingService, createElements, generateIdempotencyKey } from './chunk-R4EYMPSN.mjs';
|
|
1
|
+
export { AuthService, BusinessService, CartOperations, CatalogueQueries, CheckoutService as CheckoutOperations, CheckoutService, CimplifyElement, CimplifyElements, ELEMENT_TYPES, EVENT_TYPES, FxService, InventoryService, LinkService, LiteService, MESSAGE_TYPES, OrderQueries, SchedulingService, createElements, generateIdempotencyKey } from './chunk-X7FRCS2Q.mjs';
|
|
3
2
|
import './chunk-JFT63H34.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkRETQI2CJ_js = require('./chunk-RETQI2CJ.js');
|
|
4
4
|
var chunk64OCG2TJ_js = require('./chunk-64OCG2TJ.js');
|
|
5
5
|
|
|
6
6
|
// src/activity.ts
|
|
@@ -29,7 +29,7 @@ var ActivityService = class {
|
|
|
29
29
|
this.sendEvents([event]);
|
|
30
30
|
}
|
|
31
31
|
async getState() {
|
|
32
|
-
return
|
|
32
|
+
return chunkRETQI2CJ_js.safe(this.client.get("/api/v1/activity/state"));
|
|
33
33
|
}
|
|
34
34
|
async getRecommendations(options) {
|
|
35
35
|
const params = new URLSearchParams();
|
|
@@ -37,10 +37,10 @@ var ActivityService = class {
|
|
|
37
37
|
if (options?.limit) params.set("limit", String(options.limit));
|
|
38
38
|
const query = params.toString();
|
|
39
39
|
const path = query ? `/api/v1/activity/recommendations?${query}` : "/api/v1/activity/recommendations";
|
|
40
|
-
return
|
|
40
|
+
return chunkRETQI2CJ_js.safe(this.client.get(path));
|
|
41
41
|
}
|
|
42
42
|
async dismissMessage(code) {
|
|
43
|
-
return
|
|
43
|
+
return chunkRETQI2CJ_js.safe(
|
|
44
44
|
this.client.post("/api/v1/activity/messages/dismiss", { code })
|
|
45
45
|
);
|
|
46
46
|
}
|
|
@@ -66,7 +66,7 @@ var DeliveryService = class {
|
|
|
66
66
|
params.set("dropoff_lat", String(dropoffLat));
|
|
67
67
|
params.set("dropoff_lng", String(dropoffLng));
|
|
68
68
|
if (country) params.set("country", country);
|
|
69
|
-
return
|
|
69
|
+
return chunkRETQI2CJ_js.safe(
|
|
70
70
|
this.client.get(`/api/v1/delivery/fee?${params.toString()}`)
|
|
71
71
|
);
|
|
72
72
|
}
|
|
@@ -597,67 +597,67 @@ var CimplifyClient = class {
|
|
|
597
597
|
}
|
|
598
598
|
get catalogue() {
|
|
599
599
|
if (!this._catalogue) {
|
|
600
|
-
this._catalogue = new
|
|
600
|
+
this._catalogue = new chunkRETQI2CJ_js.CatalogueQueries(this);
|
|
601
601
|
}
|
|
602
602
|
return this._catalogue;
|
|
603
603
|
}
|
|
604
604
|
get cart() {
|
|
605
605
|
if (!this._cart) {
|
|
606
|
-
this._cart = new
|
|
606
|
+
this._cart = new chunkRETQI2CJ_js.CartOperations(this);
|
|
607
607
|
}
|
|
608
608
|
return this._cart;
|
|
609
609
|
}
|
|
610
610
|
get checkout() {
|
|
611
611
|
if (!this._checkout) {
|
|
612
|
-
this._checkout = new
|
|
612
|
+
this._checkout = new chunkRETQI2CJ_js.CheckoutService(this);
|
|
613
613
|
}
|
|
614
614
|
return this._checkout;
|
|
615
615
|
}
|
|
616
616
|
get orders() {
|
|
617
617
|
if (!this._orders) {
|
|
618
|
-
this._orders = new
|
|
618
|
+
this._orders = new chunkRETQI2CJ_js.OrderQueries(this);
|
|
619
619
|
}
|
|
620
620
|
return this._orders;
|
|
621
621
|
}
|
|
622
622
|
get link() {
|
|
623
623
|
if (!this._link) {
|
|
624
|
-
this._link = new
|
|
624
|
+
this._link = new chunkRETQI2CJ_js.LinkService(this);
|
|
625
625
|
}
|
|
626
626
|
return this._link;
|
|
627
627
|
}
|
|
628
628
|
get auth() {
|
|
629
629
|
if (!this._auth) {
|
|
630
|
-
this._auth = new
|
|
630
|
+
this._auth = new chunkRETQI2CJ_js.AuthService(this);
|
|
631
631
|
}
|
|
632
632
|
return this._auth;
|
|
633
633
|
}
|
|
634
634
|
get business() {
|
|
635
635
|
if (!this._business) {
|
|
636
|
-
this._business = new
|
|
636
|
+
this._business = new chunkRETQI2CJ_js.BusinessService(this);
|
|
637
637
|
}
|
|
638
638
|
return this._business;
|
|
639
639
|
}
|
|
640
640
|
get inventory() {
|
|
641
641
|
if (!this._inventory) {
|
|
642
|
-
this._inventory = new
|
|
642
|
+
this._inventory = new chunkRETQI2CJ_js.InventoryService(this);
|
|
643
643
|
}
|
|
644
644
|
return this._inventory;
|
|
645
645
|
}
|
|
646
646
|
get scheduling() {
|
|
647
647
|
if (!this._scheduling) {
|
|
648
|
-
this._scheduling = new
|
|
648
|
+
this._scheduling = new chunkRETQI2CJ_js.SchedulingService(this);
|
|
649
649
|
}
|
|
650
650
|
return this._scheduling;
|
|
651
651
|
}
|
|
652
652
|
get lite() {
|
|
653
653
|
if (!this._lite) {
|
|
654
|
-
this._lite = new
|
|
654
|
+
this._lite = new chunkRETQI2CJ_js.LiteService(this);
|
|
655
655
|
}
|
|
656
656
|
return this._lite;
|
|
657
657
|
}
|
|
658
658
|
get fx() {
|
|
659
659
|
if (!this._fx) {
|
|
660
|
-
this._fx = new
|
|
660
|
+
this._fx = new chunkRETQI2CJ_js.FxService(this);
|
|
661
661
|
}
|
|
662
662
|
return this._fx;
|
|
663
663
|
}
|
|
@@ -677,7 +677,7 @@ var CimplifyClient = class {
|
|
|
677
677
|
if (businessId) {
|
|
678
678
|
this.setBusinessId(businessId);
|
|
679
679
|
}
|
|
680
|
-
return
|
|
680
|
+
return chunkRETQI2CJ_js.createElements(this, businessId ?? this.businessId ?? void 0, options);
|
|
681
681
|
}
|
|
682
682
|
};
|
|
683
683
|
function createCimplifyClient(config = {}) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { safe, CatalogueQueries, CartOperations, CheckoutService, OrderQueries, LinkService, AuthService, BusinessService, InventoryService, SchedulingService, LiteService, FxService, createElements } from './chunk-
|
|
1
|
+
import { safe, CatalogueQueries, CartOperations, CheckoutService, OrderQueries, LinkService, AuthService, BusinessService, InventoryService, SchedulingService, LiteService, FxService, createElements } from './chunk-X7FRCS2Q.mjs';
|
|
2
2
|
import { CimplifyError, ErrorCode, enrichError } from './chunk-JFT63H34.mjs';
|
|
3
3
|
|
|
4
4
|
// src/activity.ts
|
|
@@ -97,6 +97,12 @@ var CURRENCY_TO_COUNTRY_CODE = {
|
|
|
97
97
|
ZAR: "ZA",
|
|
98
98
|
ZMW: "ZM"
|
|
99
99
|
};
|
|
100
|
+
var CURRENCY_TO_CANDIDATE_COUNTRIES = {
|
|
101
|
+
EUR: ["DE", "FR", "IT", "ES", "NL", "BE", "AT", "PT", "IE", "FI", "GR"],
|
|
102
|
+
USD: ["US", "EC", "PA", "SV"],
|
|
103
|
+
XOF: ["SN", "CI", "BF", "ML", "NE", "TG", "BJ", "GW"],
|
|
104
|
+
XAF: ["CM", "GA", "CG", "TD", "CF", "GQ"]
|
|
105
|
+
};
|
|
100
106
|
function normalizeCountryCode(value) {
|
|
101
107
|
const normalized = value?.trim().toUpperCase();
|
|
102
108
|
if (!normalized) {
|
|
@@ -153,6 +159,16 @@ function normalizePhoneToE164(raw, options = {}) {
|
|
|
153
159
|
if (internationalDigits) {
|
|
154
160
|
addAttempt(`+${internationalDigits}`);
|
|
155
161
|
}
|
|
162
|
+
const currency = options.currency?.trim().toUpperCase();
|
|
163
|
+
if (currency) {
|
|
164
|
+
const candidates = CURRENCY_TO_CANDIDATE_COUNTRIES[currency];
|
|
165
|
+
if (candidates) {
|
|
166
|
+
for (const candidate of candidates) {
|
|
167
|
+
addAttempt(trimmed, candidate);
|
|
168
|
+
if (digits) addAttempt(digits, candidate);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
156
172
|
for (const attempt of attempts) {
|
|
157
173
|
const parsed = parsePhoneCandidate(attempt.value, attempt.country);
|
|
158
174
|
if (parsed?.isValid()) {
|
|
@@ -2254,14 +2254,49 @@ function isAllowedOrigin(origin) {
|
|
|
2254
2254
|
return false;
|
|
2255
2255
|
}
|
|
2256
2256
|
}
|
|
2257
|
+
var KNOWN_IFRAME_TYPES = new Set(Object.values(MESSAGE_TYPES));
|
|
2257
2258
|
function parseIframeMessage(data) {
|
|
2258
2259
|
if (!data || typeof data !== "object") {
|
|
2259
2260
|
return null;
|
|
2260
2261
|
}
|
|
2261
|
-
const
|
|
2262
|
-
if (typeof
|
|
2262
|
+
const record = data;
|
|
2263
|
+
if (typeof record.type !== "string" || !KNOWN_IFRAME_TYPES.has(record.type)) {
|
|
2263
2264
|
return null;
|
|
2264
2265
|
}
|
|
2266
|
+
switch (record.type) {
|
|
2267
|
+
case MESSAGE_TYPES.AUTHENTICATED:
|
|
2268
|
+
if (typeof record.token !== "string") return null;
|
|
2269
|
+
break;
|
|
2270
|
+
case MESSAGE_TYPES.TOKEN_REFRESHED:
|
|
2271
|
+
if (typeof record.token !== "string") return null;
|
|
2272
|
+
break;
|
|
2273
|
+
case MESSAGE_TYPES.ADDRESS_CHANGED:
|
|
2274
|
+
case MESSAGE_TYPES.ADDRESS_SELECTED:
|
|
2275
|
+
if (!record.address || typeof record.address !== "object") return null;
|
|
2276
|
+
break;
|
|
2277
|
+
case MESSAGE_TYPES.PAYMENT_METHOD_SELECTED:
|
|
2278
|
+
if (!record.method || typeof record.method !== "object") return null;
|
|
2279
|
+
break;
|
|
2280
|
+
case MESSAGE_TYPES.CONTACT_PROVIDED:
|
|
2281
|
+
if (typeof record.contact !== "string" || typeof record.contactType !== "string") return null;
|
|
2282
|
+
break;
|
|
2283
|
+
case MESSAGE_TYPES.ERROR:
|
|
2284
|
+
if (typeof record.code !== "string" || typeof record.message !== "string") return null;
|
|
2285
|
+
break;
|
|
2286
|
+
case MESSAGE_TYPES.CHECKOUT_COMPLETE:
|
|
2287
|
+
if (typeof record.success !== "boolean") return null;
|
|
2288
|
+
break;
|
|
2289
|
+
case MESSAGE_TYPES.READY:
|
|
2290
|
+
case MESSAGE_TYPES.HEIGHT_CHANGE:
|
|
2291
|
+
if (typeof record.height !== "number") return null;
|
|
2292
|
+
break;
|
|
2293
|
+
case MESSAGE_TYPES.REQUIRES_OTP:
|
|
2294
|
+
if (typeof record.contactMasked !== "string") return null;
|
|
2295
|
+
break;
|
|
2296
|
+
case MESSAGE_TYPES.ORDER_TYPE_CHANGED:
|
|
2297
|
+
if (typeof record.orderType !== "string") return null;
|
|
2298
|
+
break;
|
|
2299
|
+
}
|
|
2265
2300
|
return data;
|
|
2266
2301
|
}
|
|
2267
2302
|
var CimplifyElements = class {
|
|
@@ -2252,14 +2252,49 @@ function isAllowedOrigin(origin) {
|
|
|
2252
2252
|
return false;
|
|
2253
2253
|
}
|
|
2254
2254
|
}
|
|
2255
|
+
var KNOWN_IFRAME_TYPES = new Set(Object.values(MESSAGE_TYPES));
|
|
2255
2256
|
function parseIframeMessage(data) {
|
|
2256
2257
|
if (!data || typeof data !== "object") {
|
|
2257
2258
|
return null;
|
|
2258
2259
|
}
|
|
2259
|
-
const
|
|
2260
|
-
if (typeof
|
|
2260
|
+
const record = data;
|
|
2261
|
+
if (typeof record.type !== "string" || !KNOWN_IFRAME_TYPES.has(record.type)) {
|
|
2261
2262
|
return null;
|
|
2262
2263
|
}
|
|
2264
|
+
switch (record.type) {
|
|
2265
|
+
case MESSAGE_TYPES.AUTHENTICATED:
|
|
2266
|
+
if (typeof record.token !== "string") return null;
|
|
2267
|
+
break;
|
|
2268
|
+
case MESSAGE_TYPES.TOKEN_REFRESHED:
|
|
2269
|
+
if (typeof record.token !== "string") return null;
|
|
2270
|
+
break;
|
|
2271
|
+
case MESSAGE_TYPES.ADDRESS_CHANGED:
|
|
2272
|
+
case MESSAGE_TYPES.ADDRESS_SELECTED:
|
|
2273
|
+
if (!record.address || typeof record.address !== "object") return null;
|
|
2274
|
+
break;
|
|
2275
|
+
case MESSAGE_TYPES.PAYMENT_METHOD_SELECTED:
|
|
2276
|
+
if (!record.method || typeof record.method !== "object") return null;
|
|
2277
|
+
break;
|
|
2278
|
+
case MESSAGE_TYPES.CONTACT_PROVIDED:
|
|
2279
|
+
if (typeof record.contact !== "string" || typeof record.contactType !== "string") return null;
|
|
2280
|
+
break;
|
|
2281
|
+
case MESSAGE_TYPES.ERROR:
|
|
2282
|
+
if (typeof record.code !== "string" || typeof record.message !== "string") return null;
|
|
2283
|
+
break;
|
|
2284
|
+
case MESSAGE_TYPES.CHECKOUT_COMPLETE:
|
|
2285
|
+
if (typeof record.success !== "boolean") return null;
|
|
2286
|
+
break;
|
|
2287
|
+
case MESSAGE_TYPES.READY:
|
|
2288
|
+
case MESSAGE_TYPES.HEIGHT_CHANGE:
|
|
2289
|
+
if (typeof record.height !== "number") return null;
|
|
2290
|
+
break;
|
|
2291
|
+
case MESSAGE_TYPES.REQUIRES_OTP:
|
|
2292
|
+
if (typeof record.contactMasked !== "string") return null;
|
|
2293
|
+
break;
|
|
2294
|
+
case MESSAGE_TYPES.ORDER_TYPE_CHANGED:
|
|
2295
|
+
if (typeof record.orderType !== "string") return null;
|
|
2296
|
+
break;
|
|
2297
|
+
}
|
|
2263
2298
|
return data;
|
|
2264
2299
|
}
|
|
2265
2300
|
var CimplifyElements = class {
|
|
@@ -95,6 +95,12 @@ var CURRENCY_TO_COUNTRY_CODE = {
|
|
|
95
95
|
ZAR: "ZA",
|
|
96
96
|
ZMW: "ZM"
|
|
97
97
|
};
|
|
98
|
+
var CURRENCY_TO_CANDIDATE_COUNTRIES = {
|
|
99
|
+
EUR: ["DE", "FR", "IT", "ES", "NL", "BE", "AT", "PT", "IE", "FI", "GR"],
|
|
100
|
+
USD: ["US", "EC", "PA", "SV"],
|
|
101
|
+
XOF: ["SN", "CI", "BF", "ML", "NE", "TG", "BJ", "GW"],
|
|
102
|
+
XAF: ["CM", "GA", "CG", "TD", "CF", "GQ"]
|
|
103
|
+
};
|
|
98
104
|
function normalizeCountryCode(value) {
|
|
99
105
|
const normalized = value?.trim().toUpperCase();
|
|
100
106
|
if (!normalized) {
|
|
@@ -151,6 +157,16 @@ function normalizePhoneToE164(raw, options = {}) {
|
|
|
151
157
|
if (internationalDigits) {
|
|
152
158
|
addAttempt(`+${internationalDigits}`);
|
|
153
159
|
}
|
|
160
|
+
const currency = options.currency?.trim().toUpperCase();
|
|
161
|
+
if (currency) {
|
|
162
|
+
const candidates = CURRENCY_TO_CANDIDATE_COUNTRIES[currency];
|
|
163
|
+
if (candidates) {
|
|
164
|
+
for (const candidate of candidates) {
|
|
165
|
+
addAttempt(trimmed, candidate);
|
|
166
|
+
if (digits) addAttempt(digits, candidate);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
154
170
|
for (const attempt of attempts) {
|
|
155
171
|
const parsed = parsePhoneCandidate(attempt.value, attempt.country);
|
|
156
172
|
if (parsed?.isValid()) {
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export { an as AUTHORIZATION_TYPE, as as AUTH_MUTATION, ac as AbortablePromise, x as ActivityRecommendation, y as ActivityRecommendationsResponse, s as ActivityService, w as ActivityStateResponse, cv as AddressData, cY as AddressInfo, b0 as AmountToPay, cG as AuthResponse, A as AuthService, o as AuthStatus, c_ as AuthenticatedCustomer, d0 as AuthenticatedData, cl as AvailabilityResult, c0 as AvailableSlot, c3 as Booking, c2 as BookingStatus, c4 as BookingWithDetails, bm as BufferTimes, bH as Business, bV as BusinessHours, bG as BusinessPreferences, B as BusinessService, bU as BusinessSettings, bF as BusinessType, bS as BusinessWithLocations, ag as CHECKOUT_MODE, at as CHECKOUT_MUTATION, aj as CHECKOUT_STEP, ap as CONTACT_TYPE, cb as CancelBookingInput, cc as CancelBookingResult, bg as CancelOrderInput, bo as CancellationPolicy, j as CartOperations, b as CatalogueQueries, aP as CatalogueResult, aQ as CatalogueSnapshot, bW as CategoryInfo, c8 as CheckSlotAvailabilityInput, c9 as CheckSlotAvailabilityResult, cJ as CheckoutAddressInfo, d4 as CheckoutCartData, d3 as CheckoutCartItem, cL as CheckoutCustomerInfo, a4 as CheckoutFormData, be as CheckoutInput, a0 as CheckoutMode, l as CheckoutOperations, a1 as CheckoutOrderType, a2 as CheckoutPaymentMethod, a5 as CheckoutResult, l as CheckoutService, aa as CheckoutStatus, ab as CheckoutStatusContext, a3 as CheckoutStep, C as CimplifyClient, a as CimplifyConfig, M as CimplifyElement, K as CimplifyElements, af as ContactType, cr as CreateAddressInput, ct as CreateMobileMoneyInput, cm as Customer, cn as CustomerAddress, c6 as CustomerBooking, c5 as CustomerBookingServiceItem, cp as CustomerLinkPreferences, co as CustomerMobileMoney, bl as CustomerServicePreferences, ax as DEFAULT_COUNTRY, aw as DEFAULT_CURRENCY, ao as DEVICE_TYPE, c1 as DayAvailability, bA as DeliveryFeeDetails, E as DeliveryFeeResponse, z as DeliveryService, bv as DepositResult, ae as DeviceType, D as DismissMessageResponse, X as ELEMENT_TYPES, W as EVENT_TYPES, cX as ElementAppearance, d7 as ElementEventHandler, $ as ElementEventType, Z as ElementOptions, _ as ElementType, d1 as ElementsCheckoutData, d2 as ElementsCheckoutResult, c$ as ElementsCustomerInfo, Y as ElementsOptions, cx as EnrollAndLinkOrderInput, cA as EnrollAndLinkOrderResult, cu as EnrollmentData, aA as Err, a$ as FeeBearerType, F as FetchQuoteInput, aZ as FulfillmentLink, aY as FulfillmentStatus, aX as FulfillmentType, cN as FxQuote, cM as FxQuoteRequest, cO as FxRateResponse, r as FxService, c7 as GetAvailableSlotsInput, n as GetOrdersOptions, G as GetProductsOptions, d6 as IframeToParentMessage, I as InventoryService, ar as LINK_MUTATION, aq as LINK_QUERY, b1 as LineItem, aU as LineType, cq as LinkData, cz as LinkEnrollResult, L as LinkService, cB as LinkSession, cy as LinkStatusResult, H as LiteBootstrap, q as LiteService, bK as Location, by as LocationAppointment, ck as LocationStock, bI as LocationTaxBehavior, bJ as LocationTaxOverrides, bN as LocationTimeProfile, bT as LocationWithDetails, V as MESSAGE_TYPES, am as MOBILE_MONEY_PROVIDER, cw as MobileMoneyData, cK as MobileMoneyDetails, ad as MobileMoneyProvider, a6 as NextAction, av as ORDER_MUTATION, ah as ORDER_TYPE, cV as ObservabilityHooks, az as Ok, b2 as Order, aT as OrderChannel, bd as OrderFilter, a_ as OrderFulfillmentSummary, b7 as OrderGroup, bb as OrderGroupDetails, b8 as OrderGroupPayment, b5 as OrderGroupPaymentState, b6 as OrderGroupPaymentStatus, ba as OrderGroupPaymentSummary, b4 as OrderGroupStatus, b3 as OrderHistory, aV as OrderLineState, aW as OrderLineStatus, bc as OrderPaymentEvent, O as OrderQueries, b9 as OrderSplitDetail, aR as OrderStatus, cW as OrderType, p as OtpResult, ai as PAYMENT_METHOD, au as PAYMENT_MUTATION, ak as PAYMENT_STATE, al as PICKUP_TIME_TYPE, d5 as ParentToIframeMessage, cZ as PaymentMethodInfo, aS as PaymentState, cI as PickupTime, cH as PickupTimeType, P as PriceQuote, bq as PricingOverrides, a9 as ProcessAndResolveOptions, a7 as ProcessCheckoutOptions, a8 as ProcessCheckoutResult, ci as ProductStock, bz as ProviderResolutionSource, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, i as RefreshQuoteResult, bh as RefundOrderInput, bD as RelatedCandidate, bC as RelatedProduct, bE as RelatedProductsEnrichment, bB as RelationType, bk as ReminderMethod, bn as ReminderSettings, k as ReorderResult, cP as RequestContext, cS as RequestErrorEvent, cE as RequestOtpInput, h as RequestSource, cQ as RequestStartEvent, cR as RequestSuccessEvent, ca as RescheduleBookingInput, cd as RescheduleBookingResult, bt as ResourceAssignment, ay as Result, cT as RetryEvent, cD as RevokeAllSessionsResult, cC as RevokeSessionResult, bP as Room, br as SchedulingMetadata, bu as SchedulingResult, S as SchedulingService, bX as Service, ce as ServiceAvailabilityParams, cf as ServiceAvailabilityResult, bQ as ServiceCharge, bp as ServiceNotes, bw as ServiceScheduleRequest, bi as ServiceStatus, v as SessionActivityData, cU as SessionChangeEvent, u as SessionMessage, b_ as SlotResourceInfo, b$ as SlotStaffInfo, bY as Staff, bs as StaffAssignment, bj as StaffRole, bx as StaffScheduleItem, ch as StockLevel, cg as StockStatus, bR as StorefrontBootstrap, bO as Table, J as TableInfo, bL as TimeRange, bM as TimeRanges, bZ as TimeSlot, t as TrackCategoryViewOptions, T as TrackProductViewOptions, cs as UpdateAddressInput, bf as UpdateOrderStatusInput, U as UpdateProfileInput, cj as VariantStock, cF as VerifyOtpInput, aN as combine, aO as combineObject, c as createCimplifyClient, N as createElements, aC as err, aH as flatMap, aL as fromPromise, m as generateIdempotencyKey, aI as getOrElse, aE as isErr, aD as isOk, aG as mapError, aF as mapResult, aB as ok, aK as toNullable, aM as tryCatch, aJ as unwrap } from './
|
|
2
|
-
export { QueryBuilder, query } from './advanced.mjs';
|
|
1
|
+
export { an as AUTHORIZATION_TYPE, as as AUTH_MUTATION, ac as AbortablePromise, x as ActivityRecommendation, y as ActivityRecommendationsResponse, s as ActivityService, w as ActivityStateResponse, cv as AddressData, cY as AddressInfo, b0 as AmountToPay, cG as AuthResponse, A as AuthService, o as AuthStatus, c_ as AuthenticatedCustomer, d0 as AuthenticatedData, cl as AvailabilityResult, c0 as AvailableSlot, c3 as Booking, c2 as BookingStatus, c4 as BookingWithDetails, bm as BufferTimes, bH as Business, bV as BusinessHours, bG as BusinessPreferences, B as BusinessService, bU as BusinessSettings, bF as BusinessType, bS as BusinessWithLocations, ag as CHECKOUT_MODE, at as CHECKOUT_MUTATION, aj as CHECKOUT_STEP, ap as CONTACT_TYPE, cb as CancelBookingInput, cc as CancelBookingResult, bg as CancelOrderInput, bo as CancellationPolicy, j as CartOperations, b as CatalogueQueries, aP as CatalogueResult, aQ as CatalogueSnapshot, bW as CategoryInfo, c8 as CheckSlotAvailabilityInput, c9 as CheckSlotAvailabilityResult, cJ as CheckoutAddressInfo, d4 as CheckoutCartData, d3 as CheckoutCartItem, cL as CheckoutCustomerInfo, a4 as CheckoutFormData, be as CheckoutInput, a0 as CheckoutMode, l as CheckoutOperations, a1 as CheckoutOrderType, a2 as CheckoutPaymentMethod, a5 as CheckoutResult, l as CheckoutService, aa as CheckoutStatus, ab as CheckoutStatusContext, a3 as CheckoutStep, C as CimplifyClient, a as CimplifyConfig, M as CimplifyElement, K as CimplifyElements, af as ContactType, cr as CreateAddressInput, ct as CreateMobileMoneyInput, cm as Customer, cn as CustomerAddress, c6 as CustomerBooking, c5 as CustomerBookingServiceItem, cp as CustomerLinkPreferences, co as CustomerMobileMoney, bl as CustomerServicePreferences, ax as DEFAULT_COUNTRY, aw as DEFAULT_CURRENCY, ao as DEVICE_TYPE, c1 as DayAvailability, bA as DeliveryFeeDetails, E as DeliveryFeeResponse, z as DeliveryService, bv as DepositResult, ae as DeviceType, D as DismissMessageResponse, X as ELEMENT_TYPES, W as EVENT_TYPES, cX as ElementAppearance, d7 as ElementEventHandler, $ as ElementEventType, Z as ElementOptions, _ as ElementType, d1 as ElementsCheckoutData, d2 as ElementsCheckoutResult, c$ as ElementsCustomerInfo, Y as ElementsOptions, cx as EnrollAndLinkOrderInput, cA as EnrollAndLinkOrderResult, cu as EnrollmentData, aA as Err, a$ as FeeBearerType, F as FetchQuoteInput, aZ as FulfillmentLink, aY as FulfillmentStatus, aX as FulfillmentType, cN as FxQuote, cM as FxQuoteRequest, cO as FxRateResponse, r as FxService, c7 as GetAvailableSlotsInput, n as GetOrdersOptions, G as GetProductsOptions, d6 as IframeToParentMessage, I as InventoryService, ar as LINK_MUTATION, aq as LINK_QUERY, b1 as LineItem, aU as LineType, cq as LinkData, cz as LinkEnrollResult, L as LinkService, cB as LinkSession, cy as LinkStatusResult, H as LiteBootstrap, q as LiteService, bK as Location, by as LocationAppointment, ck as LocationStock, bI as LocationTaxBehavior, bJ as LocationTaxOverrides, bN as LocationTimeProfile, bT as LocationWithDetails, V as MESSAGE_TYPES, am as MOBILE_MONEY_PROVIDER, cw as MobileMoneyData, cK as MobileMoneyDetails, ad as MobileMoneyProvider, a6 as NextAction, av as ORDER_MUTATION, ah as ORDER_TYPE, cV as ObservabilityHooks, az as Ok, b2 as Order, aT as OrderChannel, bd as OrderFilter, a_ as OrderFulfillmentSummary, b7 as OrderGroup, bb as OrderGroupDetails, b8 as OrderGroupPayment, b5 as OrderGroupPaymentState, b6 as OrderGroupPaymentStatus, ba as OrderGroupPaymentSummary, b4 as OrderGroupStatus, b3 as OrderHistory, aV as OrderLineState, aW as OrderLineStatus, bc as OrderPaymentEvent, O as OrderQueries, b9 as OrderSplitDetail, aR as OrderStatus, cW as OrderType, p as OtpResult, ai as PAYMENT_METHOD, au as PAYMENT_MUTATION, ak as PAYMENT_STATE, al as PICKUP_TIME_TYPE, d5 as ParentToIframeMessage, cZ as PaymentMethodInfo, aS as PaymentState, cI as PickupTime, cH as PickupTimeType, P as PriceQuote, bq as PricingOverrides, a9 as ProcessAndResolveOptions, a7 as ProcessCheckoutOptions, a8 as ProcessCheckoutResult, ci as ProductStock, bz as ProviderResolutionSource, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, i as RefreshQuoteResult, bh as RefundOrderInput, bD as RelatedCandidate, bC as RelatedProduct, bE as RelatedProductsEnrichment, bB as RelationType, bk as ReminderMethod, bn as ReminderSettings, k as ReorderResult, cP as RequestContext, cS as RequestErrorEvent, cE as RequestOtpInput, h as RequestSource, cQ as RequestStartEvent, cR as RequestSuccessEvent, ca as RescheduleBookingInput, cd as RescheduleBookingResult, bt as ResourceAssignment, ay as Result, cT as RetryEvent, cD as RevokeAllSessionsResult, cC as RevokeSessionResult, bP as Room, br as SchedulingMetadata, bu as SchedulingResult, S as SchedulingService, bX as Service, ce as ServiceAvailabilityParams, cf as ServiceAvailabilityResult, bQ as ServiceCharge, bp as ServiceNotes, bw as ServiceScheduleRequest, bi as ServiceStatus, v as SessionActivityData, cU as SessionChangeEvent, u as SessionMessage, b_ as SlotResourceInfo, b$ as SlotStaffInfo, bY as Staff, bs as StaffAssignment, bj as StaffRole, bx as StaffScheduleItem, ch as StockLevel, cg as StockStatus, bR as StorefrontBootstrap, bO as Table, J as TableInfo, bL as TimeRange, bM as TimeRanges, bZ as TimeSlot, t as TrackCategoryViewOptions, T as TrackProductViewOptions, cs as UpdateAddressInput, bf as UpdateOrderStatusInput, U as UpdateProfileInput, cj as VariantStock, cF as VerifyOtpInput, aN as combine, aO as combineObject, c as createCimplifyClient, N as createElements, aC as err, aH as flatMap, aL as fromPromise, m as generateIdempotencyKey, aI as getOrElse, aE as isErr, aD as isOk, aG as mapError, aF as mapResult, aB as ok, aK as toNullable, aM as tryCatch, aJ as unwrap } from './index-v1NFqZFG.mjs';
|
|
3
2
|
import { A as ApiError } from './payment-DazihbCY.mjs';
|
|
4
3
|
export { a0 as AddOn, aZ as AddOnDetails, bk as AddOnGroupDetails, a2 as AddOnOption, bj as AddOnOptionDetails, a3 as AddOnOptionPrice, a1 as AddOnWithOptions, bp as AddToCartInput, bv as AddressAuthorizationData, aP as AdjustmentType, aV as AppliedDiscount, u as AttributeAppliesTo, t as AttributeType, x as AttributeValidationRules, v as AttributeVisibility, bw as AuthorizationType, aU as BenefitType, bF as BillingFrequency, bH as BillingMarkupType, bG as BillingPlanType, ab as Bundle, af as BundleComponentData, ag as BundleComponentInfo, ai as BundleComponentVariantView, ah as BundleComponentView, aa as BundlePriceType, ad as BundleProduct, b3 as BundleSelectionData, b0 as BundleSelectionInput, b2 as BundleStoredSelection, ac as BundleSummary, ae as BundleWithDetails, b8 as Cart, a_ as CartAddOn, aN as CartChannel, b9 as CartItem, bm as CartItemDetails, aM as CartStatus, br as CartSummary, ba as CartTotals, a5 as Category, a6 as CategorySummary, C as ChosenPrice, h as CimplifyError, a7 as Collection, a9 as CollectionProduct, a8 as CollectionSummary, aq as ComponentGroup, ar as ComponentGroupWithComponents, ax as ComponentPriceBreakdown, b1 as ComponentSchedulingData, av as ComponentSelectionInput, an as ComponentSourceType, ao as Composite, au as CompositeComponent, at as CompositeComponentView, as as CompositeGroupView, b5 as CompositePriceBreakdown, aw as CompositePriceResult, al as CompositePricingMode, b6 as CompositeSelectionData, av as CompositeSelectionInput, b4 as CompositeStoredSelection, ap as CompositeWithDetails, a as CurrencyCode, y as CustomAttributeDefinition, z as CustomAttributeValue, aH as Deal, aG as DealBenefitType, r as DepositType, q as DigitalProductType, aW as DiscountBreakdown, aX as DiscountDetails, aJ as DiscountValidation, bd as DisplayAddOn, be as DisplayAddOnOption, bb as DisplayCart, bc as DisplayCartItem, D as DisplayMode, s as DurationUnit, g as ERROR_HINTS, bJ as EligiblePlansQuery, E as ErrorCode, e as ErrorCodeType, f as ErrorHint, H as FacetValue, bK as FormattedPlanOption, am as GroupPricingBehavior, bA as InitializePaymentResult, I as InventoryType, K as KnowledgeArticle, b7 as LineConfiguration, aA as LocationProductPrice, w as MeasurementValue, M as Money, d as Pagination, P as PaginationParams, bz as Payment, bD as PaymentErrorDetails, by as PaymentMethod, bu as PaymentMethodType, bx as PaymentProcessingState, bt as PaymentProvider, bB as PaymentResponse, bs as PaymentStatus, bC as PaymentStatusResponse, az as Price, aQ as PriceAdjustment, aT as PriceDecisionPath, ay as PriceEntryType, aS as PricePathTaxInfo, aO as PriceSource, J as Product, a4 as ProductAddOn, aB as ProductAvailability, aF as ProductAvailabilityNow, bI as ProductBillingPlan, aI as ProductDealInfo, F as ProductProperty, p as ProductRenderHint, aD as ProductTaxonomy, aC as ProductTimeProfile, o as ProductType, O as ProductVariant, Y as ProductVariantValue, L as ProductWithDetails, G as PropertyFacet, B as PropertySource, R as RelatedProductView, S as SalesChannel, aY as SelectedAddOnOption, bE as SubmitAuthorizationInput, aK as Tag, aL as TagsResponse, aR as TaxPathComponent, T as TaxonomyAttributeTemplate, aE as TaxonomyWithChildren, bn as UICart, bf as UICartBusiness, bh as UICartCustomer, bg as UICartLocation, bi as UICartPricing, bo as UICartResponse, bq as UpdateCartItemInput, U as VariantAxis, $ as VariantAxisSelection, X as VariantAxisValue, ak as VariantAxisValueView, aj as VariantAxisView, W as VariantAxisWithValues, a$ as VariantDetails, bl as VariantDetailsDTO, Q as VariantDisplayAttribute, _ as VariantLocationAvailability, V as VariantStrategy, N as VariantView, Z as ZERO, c as currencyCode, l as enrichError, k as getErrorHint, j as isCimplifyError, n as isRetryableError, i as isSupportedCurrency, m as money, b as moneyFromNumber } from './payment-DazihbCY.mjs';
|
|
5
4
|
export { CURRENCY_SYMBOLS, MOBILE_MONEY_PROVIDERS, categorizePaymentError, detectMobileMoneyProvider, formatMoney, formatNumberCompact, formatPrice, formatPriceAdjustment, formatPriceCompact, formatPriceWithTax, formatProductPrice, getBasePrice, getCurrencySymbol, getDiscountPercentage, getDisplayPrice, getMarkupPercentage, getProductCurrency, getTaxAmount, hasTaxInfo, isOnSale, isPaymentStatusFailure, isPaymentStatusRequiresAction, isPaymentStatusSuccess, isTaxInclusive, isValidPhoneForContext, normalizePaymentResponse, normalizePhoneToE164, normalizeStatusResponse, parsePrice, resolvePhoneCountryCode } from './utils.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export { an as AUTHORIZATION_TYPE, as as AUTH_MUTATION, ac as AbortablePromise, x as ActivityRecommendation, y as ActivityRecommendationsResponse, s as ActivityService, w as ActivityStateResponse, cv as AddressData, cY as AddressInfo, b0 as AmountToPay, cG as AuthResponse, A as AuthService, o as AuthStatus, c_ as AuthenticatedCustomer, d0 as AuthenticatedData, cl as AvailabilityResult, c0 as AvailableSlot, c3 as Booking, c2 as BookingStatus, c4 as BookingWithDetails, bm as BufferTimes, bH as Business, bV as BusinessHours, bG as BusinessPreferences, B as BusinessService, bU as BusinessSettings, bF as BusinessType, bS as BusinessWithLocations, ag as CHECKOUT_MODE, at as CHECKOUT_MUTATION, aj as CHECKOUT_STEP, ap as CONTACT_TYPE, cb as CancelBookingInput, cc as CancelBookingResult, bg as CancelOrderInput, bo as CancellationPolicy, j as CartOperations, b as CatalogueQueries, aP as CatalogueResult, aQ as CatalogueSnapshot, bW as CategoryInfo, c8 as CheckSlotAvailabilityInput, c9 as CheckSlotAvailabilityResult, cJ as CheckoutAddressInfo, d4 as CheckoutCartData, d3 as CheckoutCartItem, cL as CheckoutCustomerInfo, a4 as CheckoutFormData, be as CheckoutInput, a0 as CheckoutMode, l as CheckoutOperations, a1 as CheckoutOrderType, a2 as CheckoutPaymentMethod, a5 as CheckoutResult, l as CheckoutService, aa as CheckoutStatus, ab as CheckoutStatusContext, a3 as CheckoutStep, C as CimplifyClient, a as CimplifyConfig, M as CimplifyElement, K as CimplifyElements, af as ContactType, cr as CreateAddressInput, ct as CreateMobileMoneyInput, cm as Customer, cn as CustomerAddress, c6 as CustomerBooking, c5 as CustomerBookingServiceItem, cp as CustomerLinkPreferences, co as CustomerMobileMoney, bl as CustomerServicePreferences, ax as DEFAULT_COUNTRY, aw as DEFAULT_CURRENCY, ao as DEVICE_TYPE, c1 as DayAvailability, bA as DeliveryFeeDetails, E as DeliveryFeeResponse, z as DeliveryService, bv as DepositResult, ae as DeviceType, D as DismissMessageResponse, X as ELEMENT_TYPES, W as EVENT_TYPES, cX as ElementAppearance, d7 as ElementEventHandler, $ as ElementEventType, Z as ElementOptions, _ as ElementType, d1 as ElementsCheckoutData, d2 as ElementsCheckoutResult, c$ as ElementsCustomerInfo, Y as ElementsOptions, cx as EnrollAndLinkOrderInput, cA as EnrollAndLinkOrderResult, cu as EnrollmentData, aA as Err, a$ as FeeBearerType, F as FetchQuoteInput, aZ as FulfillmentLink, aY as FulfillmentStatus, aX as FulfillmentType, cN as FxQuote, cM as FxQuoteRequest, cO as FxRateResponse, r as FxService, c7 as GetAvailableSlotsInput, n as GetOrdersOptions, G as GetProductsOptions, d6 as IframeToParentMessage, I as InventoryService, ar as LINK_MUTATION, aq as LINK_QUERY, b1 as LineItem, aU as LineType, cq as LinkData, cz as LinkEnrollResult, L as LinkService, cB as LinkSession, cy as LinkStatusResult, H as LiteBootstrap, q as LiteService, bK as Location, by as LocationAppointment, ck as LocationStock, bI as LocationTaxBehavior, bJ as LocationTaxOverrides, bN as LocationTimeProfile, bT as LocationWithDetails, V as MESSAGE_TYPES, am as MOBILE_MONEY_PROVIDER, cw as MobileMoneyData, cK as MobileMoneyDetails, ad as MobileMoneyProvider, a6 as NextAction, av as ORDER_MUTATION, ah as ORDER_TYPE, cV as ObservabilityHooks, az as Ok, b2 as Order, aT as OrderChannel, bd as OrderFilter, a_ as OrderFulfillmentSummary, b7 as OrderGroup, bb as OrderGroupDetails, b8 as OrderGroupPayment, b5 as OrderGroupPaymentState, b6 as OrderGroupPaymentStatus, ba as OrderGroupPaymentSummary, b4 as OrderGroupStatus, b3 as OrderHistory, aV as OrderLineState, aW as OrderLineStatus, bc as OrderPaymentEvent, O as OrderQueries, b9 as OrderSplitDetail, aR as OrderStatus, cW as OrderType, p as OtpResult, ai as PAYMENT_METHOD, au as PAYMENT_MUTATION, ak as PAYMENT_STATE, al as PICKUP_TIME_TYPE, d5 as ParentToIframeMessage, cZ as PaymentMethodInfo, aS as PaymentState, cI as PickupTime, cH as PickupTimeType, P as PriceQuote, bq as PricingOverrides, a9 as ProcessAndResolveOptions, a7 as ProcessCheckoutOptions, a8 as ProcessCheckoutResult, ci as ProductStock, bz as ProviderResolutionSource, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, i as RefreshQuoteResult, bh as RefundOrderInput, bD as RelatedCandidate, bC as RelatedProduct, bE as RelatedProductsEnrichment, bB as RelationType, bk as ReminderMethod, bn as ReminderSettings, k as ReorderResult, cP as RequestContext, cS as RequestErrorEvent, cE as RequestOtpInput, h as RequestSource, cQ as RequestStartEvent, cR as RequestSuccessEvent, ca as RescheduleBookingInput, cd as RescheduleBookingResult, bt as ResourceAssignment, ay as Result, cT as RetryEvent, cD as RevokeAllSessionsResult, cC as RevokeSessionResult, bP as Room, br as SchedulingMetadata, bu as SchedulingResult, S as SchedulingService, bX as Service, ce as ServiceAvailabilityParams, cf as ServiceAvailabilityResult, bQ as ServiceCharge, bp as ServiceNotes, bw as ServiceScheduleRequest, bi as ServiceStatus, v as SessionActivityData, cU as SessionChangeEvent, u as SessionMessage, b_ as SlotResourceInfo, b$ as SlotStaffInfo, bY as Staff, bs as StaffAssignment, bj as StaffRole, bx as StaffScheduleItem, ch as StockLevel, cg as StockStatus, bR as StorefrontBootstrap, bO as Table, J as TableInfo, bL as TimeRange, bM as TimeRanges, bZ as TimeSlot, t as TrackCategoryViewOptions, T as TrackProductViewOptions, cs as UpdateAddressInput, bf as UpdateOrderStatusInput, U as UpdateProfileInput, cj as VariantStock, cF as VerifyOtpInput, aN as combine, aO as combineObject, c as createCimplifyClient, N as createElements, aC as err, aH as flatMap, aL as fromPromise, m as generateIdempotencyKey, aI as getOrElse, aE as isErr, aD as isOk, aG as mapError, aF as mapResult, aB as ok, aK as toNullable, aM as tryCatch, aJ as unwrap } from './
|
|
2
|
-
export { QueryBuilder, query } from './advanced.js';
|
|
1
|
+
export { an as AUTHORIZATION_TYPE, as as AUTH_MUTATION, ac as AbortablePromise, x as ActivityRecommendation, y as ActivityRecommendationsResponse, s as ActivityService, w as ActivityStateResponse, cv as AddressData, cY as AddressInfo, b0 as AmountToPay, cG as AuthResponse, A as AuthService, o as AuthStatus, c_ as AuthenticatedCustomer, d0 as AuthenticatedData, cl as AvailabilityResult, c0 as AvailableSlot, c3 as Booking, c2 as BookingStatus, c4 as BookingWithDetails, bm as BufferTimes, bH as Business, bV as BusinessHours, bG as BusinessPreferences, B as BusinessService, bU as BusinessSettings, bF as BusinessType, bS as BusinessWithLocations, ag as CHECKOUT_MODE, at as CHECKOUT_MUTATION, aj as CHECKOUT_STEP, ap as CONTACT_TYPE, cb as CancelBookingInput, cc as CancelBookingResult, bg as CancelOrderInput, bo as CancellationPolicy, j as CartOperations, b as CatalogueQueries, aP as CatalogueResult, aQ as CatalogueSnapshot, bW as CategoryInfo, c8 as CheckSlotAvailabilityInput, c9 as CheckSlotAvailabilityResult, cJ as CheckoutAddressInfo, d4 as CheckoutCartData, d3 as CheckoutCartItem, cL as CheckoutCustomerInfo, a4 as CheckoutFormData, be as CheckoutInput, a0 as CheckoutMode, l as CheckoutOperations, a1 as CheckoutOrderType, a2 as CheckoutPaymentMethod, a5 as CheckoutResult, l as CheckoutService, aa as CheckoutStatus, ab as CheckoutStatusContext, a3 as CheckoutStep, C as CimplifyClient, a as CimplifyConfig, M as CimplifyElement, K as CimplifyElements, af as ContactType, cr as CreateAddressInput, ct as CreateMobileMoneyInput, cm as Customer, cn as CustomerAddress, c6 as CustomerBooking, c5 as CustomerBookingServiceItem, cp as CustomerLinkPreferences, co as CustomerMobileMoney, bl as CustomerServicePreferences, ax as DEFAULT_COUNTRY, aw as DEFAULT_CURRENCY, ao as DEVICE_TYPE, c1 as DayAvailability, bA as DeliveryFeeDetails, E as DeliveryFeeResponse, z as DeliveryService, bv as DepositResult, ae as DeviceType, D as DismissMessageResponse, X as ELEMENT_TYPES, W as EVENT_TYPES, cX as ElementAppearance, d7 as ElementEventHandler, $ as ElementEventType, Z as ElementOptions, _ as ElementType, d1 as ElementsCheckoutData, d2 as ElementsCheckoutResult, c$ as ElementsCustomerInfo, Y as ElementsOptions, cx as EnrollAndLinkOrderInput, cA as EnrollAndLinkOrderResult, cu as EnrollmentData, aA as Err, a$ as FeeBearerType, F as FetchQuoteInput, aZ as FulfillmentLink, aY as FulfillmentStatus, aX as FulfillmentType, cN as FxQuote, cM as FxQuoteRequest, cO as FxRateResponse, r as FxService, c7 as GetAvailableSlotsInput, n as GetOrdersOptions, G as GetProductsOptions, d6 as IframeToParentMessage, I as InventoryService, ar as LINK_MUTATION, aq as LINK_QUERY, b1 as LineItem, aU as LineType, cq as LinkData, cz as LinkEnrollResult, L as LinkService, cB as LinkSession, cy as LinkStatusResult, H as LiteBootstrap, q as LiteService, bK as Location, by as LocationAppointment, ck as LocationStock, bI as LocationTaxBehavior, bJ as LocationTaxOverrides, bN as LocationTimeProfile, bT as LocationWithDetails, V as MESSAGE_TYPES, am as MOBILE_MONEY_PROVIDER, cw as MobileMoneyData, cK as MobileMoneyDetails, ad as MobileMoneyProvider, a6 as NextAction, av as ORDER_MUTATION, ah as ORDER_TYPE, cV as ObservabilityHooks, az as Ok, b2 as Order, aT as OrderChannel, bd as OrderFilter, a_ as OrderFulfillmentSummary, b7 as OrderGroup, bb as OrderGroupDetails, b8 as OrderGroupPayment, b5 as OrderGroupPaymentState, b6 as OrderGroupPaymentStatus, ba as OrderGroupPaymentSummary, b4 as OrderGroupStatus, b3 as OrderHistory, aV as OrderLineState, aW as OrderLineStatus, bc as OrderPaymentEvent, O as OrderQueries, b9 as OrderSplitDetail, aR as OrderStatus, cW as OrderType, p as OtpResult, ai as PAYMENT_METHOD, au as PAYMENT_MUTATION, ak as PAYMENT_STATE, al as PICKUP_TIME_TYPE, d5 as ParentToIframeMessage, cZ as PaymentMethodInfo, aS as PaymentState, cI as PickupTime, cH as PickupTimeType, P as PriceQuote, bq as PricingOverrides, a9 as ProcessAndResolveOptions, a7 as ProcessCheckoutOptions, a8 as ProcessCheckoutResult, ci as ProductStock, bz as ProviderResolutionSource, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, i as RefreshQuoteResult, bh as RefundOrderInput, bD as RelatedCandidate, bC as RelatedProduct, bE as RelatedProductsEnrichment, bB as RelationType, bk as ReminderMethod, bn as ReminderSettings, k as ReorderResult, cP as RequestContext, cS as RequestErrorEvent, cE as RequestOtpInput, h as RequestSource, cQ as RequestStartEvent, cR as RequestSuccessEvent, ca as RescheduleBookingInput, cd as RescheduleBookingResult, bt as ResourceAssignment, ay as Result, cT as RetryEvent, cD as RevokeAllSessionsResult, cC as RevokeSessionResult, bP as Room, br as SchedulingMetadata, bu as SchedulingResult, S as SchedulingService, bX as Service, ce as ServiceAvailabilityParams, cf as ServiceAvailabilityResult, bQ as ServiceCharge, bp as ServiceNotes, bw as ServiceScheduleRequest, bi as ServiceStatus, v as SessionActivityData, cU as SessionChangeEvent, u as SessionMessage, b_ as SlotResourceInfo, b$ as SlotStaffInfo, bY as Staff, bs as StaffAssignment, bj as StaffRole, bx as StaffScheduleItem, ch as StockLevel, cg as StockStatus, bR as StorefrontBootstrap, bO as Table, J as TableInfo, bL as TimeRange, bM as TimeRanges, bZ as TimeSlot, t as TrackCategoryViewOptions, T as TrackProductViewOptions, cs as UpdateAddressInput, bf as UpdateOrderStatusInput, U as UpdateProfileInput, cj as VariantStock, cF as VerifyOtpInput, aN as combine, aO as combineObject, c as createCimplifyClient, N as createElements, aC as err, aH as flatMap, aL as fromPromise, m as generateIdempotencyKey, aI as getOrElse, aE as isErr, aD as isOk, aG as mapError, aF as mapResult, aB as ok, aK as toNullable, aM as tryCatch, aJ as unwrap } from './index-uvCOGdBp.js';
|
|
3
2
|
import { A as ApiError } from './payment-DazihbCY.js';
|
|
4
3
|
export { a0 as AddOn, aZ as AddOnDetails, bk as AddOnGroupDetails, a2 as AddOnOption, bj as AddOnOptionDetails, a3 as AddOnOptionPrice, a1 as AddOnWithOptions, bp as AddToCartInput, bv as AddressAuthorizationData, aP as AdjustmentType, aV as AppliedDiscount, u as AttributeAppliesTo, t as AttributeType, x as AttributeValidationRules, v as AttributeVisibility, bw as AuthorizationType, aU as BenefitType, bF as BillingFrequency, bH as BillingMarkupType, bG as BillingPlanType, ab as Bundle, af as BundleComponentData, ag as BundleComponentInfo, ai as BundleComponentVariantView, ah as BundleComponentView, aa as BundlePriceType, ad as BundleProduct, b3 as BundleSelectionData, b0 as BundleSelectionInput, b2 as BundleStoredSelection, ac as BundleSummary, ae as BundleWithDetails, b8 as Cart, a_ as CartAddOn, aN as CartChannel, b9 as CartItem, bm as CartItemDetails, aM as CartStatus, br as CartSummary, ba as CartTotals, a5 as Category, a6 as CategorySummary, C as ChosenPrice, h as CimplifyError, a7 as Collection, a9 as CollectionProduct, a8 as CollectionSummary, aq as ComponentGroup, ar as ComponentGroupWithComponents, ax as ComponentPriceBreakdown, b1 as ComponentSchedulingData, av as ComponentSelectionInput, an as ComponentSourceType, ao as Composite, au as CompositeComponent, at as CompositeComponentView, as as CompositeGroupView, b5 as CompositePriceBreakdown, aw as CompositePriceResult, al as CompositePricingMode, b6 as CompositeSelectionData, av as CompositeSelectionInput, b4 as CompositeStoredSelection, ap as CompositeWithDetails, a as CurrencyCode, y as CustomAttributeDefinition, z as CustomAttributeValue, aH as Deal, aG as DealBenefitType, r as DepositType, q as DigitalProductType, aW as DiscountBreakdown, aX as DiscountDetails, aJ as DiscountValidation, bd as DisplayAddOn, be as DisplayAddOnOption, bb as DisplayCart, bc as DisplayCartItem, D as DisplayMode, s as DurationUnit, g as ERROR_HINTS, bJ as EligiblePlansQuery, E as ErrorCode, e as ErrorCodeType, f as ErrorHint, H as FacetValue, bK as FormattedPlanOption, am as GroupPricingBehavior, bA as InitializePaymentResult, I as InventoryType, K as KnowledgeArticle, b7 as LineConfiguration, aA as LocationProductPrice, w as MeasurementValue, M as Money, d as Pagination, P as PaginationParams, bz as Payment, bD as PaymentErrorDetails, by as PaymentMethod, bu as PaymentMethodType, bx as PaymentProcessingState, bt as PaymentProvider, bB as PaymentResponse, bs as PaymentStatus, bC as PaymentStatusResponse, az as Price, aQ as PriceAdjustment, aT as PriceDecisionPath, ay as PriceEntryType, aS as PricePathTaxInfo, aO as PriceSource, J as Product, a4 as ProductAddOn, aB as ProductAvailability, aF as ProductAvailabilityNow, bI as ProductBillingPlan, aI as ProductDealInfo, F as ProductProperty, p as ProductRenderHint, aD as ProductTaxonomy, aC as ProductTimeProfile, o as ProductType, O as ProductVariant, Y as ProductVariantValue, L as ProductWithDetails, G as PropertyFacet, B as PropertySource, R as RelatedProductView, S as SalesChannel, aY as SelectedAddOnOption, bE as SubmitAuthorizationInput, aK as Tag, aL as TagsResponse, aR as TaxPathComponent, T as TaxonomyAttributeTemplate, aE as TaxonomyWithChildren, bn as UICart, bf as UICartBusiness, bh as UICartCustomer, bg as UICartLocation, bi as UICartPricing, bo as UICartResponse, bq as UpdateCartItemInput, U as VariantAxis, $ as VariantAxisSelection, X as VariantAxisValue, ak as VariantAxisValueView, aj as VariantAxisView, W as VariantAxisWithValues, a$ as VariantDetails, bl as VariantDetailsDTO, Q as VariantDisplayAttribute, _ as VariantLocationAvailability, V as VariantStrategy, N as VariantView, Z as ZERO, c as currencyCode, l as enrichError, k as getErrorHint, j as isCimplifyError, n as isRetryableError, i as isSupportedCurrency, m as money, b as moneyFromNumber } from './payment-DazihbCY.js';
|
|
5
4
|
export { CURRENCY_SYMBOLS, MOBILE_MONEY_PROVIDERS, categorizePaymentError, detectMobileMoneyProvider, formatMoney, formatNumberCompact, formatPrice, formatPriceAdjustment, formatPriceCompact, formatPriceWithTax, formatProductPrice, getBasePrice, getCurrencySymbol, getDiscountPercentage, getDisplayPrice, getMarkupPercentage, getProductCurrency, getTaxAmount, hasTaxInfo, isOnSale, isPaymentStatusFailure, isPaymentStatusRequiresAction, isPaymentStatusSuccess, isTaxInclusive, isValidPhoneForContext, normalizePaymentResponse, normalizePhoneToE164, normalizeStatusResponse, parsePrice, resolvePhoneCountryCode } from './utils.js';
|