@cimplify/sdk 0.80.0 → 0.82.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/advanced.d.mts +3 -3
  2. package/dist/advanced.d.ts +3 -3
  3. package/dist/advanced.js +20 -20
  4. package/dist/advanced.mjs +1 -1
  5. package/dist/{chunk-3BKMNVTR.mjs → chunk-7BM56JET.mjs} +1 -0
  6. package/dist/{chunk-FIC5S3KD.mjs → chunk-7PAQR3VC.mjs} +2 -2
  7. package/dist/{chunk-BNA4GW4D.mjs → chunk-BRVIXGUW.mjs} +60 -0
  8. package/dist/{chunk-NV445GMS.js → chunk-GFM5JW45.js} +48 -36
  9. package/dist/{chunk-CV5QMDQS.js → chunk-HPN5R3K2.js} +1 -0
  10. package/dist/{chunk-KMP4HVA2.js → chunk-IZDJEDR4.js} +4 -4
  11. package/dist/{chunk-NJGJCQWF.mjs → chunk-NWUEWUX2.mjs} +13 -1
  12. package/dist/{chunk-OSTOGR4F.js → chunk-SRJEMEVZ.js} +60 -0
  13. package/dist/{client-6BNd11sq.d.mts → client-BSpVgule.d.mts} +2 -2
  14. package/dist/{client-CuoWlAfH.d.ts → client-Dh-KIIX8.d.ts} +2 -2
  15. package/dist/{client-D22iSqke.d.ts → client-DnHP_2Jw.d.mts} +44 -4
  16. package/dist/{client-Czbt-mej.d.mts → client-xc2aQSB4.d.ts} +44 -4
  17. package/dist/{index-Moe4cGMB.d.ts → index-C4xE31-D.d.ts} +3 -3
  18. package/dist/{index-Bu76UyFz.d.mts → index-Dy8D3r9b.d.mts} +3 -3
  19. package/dist/index.d.mts +6 -6
  20. package/dist/index.d.ts +6 -6
  21. package/dist/index.js +69 -69
  22. package/dist/index.mjs +3 -3
  23. package/dist/mock/cli.mjs +60 -0
  24. package/dist/mock/library.js +60 -0
  25. package/dist/mock/library.mjs +60 -0
  26. package/dist/mock/msw.js +60 -0
  27. package/dist/mock/msw.mjs +60 -0
  28. package/dist/{payment-B7qzWdaJ.d.mts → payment-T_0MUE9o.d.mts} +1 -1
  29. package/dist/{payment-mVIJIJcq.d.ts → payment-nH9OCUg2.d.ts} +1 -1
  30. package/dist/{price-CS1IsORZ.d.ts → price-B8WMoldA.d.ts} +1 -1
  31. package/dist/{price-BfOaGqjx.d.mts → price-Bg7hujK_.d.mts} +1 -1
  32. package/dist/{product-BgFOFmQw.d.ts → product-DXhjLQ_w.d.mts} +1 -0
  33. package/dist/{product-BgFOFmQw.d.mts → product-DXhjLQ_w.d.ts} +1 -0
  34. package/dist/react.d.mts +23 -5
  35. package/dist/react.d.ts +23 -5
  36. package/dist/react.js +43 -17
  37. package/dist/react.mjs +29 -4
  38. package/dist/{server-CGO4zneR.d.mts → server-tr993CPj.d.mts} +22 -1
  39. package/dist/{server-Daq42vK7.d.ts → server-wAB-qfyZ.d.ts} +22 -1
  40. package/dist/server.d.mts +4 -4
  41. package/dist/server.d.ts +4 -4
  42. package/dist/server.js +7 -7
  43. package/dist/server.mjs +2 -2
  44. package/dist/testing/msw.d.mts +2 -2
  45. package/dist/testing/msw.d.ts +2 -2
  46. package/dist/testing/msw.js +2 -2
  47. package/dist/testing/msw.mjs +1 -1
  48. package/dist/testing/suite.d.mts +6 -6
  49. package/dist/testing/suite.d.ts +6 -6
  50. package/dist/testing/suite.js +23 -23
  51. package/dist/testing/suite.mjs +4 -4
  52. package/dist/testing.d.mts +5 -5
  53. package/dist/testing.d.ts +5 -5
  54. package/dist/testing.js +79 -79
  55. package/dist/testing.mjs +5 -5
  56. package/dist/utils.d.mts +4 -4
  57. package/dist/utils.d.ts +4 -4
  58. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
- export { k as AuthService, C as BusinessService, P as CartOperations, Q as CatalogueQueries, a9 as CheckoutOperations, a9 as CheckoutService, af as CimplifyElement, ag as CimplifyElements, aF as ELEMENT_TYPES, aG as EVENT_TYPES, aJ as ElementEventType, aK as ElementOptions, aL as ElementType, aT as ElementsOptions, a$ as FetchQuoteInput, b7 as FxService, ba as GetProductsOptions, bd as InventoryService, bk as LinkService, bo as LiteService, bv as MESSAGE_TYPES, bY as OrderQueries, cf as PriceQuote, cl as QuoteBundleSelectionInput, cm as QuoteCompositeSelectionInput, cn as QuoteDynamicBuckets, co as QuoteStatus, cp as QuoteUiMessage, cr as RefreshQuoteInput, cs as RefreshQuoteResult, cT as SchedulingService, dy as createElements } from './client-Czbt-mej.mjs';
2
- import './product-BgFOFmQw.mjs';
3
- import './payment-B7qzWdaJ.mjs';
1
+ export { k as AuthService, C as BusinessService, P as CartOperations, Q as CatalogueQueries, a9 as CheckoutOperations, a9 as CheckoutService, af as CimplifyElement, ag as CimplifyElements, aH as ELEMENT_TYPES, aI as EVENT_TYPES, aL as ElementEventType, aM as ElementOptions, aN as ElementType, aV as ElementsOptions, b1 as FetchQuoteInput, b9 as FxService, bd as GetProductsOptions, bg as InventoryService, bn as LinkService, br as LiteService, by as MESSAGE_TYPES, b$ as OrderQueries, ci as PriceQuote, co as QuoteBundleSelectionInput, cp as QuoteCompositeSelectionInput, cq as QuoteDynamicBuckets, cr as QuoteStatus, cs as QuoteUiMessage, cu as RefreshQuoteInput, cv as RefreshQuoteResult, cW as SchedulingService, dB as createElements } from './client-DnHP_2Jw.mjs';
2
+ import './product-DXhjLQ_w.mjs';
3
+ import './payment-T_0MUE9o.mjs';
4
4
 
5
5
  declare function generateIdempotencyKey(prefix?: string): string;
6
6
 
@@ -1,6 +1,6 @@
1
- export { k as AuthService, C as BusinessService, P as CartOperations, Q as CatalogueQueries, a9 as CheckoutOperations, a9 as CheckoutService, af as CimplifyElement, ag as CimplifyElements, aF as ELEMENT_TYPES, aG as EVENT_TYPES, aJ as ElementEventType, aK as ElementOptions, aL as ElementType, aT as ElementsOptions, a$ as FetchQuoteInput, b7 as FxService, ba as GetProductsOptions, bd as InventoryService, bk as LinkService, bo as LiteService, bv as MESSAGE_TYPES, bY as OrderQueries, cf as PriceQuote, cl as QuoteBundleSelectionInput, cm as QuoteCompositeSelectionInput, cn as QuoteDynamicBuckets, co as QuoteStatus, cp as QuoteUiMessage, cr as RefreshQuoteInput, cs as RefreshQuoteResult, cT as SchedulingService, dy as createElements } from './client-D22iSqke.js';
2
- import './product-BgFOFmQw.js';
3
- import './payment-mVIJIJcq.js';
1
+ export { k as AuthService, C as BusinessService, P as CartOperations, Q as CatalogueQueries, a9 as CheckoutOperations, a9 as CheckoutService, af as CimplifyElement, ag as CimplifyElements, aH as ELEMENT_TYPES, aI as EVENT_TYPES, aL as ElementEventType, aM as ElementOptions, aN as ElementType, aV as ElementsOptions, b1 as FetchQuoteInput, b9 as FxService, bd as GetProductsOptions, bg as InventoryService, bn as LinkService, br as LiteService, by as MESSAGE_TYPES, b$ as OrderQueries, ci as PriceQuote, co as QuoteBundleSelectionInput, cp as QuoteCompositeSelectionInput, cq as QuoteDynamicBuckets, cr as QuoteStatus, cs as QuoteUiMessage, cu as RefreshQuoteInput, cv as RefreshQuoteResult, cW as SchedulingService, dB as createElements } from './client-xc2aQSB4.js';
2
+ import './product-DXhjLQ_w.js';
3
+ import './payment-nH9OCUg2.js';
4
4
 
5
5
  declare function generateIdempotencyKey(prefix?: string): string;
6
6
 
package/dist/advanced.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkCV5QMDQS_js = require('./chunk-CV5QMDQS.js');
3
+ var chunkHPN5R3K2_js = require('./chunk-HPN5R3K2.js');
4
4
  require('./chunk-7Y2O3E4D.js');
5
5
  require('./chunk-XA3ZNR75.js');
6
6
  require('./chunk-OWW5GUSB.js');
@@ -9,77 +9,77 @@ require('./chunk-OWW5GUSB.js');
9
9
 
10
10
  Object.defineProperty(exports, "AuthService", {
11
11
  enumerable: true,
12
- get: function () { return chunkCV5QMDQS_js.AuthService; }
12
+ get: function () { return chunkHPN5R3K2_js.AuthService; }
13
13
  });
14
14
  Object.defineProperty(exports, "BusinessService", {
15
15
  enumerable: true,
16
- get: function () { return chunkCV5QMDQS_js.BusinessService; }
16
+ get: function () { return chunkHPN5R3K2_js.BusinessService; }
17
17
  });
18
18
  Object.defineProperty(exports, "CartOperations", {
19
19
  enumerable: true,
20
- get: function () { return chunkCV5QMDQS_js.CartOperations; }
20
+ get: function () { return chunkHPN5R3K2_js.CartOperations; }
21
21
  });
22
22
  Object.defineProperty(exports, "CatalogueQueries", {
23
23
  enumerable: true,
24
- get: function () { return chunkCV5QMDQS_js.CatalogueQueries; }
24
+ get: function () { return chunkHPN5R3K2_js.CatalogueQueries; }
25
25
  });
26
26
  Object.defineProperty(exports, "CheckoutOperations", {
27
27
  enumerable: true,
28
- get: function () { return chunkCV5QMDQS_js.CheckoutService; }
28
+ get: function () { return chunkHPN5R3K2_js.CheckoutService; }
29
29
  });
30
30
  Object.defineProperty(exports, "CheckoutService", {
31
31
  enumerable: true,
32
- get: function () { return chunkCV5QMDQS_js.CheckoutService; }
32
+ get: function () { return chunkHPN5R3K2_js.CheckoutService; }
33
33
  });
34
34
  Object.defineProperty(exports, "CimplifyElement", {
35
35
  enumerable: true,
36
- get: function () { return chunkCV5QMDQS_js.CimplifyElement; }
36
+ get: function () { return chunkHPN5R3K2_js.CimplifyElement; }
37
37
  });
38
38
  Object.defineProperty(exports, "CimplifyElements", {
39
39
  enumerable: true,
40
- get: function () { return chunkCV5QMDQS_js.CimplifyElements; }
40
+ get: function () { return chunkHPN5R3K2_js.CimplifyElements; }
41
41
  });
42
42
  Object.defineProperty(exports, "ELEMENT_TYPES", {
43
43
  enumerable: true,
44
- get: function () { return chunkCV5QMDQS_js.ELEMENT_TYPES; }
44
+ get: function () { return chunkHPN5R3K2_js.ELEMENT_TYPES; }
45
45
  });
46
46
  Object.defineProperty(exports, "EVENT_TYPES", {
47
47
  enumerable: true,
48
- get: function () { return chunkCV5QMDQS_js.EVENT_TYPES; }
48
+ get: function () { return chunkHPN5R3K2_js.EVENT_TYPES; }
49
49
  });
50
50
  Object.defineProperty(exports, "FxService", {
51
51
  enumerable: true,
52
- get: function () { return chunkCV5QMDQS_js.FxService; }
52
+ get: function () { return chunkHPN5R3K2_js.FxService; }
53
53
  });
54
54
  Object.defineProperty(exports, "InventoryService", {
55
55
  enumerable: true,
56
- get: function () { return chunkCV5QMDQS_js.InventoryService; }
56
+ get: function () { return chunkHPN5R3K2_js.InventoryService; }
57
57
  });
58
58
  Object.defineProperty(exports, "LinkService", {
59
59
  enumerable: true,
60
- get: function () { return chunkCV5QMDQS_js.LinkService; }
60
+ get: function () { return chunkHPN5R3K2_js.LinkService; }
61
61
  });
62
62
  Object.defineProperty(exports, "LiteService", {
63
63
  enumerable: true,
64
- get: function () { return chunkCV5QMDQS_js.LiteService; }
64
+ get: function () { return chunkHPN5R3K2_js.LiteService; }
65
65
  });
66
66
  Object.defineProperty(exports, "MESSAGE_TYPES", {
67
67
  enumerable: true,
68
- get: function () { return chunkCV5QMDQS_js.MESSAGE_TYPES; }
68
+ get: function () { return chunkHPN5R3K2_js.MESSAGE_TYPES; }
69
69
  });
70
70
  Object.defineProperty(exports, "OrderQueries", {
71
71
  enumerable: true,
72
- get: function () { return chunkCV5QMDQS_js.OrderQueries; }
72
+ get: function () { return chunkHPN5R3K2_js.OrderQueries; }
73
73
  });
74
74
  Object.defineProperty(exports, "SchedulingService", {
75
75
  enumerable: true,
76
- get: function () { return chunkCV5QMDQS_js.SchedulingService; }
76
+ get: function () { return chunkHPN5R3K2_js.SchedulingService; }
77
77
  });
78
78
  Object.defineProperty(exports, "createElements", {
79
79
  enumerable: true,
80
- get: function () { return chunkCV5QMDQS_js.createElements; }
80
+ get: function () { return chunkHPN5R3K2_js.createElements; }
81
81
  });
82
82
  Object.defineProperty(exports, "generateIdempotencyKey", {
83
83
  enumerable: true,
84
- get: function () { return chunkCV5QMDQS_js.generateIdempotencyKey; }
84
+ get: function () { return chunkHPN5R3K2_js.generateIdempotencyKey; }
85
85
  });
package/dist/advanced.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { AuthService, BusinessService, CartOperations, CatalogueQueries, CheckoutService as CheckoutOperations, CheckoutService, CimplifyElement, CimplifyElements, ELEMENT_TYPES, EVENT_TYPES, FxService, InventoryService, LinkService, LiteService, MESSAGE_TYPES, OrderQueries, SchedulingService, createElements, generateIdempotencyKey } from './chunk-3BKMNVTR.mjs';
1
+ export { AuthService, BusinessService, CartOperations, CatalogueQueries, CheckoutService as CheckoutOperations, CheckoutService, CimplifyElement, CimplifyElements, ELEMENT_TYPES, EVENT_TYPES, FxService, InventoryService, LinkService, LiteService, MESSAGE_TYPES, OrderQueries, SchedulingService, createElements, generateIdempotencyKey } from './chunk-7BM56JET.mjs';
2
2
  import './chunk-TD3AY34U.mjs';
3
3
  import './chunk-AMZXALF6.mjs';
4
4
  import './chunk-3G6RQLXK.mjs';
@@ -1634,6 +1634,7 @@ var CheckoutService = class {
1634
1634
  customer: data.customer,
1635
1635
  order_type: data.order_type,
1636
1636
  address_info: data.address_info,
1637
+ delivery_rate_id: data.delivery_rate_id,
1637
1638
  payment_method: data.payment_method,
1638
1639
  mobile_money_details: data.mobile_money_details,
1639
1640
  special_instructions: data.special_instructions,
@@ -1,5 +1,5 @@
1
- import { createMockApp } from './chunk-BNA4GW4D.mjs';
2
- import { createCimplifyClient } from './chunk-NJGJCQWF.mjs';
1
+ import { createMockApp } from './chunk-BRVIXGUW.mjs';
2
+ import { createCimplifyClient } from './chunk-NWUEWUX2.mjs';
3
3
  import { z } from 'zod';
4
4
 
5
5
  var cimplifyRegistry = z.registry();
@@ -2403,6 +2403,17 @@ function buildV1(deps) {
2403
2403
  })
2404
2404
  )
2405
2405
  );
2406
+ app.get(
2407
+ "/delivery/options",
2408
+ (c) => tryRoute(
2409
+ c,
2410
+ () => deps.delivery.getOptions({
2411
+ lat: getQueryNum(c, "dropoff_lat"),
2412
+ lng: getQueryNum(c, "dropoff_lng"),
2413
+ order_value: c.req.query("order_value")
2414
+ })
2415
+ )
2416
+ );
2406
2417
  app.post("/places/autocomplete", async (c) => {
2407
2418
  const body = await c.req.json().catch(() => ({}));
2408
2419
  return tryRoute(c, () => deps.places.autocomplete({ query: body.input ?? body.query ?? "", country: body.country }));
@@ -5313,6 +5324,22 @@ function createPlacesService() {
5313
5324
  }
5314
5325
 
5315
5326
  // src/mock/domain/delivery.ts
5327
+ function optionDetails(rateId, rateName) {
5328
+ return {
5329
+ zone_id: "dlvz_mock",
5330
+ zone_name: "Mock Zone",
5331
+ provider: "manual",
5332
+ provider_resolved_from: "zone",
5333
+ rate_id: rateId,
5334
+ rate_name: rateName,
5335
+ distance_km: "4.20",
5336
+ base_fee: money(5),
5337
+ per_km_fee: money(2),
5338
+ surge_multiplier: "1",
5339
+ calculated_fee: money(15),
5340
+ currency: "GHS"
5341
+ };
5342
+ }
5316
5343
  function createDeliveryService() {
5317
5344
  return {
5318
5345
  getFee(opts) {
@@ -5329,6 +5356,39 @@ function createDeliveryService() {
5329
5356
  { provider: "uber", fee: money(22), eta_minutes: 28 }
5330
5357
  ]
5331
5358
  };
5359
+ },
5360
+ getOptions(opts) {
5361
+ const orderValue = parseFloat(opts.order_value ?? "0");
5362
+ const standardFree = orderValue >= 200;
5363
+ return {
5364
+ serviceable: true,
5365
+ options: [
5366
+ {
5367
+ rate_id: "dlvrt_mock_standard",
5368
+ name: "Standard",
5369
+ fee: standardFree ? money(0) : money(15),
5370
+ currency: "GHS",
5371
+ free_delivery_applied: standardFree,
5372
+ free_over_amount: money(200),
5373
+ eta_min_minutes: 45,
5374
+ eta_max_minutes: 90,
5375
+ is_default: true,
5376
+ details: optionDetails("dlvrt_mock_standard", "Standard")
5377
+ },
5378
+ {
5379
+ rate_id: "dlvrt_mock_express",
5380
+ name: "Express",
5381
+ description: "Delivered within the hour",
5382
+ fee: money(25),
5383
+ currency: "GHS",
5384
+ free_delivery_applied: false,
5385
+ eta_min_minutes: 30,
5386
+ eta_max_minutes: 60,
5387
+ is_default: false,
5388
+ details: optionDetails("dlvrt_mock_express", "Express")
5389
+ }
5390
+ ]
5391
+ };
5332
5392
  }
5333
5393
  };
5334
5394
  }
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkCV5QMDQS_js = require('./chunk-CV5QMDQS.js');
3
+ var chunkHPN5R3K2_js = require('./chunk-HPN5R3K2.js');
4
4
  var chunkXA3ZNR75_js = require('./chunk-XA3ZNR75.js');
5
5
 
6
6
  // src/store-credit.ts
@@ -13,7 +13,7 @@ var StoreCreditQueries = class {
13
13
  * currency. Requires a signed-in customer; returns an error otherwise.
14
14
  */
15
15
  async balance() {
16
- return chunkCV5QMDQS_js.safe(this.client.get("/api/v1/store-credit/balance"));
16
+ return chunkHPN5R3K2_js.safe(this.client.get("/api/v1/store-credit/balance"));
17
17
  }
18
18
  };
19
19
 
@@ -95,7 +95,7 @@ var ActivityService = class {
95
95
  this.sendEvents([event]);
96
96
  }
97
97
  async getState() {
98
- return chunkCV5QMDQS_js.safe(this.client.get("/api/v1/activity/state"));
98
+ return chunkHPN5R3K2_js.safe(this.client.get("/api/v1/activity/state"));
99
99
  }
100
100
  async getRecommendations(options) {
101
101
  const params = new URLSearchParams();
@@ -103,10 +103,10 @@ var ActivityService = class {
103
103
  if (options?.limit) params.set("limit", String(options.limit));
104
104
  const query = params.toString();
105
105
  const path = query ? `/api/v1/activity/recommendations?${query}` : "/api/v1/activity/recommendations";
106
- return chunkCV5QMDQS_js.safe(this.client.get(path));
106
+ return chunkHPN5R3K2_js.safe(this.client.get(path));
107
107
  }
108
108
  async dismissMessage(code) {
109
- return chunkCV5QMDQS_js.safe(
109
+ return chunkHPN5R3K2_js.safe(
110
110
  this.client.post("/api/v1/activity/messages/dismiss", { code })
111
111
  );
112
112
  }
@@ -142,16 +142,16 @@ var SubscriptionService = class {
142
142
  this.client = client;
143
143
  }
144
144
  async list() {
145
- return chunkCV5QMDQS_js.safe(this.client.get("/api/v1/subscriptions"));
145
+ return chunkHPN5R3K2_js.safe(this.client.get("/api/v1/subscriptions"));
146
146
  }
147
147
  async get(id) {
148
148
  const encodedId = encodeURIComponent(id);
149
- return chunkCV5QMDQS_js.safe(this.client.get(`/api/v1/subscriptions/${encodedId}`));
149
+ return chunkHPN5R3K2_js.safe(this.client.get(`/api/v1/subscriptions/${encodedId}`));
150
150
  }
151
151
  async cancel(id, reason, opts) {
152
152
  const encodedId = encodeURIComponent(id);
153
- const idempotencyKey = opts?.idempotencyKey ?? chunkCV5QMDQS_js.generateIdempotencyKey();
154
- return chunkCV5QMDQS_js.safe(
153
+ const idempotencyKey = opts?.idempotencyKey ?? chunkHPN5R3K2_js.generateIdempotencyKey();
154
+ return chunkHPN5R3K2_js.safe(
155
155
  this.client.post(
156
156
  `/api/v1/subscriptions/${encodedId}/cancel`,
157
157
  { reason },
@@ -161,20 +161,20 @@ var SubscriptionService = class {
161
161
  }
162
162
  async pause(id) {
163
163
  const encodedId = encodeURIComponent(id);
164
- return chunkCV5QMDQS_js.safe(
164
+ return chunkHPN5R3K2_js.safe(
165
165
  this.client.post(`/api/v1/subscriptions/${encodedId}/pause`)
166
166
  );
167
167
  }
168
168
  async resume(id) {
169
169
  const encodedId = encodeURIComponent(id);
170
- return chunkCV5QMDQS_js.safe(
170
+ return chunkHPN5R3K2_js.safe(
171
171
  this.client.post(`/api/v1/subscriptions/${encodedId}/resume`)
172
172
  );
173
173
  }
174
174
  async skipNextRenewal(id, opts) {
175
175
  const encodedId = encodeURIComponent(id);
176
- const idempotencyKey = opts?.idempotencyKey ?? chunkCV5QMDQS_js.generateIdempotencyKey();
177
- return chunkCV5QMDQS_js.safe(
176
+ const idempotencyKey = opts?.idempotencyKey ?? chunkHPN5R3K2_js.generateIdempotencyKey();
177
+ return chunkHPN5R3K2_js.safe(
178
178
  this.client.post(
179
179
  `/api/v1/subscriptions/${encodedId}/skip`,
180
180
  void 0,
@@ -190,8 +190,8 @@ var UploadService = class {
190
190
  this.client = client;
191
191
  }
192
192
  async init(filename, contentType, sizeBytes, opts) {
193
- const idempotencyKey = opts?.idempotencyKey ?? chunkCV5QMDQS_js.generateIdempotencyKey();
194
- return chunkCV5QMDQS_js.safe(
193
+ const idempotencyKey = opts?.idempotencyKey ?? chunkHPN5R3K2_js.generateIdempotencyKey();
194
+ return chunkHPN5R3K2_js.safe(
195
195
  this.client.post(
196
196
  "/api/v1/uploads/init",
197
197
  {
@@ -204,7 +204,7 @@ var UploadService = class {
204
204
  );
205
205
  }
206
206
  async confirm(uploadId) {
207
- return chunkCV5QMDQS_js.safe(
207
+ return chunkHPN5R3K2_js.safe(
208
208
  this.client.post("/api/v1/uploads/confirm", {
209
209
  upload_id: uploadId
210
210
  })
@@ -250,7 +250,7 @@ var PlacesService = class {
250
250
  this.client = client;
251
251
  }
252
252
  async autocomplete(input, sessionToken) {
253
- return chunkCV5QMDQS_js.safe(
253
+ return chunkHPN5R3K2_js.safe(
254
254
  this.client.post("/api/v1/places/autocomplete", {
255
255
  input,
256
256
  sessionToken
@@ -258,7 +258,7 @@ var PlacesService = class {
258
258
  );
259
259
  }
260
260
  async details(placeId, sessionToken) {
261
- return chunkCV5QMDQS_js.safe(
261
+ return chunkHPN5R3K2_js.safe(
262
262
  this.client.post("/api/v1/places/details", {
263
263
  place_id: placeId,
264
264
  sessionToken
@@ -277,10 +277,22 @@ var DeliveryService = class {
277
277
  params.set("dropoff_lat", String(dropoffLat));
278
278
  params.set("dropoff_lng", String(dropoffLng));
279
279
  if (country) params.set("country", country);
280
- return chunkCV5QMDQS_js.safe(
280
+ return chunkHPN5R3K2_js.safe(
281
281
  this.client.get(`/api/v1/delivery/fee?${params.toString()}`)
282
282
  );
283
283
  }
284
+ /** The full delivery menu for an address. Pass the selected option's
285
+ * `rate_id` as `delivery_rate_id` when processing checkout. */
286
+ async getOptions(dropoffLat, dropoffLng, opts) {
287
+ const params = new URLSearchParams();
288
+ params.set("dropoff_lat", String(dropoffLat));
289
+ params.set("dropoff_lng", String(dropoffLng));
290
+ if (opts?.country) params.set("country", opts.country);
291
+ if (opts?.orderValue != null) params.set("order_value", String(opts.orderValue));
292
+ return chunkHPN5R3K2_js.safe(
293
+ this.client.get(`/api/v1/delivery/options?${params.toString()}`)
294
+ );
295
+ }
284
296
  };
285
297
 
286
298
  // src/support.ts
@@ -290,8 +302,8 @@ var SupportService = class {
290
302
  }
291
303
  /** Open (or resume) the customer's widget conversation. */
292
304
  async openConversation(opts) {
293
- const idempotencyKey = opts?.idempotencyKey ?? chunkCV5QMDQS_js.generateIdempotencyKey();
294
- return chunkCV5QMDQS_js.safe(
305
+ const idempotencyKey = opts?.idempotencyKey ?? chunkHPN5R3K2_js.generateIdempotencyKey();
306
+ return chunkHPN5R3K2_js.safe(
295
307
  this.client.post("/api/v1/support/conversation", void 0, {
296
308
  idempotencyKey
297
309
  })
@@ -299,8 +311,8 @@ var SupportService = class {
299
311
  }
300
312
  /** Send a message in the active conversation. */
301
313
  async sendMessage(content, opts) {
302
- const idempotencyKey = opts?.idempotencyKey ?? chunkCV5QMDQS_js.generateIdempotencyKey();
303
- return chunkCV5QMDQS_js.safe(
314
+ const idempotencyKey = opts?.idempotencyKey ?? chunkHPN5R3K2_js.generateIdempotencyKey();
315
+ return chunkHPN5R3K2_js.safe(
304
316
  this.client.post(
305
317
  "/api/v1/support/conversation/messages",
306
318
  { content },
@@ -315,7 +327,7 @@ var SupportService = class {
315
327
  if (options.limit) params.set("limit", String(options.limit));
316
328
  const query = params.toString();
317
329
  const path = query ? `/api/v1/support/conversation/messages?${query}` : "/api/v1/support/conversation/messages";
318
- return chunkCV5QMDQS_js.safe(this.client.get(path));
330
+ return chunkHPN5R3K2_js.safe(this.client.get(path));
319
331
  }
320
332
  };
321
333
 
@@ -910,25 +922,25 @@ var CimplifyClient = class {
910
922
  }
911
923
  get catalogue() {
912
924
  if (!this._catalogue) {
913
- this._catalogue = new chunkCV5QMDQS_js.CatalogueQueries(this);
925
+ this._catalogue = new chunkHPN5R3K2_js.CatalogueQueries(this);
914
926
  }
915
927
  return this._catalogue;
916
928
  }
917
929
  get cart() {
918
930
  if (!this._cart) {
919
- this._cart = new chunkCV5QMDQS_js.CartOperations(this);
931
+ this._cart = new chunkHPN5R3K2_js.CartOperations(this);
920
932
  }
921
933
  return this._cart;
922
934
  }
923
935
  get checkout() {
924
936
  if (!this._checkout) {
925
- this._checkout = new chunkCV5QMDQS_js.CheckoutService(this);
937
+ this._checkout = new chunkHPN5R3K2_js.CheckoutService(this);
926
938
  }
927
939
  return this._checkout;
928
940
  }
929
941
  get orders() {
930
942
  if (!this._orders) {
931
- this._orders = new chunkCV5QMDQS_js.OrderQueries(this);
943
+ this._orders = new chunkHPN5R3K2_js.OrderQueries(this);
932
944
  }
933
945
  return this._orders;
934
946
  }
@@ -958,43 +970,43 @@ var CimplifyClient = class {
958
970
  }
959
971
  get link() {
960
972
  if (!this._link) {
961
- this._link = new chunkCV5QMDQS_js.LinkService(this);
973
+ this._link = new chunkHPN5R3K2_js.LinkService(this);
962
974
  }
963
975
  return this._link;
964
976
  }
965
977
  get auth() {
966
978
  if (!this._auth) {
967
- this._auth = new chunkCV5QMDQS_js.AuthService(this);
979
+ this._auth = new chunkHPN5R3K2_js.AuthService(this);
968
980
  }
969
981
  return this._auth;
970
982
  }
971
983
  get business() {
972
984
  if (!this._business) {
973
- this._business = new chunkCV5QMDQS_js.BusinessService(this);
985
+ this._business = new chunkHPN5R3K2_js.BusinessService(this);
974
986
  }
975
987
  return this._business;
976
988
  }
977
989
  get inventory() {
978
990
  if (!this._inventory) {
979
- this._inventory = new chunkCV5QMDQS_js.InventoryService(this);
991
+ this._inventory = new chunkHPN5R3K2_js.InventoryService(this);
980
992
  }
981
993
  return this._inventory;
982
994
  }
983
995
  get scheduling() {
984
996
  if (!this._scheduling) {
985
- this._scheduling = new chunkCV5QMDQS_js.SchedulingService(this);
997
+ this._scheduling = new chunkHPN5R3K2_js.SchedulingService(this);
986
998
  }
987
999
  return this._scheduling;
988
1000
  }
989
1001
  get lite() {
990
1002
  if (!this._lite) {
991
- this._lite = new chunkCV5QMDQS_js.LiteService(this);
1003
+ this._lite = new chunkHPN5R3K2_js.LiteService(this);
992
1004
  }
993
1005
  return this._lite;
994
1006
  }
995
1007
  get fx() {
996
1008
  if (!this._fx) {
997
- this._fx = new chunkCV5QMDQS_js.FxService(this);
1009
+ this._fx = new chunkHPN5R3K2_js.FxService(this);
998
1010
  }
999
1011
  return this._fx;
1000
1012
  }
@@ -1029,7 +1041,7 @@ var CimplifyClient = class {
1029
1041
  if (businessId) {
1030
1042
  this.setBusinessId(businessId);
1031
1043
  }
1032
- return chunkCV5QMDQS_js.createElements(this, businessId ?? this.businessId ?? void 0, options);
1044
+ return chunkHPN5R3K2_js.createElements(this, businessId ?? this.businessId ?? void 0, options);
1033
1045
  }
1034
1046
  };
1035
1047
  function createCimplifyClient(config = {}) {
@@ -1636,6 +1636,7 @@ var CheckoutService = class {
1636
1636
  customer: data.customer,
1637
1637
  order_type: data.order_type,
1638
1638
  address_info: data.address_info,
1639
+ delivery_rate_id: data.delivery_rate_id,
1639
1640
  payment_method: data.payment_method,
1640
1641
  mobile_money_details: data.mobile_money_details,
1641
1642
  special_instructions: data.special_instructions,
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkOSTOGR4F_js = require('./chunk-OSTOGR4F.js');
4
- var chunkNV445GMS_js = require('./chunk-NV445GMS.js');
3
+ var chunkSRJEMEVZ_js = require('./chunk-SRJEMEVZ.js');
4
+ var chunkGFM5JW45_js = require('./chunk-GFM5JW45.js');
5
5
  var zod = require('zod');
6
6
 
7
7
  var cimplifyRegistry = zod.z.registry();
@@ -598,7 +598,7 @@ async function toForwardedRequest(input, init) {
598
598
  };
599
599
  }
600
600
  function createTestClient(options = {}) {
601
- const mock = chunkOSTOGR4F_js.createMockApp(options);
601
+ const mock = chunkSRJEMEVZ_js.createMockApp(options);
602
602
  let sessionToken;
603
603
  const fetchImpl = async (input, init) => {
604
604
  const url = typeof input === "string" ? input : input instanceof URL ? input.toString() : input.url;
@@ -617,7 +617,7 @@ function createTestClient(options = {}) {
617
617
  if (echoed) sessionToken = echoed;
618
618
  return res;
619
619
  };
620
- const client = chunkNV445GMS_js.createCimplifyClient({
620
+ const client = chunkGFM5JW45_js.createCimplifyClient({
621
621
  baseUrl: TEST_BASE_URL,
622
622
  // Link mock lives at /v1/link on the same Hono app, so point the SDK's
623
623
  // separate Link transport at the same TEST_BASE_URL.
@@ -1,4 +1,4 @@
1
- import { safe, generateIdempotencyKey, CatalogueQueries, CartOperations, CheckoutService, OrderQueries, LinkService, AuthService, BusinessService, InventoryService, SchedulingService, LiteService, FxService, createElements } from './chunk-3BKMNVTR.mjs';
1
+ import { safe, generateIdempotencyKey, CatalogueQueries, CartOperations, CheckoutService, OrderQueries, LinkService, AuthService, BusinessService, InventoryService, SchedulingService, LiteService, FxService, createElements } from './chunk-7BM56JET.mjs';
2
2
  import { CimplifyError, ErrorCode, IdempotencyMismatchError, enrichError } from './chunk-AMZXALF6.mjs';
3
3
 
4
4
  // src/store-credit.ts
@@ -279,6 +279,18 @@ var DeliveryService = class {
279
279
  this.client.get(`/api/v1/delivery/fee?${params.toString()}`)
280
280
  );
281
281
  }
282
+ /** The full delivery menu for an address. Pass the selected option's
283
+ * `rate_id` as `delivery_rate_id` when processing checkout. */
284
+ async getOptions(dropoffLat, dropoffLng, opts) {
285
+ const params = new URLSearchParams();
286
+ params.set("dropoff_lat", String(dropoffLat));
287
+ params.set("dropoff_lng", String(dropoffLng));
288
+ if (opts?.country) params.set("country", opts.country);
289
+ if (opts?.orderValue != null) params.set("order_value", String(opts.orderValue));
290
+ return safe(
291
+ this.client.get(`/api/v1/delivery/options?${params.toString()}`)
292
+ );
293
+ }
282
294
  };
283
295
 
284
296
  // src/support.ts
@@ -2405,6 +2405,17 @@ function buildV1(deps) {
2405
2405
  })
2406
2406
  )
2407
2407
  );
2408
+ app.get(
2409
+ "/delivery/options",
2410
+ (c) => tryRoute(
2411
+ c,
2412
+ () => deps.delivery.getOptions({
2413
+ lat: getQueryNum(c, "dropoff_lat"),
2414
+ lng: getQueryNum(c, "dropoff_lng"),
2415
+ order_value: c.req.query("order_value")
2416
+ })
2417
+ )
2418
+ );
2408
2419
  app.post("/places/autocomplete", async (c) => {
2409
2420
  const body = await c.req.json().catch(() => ({}));
2410
2421
  return tryRoute(c, () => deps.places.autocomplete({ query: body.input ?? body.query ?? "", country: body.country }));
@@ -5315,6 +5326,22 @@ function createPlacesService() {
5315
5326
  }
5316
5327
 
5317
5328
  // src/mock/domain/delivery.ts
5329
+ function optionDetails(rateId, rateName) {
5330
+ return {
5331
+ zone_id: "dlvz_mock",
5332
+ zone_name: "Mock Zone",
5333
+ provider: "manual",
5334
+ provider_resolved_from: "zone",
5335
+ rate_id: rateId,
5336
+ rate_name: rateName,
5337
+ distance_km: "4.20",
5338
+ base_fee: money(5),
5339
+ per_km_fee: money(2),
5340
+ surge_multiplier: "1",
5341
+ calculated_fee: money(15),
5342
+ currency: "GHS"
5343
+ };
5344
+ }
5318
5345
  function createDeliveryService() {
5319
5346
  return {
5320
5347
  getFee(opts) {
@@ -5331,6 +5358,39 @@ function createDeliveryService() {
5331
5358
  { provider: "uber", fee: money(22), eta_minutes: 28 }
5332
5359
  ]
5333
5360
  };
5361
+ },
5362
+ getOptions(opts) {
5363
+ const orderValue = parseFloat(opts.order_value ?? "0");
5364
+ const standardFree = orderValue >= 200;
5365
+ return {
5366
+ serviceable: true,
5367
+ options: [
5368
+ {
5369
+ rate_id: "dlvrt_mock_standard",
5370
+ name: "Standard",
5371
+ fee: standardFree ? money(0) : money(15),
5372
+ currency: "GHS",
5373
+ free_delivery_applied: standardFree,
5374
+ free_over_amount: money(200),
5375
+ eta_min_minutes: 45,
5376
+ eta_max_minutes: 90,
5377
+ is_default: true,
5378
+ details: optionDetails("dlvrt_mock_standard", "Standard")
5379
+ },
5380
+ {
5381
+ rate_id: "dlvrt_mock_express",
5382
+ name: "Express",
5383
+ description: "Delivered within the hour",
5384
+ fee: money(25),
5385
+ currency: "GHS",
5386
+ free_delivery_applied: false,
5387
+ eta_min_minutes: 30,
5388
+ eta_max_minutes: 60,
5389
+ is_default: false,
5390
+ details: optionDetails("dlvrt_mock_express", "Express")
5391
+ }
5392
+ ]
5393
+ };
5334
5394
  }
5335
5395
  };
5336
5396
  }
@@ -1,5 +1,5 @@
1
- import { ad as CimplifyClient } from './client-Czbt-mej.mjs';
2
- import { A as AppHandle, C as CreateAppOptions } from './server-CGO4zneR.mjs';
1
+ import { ad as CimplifyClient } from './client-DnHP_2Jw.mjs';
2
+ import { A as AppHandle, C as CreateAppOptions } from './server-tr993CPj.mjs';
3
3
 
4
4
  /**
5
5
  * Test client + fixtures.
@@ -1,5 +1,5 @@
1
- import { ad as CimplifyClient } from './client-D22iSqke.js';
2
- import { A as AppHandle, C as CreateAppOptions } from './server-Daq42vK7.js';
1
+ import { ad as CimplifyClient } from './client-xc2aQSB4.js';
2
+ import { A as AppHandle, C as CreateAppOptions } from './server-wAB-qfyZ.js';
3
3
 
4
4
  /**
5
5
  * Test client + fixtures.