@cimplify/sdk 0.7.14 → 0.8.1
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 +53 -35
- package/dist/advanced.mjs +53 -35
- package/dist/{client-Dkinq9Oz.d.ts → client-BJFeYCB2.d.ts} +19 -3
- package/dist/{client-CVqmSTNq.d.mts → client-bq-xxzM7.d.mts} +19 -3
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +53 -35
- package/dist/index.mjs +53 -35
- package/dist/react.d.mts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +75 -129
- package/dist/react.mjs +75 -129
- 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-bq-xxzM7.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-BJFeYCB2.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,9 @@ 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",
|
|
2166
|
+
REQUEST_SUBMIT: "request_submit"
|
|
2164
2167
|
};
|
|
2165
2168
|
var EVENT_TYPES = {
|
|
2166
2169
|
READY: "ready",
|
|
@@ -2169,7 +2172,9 @@ var EVENT_TYPES = {
|
|
|
2169
2172
|
ERROR: "error",
|
|
2170
2173
|
CHANGE: "change",
|
|
2171
2174
|
BLUR: "blur",
|
|
2172
|
-
FOCUS: "focus"
|
|
2175
|
+
FOCUS: "focus",
|
|
2176
|
+
ORDER_TYPE_CHANGED: "order_type_changed",
|
|
2177
|
+
REQUEST_SUBMIT: "request_submit"
|
|
2173
2178
|
};
|
|
2174
2179
|
|
|
2175
2180
|
// src/elements.ts
|
|
@@ -2318,40 +2323,43 @@ var CimplifyElements = class {
|
|
|
2318
2323
|
false
|
|
2319
2324
|
);
|
|
2320
2325
|
}
|
|
2321
|
-
const
|
|
2322
|
-
if (!
|
|
2323
|
-
console.debug("[cimplify:checkout] BLOCKED: no
|
|
2326
|
+
const checkoutElement = this.elements.get(ELEMENT_TYPES.CHECKOUT) || this.elements.get(ELEMENT_TYPES.PAYMENT);
|
|
2327
|
+
if (!checkoutElement) {
|
|
2328
|
+
console.debug("[cimplify:checkout] BLOCKED: no checkout element");
|
|
2324
2329
|
return toCheckoutError(
|
|
2325
2330
|
"NO_PAYMENT_ELEMENT",
|
|
2326
|
-
"
|
|
2331
|
+
"Checkout element must be mounted before checkout.",
|
|
2327
2332
|
false
|
|
2328
2333
|
);
|
|
2329
2334
|
}
|
|
2330
|
-
if (!
|
|
2331
|
-
console.debug("[cimplify:checkout] BLOCKED:
|
|
2335
|
+
if (!checkoutElement.isMounted()) {
|
|
2336
|
+
console.debug("[cimplify:checkout] BLOCKED: checkout element not mounted");
|
|
2332
2337
|
return toCheckoutError(
|
|
2333
2338
|
"PAYMENT_NOT_MOUNTED",
|
|
2334
|
-
"
|
|
2339
|
+
"Checkout element must be mounted before checkout.",
|
|
2335
2340
|
false
|
|
2336
2341
|
);
|
|
2337
2342
|
}
|
|
2338
|
-
const
|
|
2339
|
-
if (
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
"
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2343
|
+
const isUnifiedCheckout = this.elements.has(ELEMENT_TYPES.CHECKOUT);
|
|
2344
|
+
if (!isUnifiedCheckout) {
|
|
2345
|
+
const authElement = this.elements.get(ELEMENT_TYPES.AUTH);
|
|
2346
|
+
if (authElement && !this.accessToken) {
|
|
2347
|
+
console.debug("[cimplify:checkout] BLOCKED: auth incomplete");
|
|
2348
|
+
return toCheckoutError(
|
|
2349
|
+
"AUTH_INCOMPLETE",
|
|
2350
|
+
"Authentication must complete before checkout can start.",
|
|
2351
|
+
true
|
|
2352
|
+
);
|
|
2353
|
+
}
|
|
2354
|
+
const addressElement = this.elements.get(ELEMENT_TYPES.ADDRESS);
|
|
2355
|
+
if (addressElement) {
|
|
2356
|
+
console.debug("[cimplify:checkout] getting address data...");
|
|
2357
|
+
await addressElement.getData();
|
|
2358
|
+
console.debug("[cimplify:checkout] address data resolved", this.addressData);
|
|
2359
|
+
}
|
|
2360
|
+
await this.hydrateCustomerData();
|
|
2352
2361
|
}
|
|
2353
|
-
|
|
2354
|
-
console.debug("[cimplify:checkout] customer data hydrated", { customerData: this.customerData, accountId: this.accountId });
|
|
2362
|
+
console.debug("[cimplify:checkout] customer data hydrated", { customerData: this.customerData, accountId: this.accountId, isUnifiedCheckout });
|
|
2355
2363
|
const processMessage = {
|
|
2356
2364
|
type: MESSAGE_TYPES.PROCESS_CHECKOUT,
|
|
2357
2365
|
cart_id: options.cart_id,
|
|
@@ -2362,8 +2370,9 @@ var CimplifyElements = class {
|
|
|
2362
2370
|
tip_amount: options.tip_amount,
|
|
2363
2371
|
pay_currency: options.pay_currency,
|
|
2364
2372
|
enroll_in_link: options.enroll_in_link ?? true,
|
|
2365
|
-
address
|
|
2366
|
-
|
|
2373
|
+
// Unified checkout has its own address/customer state; only pass if available externally
|
|
2374
|
+
address: isUnifiedCheckout ? void 0 : this.addressData ?? void 0,
|
|
2375
|
+
customer: isUnifiedCheckout ? void 0 : this.customerData ? {
|
|
2367
2376
|
name: this.customerData.name,
|
|
2368
2377
|
email: this.customerData.email,
|
|
2369
2378
|
phone: this.customerData.phone
|
|
@@ -2372,7 +2381,7 @@ var CimplifyElements = class {
|
|
|
2372
2381
|
customer_id: this.customerId ?? void 0
|
|
2373
2382
|
};
|
|
2374
2383
|
const timeoutMs = options.timeout_ms ?? 18e4;
|
|
2375
|
-
const paymentWindow =
|
|
2384
|
+
const paymentWindow = checkoutElement.getContentWindow();
|
|
2376
2385
|
this.checkoutInProgress = true;
|
|
2377
2386
|
return new Promise((resolve) => {
|
|
2378
2387
|
let settled = false;
|
|
@@ -2410,7 +2419,7 @@ var CimplifyElements = class {
|
|
|
2410
2419
|
return;
|
|
2411
2420
|
}
|
|
2412
2421
|
if (message.type === MESSAGE_TYPES.LOGOUT_COMPLETE) {
|
|
2413
|
-
|
|
2422
|
+
checkoutElement.sendMessage({ type: MESSAGE_TYPES.ABORT_CHECKOUT });
|
|
2414
2423
|
settle(
|
|
2415
2424
|
toCheckoutError(
|
|
2416
2425
|
"AUTH_LOST",
|
|
@@ -2441,7 +2450,7 @@ var CimplifyElements = class {
|
|
|
2441
2450
|
window.addEventListener("message", handleCheckoutMessage);
|
|
2442
2451
|
}
|
|
2443
2452
|
abortFn = () => {
|
|
2444
|
-
|
|
2453
|
+
checkoutElement.sendMessage({ type: MESSAGE_TYPES.ABORT_CHECKOUT });
|
|
2445
2454
|
settle(
|
|
2446
2455
|
toCheckoutError(
|
|
2447
2456
|
"CANCELLED",
|
|
@@ -2451,8 +2460,8 @@ var CimplifyElements = class {
|
|
|
2451
2460
|
);
|
|
2452
2461
|
};
|
|
2453
2462
|
this.activeCheckoutAbort = abortFn;
|
|
2454
|
-
console.debug("[cimplify:checkout] sending process_checkout to
|
|
2455
|
-
|
|
2463
|
+
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 });
|
|
2464
|
+
checkoutElement.sendMessage(processMessage);
|
|
2456
2465
|
console.debug("[cimplify:checkout] postMessage sent, waiting for checkout_complete...");
|
|
2457
2466
|
});
|
|
2458
2467
|
})();
|
|
@@ -2531,7 +2540,7 @@ var CimplifyElements = class {
|
|
|
2531
2540
|
this.customerData = customer;
|
|
2532
2541
|
this.client.setAccessToken(message.token);
|
|
2533
2542
|
this.elements.forEach((element, type) => {
|
|
2534
|
-
if (type !== ELEMENT_TYPES.AUTH) {
|
|
2543
|
+
if (type !== ELEMENT_TYPES.AUTH && type !== ELEMENT_TYPES.CHECKOUT) {
|
|
2535
2544
|
element.sendMessage({ type: MESSAGE_TYPES.SET_TOKEN, token: message.token });
|
|
2536
2545
|
}
|
|
2537
2546
|
});
|
|
@@ -2721,7 +2730,10 @@ var CimplifyElement = class {
|
|
|
2721
2730
|
publicKey,
|
|
2722
2731
|
demoMode: publicKey.length === 0,
|
|
2723
2732
|
prefillEmail: this.options.prefillEmail,
|
|
2724
|
-
appearance: this.parent.getAppearance()
|
|
2733
|
+
appearance: this.parent.getAppearance(),
|
|
2734
|
+
orderTypes: this.options.orderTypes,
|
|
2735
|
+
defaultOrderType: this.options.defaultOrderType,
|
|
2736
|
+
renderSubmitButton: true
|
|
2725
2737
|
});
|
|
2726
2738
|
const token = this.parent.getAccessToken();
|
|
2727
2739
|
if (token && this.type !== ELEMENT_TYPES.AUTH) {
|
|
@@ -2785,6 +2797,12 @@ var CimplifyElement = class {
|
|
|
2785
2797
|
case MESSAGE_TYPES.CONTACT_PROVIDED:
|
|
2786
2798
|
this.parent._setGuestContact(message.contact, message.contactType);
|
|
2787
2799
|
break;
|
|
2800
|
+
case MESSAGE_TYPES.ORDER_TYPE_CHANGED:
|
|
2801
|
+
this.emit(EVENT_TYPES.ORDER_TYPE_CHANGED, { orderType: message.orderType });
|
|
2802
|
+
break;
|
|
2803
|
+
case MESSAGE_TYPES.REQUEST_SUBMIT:
|
|
2804
|
+
this.emit(EVENT_TYPES.REQUEST_SUBMIT, {});
|
|
2805
|
+
break;
|
|
2788
2806
|
}
|
|
2789
2807
|
}
|
|
2790
2808
|
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,9 @@ 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",
|
|
2164
|
+
REQUEST_SUBMIT: "request_submit"
|
|
2162
2165
|
};
|
|
2163
2166
|
var EVENT_TYPES = {
|
|
2164
2167
|
READY: "ready",
|
|
@@ -2167,7 +2170,9 @@ var EVENT_TYPES = {
|
|
|
2167
2170
|
ERROR: "error",
|
|
2168
2171
|
CHANGE: "change",
|
|
2169
2172
|
BLUR: "blur",
|
|
2170
|
-
FOCUS: "focus"
|
|
2173
|
+
FOCUS: "focus",
|
|
2174
|
+
ORDER_TYPE_CHANGED: "order_type_changed",
|
|
2175
|
+
REQUEST_SUBMIT: "request_submit"
|
|
2171
2176
|
};
|
|
2172
2177
|
|
|
2173
2178
|
// src/elements.ts
|
|
@@ -2316,40 +2321,43 @@ var CimplifyElements = class {
|
|
|
2316
2321
|
false
|
|
2317
2322
|
);
|
|
2318
2323
|
}
|
|
2319
|
-
const
|
|
2320
|
-
if (!
|
|
2321
|
-
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");
|
|
2322
2327
|
return toCheckoutError(
|
|
2323
2328
|
"NO_PAYMENT_ELEMENT",
|
|
2324
|
-
"
|
|
2329
|
+
"Checkout element must be mounted before checkout.",
|
|
2325
2330
|
false
|
|
2326
2331
|
);
|
|
2327
2332
|
}
|
|
2328
|
-
if (!
|
|
2329
|
-
console.debug("[cimplify:checkout] BLOCKED:
|
|
2333
|
+
if (!checkoutElement.isMounted()) {
|
|
2334
|
+
console.debug("[cimplify:checkout] BLOCKED: checkout element not mounted");
|
|
2330
2335
|
return toCheckoutError(
|
|
2331
2336
|
"PAYMENT_NOT_MOUNTED",
|
|
2332
|
-
"
|
|
2337
|
+
"Checkout element must be mounted before checkout.",
|
|
2333
2338
|
false
|
|
2334
2339
|
);
|
|
2335
2340
|
}
|
|
2336
|
-
const
|
|
2337
|
-
if (
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
"
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
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();
|
|
2350
2359
|
}
|
|
2351
|
-
|
|
2352
|
-
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 });
|
|
2353
2361
|
const processMessage = {
|
|
2354
2362
|
type: MESSAGE_TYPES.PROCESS_CHECKOUT,
|
|
2355
2363
|
cart_id: options.cart_id,
|
|
@@ -2360,8 +2368,9 @@ var CimplifyElements = class {
|
|
|
2360
2368
|
tip_amount: options.tip_amount,
|
|
2361
2369
|
pay_currency: options.pay_currency,
|
|
2362
2370
|
enroll_in_link: options.enroll_in_link ?? true,
|
|
2363
|
-
address
|
|
2364
|
-
|
|
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 ? {
|
|
2365
2374
|
name: this.customerData.name,
|
|
2366
2375
|
email: this.customerData.email,
|
|
2367
2376
|
phone: this.customerData.phone
|
|
@@ -2370,7 +2379,7 @@ var CimplifyElements = class {
|
|
|
2370
2379
|
customer_id: this.customerId ?? void 0
|
|
2371
2380
|
};
|
|
2372
2381
|
const timeoutMs = options.timeout_ms ?? 18e4;
|
|
2373
|
-
const paymentWindow =
|
|
2382
|
+
const paymentWindow = checkoutElement.getContentWindow();
|
|
2374
2383
|
this.checkoutInProgress = true;
|
|
2375
2384
|
return new Promise((resolve) => {
|
|
2376
2385
|
let settled = false;
|
|
@@ -2408,7 +2417,7 @@ var CimplifyElements = class {
|
|
|
2408
2417
|
return;
|
|
2409
2418
|
}
|
|
2410
2419
|
if (message.type === MESSAGE_TYPES.LOGOUT_COMPLETE) {
|
|
2411
|
-
|
|
2420
|
+
checkoutElement.sendMessage({ type: MESSAGE_TYPES.ABORT_CHECKOUT });
|
|
2412
2421
|
settle(
|
|
2413
2422
|
toCheckoutError(
|
|
2414
2423
|
"AUTH_LOST",
|
|
@@ -2439,7 +2448,7 @@ var CimplifyElements = class {
|
|
|
2439
2448
|
window.addEventListener("message", handleCheckoutMessage);
|
|
2440
2449
|
}
|
|
2441
2450
|
abortFn = () => {
|
|
2442
|
-
|
|
2451
|
+
checkoutElement.sendMessage({ type: MESSAGE_TYPES.ABORT_CHECKOUT });
|
|
2443
2452
|
settle(
|
|
2444
2453
|
toCheckoutError(
|
|
2445
2454
|
"CANCELLED",
|
|
@@ -2449,8 +2458,8 @@ var CimplifyElements = class {
|
|
|
2449
2458
|
);
|
|
2450
2459
|
};
|
|
2451
2460
|
this.activeCheckoutAbort = abortFn;
|
|
2452
|
-
console.debug("[cimplify:checkout] sending process_checkout to
|
|
2453
|
-
|
|
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);
|
|
2454
2463
|
console.debug("[cimplify:checkout] postMessage sent, waiting for checkout_complete...");
|
|
2455
2464
|
});
|
|
2456
2465
|
})();
|
|
@@ -2529,7 +2538,7 @@ var CimplifyElements = class {
|
|
|
2529
2538
|
this.customerData = customer;
|
|
2530
2539
|
this.client.setAccessToken(message.token);
|
|
2531
2540
|
this.elements.forEach((element, type) => {
|
|
2532
|
-
if (type !== ELEMENT_TYPES.AUTH) {
|
|
2541
|
+
if (type !== ELEMENT_TYPES.AUTH && type !== ELEMENT_TYPES.CHECKOUT) {
|
|
2533
2542
|
element.sendMessage({ type: MESSAGE_TYPES.SET_TOKEN, token: message.token });
|
|
2534
2543
|
}
|
|
2535
2544
|
});
|
|
@@ -2719,7 +2728,10 @@ var CimplifyElement = class {
|
|
|
2719
2728
|
publicKey,
|
|
2720
2729
|
demoMode: publicKey.length === 0,
|
|
2721
2730
|
prefillEmail: this.options.prefillEmail,
|
|
2722
|
-
appearance: this.parent.getAppearance()
|
|
2731
|
+
appearance: this.parent.getAppearance(),
|
|
2732
|
+
orderTypes: this.options.orderTypes,
|
|
2733
|
+
defaultOrderType: this.options.defaultOrderType,
|
|
2734
|
+
renderSubmitButton: true
|
|
2723
2735
|
});
|
|
2724
2736
|
const token = this.parent.getAccessToken();
|
|
2725
2737
|
if (token && this.type !== ELEMENT_TYPES.AUTH) {
|
|
@@ -2783,6 +2795,12 @@ var CimplifyElement = class {
|
|
|
2783
2795
|
case MESSAGE_TYPES.CONTACT_PROVIDED:
|
|
2784
2796
|
this.parent._setGuestContact(message.contact, message.contactType);
|
|
2785
2797
|
break;
|
|
2798
|
+
case MESSAGE_TYPES.ORDER_TYPE_CHANGED:
|
|
2799
|
+
this.emit(EVENT_TYPES.ORDER_TYPE_CHANGED, { orderType: message.orderType });
|
|
2800
|
+
break;
|
|
2801
|
+
case MESSAGE_TYPES.REQUEST_SUBMIT:
|
|
2802
|
+
this.emit(EVENT_TYPES.REQUEST_SUBMIT, {});
|
|
2803
|
+
break;
|
|
2786
2804
|
}
|
|
2787
2805
|
}
|
|
2788
2806
|
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,8 @@ 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";
|
|
1916
|
+
readonly REQUEST_SUBMIT: "request_submit";
|
|
1913
1917
|
};
|
|
1914
1918
|
interface ElementsOptions {
|
|
1915
1919
|
linkUrl?: string;
|
|
@@ -1928,6 +1932,8 @@ interface ElementOptions {
|
|
|
1928
1932
|
prefillEmail?: string;
|
|
1929
1933
|
amount?: number;
|
|
1930
1934
|
currency?: CurrencyCode;
|
|
1935
|
+
orderTypes?: OrderType[];
|
|
1936
|
+
defaultOrderType?: OrderType;
|
|
1931
1937
|
}
|
|
1932
1938
|
interface AddressInfo {
|
|
1933
1939
|
id?: string;
|
|
@@ -1991,6 +1997,9 @@ type ParentToIframeMessage = {
|
|
|
1991
1997
|
demoMode?: boolean;
|
|
1992
1998
|
prefillEmail?: string;
|
|
1993
1999
|
appearance?: ElementAppearance;
|
|
2000
|
+
orderTypes?: OrderType[];
|
|
2001
|
+
defaultOrderType?: OrderType;
|
|
2002
|
+
renderSubmitButton?: boolean;
|
|
1994
2003
|
} | {
|
|
1995
2004
|
type: typeof MESSAGE_TYPES.SET_TOKEN;
|
|
1996
2005
|
token: string;
|
|
@@ -2003,7 +2012,7 @@ type ParentToIframeMessage = {
|
|
|
2003
2012
|
} | {
|
|
2004
2013
|
type: typeof MESSAGE_TYPES.PROCESS_CHECKOUT;
|
|
2005
2014
|
cart_id: string;
|
|
2006
|
-
order_type
|
|
2015
|
+
order_type?: OrderType;
|
|
2007
2016
|
location_id?: string;
|
|
2008
2017
|
notes?: string;
|
|
2009
2018
|
scheduled_time?: string;
|
|
@@ -2011,7 +2020,7 @@ type ParentToIframeMessage = {
|
|
|
2011
2020
|
pay_currency?: CurrencyCode;
|
|
2012
2021
|
enroll_in_link?: boolean;
|
|
2013
2022
|
address?: AddressInfo;
|
|
2014
|
-
customer
|
|
2023
|
+
customer?: ElementsCustomerInfo;
|
|
2015
2024
|
account_id?: string;
|
|
2016
2025
|
customer_id?: string;
|
|
2017
2026
|
} | {
|
|
@@ -2076,6 +2085,11 @@ type IframeToParentMessage = {
|
|
|
2076
2085
|
recoverable: boolean;
|
|
2077
2086
|
};
|
|
2078
2087
|
enrolled_in_link?: boolean;
|
|
2088
|
+
} | {
|
|
2089
|
+
type: typeof MESSAGE_TYPES.ORDER_TYPE_CHANGED;
|
|
2090
|
+
orderType: OrderType;
|
|
2091
|
+
} | {
|
|
2092
|
+
type: typeof MESSAGE_TYPES.REQUEST_SUBMIT;
|
|
2079
2093
|
};
|
|
2080
2094
|
declare const EVENT_TYPES: {
|
|
2081
2095
|
readonly READY: "ready";
|
|
@@ -2085,6 +2099,8 @@ declare const EVENT_TYPES: {
|
|
|
2085
2099
|
readonly CHANGE: "change";
|
|
2086
2100
|
readonly BLUR: "blur";
|
|
2087
2101
|
readonly FOCUS: "focus";
|
|
2102
|
+
readonly ORDER_TYPE_CHANGED: "order_type_changed";
|
|
2103
|
+
readonly REQUEST_SUBMIT: "request_submit";
|
|
2088
2104
|
};
|
|
2089
2105
|
type ElementEventType = (typeof EVENT_TYPES)[keyof typeof EVENT_TYPES];
|
|
2090
2106
|
type ElementEventHandler<T = unknown> = (data: T) => void;
|
|
@@ -2269,4 +2285,4 @@ declare class CimplifyClient {
|
|
|
2269
2285
|
}
|
|
2270
2286
|
declare function createCimplifyClient(config?: CimplifyConfig): CimplifyClient;
|
|
2271
2287
|
|
|
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
|
|
2288
|
+
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,8 @@ 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";
|
|
1916
|
+
readonly REQUEST_SUBMIT: "request_submit";
|
|
1913
1917
|
};
|
|
1914
1918
|
interface ElementsOptions {
|
|
1915
1919
|
linkUrl?: string;
|
|
@@ -1928,6 +1932,8 @@ interface ElementOptions {
|
|
|
1928
1932
|
prefillEmail?: string;
|
|
1929
1933
|
amount?: number;
|
|
1930
1934
|
currency?: CurrencyCode;
|
|
1935
|
+
orderTypes?: OrderType[];
|
|
1936
|
+
defaultOrderType?: OrderType;
|
|
1931
1937
|
}
|
|
1932
1938
|
interface AddressInfo {
|
|
1933
1939
|
id?: string;
|
|
@@ -1991,6 +1997,9 @@ type ParentToIframeMessage = {
|
|
|
1991
1997
|
demoMode?: boolean;
|
|
1992
1998
|
prefillEmail?: string;
|
|
1993
1999
|
appearance?: ElementAppearance;
|
|
2000
|
+
orderTypes?: OrderType[];
|
|
2001
|
+
defaultOrderType?: OrderType;
|
|
2002
|
+
renderSubmitButton?: boolean;
|
|
1994
2003
|
} | {
|
|
1995
2004
|
type: typeof MESSAGE_TYPES.SET_TOKEN;
|
|
1996
2005
|
token: string;
|
|
@@ -2003,7 +2012,7 @@ type ParentToIframeMessage = {
|
|
|
2003
2012
|
} | {
|
|
2004
2013
|
type: typeof MESSAGE_TYPES.PROCESS_CHECKOUT;
|
|
2005
2014
|
cart_id: string;
|
|
2006
|
-
order_type
|
|
2015
|
+
order_type?: OrderType;
|
|
2007
2016
|
location_id?: string;
|
|
2008
2017
|
notes?: string;
|
|
2009
2018
|
scheduled_time?: string;
|
|
@@ -2011,7 +2020,7 @@ type ParentToIframeMessage = {
|
|
|
2011
2020
|
pay_currency?: CurrencyCode;
|
|
2012
2021
|
enroll_in_link?: boolean;
|
|
2013
2022
|
address?: AddressInfo;
|
|
2014
|
-
customer
|
|
2023
|
+
customer?: ElementsCustomerInfo;
|
|
2015
2024
|
account_id?: string;
|
|
2016
2025
|
customer_id?: string;
|
|
2017
2026
|
} | {
|
|
@@ -2076,6 +2085,11 @@ type IframeToParentMessage = {
|
|
|
2076
2085
|
recoverable: boolean;
|
|
2077
2086
|
};
|
|
2078
2087
|
enrolled_in_link?: boolean;
|
|
2088
|
+
} | {
|
|
2089
|
+
type: typeof MESSAGE_TYPES.ORDER_TYPE_CHANGED;
|
|
2090
|
+
orderType: OrderType;
|
|
2091
|
+
} | {
|
|
2092
|
+
type: typeof MESSAGE_TYPES.REQUEST_SUBMIT;
|
|
2079
2093
|
};
|
|
2080
2094
|
declare const EVENT_TYPES: {
|
|
2081
2095
|
readonly READY: "ready";
|
|
@@ -2085,6 +2099,8 @@ declare const EVENT_TYPES: {
|
|
|
2085
2099
|
readonly CHANGE: "change";
|
|
2086
2100
|
readonly BLUR: "blur";
|
|
2087
2101
|
readonly FOCUS: "focus";
|
|
2102
|
+
readonly ORDER_TYPE_CHANGED: "order_type_changed";
|
|
2103
|
+
readonly REQUEST_SUBMIT: "request_submit";
|
|
2088
2104
|
};
|
|
2089
2105
|
type ElementEventType = (typeof EVENT_TYPES)[keyof typeof EVENT_TYPES];
|
|
2090
2106
|
type ElementEventHandler<T = unknown> = (data: T) => void;
|
|
@@ -2269,4 +2285,4 @@ declare class CimplifyClient {
|
|
|
2269
2285
|
}
|
|
2270
2286
|
declare function createCimplifyClient(config?: CimplifyConfig): CimplifyClient;
|
|
2271
2287
|
|
|
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
|
|
2288
|
+
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-bq-xxzM7.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';
|