@cimplify/sdk 0.7.14 → 0.8.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/advanced.d.mts +1 -1
- package/dist/advanced.d.ts +1 -1
- package/dist/advanced.js +47 -35
- package/dist/advanced.mjs +47 -35
- package/dist/{client-CVqmSTNq.d.mts → client-I-utsHva.d.mts} +14 -3
- package/dist/{client-Dkinq9Oz.d.ts → client-tMD3aBuM.d.ts} +14 -3
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +47 -35
- package/dist/index.mjs +47 -35
- package/dist/react.d.mts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +62 -106
- package/dist/react.mjs +62 -106
- package/package.json +1 -1
package/dist/advanced.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AuthService, B as BusinessService, i as CartOperations, b as CatalogueQueries, j as CheckoutOperations, j as CheckoutService, t as CimplifyElement, s as CimplifyElements, v as ELEMENT_TYPES, E as EVENT_TYPES, z as ElementEventType, x as ElementOptions, y as ElementType, w as ElementsOptions, F as FetchQuoteInput, q as FxService, G as GetProductsOptions, I as InventoryService, L as LinkService, p as LiteService, M 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, h as RefreshQuoteResult, o as SchedulingService, S as SearchOptions, u as createElements, k as generateIdempotencyKey } from './client-
|
|
1
|
+
export { A as AuthService, B as BusinessService, i as CartOperations, b as CatalogueQueries, j as CheckoutOperations, j as CheckoutService, t as CimplifyElement, s as CimplifyElements, v as ELEMENT_TYPES, E as EVENT_TYPES, z as ElementEventType, x as ElementOptions, y as ElementType, w as ElementsOptions, F as FetchQuoteInput, q as FxService, G as GetProductsOptions, I as InventoryService, L as LinkService, p as LiteService, M 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, h as RefreshQuoteResult, o as SchedulingService, S as SearchOptions, u as createElements, k as generateIdempotencyKey } from './client-I-utsHva.mjs';
|
|
2
2
|
import './payment-CLIWNMaP.mjs';
|
|
3
3
|
|
|
4
4
|
type Operator = "==" | "!=" | ">" | "<" | ">=" | "<=" | "contains" | "startsWith";
|
package/dist/advanced.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AuthService, B as BusinessService, i as CartOperations, b as CatalogueQueries, j as CheckoutOperations, j as CheckoutService, t as CimplifyElement, s as CimplifyElements, v as ELEMENT_TYPES, E as EVENT_TYPES, z as ElementEventType, x as ElementOptions, y as ElementType, w as ElementsOptions, F as FetchQuoteInput, q as FxService, G as GetProductsOptions, I as InventoryService, L as LinkService, p as LiteService, M 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, h as RefreshQuoteResult, o as SchedulingService, S as SearchOptions, u as createElements, k as generateIdempotencyKey } from './client-
|
|
1
|
+
export { A as AuthService, B as BusinessService, i as CartOperations, b as CatalogueQueries, j as CheckoutOperations, j as CheckoutService, t as CimplifyElement, s as CimplifyElements, v as ELEMENT_TYPES, E as EVENT_TYPES, z as ElementEventType, x as ElementOptions, y as ElementType, w as ElementsOptions, F as FetchQuoteInput, q as FxService, G as GetProductsOptions, I as InventoryService, L as LinkService, p as LiteService, M 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, h as RefreshQuoteResult, o as SchedulingService, S as SearchOptions, u as createElements, k as generateIdempotencyKey } from './client-tMD3aBuM.js';
|
|
2
2
|
import './payment-CLIWNMaP.js';
|
|
3
3
|
|
|
4
4
|
type Operator = "==" | "!=" | ">" | "<" | ">=" | "<=" | "contains" | "startsWith";
|
package/dist/advanced.js
CHANGED
|
@@ -2136,7 +2136,8 @@ var FxService = class {
|
|
|
2136
2136
|
var ELEMENT_TYPES = {
|
|
2137
2137
|
AUTH: "auth",
|
|
2138
2138
|
ADDRESS: "address",
|
|
2139
|
-
PAYMENT: "payment"
|
|
2139
|
+
PAYMENT: "payment",
|
|
2140
|
+
CHECKOUT: "checkout"
|
|
2140
2141
|
};
|
|
2141
2142
|
var MESSAGE_TYPES = {
|
|
2142
2143
|
// Parent → Iframe
|
|
@@ -2160,7 +2161,8 @@ var MESSAGE_TYPES = {
|
|
|
2160
2161
|
LOGOUT_COMPLETE: "logout_complete",
|
|
2161
2162
|
CONTACT_PROVIDED: "contact_provided",
|
|
2162
2163
|
CHECKOUT_STATUS: "checkout_status",
|
|
2163
|
-
CHECKOUT_COMPLETE: "checkout_complete"
|
|
2164
|
+
CHECKOUT_COMPLETE: "checkout_complete",
|
|
2165
|
+
ORDER_TYPE_CHANGED: "order_type_changed"
|
|
2164
2166
|
};
|
|
2165
2167
|
var EVENT_TYPES = {
|
|
2166
2168
|
READY: "ready",
|
|
@@ -2169,7 +2171,8 @@ var EVENT_TYPES = {
|
|
|
2169
2171
|
ERROR: "error",
|
|
2170
2172
|
CHANGE: "change",
|
|
2171
2173
|
BLUR: "blur",
|
|
2172
|
-
FOCUS: "focus"
|
|
2174
|
+
FOCUS: "focus",
|
|
2175
|
+
ORDER_TYPE_CHANGED: "order_type_changed"
|
|
2173
2176
|
};
|
|
2174
2177
|
|
|
2175
2178
|
// src/elements.ts
|
|
@@ -2318,40 +2321,43 @@ var CimplifyElements = class {
|
|
|
2318
2321
|
false
|
|
2319
2322
|
);
|
|
2320
2323
|
}
|
|
2321
|
-
const
|
|
2322
|
-
if (!
|
|
2323
|
-
console.debug("[cimplify:checkout] BLOCKED: no
|
|
2324
|
+
const checkoutElement = this.elements.get(ELEMENT_TYPES.CHECKOUT) || this.elements.get(ELEMENT_TYPES.PAYMENT);
|
|
2325
|
+
if (!checkoutElement) {
|
|
2326
|
+
console.debug("[cimplify:checkout] BLOCKED: no checkout element");
|
|
2324
2327
|
return toCheckoutError(
|
|
2325
2328
|
"NO_PAYMENT_ELEMENT",
|
|
2326
|
-
"
|
|
2329
|
+
"Checkout element must be mounted before checkout.",
|
|
2327
2330
|
false
|
|
2328
2331
|
);
|
|
2329
2332
|
}
|
|
2330
|
-
if (!
|
|
2331
|
-
console.debug("[cimplify:checkout] BLOCKED:
|
|
2333
|
+
if (!checkoutElement.isMounted()) {
|
|
2334
|
+
console.debug("[cimplify:checkout] BLOCKED: checkout element not mounted");
|
|
2332
2335
|
return toCheckoutError(
|
|
2333
2336
|
"PAYMENT_NOT_MOUNTED",
|
|
2334
|
-
"
|
|
2337
|
+
"Checkout element must be mounted before checkout.",
|
|
2335
2338
|
false
|
|
2336
2339
|
);
|
|
2337
2340
|
}
|
|
2338
|
-
const
|
|
2339
|
-
if (
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
"
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2341
|
+
const isUnifiedCheckout = this.elements.has(ELEMENT_TYPES.CHECKOUT);
|
|
2342
|
+
if (!isUnifiedCheckout) {
|
|
2343
|
+
const authElement = this.elements.get(ELEMENT_TYPES.AUTH);
|
|
2344
|
+
if (authElement && !this.accessToken) {
|
|
2345
|
+
console.debug("[cimplify:checkout] BLOCKED: auth incomplete");
|
|
2346
|
+
return toCheckoutError(
|
|
2347
|
+
"AUTH_INCOMPLETE",
|
|
2348
|
+
"Authentication must complete before checkout can start.",
|
|
2349
|
+
true
|
|
2350
|
+
);
|
|
2351
|
+
}
|
|
2352
|
+
const addressElement = this.elements.get(ELEMENT_TYPES.ADDRESS);
|
|
2353
|
+
if (addressElement) {
|
|
2354
|
+
console.debug("[cimplify:checkout] getting address data...");
|
|
2355
|
+
await addressElement.getData();
|
|
2356
|
+
console.debug("[cimplify:checkout] address data resolved", this.addressData);
|
|
2357
|
+
}
|
|
2358
|
+
await this.hydrateCustomerData();
|
|
2352
2359
|
}
|
|
2353
|
-
|
|
2354
|
-
console.debug("[cimplify:checkout] customer data hydrated", { customerData: this.customerData, accountId: this.accountId });
|
|
2360
|
+
console.debug("[cimplify:checkout] customer data hydrated", { customerData: this.customerData, accountId: this.accountId, isUnifiedCheckout });
|
|
2355
2361
|
const processMessage = {
|
|
2356
2362
|
type: MESSAGE_TYPES.PROCESS_CHECKOUT,
|
|
2357
2363
|
cart_id: options.cart_id,
|
|
@@ -2362,8 +2368,9 @@ var CimplifyElements = class {
|
|
|
2362
2368
|
tip_amount: options.tip_amount,
|
|
2363
2369
|
pay_currency: options.pay_currency,
|
|
2364
2370
|
enroll_in_link: options.enroll_in_link ?? true,
|
|
2365
|
-
address
|
|
2366
|
-
|
|
2371
|
+
// Unified checkout has its own address/customer state; only pass if available externally
|
|
2372
|
+
address: isUnifiedCheckout ? void 0 : this.addressData ?? void 0,
|
|
2373
|
+
customer: isUnifiedCheckout ? void 0 : this.customerData ? {
|
|
2367
2374
|
name: this.customerData.name,
|
|
2368
2375
|
email: this.customerData.email,
|
|
2369
2376
|
phone: this.customerData.phone
|
|
@@ -2372,7 +2379,7 @@ var CimplifyElements = class {
|
|
|
2372
2379
|
customer_id: this.customerId ?? void 0
|
|
2373
2380
|
};
|
|
2374
2381
|
const timeoutMs = options.timeout_ms ?? 18e4;
|
|
2375
|
-
const paymentWindow =
|
|
2382
|
+
const paymentWindow = checkoutElement.getContentWindow();
|
|
2376
2383
|
this.checkoutInProgress = true;
|
|
2377
2384
|
return new Promise((resolve) => {
|
|
2378
2385
|
let settled = false;
|
|
@@ -2410,7 +2417,7 @@ var CimplifyElements = class {
|
|
|
2410
2417
|
return;
|
|
2411
2418
|
}
|
|
2412
2419
|
if (message.type === MESSAGE_TYPES.LOGOUT_COMPLETE) {
|
|
2413
|
-
|
|
2420
|
+
checkoutElement.sendMessage({ type: MESSAGE_TYPES.ABORT_CHECKOUT });
|
|
2414
2421
|
settle(
|
|
2415
2422
|
toCheckoutError(
|
|
2416
2423
|
"AUTH_LOST",
|
|
@@ -2441,7 +2448,7 @@ var CimplifyElements = class {
|
|
|
2441
2448
|
window.addEventListener("message", handleCheckoutMessage);
|
|
2442
2449
|
}
|
|
2443
2450
|
abortFn = () => {
|
|
2444
|
-
|
|
2451
|
+
checkoutElement.sendMessage({ type: MESSAGE_TYPES.ABORT_CHECKOUT });
|
|
2445
2452
|
settle(
|
|
2446
2453
|
toCheckoutError(
|
|
2447
2454
|
"CANCELLED",
|
|
@@ -2451,8 +2458,8 @@ var CimplifyElements = class {
|
|
|
2451
2458
|
);
|
|
2452
2459
|
};
|
|
2453
2460
|
this.activeCheckoutAbort = abortFn;
|
|
2454
|
-
console.debug("[cimplify:checkout] sending process_checkout to
|
|
2455
|
-
|
|
2461
|
+
console.debug("[cimplify:checkout] sending process_checkout to checkout iframe", { cart_id: processMessage.cart_id, order_type: processMessage.order_type, hasCustomer: !!processMessage.customer, hasAddress: !!processMessage.address, isUnifiedCheckout });
|
|
2462
|
+
checkoutElement.sendMessage(processMessage);
|
|
2456
2463
|
console.debug("[cimplify:checkout] postMessage sent, waiting for checkout_complete...");
|
|
2457
2464
|
});
|
|
2458
2465
|
})();
|
|
@@ -2531,7 +2538,7 @@ var CimplifyElements = class {
|
|
|
2531
2538
|
this.customerData = customer;
|
|
2532
2539
|
this.client.setAccessToken(message.token);
|
|
2533
2540
|
this.elements.forEach((element, type) => {
|
|
2534
|
-
if (type !== ELEMENT_TYPES.AUTH) {
|
|
2541
|
+
if (type !== ELEMENT_TYPES.AUTH && type !== ELEMENT_TYPES.CHECKOUT) {
|
|
2535
2542
|
element.sendMessage({ type: MESSAGE_TYPES.SET_TOKEN, token: message.token });
|
|
2536
2543
|
}
|
|
2537
2544
|
});
|
|
@@ -2721,7 +2728,9 @@ var CimplifyElement = class {
|
|
|
2721
2728
|
publicKey,
|
|
2722
2729
|
demoMode: publicKey.length === 0,
|
|
2723
2730
|
prefillEmail: this.options.prefillEmail,
|
|
2724
|
-
appearance: this.parent.getAppearance()
|
|
2731
|
+
appearance: this.parent.getAppearance(),
|
|
2732
|
+
orderTypes: this.options.orderTypes,
|
|
2733
|
+
defaultOrderType: this.options.defaultOrderType
|
|
2725
2734
|
});
|
|
2726
2735
|
const token = this.parent.getAccessToken();
|
|
2727
2736
|
if (token && this.type !== ELEMENT_TYPES.AUTH) {
|
|
@@ -2785,6 +2794,9 @@ var CimplifyElement = class {
|
|
|
2785
2794
|
case MESSAGE_TYPES.CONTACT_PROVIDED:
|
|
2786
2795
|
this.parent._setGuestContact(message.contact, message.contactType);
|
|
2787
2796
|
break;
|
|
2797
|
+
case MESSAGE_TYPES.ORDER_TYPE_CHANGED:
|
|
2798
|
+
this.emit(EVENT_TYPES.ORDER_TYPE_CHANGED, { orderType: message.orderType });
|
|
2799
|
+
break;
|
|
2788
2800
|
}
|
|
2789
2801
|
}
|
|
2790
2802
|
emit(event, data) {
|
package/dist/advanced.mjs
CHANGED
|
@@ -2134,7 +2134,8 @@ var FxService = class {
|
|
|
2134
2134
|
var ELEMENT_TYPES = {
|
|
2135
2135
|
AUTH: "auth",
|
|
2136
2136
|
ADDRESS: "address",
|
|
2137
|
-
PAYMENT: "payment"
|
|
2137
|
+
PAYMENT: "payment",
|
|
2138
|
+
CHECKOUT: "checkout"
|
|
2138
2139
|
};
|
|
2139
2140
|
var MESSAGE_TYPES = {
|
|
2140
2141
|
// Parent → Iframe
|
|
@@ -2158,7 +2159,8 @@ var MESSAGE_TYPES = {
|
|
|
2158
2159
|
LOGOUT_COMPLETE: "logout_complete",
|
|
2159
2160
|
CONTACT_PROVIDED: "contact_provided",
|
|
2160
2161
|
CHECKOUT_STATUS: "checkout_status",
|
|
2161
|
-
CHECKOUT_COMPLETE: "checkout_complete"
|
|
2162
|
+
CHECKOUT_COMPLETE: "checkout_complete",
|
|
2163
|
+
ORDER_TYPE_CHANGED: "order_type_changed"
|
|
2162
2164
|
};
|
|
2163
2165
|
var EVENT_TYPES = {
|
|
2164
2166
|
READY: "ready",
|
|
@@ -2167,7 +2169,8 @@ var EVENT_TYPES = {
|
|
|
2167
2169
|
ERROR: "error",
|
|
2168
2170
|
CHANGE: "change",
|
|
2169
2171
|
BLUR: "blur",
|
|
2170
|
-
FOCUS: "focus"
|
|
2172
|
+
FOCUS: "focus",
|
|
2173
|
+
ORDER_TYPE_CHANGED: "order_type_changed"
|
|
2171
2174
|
};
|
|
2172
2175
|
|
|
2173
2176
|
// src/elements.ts
|
|
@@ -2316,40 +2319,43 @@ var CimplifyElements = class {
|
|
|
2316
2319
|
false
|
|
2317
2320
|
);
|
|
2318
2321
|
}
|
|
2319
|
-
const
|
|
2320
|
-
if (!
|
|
2321
|
-
console.debug("[cimplify:checkout] BLOCKED: no
|
|
2322
|
+
const checkoutElement = this.elements.get(ELEMENT_TYPES.CHECKOUT) || this.elements.get(ELEMENT_TYPES.PAYMENT);
|
|
2323
|
+
if (!checkoutElement) {
|
|
2324
|
+
console.debug("[cimplify:checkout] BLOCKED: no checkout element");
|
|
2322
2325
|
return toCheckoutError(
|
|
2323
2326
|
"NO_PAYMENT_ELEMENT",
|
|
2324
|
-
"
|
|
2327
|
+
"Checkout element must be mounted before checkout.",
|
|
2325
2328
|
false
|
|
2326
2329
|
);
|
|
2327
2330
|
}
|
|
2328
|
-
if (!
|
|
2329
|
-
console.debug("[cimplify:checkout] BLOCKED:
|
|
2331
|
+
if (!checkoutElement.isMounted()) {
|
|
2332
|
+
console.debug("[cimplify:checkout] BLOCKED: checkout element not mounted");
|
|
2330
2333
|
return toCheckoutError(
|
|
2331
2334
|
"PAYMENT_NOT_MOUNTED",
|
|
2332
|
-
"
|
|
2335
|
+
"Checkout element must be mounted before checkout.",
|
|
2333
2336
|
false
|
|
2334
2337
|
);
|
|
2335
2338
|
}
|
|
2336
|
-
const
|
|
2337
|
-
if (
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
"
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2339
|
+
const isUnifiedCheckout = this.elements.has(ELEMENT_TYPES.CHECKOUT);
|
|
2340
|
+
if (!isUnifiedCheckout) {
|
|
2341
|
+
const authElement = this.elements.get(ELEMENT_TYPES.AUTH);
|
|
2342
|
+
if (authElement && !this.accessToken) {
|
|
2343
|
+
console.debug("[cimplify:checkout] BLOCKED: auth incomplete");
|
|
2344
|
+
return toCheckoutError(
|
|
2345
|
+
"AUTH_INCOMPLETE",
|
|
2346
|
+
"Authentication must complete before checkout can start.",
|
|
2347
|
+
true
|
|
2348
|
+
);
|
|
2349
|
+
}
|
|
2350
|
+
const addressElement = this.elements.get(ELEMENT_TYPES.ADDRESS);
|
|
2351
|
+
if (addressElement) {
|
|
2352
|
+
console.debug("[cimplify:checkout] getting address data...");
|
|
2353
|
+
await addressElement.getData();
|
|
2354
|
+
console.debug("[cimplify:checkout] address data resolved", this.addressData);
|
|
2355
|
+
}
|
|
2356
|
+
await this.hydrateCustomerData();
|
|
2350
2357
|
}
|
|
2351
|
-
|
|
2352
|
-
console.debug("[cimplify:checkout] customer data hydrated", { customerData: this.customerData, accountId: this.accountId });
|
|
2358
|
+
console.debug("[cimplify:checkout] customer data hydrated", { customerData: this.customerData, accountId: this.accountId, isUnifiedCheckout });
|
|
2353
2359
|
const processMessage = {
|
|
2354
2360
|
type: MESSAGE_TYPES.PROCESS_CHECKOUT,
|
|
2355
2361
|
cart_id: options.cart_id,
|
|
@@ -2360,8 +2366,9 @@ var CimplifyElements = class {
|
|
|
2360
2366
|
tip_amount: options.tip_amount,
|
|
2361
2367
|
pay_currency: options.pay_currency,
|
|
2362
2368
|
enroll_in_link: options.enroll_in_link ?? true,
|
|
2363
|
-
address
|
|
2364
|
-
|
|
2369
|
+
// Unified checkout has its own address/customer state; only pass if available externally
|
|
2370
|
+
address: isUnifiedCheckout ? void 0 : this.addressData ?? void 0,
|
|
2371
|
+
customer: isUnifiedCheckout ? void 0 : this.customerData ? {
|
|
2365
2372
|
name: this.customerData.name,
|
|
2366
2373
|
email: this.customerData.email,
|
|
2367
2374
|
phone: this.customerData.phone
|
|
@@ -2370,7 +2377,7 @@ var CimplifyElements = class {
|
|
|
2370
2377
|
customer_id: this.customerId ?? void 0
|
|
2371
2378
|
};
|
|
2372
2379
|
const timeoutMs = options.timeout_ms ?? 18e4;
|
|
2373
|
-
const paymentWindow =
|
|
2380
|
+
const paymentWindow = checkoutElement.getContentWindow();
|
|
2374
2381
|
this.checkoutInProgress = true;
|
|
2375
2382
|
return new Promise((resolve) => {
|
|
2376
2383
|
let settled = false;
|
|
@@ -2408,7 +2415,7 @@ var CimplifyElements = class {
|
|
|
2408
2415
|
return;
|
|
2409
2416
|
}
|
|
2410
2417
|
if (message.type === MESSAGE_TYPES.LOGOUT_COMPLETE) {
|
|
2411
|
-
|
|
2418
|
+
checkoutElement.sendMessage({ type: MESSAGE_TYPES.ABORT_CHECKOUT });
|
|
2412
2419
|
settle(
|
|
2413
2420
|
toCheckoutError(
|
|
2414
2421
|
"AUTH_LOST",
|
|
@@ -2439,7 +2446,7 @@ var CimplifyElements = class {
|
|
|
2439
2446
|
window.addEventListener("message", handleCheckoutMessage);
|
|
2440
2447
|
}
|
|
2441
2448
|
abortFn = () => {
|
|
2442
|
-
|
|
2449
|
+
checkoutElement.sendMessage({ type: MESSAGE_TYPES.ABORT_CHECKOUT });
|
|
2443
2450
|
settle(
|
|
2444
2451
|
toCheckoutError(
|
|
2445
2452
|
"CANCELLED",
|
|
@@ -2449,8 +2456,8 @@ var CimplifyElements = class {
|
|
|
2449
2456
|
);
|
|
2450
2457
|
};
|
|
2451
2458
|
this.activeCheckoutAbort = abortFn;
|
|
2452
|
-
console.debug("[cimplify:checkout] sending process_checkout to
|
|
2453
|
-
|
|
2459
|
+
console.debug("[cimplify:checkout] sending process_checkout to checkout iframe", { cart_id: processMessage.cart_id, order_type: processMessage.order_type, hasCustomer: !!processMessage.customer, hasAddress: !!processMessage.address, isUnifiedCheckout });
|
|
2460
|
+
checkoutElement.sendMessage(processMessage);
|
|
2454
2461
|
console.debug("[cimplify:checkout] postMessage sent, waiting for checkout_complete...");
|
|
2455
2462
|
});
|
|
2456
2463
|
})();
|
|
@@ -2529,7 +2536,7 @@ var CimplifyElements = class {
|
|
|
2529
2536
|
this.customerData = customer;
|
|
2530
2537
|
this.client.setAccessToken(message.token);
|
|
2531
2538
|
this.elements.forEach((element, type) => {
|
|
2532
|
-
if (type !== ELEMENT_TYPES.AUTH) {
|
|
2539
|
+
if (type !== ELEMENT_TYPES.AUTH && type !== ELEMENT_TYPES.CHECKOUT) {
|
|
2533
2540
|
element.sendMessage({ type: MESSAGE_TYPES.SET_TOKEN, token: message.token });
|
|
2534
2541
|
}
|
|
2535
2542
|
});
|
|
@@ -2719,7 +2726,9 @@ var CimplifyElement = class {
|
|
|
2719
2726
|
publicKey,
|
|
2720
2727
|
demoMode: publicKey.length === 0,
|
|
2721
2728
|
prefillEmail: this.options.prefillEmail,
|
|
2722
|
-
appearance: this.parent.getAppearance()
|
|
2729
|
+
appearance: this.parent.getAppearance(),
|
|
2730
|
+
orderTypes: this.options.orderTypes,
|
|
2731
|
+
defaultOrderType: this.options.defaultOrderType
|
|
2723
2732
|
});
|
|
2724
2733
|
const token = this.parent.getAccessToken();
|
|
2725
2734
|
if (token && this.type !== ELEMENT_TYPES.AUTH) {
|
|
@@ -2783,6 +2792,9 @@ var CimplifyElement = class {
|
|
|
2783
2792
|
case MESSAGE_TYPES.CONTACT_PROVIDED:
|
|
2784
2793
|
this.parent._setGuestContact(message.contact, message.contactType);
|
|
2785
2794
|
break;
|
|
2795
|
+
case MESSAGE_TYPES.ORDER_TYPE_CHANGED:
|
|
2796
|
+
this.emit(EVENT_TYPES.ORDER_TYPE_CHANGED, { orderType: message.orderType });
|
|
2797
|
+
break;
|
|
2786
2798
|
}
|
|
2787
2799
|
}
|
|
2788
2800
|
emit(event, data) {
|
|
@@ -1883,10 +1883,12 @@ declare class FxService {
|
|
|
1883
1883
|
lockQuote(request: FxQuoteRequest): Promise<Result<FxQuote, CimplifyError>>;
|
|
1884
1884
|
}
|
|
1885
1885
|
|
|
1886
|
+
type OrderType = "delivery" | "pickup" | "dine_in";
|
|
1886
1887
|
declare const ELEMENT_TYPES: {
|
|
1887
1888
|
readonly AUTH: "auth";
|
|
1888
1889
|
readonly ADDRESS: "address";
|
|
1889
1890
|
readonly PAYMENT: "payment";
|
|
1891
|
+
readonly CHECKOUT: "checkout";
|
|
1890
1892
|
};
|
|
1891
1893
|
type ElementType = (typeof ELEMENT_TYPES)[keyof typeof ELEMENT_TYPES];
|
|
1892
1894
|
declare const MESSAGE_TYPES: {
|
|
@@ -1910,6 +1912,7 @@ declare const MESSAGE_TYPES: {
|
|
|
1910
1912
|
readonly CONTACT_PROVIDED: "contact_provided";
|
|
1911
1913
|
readonly CHECKOUT_STATUS: "checkout_status";
|
|
1912
1914
|
readonly CHECKOUT_COMPLETE: "checkout_complete";
|
|
1915
|
+
readonly ORDER_TYPE_CHANGED: "order_type_changed";
|
|
1913
1916
|
};
|
|
1914
1917
|
interface ElementsOptions {
|
|
1915
1918
|
linkUrl?: string;
|
|
@@ -1928,6 +1931,8 @@ interface ElementOptions {
|
|
|
1928
1931
|
prefillEmail?: string;
|
|
1929
1932
|
amount?: number;
|
|
1930
1933
|
currency?: CurrencyCode;
|
|
1934
|
+
orderTypes?: OrderType[];
|
|
1935
|
+
defaultOrderType?: OrderType;
|
|
1931
1936
|
}
|
|
1932
1937
|
interface AddressInfo {
|
|
1933
1938
|
id?: string;
|
|
@@ -1991,6 +1996,8 @@ type ParentToIframeMessage = {
|
|
|
1991
1996
|
demoMode?: boolean;
|
|
1992
1997
|
prefillEmail?: string;
|
|
1993
1998
|
appearance?: ElementAppearance;
|
|
1999
|
+
orderTypes?: OrderType[];
|
|
2000
|
+
defaultOrderType?: OrderType;
|
|
1994
2001
|
} | {
|
|
1995
2002
|
type: typeof MESSAGE_TYPES.SET_TOKEN;
|
|
1996
2003
|
token: string;
|
|
@@ -2003,7 +2010,7 @@ type ParentToIframeMessage = {
|
|
|
2003
2010
|
} | {
|
|
2004
2011
|
type: typeof MESSAGE_TYPES.PROCESS_CHECKOUT;
|
|
2005
2012
|
cart_id: string;
|
|
2006
|
-
order_type
|
|
2013
|
+
order_type?: OrderType;
|
|
2007
2014
|
location_id?: string;
|
|
2008
2015
|
notes?: string;
|
|
2009
2016
|
scheduled_time?: string;
|
|
@@ -2011,7 +2018,7 @@ type ParentToIframeMessage = {
|
|
|
2011
2018
|
pay_currency?: CurrencyCode;
|
|
2012
2019
|
enroll_in_link?: boolean;
|
|
2013
2020
|
address?: AddressInfo;
|
|
2014
|
-
customer
|
|
2021
|
+
customer?: ElementsCustomerInfo;
|
|
2015
2022
|
account_id?: string;
|
|
2016
2023
|
customer_id?: string;
|
|
2017
2024
|
} | {
|
|
@@ -2076,6 +2083,9 @@ type IframeToParentMessage = {
|
|
|
2076
2083
|
recoverable: boolean;
|
|
2077
2084
|
};
|
|
2078
2085
|
enrolled_in_link?: boolean;
|
|
2086
|
+
} | {
|
|
2087
|
+
type: typeof MESSAGE_TYPES.ORDER_TYPE_CHANGED;
|
|
2088
|
+
orderType: OrderType;
|
|
2079
2089
|
};
|
|
2080
2090
|
declare const EVENT_TYPES: {
|
|
2081
2091
|
readonly READY: "ready";
|
|
@@ -2085,6 +2095,7 @@ declare const EVENT_TYPES: {
|
|
|
2085
2095
|
readonly CHANGE: "change";
|
|
2086
2096
|
readonly BLUR: "blur";
|
|
2087
2097
|
readonly FOCUS: "focus";
|
|
2098
|
+
readonly ORDER_TYPE_CHANGED: "order_type_changed";
|
|
2088
2099
|
};
|
|
2089
2100
|
type ElementEventType = (typeof EVENT_TYPES)[keyof typeof EVENT_TYPES];
|
|
2090
2101
|
type ElementEventHandler<T = unknown> = (data: T) => void;
|
|
@@ -2269,4 +2280,4 @@ declare class CimplifyClient {
|
|
|
2269
2280
|
}
|
|
2270
2281
|
declare function createCimplifyClient(config?: CimplifyConfig): CimplifyClient;
|
|
2271
2282
|
|
|
2272
|
-
export { type AbortablePromise as $, AuthService as A, BusinessService as B, CimplifyClient as C, type CheckoutMode as D, EVENT_TYPES as E, type FetchQuoteInput as F, type GetProductsOptions as G, type CheckoutOrderType as H, InventoryService as I, type CheckoutPaymentMethod as J, type CheckoutStep as K, LinkService as L, MESSAGE_TYPES as M, type CheckoutFormData as N, OrderQueries as O, type PriceQuote as P, type QuoteCompositeSelectionInput as Q, type RefreshQuoteInput as R, type SearchOptions as S, type TableInfo as T, type UpdateProfileInput as U, type CheckoutResult as V, type ProcessCheckoutOptions as W, type ProcessCheckoutResult as X, type ProcessAndResolveOptions as Y, type CheckoutStatus as Z, type CheckoutStatusContext as _, type CimplifyConfig as a, type CheckoutInput as a$, type MobileMoneyProvider as a0, type DeviceType as a1, type ContactType as a2, CHECKOUT_MODE as a3, ORDER_TYPE as a4, PAYMENT_METHOD as a5, CHECKOUT_STEP as a6, PAYMENT_STATE as a7, PICKUP_TIME_TYPE as a8, MOBILE_MONEY_PROVIDER as a9, combine as aA, combineObject as aB, type CatalogueResult as aC, type CatalogueSnapshot as aD, type OrderStatus as aE, type PaymentState as aF, type OrderChannel as aG, type LineType as aH, type OrderLineState as aI, type OrderLineStatus as aJ, type FulfillmentType as aK, type FulfillmentStatus as aL, type FulfillmentLink as aM, type OrderFulfillmentSummary as aN, type FeeBearerType as aO, type AmountToPay as aP, type LineItem as aQ, type Order as aR, type OrderHistory as aS, type OrderGroupPaymentState as aT, type OrderGroup as aU, type OrderGroupPayment as aV, type OrderSplitDetail as aW, type OrderGroupPaymentSummary as aX, type OrderGroupDetails as aY, type OrderPaymentEvent as aZ, type OrderFilter as a_, AUTHORIZATION_TYPE as aa, DEVICE_TYPE as ab, CONTACT_TYPE as ac, LINK_QUERY as ad, LINK_MUTATION as ae, AUTH_MUTATION as af, CHECKOUT_MUTATION as ag, PAYMENT_MUTATION as ah, ORDER_MUTATION as ai, DEFAULT_CURRENCY as aj, DEFAULT_COUNTRY as ak, type Result as al, type Ok as am, type Err as an, ok as ao, err as ap, isOk as aq, isErr as ar, mapResult as as, mapError as at, flatMap as au, getOrElse as av, unwrap as aw, toNullable as ax, fromPromise as ay, tryCatch as az, CatalogueQueries as b, type LocationStock as b$, type UpdateOrderStatusInput as b0, type CancelOrderInput as b1, type RefundOrderInput as b2, type ServiceStatus as b3, type StaffRole as b4, type ReminderMethod as b5, type CustomerServicePreferences as b6, type BufferTimes as b7, type ReminderSettings as b8, type CancellationPolicy as b9, type BusinessHours as bA, type CategoryInfo as bB, type Service as bC, type Staff as bD, type TimeSlot as bE, type AvailableSlot as bF, type DayAvailability as bG, type BookingStatus as bH, type Booking as bI, type BookingWithDetails as bJ, type CustomerBookingServiceItem as bK, type CustomerBooking as bL, type GetAvailableSlotsInput as bM, type CheckSlotAvailabilityInput as bN, type CheckSlotAvailabilityResult as bO, type RescheduleBookingInput as bP, type CancelBookingInput as bQ, type CancelBookingResult as bR, type RescheduleBookingResult as bS, type ServiceAvailabilityParams as bT, type ServiceAvailabilityResult as bU, type StockOwnershipType as bV, type StockStatus as bW, type Stock as bX, type StockLevel as bY, type ProductStock as bZ, type VariantStock as b_, type ServiceNotes as ba, type PricingOverrides as bb, type SchedulingMetadata as bc, type StaffAssignment as bd, type ResourceAssignment as be, type SchedulingResult as bf, type DepositResult as bg, type ServiceScheduleRequest as bh, type StaffScheduleItem as bi, type LocationAppointment as bj, type BusinessType as bk, type BusinessPreferences as bl, type Business as bm, type LocationTaxBehavior as bn, type LocationTaxOverrides as bo, type Location as bp, type TimeRange as bq, type TimeRanges as br, type LocationTimeProfile as bs, type Table as bt, type Room as bu, type ServiceCharge as bv, type StorefrontBootstrap as bw, type BusinessWithLocations as bx, type LocationWithDetails as by, type BusinessSettings as bz, createCimplifyClient as c, type AvailabilityCheck as c0, type AvailabilityResult as c1, type InventorySummary as c2, type Customer as c3, type CustomerAddress as c4, type CustomerMobileMoney as c5, type CustomerLinkPreferences as c6, type LinkData as c7, type CreateAddressInput as c8, type UpdateAddressInput as c9, type RetryEvent as cA, type SessionChangeEvent as cB, type ObservabilityHooks as cC, type
|
|
2283
|
+
export { type AbortablePromise as $, AuthService as A, BusinessService as B, CimplifyClient as C, type CheckoutMode as D, EVENT_TYPES as E, type FetchQuoteInput as F, type GetProductsOptions as G, type CheckoutOrderType as H, InventoryService as I, type CheckoutPaymentMethod as J, type CheckoutStep as K, LinkService as L, MESSAGE_TYPES as M, type CheckoutFormData as N, OrderQueries as O, type PriceQuote as P, type QuoteCompositeSelectionInput as Q, type RefreshQuoteInput as R, type SearchOptions as S, type TableInfo as T, type UpdateProfileInput as U, type CheckoutResult as V, type ProcessCheckoutOptions as W, type ProcessCheckoutResult as X, type ProcessAndResolveOptions as Y, type CheckoutStatus as Z, type CheckoutStatusContext as _, type CimplifyConfig as a, type CheckoutInput as a$, type MobileMoneyProvider as a0, type DeviceType as a1, type ContactType as a2, CHECKOUT_MODE as a3, ORDER_TYPE as a4, PAYMENT_METHOD as a5, CHECKOUT_STEP as a6, PAYMENT_STATE as a7, PICKUP_TIME_TYPE as a8, MOBILE_MONEY_PROVIDER as a9, combine as aA, combineObject as aB, type CatalogueResult as aC, type CatalogueSnapshot as aD, type OrderStatus as aE, type PaymentState as aF, type OrderChannel as aG, type LineType as aH, type OrderLineState as aI, type OrderLineStatus as aJ, type FulfillmentType as aK, type FulfillmentStatus as aL, type FulfillmentLink as aM, type OrderFulfillmentSummary as aN, type FeeBearerType as aO, type AmountToPay as aP, type LineItem as aQ, type Order as aR, type OrderHistory as aS, type OrderGroupPaymentState as aT, type OrderGroup as aU, type OrderGroupPayment as aV, type OrderSplitDetail as aW, type OrderGroupPaymentSummary as aX, type OrderGroupDetails as aY, type OrderPaymentEvent as aZ, type OrderFilter as a_, AUTHORIZATION_TYPE as aa, DEVICE_TYPE as ab, CONTACT_TYPE as ac, LINK_QUERY as ad, LINK_MUTATION as ae, AUTH_MUTATION as af, CHECKOUT_MUTATION as ag, PAYMENT_MUTATION as ah, ORDER_MUTATION as ai, DEFAULT_CURRENCY as aj, DEFAULT_COUNTRY as ak, type Result as al, type Ok as am, type Err as an, ok as ao, err as ap, isOk as aq, isErr as ar, mapResult as as, mapError as at, flatMap as au, getOrElse as av, unwrap as aw, toNullable as ax, fromPromise as ay, tryCatch as az, CatalogueQueries as b, type LocationStock as b$, type UpdateOrderStatusInput as b0, type CancelOrderInput as b1, type RefundOrderInput as b2, type ServiceStatus as b3, type StaffRole as b4, type ReminderMethod as b5, type CustomerServicePreferences as b6, type BufferTimes as b7, type ReminderSettings as b8, type CancellationPolicy as b9, type BusinessHours as bA, type CategoryInfo as bB, type Service as bC, type Staff as bD, type TimeSlot as bE, type AvailableSlot as bF, type DayAvailability as bG, type BookingStatus as bH, type Booking as bI, type BookingWithDetails as bJ, type CustomerBookingServiceItem as bK, type CustomerBooking as bL, type GetAvailableSlotsInput as bM, type CheckSlotAvailabilityInput as bN, type CheckSlotAvailabilityResult as bO, type RescheduleBookingInput as bP, type CancelBookingInput as bQ, type CancelBookingResult as bR, type RescheduleBookingResult as bS, type ServiceAvailabilityParams as bT, type ServiceAvailabilityResult as bU, type StockOwnershipType as bV, type StockStatus as bW, type Stock as bX, type StockLevel as bY, type ProductStock as bZ, type VariantStock as b_, type ServiceNotes as ba, type PricingOverrides as bb, type SchedulingMetadata as bc, type StaffAssignment as bd, type ResourceAssignment as be, type SchedulingResult as bf, type DepositResult as bg, type ServiceScheduleRequest as bh, type StaffScheduleItem as bi, type LocationAppointment as bj, type BusinessType as bk, type BusinessPreferences as bl, type Business as bm, type LocationTaxBehavior as bn, type LocationTaxOverrides as bo, type Location as bp, type TimeRange as bq, type TimeRanges as br, type LocationTimeProfile as bs, type Table as bt, type Room as bu, type ServiceCharge as bv, type StorefrontBootstrap as bw, type BusinessWithLocations as bx, type LocationWithDetails as by, type BusinessSettings as bz, createCimplifyClient as c, type AvailabilityCheck as c0, type AvailabilityResult as c1, type InventorySummary as c2, type Customer as c3, type CustomerAddress as c4, type CustomerMobileMoney as c5, type CustomerLinkPreferences as c6, type LinkData as c7, type CreateAddressInput as c8, type UpdateAddressInput as c9, type RetryEvent as cA, type SessionChangeEvent as cB, type ObservabilityHooks as cC, type OrderType as cD, type ElementAppearance as cE, type AddressInfo as cF, type PaymentMethodInfo as cG, type AuthenticatedCustomer as cH, type ElementsCustomerInfo as cI, type AuthenticatedData as cJ, type ElementsCheckoutData as cK, type ElementsCheckoutResult as cL, type ParentToIframeMessage as cM, type IframeToParentMessage as cN, type ElementEventHandler as cO, type CreateMobileMoneyInput as ca, type EnrollmentData as cb, type AddressData as cc, type MobileMoneyData as cd, type EnrollAndLinkOrderInput as ce, type LinkStatusResult as cf, type LinkEnrollResult as cg, type EnrollAndLinkOrderResult as ch, type LinkSession as ci, type RevokeSessionResult as cj, type RevokeAllSessionsResult as ck, type RequestOtpInput as cl, type VerifyOtpInput as cm, type AuthResponse as cn, type PickupTimeType as co, type PickupTime as cp, type CheckoutAddressInfo as cq, type MobileMoneyDetails as cr, type CheckoutCustomerInfo as cs, type FxQuoteRequest as ct, type FxQuote as cu, type FxRateResponse as cv, type RequestContext as cw, type RequestStartEvent as cx, type RequestSuccessEvent as cy, type RequestErrorEvent as cz, type QuoteBundleSelectionInput as d, type QuoteStatus as e, type QuoteDynamicBuckets as f, type QuoteUiMessage as g, type RefreshQuoteResult as h, CartOperations as i, CheckoutService as j, generateIdempotencyKey as k, type GetOrdersOptions as l, type AuthStatus as m, type OtpResult as n, SchedulingService as o, LiteService as p, FxService as q, type LiteBootstrap as r, CimplifyElements as s, CimplifyElement as t, createElements as u, ELEMENT_TYPES as v, type ElementsOptions as w, type ElementOptions as x, type ElementType as y, type ElementEventType as z };
|
|
@@ -1883,10 +1883,12 @@ declare class FxService {
|
|
|
1883
1883
|
lockQuote(request: FxQuoteRequest): Promise<Result<FxQuote, CimplifyError>>;
|
|
1884
1884
|
}
|
|
1885
1885
|
|
|
1886
|
+
type OrderType = "delivery" | "pickup" | "dine_in";
|
|
1886
1887
|
declare const ELEMENT_TYPES: {
|
|
1887
1888
|
readonly AUTH: "auth";
|
|
1888
1889
|
readonly ADDRESS: "address";
|
|
1889
1890
|
readonly PAYMENT: "payment";
|
|
1891
|
+
readonly CHECKOUT: "checkout";
|
|
1890
1892
|
};
|
|
1891
1893
|
type ElementType = (typeof ELEMENT_TYPES)[keyof typeof ELEMENT_TYPES];
|
|
1892
1894
|
declare const MESSAGE_TYPES: {
|
|
@@ -1910,6 +1912,7 @@ declare const MESSAGE_TYPES: {
|
|
|
1910
1912
|
readonly CONTACT_PROVIDED: "contact_provided";
|
|
1911
1913
|
readonly CHECKOUT_STATUS: "checkout_status";
|
|
1912
1914
|
readonly CHECKOUT_COMPLETE: "checkout_complete";
|
|
1915
|
+
readonly ORDER_TYPE_CHANGED: "order_type_changed";
|
|
1913
1916
|
};
|
|
1914
1917
|
interface ElementsOptions {
|
|
1915
1918
|
linkUrl?: string;
|
|
@@ -1928,6 +1931,8 @@ interface ElementOptions {
|
|
|
1928
1931
|
prefillEmail?: string;
|
|
1929
1932
|
amount?: number;
|
|
1930
1933
|
currency?: CurrencyCode;
|
|
1934
|
+
orderTypes?: OrderType[];
|
|
1935
|
+
defaultOrderType?: OrderType;
|
|
1931
1936
|
}
|
|
1932
1937
|
interface AddressInfo {
|
|
1933
1938
|
id?: string;
|
|
@@ -1991,6 +1996,8 @@ type ParentToIframeMessage = {
|
|
|
1991
1996
|
demoMode?: boolean;
|
|
1992
1997
|
prefillEmail?: string;
|
|
1993
1998
|
appearance?: ElementAppearance;
|
|
1999
|
+
orderTypes?: OrderType[];
|
|
2000
|
+
defaultOrderType?: OrderType;
|
|
1994
2001
|
} | {
|
|
1995
2002
|
type: typeof MESSAGE_TYPES.SET_TOKEN;
|
|
1996
2003
|
token: string;
|
|
@@ -2003,7 +2010,7 @@ type ParentToIframeMessage = {
|
|
|
2003
2010
|
} | {
|
|
2004
2011
|
type: typeof MESSAGE_TYPES.PROCESS_CHECKOUT;
|
|
2005
2012
|
cart_id: string;
|
|
2006
|
-
order_type
|
|
2013
|
+
order_type?: OrderType;
|
|
2007
2014
|
location_id?: string;
|
|
2008
2015
|
notes?: string;
|
|
2009
2016
|
scheduled_time?: string;
|
|
@@ -2011,7 +2018,7 @@ type ParentToIframeMessage = {
|
|
|
2011
2018
|
pay_currency?: CurrencyCode;
|
|
2012
2019
|
enroll_in_link?: boolean;
|
|
2013
2020
|
address?: AddressInfo;
|
|
2014
|
-
customer
|
|
2021
|
+
customer?: ElementsCustomerInfo;
|
|
2015
2022
|
account_id?: string;
|
|
2016
2023
|
customer_id?: string;
|
|
2017
2024
|
} | {
|
|
@@ -2076,6 +2083,9 @@ type IframeToParentMessage = {
|
|
|
2076
2083
|
recoverable: boolean;
|
|
2077
2084
|
};
|
|
2078
2085
|
enrolled_in_link?: boolean;
|
|
2086
|
+
} | {
|
|
2087
|
+
type: typeof MESSAGE_TYPES.ORDER_TYPE_CHANGED;
|
|
2088
|
+
orderType: OrderType;
|
|
2079
2089
|
};
|
|
2080
2090
|
declare const EVENT_TYPES: {
|
|
2081
2091
|
readonly READY: "ready";
|
|
@@ -2085,6 +2095,7 @@ declare const EVENT_TYPES: {
|
|
|
2085
2095
|
readonly CHANGE: "change";
|
|
2086
2096
|
readonly BLUR: "blur";
|
|
2087
2097
|
readonly FOCUS: "focus";
|
|
2098
|
+
readonly ORDER_TYPE_CHANGED: "order_type_changed";
|
|
2088
2099
|
};
|
|
2089
2100
|
type ElementEventType = (typeof EVENT_TYPES)[keyof typeof EVENT_TYPES];
|
|
2090
2101
|
type ElementEventHandler<T = unknown> = (data: T) => void;
|
|
@@ -2269,4 +2280,4 @@ declare class CimplifyClient {
|
|
|
2269
2280
|
}
|
|
2270
2281
|
declare function createCimplifyClient(config?: CimplifyConfig): CimplifyClient;
|
|
2271
2282
|
|
|
2272
|
-
export { type AbortablePromise as $, AuthService as A, BusinessService as B, CimplifyClient as C, type CheckoutMode as D, EVENT_TYPES as E, type FetchQuoteInput as F, type GetProductsOptions as G, type CheckoutOrderType as H, InventoryService as I, type CheckoutPaymentMethod as J, type CheckoutStep as K, LinkService as L, MESSAGE_TYPES as M, type CheckoutFormData as N, OrderQueries as O, type PriceQuote as P, type QuoteCompositeSelectionInput as Q, type RefreshQuoteInput as R, type SearchOptions as S, type TableInfo as T, type UpdateProfileInput as U, type CheckoutResult as V, type ProcessCheckoutOptions as W, type ProcessCheckoutResult as X, type ProcessAndResolveOptions as Y, type CheckoutStatus as Z, type CheckoutStatusContext as _, type CimplifyConfig as a, type CheckoutInput as a$, type MobileMoneyProvider as a0, type DeviceType as a1, type ContactType as a2, CHECKOUT_MODE as a3, ORDER_TYPE as a4, PAYMENT_METHOD as a5, CHECKOUT_STEP as a6, PAYMENT_STATE as a7, PICKUP_TIME_TYPE as a8, MOBILE_MONEY_PROVIDER as a9, combine as aA, combineObject as aB, type CatalogueResult as aC, type CatalogueSnapshot as aD, type OrderStatus as aE, type PaymentState as aF, type OrderChannel as aG, type LineType as aH, type OrderLineState as aI, type OrderLineStatus as aJ, type FulfillmentType as aK, type FulfillmentStatus as aL, type FulfillmentLink as aM, type OrderFulfillmentSummary as aN, type FeeBearerType as aO, type AmountToPay as aP, type LineItem as aQ, type Order as aR, type OrderHistory as aS, type OrderGroupPaymentState as aT, type OrderGroup as aU, type OrderGroupPayment as aV, type OrderSplitDetail as aW, type OrderGroupPaymentSummary as aX, type OrderGroupDetails as aY, type OrderPaymentEvent as aZ, type OrderFilter as a_, AUTHORIZATION_TYPE as aa, DEVICE_TYPE as ab, CONTACT_TYPE as ac, LINK_QUERY as ad, LINK_MUTATION as ae, AUTH_MUTATION as af, CHECKOUT_MUTATION as ag, PAYMENT_MUTATION as ah, ORDER_MUTATION as ai, DEFAULT_CURRENCY as aj, DEFAULT_COUNTRY as ak, type Result as al, type Ok as am, type Err as an, ok as ao, err as ap, isOk as aq, isErr as ar, mapResult as as, mapError as at, flatMap as au, getOrElse as av, unwrap as aw, toNullable as ax, fromPromise as ay, tryCatch as az, CatalogueQueries as b, type LocationStock as b$, type UpdateOrderStatusInput as b0, type CancelOrderInput as b1, type RefundOrderInput as b2, type ServiceStatus as b3, type StaffRole as b4, type ReminderMethod as b5, type CustomerServicePreferences as b6, type BufferTimes as b7, type ReminderSettings as b8, type CancellationPolicy as b9, type BusinessHours as bA, type CategoryInfo as bB, type Service as bC, type Staff as bD, type TimeSlot as bE, type AvailableSlot as bF, type DayAvailability as bG, type BookingStatus as bH, type Booking as bI, type BookingWithDetails as bJ, type CustomerBookingServiceItem as bK, type CustomerBooking as bL, type GetAvailableSlotsInput as bM, type CheckSlotAvailabilityInput as bN, type CheckSlotAvailabilityResult as bO, type RescheduleBookingInput as bP, type CancelBookingInput as bQ, type CancelBookingResult as bR, type RescheduleBookingResult as bS, type ServiceAvailabilityParams as bT, type ServiceAvailabilityResult as bU, type StockOwnershipType as bV, type StockStatus as bW, type Stock as bX, type StockLevel as bY, type ProductStock as bZ, type VariantStock as b_, type ServiceNotes as ba, type PricingOverrides as bb, type SchedulingMetadata as bc, type StaffAssignment as bd, type ResourceAssignment as be, type SchedulingResult as bf, type DepositResult as bg, type ServiceScheduleRequest as bh, type StaffScheduleItem as bi, type LocationAppointment as bj, type BusinessType as bk, type BusinessPreferences as bl, type Business as bm, type LocationTaxBehavior as bn, type LocationTaxOverrides as bo, type Location as bp, type TimeRange as bq, type TimeRanges as br, type LocationTimeProfile as bs, type Table as bt, type Room as bu, type ServiceCharge as bv, type StorefrontBootstrap as bw, type BusinessWithLocations as bx, type LocationWithDetails as by, type BusinessSettings as bz, createCimplifyClient as c, type AvailabilityCheck as c0, type AvailabilityResult as c1, type InventorySummary as c2, type Customer as c3, type CustomerAddress as c4, type CustomerMobileMoney as c5, type CustomerLinkPreferences as c6, type LinkData as c7, type CreateAddressInput as c8, type UpdateAddressInput as c9, type RetryEvent as cA, type SessionChangeEvent as cB, type ObservabilityHooks as cC, type
|
|
2283
|
+
export { type AbortablePromise as $, AuthService as A, BusinessService as B, CimplifyClient as C, type CheckoutMode as D, EVENT_TYPES as E, type FetchQuoteInput as F, type GetProductsOptions as G, type CheckoutOrderType as H, InventoryService as I, type CheckoutPaymentMethod as J, type CheckoutStep as K, LinkService as L, MESSAGE_TYPES as M, type CheckoutFormData as N, OrderQueries as O, type PriceQuote as P, type QuoteCompositeSelectionInput as Q, type RefreshQuoteInput as R, type SearchOptions as S, type TableInfo as T, type UpdateProfileInput as U, type CheckoutResult as V, type ProcessCheckoutOptions as W, type ProcessCheckoutResult as X, type ProcessAndResolveOptions as Y, type CheckoutStatus as Z, type CheckoutStatusContext as _, type CimplifyConfig as a, type CheckoutInput as a$, type MobileMoneyProvider as a0, type DeviceType as a1, type ContactType as a2, CHECKOUT_MODE as a3, ORDER_TYPE as a4, PAYMENT_METHOD as a5, CHECKOUT_STEP as a6, PAYMENT_STATE as a7, PICKUP_TIME_TYPE as a8, MOBILE_MONEY_PROVIDER as a9, combine as aA, combineObject as aB, type CatalogueResult as aC, type CatalogueSnapshot as aD, type OrderStatus as aE, type PaymentState as aF, type OrderChannel as aG, type LineType as aH, type OrderLineState as aI, type OrderLineStatus as aJ, type FulfillmentType as aK, type FulfillmentStatus as aL, type FulfillmentLink as aM, type OrderFulfillmentSummary as aN, type FeeBearerType as aO, type AmountToPay as aP, type LineItem as aQ, type Order as aR, type OrderHistory as aS, type OrderGroupPaymentState as aT, type OrderGroup as aU, type OrderGroupPayment as aV, type OrderSplitDetail as aW, type OrderGroupPaymentSummary as aX, type OrderGroupDetails as aY, type OrderPaymentEvent as aZ, type OrderFilter as a_, AUTHORIZATION_TYPE as aa, DEVICE_TYPE as ab, CONTACT_TYPE as ac, LINK_QUERY as ad, LINK_MUTATION as ae, AUTH_MUTATION as af, CHECKOUT_MUTATION as ag, PAYMENT_MUTATION as ah, ORDER_MUTATION as ai, DEFAULT_CURRENCY as aj, DEFAULT_COUNTRY as ak, type Result as al, type Ok as am, type Err as an, ok as ao, err as ap, isOk as aq, isErr as ar, mapResult as as, mapError as at, flatMap as au, getOrElse as av, unwrap as aw, toNullable as ax, fromPromise as ay, tryCatch as az, CatalogueQueries as b, type LocationStock as b$, type UpdateOrderStatusInput as b0, type CancelOrderInput as b1, type RefundOrderInput as b2, type ServiceStatus as b3, type StaffRole as b4, type ReminderMethod as b5, type CustomerServicePreferences as b6, type BufferTimes as b7, type ReminderSettings as b8, type CancellationPolicy as b9, type BusinessHours as bA, type CategoryInfo as bB, type Service as bC, type Staff as bD, type TimeSlot as bE, type AvailableSlot as bF, type DayAvailability as bG, type BookingStatus as bH, type Booking as bI, type BookingWithDetails as bJ, type CustomerBookingServiceItem as bK, type CustomerBooking as bL, type GetAvailableSlotsInput as bM, type CheckSlotAvailabilityInput as bN, type CheckSlotAvailabilityResult as bO, type RescheduleBookingInput as bP, type CancelBookingInput as bQ, type CancelBookingResult as bR, type RescheduleBookingResult as bS, type ServiceAvailabilityParams as bT, type ServiceAvailabilityResult as bU, type StockOwnershipType as bV, type StockStatus as bW, type Stock as bX, type StockLevel as bY, type ProductStock as bZ, type VariantStock as b_, type ServiceNotes as ba, type PricingOverrides as bb, type SchedulingMetadata as bc, type StaffAssignment as bd, type ResourceAssignment as be, type SchedulingResult as bf, type DepositResult as bg, type ServiceScheduleRequest as bh, type StaffScheduleItem as bi, type LocationAppointment as bj, type BusinessType as bk, type BusinessPreferences as bl, type Business as bm, type LocationTaxBehavior as bn, type LocationTaxOverrides as bo, type Location as bp, type TimeRange as bq, type TimeRanges as br, type LocationTimeProfile as bs, type Table as bt, type Room as bu, type ServiceCharge as bv, type StorefrontBootstrap as bw, type BusinessWithLocations as bx, type LocationWithDetails as by, type BusinessSettings as bz, createCimplifyClient as c, type AvailabilityCheck as c0, type AvailabilityResult as c1, type InventorySummary as c2, type Customer as c3, type CustomerAddress as c4, type CustomerMobileMoney as c5, type CustomerLinkPreferences as c6, type LinkData as c7, type CreateAddressInput as c8, type UpdateAddressInput as c9, type RetryEvent as cA, type SessionChangeEvent as cB, type ObservabilityHooks as cC, type OrderType as cD, type ElementAppearance as cE, type AddressInfo as cF, type PaymentMethodInfo as cG, type AuthenticatedCustomer as cH, type ElementsCustomerInfo as cI, type AuthenticatedData as cJ, type ElementsCheckoutData as cK, type ElementsCheckoutResult as cL, type ParentToIframeMessage as cM, type IframeToParentMessage as cN, type ElementEventHandler as cO, type CreateMobileMoneyInput as ca, type EnrollmentData as cb, type AddressData as cc, type MobileMoneyData as cd, type EnrollAndLinkOrderInput as ce, type LinkStatusResult as cf, type LinkEnrollResult as cg, type EnrollAndLinkOrderResult as ch, type LinkSession as ci, type RevokeSessionResult as cj, type RevokeAllSessionsResult as ck, type RequestOtpInput as cl, type VerifyOtpInput as cm, type AuthResponse as cn, type PickupTimeType as co, type PickupTime as cp, type CheckoutAddressInfo as cq, type MobileMoneyDetails as cr, type CheckoutCustomerInfo as cs, type FxQuoteRequest as ct, type FxQuote as cu, type FxRateResponse as cv, type RequestContext as cw, type RequestStartEvent as cx, type RequestSuccessEvent as cy, type RequestErrorEvent as cz, type QuoteBundleSelectionInput as d, type QuoteStatus as e, type QuoteDynamicBuckets as f, type QuoteUiMessage as g, type RefreshQuoteResult as h, CartOperations as i, CheckoutService as j, generateIdempotencyKey as k, type GetOrdersOptions as l, type AuthStatus as m, type OtpResult as n, SchedulingService as o, LiteService as p, FxService as q, type LiteBootstrap as r, CimplifyElements as s, CimplifyElement as t, createElements as u, ELEMENT_TYPES as v, type ElementsOptions as w, type ElementOptions as x, type ElementType as y, type ElementEventType as z };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { aa as AUTHORIZATION_TYPE, af as AUTH_MUTATION, $ as AbortablePromise, cc as AddressData,
|
|
1
|
+
export { aa as AUTHORIZATION_TYPE, af as AUTH_MUTATION, $ as AbortablePromise, cc as AddressData, cF as AddressInfo, aP as AmountToPay, cn as AuthResponse, A as AuthService, m as AuthStatus, cH as AuthenticatedCustomer, cJ as AuthenticatedData, c0 as AvailabilityCheck, c1 as AvailabilityResult, bF as AvailableSlot, bI as Booking, bH as BookingStatus, bJ as BookingWithDetails, b7 as BufferTimes, bm as Business, bA as BusinessHours, bl as BusinessPreferences, B as BusinessService, bz as BusinessSettings, bk as BusinessType, bx as BusinessWithLocations, a3 as CHECKOUT_MODE, ag as CHECKOUT_MUTATION, a6 as CHECKOUT_STEP, ac as CONTACT_TYPE, bQ as CancelBookingInput, bR as CancelBookingResult, b1 as CancelOrderInput, b9 as CancellationPolicy, i as CartOperations, b as CatalogueQueries, aC as CatalogueResult, aD as CatalogueSnapshot, bB as CategoryInfo, bN as CheckSlotAvailabilityInput, bO as CheckSlotAvailabilityResult, cq as CheckoutAddressInfo, cs as CheckoutCustomerInfo, N as CheckoutFormData, a$ as CheckoutInput, D as CheckoutMode, j as CheckoutOperations, H as CheckoutOrderType, J as CheckoutPaymentMethod, V as CheckoutResult, j as CheckoutService, Z as CheckoutStatus, _ as CheckoutStatusContext, K as CheckoutStep, C as CimplifyClient, a as CimplifyConfig, t as CimplifyElement, s as CimplifyElements, a2 as ContactType, c8 as CreateAddressInput, ca as CreateMobileMoneyInput, c3 as Customer, c4 as CustomerAddress, bL as CustomerBooking, bK as CustomerBookingServiceItem, c6 as CustomerLinkPreferences, c5 as CustomerMobileMoney, b6 as CustomerServicePreferences, ak as DEFAULT_COUNTRY, aj as DEFAULT_CURRENCY, ab as DEVICE_TYPE, bG as DayAvailability, bg as DepositResult, a1 as DeviceType, v as ELEMENT_TYPES, E as EVENT_TYPES, cE as ElementAppearance, cO as ElementEventHandler, z as ElementEventType, x as ElementOptions, y as ElementType, cK as ElementsCheckoutData, cL as ElementsCheckoutResult, cI as ElementsCustomerInfo, w as ElementsOptions, ce as EnrollAndLinkOrderInput, ch as EnrollAndLinkOrderResult, cb as EnrollmentData, an as Err, aO as FeeBearerType, F as FetchQuoteInput, aM as FulfillmentLink, aL as FulfillmentStatus, aK as FulfillmentType, cu as FxQuote, ct as FxQuoteRequest, cv as FxRateResponse, q as FxService, bM as GetAvailableSlotsInput, l as GetOrdersOptions, G as GetProductsOptions, cN as IframeToParentMessage, I as InventoryService, c2 as InventorySummary, ae as LINK_MUTATION, ad as LINK_QUERY, aQ as LineItem, aH as LineType, c7 as LinkData, cg as LinkEnrollResult, L as LinkService, ci as LinkSession, cf as LinkStatusResult, r as LiteBootstrap, p as LiteService, bp as Location, bj as LocationAppointment, b$ as LocationStock, bn as LocationTaxBehavior, bo as LocationTaxOverrides, bs as LocationTimeProfile, by as LocationWithDetails, M as MESSAGE_TYPES, a9 as MOBILE_MONEY_PROVIDER, cd as MobileMoneyData, cr as MobileMoneyDetails, a0 as MobileMoneyProvider, ai as ORDER_MUTATION, a4 as ORDER_TYPE, cC as ObservabilityHooks, am as Ok, aR as Order, aG as OrderChannel, a_ as OrderFilter, aN as OrderFulfillmentSummary, aU as OrderGroup, aY as OrderGroupDetails, aV as OrderGroupPayment, aT as OrderGroupPaymentState, aX as OrderGroupPaymentSummary, aS as OrderHistory, aI as OrderLineState, aJ as OrderLineStatus, aZ as OrderPaymentEvent, O as OrderQueries, aW as OrderSplitDetail, aE as OrderStatus, cD as OrderType, n as OtpResult, a5 as PAYMENT_METHOD, ah as PAYMENT_MUTATION, a7 as PAYMENT_STATE, a8 as PICKUP_TIME_TYPE, cM as ParentToIframeMessage, cG as PaymentMethodInfo, aF as PaymentState, cp as PickupTime, co as PickupTimeType, P as PriceQuote, bb as PricingOverrides, Y as ProcessAndResolveOptions, W as ProcessCheckoutOptions, X as ProcessCheckoutResult, bZ as ProductStock, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, h as RefreshQuoteResult, b2 as RefundOrderInput, b5 as ReminderMethod, b8 as ReminderSettings, cw as RequestContext, cz as RequestErrorEvent, cl as RequestOtpInput, cx as RequestStartEvent, cy as RequestSuccessEvent, bP as RescheduleBookingInput, bS as RescheduleBookingResult, be as ResourceAssignment, al as Result, cA as RetryEvent, ck as RevokeAllSessionsResult, cj as RevokeSessionResult, bu as Room, bc as SchedulingMetadata, bf as SchedulingResult, o as SchedulingService, S as SearchOptions, bC as Service, bT as ServiceAvailabilityParams, bU as ServiceAvailabilityResult, bv as ServiceCharge, ba as ServiceNotes, bh as ServiceScheduleRequest, b3 as ServiceStatus, cB as SessionChangeEvent, bD as Staff, bd as StaffAssignment, b4 as StaffRole, bi as StaffScheduleItem, bX as Stock, bY as StockLevel, bV as StockOwnershipType, bW as StockStatus, bw as StorefrontBootstrap, bt as Table, T as TableInfo, bq as TimeRange, br as TimeRanges, bE as TimeSlot, c9 as UpdateAddressInput, b0 as UpdateOrderStatusInput, U as UpdateProfileInput, b_ as VariantStock, cm as VerifyOtpInput, aA as combine, aB as combineObject, c as createCimplifyClient, u as createElements, ap as err, au as flatMap, ay as fromPromise, k as generateIdempotencyKey, av as getOrElse, ar as isErr, aq as isOk, at as mapError, as as mapResult, ao as ok, ax as toNullable, az as tryCatch, aw as unwrap } from './client-I-utsHva.mjs';
|
|
2
2
|
export { QueryBuilder, query } from './advanced.mjs';
|
|
3
3
|
import { A as ApiError } from './payment-CLIWNMaP.mjs';
|
|
4
4
|
export { B as AddOn, at as AddOnDetails, aP as AddOnGroupDetails, G as AddOnOption, aO as AddOnOptionDetails, H as AddOnOptionPrice, F as AddOnWithOptions, aU as AddToCartInput, ai as AdjustmentType, ap as AppliedDiscount, a_ as AuthorizationType, ao as BenefitType, T as Bundle, Y as BundleComponentData, _ as BundleComponentInfo, R as BundlePriceType, W as BundleProduct, ay as BundleSelectionData, aw as BundleSelectionInput, ax as BundleStoredSelection, U as BundleSummary, X as BundleWithDetails, aD as Cart, au as CartAddOn, ag as CartChannel, aE as CartItem, aR as CartItemDetails, af as CartStatus, aW as CartSummary, aF as CartTotals, K as Category, L as CategorySummary, an as ChosenPrice, h as CimplifyError, N as Collection, Q as CollectionProduct, O as CollectionSummary, a4 as ComponentGroup, a5 as ComponentGroupWithComponents, a9 as ComponentPriceBreakdown, a7 as ComponentSelectionInput, a1 as ComponentSourceType, a2 as Composite, a6 as CompositeComponent, aA as CompositePriceBreakdown, a8 as CompositePriceResult, $ as CompositePricingMode, aB as CompositeSelectionData, a7 as CompositeSelectionInput, az as CompositeStoredSelection, a3 as CompositeWithDetails, b as Currency, C as CurrencyCode, p as DepositType, D as DigitalProductType, aq as DiscountBreakdown, ar as DiscountDetails, aI as DisplayAddOn, aJ as DisplayAddOnOption, aG as DisplayCart, aH as DisplayCartItem, g as ERROR_HINTS, E as ErrorCode, e as ErrorCodeType, f as ErrorHint, a0 as GroupPricingBehavior, b2 as InitializePaymentResult, I as InventoryType, aC as LineConfiguration, ac as LocationProductPrice, M as Money, d as Pagination, P as PaginationParams, b1 as Payment, b5 as PaymentErrorDetails, b0 as PaymentMethod, aZ as PaymentMethodType, a$ as PaymentProcessingState, aY as PaymentProvider, b3 as PaymentResponse, aX as PaymentStatus, b4 as PaymentStatusResponse, ab as Price, aj as PriceAdjustment, am as PriceDecisionPath, aa as PriceEntryType, al as PricePathTaxInfo, ah as PriceSource, q as Product, J as ProductAddOn, ad as ProductAvailability, o as ProductRenderHint, ae as ProductTimeProfile, n as ProductType, s as ProductVariant, x as ProductVariantValue, r as ProductWithDetails, S as SalesChannel, as as SelectedAddOnOption, b6 as SubmitAuthorizationInput, ak as TaxPathComponent, aS as UICart, aK as UICartBusiness, aM as UICartCustomer, aL as UICartLocation, aN as UICartPricing, aT as UICartResponse, aV as UpdateCartItemInput, u as VariantAxis, z as VariantAxisSelection, w as VariantAxisValue, v as VariantAxisWithValues, av as VariantDetails, aQ as VariantDetailsDTO, t as VariantDisplayAttribute, y as VariantLocationAvailability, V as VariantStrategy, 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-CLIWNMaP.mjs';
|