@cimplify/sdk 0.7.1 → 0.7.2
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 +21 -5
- package/dist/advanced.mjs +21 -5
- package/dist/{client-CSH0xyto.d.mts → client-4qOxssTq.d.mts} +7 -1
- package/dist/{client-C082Zp8J.d.ts → client-Djde3IXh.d.ts} +7 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +45 -6
- package/dist/index.mjs +45 -6
- package/dist/react.d.mts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +45 -6
- package/dist/react.mjs +45 -6
- 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, v as CimplifyElement, u as CimplifyElements, x as ELEMENT_TYPES, E as EVENT_TYPES, H as ElementEventType, z as ElementOptions, D as ElementType, y as ElementsOptions, F as FetchQuoteInput, r as FxService, G as GetProductsOptions, I as InventoryService, L as LinkService, q 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, p as SchedulingService, S as SearchOptions, w 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, v as CimplifyElement, u as CimplifyElements, x as ELEMENT_TYPES, E as EVENT_TYPES, H as ElementEventType, z as ElementOptions, D as ElementType, y as ElementsOptions, F as FetchQuoteInput, r as FxService, G as GetProductsOptions, I as InventoryService, L as LinkService, q 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, p as SchedulingService, S as SearchOptions, w as createElements, k as generateIdempotencyKey } from './client-4qOxssTq.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, v as CimplifyElement, u as CimplifyElements, x as ELEMENT_TYPES, E as EVENT_TYPES, H as ElementEventType, z as ElementOptions, D as ElementType, y as ElementsOptions, F as FetchQuoteInput, r as FxService, G as GetProductsOptions, I as InventoryService, L as LinkService, q 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, p as SchedulingService, S as SearchOptions, w 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, v as CimplifyElement, u as CimplifyElements, x as ELEMENT_TYPES, E as EVENT_TYPES, H as ElementEventType, z as ElementOptions, D as ElementType, y as ElementsOptions, F as FetchQuoteInput, r as FxService, G as GetProductsOptions, I as InventoryService, L as LinkService, q 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, p as SchedulingService, S as SearchOptions, w as createElements, k as generateIdempotencyKey } from './client-Djde3IXh.js';
|
|
2
2
|
import './payment-CLIWNMaP.js';
|
|
3
3
|
|
|
4
4
|
type Operator = "==" | "!=" | ">" | "<" | ">=" | "<=" | "contains" | "startsWith";
|
package/dist/advanced.js
CHANGED
|
@@ -1734,12 +1734,16 @@ var CheckoutService = class {
|
|
|
1734
1734
|
constructor(client) {
|
|
1735
1735
|
this.client = client;
|
|
1736
1736
|
}
|
|
1737
|
+
orderTokenParam(orderId) {
|
|
1738
|
+
const token = this.client.getOrderToken(orderId);
|
|
1739
|
+
return token ? `?token=${encodeURIComponent(token)}` : "";
|
|
1740
|
+
}
|
|
1737
1741
|
async process(data) {
|
|
1738
1742
|
const checkoutData = {
|
|
1739
1743
|
...data,
|
|
1740
1744
|
idempotency_key: data.idempotency_key || generateIdempotencyKey()
|
|
1741
1745
|
};
|
|
1742
|
-
|
|
1746
|
+
const result = await safeWithFallback3(
|
|
1743
1747
|
() => this.client.post("/api/v1/checkout", {
|
|
1744
1748
|
checkout_data: checkoutData
|
|
1745
1749
|
}),
|
|
@@ -1747,6 +1751,10 @@ var CheckoutService = class {
|
|
|
1747
1751
|
checkout_data: checkoutData
|
|
1748
1752
|
})
|
|
1749
1753
|
);
|
|
1754
|
+
if (result.ok && result.value.bill_token) {
|
|
1755
|
+
this.client.setOrderToken(result.value.order_id, result.value.bill_token);
|
|
1756
|
+
}
|
|
1757
|
+
return result;
|
|
1750
1758
|
}
|
|
1751
1759
|
async initializePayment(orderId, method) {
|
|
1752
1760
|
return safe3(
|
|
@@ -1764,15 +1772,17 @@ var CheckoutService = class {
|
|
|
1764
1772
|
}
|
|
1765
1773
|
async pollPaymentStatus(orderId) {
|
|
1766
1774
|
const encodedId = encodeURIComponent(orderId);
|
|
1775
|
+
const tokenParam = this.orderTokenParam(orderId);
|
|
1767
1776
|
return safeWithFallback3(
|
|
1768
|
-
() => this.client.get(`/api/v1/orders/${encodedId}/payment-status`),
|
|
1777
|
+
() => this.client.get(`/api/v1/orders/${encodedId}/payment-status${tokenParam}`),
|
|
1769
1778
|
() => this.client.call(PAYMENT_MUTATION.CHECK_STATUS, orderId)
|
|
1770
1779
|
);
|
|
1771
1780
|
}
|
|
1772
1781
|
async updateOrderCustomer(orderId, customer) {
|
|
1773
1782
|
const encodedId = encodeURIComponent(orderId);
|
|
1783
|
+
const tokenParam = this.orderTokenParam(orderId);
|
|
1774
1784
|
return safeWithFallback3(
|
|
1775
|
-
() => this.client.post(`/api/v1/orders/${encodedId}/customer`, customer),
|
|
1785
|
+
() => this.client.post(`/api/v1/orders/${encodedId}/customer${tokenParam}`, customer),
|
|
1776
1786
|
() => this.client.call(ORDER_MUTATION.UPDATE_CUSTOMER, {
|
|
1777
1787
|
order_id: orderId,
|
|
1778
1788
|
...customer
|
|
@@ -1915,6 +1925,10 @@ var OrderQueries = class {
|
|
|
1915
1925
|
constructor(client) {
|
|
1916
1926
|
this.client = client;
|
|
1917
1927
|
}
|
|
1928
|
+
orderTokenParam(orderId) {
|
|
1929
|
+
const token = this.client.getOrderToken(orderId);
|
|
1930
|
+
return token ? `?token=${encodeURIComponent(token)}` : "";
|
|
1931
|
+
}
|
|
1918
1932
|
async list(options) {
|
|
1919
1933
|
let query2 = "orders";
|
|
1920
1934
|
if (options?.status) {
|
|
@@ -1939,8 +1953,9 @@ var OrderQueries = class {
|
|
|
1939
1953
|
}
|
|
1940
1954
|
async get(orderId) {
|
|
1941
1955
|
const encodedId = encodeURIComponent(orderId);
|
|
1956
|
+
const tokenParam = this.orderTokenParam(orderId);
|
|
1942
1957
|
return safeWithFallback4(
|
|
1943
|
-
() => this.client.get(`/api/v1/orders/${encodedId}`),
|
|
1958
|
+
() => this.client.get(`/api/v1/orders/${encodedId}${tokenParam}`),
|
|
1944
1959
|
() => this.client.query(`orders.${orderId}`)
|
|
1945
1960
|
);
|
|
1946
1961
|
}
|
|
@@ -1952,8 +1967,9 @@ var OrderQueries = class {
|
|
|
1952
1967
|
}
|
|
1953
1968
|
async cancel(orderId, reason) {
|
|
1954
1969
|
const encodedId = encodeURIComponent(orderId);
|
|
1970
|
+
const tokenParam = this.orderTokenParam(orderId);
|
|
1955
1971
|
return safeWithFallback4(
|
|
1956
|
-
() => this.client.post(`/api/v1/orders/${encodedId}/cancel`, {
|
|
1972
|
+
() => this.client.post(`/api/v1/orders/${encodedId}/cancel${tokenParam}`, {
|
|
1957
1973
|
reason
|
|
1958
1974
|
}),
|
|
1959
1975
|
() => this.client.call("order.cancelOrder", {
|
package/dist/advanced.mjs
CHANGED
|
@@ -1732,12 +1732,16 @@ var CheckoutService = class {
|
|
|
1732
1732
|
constructor(client) {
|
|
1733
1733
|
this.client = client;
|
|
1734
1734
|
}
|
|
1735
|
+
orderTokenParam(orderId) {
|
|
1736
|
+
const token = this.client.getOrderToken(orderId);
|
|
1737
|
+
return token ? `?token=${encodeURIComponent(token)}` : "";
|
|
1738
|
+
}
|
|
1735
1739
|
async process(data) {
|
|
1736
1740
|
const checkoutData = {
|
|
1737
1741
|
...data,
|
|
1738
1742
|
idempotency_key: data.idempotency_key || generateIdempotencyKey()
|
|
1739
1743
|
};
|
|
1740
|
-
|
|
1744
|
+
const result = await safeWithFallback3(
|
|
1741
1745
|
() => this.client.post("/api/v1/checkout", {
|
|
1742
1746
|
checkout_data: checkoutData
|
|
1743
1747
|
}),
|
|
@@ -1745,6 +1749,10 @@ var CheckoutService = class {
|
|
|
1745
1749
|
checkout_data: checkoutData
|
|
1746
1750
|
})
|
|
1747
1751
|
);
|
|
1752
|
+
if (result.ok && result.value.bill_token) {
|
|
1753
|
+
this.client.setOrderToken(result.value.order_id, result.value.bill_token);
|
|
1754
|
+
}
|
|
1755
|
+
return result;
|
|
1748
1756
|
}
|
|
1749
1757
|
async initializePayment(orderId, method) {
|
|
1750
1758
|
return safe3(
|
|
@@ -1762,15 +1770,17 @@ var CheckoutService = class {
|
|
|
1762
1770
|
}
|
|
1763
1771
|
async pollPaymentStatus(orderId) {
|
|
1764
1772
|
const encodedId = encodeURIComponent(orderId);
|
|
1773
|
+
const tokenParam = this.orderTokenParam(orderId);
|
|
1765
1774
|
return safeWithFallback3(
|
|
1766
|
-
() => this.client.get(`/api/v1/orders/${encodedId}/payment-status`),
|
|
1775
|
+
() => this.client.get(`/api/v1/orders/${encodedId}/payment-status${tokenParam}`),
|
|
1767
1776
|
() => this.client.call(PAYMENT_MUTATION.CHECK_STATUS, orderId)
|
|
1768
1777
|
);
|
|
1769
1778
|
}
|
|
1770
1779
|
async updateOrderCustomer(orderId, customer) {
|
|
1771
1780
|
const encodedId = encodeURIComponent(orderId);
|
|
1781
|
+
const tokenParam = this.orderTokenParam(orderId);
|
|
1772
1782
|
return safeWithFallback3(
|
|
1773
|
-
() => this.client.post(`/api/v1/orders/${encodedId}/customer`, customer),
|
|
1783
|
+
() => this.client.post(`/api/v1/orders/${encodedId}/customer${tokenParam}`, customer),
|
|
1774
1784
|
() => this.client.call(ORDER_MUTATION.UPDATE_CUSTOMER, {
|
|
1775
1785
|
order_id: orderId,
|
|
1776
1786
|
...customer
|
|
@@ -1913,6 +1923,10 @@ var OrderQueries = class {
|
|
|
1913
1923
|
constructor(client) {
|
|
1914
1924
|
this.client = client;
|
|
1915
1925
|
}
|
|
1926
|
+
orderTokenParam(orderId) {
|
|
1927
|
+
const token = this.client.getOrderToken(orderId);
|
|
1928
|
+
return token ? `?token=${encodeURIComponent(token)}` : "";
|
|
1929
|
+
}
|
|
1916
1930
|
async list(options) {
|
|
1917
1931
|
let query2 = "orders";
|
|
1918
1932
|
if (options?.status) {
|
|
@@ -1937,8 +1951,9 @@ var OrderQueries = class {
|
|
|
1937
1951
|
}
|
|
1938
1952
|
async get(orderId) {
|
|
1939
1953
|
const encodedId = encodeURIComponent(orderId);
|
|
1954
|
+
const tokenParam = this.orderTokenParam(orderId);
|
|
1940
1955
|
return safeWithFallback4(
|
|
1941
|
-
() => this.client.get(`/api/v1/orders/${encodedId}`),
|
|
1956
|
+
() => this.client.get(`/api/v1/orders/${encodedId}${tokenParam}`),
|
|
1942
1957
|
() => this.client.query(`orders.${orderId}`)
|
|
1943
1958
|
);
|
|
1944
1959
|
}
|
|
@@ -1950,8 +1965,9 @@ var OrderQueries = class {
|
|
|
1950
1965
|
}
|
|
1951
1966
|
async cancel(orderId, reason) {
|
|
1952
1967
|
const encodedId = encodeURIComponent(orderId);
|
|
1968
|
+
const tokenParam = this.orderTokenParam(orderId);
|
|
1953
1969
|
return safeWithFallback4(
|
|
1954
|
-
() => this.client.post(`/api/v1/orders/${encodedId}/cancel`, {
|
|
1970
|
+
() => this.client.post(`/api/v1/orders/${encodedId}/cancel${tokenParam}`, {
|
|
1955
1971
|
reason
|
|
1956
1972
|
}),
|
|
1957
1973
|
() => this.client.call("order.cancelOrder", {
|
|
@@ -1112,6 +1112,8 @@ interface CheckoutFormData {
|
|
|
1112
1112
|
interface CheckoutResult {
|
|
1113
1113
|
order_id: string;
|
|
1114
1114
|
order_number: string;
|
|
1115
|
+
/** Token for guest order access. Store this and pass as `?token=` on order endpoints. */
|
|
1116
|
+
bill_token?: string;
|
|
1115
1117
|
payment_reference?: string;
|
|
1116
1118
|
payment_status: string;
|
|
1117
1119
|
requires_authorization: boolean;
|
|
@@ -1189,6 +1191,7 @@ declare function generateIdempotencyKey(): string;
|
|
|
1189
1191
|
declare class CheckoutService {
|
|
1190
1192
|
private client;
|
|
1191
1193
|
constructor(client: CimplifyClient);
|
|
1194
|
+
private orderTokenParam;
|
|
1192
1195
|
process(data: CheckoutFormData): Promise<Result<CheckoutResult, CimplifyError>>;
|
|
1193
1196
|
initializePayment(orderId: string, method: PaymentMethod): Promise<Result<InitializePaymentResult, CimplifyError>>;
|
|
1194
1197
|
submitAuthorization(input: SubmitAuthorizationInput): Promise<Result<CheckoutResult, CimplifyError>>;
|
|
@@ -1222,6 +1225,7 @@ interface GetOrdersOptions {
|
|
|
1222
1225
|
declare class OrderQueries {
|
|
1223
1226
|
private client;
|
|
1224
1227
|
constructor(client: CimplifyClient);
|
|
1228
|
+
private orderTokenParam;
|
|
1225
1229
|
list(options?: GetOrdersOptions): Promise<Result<Order[], CimplifyError>>;
|
|
1226
1230
|
get(orderId: string): Promise<Result<Order, CimplifyError>>;
|
|
1227
1231
|
getRecent(limit?: number): Promise<Result<Order[], CimplifyError>>;
|
|
@@ -2323,7 +2327,9 @@ declare class CimplifyClient {
|
|
|
2323
2327
|
isTestMode(): boolean;
|
|
2324
2328
|
setAccessToken(token: string | null): void;
|
|
2325
2329
|
clearSession(): void;
|
|
2326
|
-
|
|
2330
|
+
setOrderToken(orderId: string, token: string): void;
|
|
2331
|
+
getOrderToken(orderId: string): string | null;
|
|
2332
|
+
clearOrderTokens(): void;
|
|
2327
2333
|
setLocationId(locationId: string | null): void;
|
|
2328
2334
|
/** Get the currently active location ID */
|
|
2329
2335
|
getLocationId(): string | null;
|
|
@@ -1112,6 +1112,8 @@ interface CheckoutFormData {
|
|
|
1112
1112
|
interface CheckoutResult {
|
|
1113
1113
|
order_id: string;
|
|
1114
1114
|
order_number: string;
|
|
1115
|
+
/** Token for guest order access. Store this and pass as `?token=` on order endpoints. */
|
|
1116
|
+
bill_token?: string;
|
|
1115
1117
|
payment_reference?: string;
|
|
1116
1118
|
payment_status: string;
|
|
1117
1119
|
requires_authorization: boolean;
|
|
@@ -1189,6 +1191,7 @@ declare function generateIdempotencyKey(): string;
|
|
|
1189
1191
|
declare class CheckoutService {
|
|
1190
1192
|
private client;
|
|
1191
1193
|
constructor(client: CimplifyClient);
|
|
1194
|
+
private orderTokenParam;
|
|
1192
1195
|
process(data: CheckoutFormData): Promise<Result<CheckoutResult, CimplifyError>>;
|
|
1193
1196
|
initializePayment(orderId: string, method: PaymentMethod): Promise<Result<InitializePaymentResult, CimplifyError>>;
|
|
1194
1197
|
submitAuthorization(input: SubmitAuthorizationInput): Promise<Result<CheckoutResult, CimplifyError>>;
|
|
@@ -1222,6 +1225,7 @@ interface GetOrdersOptions {
|
|
|
1222
1225
|
declare class OrderQueries {
|
|
1223
1226
|
private client;
|
|
1224
1227
|
constructor(client: CimplifyClient);
|
|
1228
|
+
private orderTokenParam;
|
|
1225
1229
|
list(options?: GetOrdersOptions): Promise<Result<Order[], CimplifyError>>;
|
|
1226
1230
|
get(orderId: string): Promise<Result<Order, CimplifyError>>;
|
|
1227
1231
|
getRecent(limit?: number): Promise<Result<Order[], CimplifyError>>;
|
|
@@ -2323,7 +2327,9 @@ declare class CimplifyClient {
|
|
|
2323
2327
|
isTestMode(): boolean;
|
|
2324
2328
|
setAccessToken(token: string | null): void;
|
|
2325
2329
|
clearSession(): void;
|
|
2326
|
-
|
|
2330
|
+
setOrderToken(orderId: string, token: string): void;
|
|
2331
|
+
getOrderToken(orderId: string): string | null;
|
|
2332
|
+
clearOrderTokens(): void;
|
|
2327
2333
|
setLocationId(locationId: string | null): void;
|
|
2328
2334
|
/** Get the currently active location ID */
|
|
2329
2335
|
getLocationId(): string | null;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ad as AUTHORIZATION_TYPE, ai as AUTH_MUTATION, a2 as AbortablePromise, cl as AddressData, cN as AddressInfo, aS as AmountToPay, cw as AuthResponse, A as AuthService, m as AuthStatus, cP as AuthenticatedCustomer, cR as AuthenticatedData, c9 as AvailabilityCheck, ca as AvailabilityResult, bT as AvailableSlot, bW as Booking, bN as BookingRequirementOverride, bV as BookingStatus, bX as BookingWithDetails, ba as BufferTimes, bp as Business, bD as BusinessHours, bo as BusinessPreferences, B as BusinessService, bC as BusinessSettings, bn as BusinessType, bA as BusinessWithLocations, a6 as CHECKOUT_MODE, aj as CHECKOUT_MUTATION, a9 as CHECKOUT_STEP, af as CONTACT_TYPE, b$ as CancelBookingInput, b4 as CancelOrderInput, bc as CancellationPolicy, i as CartOperations, b as CatalogueQueries, aF as CatalogueResult, aG as CatalogueSnapshot, bE as CategoryInfo, o as ChangePasswordInput, bZ as CheckSlotAvailabilityInput, cz as CheckoutAddressInfo, cB as CheckoutCustomerInfo, X as CheckoutFormData, b2 as CheckoutInput, J as CheckoutMode, j as CheckoutOperations, N as CheckoutOrderType, V as CheckoutPaymentMethod, Y as CheckoutResult, j as CheckoutService, a0 as CheckoutStatus, a1 as CheckoutStatusContext, W as CheckoutStep, C as CimplifyClient, a as CimplifyConfig, v as CimplifyElement, u as CimplifyElements, a5 as ContactType, ch as CreateAddressInput, cj as CreateMobileMoneyInput, cc as Customer, cd as CustomerAddress, cf as CustomerLinkPreferences, ce as CustomerMobileMoney, b9 as CustomerServicePreferences, an as DEFAULT_COUNTRY, am as DEFAULT_CURRENCY, ae as DEVICE_TYPE, bU as DayAvailability, bj as DepositResult, a4 as DeviceType, x as ELEMENT_TYPES, E as EVENT_TYPES, cM as ElementAppearance, cW as ElementEventHandler, H as ElementEventType, z as ElementOptions, D as ElementType, cS as ElementsCheckoutData, cT as ElementsCheckoutResult, cQ as ElementsCustomerInfo, y as ElementsOptions, cn as EnrollAndLinkOrderInput, cq as EnrollAndLinkOrderResult, ck as EnrollmentData, aq as Err, aR as FeeBearerType, F as FetchQuoteInput, aP as FulfillmentLink, aO as FulfillmentStatus, aN as FulfillmentType, cD as FxQuote, cC as FxQuoteRequest, cE as FxRateResponse, r as FxService, bY as GetAvailableSlotsInput, l as GetOrdersOptions, G as GetProductsOptions, cV as IframeToParentMessage, I as InventoryService, cb as InventorySummary, K as KitchenOrderItem, t as KitchenOrderResult, ah as LINK_MUTATION, ag as LINK_QUERY, aT as LineItem, aK as LineType, cg as LinkData, cp as LinkEnrollResult, L as LinkService, cr as LinkSession, co as LinkStatusResult, s as LiteBootstrap, q as LiteService, bs as Location, bm as LocationAppointment, c8 as LocationStock, bq as LocationTaxBehavior, br as LocationTaxOverrides, bv as LocationTimeProfile, bB as LocationWithDetails, M as MESSAGE_TYPES, ac as MOBILE_MONEY_PROVIDER, cm as MobileMoneyData, cA as MobileMoneyDetails, a3 as MobileMoneyProvider, al as ORDER_MUTATION, a7 as ORDER_TYPE, cL as ObservabilityHooks, ap as Ok, aU as Order, aJ as OrderChannel, b1 as OrderFilter, aQ as OrderFulfillmentSummary, aX as OrderGroup, a$ as OrderGroupDetails, aY as OrderGroupPayment, aW as OrderGroupPaymentState, a_ as OrderGroupPaymentSummary, aV as OrderHistory, aL as OrderLineState, aM as OrderLineStatus, b0 as OrderPaymentEvent, O as OrderQueries, aZ as OrderSplitDetail, aH as OrderStatus, n as OtpResult, a8 as PAYMENT_METHOD, ak as PAYMENT_MUTATION, aa as PAYMENT_STATE, ab as PICKUP_TIME_TYPE, cU as ParentToIframeMessage, cO as PaymentMethodInfo, aI as PaymentState, cy as PickupTime, cx as PickupTimeType, P as PriceQuote, be as PricingOverrides, $ as ProcessAndResolveOptions, Z as ProcessCheckoutOptions, _ as ProcessCheckoutResult, c6 as ProductStock, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, h as RefreshQuoteResult, b5 as RefundOrderInput, b8 as ReminderMethod, bb as ReminderSettings, cF as RequestContext, cI as RequestErrorEvent, cu as RequestOtpInput, cG as RequestStartEvent, cH as RequestSuccessEvent, b_ as RescheduleBookingInput, bh as ResourceAssignment, bK as ResourceAvailabilityException, bJ as ResourceAvailabilityRule, bO as ResourceType, ao as Result, cJ as RetryEvent, ct as RevokeAllSessionsResult, cs as RevokeSessionResult, bx as Room, bf as SchedulingMetadata, bi as SchedulingResult, p as SchedulingService, S as SearchOptions, bP as Service, bG as ServiceAvailabilityException, c0 as ServiceAvailabilityParams, c1 as ServiceAvailabilityResult, bF as ServiceAvailabilityRule, by as ServiceCharge, bd as ServiceNotes, bk as ServiceScheduleRequest, bM as ServiceStaffRequirement, b6 as ServiceStatus, bQ as ServiceWithStaff, cK as SessionChangeEvent, bR as Staff, bg as StaffAssignment, bI as StaffAvailabilityException, bH as StaffAvailabilityRule, bL as StaffBookingProfile, b7 as StaffRole, bl as StaffScheduleItem, c4 as Stock, c5 as StockLevel, c2 as StockOwnershipType, c3 as StockStatus, bz as StorefrontBootstrap, bw as Table, T as TableInfo, bt as TimeRange, bu as TimeRanges, bS as TimeSlot, ci as UpdateAddressInput, b3 as UpdateOrderStatusInput, U as UpdateProfileInput, c7 as VariantStock, cv as VerifyOtpInput, aD as combine, aE as combineObject, c as createCimplifyClient, w as createElements, as as err, ax as flatMap, aB as fromPromise, k as generateIdempotencyKey, ay as getOrElse, au as isErr, at as isOk, aw as mapError, av as mapResult, ar as ok, aA as toNullable, aC as tryCatch, az as unwrap } from './client-
|
|
1
|
+
export { ad as AUTHORIZATION_TYPE, ai as AUTH_MUTATION, a2 as AbortablePromise, cl as AddressData, cN as AddressInfo, aS as AmountToPay, cw as AuthResponse, A as AuthService, m as AuthStatus, cP as AuthenticatedCustomer, cR as AuthenticatedData, c9 as AvailabilityCheck, ca as AvailabilityResult, bT as AvailableSlot, bW as Booking, bN as BookingRequirementOverride, bV as BookingStatus, bX as BookingWithDetails, ba as BufferTimes, bp as Business, bD as BusinessHours, bo as BusinessPreferences, B as BusinessService, bC as BusinessSettings, bn as BusinessType, bA as BusinessWithLocations, a6 as CHECKOUT_MODE, aj as CHECKOUT_MUTATION, a9 as CHECKOUT_STEP, af as CONTACT_TYPE, b$ as CancelBookingInput, b4 as CancelOrderInput, bc as CancellationPolicy, i as CartOperations, b as CatalogueQueries, aF as CatalogueResult, aG as CatalogueSnapshot, bE as CategoryInfo, o as ChangePasswordInput, bZ as CheckSlotAvailabilityInput, cz as CheckoutAddressInfo, cB as CheckoutCustomerInfo, X as CheckoutFormData, b2 as CheckoutInput, J as CheckoutMode, j as CheckoutOperations, N as CheckoutOrderType, V as CheckoutPaymentMethod, Y as CheckoutResult, j as CheckoutService, a0 as CheckoutStatus, a1 as CheckoutStatusContext, W as CheckoutStep, C as CimplifyClient, a as CimplifyConfig, v as CimplifyElement, u as CimplifyElements, a5 as ContactType, ch as CreateAddressInput, cj as CreateMobileMoneyInput, cc as Customer, cd as CustomerAddress, cf as CustomerLinkPreferences, ce as CustomerMobileMoney, b9 as CustomerServicePreferences, an as DEFAULT_COUNTRY, am as DEFAULT_CURRENCY, ae as DEVICE_TYPE, bU as DayAvailability, bj as DepositResult, a4 as DeviceType, x as ELEMENT_TYPES, E as EVENT_TYPES, cM as ElementAppearance, cW as ElementEventHandler, H as ElementEventType, z as ElementOptions, D as ElementType, cS as ElementsCheckoutData, cT as ElementsCheckoutResult, cQ as ElementsCustomerInfo, y as ElementsOptions, cn as EnrollAndLinkOrderInput, cq as EnrollAndLinkOrderResult, ck as EnrollmentData, aq as Err, aR as FeeBearerType, F as FetchQuoteInput, aP as FulfillmentLink, aO as FulfillmentStatus, aN as FulfillmentType, cD as FxQuote, cC as FxQuoteRequest, cE as FxRateResponse, r as FxService, bY as GetAvailableSlotsInput, l as GetOrdersOptions, G as GetProductsOptions, cV as IframeToParentMessage, I as InventoryService, cb as InventorySummary, K as KitchenOrderItem, t as KitchenOrderResult, ah as LINK_MUTATION, ag as LINK_QUERY, aT as LineItem, aK as LineType, cg as LinkData, cp as LinkEnrollResult, L as LinkService, cr as LinkSession, co as LinkStatusResult, s as LiteBootstrap, q as LiteService, bs as Location, bm as LocationAppointment, c8 as LocationStock, bq as LocationTaxBehavior, br as LocationTaxOverrides, bv as LocationTimeProfile, bB as LocationWithDetails, M as MESSAGE_TYPES, ac as MOBILE_MONEY_PROVIDER, cm as MobileMoneyData, cA as MobileMoneyDetails, a3 as MobileMoneyProvider, al as ORDER_MUTATION, a7 as ORDER_TYPE, cL as ObservabilityHooks, ap as Ok, aU as Order, aJ as OrderChannel, b1 as OrderFilter, aQ as OrderFulfillmentSummary, aX as OrderGroup, a$ as OrderGroupDetails, aY as OrderGroupPayment, aW as OrderGroupPaymentState, a_ as OrderGroupPaymentSummary, aV as OrderHistory, aL as OrderLineState, aM as OrderLineStatus, b0 as OrderPaymentEvent, O as OrderQueries, aZ as OrderSplitDetail, aH as OrderStatus, n as OtpResult, a8 as PAYMENT_METHOD, ak as PAYMENT_MUTATION, aa as PAYMENT_STATE, ab as PICKUP_TIME_TYPE, cU as ParentToIframeMessage, cO as PaymentMethodInfo, aI as PaymentState, cy as PickupTime, cx as PickupTimeType, P as PriceQuote, be as PricingOverrides, $ as ProcessAndResolveOptions, Z as ProcessCheckoutOptions, _ as ProcessCheckoutResult, c6 as ProductStock, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, h as RefreshQuoteResult, b5 as RefundOrderInput, b8 as ReminderMethod, bb as ReminderSettings, cF as RequestContext, cI as RequestErrorEvent, cu as RequestOtpInput, cG as RequestStartEvent, cH as RequestSuccessEvent, b_ as RescheduleBookingInput, bh as ResourceAssignment, bK as ResourceAvailabilityException, bJ as ResourceAvailabilityRule, bO as ResourceType, ao as Result, cJ as RetryEvent, ct as RevokeAllSessionsResult, cs as RevokeSessionResult, bx as Room, bf as SchedulingMetadata, bi as SchedulingResult, p as SchedulingService, S as SearchOptions, bP as Service, bG as ServiceAvailabilityException, c0 as ServiceAvailabilityParams, c1 as ServiceAvailabilityResult, bF as ServiceAvailabilityRule, by as ServiceCharge, bd as ServiceNotes, bk as ServiceScheduleRequest, bM as ServiceStaffRequirement, b6 as ServiceStatus, bQ as ServiceWithStaff, cK as SessionChangeEvent, bR as Staff, bg as StaffAssignment, bI as StaffAvailabilityException, bH as StaffAvailabilityRule, bL as StaffBookingProfile, b7 as StaffRole, bl as StaffScheduleItem, c4 as Stock, c5 as StockLevel, c2 as StockOwnershipType, c3 as StockStatus, bz as StorefrontBootstrap, bw as Table, T as TableInfo, bt as TimeRange, bu as TimeRanges, bS as TimeSlot, ci as UpdateAddressInput, b3 as UpdateOrderStatusInput, U as UpdateProfileInput, c7 as VariantStock, cv as VerifyOtpInput, aD as combine, aE as combineObject, c as createCimplifyClient, w as createElements, as as err, ax as flatMap, aB as fromPromise, k as generateIdempotencyKey, ay as getOrElse, au as isErr, at as isOk, aw as mapError, av as mapResult, ar as ok, aA as toNullable, aC as tryCatch, az as unwrap } from './client-4qOxssTq.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';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ad as AUTHORIZATION_TYPE, ai as AUTH_MUTATION, a2 as AbortablePromise, cl as AddressData, cN as AddressInfo, aS as AmountToPay, cw as AuthResponse, A as AuthService, m as AuthStatus, cP as AuthenticatedCustomer, cR as AuthenticatedData, c9 as AvailabilityCheck, ca as AvailabilityResult, bT as AvailableSlot, bW as Booking, bN as BookingRequirementOverride, bV as BookingStatus, bX as BookingWithDetails, ba as BufferTimes, bp as Business, bD as BusinessHours, bo as BusinessPreferences, B as BusinessService, bC as BusinessSettings, bn as BusinessType, bA as BusinessWithLocations, a6 as CHECKOUT_MODE, aj as CHECKOUT_MUTATION, a9 as CHECKOUT_STEP, af as CONTACT_TYPE, b$ as CancelBookingInput, b4 as CancelOrderInput, bc as CancellationPolicy, i as CartOperations, b as CatalogueQueries, aF as CatalogueResult, aG as CatalogueSnapshot, bE as CategoryInfo, o as ChangePasswordInput, bZ as CheckSlotAvailabilityInput, cz as CheckoutAddressInfo, cB as CheckoutCustomerInfo, X as CheckoutFormData, b2 as CheckoutInput, J as CheckoutMode, j as CheckoutOperations, N as CheckoutOrderType, V as CheckoutPaymentMethod, Y as CheckoutResult, j as CheckoutService, a0 as CheckoutStatus, a1 as CheckoutStatusContext, W as CheckoutStep, C as CimplifyClient, a as CimplifyConfig, v as CimplifyElement, u as CimplifyElements, a5 as ContactType, ch as CreateAddressInput, cj as CreateMobileMoneyInput, cc as Customer, cd as CustomerAddress, cf as CustomerLinkPreferences, ce as CustomerMobileMoney, b9 as CustomerServicePreferences, an as DEFAULT_COUNTRY, am as DEFAULT_CURRENCY, ae as DEVICE_TYPE, bU as DayAvailability, bj as DepositResult, a4 as DeviceType, x as ELEMENT_TYPES, E as EVENT_TYPES, cM as ElementAppearance, cW as ElementEventHandler, H as ElementEventType, z as ElementOptions, D as ElementType, cS as ElementsCheckoutData, cT as ElementsCheckoutResult, cQ as ElementsCustomerInfo, y as ElementsOptions, cn as EnrollAndLinkOrderInput, cq as EnrollAndLinkOrderResult, ck as EnrollmentData, aq as Err, aR as FeeBearerType, F as FetchQuoteInput, aP as FulfillmentLink, aO as FulfillmentStatus, aN as FulfillmentType, cD as FxQuote, cC as FxQuoteRequest, cE as FxRateResponse, r as FxService, bY as GetAvailableSlotsInput, l as GetOrdersOptions, G as GetProductsOptions, cV as IframeToParentMessage, I as InventoryService, cb as InventorySummary, K as KitchenOrderItem, t as KitchenOrderResult, ah as LINK_MUTATION, ag as LINK_QUERY, aT as LineItem, aK as LineType, cg as LinkData, cp as LinkEnrollResult, L as LinkService, cr as LinkSession, co as LinkStatusResult, s as LiteBootstrap, q as LiteService, bs as Location, bm as LocationAppointment, c8 as LocationStock, bq as LocationTaxBehavior, br as LocationTaxOverrides, bv as LocationTimeProfile, bB as LocationWithDetails, M as MESSAGE_TYPES, ac as MOBILE_MONEY_PROVIDER, cm as MobileMoneyData, cA as MobileMoneyDetails, a3 as MobileMoneyProvider, al as ORDER_MUTATION, a7 as ORDER_TYPE, cL as ObservabilityHooks, ap as Ok, aU as Order, aJ as OrderChannel, b1 as OrderFilter, aQ as OrderFulfillmentSummary, aX as OrderGroup, a$ as OrderGroupDetails, aY as OrderGroupPayment, aW as OrderGroupPaymentState, a_ as OrderGroupPaymentSummary, aV as OrderHistory, aL as OrderLineState, aM as OrderLineStatus, b0 as OrderPaymentEvent, O as OrderQueries, aZ as OrderSplitDetail, aH as OrderStatus, n as OtpResult, a8 as PAYMENT_METHOD, ak as PAYMENT_MUTATION, aa as PAYMENT_STATE, ab as PICKUP_TIME_TYPE, cU as ParentToIframeMessage, cO as PaymentMethodInfo, aI as PaymentState, cy as PickupTime, cx as PickupTimeType, P as PriceQuote, be as PricingOverrides, $ as ProcessAndResolveOptions, Z as ProcessCheckoutOptions, _ as ProcessCheckoutResult, c6 as ProductStock, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, h as RefreshQuoteResult, b5 as RefundOrderInput, b8 as ReminderMethod, bb as ReminderSettings, cF as RequestContext, cI as RequestErrorEvent, cu as RequestOtpInput, cG as RequestStartEvent, cH as RequestSuccessEvent, b_ as RescheduleBookingInput, bh as ResourceAssignment, bK as ResourceAvailabilityException, bJ as ResourceAvailabilityRule, bO as ResourceType, ao as Result, cJ as RetryEvent, ct as RevokeAllSessionsResult, cs as RevokeSessionResult, bx as Room, bf as SchedulingMetadata, bi as SchedulingResult, p as SchedulingService, S as SearchOptions, bP as Service, bG as ServiceAvailabilityException, c0 as ServiceAvailabilityParams, c1 as ServiceAvailabilityResult, bF as ServiceAvailabilityRule, by as ServiceCharge, bd as ServiceNotes, bk as ServiceScheduleRequest, bM as ServiceStaffRequirement, b6 as ServiceStatus, bQ as ServiceWithStaff, cK as SessionChangeEvent, bR as Staff, bg as StaffAssignment, bI as StaffAvailabilityException, bH as StaffAvailabilityRule, bL as StaffBookingProfile, b7 as StaffRole, bl as StaffScheduleItem, c4 as Stock, c5 as StockLevel, c2 as StockOwnershipType, c3 as StockStatus, bz as StorefrontBootstrap, bw as Table, T as TableInfo, bt as TimeRange, bu as TimeRanges, bS as TimeSlot, ci as UpdateAddressInput, b3 as UpdateOrderStatusInput, U as UpdateProfileInput, c7 as VariantStock, cv as VerifyOtpInput, aD as combine, aE as combineObject, c as createCimplifyClient, w as createElements, as as err, ax as flatMap, aB as fromPromise, k as generateIdempotencyKey, ay as getOrElse, au as isErr, at as isOk, aw as mapError, av as mapResult, ar as ok, aA as toNullable, aC as tryCatch, az as unwrap } from './client-
|
|
1
|
+
export { ad as AUTHORIZATION_TYPE, ai as AUTH_MUTATION, a2 as AbortablePromise, cl as AddressData, cN as AddressInfo, aS as AmountToPay, cw as AuthResponse, A as AuthService, m as AuthStatus, cP as AuthenticatedCustomer, cR as AuthenticatedData, c9 as AvailabilityCheck, ca as AvailabilityResult, bT as AvailableSlot, bW as Booking, bN as BookingRequirementOverride, bV as BookingStatus, bX as BookingWithDetails, ba as BufferTimes, bp as Business, bD as BusinessHours, bo as BusinessPreferences, B as BusinessService, bC as BusinessSettings, bn as BusinessType, bA as BusinessWithLocations, a6 as CHECKOUT_MODE, aj as CHECKOUT_MUTATION, a9 as CHECKOUT_STEP, af as CONTACT_TYPE, b$ as CancelBookingInput, b4 as CancelOrderInput, bc as CancellationPolicy, i as CartOperations, b as CatalogueQueries, aF as CatalogueResult, aG as CatalogueSnapshot, bE as CategoryInfo, o as ChangePasswordInput, bZ as CheckSlotAvailabilityInput, cz as CheckoutAddressInfo, cB as CheckoutCustomerInfo, X as CheckoutFormData, b2 as CheckoutInput, J as CheckoutMode, j as CheckoutOperations, N as CheckoutOrderType, V as CheckoutPaymentMethod, Y as CheckoutResult, j as CheckoutService, a0 as CheckoutStatus, a1 as CheckoutStatusContext, W as CheckoutStep, C as CimplifyClient, a as CimplifyConfig, v as CimplifyElement, u as CimplifyElements, a5 as ContactType, ch as CreateAddressInput, cj as CreateMobileMoneyInput, cc as Customer, cd as CustomerAddress, cf as CustomerLinkPreferences, ce as CustomerMobileMoney, b9 as CustomerServicePreferences, an as DEFAULT_COUNTRY, am as DEFAULT_CURRENCY, ae as DEVICE_TYPE, bU as DayAvailability, bj as DepositResult, a4 as DeviceType, x as ELEMENT_TYPES, E as EVENT_TYPES, cM as ElementAppearance, cW as ElementEventHandler, H as ElementEventType, z as ElementOptions, D as ElementType, cS as ElementsCheckoutData, cT as ElementsCheckoutResult, cQ as ElementsCustomerInfo, y as ElementsOptions, cn as EnrollAndLinkOrderInput, cq as EnrollAndLinkOrderResult, ck as EnrollmentData, aq as Err, aR as FeeBearerType, F as FetchQuoteInput, aP as FulfillmentLink, aO as FulfillmentStatus, aN as FulfillmentType, cD as FxQuote, cC as FxQuoteRequest, cE as FxRateResponse, r as FxService, bY as GetAvailableSlotsInput, l as GetOrdersOptions, G as GetProductsOptions, cV as IframeToParentMessage, I as InventoryService, cb as InventorySummary, K as KitchenOrderItem, t as KitchenOrderResult, ah as LINK_MUTATION, ag as LINK_QUERY, aT as LineItem, aK as LineType, cg as LinkData, cp as LinkEnrollResult, L as LinkService, cr as LinkSession, co as LinkStatusResult, s as LiteBootstrap, q as LiteService, bs as Location, bm as LocationAppointment, c8 as LocationStock, bq as LocationTaxBehavior, br as LocationTaxOverrides, bv as LocationTimeProfile, bB as LocationWithDetails, M as MESSAGE_TYPES, ac as MOBILE_MONEY_PROVIDER, cm as MobileMoneyData, cA as MobileMoneyDetails, a3 as MobileMoneyProvider, al as ORDER_MUTATION, a7 as ORDER_TYPE, cL as ObservabilityHooks, ap as Ok, aU as Order, aJ as OrderChannel, b1 as OrderFilter, aQ as OrderFulfillmentSummary, aX as OrderGroup, a$ as OrderGroupDetails, aY as OrderGroupPayment, aW as OrderGroupPaymentState, a_ as OrderGroupPaymentSummary, aV as OrderHistory, aL as OrderLineState, aM as OrderLineStatus, b0 as OrderPaymentEvent, O as OrderQueries, aZ as OrderSplitDetail, aH as OrderStatus, n as OtpResult, a8 as PAYMENT_METHOD, ak as PAYMENT_MUTATION, aa as PAYMENT_STATE, ab as PICKUP_TIME_TYPE, cU as ParentToIframeMessage, cO as PaymentMethodInfo, aI as PaymentState, cy as PickupTime, cx as PickupTimeType, P as PriceQuote, be as PricingOverrides, $ as ProcessAndResolveOptions, Z as ProcessCheckoutOptions, _ as ProcessCheckoutResult, c6 as ProductStock, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, h as RefreshQuoteResult, b5 as RefundOrderInput, b8 as ReminderMethod, bb as ReminderSettings, cF as RequestContext, cI as RequestErrorEvent, cu as RequestOtpInput, cG as RequestStartEvent, cH as RequestSuccessEvent, b_ as RescheduleBookingInput, bh as ResourceAssignment, bK as ResourceAvailabilityException, bJ as ResourceAvailabilityRule, bO as ResourceType, ao as Result, cJ as RetryEvent, ct as RevokeAllSessionsResult, cs as RevokeSessionResult, bx as Room, bf as SchedulingMetadata, bi as SchedulingResult, p as SchedulingService, S as SearchOptions, bP as Service, bG as ServiceAvailabilityException, c0 as ServiceAvailabilityParams, c1 as ServiceAvailabilityResult, bF as ServiceAvailabilityRule, by as ServiceCharge, bd as ServiceNotes, bk as ServiceScheduleRequest, bM as ServiceStaffRequirement, b6 as ServiceStatus, bQ as ServiceWithStaff, cK as SessionChangeEvent, bR as Staff, bg as StaffAssignment, bI as StaffAvailabilityException, bH as StaffAvailabilityRule, bL as StaffBookingProfile, b7 as StaffRole, bl as StaffScheduleItem, c4 as Stock, c5 as StockLevel, c2 as StockOwnershipType, c3 as StockStatus, bz as StorefrontBootstrap, bw as Table, T as TableInfo, bt as TimeRange, bu as TimeRanges, bS as TimeSlot, ci as UpdateAddressInput, b3 as UpdateOrderStatusInput, U as UpdateProfileInput, c7 as VariantStock, cv as VerifyOtpInput, aD as combine, aE as combineObject, c as createCimplifyClient, w as createElements, as as err, ax as flatMap, aB as fromPromise, k as generateIdempotencyKey, ay as getOrElse, au as isErr, at as isOk, aw as mapError, av as mapResult, ar as ok, aA as toNullable, aC as tryCatch, az as unwrap } from './client-Djde3IXh.js';
|
|
2
2
|
export { QueryBuilder, query } from './advanced.js';
|
|
3
3
|
import { A as ApiError } from './payment-CLIWNMaP.js';
|
|
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.js';
|
package/dist/index.js
CHANGED
|
@@ -2252,12 +2252,16 @@ var CheckoutService = class {
|
|
|
2252
2252
|
constructor(client) {
|
|
2253
2253
|
this.client = client;
|
|
2254
2254
|
}
|
|
2255
|
+
orderTokenParam(orderId) {
|
|
2256
|
+
const token = this.client.getOrderToken(orderId);
|
|
2257
|
+
return token ? `?token=${encodeURIComponent(token)}` : "";
|
|
2258
|
+
}
|
|
2255
2259
|
async process(data) {
|
|
2256
2260
|
const checkoutData = {
|
|
2257
2261
|
...data,
|
|
2258
2262
|
idempotency_key: data.idempotency_key || generateIdempotencyKey()
|
|
2259
2263
|
};
|
|
2260
|
-
|
|
2264
|
+
const result = await safeWithFallback3(
|
|
2261
2265
|
() => this.client.post("/api/v1/checkout", {
|
|
2262
2266
|
checkout_data: checkoutData
|
|
2263
2267
|
}),
|
|
@@ -2265,6 +2269,10 @@ var CheckoutService = class {
|
|
|
2265
2269
|
checkout_data: checkoutData
|
|
2266
2270
|
})
|
|
2267
2271
|
);
|
|
2272
|
+
if (result.ok && result.value.bill_token) {
|
|
2273
|
+
this.client.setOrderToken(result.value.order_id, result.value.bill_token);
|
|
2274
|
+
}
|
|
2275
|
+
return result;
|
|
2268
2276
|
}
|
|
2269
2277
|
async initializePayment(orderId, method) {
|
|
2270
2278
|
return safe3(
|
|
@@ -2282,15 +2290,17 @@ var CheckoutService = class {
|
|
|
2282
2290
|
}
|
|
2283
2291
|
async pollPaymentStatus(orderId) {
|
|
2284
2292
|
const encodedId = encodeURIComponent(orderId);
|
|
2293
|
+
const tokenParam = this.orderTokenParam(orderId);
|
|
2285
2294
|
return safeWithFallback3(
|
|
2286
|
-
() => this.client.get(`/api/v1/orders/${encodedId}/payment-status`),
|
|
2295
|
+
() => this.client.get(`/api/v1/orders/${encodedId}/payment-status${tokenParam}`),
|
|
2287
2296
|
() => this.client.call(PAYMENT_MUTATION.CHECK_STATUS, orderId)
|
|
2288
2297
|
);
|
|
2289
2298
|
}
|
|
2290
2299
|
async updateOrderCustomer(orderId, customer) {
|
|
2291
2300
|
const encodedId = encodeURIComponent(orderId);
|
|
2301
|
+
const tokenParam = this.orderTokenParam(orderId);
|
|
2292
2302
|
return safeWithFallback3(
|
|
2293
|
-
() => this.client.post(`/api/v1/orders/${encodedId}/customer`, customer),
|
|
2303
|
+
() => this.client.post(`/api/v1/orders/${encodedId}/customer${tokenParam}`, customer),
|
|
2294
2304
|
() => this.client.call(ORDER_MUTATION.UPDATE_CUSTOMER, {
|
|
2295
2305
|
order_id: orderId,
|
|
2296
2306
|
...customer
|
|
@@ -2433,6 +2443,10 @@ var OrderQueries = class {
|
|
|
2433
2443
|
constructor(client) {
|
|
2434
2444
|
this.client = client;
|
|
2435
2445
|
}
|
|
2446
|
+
orderTokenParam(orderId) {
|
|
2447
|
+
const token = this.client.getOrderToken(orderId);
|
|
2448
|
+
return token ? `?token=${encodeURIComponent(token)}` : "";
|
|
2449
|
+
}
|
|
2436
2450
|
async list(options) {
|
|
2437
2451
|
let query2 = "orders";
|
|
2438
2452
|
if (options?.status) {
|
|
@@ -2457,8 +2471,9 @@ var OrderQueries = class {
|
|
|
2457
2471
|
}
|
|
2458
2472
|
async get(orderId) {
|
|
2459
2473
|
const encodedId = encodeURIComponent(orderId);
|
|
2474
|
+
const tokenParam = this.orderTokenParam(orderId);
|
|
2460
2475
|
return safeWithFallback4(
|
|
2461
|
-
() => this.client.get(`/api/v1/orders/${encodedId}`),
|
|
2476
|
+
() => this.client.get(`/api/v1/orders/${encodedId}${tokenParam}`),
|
|
2462
2477
|
() => this.client.query(`orders.${orderId}`)
|
|
2463
2478
|
);
|
|
2464
2479
|
}
|
|
@@ -2470,8 +2485,9 @@ var OrderQueries = class {
|
|
|
2470
2485
|
}
|
|
2471
2486
|
async cancel(orderId, reason) {
|
|
2472
2487
|
const encodedId = encodeURIComponent(orderId);
|
|
2488
|
+
const tokenParam = this.orderTokenParam(orderId);
|
|
2473
2489
|
return safeWithFallback4(
|
|
2474
|
-
() => this.client.post(`/api/v1/orders/${encodedId}/cancel`, {
|
|
2490
|
+
() => this.client.post(`/api/v1/orders/${encodedId}/cancel${tokenParam}`, {
|
|
2475
2491
|
reason
|
|
2476
2492
|
}),
|
|
2477
2493
|
() => this.client.call("order.cancelOrder", {
|
|
@@ -3726,6 +3742,7 @@ function createElements(client, businessId, options) {
|
|
|
3726
3742
|
|
|
3727
3743
|
// src/client.ts
|
|
3728
3744
|
var ACCESS_TOKEN_STORAGE_KEY = "cimplify_access_token";
|
|
3745
|
+
var ORDER_TOKEN_PREFIX = "cimplify_ot_";
|
|
3729
3746
|
var DEFAULT_TIMEOUT_MS = 3e4;
|
|
3730
3747
|
var DEFAULT_MAX_RETRIES = 3;
|
|
3731
3748
|
var DEFAULT_RETRY_DELAY_MS = 1e3;
|
|
@@ -3867,7 +3884,29 @@ var CimplifyClient = class {
|
|
|
3867
3884
|
source: "clear"
|
|
3868
3885
|
});
|
|
3869
3886
|
}
|
|
3870
|
-
|
|
3887
|
+
setOrderToken(orderId, token) {
|
|
3888
|
+
if (typeof window !== "undefined" && window.localStorage) {
|
|
3889
|
+
localStorage.setItem(`${ORDER_TOKEN_PREFIX}${orderId}`, token);
|
|
3890
|
+
}
|
|
3891
|
+
}
|
|
3892
|
+
getOrderToken(orderId) {
|
|
3893
|
+
if (typeof window !== "undefined" && window.localStorage) {
|
|
3894
|
+
return localStorage.getItem(`${ORDER_TOKEN_PREFIX}${orderId}`);
|
|
3895
|
+
}
|
|
3896
|
+
return null;
|
|
3897
|
+
}
|
|
3898
|
+
clearOrderTokens() {
|
|
3899
|
+
if (typeof window !== "undefined" && window.localStorage) {
|
|
3900
|
+
const keysToRemove = [];
|
|
3901
|
+
for (let i = 0; i < localStorage.length; i++) {
|
|
3902
|
+
const key = localStorage.key(i);
|
|
3903
|
+
if (key?.startsWith(ORDER_TOKEN_PREFIX)) {
|
|
3904
|
+
keysToRemove.push(key);
|
|
3905
|
+
}
|
|
3906
|
+
}
|
|
3907
|
+
keysToRemove.forEach((k) => localStorage.removeItem(k));
|
|
3908
|
+
}
|
|
3909
|
+
}
|
|
3871
3910
|
setLocationId(locationId) {
|
|
3872
3911
|
if (locationId) {
|
|
3873
3912
|
this.context.location_id = locationId;
|
package/dist/index.mjs
CHANGED
|
@@ -2250,12 +2250,16 @@ var CheckoutService = class {
|
|
|
2250
2250
|
constructor(client) {
|
|
2251
2251
|
this.client = client;
|
|
2252
2252
|
}
|
|
2253
|
+
orderTokenParam(orderId) {
|
|
2254
|
+
const token = this.client.getOrderToken(orderId);
|
|
2255
|
+
return token ? `?token=${encodeURIComponent(token)}` : "";
|
|
2256
|
+
}
|
|
2253
2257
|
async process(data) {
|
|
2254
2258
|
const checkoutData = {
|
|
2255
2259
|
...data,
|
|
2256
2260
|
idempotency_key: data.idempotency_key || generateIdempotencyKey()
|
|
2257
2261
|
};
|
|
2258
|
-
|
|
2262
|
+
const result = await safeWithFallback3(
|
|
2259
2263
|
() => this.client.post("/api/v1/checkout", {
|
|
2260
2264
|
checkout_data: checkoutData
|
|
2261
2265
|
}),
|
|
@@ -2263,6 +2267,10 @@ var CheckoutService = class {
|
|
|
2263
2267
|
checkout_data: checkoutData
|
|
2264
2268
|
})
|
|
2265
2269
|
);
|
|
2270
|
+
if (result.ok && result.value.bill_token) {
|
|
2271
|
+
this.client.setOrderToken(result.value.order_id, result.value.bill_token);
|
|
2272
|
+
}
|
|
2273
|
+
return result;
|
|
2266
2274
|
}
|
|
2267
2275
|
async initializePayment(orderId, method) {
|
|
2268
2276
|
return safe3(
|
|
@@ -2280,15 +2288,17 @@ var CheckoutService = class {
|
|
|
2280
2288
|
}
|
|
2281
2289
|
async pollPaymentStatus(orderId) {
|
|
2282
2290
|
const encodedId = encodeURIComponent(orderId);
|
|
2291
|
+
const tokenParam = this.orderTokenParam(orderId);
|
|
2283
2292
|
return safeWithFallback3(
|
|
2284
|
-
() => this.client.get(`/api/v1/orders/${encodedId}/payment-status`),
|
|
2293
|
+
() => this.client.get(`/api/v1/orders/${encodedId}/payment-status${tokenParam}`),
|
|
2285
2294
|
() => this.client.call(PAYMENT_MUTATION.CHECK_STATUS, orderId)
|
|
2286
2295
|
);
|
|
2287
2296
|
}
|
|
2288
2297
|
async updateOrderCustomer(orderId, customer) {
|
|
2289
2298
|
const encodedId = encodeURIComponent(orderId);
|
|
2299
|
+
const tokenParam = this.orderTokenParam(orderId);
|
|
2290
2300
|
return safeWithFallback3(
|
|
2291
|
-
() => this.client.post(`/api/v1/orders/${encodedId}/customer`, customer),
|
|
2301
|
+
() => this.client.post(`/api/v1/orders/${encodedId}/customer${tokenParam}`, customer),
|
|
2292
2302
|
() => this.client.call(ORDER_MUTATION.UPDATE_CUSTOMER, {
|
|
2293
2303
|
order_id: orderId,
|
|
2294
2304
|
...customer
|
|
@@ -2431,6 +2441,10 @@ var OrderQueries = class {
|
|
|
2431
2441
|
constructor(client) {
|
|
2432
2442
|
this.client = client;
|
|
2433
2443
|
}
|
|
2444
|
+
orderTokenParam(orderId) {
|
|
2445
|
+
const token = this.client.getOrderToken(orderId);
|
|
2446
|
+
return token ? `?token=${encodeURIComponent(token)}` : "";
|
|
2447
|
+
}
|
|
2434
2448
|
async list(options) {
|
|
2435
2449
|
let query2 = "orders";
|
|
2436
2450
|
if (options?.status) {
|
|
@@ -2455,8 +2469,9 @@ var OrderQueries = class {
|
|
|
2455
2469
|
}
|
|
2456
2470
|
async get(orderId) {
|
|
2457
2471
|
const encodedId = encodeURIComponent(orderId);
|
|
2472
|
+
const tokenParam = this.orderTokenParam(orderId);
|
|
2458
2473
|
return safeWithFallback4(
|
|
2459
|
-
() => this.client.get(`/api/v1/orders/${encodedId}`),
|
|
2474
|
+
() => this.client.get(`/api/v1/orders/${encodedId}${tokenParam}`),
|
|
2460
2475
|
() => this.client.query(`orders.${orderId}`)
|
|
2461
2476
|
);
|
|
2462
2477
|
}
|
|
@@ -2468,8 +2483,9 @@ var OrderQueries = class {
|
|
|
2468
2483
|
}
|
|
2469
2484
|
async cancel(orderId, reason) {
|
|
2470
2485
|
const encodedId = encodeURIComponent(orderId);
|
|
2486
|
+
const tokenParam = this.orderTokenParam(orderId);
|
|
2471
2487
|
return safeWithFallback4(
|
|
2472
|
-
() => this.client.post(`/api/v1/orders/${encodedId}/cancel`, {
|
|
2488
|
+
() => this.client.post(`/api/v1/orders/${encodedId}/cancel${tokenParam}`, {
|
|
2473
2489
|
reason
|
|
2474
2490
|
}),
|
|
2475
2491
|
() => this.client.call("order.cancelOrder", {
|
|
@@ -3724,6 +3740,7 @@ function createElements(client, businessId, options) {
|
|
|
3724
3740
|
|
|
3725
3741
|
// src/client.ts
|
|
3726
3742
|
var ACCESS_TOKEN_STORAGE_KEY = "cimplify_access_token";
|
|
3743
|
+
var ORDER_TOKEN_PREFIX = "cimplify_ot_";
|
|
3727
3744
|
var DEFAULT_TIMEOUT_MS = 3e4;
|
|
3728
3745
|
var DEFAULT_MAX_RETRIES = 3;
|
|
3729
3746
|
var DEFAULT_RETRY_DELAY_MS = 1e3;
|
|
@@ -3865,7 +3882,29 @@ var CimplifyClient = class {
|
|
|
3865
3882
|
source: "clear"
|
|
3866
3883
|
});
|
|
3867
3884
|
}
|
|
3868
|
-
|
|
3885
|
+
setOrderToken(orderId, token) {
|
|
3886
|
+
if (typeof window !== "undefined" && window.localStorage) {
|
|
3887
|
+
localStorage.setItem(`${ORDER_TOKEN_PREFIX}${orderId}`, token);
|
|
3888
|
+
}
|
|
3889
|
+
}
|
|
3890
|
+
getOrderToken(orderId) {
|
|
3891
|
+
if (typeof window !== "undefined" && window.localStorage) {
|
|
3892
|
+
return localStorage.getItem(`${ORDER_TOKEN_PREFIX}${orderId}`);
|
|
3893
|
+
}
|
|
3894
|
+
return null;
|
|
3895
|
+
}
|
|
3896
|
+
clearOrderTokens() {
|
|
3897
|
+
if (typeof window !== "undefined" && window.localStorage) {
|
|
3898
|
+
const keysToRemove = [];
|
|
3899
|
+
for (let i = 0; i < localStorage.length; i++) {
|
|
3900
|
+
const key = localStorage.key(i);
|
|
3901
|
+
if (key?.startsWith(ORDER_TOKEN_PREFIX)) {
|
|
3902
|
+
keysToRemove.push(key);
|
|
3903
|
+
}
|
|
3904
|
+
}
|
|
3905
|
+
keysToRemove.forEach((k) => localStorage.removeItem(k));
|
|
3906
|
+
}
|
|
3907
|
+
}
|
|
3869
3908
|
setLocationId(locationId) {
|
|
3870
3909
|
if (locationId) {
|
|
3871
3910
|
this.context.location_id = locationId;
|
package/dist/react.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CimplifyClient, _ as ProcessCheckoutResult, a0 as CheckoutStatus, a1 as CheckoutStatusContext, bs as Location, bp as Business, aU as Order, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, P as PriceQuote, g as QuoteUiMessage, u as CimplifyElements, y as ElementsOptions, cR as AuthenticatedData, cN as AddressInfo, cO as PaymentMethodInfo, cT as ElementsCheckoutResult, Z as ProcessCheckoutOptions } from './client-
|
|
1
|
+
import { C as CimplifyClient, _ as ProcessCheckoutResult, a0 as CheckoutStatus, a1 as CheckoutStatusContext, bs as Location, bp as Business, aU as Order, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, P as PriceQuote, g as QuoteUiMessage, u as CimplifyElements, y as ElementsOptions, cR as AuthenticatedData, cN as AddressInfo, cO as PaymentMethodInfo, cT as ElementsCheckoutResult, Z as ProcessCheckoutOptions } from './client-4qOxssTq.mjs';
|
|
2
2
|
import React, { ReactNode } from 'react';
|
|
3
3
|
import { q as Product, d as Pagination, h as CimplifyError, r as ProductWithDetails, K as Category, aw as BundleSelectionInput, a7 as ComponentSelectionInput, N as Collection, X as BundleWithDetails, a3 as CompositeWithDetails, a8 as CompositePriceResult, C as CurrencyCode } from './payment-CLIWNMaP.mjs';
|
|
4
4
|
import { A as AdSlot, a as AdPosition, e as AdContextValue } from './ads-t3FBTU8p.mjs';
|
package/dist/react.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CimplifyClient, _ as ProcessCheckoutResult, a0 as CheckoutStatus, a1 as CheckoutStatusContext, bs as Location, bp as Business, aU as Order, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, P as PriceQuote, g as QuoteUiMessage, u as CimplifyElements, y as ElementsOptions, cR as AuthenticatedData, cN as AddressInfo, cO as PaymentMethodInfo, cT as ElementsCheckoutResult, Z as ProcessCheckoutOptions } from './client-
|
|
1
|
+
import { C as CimplifyClient, _ as ProcessCheckoutResult, a0 as CheckoutStatus, a1 as CheckoutStatusContext, bs as Location, bp as Business, aU as Order, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, P as PriceQuote, g as QuoteUiMessage, u as CimplifyElements, y as ElementsOptions, cR as AuthenticatedData, cN as AddressInfo, cO as PaymentMethodInfo, cT as ElementsCheckoutResult, Z as ProcessCheckoutOptions } from './client-Djde3IXh.js';
|
|
2
2
|
import React, { ReactNode } from 'react';
|
|
3
3
|
import { q as Product, d as Pagination, h as CimplifyError, r as ProductWithDetails, K as Category, aw as BundleSelectionInput, a7 as ComponentSelectionInput, N as Collection, X as BundleWithDetails, a3 as CompositeWithDetails, a8 as CompositePriceResult, C as CurrencyCode } from './payment-CLIWNMaP.js';
|
|
4
4
|
import { A as AdSlot, a as AdPosition, e as AdContextValue } from './ads-t3FBTU8p.js';
|
package/dist/react.js
CHANGED
|
@@ -2399,12 +2399,16 @@ var CheckoutService = class {
|
|
|
2399
2399
|
constructor(client) {
|
|
2400
2400
|
this.client = client;
|
|
2401
2401
|
}
|
|
2402
|
+
orderTokenParam(orderId) {
|
|
2403
|
+
const token = this.client.getOrderToken(orderId);
|
|
2404
|
+
return token ? `?token=${encodeURIComponent(token)}` : "";
|
|
2405
|
+
}
|
|
2402
2406
|
async process(data) {
|
|
2403
2407
|
const checkoutData = {
|
|
2404
2408
|
...data,
|
|
2405
2409
|
idempotency_key: data.idempotency_key || generateIdempotencyKey()
|
|
2406
2410
|
};
|
|
2407
|
-
|
|
2411
|
+
const result = await safeWithFallback3(
|
|
2408
2412
|
() => this.client.post("/api/v1/checkout", {
|
|
2409
2413
|
checkout_data: checkoutData
|
|
2410
2414
|
}),
|
|
@@ -2412,6 +2416,10 @@ var CheckoutService = class {
|
|
|
2412
2416
|
checkout_data: checkoutData
|
|
2413
2417
|
})
|
|
2414
2418
|
);
|
|
2419
|
+
if (result.ok && result.value.bill_token) {
|
|
2420
|
+
this.client.setOrderToken(result.value.order_id, result.value.bill_token);
|
|
2421
|
+
}
|
|
2422
|
+
return result;
|
|
2415
2423
|
}
|
|
2416
2424
|
async initializePayment(orderId, method) {
|
|
2417
2425
|
return safe3(
|
|
@@ -2429,15 +2437,17 @@ var CheckoutService = class {
|
|
|
2429
2437
|
}
|
|
2430
2438
|
async pollPaymentStatus(orderId) {
|
|
2431
2439
|
const encodedId = encodeURIComponent(orderId);
|
|
2440
|
+
const tokenParam = this.orderTokenParam(orderId);
|
|
2432
2441
|
return safeWithFallback3(
|
|
2433
|
-
() => this.client.get(`/api/v1/orders/${encodedId}/payment-status`),
|
|
2442
|
+
() => this.client.get(`/api/v1/orders/${encodedId}/payment-status${tokenParam}`),
|
|
2434
2443
|
() => this.client.call(PAYMENT_MUTATION.CHECK_STATUS, orderId)
|
|
2435
2444
|
);
|
|
2436
2445
|
}
|
|
2437
2446
|
async updateOrderCustomer(orderId, customer) {
|
|
2438
2447
|
const encodedId = encodeURIComponent(orderId);
|
|
2448
|
+
const tokenParam = this.orderTokenParam(orderId);
|
|
2439
2449
|
return safeWithFallback3(
|
|
2440
|
-
() => this.client.post(`/api/v1/orders/${encodedId}/customer`, customer),
|
|
2450
|
+
() => this.client.post(`/api/v1/orders/${encodedId}/customer${tokenParam}`, customer),
|
|
2441
2451
|
() => this.client.call(ORDER_MUTATION.UPDATE_CUSTOMER, {
|
|
2442
2452
|
order_id: orderId,
|
|
2443
2453
|
...customer
|
|
@@ -2580,6 +2590,10 @@ var OrderQueries = class {
|
|
|
2580
2590
|
constructor(client) {
|
|
2581
2591
|
this.client = client;
|
|
2582
2592
|
}
|
|
2593
|
+
orderTokenParam(orderId) {
|
|
2594
|
+
const token = this.client.getOrderToken(orderId);
|
|
2595
|
+
return token ? `?token=${encodeURIComponent(token)}` : "";
|
|
2596
|
+
}
|
|
2583
2597
|
async list(options) {
|
|
2584
2598
|
let query = "orders";
|
|
2585
2599
|
if (options?.status) {
|
|
@@ -2604,8 +2618,9 @@ var OrderQueries = class {
|
|
|
2604
2618
|
}
|
|
2605
2619
|
async get(orderId) {
|
|
2606
2620
|
const encodedId = encodeURIComponent(orderId);
|
|
2621
|
+
const tokenParam = this.orderTokenParam(orderId);
|
|
2607
2622
|
return safeWithFallback4(
|
|
2608
|
-
() => this.client.get(`/api/v1/orders/${encodedId}`),
|
|
2623
|
+
() => this.client.get(`/api/v1/orders/${encodedId}${tokenParam}`),
|
|
2609
2624
|
() => this.client.query(`orders.${orderId}`)
|
|
2610
2625
|
);
|
|
2611
2626
|
}
|
|
@@ -2617,8 +2632,9 @@ var OrderQueries = class {
|
|
|
2617
2632
|
}
|
|
2618
2633
|
async cancel(orderId, reason) {
|
|
2619
2634
|
const encodedId = encodeURIComponent(orderId);
|
|
2635
|
+
const tokenParam = this.orderTokenParam(orderId);
|
|
2620
2636
|
return safeWithFallback4(
|
|
2621
|
-
() => this.client.post(`/api/v1/orders/${encodedId}/cancel`, {
|
|
2637
|
+
() => this.client.post(`/api/v1/orders/${encodedId}/cancel${tokenParam}`, {
|
|
2622
2638
|
reason
|
|
2623
2639
|
}),
|
|
2624
2640
|
() => this.client.call("order.cancelOrder", {
|
|
@@ -3834,6 +3850,7 @@ function createElements(client, businessId, options) {
|
|
|
3834
3850
|
|
|
3835
3851
|
// src/client.ts
|
|
3836
3852
|
var ACCESS_TOKEN_STORAGE_KEY = "cimplify_access_token";
|
|
3853
|
+
var ORDER_TOKEN_PREFIX = "cimplify_ot_";
|
|
3837
3854
|
var DEFAULT_TIMEOUT_MS = 3e4;
|
|
3838
3855
|
var DEFAULT_MAX_RETRIES = 3;
|
|
3839
3856
|
var DEFAULT_RETRY_DELAY_MS = 1e3;
|
|
@@ -3975,7 +3992,29 @@ var CimplifyClient = class {
|
|
|
3975
3992
|
source: "clear"
|
|
3976
3993
|
});
|
|
3977
3994
|
}
|
|
3978
|
-
|
|
3995
|
+
setOrderToken(orderId, token) {
|
|
3996
|
+
if (typeof window !== "undefined" && window.localStorage) {
|
|
3997
|
+
localStorage.setItem(`${ORDER_TOKEN_PREFIX}${orderId}`, token);
|
|
3998
|
+
}
|
|
3999
|
+
}
|
|
4000
|
+
getOrderToken(orderId) {
|
|
4001
|
+
if (typeof window !== "undefined" && window.localStorage) {
|
|
4002
|
+
return localStorage.getItem(`${ORDER_TOKEN_PREFIX}${orderId}`);
|
|
4003
|
+
}
|
|
4004
|
+
return null;
|
|
4005
|
+
}
|
|
4006
|
+
clearOrderTokens() {
|
|
4007
|
+
if (typeof window !== "undefined" && window.localStorage) {
|
|
4008
|
+
const keysToRemove = [];
|
|
4009
|
+
for (let i = 0; i < localStorage.length; i++) {
|
|
4010
|
+
const key = localStorage.key(i);
|
|
4011
|
+
if (key?.startsWith(ORDER_TOKEN_PREFIX)) {
|
|
4012
|
+
keysToRemove.push(key);
|
|
4013
|
+
}
|
|
4014
|
+
}
|
|
4015
|
+
keysToRemove.forEach((k) => localStorage.removeItem(k));
|
|
4016
|
+
}
|
|
4017
|
+
}
|
|
3979
4018
|
setLocationId(locationId) {
|
|
3980
4019
|
if (locationId) {
|
|
3981
4020
|
this.context.location_id = locationId;
|
package/dist/react.mjs
CHANGED
|
@@ -2397,12 +2397,16 @@ var CheckoutService = class {
|
|
|
2397
2397
|
constructor(client) {
|
|
2398
2398
|
this.client = client;
|
|
2399
2399
|
}
|
|
2400
|
+
orderTokenParam(orderId) {
|
|
2401
|
+
const token = this.client.getOrderToken(orderId);
|
|
2402
|
+
return token ? `?token=${encodeURIComponent(token)}` : "";
|
|
2403
|
+
}
|
|
2400
2404
|
async process(data) {
|
|
2401
2405
|
const checkoutData = {
|
|
2402
2406
|
...data,
|
|
2403
2407
|
idempotency_key: data.idempotency_key || generateIdempotencyKey()
|
|
2404
2408
|
};
|
|
2405
|
-
|
|
2409
|
+
const result = await safeWithFallback3(
|
|
2406
2410
|
() => this.client.post("/api/v1/checkout", {
|
|
2407
2411
|
checkout_data: checkoutData
|
|
2408
2412
|
}),
|
|
@@ -2410,6 +2414,10 @@ var CheckoutService = class {
|
|
|
2410
2414
|
checkout_data: checkoutData
|
|
2411
2415
|
})
|
|
2412
2416
|
);
|
|
2417
|
+
if (result.ok && result.value.bill_token) {
|
|
2418
|
+
this.client.setOrderToken(result.value.order_id, result.value.bill_token);
|
|
2419
|
+
}
|
|
2420
|
+
return result;
|
|
2413
2421
|
}
|
|
2414
2422
|
async initializePayment(orderId, method) {
|
|
2415
2423
|
return safe3(
|
|
@@ -2427,15 +2435,17 @@ var CheckoutService = class {
|
|
|
2427
2435
|
}
|
|
2428
2436
|
async pollPaymentStatus(orderId) {
|
|
2429
2437
|
const encodedId = encodeURIComponent(orderId);
|
|
2438
|
+
const tokenParam = this.orderTokenParam(orderId);
|
|
2430
2439
|
return safeWithFallback3(
|
|
2431
|
-
() => this.client.get(`/api/v1/orders/${encodedId}/payment-status`),
|
|
2440
|
+
() => this.client.get(`/api/v1/orders/${encodedId}/payment-status${tokenParam}`),
|
|
2432
2441
|
() => this.client.call(PAYMENT_MUTATION.CHECK_STATUS, orderId)
|
|
2433
2442
|
);
|
|
2434
2443
|
}
|
|
2435
2444
|
async updateOrderCustomer(orderId, customer) {
|
|
2436
2445
|
const encodedId = encodeURIComponent(orderId);
|
|
2446
|
+
const tokenParam = this.orderTokenParam(orderId);
|
|
2437
2447
|
return safeWithFallback3(
|
|
2438
|
-
() => this.client.post(`/api/v1/orders/${encodedId}/customer`, customer),
|
|
2448
|
+
() => this.client.post(`/api/v1/orders/${encodedId}/customer${tokenParam}`, customer),
|
|
2439
2449
|
() => this.client.call(ORDER_MUTATION.UPDATE_CUSTOMER, {
|
|
2440
2450
|
order_id: orderId,
|
|
2441
2451
|
...customer
|
|
@@ -2578,6 +2588,10 @@ var OrderQueries = class {
|
|
|
2578
2588
|
constructor(client) {
|
|
2579
2589
|
this.client = client;
|
|
2580
2590
|
}
|
|
2591
|
+
orderTokenParam(orderId) {
|
|
2592
|
+
const token = this.client.getOrderToken(orderId);
|
|
2593
|
+
return token ? `?token=${encodeURIComponent(token)}` : "";
|
|
2594
|
+
}
|
|
2581
2595
|
async list(options) {
|
|
2582
2596
|
let query = "orders";
|
|
2583
2597
|
if (options?.status) {
|
|
@@ -2602,8 +2616,9 @@ var OrderQueries = class {
|
|
|
2602
2616
|
}
|
|
2603
2617
|
async get(orderId) {
|
|
2604
2618
|
const encodedId = encodeURIComponent(orderId);
|
|
2619
|
+
const tokenParam = this.orderTokenParam(orderId);
|
|
2605
2620
|
return safeWithFallback4(
|
|
2606
|
-
() => this.client.get(`/api/v1/orders/${encodedId}`),
|
|
2621
|
+
() => this.client.get(`/api/v1/orders/${encodedId}${tokenParam}`),
|
|
2607
2622
|
() => this.client.query(`orders.${orderId}`)
|
|
2608
2623
|
);
|
|
2609
2624
|
}
|
|
@@ -2615,8 +2630,9 @@ var OrderQueries = class {
|
|
|
2615
2630
|
}
|
|
2616
2631
|
async cancel(orderId, reason) {
|
|
2617
2632
|
const encodedId = encodeURIComponent(orderId);
|
|
2633
|
+
const tokenParam = this.orderTokenParam(orderId);
|
|
2618
2634
|
return safeWithFallback4(
|
|
2619
|
-
() => this.client.post(`/api/v1/orders/${encodedId}/cancel`, {
|
|
2635
|
+
() => this.client.post(`/api/v1/orders/${encodedId}/cancel${tokenParam}`, {
|
|
2620
2636
|
reason
|
|
2621
2637
|
}),
|
|
2622
2638
|
() => this.client.call("order.cancelOrder", {
|
|
@@ -3832,6 +3848,7 @@ function createElements(client, businessId, options) {
|
|
|
3832
3848
|
|
|
3833
3849
|
// src/client.ts
|
|
3834
3850
|
var ACCESS_TOKEN_STORAGE_KEY = "cimplify_access_token";
|
|
3851
|
+
var ORDER_TOKEN_PREFIX = "cimplify_ot_";
|
|
3835
3852
|
var DEFAULT_TIMEOUT_MS = 3e4;
|
|
3836
3853
|
var DEFAULT_MAX_RETRIES = 3;
|
|
3837
3854
|
var DEFAULT_RETRY_DELAY_MS = 1e3;
|
|
@@ -3973,7 +3990,29 @@ var CimplifyClient = class {
|
|
|
3973
3990
|
source: "clear"
|
|
3974
3991
|
});
|
|
3975
3992
|
}
|
|
3976
|
-
|
|
3993
|
+
setOrderToken(orderId, token) {
|
|
3994
|
+
if (typeof window !== "undefined" && window.localStorage) {
|
|
3995
|
+
localStorage.setItem(`${ORDER_TOKEN_PREFIX}${orderId}`, token);
|
|
3996
|
+
}
|
|
3997
|
+
}
|
|
3998
|
+
getOrderToken(orderId) {
|
|
3999
|
+
if (typeof window !== "undefined" && window.localStorage) {
|
|
4000
|
+
return localStorage.getItem(`${ORDER_TOKEN_PREFIX}${orderId}`);
|
|
4001
|
+
}
|
|
4002
|
+
return null;
|
|
4003
|
+
}
|
|
4004
|
+
clearOrderTokens() {
|
|
4005
|
+
if (typeof window !== "undefined" && window.localStorage) {
|
|
4006
|
+
const keysToRemove = [];
|
|
4007
|
+
for (let i = 0; i < localStorage.length; i++) {
|
|
4008
|
+
const key = localStorage.key(i);
|
|
4009
|
+
if (key?.startsWith(ORDER_TOKEN_PREFIX)) {
|
|
4010
|
+
keysToRemove.push(key);
|
|
4011
|
+
}
|
|
4012
|
+
}
|
|
4013
|
+
keysToRemove.forEach((k) => localStorage.removeItem(k));
|
|
4014
|
+
}
|
|
4015
|
+
}
|
|
3977
4016
|
setLocationId(locationId) {
|
|
3978
4017
|
if (locationId) {
|
|
3979
4018
|
this.context.location_id = locationId;
|