@cimplify/sdk 0.100.0 → 0.100.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 +3 -3
- package/dist/advanced.d.ts +3 -3
- package/dist/advanced.js +22 -22
- package/dist/advanced.mjs +3 -3
- package/dist/{chunk-X6G6QERR.js → chunk-6JEKKL3M.js} +53 -38
- package/dist/{chunk-7TEMLVDT.mjs → chunk-B2YOCOLH.mjs} +2 -2
- package/dist/{chunk-V5TU5JKA.mjs → chunk-DLW3RWRK.mjs} +30 -6
- package/dist/{chunk-FECGCIVV.js → chunk-IFAQLFAJ.js} +4 -4
- package/dist/{chunk-J3UYIBKH.js → chunk-IJI7KMTG.js} +89 -82
- package/dist/{chunk-AETVRBKI.js → chunk-NIOUSKQQ.js} +1 -0
- package/dist/{chunk-K5EN2W2Q.mjs → chunk-O3YUHLZL.mjs} +1 -0
- package/dist/{chunk-GWKIDFN6.mjs → chunk-PJUXAUM2.mjs} +20 -14
- package/dist/{chunk-ZA5VKVUB.js → chunk-QRBBSIAY.js} +4 -4
- package/dist/{chunk-OX5L6XE7.mjs → chunk-TIQLOH2B.mjs} +30 -15
- package/dist/{chunk-64EDCDBR.js → chunk-WMEC5JWN.js} +32 -7
- package/dist/{chunk-I7L4VRHI.mjs → chunk-YWNJJO2U.mjs} +2 -2
- package/dist/{client-DQpvwf-p.d.mts → client-C6wb92AD.d.mts} +2 -2
- package/dist/{client-DmR3Z6pQ.d.ts → client-CgXkRu2o.d.ts} +2 -2
- package/dist/{client-C1vS5pf0.d.ts → client-D8XcrONA.d.mts} +38 -26
- package/dist/{client-B5MeD8da.d.mts → client-LPg_AUUr.d.ts} +38 -26
- package/dist/{index-Br-vFygC.d.ts → index-B_RYmvlF.d.ts} +3 -3
- package/dist/{index-DUOCn1Cs.d.mts → index-D-LUYk1Y.d.mts} +3 -3
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +117 -117
- package/dist/index.mjs +5 -5
- package/dist/mock/cli.mjs +1 -1
- package/dist/mock/library.js +1 -1
- package/dist/mock/library.mjs +1 -1
- package/dist/mock/msw.js +1 -1
- package/dist/mock/msw.mjs +1 -1
- package/dist/{payment-BIpS9oPG.d.mts → payment-BSzy7sly.d.mts} +1 -1
- package/dist/{payment-CsuBKHqg.d.ts → payment-jK8ztICx.d.ts} +1 -1
- package/dist/{price-Ml_uPoiY.d.ts → price-CJLfcYKd.d.ts} +1 -1
- package/dist/{price-IOOoVYS-.d.mts → price-D96h6c6L.d.mts} +1 -1
- package/dist/{product-BKV6TBj_.d.ts → product-CeV8euw4.d.mts} +23 -11
- package/dist/{product-BKV6TBj_.d.mts → product-CeV8euw4.d.ts} +23 -11
- package/dist/react.d.mts +10 -5
- package/dist/react.d.ts +10 -5
- package/dist/react.js +856 -450
- package/dist/react.mjs +737 -331
- package/dist/{server-C0iEk55_.d.mts → server--RyVAfPN.d.mts} +1 -1
- package/dist/{server-CfpYhSV_.d.ts → server-CNyy47HL.d.ts} +1 -1
- package/dist/server.d.mts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +10 -10
- package/dist/server.mjs +4 -4
- package/dist/testing/msw.d.mts +2 -2
- package/dist/testing/msw.d.ts +2 -2
- package/dist/testing/msw.js +3 -3
- package/dist/testing/msw.mjs +2 -2
- package/dist/testing/suite.d.mts +6 -6
- package/dist/testing/suite.d.ts +6 -6
- package/dist/testing/suite.js +25 -25
- package/dist/testing/suite.mjs +6 -6
- package/dist/testing.d.mts +5 -5
- package/dist/testing.d.ts +5 -5
- package/dist/testing.js +81 -81
- package/dist/testing.mjs +7 -7
- package/dist/utils.d.mts +4 -4
- package/dist/utils.d.ts +4 -4
- package/dist/utils.js +29 -29
- package/dist/utils.mjs +2 -2
- package/package.json +1 -1
- package/registry/cart-summary.json +1 -1
- package/registry/product-customizer.json +1 -1
- package/registry/sale-badge.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isPaymentStatusRequiresAction, normalizeStatusResponse, isPaymentStatusSuccess, isPaymentStatusFailure } from './chunk-
|
|
2
|
-
import { CimplifyError, ErrorCode, currencyCode, enrichError, getErrorHint } from './chunk-
|
|
1
|
+
import { isPaymentStatusRequiresAction, normalizeStatusResponse, isPaymentStatusSuccess, isPaymentStatusFailure } from './chunk-DLW3RWRK.mjs';
|
|
2
|
+
import { CimplifyError, ErrorCode, currencyCode, enrichError, getErrorHint } from './chunk-O3YUHLZL.mjs';
|
|
3
3
|
|
|
4
4
|
// src/types/result.ts
|
|
5
5
|
function ok(value) {
|
|
@@ -284,7 +284,9 @@ var CatalogueQueries = class {
|
|
|
284
284
|
this.client = client;
|
|
285
285
|
}
|
|
286
286
|
async getCatalogue(opts) {
|
|
287
|
-
const result = await safe(
|
|
287
|
+
const result = await safe(
|
|
288
|
+
this.client.get("/api/v1/catalogue", opts)
|
|
289
|
+
);
|
|
288
290
|
if (!result.ok) return result;
|
|
289
291
|
return ok(normalizeCatalogueSnapshot(result.value));
|
|
290
292
|
}
|
|
@@ -312,7 +314,9 @@ var CatalogueQueries = class {
|
|
|
312
314
|
}
|
|
313
315
|
async getProduct(id, opts) {
|
|
314
316
|
const encodedId = encodeURIComponent(id);
|
|
315
|
-
const result = await safe(
|
|
317
|
+
const result = await safe(
|
|
318
|
+
this.client.get(`/api/v1/catalogue/products/${encodedId}`, opts)
|
|
319
|
+
);
|
|
316
320
|
if (!result.ok) return result;
|
|
317
321
|
const payload = result.value;
|
|
318
322
|
const rawProduct = isRecord(payload.item) ? payload.item : payload;
|
|
@@ -334,11 +338,15 @@ var CatalogueQueries = class {
|
|
|
334
338
|
}
|
|
335
339
|
async getVariants(productId) {
|
|
336
340
|
const encodedId = encodeURIComponent(productId);
|
|
337
|
-
return safe(
|
|
341
|
+
return safe(
|
|
342
|
+
this.client.get(`/api/v1/catalogue/products/${encodedId}/variants`)
|
|
343
|
+
);
|
|
338
344
|
}
|
|
339
345
|
async getVariantAxes(productId) {
|
|
340
346
|
const encodedId = encodeURIComponent(productId);
|
|
341
|
-
return safe(
|
|
347
|
+
return safe(
|
|
348
|
+
this.client.get(`/api/v1/catalogue/products/${encodedId}/variant-axes`)
|
|
349
|
+
);
|
|
342
350
|
}
|
|
343
351
|
async getVariantByAxisSelections(productId, selections) {
|
|
344
352
|
const encodedId = encodeURIComponent(productId);
|
|
@@ -469,7 +477,9 @@ var CatalogueQueries = class {
|
|
|
469
477
|
}
|
|
470
478
|
async getTaxonomyPath(id) {
|
|
471
479
|
const encodedId = encodeURIComponent(id);
|
|
472
|
-
return safe(
|
|
480
|
+
return safe(
|
|
481
|
+
this.client.get(`/api/v1/catalogue/taxonomies/${encodedId}/path`)
|
|
482
|
+
);
|
|
473
483
|
}
|
|
474
484
|
async searchTaxonomies(query, limit) {
|
|
475
485
|
const path = withQuery("/api/v1/catalogue/taxonomies/search", { q: query, limit });
|
|
@@ -486,11 +496,15 @@ var CatalogueQueries = class {
|
|
|
486
496
|
}
|
|
487
497
|
async getProductSchedules(productId) {
|
|
488
498
|
const encodedId = encodeURIComponent(productId);
|
|
489
|
-
return safe(
|
|
499
|
+
return safe(
|
|
500
|
+
this.client.get(`/api/v1/catalogue/products/${encodedId}/schedules`)
|
|
501
|
+
);
|
|
490
502
|
}
|
|
491
503
|
async checkProductAvailableNow(productId, locationId) {
|
|
492
504
|
const encodedId = encodeURIComponent(productId);
|
|
493
|
-
const path = withQuery(`/api/v1/catalogue/products/${encodedId}/available-now`, {
|
|
505
|
+
const path = withQuery(`/api/v1/catalogue/products/${encodedId}/available-now`, {
|
|
506
|
+
location_id: locationId
|
|
507
|
+
});
|
|
494
508
|
return safe(this.client.get(path));
|
|
495
509
|
}
|
|
496
510
|
async getDeals(locationId) {
|
|
@@ -570,9 +584,7 @@ var CatalogueQueries = class {
|
|
|
570
584
|
async getProductAttributes(productId) {
|
|
571
585
|
const encodedId = encodeURIComponent(productId);
|
|
572
586
|
return safe(
|
|
573
|
-
this.client.get(
|
|
574
|
-
`/api/v1/catalogue/products/${encodedId}/attributes`
|
|
575
|
-
)
|
|
587
|
+
this.client.get(`/api/v1/catalogue/products/${encodedId}/attributes`)
|
|
576
588
|
);
|
|
577
589
|
}
|
|
578
590
|
async getCategoryAttributes(categoryId) {
|
|
@@ -614,9 +626,7 @@ var CatalogueQueries = class {
|
|
|
614
626
|
return safe(this.client.get(path));
|
|
615
627
|
}
|
|
616
628
|
async getKnowledgeArticles() {
|
|
617
|
-
return safe(
|
|
618
|
-
this.client.get("/api/v1/catalogue/knowledge-base/articles")
|
|
619
|
-
);
|
|
629
|
+
return safe(this.client.get("/api/v1/catalogue/knowledge-base/articles"));
|
|
620
630
|
}
|
|
621
631
|
};
|
|
622
632
|
|
|
@@ -2767,6 +2777,7 @@ var KNOWN_IFRAME_TYPES = /* @__PURE__ */ new Set([
|
|
|
2767
2777
|
MESSAGE_TYPES.READY,
|
|
2768
2778
|
MESSAGE_TYPES.HEIGHT_CHANGE,
|
|
2769
2779
|
MESSAGE_TYPES.AUTH_REQUESTED,
|
|
2780
|
+
MESSAGE_TYPES.SESSION_ESTABLISHED,
|
|
2770
2781
|
MESSAGE_TYPES.ERROR,
|
|
2771
2782
|
MESSAGE_TYPES.ADDRESS_CHANGED,
|
|
2772
2783
|
MESSAGE_TYPES.ADDRESS_SELECTED,
|
|
@@ -2799,6 +2810,10 @@ function parseIframeMessage(data) {
|
|
|
2799
2810
|
return null;
|
|
2800
2811
|
}
|
|
2801
2812
|
break;
|
|
2813
|
+
case MESSAGE_TYPES.SESSION_ESTABLISHED:
|
|
2814
|
+
if (typeof record.accessToken !== "string" || !record.accessToken.trim()) return null;
|
|
2815
|
+
if (record.refreshToken !== void 0 && typeof record.refreshToken !== "string") return null;
|
|
2816
|
+
break;
|
|
2802
2817
|
case MESSAGE_TYPES.ADDRESS_CHANGED:
|
|
2803
2818
|
case MESSAGE_TYPES.ADDRESS_SELECTED:
|
|
2804
2819
|
if (!record.address || typeof record.address !== "object") return null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkNIOUSKQQ_js = require('./chunk-NIOUSKQQ.js');
|
|
4
4
|
|
|
5
5
|
// src/utils/price.ts
|
|
6
6
|
var CURRENCY_SYMBOLS = {
|
|
@@ -17,6 +17,7 @@ var CURRENCY_SYMBOLS = {
|
|
|
17
17
|
SGD: "S$",
|
|
18
18
|
INR: "\u20B9",
|
|
19
19
|
BRL: "R$",
|
|
20
|
+
COP: "COL$",
|
|
20
21
|
MXN: "MX$",
|
|
21
22
|
KRW: "\u20A9",
|
|
22
23
|
RUB: "\u20BD",
|
|
@@ -145,6 +146,20 @@ function parsePrice(value) {
|
|
|
145
146
|
const parsed = parseFloat(cleaned);
|
|
146
147
|
return isNaN(parsed) ? 0 : parsed;
|
|
147
148
|
}
|
|
149
|
+
function getVariantUnitPrice(product, variant) {
|
|
150
|
+
if (variant?.price_info) {
|
|
151
|
+
return parsePrice(variant.price_info.final_price);
|
|
152
|
+
}
|
|
153
|
+
const defaultPrice = parsePrice(product.default_price);
|
|
154
|
+
if (!variant) {
|
|
155
|
+
return defaultPrice;
|
|
156
|
+
}
|
|
157
|
+
const defaultVariant = product.variants?.find((candidate) => candidate.is_default);
|
|
158
|
+
if (!defaultVariant) {
|
|
159
|
+
return variant.is_default ? defaultPrice : defaultPrice + parsePrice(variant.price_adjustment);
|
|
160
|
+
}
|
|
161
|
+
return defaultPrice - parsePrice(defaultVariant.price_adjustment) + parsePrice(variant.price_adjustment);
|
|
162
|
+
}
|
|
148
163
|
function hasTaxInfo(priceInfo) {
|
|
149
164
|
return priceInfo.tax_info !== void 0 && priceInfo.tax_info !== null;
|
|
150
165
|
}
|
|
@@ -165,6 +180,9 @@ function formatPriceWithTax(priceInfo, currency = "GHS") {
|
|
|
165
180
|
return `${finalPrice} + ${formatPrice(getTaxAmount(priceInfo), currency)} tax`;
|
|
166
181
|
}
|
|
167
182
|
function getDisplayPrice(product) {
|
|
183
|
+
if (product.sale) {
|
|
184
|
+
return parsePrice(product.sale.price);
|
|
185
|
+
}
|
|
168
186
|
if (product.price_info) {
|
|
169
187
|
return parsePrice(product.price_info.final_price);
|
|
170
188
|
}
|
|
@@ -177,6 +195,9 @@ function getDisplayPrice(product) {
|
|
|
177
195
|
return 0;
|
|
178
196
|
}
|
|
179
197
|
function getBasePrice(product) {
|
|
198
|
+
if (product.sale) {
|
|
199
|
+
return parsePrice(product.sale.original);
|
|
200
|
+
}
|
|
180
201
|
if (product.price_info) {
|
|
181
202
|
return parsePrice(product.price_info.base_price);
|
|
182
203
|
}
|
|
@@ -189,11 +210,17 @@ function getBasePrice(product) {
|
|
|
189
210
|
return 0;
|
|
190
211
|
}
|
|
191
212
|
function isOnSale(product) {
|
|
213
|
+
if (product.sale) {
|
|
214
|
+
return true;
|
|
215
|
+
}
|
|
192
216
|
const basePrice = getBasePrice(product);
|
|
193
217
|
const finalPrice = getDisplayPrice(product);
|
|
194
218
|
return basePrice > finalPrice && basePrice > 0;
|
|
195
219
|
}
|
|
196
220
|
function getDiscountPercentage(product) {
|
|
221
|
+
if (product.sale) {
|
|
222
|
+
return parsePrice(product.sale.percent_off);
|
|
223
|
+
}
|
|
197
224
|
const basePrice = getBasePrice(product);
|
|
198
225
|
const finalPrice = getDisplayPrice(product);
|
|
199
226
|
if (basePrice > finalPrice && basePrice > 0) {
|
|
@@ -243,10 +270,7 @@ function getPriceRange(product) {
|
|
|
243
270
|
}
|
|
244
271
|
const variants = product.variants;
|
|
245
272
|
if (variants && variants.length > 1) {
|
|
246
|
-
const
|
|
247
|
-
const prices = variants.map(
|
|
248
|
-
(v) => base + parsePrice(v.price_adjustment ?? 0)
|
|
249
|
-
);
|
|
273
|
+
const prices = variants.map((variant) => getVariantUnitPrice(product, variant));
|
|
250
274
|
return { min: Math.min(...prices), max: Math.max(...prices) };
|
|
251
275
|
}
|
|
252
276
|
return null;
|
|
@@ -443,14 +467,14 @@ function normalizeStatusResponse(response) {
|
|
|
443
467
|
return {
|
|
444
468
|
status: "pending",
|
|
445
469
|
paid: false,
|
|
446
|
-
amount:
|
|
470
|
+
amount: chunkNIOUSKQQ_js.moneyFromNumber(0),
|
|
447
471
|
currency: "",
|
|
448
472
|
message: "No status available"
|
|
449
473
|
};
|
|
450
474
|
}
|
|
451
475
|
const res = response;
|
|
452
476
|
const normalizedStatus = normalizePaymentStatusValue(res.status ?? void 0);
|
|
453
|
-
const normalizedAmount = typeof res.amount === "string" ?
|
|
477
|
+
const normalizedAmount = typeof res.amount === "string" ? chunkNIOUSKQQ_js.money(res.amount) : typeof res.amount === "number" && Number.isFinite(res.amount) ? chunkNIOUSKQQ_js.moneyFromNumber(res.amount) : chunkNIOUSKQQ_js.moneyFromNumber(0);
|
|
454
478
|
const normalizedCurrency = typeof res.currency === "string" && res.currency.trim().length > 0 ? res.currency : "";
|
|
455
479
|
const paidValue = res.paid === true;
|
|
456
480
|
const derivedPaid = paidValue || PAYMENT_SUCCESS_STATUSES.has(normalizedStatus);
|
|
@@ -500,6 +524,7 @@ exports.getPriceRange = getPriceRange;
|
|
|
500
524
|
exports.getProductCurrency = getProductCurrency;
|
|
501
525
|
exports.getTaxAmount = getTaxAmount;
|
|
502
526
|
exports.getUnitPriceAtQuantity = getUnitPriceAtQuantity;
|
|
527
|
+
exports.getVariantUnitPrice = getVariantUnitPrice;
|
|
503
528
|
exports.hasTaxInfo = hasTaxInfo;
|
|
504
529
|
exports.isOnSale = isOnSale;
|
|
505
530
|
exports.isPaymentStatusFailure = isPaymentStatusFailure;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createMockApp } from './chunk-
|
|
2
|
-
import { createCimplifyClient } from './chunk-
|
|
1
|
+
import { createMockApp } from './chunk-B2YOCOLH.mjs';
|
|
2
|
+
import { createCimplifyClient } from './chunk-PJUXAUM2.mjs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
var cimplifyRegistry = z.registry();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { af as CimplifyClient } from './client-
|
|
2
|
-
import { A as AppHandle, C as CreateAppOptions } from './server
|
|
1
|
+
import { af as CimplifyClient } from './client-D8XcrONA.mjs';
|
|
2
|
+
import { A as AppHandle, C as CreateAppOptions } from './server--RyVAfPN.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Test client + fixtures.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { af as CimplifyClient } from './client-
|
|
2
|
-
import { A as AppHandle, C as CreateAppOptions } from './server-
|
|
1
|
+
import { af as CimplifyClient } from './client-LPg_AUUr.js';
|
|
2
|
+
import { A as AppHandle, C as CreateAppOptions } from './server-CNyy47HL.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Test client + fixtures.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { V as CimplifyError, S as Category, aZ as Product, f as AddOnWithOptions, aQ as Pagination, bb as ProductWithDetails, b9 as ProductVariant, bF as VariantAxis, bG as VariantAxisSelection, A as AddOn, W as Collection, G as BundleSummary, u as Bundle, a3 as Composite, a1 as ComponentSelectionInput, a8 as CompositePriceResult, U as ChosenPrice, b6 as ProductTaxonomy, bx as TaxonomyWithChildren, ax as EligiblePlansQuery, b1 as ProductBillingPlan, b7 as ProductTimeProfile, b0 as ProductAvailabilityNow, aj as Deal, b2 as ProductDealInfo, ap as DiscountValidation, bu as TagsResponse, ae as CustomAttributeDefinition, af as CustomAttributeValue, bc as PropertyFacet, bw as TaxonomyAttributeTemplate, aJ as KnowledgeArticle, by as UICart, L as CartItem, Q as CartSummary, g as AddToCartInput, N as CartMutationResult, bE as UpdateCartItemInput, ao as DiscountDetails, aO as Money,
|
|
2
|
-
import { a as AuthorizationType, c as PaymentMethod, I as InitializePaymentResult, S as SubmitAuthorizationInput, i as PaymentStatusResponse } from './payment-
|
|
1
|
+
import { V as CimplifyError, S as Category, aZ as Product, f as AddOnWithOptions, aQ as Pagination, bb as ProductWithDetails, b9 as ProductVariant, bF as VariantAxis, bG as VariantAxisSelection, A as AddOn, W as Collection, G as BundleSummary, u as Bundle, a3 as Composite, a1 as ComponentSelectionInput, a8 as CompositePriceResult, ad as CurrencyCode, U as ChosenPrice, bi as SaleInfo, b6 as ProductTaxonomy, bx as TaxonomyWithChildren, ax as EligiblePlansQuery, b1 as ProductBillingPlan, b7 as ProductTimeProfile, b0 as ProductAvailabilityNow, aj as Deal, b2 as ProductDealInfo, ap as DiscountValidation, bu as TagsResponse, ae as CustomAttributeDefinition, af as CustomAttributeValue, bc as PropertyFacet, bw as TaxonomyAttributeTemplate, aJ as KnowledgeArticle, by as UICart, L as CartItem, Q as CartSummary, g as AddToCartInput, N as CartMutationResult, bE as UpdateCartItemInput, ao as DiscountDetails, aO as Money, aK as LineConfiguration, bL as VariantDetails, bM as VariantDetailsDTO, a as AddOnDetails, d as AddOnOptionDetails, b as AddOnGroupDetails, D as BundleSelectionData, aa as CompositeSelectionData, ag as CustomerInputValue, bS as components, bk as SchedulingMode, av as DurationUnit, bo as Subscription, bs as SubscriptionWithDetails } from './product-CeV8euw4.mjs';
|
|
2
|
+
import { a as AuthorizationType, c as PaymentMethod, I as InitializePaymentResult, S as SubmitAuthorizationInput, i as PaymentStatusResponse } from './payment-BSzy7sly.mjs';
|
|
3
3
|
|
|
4
4
|
interface RequestContext {
|
|
5
5
|
method: "GET" | "POST" | "PATCH" | "DELETE";
|
|
@@ -221,31 +221,32 @@ interface PriceQuote {
|
|
|
221
221
|
quote_id: string;
|
|
222
222
|
business_id: string;
|
|
223
223
|
product_id: string;
|
|
224
|
-
variant_id?: string;
|
|
225
|
-
location_id?: string;
|
|
224
|
+
variant_id?: string | null;
|
|
225
|
+
location_id?: string | null;
|
|
226
226
|
source: RequestSource;
|
|
227
|
-
customer_id?: string;
|
|
228
|
-
customer_segment_id?: string;
|
|
229
|
-
storefront_id?: string;
|
|
230
|
-
attribution_id?: string;
|
|
227
|
+
customer_id?: string | null;
|
|
228
|
+
customer_segment_id?: string | null;
|
|
229
|
+
storefront_id?: string | null;
|
|
230
|
+
attribution_id?: string | null;
|
|
231
231
|
quantity: number;
|
|
232
|
-
currency?:
|
|
233
|
-
snapshot_id?: string;
|
|
234
|
-
snapshot_markup_version?: string;
|
|
235
|
-
snapshot_tax_version?: string;
|
|
232
|
+
currency?: CurrencyCode | null;
|
|
233
|
+
snapshot_id?: string | null;
|
|
234
|
+
snapshot_markup_version?: string | null;
|
|
235
|
+
snapshot_tax_version?: string | null;
|
|
236
236
|
item_price_info: ChosenPrice;
|
|
237
|
-
variant_price_info?: ChosenPrice;
|
|
237
|
+
variant_price_info?: ChosenPrice | null;
|
|
238
238
|
final_price_info: ChosenPrice;
|
|
239
|
+
sale?: SaleInfo | null;
|
|
239
240
|
add_on_option_ids: string[];
|
|
240
241
|
bundle_selections?: QuoteBundleSelectionInput[];
|
|
241
|
-
add_ons_price_info?: ChosenPrice;
|
|
242
|
-
quoted_total_price_info?: ChosenPrice;
|
|
242
|
+
add_ons_price_info?: ChosenPrice | null;
|
|
243
|
+
quoted_total_price_info?: ChosenPrice | null;
|
|
243
244
|
composite_selections?: QuoteCompositeSelectionInput[];
|
|
244
245
|
dynamic_buckets: QuoteDynamicBuckets;
|
|
245
246
|
ui_messages: QuoteUiMessage[];
|
|
246
247
|
created_at: string;
|
|
247
248
|
expires_at: string;
|
|
248
|
-
next_change_at?: string;
|
|
249
|
+
next_change_at?: string | null;
|
|
249
250
|
status: QuoteStatus;
|
|
250
251
|
}
|
|
251
252
|
interface RefreshQuoteResult {
|
|
@@ -732,19 +733,19 @@ interface LocationBooking {
|
|
|
732
733
|
assigned_resources: string[];
|
|
733
734
|
service_status: ServiceStatus;
|
|
734
735
|
}
|
|
735
|
-
type ProviderResolutionSource = "zone" | "hint" | "fallback" | "best_price";
|
|
736
|
+
type ProviderResolutionSource = "zone" | "hint" | "fallback" | "rate" | "best_price";
|
|
736
737
|
interface DeliveryFeeDetails {
|
|
737
|
-
zone_id
|
|
738
|
-
zone_name
|
|
738
|
+
zone_id?: string;
|
|
739
|
+
zone_name?: string;
|
|
739
740
|
provider: string;
|
|
740
741
|
provider_resolved_from: ProviderResolutionSource;
|
|
741
742
|
/** Named rate this fee was priced under, if any. */
|
|
742
743
|
rate_id?: string;
|
|
743
744
|
rate_name?: string;
|
|
744
|
-
distance_km
|
|
745
|
-
base_fee
|
|
746
|
-
per_km_fee
|
|
747
|
-
surge_multiplier
|
|
745
|
+
distance_km?: Money;
|
|
746
|
+
base_fee?: Money;
|
|
747
|
+
per_km_fee?: Money;
|
|
748
|
+
surge_multiplier?: Money;
|
|
748
749
|
calculated_fee: Money;
|
|
749
750
|
currency: string;
|
|
750
751
|
free_delivery_applied?: boolean;
|
|
@@ -1218,6 +1219,9 @@ interface CheckoutCartData {
|
|
|
1218
1219
|
tax_amount: string;
|
|
1219
1220
|
total_discounts: string;
|
|
1220
1221
|
service_charge: string;
|
|
1222
|
+
/** Server-quoted delivery fee selected in checkout. The cart total excludes
|
|
1223
|
+
* this value until checkout has a delivery address and rate. */
|
|
1224
|
+
delivery_fee?: string;
|
|
1221
1225
|
total: string;
|
|
1222
1226
|
currency: string;
|
|
1223
1227
|
/** Tax is baked into the prices (e.g. Ghana VAT), so `tax_amount` is already
|
|
@@ -2513,8 +2517,8 @@ interface DeliveryFeeResponse {
|
|
|
2513
2517
|
currency: string | null;
|
|
2514
2518
|
details: DeliveryFeeDetails | null;
|
|
2515
2519
|
}
|
|
2516
|
-
/** One entry on the delivery menu
|
|
2517
|
-
*
|
|
2520
|
+
/** One entry on the delivery menu — a merchant-named rate ("Standard",
|
|
2521
|
+
* "Express", "Outside Accra") priced for the address when required, or the
|
|
2518
2522
|
* synthesized default when the business has no named rates (`rate_id: null`). */
|
|
2519
2523
|
interface DeliveryOption {
|
|
2520
2524
|
rate_id: string | null;
|
|
@@ -2541,12 +2545,20 @@ interface GetDeliveryOptionsParams {
|
|
|
2541
2545
|
/** Cart goods total — drives free-over thresholds and zone minimums. */
|
|
2542
2546
|
orderValue?: Money;
|
|
2543
2547
|
}
|
|
2548
|
+
type DeliveryOptionsQuery = GetDeliveryOptionsParams & ({
|
|
2549
|
+
dropoffLat: number;
|
|
2550
|
+
dropoffLng: number;
|
|
2551
|
+
} | {
|
|
2552
|
+
dropoffLat?: never;
|
|
2553
|
+
dropoffLng?: never;
|
|
2554
|
+
});
|
|
2544
2555
|
declare class DeliveryService {
|
|
2545
2556
|
private client;
|
|
2546
2557
|
constructor(client: CimplifyClient);
|
|
2547
2558
|
getFee(dropoffLat: number, dropoffLng: number, country?: string): Promise<Result<DeliveryFeeResponse, CimplifyError>>;
|
|
2548
2559
|
/** The full delivery menu for an address. Pass the selected option's
|
|
2549
2560
|
* `rate_id` as `delivery_rate_id` when processing checkout. */
|
|
2561
|
+
getOptions(query?: DeliveryOptionsQuery): Promise<Result<DeliveryOptionsResponse, CimplifyError>>;
|
|
2550
2562
|
getOptions(dropoffLat: number, dropoffLng: number, opts?: GetDeliveryOptionsParams): Promise<Result<DeliveryOptionsResponse, CimplifyError>>;
|
|
2551
2563
|
}
|
|
2552
2564
|
|
|
@@ -2960,4 +2972,4 @@ declare class CimplifyClient {
|
|
|
2960
2972
|
}
|
|
2961
2973
|
declare function createCimplifyClient(config?: CimplifyConfig): CimplifyClient;
|
|
2962
2974
|
|
|
2963
|
-
export { type CheckSlotAvailabilityInput as $, AUTHORIZATION_TYPE as A, type Booking as B, BusinessService as C, type BusinessSettings as D, type BusinessWithLocations as E, CHECKOUT_MODE as F, CHECKOUT_MUTATION as G, CHECKOUT_STEP as H, CONTACT_TYPE as I, type CacheOptions as J, type CancelBookingInput as K, type CancelBookingResult as L, type CancelOrderInput as M, type CancellationPolicy as N, CartOperations as O, CatalogueQueries as P, type CatalogueResult as Q, type CatalogueSnapshot as R, type CategoryInfo as S, type ChatAttachment as T, type ChatConversation as U, type ChatConversationResponse as V, type ChatMessage as W, type ChatReplyCard as X, type ChatReplyContext as Y, type ChatUploadAttachment as Z, type ChatWidgetStarter as _, AUTH_MUTATION as a, type
|
|
2975
|
+
export { type CheckSlotAvailabilityInput as $, AUTHORIZATION_TYPE as A, type Booking as B, BusinessService as C, type BusinessSettings as D, type BusinessWithLocations as E, CHECKOUT_MODE as F, CHECKOUT_MUTATION as G, CHECKOUT_STEP as H, CONTACT_TYPE as I, type CacheOptions as J, type CancelBookingInput as K, type CancelBookingResult as L, type CancelOrderInput as M, type CancellationPolicy as N, CartOperations as O, CatalogueQueries as P, type CatalogueResult as Q, type CatalogueSnapshot as R, type CategoryInfo as S, type ChatAttachment as T, type ChatConversation as U, type ChatConversationResponse as V, type ChatMessage as W, type ChatReplyCard as X, type ChatReplyContext as Y, type ChatUploadAttachment as Z, type ChatWidgetStarter as _, AUTH_MUTATION as a, type EnrichedOrderItem as a$, type CheckSlotAvailabilityResult as a0, type CheckoutAddressInfo as a1, type CheckoutCartData as a2, type CheckoutCartItem as a3, type CheckoutCustomerInfo as a4, type CheckoutFormData as a5, type CheckoutInput as a6, type CheckoutMode as a7, type CheckoutOrderType as a8, type CheckoutPaymentMethod as a9, type DeliveryFeeResponse as aA, type DeliveryOption as aB, type DeliveryOptionsQuery as aC, type DeliveryOptionsResponse as aD, DeliveryService as aE, type DepositResult as aF, type DeviceType as aG, type DismissMessageResponse as aH, ELEMENTS_AUTH_CONTACT_TYPES as aI, ELEMENTS_AUTH_MODES as aJ, ELEMENTS_AUTH_PROMPTS as aK, ELEMENT_TYPES as aL, EVENT_TYPES as aM, type ElementAppearance as aN, type ElementEventHandler as aO, type ElementEventType as aP, type ElementOptions as aQ, type ElementType as aR, type ElementsAuthContactType as aS, type ElementsAuthMode as aT, type ElementsAuthOptions as aU, type ElementsAuthPrompt as aV, type ElementsCheckoutData as aW, type ElementsCheckoutResult as aX, type ElementsCustomerInfo as aY, type ElementsOptions as aZ, type EnrichedOrder as a_, type CheckoutResult as aa, CheckoutService as ab, type CheckoutStatus as ac, type CheckoutStatusContext as ad, type CheckoutStep as ae, CimplifyClient as af, type CimplifyConfig as ag, CimplifyElement as ah, CimplifyElements as ai, type ClaimConversationResult as aj, type ContactType as ak, type ContentType as al, type CreateAddressInput as am, type CreateMobileMoneyInput as an, type Customer as ao, type CustomerAddress as ap, type CustomerBooking as aq, type CustomerBookingServiceItem as ar, type CustomerLinkPreferences as as, type CustomerMobileMoney as at, type CustomerServicePreferences as au, DEFAULT_COUNTRY as av, DEFAULT_CURRENCY as aw, DEVICE_TYPE as ax, type DayAvailability as ay, type DeliveryFeeDetails as az, type AbortablePromise as b, type OrderGroupStatus as b$, type EnrollAndLinkOrderInput as b0, type EnrollAndLinkOrderResult as b1, type EnrollmentData as b2, type Err as b3, type FeeBearerType as b4, type FetchQuoteInput as b5, type FulfillmentLink as b6, type FulfillmentStatus as b7, type FulfillmentSummaryDTO as b8, type FulfillmentType as b9, type Location as bA, type LocationBooking as bB, type LocationTaxBehavior as bC, type LocationTaxOverrides as bD, type LocationTimeProfile as bE, type LocationWithDetails as bF, MESSAGE_TYPES as bG, MOBILE_MONEY_PROVIDER as bH, type MobileMoneyData as bI, type MobileMoneyDetails as bJ, type MobileMoneyProvider as bK, type NextAction as bL, ORDER_MUTATION as bM, ORDER_TYPE as bN, type ObservabilityHooks as bO, type Ok as bP, type Order as bQ, type OrderCustomerInfo as bR, type OrderDiscountInfo as bS, type OrderFilter as bT, type OrderFulfillmentSummary as bU, type OrderGroup as bV, type OrderGroupDetails as bW, type OrderGroupPayment as bX, type OrderGroupPaymentState as bY, type OrderGroupPaymentStatus as bZ, type OrderGroupPaymentSummary as b_, type FxQuote as ba, type FxQuoteRequest as bb, type FxQuoteStatus as bc, type FxRateResponse as bd, FxService as be, type GetAvailableSlotsInput as bf, type GetDeliveryOptionsParams as bg, type GetOrdersOptions as bh, type GetProductsOptions as bi, type GroupOrderInfo as bj, type IframeToParentMessage as bk, InventoryService as bl, LINK_MUTATION as bm, LINK_QUERY as bn, type LifecyclePhase as bo, type LineItem as bp, type LineType as bq, type LinkData as br, type LinkEnrollResult as bs, LinkService as bt, type LinkSession as bu, type LinkStatusResult as bv, type LiteBootstrap as bw, type LiteDayHours as bx, type LiteHoursRange as by, LiteService as bz, type ActivityRecommendation as c, type RetryEvent as c$, type OrderHistory as c0, type OrderLineState as c1, type OrderLineStatus as c2, type OrderLocationInfo as c3, type OrderPaymentEvent as c4, type OrderPricingView as c5, OrderQueries as c6, type OrderSplitDetail as c7, type OrderStaffInfo as c8, type OrderStatus as c9, type QuoteDynamicBuckets as cA, type QuoteStatus as cB, type QuoteUiMessage as cC, type ReadRequestOptions as cD, type RefreshQuoteInput as cE, type RefreshQuoteResult as cF, type RefundOrderInput as cG, type RelatedCandidate as cH, type RelatedProduct as cI, type RelatedProductsEnrichment as cJ, type RelationType as cK, type ReminderMethod as cL, type ReminderSettings as cM, type ReorderResult as cN, type RequestContext as cO, type RequestErrorEvent as cP, type RequestOptions as cQ, type RequestOtpInput as cR, type RequestSource as cS, type RequestStartEvent as cT, type RequestSuccessEvent as cU, type RescheduleBookingInput as cV, type RescheduleBookingResult as cW, type RescheduleHistoryRecord as cX, type ResourceAssignment as cY, type ResourceInfo as cZ, type Result as c_, type OrderTimestampsDTO as ca, type OrderType as cb, type Origin as cc, type OriginActor as cd, type OriginChannel as ce, type OtpResult as cf, PAYMENT_METHOD as cg, PAYMENT_MUTATION as ch, PAYMENT_STATE as ci, PICKUP_TIME_TYPE as cj, type ParentToIframeMessage as ck, type PaymentInfoDTO as cl, type PaymentMethodInfo as cm, type PaymentState as cn, type PickupTime as co, type PickupTimeType as cp, type PlaceDetailsResponse as cq, PlacesService as cr, type PriceQuote as cs, type PricingOverrides as ct, type ProcessAndResolveOptions as cu, type ProcessCheckoutOptions as cv, type ProcessCheckoutResult as cw, type ProviderResolutionSource as cx, type QuoteBundleSelectionInput as cy, type QuoteCompositeSelectionInput as cz, type ActivityRecommendationsResponse as d, type RevokeAllSessionsResult as d0, type RevokeSessionResult as d1, type Room as d2, type SchedulingMetadata as d3, type SchedulingResult as d4, SchedulingService as d5, type SenderType as d6, type Service as d7, type ServiceAvailabilityParams as d8, type ServiceAvailabilityResult as d9, type TrackProductViewOptions as dA, type UpdateAddressInput as dB, type UpdateOrderStatusInput as dC, type UpdateProfileInput as dD, type UploadInitResponse as dE, type UploadResult as dF, UploadService as dG, type VerifyOtpInput as dH, combine as dI, combineObject as dJ, createCimplifyClient as dK, createElements as dL, err as dM, flatMap as dN, fromPromise as dO, getOrElse as dP, isErr as dQ, isOk as dR, mapError as dS, mapResult as dT, ok as dU, toNullable as dV, tryCatch as dW, unwrap as dX, type ServiceCharge as da, type ServiceNotes as db, type ServiceScheduleRequest as dc, type ServiceStatus as dd, type SessionActivityData as de, type SessionChangeEvent as df, type SessionMessage as dg, type SlotResourceInfo as dh, type SlotStaffInfo as di, type Staff as dj, type StaffAssignment as dk, type StaffRole as dl, type StaffScheduleItem as dm, type StockLevel as dn, type StockStatus as dp, type StoreCreditBalance as dq, StoreCreditQueries as dr, type StorefrontBootstrap as ds, SubscriptionService as dt, SupportService as du, type Table as dv, type TimeRange as dw, type TimeRanges as dx, type TimeSlot as dy, type TrackCategoryViewOptions as dz, ActivityService as e, type ActivityStateResponse as f, type AddressData as g, type AddressInfo as h, type AmountToPay as i, type AuthResponse as j, AuthService as k, type AuthStatus as l, type AuthenticatedCustomer as m, type AuthenticatedData as n, type AutocompletePrediction as o, type AutocompleteResponse as p, type AvailabilityResult as q, type AvailableSlot as r, type BookingModificationType as s, type BookingStatus as t, type BookingWithDetails as u, type BufferTimes as v, type Business as w, type BusinessDetailsDTO as x, type BusinessHours as y, type BusinessPreferences as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { V as CimplifyError, S as Category, aZ as Product, f as AddOnWithOptions, aQ as Pagination, bb as ProductWithDetails, b9 as ProductVariant, bF as VariantAxis, bG as VariantAxisSelection, A as AddOn, W as Collection, G as BundleSummary, u as Bundle, a3 as Composite, a1 as ComponentSelectionInput, a8 as CompositePriceResult, U as ChosenPrice, b6 as ProductTaxonomy, bx as TaxonomyWithChildren, ax as EligiblePlansQuery, b1 as ProductBillingPlan, b7 as ProductTimeProfile, b0 as ProductAvailabilityNow, aj as Deal, b2 as ProductDealInfo, ap as DiscountValidation, bu as TagsResponse, ae as CustomAttributeDefinition, af as CustomAttributeValue, bc as PropertyFacet, bw as TaxonomyAttributeTemplate, aJ as KnowledgeArticle, by as UICart, L as CartItem, Q as CartSummary, g as AddToCartInput, N as CartMutationResult, bE as UpdateCartItemInput, ao as DiscountDetails, aO as Money,
|
|
2
|
-
import { a as AuthorizationType, c as PaymentMethod, I as InitializePaymentResult, S as SubmitAuthorizationInput, i as PaymentStatusResponse } from './payment-
|
|
1
|
+
import { V as CimplifyError, S as Category, aZ as Product, f as AddOnWithOptions, aQ as Pagination, bb as ProductWithDetails, b9 as ProductVariant, bF as VariantAxis, bG as VariantAxisSelection, A as AddOn, W as Collection, G as BundleSummary, u as Bundle, a3 as Composite, a1 as ComponentSelectionInput, a8 as CompositePriceResult, ad as CurrencyCode, U as ChosenPrice, bi as SaleInfo, b6 as ProductTaxonomy, bx as TaxonomyWithChildren, ax as EligiblePlansQuery, b1 as ProductBillingPlan, b7 as ProductTimeProfile, b0 as ProductAvailabilityNow, aj as Deal, b2 as ProductDealInfo, ap as DiscountValidation, bu as TagsResponse, ae as CustomAttributeDefinition, af as CustomAttributeValue, bc as PropertyFacet, bw as TaxonomyAttributeTemplate, aJ as KnowledgeArticle, by as UICart, L as CartItem, Q as CartSummary, g as AddToCartInput, N as CartMutationResult, bE as UpdateCartItemInput, ao as DiscountDetails, aO as Money, aK as LineConfiguration, bL as VariantDetails, bM as VariantDetailsDTO, a as AddOnDetails, d as AddOnOptionDetails, b as AddOnGroupDetails, D as BundleSelectionData, aa as CompositeSelectionData, ag as CustomerInputValue, bS as components, bk as SchedulingMode, av as DurationUnit, bo as Subscription, bs as SubscriptionWithDetails } from './product-CeV8euw4.js';
|
|
2
|
+
import { a as AuthorizationType, c as PaymentMethod, I as InitializePaymentResult, S as SubmitAuthorizationInput, i as PaymentStatusResponse } from './payment-jK8ztICx.js';
|
|
3
3
|
|
|
4
4
|
interface RequestContext {
|
|
5
5
|
method: "GET" | "POST" | "PATCH" | "DELETE";
|
|
@@ -221,31 +221,32 @@ interface PriceQuote {
|
|
|
221
221
|
quote_id: string;
|
|
222
222
|
business_id: string;
|
|
223
223
|
product_id: string;
|
|
224
|
-
variant_id?: string;
|
|
225
|
-
location_id?: string;
|
|
224
|
+
variant_id?: string | null;
|
|
225
|
+
location_id?: string | null;
|
|
226
226
|
source: RequestSource;
|
|
227
|
-
customer_id?: string;
|
|
228
|
-
customer_segment_id?: string;
|
|
229
|
-
storefront_id?: string;
|
|
230
|
-
attribution_id?: string;
|
|
227
|
+
customer_id?: string | null;
|
|
228
|
+
customer_segment_id?: string | null;
|
|
229
|
+
storefront_id?: string | null;
|
|
230
|
+
attribution_id?: string | null;
|
|
231
231
|
quantity: number;
|
|
232
|
-
currency?:
|
|
233
|
-
snapshot_id?: string;
|
|
234
|
-
snapshot_markup_version?: string;
|
|
235
|
-
snapshot_tax_version?: string;
|
|
232
|
+
currency?: CurrencyCode | null;
|
|
233
|
+
snapshot_id?: string | null;
|
|
234
|
+
snapshot_markup_version?: string | null;
|
|
235
|
+
snapshot_tax_version?: string | null;
|
|
236
236
|
item_price_info: ChosenPrice;
|
|
237
|
-
variant_price_info?: ChosenPrice;
|
|
237
|
+
variant_price_info?: ChosenPrice | null;
|
|
238
238
|
final_price_info: ChosenPrice;
|
|
239
|
+
sale?: SaleInfo | null;
|
|
239
240
|
add_on_option_ids: string[];
|
|
240
241
|
bundle_selections?: QuoteBundleSelectionInput[];
|
|
241
|
-
add_ons_price_info?: ChosenPrice;
|
|
242
|
-
quoted_total_price_info?: ChosenPrice;
|
|
242
|
+
add_ons_price_info?: ChosenPrice | null;
|
|
243
|
+
quoted_total_price_info?: ChosenPrice | null;
|
|
243
244
|
composite_selections?: QuoteCompositeSelectionInput[];
|
|
244
245
|
dynamic_buckets: QuoteDynamicBuckets;
|
|
245
246
|
ui_messages: QuoteUiMessage[];
|
|
246
247
|
created_at: string;
|
|
247
248
|
expires_at: string;
|
|
248
|
-
next_change_at?: string;
|
|
249
|
+
next_change_at?: string | null;
|
|
249
250
|
status: QuoteStatus;
|
|
250
251
|
}
|
|
251
252
|
interface RefreshQuoteResult {
|
|
@@ -732,19 +733,19 @@ interface LocationBooking {
|
|
|
732
733
|
assigned_resources: string[];
|
|
733
734
|
service_status: ServiceStatus;
|
|
734
735
|
}
|
|
735
|
-
type ProviderResolutionSource = "zone" | "hint" | "fallback" | "best_price";
|
|
736
|
+
type ProviderResolutionSource = "zone" | "hint" | "fallback" | "rate" | "best_price";
|
|
736
737
|
interface DeliveryFeeDetails {
|
|
737
|
-
zone_id
|
|
738
|
-
zone_name
|
|
738
|
+
zone_id?: string;
|
|
739
|
+
zone_name?: string;
|
|
739
740
|
provider: string;
|
|
740
741
|
provider_resolved_from: ProviderResolutionSource;
|
|
741
742
|
/** Named rate this fee was priced under, if any. */
|
|
742
743
|
rate_id?: string;
|
|
743
744
|
rate_name?: string;
|
|
744
|
-
distance_km
|
|
745
|
-
base_fee
|
|
746
|
-
per_km_fee
|
|
747
|
-
surge_multiplier
|
|
745
|
+
distance_km?: Money;
|
|
746
|
+
base_fee?: Money;
|
|
747
|
+
per_km_fee?: Money;
|
|
748
|
+
surge_multiplier?: Money;
|
|
748
749
|
calculated_fee: Money;
|
|
749
750
|
currency: string;
|
|
750
751
|
free_delivery_applied?: boolean;
|
|
@@ -1218,6 +1219,9 @@ interface CheckoutCartData {
|
|
|
1218
1219
|
tax_amount: string;
|
|
1219
1220
|
total_discounts: string;
|
|
1220
1221
|
service_charge: string;
|
|
1222
|
+
/** Server-quoted delivery fee selected in checkout. The cart total excludes
|
|
1223
|
+
* this value until checkout has a delivery address and rate. */
|
|
1224
|
+
delivery_fee?: string;
|
|
1221
1225
|
total: string;
|
|
1222
1226
|
currency: string;
|
|
1223
1227
|
/** Tax is baked into the prices (e.g. Ghana VAT), so `tax_amount` is already
|
|
@@ -2513,8 +2517,8 @@ interface DeliveryFeeResponse {
|
|
|
2513
2517
|
currency: string | null;
|
|
2514
2518
|
details: DeliveryFeeDetails | null;
|
|
2515
2519
|
}
|
|
2516
|
-
/** One entry on the delivery menu
|
|
2517
|
-
*
|
|
2520
|
+
/** One entry on the delivery menu — a merchant-named rate ("Standard",
|
|
2521
|
+
* "Express", "Outside Accra") priced for the address when required, or the
|
|
2518
2522
|
* synthesized default when the business has no named rates (`rate_id: null`). */
|
|
2519
2523
|
interface DeliveryOption {
|
|
2520
2524
|
rate_id: string | null;
|
|
@@ -2541,12 +2545,20 @@ interface GetDeliveryOptionsParams {
|
|
|
2541
2545
|
/** Cart goods total — drives free-over thresholds and zone minimums. */
|
|
2542
2546
|
orderValue?: Money;
|
|
2543
2547
|
}
|
|
2548
|
+
type DeliveryOptionsQuery = GetDeliveryOptionsParams & ({
|
|
2549
|
+
dropoffLat: number;
|
|
2550
|
+
dropoffLng: number;
|
|
2551
|
+
} | {
|
|
2552
|
+
dropoffLat?: never;
|
|
2553
|
+
dropoffLng?: never;
|
|
2554
|
+
});
|
|
2544
2555
|
declare class DeliveryService {
|
|
2545
2556
|
private client;
|
|
2546
2557
|
constructor(client: CimplifyClient);
|
|
2547
2558
|
getFee(dropoffLat: number, dropoffLng: number, country?: string): Promise<Result<DeliveryFeeResponse, CimplifyError>>;
|
|
2548
2559
|
/** The full delivery menu for an address. Pass the selected option's
|
|
2549
2560
|
* `rate_id` as `delivery_rate_id` when processing checkout. */
|
|
2561
|
+
getOptions(query?: DeliveryOptionsQuery): Promise<Result<DeliveryOptionsResponse, CimplifyError>>;
|
|
2550
2562
|
getOptions(dropoffLat: number, dropoffLng: number, opts?: GetDeliveryOptionsParams): Promise<Result<DeliveryOptionsResponse, CimplifyError>>;
|
|
2551
2563
|
}
|
|
2552
2564
|
|
|
@@ -2960,4 +2972,4 @@ declare class CimplifyClient {
|
|
|
2960
2972
|
}
|
|
2961
2973
|
declare function createCimplifyClient(config?: CimplifyConfig): CimplifyClient;
|
|
2962
2974
|
|
|
2963
|
-
export { type CheckSlotAvailabilityInput as $, AUTHORIZATION_TYPE as A, type Booking as B, BusinessService as C, type BusinessSettings as D, type BusinessWithLocations as E, CHECKOUT_MODE as F, CHECKOUT_MUTATION as G, CHECKOUT_STEP as H, CONTACT_TYPE as I, type CacheOptions as J, type CancelBookingInput as K, type CancelBookingResult as L, type CancelOrderInput as M, type CancellationPolicy as N, CartOperations as O, CatalogueQueries as P, type CatalogueResult as Q, type CatalogueSnapshot as R, type CategoryInfo as S, type ChatAttachment as T, type ChatConversation as U, type ChatConversationResponse as V, type ChatMessage as W, type ChatReplyCard as X, type ChatReplyContext as Y, type ChatUploadAttachment as Z, type ChatWidgetStarter as _, AUTH_MUTATION as a, type
|
|
2975
|
+
export { type CheckSlotAvailabilityInput as $, AUTHORIZATION_TYPE as A, type Booking as B, BusinessService as C, type BusinessSettings as D, type BusinessWithLocations as E, CHECKOUT_MODE as F, CHECKOUT_MUTATION as G, CHECKOUT_STEP as H, CONTACT_TYPE as I, type CacheOptions as J, type CancelBookingInput as K, type CancelBookingResult as L, type CancelOrderInput as M, type CancellationPolicy as N, CartOperations as O, CatalogueQueries as P, type CatalogueResult as Q, type CatalogueSnapshot as R, type CategoryInfo as S, type ChatAttachment as T, type ChatConversation as U, type ChatConversationResponse as V, type ChatMessage as W, type ChatReplyCard as X, type ChatReplyContext as Y, type ChatUploadAttachment as Z, type ChatWidgetStarter as _, AUTH_MUTATION as a, type EnrichedOrderItem as a$, type CheckSlotAvailabilityResult as a0, type CheckoutAddressInfo as a1, type CheckoutCartData as a2, type CheckoutCartItem as a3, type CheckoutCustomerInfo as a4, type CheckoutFormData as a5, type CheckoutInput as a6, type CheckoutMode as a7, type CheckoutOrderType as a8, type CheckoutPaymentMethod as a9, type DeliveryFeeResponse as aA, type DeliveryOption as aB, type DeliveryOptionsQuery as aC, type DeliveryOptionsResponse as aD, DeliveryService as aE, type DepositResult as aF, type DeviceType as aG, type DismissMessageResponse as aH, ELEMENTS_AUTH_CONTACT_TYPES as aI, ELEMENTS_AUTH_MODES as aJ, ELEMENTS_AUTH_PROMPTS as aK, ELEMENT_TYPES as aL, EVENT_TYPES as aM, type ElementAppearance as aN, type ElementEventHandler as aO, type ElementEventType as aP, type ElementOptions as aQ, type ElementType as aR, type ElementsAuthContactType as aS, type ElementsAuthMode as aT, type ElementsAuthOptions as aU, type ElementsAuthPrompt as aV, type ElementsCheckoutData as aW, type ElementsCheckoutResult as aX, type ElementsCustomerInfo as aY, type ElementsOptions as aZ, type EnrichedOrder as a_, type CheckoutResult as aa, CheckoutService as ab, type CheckoutStatus as ac, type CheckoutStatusContext as ad, type CheckoutStep as ae, CimplifyClient as af, type CimplifyConfig as ag, CimplifyElement as ah, CimplifyElements as ai, type ClaimConversationResult as aj, type ContactType as ak, type ContentType as al, type CreateAddressInput as am, type CreateMobileMoneyInput as an, type Customer as ao, type CustomerAddress as ap, type CustomerBooking as aq, type CustomerBookingServiceItem as ar, type CustomerLinkPreferences as as, type CustomerMobileMoney as at, type CustomerServicePreferences as au, DEFAULT_COUNTRY as av, DEFAULT_CURRENCY as aw, DEVICE_TYPE as ax, type DayAvailability as ay, type DeliveryFeeDetails as az, type AbortablePromise as b, type OrderGroupStatus as b$, type EnrollAndLinkOrderInput as b0, type EnrollAndLinkOrderResult as b1, type EnrollmentData as b2, type Err as b3, type FeeBearerType as b4, type FetchQuoteInput as b5, type FulfillmentLink as b6, type FulfillmentStatus as b7, type FulfillmentSummaryDTO as b8, type FulfillmentType as b9, type Location as bA, type LocationBooking as bB, type LocationTaxBehavior as bC, type LocationTaxOverrides as bD, type LocationTimeProfile as bE, type LocationWithDetails as bF, MESSAGE_TYPES as bG, MOBILE_MONEY_PROVIDER as bH, type MobileMoneyData as bI, type MobileMoneyDetails as bJ, type MobileMoneyProvider as bK, type NextAction as bL, ORDER_MUTATION as bM, ORDER_TYPE as bN, type ObservabilityHooks as bO, type Ok as bP, type Order as bQ, type OrderCustomerInfo as bR, type OrderDiscountInfo as bS, type OrderFilter as bT, type OrderFulfillmentSummary as bU, type OrderGroup as bV, type OrderGroupDetails as bW, type OrderGroupPayment as bX, type OrderGroupPaymentState as bY, type OrderGroupPaymentStatus as bZ, type OrderGroupPaymentSummary as b_, type FxQuote as ba, type FxQuoteRequest as bb, type FxQuoteStatus as bc, type FxRateResponse as bd, FxService as be, type GetAvailableSlotsInput as bf, type GetDeliveryOptionsParams as bg, type GetOrdersOptions as bh, type GetProductsOptions as bi, type GroupOrderInfo as bj, type IframeToParentMessage as bk, InventoryService as bl, LINK_MUTATION as bm, LINK_QUERY as bn, type LifecyclePhase as bo, type LineItem as bp, type LineType as bq, type LinkData as br, type LinkEnrollResult as bs, LinkService as bt, type LinkSession as bu, type LinkStatusResult as bv, type LiteBootstrap as bw, type LiteDayHours as bx, type LiteHoursRange as by, LiteService as bz, type ActivityRecommendation as c, type RetryEvent as c$, type OrderHistory as c0, type OrderLineState as c1, type OrderLineStatus as c2, type OrderLocationInfo as c3, type OrderPaymentEvent as c4, type OrderPricingView as c5, OrderQueries as c6, type OrderSplitDetail as c7, type OrderStaffInfo as c8, type OrderStatus as c9, type QuoteDynamicBuckets as cA, type QuoteStatus as cB, type QuoteUiMessage as cC, type ReadRequestOptions as cD, type RefreshQuoteInput as cE, type RefreshQuoteResult as cF, type RefundOrderInput as cG, type RelatedCandidate as cH, type RelatedProduct as cI, type RelatedProductsEnrichment as cJ, type RelationType as cK, type ReminderMethod as cL, type ReminderSettings as cM, type ReorderResult as cN, type RequestContext as cO, type RequestErrorEvent as cP, type RequestOptions as cQ, type RequestOtpInput as cR, type RequestSource as cS, type RequestStartEvent as cT, type RequestSuccessEvent as cU, type RescheduleBookingInput as cV, type RescheduleBookingResult as cW, type RescheduleHistoryRecord as cX, type ResourceAssignment as cY, type ResourceInfo as cZ, type Result as c_, type OrderTimestampsDTO as ca, type OrderType as cb, type Origin as cc, type OriginActor as cd, type OriginChannel as ce, type OtpResult as cf, PAYMENT_METHOD as cg, PAYMENT_MUTATION as ch, PAYMENT_STATE as ci, PICKUP_TIME_TYPE as cj, type ParentToIframeMessage as ck, type PaymentInfoDTO as cl, type PaymentMethodInfo as cm, type PaymentState as cn, type PickupTime as co, type PickupTimeType as cp, type PlaceDetailsResponse as cq, PlacesService as cr, type PriceQuote as cs, type PricingOverrides as ct, type ProcessAndResolveOptions as cu, type ProcessCheckoutOptions as cv, type ProcessCheckoutResult as cw, type ProviderResolutionSource as cx, type QuoteBundleSelectionInput as cy, type QuoteCompositeSelectionInput as cz, type ActivityRecommendationsResponse as d, type RevokeAllSessionsResult as d0, type RevokeSessionResult as d1, type Room as d2, type SchedulingMetadata as d3, type SchedulingResult as d4, SchedulingService as d5, type SenderType as d6, type Service as d7, type ServiceAvailabilityParams as d8, type ServiceAvailabilityResult as d9, type TrackProductViewOptions as dA, type UpdateAddressInput as dB, type UpdateOrderStatusInput as dC, type UpdateProfileInput as dD, type UploadInitResponse as dE, type UploadResult as dF, UploadService as dG, type VerifyOtpInput as dH, combine as dI, combineObject as dJ, createCimplifyClient as dK, createElements as dL, err as dM, flatMap as dN, fromPromise as dO, getOrElse as dP, isErr as dQ, isOk as dR, mapError as dS, mapResult as dT, ok as dU, toNullable as dV, tryCatch as dW, unwrap as dX, type ServiceCharge as da, type ServiceNotes as db, type ServiceScheduleRequest as dc, type ServiceStatus as dd, type SessionActivityData as de, type SessionChangeEvent as df, type SessionMessage as dg, type SlotResourceInfo as dh, type SlotStaffInfo as di, type Staff as dj, type StaffAssignment as dk, type StaffRole as dl, type StaffScheduleItem as dm, type StockLevel as dn, type StockStatus as dp, type StoreCreditBalance as dq, StoreCreditQueries as dr, type StorefrontBootstrap as ds, SubscriptionService as dt, SupportService as du, type Table as dv, type TimeRange as dw, type TimeRanges as dx, type TimeSlot as dy, type TrackCategoryViewOptions as dz, ActivityService as e, type ActivityStateResponse as f, type AddressData as g, type AddressInfo as h, type AmountToPay as i, type AuthResponse as j, AuthService as k, type AuthStatus as l, type AuthenticatedCustomer as m, type AuthenticatedData as n, type AutocompletePrediction as o, type AutocompleteResponse as p, type AvailabilityResult as q, type AvailableSlot as r, type BookingModificationType as s, type BookingStatus as t, type BookingWithDetails as u, type BufferTimes as v, type Business as w, type BusinessDetailsDTO as x, type BusinessHours as y, type BusinessPreferences as z };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { aO as Money, ad as CurrencyCode, aX as PricePathTaxInfo, aZ as Product, bb as ProductWithDetails, be as QuantityPricingTier } from './product-
|
|
2
|
-
import { P as ProductWithPrice } from './price-
|
|
3
|
-
import { b as PaymentErrorDetails, g as PaymentResponse, i as PaymentStatusResponse } from './payment-
|
|
1
|
+
import { aO as Money, ad as CurrencyCode, aX as PricePathTaxInfo, aZ as Product, bb as ProductWithDetails, be as QuantityPricingTier } from './product-CeV8euw4.js';
|
|
2
|
+
import { P as ProductWithPrice } from './price-CJLfcYKd.js';
|
|
3
|
+
import { b as PaymentErrorDetails, g as PaymentResponse, i as PaymentStatusResponse } from './payment-jK8ztICx.js';
|
|
4
4
|
import { CountryCode } from 'libphonenumber-js';
|
|
5
5
|
|
|
6
6
|
declare const CURRENCY_SYMBOLS: Record<string, string>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { aO as Money, ad as CurrencyCode, aX as PricePathTaxInfo, aZ as Product, bb as ProductWithDetails, be as QuantityPricingTier } from './product-
|
|
2
|
-
import { P as ProductWithPrice } from './price-
|
|
3
|
-
import { b as PaymentErrorDetails, g as PaymentResponse, i as PaymentStatusResponse } from './payment-
|
|
1
|
+
import { aO as Money, ad as CurrencyCode, aX as PricePathTaxInfo, aZ as Product, bb as ProductWithDetails, be as QuantityPricingTier } from './product-CeV8euw4.mjs';
|
|
2
|
+
import { P as ProductWithPrice } from './price-D96h6c6L.mjs';
|
|
3
|
+
import { b as PaymentErrorDetails, g as PaymentResponse, i as PaymentStatusResponse } from './payment-BSzy7sly.mjs';
|
|
4
4
|
import { CountryCode } from 'libphonenumber-js';
|
|
5
5
|
|
|
6
6
|
declare const CURRENCY_SYMBOLS: Record<string, string>;
|