@cimplify/sdk 0.52.2 → 0.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ads-BxbWrwqp.d.mts → ads-C2c2Aald.d.mts} +1 -1
- package/dist/{ads-BxbWrwqp.d.ts → ads-C2c2Aald.d.ts} +1 -1
- package/dist/advanced.d.mts +3 -3
- package/dist/advanced.d.ts +3 -3
- package/dist/advanced.js +20 -20
- package/dist/advanced.mjs +1 -1
- package/dist/{chunk-R3F55BRN.mjs → chunk-3G4QCENX.mjs} +42 -22
- package/dist/{chunk-APHYBBDD.mjs → chunk-6QZQQRBB.mjs} +20 -9
- package/dist/{chunk-GLAVTDDE.mjs → chunk-B3Y4C4A7.mjs} +56 -53
- package/dist/{chunk-ROURLUXG.js → chunk-EJUKGJTZ.js} +4 -4
- package/dist/{chunk-Q5VGDCQF.js → chunk-HCZTBWU4.js} +42 -22
- package/dist/{chunk-EMS6DQIX.js → chunk-IJ32BXKZ.js} +54 -43
- package/dist/{chunk-VZS453ON.mjs → chunk-NEK7CVE2.mjs} +2 -2
- package/dist/{chunk-EQLT46ZR.js → chunk-YJLOOC3L.js} +56 -53
- package/dist/{client-C6J_RGlr.d.mts → client-306peWZ0.d.ts} +47 -29
- package/dist/{client-CX7IFIkL.d.ts → client-Bj2apl_y.d.mts} +47 -29
- package/dist/{client-Lt7uGLmT.d.ts → client-C2bKMy5g.d.ts} +2 -2
- package/dist/{client-DdefKjcs.d.mts → client-D1Gknspz.d.mts} +2 -2
- package/dist/{index-Bo0NjgR6.d.mts → index-D8vnKlOQ.d.mts} +4 -4
- package/dist/{index-BAohYhdg.d.ts → index-DIIlPUOC.d.ts} +4 -4
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +61 -61
- package/dist/index.mjs +2 -2
- package/dist/mock/cli.mjs +42 -22
- package/dist/mock/library.js +42 -22
- package/dist/mock/library.mjs +42 -22
- package/dist/mock/msw.js +42 -22
- package/dist/mock/msw.mjs +42 -22
- package/dist/{payment-_e99nSRj.d.ts → payment-DVS7ZUEp.d.mts} +2 -2
- package/dist/{payment-9L_-GWqQ.d.mts → payment-sn-yGL7v.d.ts} +2 -2
- package/dist/{price-BjehlIhG.d.mts → price-9T1Y47oS.d.ts} +2 -2
- package/dist/{price-CWQ5TQmk.d.ts → price-Cm0tU0V5.d.mts} +2 -2
- package/dist/{product-C-xLzh7Q.d.ts → product-B_kS4Oxa.d.mts} +1 -1
- package/dist/{product-C-xLzh7Q.d.mts → product-B_kS4Oxa.d.ts} +1 -1
- package/dist/react.d.mts +6 -6
- package/dist/react.d.ts +6 -6
- package/dist/react.js +16 -16
- package/dist/react.mjs +2 -2
- package/dist/{server-72rzvJ4Y.d.ts → server-BQzz921M.d.ts} +1 -1
- package/dist/{server-BgccqOLT.d.mts → server-D8rwqZQ6.d.mts} +1 -1
- package/dist/server.d.mts +20 -12
- package/dist/server.d.ts +20 -12
- package/dist/server.js +3 -3
- package/dist/server.mjs +2 -2
- package/dist/testing/msw.d.mts +2 -2
- package/dist/testing/msw.d.ts +2 -2
- package/dist/testing/msw.js +2 -2
- package/dist/testing/msw.mjs +1 -1
- package/dist/testing/suite.d.mts +6 -6
- package/dist/testing/suite.d.ts +6 -6
- package/dist/testing/suite.js +23 -23
- package/dist/testing/suite.mjs +4 -4
- package/dist/testing.d.mts +5 -5
- package/dist/testing.d.ts +5 -5
- package/dist/testing.js +79 -79
- package/dist/testing.mjs +5 -5
- package/dist/utils.d.mts +4 -4
- package/dist/utils.d.ts +4 -4
- package/package.json +1 -1
|
@@ -25,4 +25,4 @@ interface AdContextValue {
|
|
|
25
25
|
isLoading: boolean;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
export { type
|
|
28
|
+
export { type AdConfig as A, type AdContextValue as a, type AdCreative as b, type AdPosition as c, type AdSlot as d, type AdTheme as e, getVariantDisplayName as g };
|
|
@@ -25,4 +25,4 @@ interface AdContextValue {
|
|
|
25
25
|
isLoading: boolean;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
export { type
|
|
28
|
+
export { type AdConfig as A, type AdContextValue as a, type AdCreative as b, type AdPosition as c, type AdSlot as d, type AdTheme as e, getVariantDisplayName as g };
|
package/dist/advanced.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export {
|
|
2
|
-
import './product-
|
|
3
|
-
import './payment-
|
|
1
|
+
export { k as AuthService, z as BusinessService, O as CartOperations, P as CatalogueQueries, a8 as CheckoutOperations, a8 as CheckoutService, ae as CimplifyElement, af as CimplifyElements, aB as ELEMENT_TYPES, aC as EVENT_TYPES, aF as ElementEventType, aG as ElementOptions, aH as ElementType, aL as ElementsOptions, aR as FetchQuoteInput, aY as FxService, a$ as GetProductsOptions, b1 as InventoryService, b8 as LinkService, bc as LiteService, bj as MESSAGE_TYPES, bI as OrderQueries, bY as PriceQuote, c2 as QuoteBundleSelectionInput, c3 as QuoteCompositeSelectionInput, c4 as QuoteDynamicBuckets, c5 as QuoteStatus, c6 as QuoteUiMessage, c8 as RefreshQuoteInput, c9 as RefreshQuoteResult, cA as SchedulingService, dc as createElements } from './client-Bj2apl_y.mjs';
|
|
2
|
+
import './product-B_kS4Oxa.mjs';
|
|
3
|
+
import './payment-DVS7ZUEp.mjs';
|
|
4
4
|
|
|
5
5
|
declare function generateIdempotencyKey(prefix?: string): string;
|
|
6
6
|
|
package/dist/advanced.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export {
|
|
2
|
-
import './product-
|
|
3
|
-
import './payment-
|
|
1
|
+
export { k as AuthService, z as BusinessService, O as CartOperations, P as CatalogueQueries, a8 as CheckoutOperations, a8 as CheckoutService, ae as CimplifyElement, af as CimplifyElements, aB as ELEMENT_TYPES, aC as EVENT_TYPES, aF as ElementEventType, aG as ElementOptions, aH as ElementType, aL as ElementsOptions, aR as FetchQuoteInput, aY as FxService, a$ as GetProductsOptions, b1 as InventoryService, b8 as LinkService, bc as LiteService, bj as MESSAGE_TYPES, bI as OrderQueries, bY as PriceQuote, c2 as QuoteBundleSelectionInput, c3 as QuoteCompositeSelectionInput, c4 as QuoteDynamicBuckets, c5 as QuoteStatus, c6 as QuoteUiMessage, c8 as RefreshQuoteInput, c9 as RefreshQuoteResult, cA as SchedulingService, dc as createElements } from './client-306peWZ0.js';
|
|
2
|
+
import './product-B_kS4Oxa.js';
|
|
3
|
+
import './payment-sn-yGL7v.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
|
|
3
|
+
var chunkYJLOOC3L_js = require('./chunk-YJLOOC3L.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
|
|
12
|
+
get: function () { return chunkYJLOOC3L_js.AuthService; }
|
|
13
13
|
});
|
|
14
14
|
Object.defineProperty(exports, "BusinessService", {
|
|
15
15
|
enumerable: true,
|
|
16
|
-
get: function () { return
|
|
16
|
+
get: function () { return chunkYJLOOC3L_js.BusinessService; }
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "CartOperations", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function () { return
|
|
20
|
+
get: function () { return chunkYJLOOC3L_js.CartOperations; }
|
|
21
21
|
});
|
|
22
22
|
Object.defineProperty(exports, "CatalogueQueries", {
|
|
23
23
|
enumerable: true,
|
|
24
|
-
get: function () { return
|
|
24
|
+
get: function () { return chunkYJLOOC3L_js.CatalogueQueries; }
|
|
25
25
|
});
|
|
26
26
|
Object.defineProperty(exports, "CheckoutOperations", {
|
|
27
27
|
enumerable: true,
|
|
28
|
-
get: function () { return
|
|
28
|
+
get: function () { return chunkYJLOOC3L_js.CheckoutService; }
|
|
29
29
|
});
|
|
30
30
|
Object.defineProperty(exports, "CheckoutService", {
|
|
31
31
|
enumerable: true,
|
|
32
|
-
get: function () { return
|
|
32
|
+
get: function () { return chunkYJLOOC3L_js.CheckoutService; }
|
|
33
33
|
});
|
|
34
34
|
Object.defineProperty(exports, "CimplifyElement", {
|
|
35
35
|
enumerable: true,
|
|
36
|
-
get: function () { return
|
|
36
|
+
get: function () { return chunkYJLOOC3L_js.CimplifyElement; }
|
|
37
37
|
});
|
|
38
38
|
Object.defineProperty(exports, "CimplifyElements", {
|
|
39
39
|
enumerable: true,
|
|
40
|
-
get: function () { return
|
|
40
|
+
get: function () { return chunkYJLOOC3L_js.CimplifyElements; }
|
|
41
41
|
});
|
|
42
42
|
Object.defineProperty(exports, "ELEMENT_TYPES", {
|
|
43
43
|
enumerable: true,
|
|
44
|
-
get: function () { return
|
|
44
|
+
get: function () { return chunkYJLOOC3L_js.ELEMENT_TYPES; }
|
|
45
45
|
});
|
|
46
46
|
Object.defineProperty(exports, "EVENT_TYPES", {
|
|
47
47
|
enumerable: true,
|
|
48
|
-
get: function () { return
|
|
48
|
+
get: function () { return chunkYJLOOC3L_js.EVENT_TYPES; }
|
|
49
49
|
});
|
|
50
50
|
Object.defineProperty(exports, "FxService", {
|
|
51
51
|
enumerable: true,
|
|
52
|
-
get: function () { return
|
|
52
|
+
get: function () { return chunkYJLOOC3L_js.FxService; }
|
|
53
53
|
});
|
|
54
54
|
Object.defineProperty(exports, "InventoryService", {
|
|
55
55
|
enumerable: true,
|
|
56
|
-
get: function () { return
|
|
56
|
+
get: function () { return chunkYJLOOC3L_js.InventoryService; }
|
|
57
57
|
});
|
|
58
58
|
Object.defineProperty(exports, "LinkService", {
|
|
59
59
|
enumerable: true,
|
|
60
|
-
get: function () { return
|
|
60
|
+
get: function () { return chunkYJLOOC3L_js.LinkService; }
|
|
61
61
|
});
|
|
62
62
|
Object.defineProperty(exports, "LiteService", {
|
|
63
63
|
enumerable: true,
|
|
64
|
-
get: function () { return
|
|
64
|
+
get: function () { return chunkYJLOOC3L_js.LiteService; }
|
|
65
65
|
});
|
|
66
66
|
Object.defineProperty(exports, "MESSAGE_TYPES", {
|
|
67
67
|
enumerable: true,
|
|
68
|
-
get: function () { return
|
|
68
|
+
get: function () { return chunkYJLOOC3L_js.MESSAGE_TYPES; }
|
|
69
69
|
});
|
|
70
70
|
Object.defineProperty(exports, "OrderQueries", {
|
|
71
71
|
enumerable: true,
|
|
72
|
-
get: function () { return
|
|
72
|
+
get: function () { return chunkYJLOOC3L_js.OrderQueries; }
|
|
73
73
|
});
|
|
74
74
|
Object.defineProperty(exports, "SchedulingService", {
|
|
75
75
|
enumerable: true,
|
|
76
|
-
get: function () { return
|
|
76
|
+
get: function () { return chunkYJLOOC3L_js.SchedulingService; }
|
|
77
77
|
});
|
|
78
78
|
Object.defineProperty(exports, "createElements", {
|
|
79
79
|
enumerable: true,
|
|
80
|
-
get: function () { return
|
|
80
|
+
get: function () { return chunkYJLOOC3L_js.createElements; }
|
|
81
81
|
});
|
|
82
82
|
Object.defineProperty(exports, "generateIdempotencyKey", {
|
|
83
83
|
enumerable: true,
|
|
84
|
-
get: function () { return
|
|
84
|
+
get: function () { return chunkYJLOOC3L_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-
|
|
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-B3Y4C4A7.mjs';
|
|
2
2
|
import './chunk-TD3AY34U.mjs';
|
|
3
3
|
import './chunk-AMZXALF6.mjs';
|
|
4
4
|
import './chunk-3G6RQLXK.mjs';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ErrorCode } from './chunk-AMZXALF6.mjs';
|
|
2
2
|
import { __publicField, __privateAdd, __privateSet, __privateGet, __privateMethod, __privateWrapper } from './chunk-3G6RQLXK.mjs';
|
|
3
3
|
|
|
4
|
-
// ../node_modules/.bun/hono@4.12.
|
|
4
|
+
// ../node_modules/.bun/hono@4.12.22/node_modules/hono/dist/compose.js
|
|
5
5
|
var compose = (middleware, onError, onNotFound) => {
|
|
6
6
|
return (context, next) => {
|
|
7
7
|
let index = -1;
|
|
@@ -45,10 +45,10 @@ var compose = (middleware, onError, onNotFound) => {
|
|
|
45
45
|
};
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
-
// ../node_modules/.bun/hono@4.12.
|
|
48
|
+
// ../node_modules/.bun/hono@4.12.22/node_modules/hono/dist/request/constants.js
|
|
49
49
|
var GET_MATCH_RESULT = /* @__PURE__ */ Symbol();
|
|
50
50
|
|
|
51
|
-
// ../node_modules/.bun/hono@4.12.
|
|
51
|
+
// ../node_modules/.bun/hono@4.12.22/node_modules/hono/dist/utils/body.js
|
|
52
52
|
var parseBody = async (request, options = /* @__PURE__ */ Object.create(null)) => {
|
|
53
53
|
const { all = false, dot = false } = options;
|
|
54
54
|
const headers = request instanceof HonoRequest ? request.raw.headers : request.headers;
|
|
@@ -119,7 +119,7 @@ var handleParsingNestedValues = (form, key, value) => {
|
|
|
119
119
|
});
|
|
120
120
|
};
|
|
121
121
|
|
|
122
|
-
// ../node_modules/.bun/hono@4.12.
|
|
122
|
+
// ../node_modules/.bun/hono@4.12.22/node_modules/hono/dist/utils/url.js
|
|
123
123
|
var splitPath = (path) => {
|
|
124
124
|
const paths = path.split("/");
|
|
125
125
|
if (paths[0] === "") {
|
|
@@ -322,7 +322,7 @@ var getQueryParams = (url, key) => {
|
|
|
322
322
|
};
|
|
323
323
|
var decodeURIComponent_ = decodeURIComponent;
|
|
324
324
|
|
|
325
|
-
// ../node_modules/.bun/hono@4.12.
|
|
325
|
+
// ../node_modules/.bun/hono@4.12.22/node_modules/hono/dist/request.js
|
|
326
326
|
var tryDecodeURIComponent = (str) => tryDecode(str, decodeURIComponent_);
|
|
327
327
|
var _validatedData, _matchResult, _HonoRequest_instances, getDecodedParam_fn, getAllDecodedParams_fn, getParamValue_fn, _cachedBody, _a;
|
|
328
328
|
var HonoRequest = (_a = class {
|
|
@@ -450,6 +450,21 @@ var HonoRequest = (_a = class {
|
|
|
450
450
|
arrayBuffer() {
|
|
451
451
|
return __privateGet(this, _cachedBody).call(this, "arrayBuffer");
|
|
452
452
|
}
|
|
453
|
+
/**
|
|
454
|
+
* `.bytes()` parses the request body as a `Uint8Array`.
|
|
455
|
+
*
|
|
456
|
+
* @see {@link https://hono.dev/docs/api/request#bytes}
|
|
457
|
+
*
|
|
458
|
+
* @example
|
|
459
|
+
* ```ts
|
|
460
|
+
* app.post('/entry', async (c) => {
|
|
461
|
+
* const body = await c.req.bytes()
|
|
462
|
+
* })
|
|
463
|
+
* ```
|
|
464
|
+
*/
|
|
465
|
+
bytes() {
|
|
466
|
+
return __privateGet(this, _cachedBody).call(this, "arrayBuffer").then((buffer) => new Uint8Array(buffer));
|
|
467
|
+
}
|
|
453
468
|
/**
|
|
454
469
|
* Parses the request body as a `Blob`.
|
|
455
470
|
* @example
|
|
@@ -589,7 +604,7 @@ var HonoRequest = (_a = class {
|
|
|
589
604
|
return __privateGet(this, _matchResult)[1] ? __privateGet(this, _matchResult)[1][paramKey] : paramKey;
|
|
590
605
|
}, _cachedBody = new WeakMap(), _a);
|
|
591
606
|
|
|
592
|
-
// ../node_modules/.bun/hono@4.12.
|
|
607
|
+
// ../node_modules/.bun/hono@4.12.22/node_modules/hono/dist/utils/html.js
|
|
593
608
|
var HtmlEscapedCallbackPhase = {
|
|
594
609
|
Stringify: 1};
|
|
595
610
|
var resolveCallback = async (str, phase, preserveCallbacks, context, buffer) => {
|
|
@@ -620,7 +635,7 @@ var resolveCallback = async (str, phase, preserveCallbacks, context, buffer) =>
|
|
|
620
635
|
}
|
|
621
636
|
};
|
|
622
637
|
|
|
623
|
-
// ../node_modules/.bun/hono@4.12.
|
|
638
|
+
// ../node_modules/.bun/hono@4.12.22/node_modules/hono/dist/context.js
|
|
624
639
|
var TEXT_PLAIN = "text/plain; charset=UTF-8";
|
|
625
640
|
var setDefaultContentType = (contentType, headers) => {
|
|
626
641
|
return {
|
|
@@ -1020,7 +1035,7 @@ var Context = (_a2 = class {
|
|
|
1020
1035
|
return createResponseInstance(data, { status, headers: responseHeaders });
|
|
1021
1036
|
}, _a2);
|
|
1022
1037
|
|
|
1023
|
-
// ../node_modules/.bun/hono@4.12.
|
|
1038
|
+
// ../node_modules/.bun/hono@4.12.22/node_modules/hono/dist/router.js
|
|
1024
1039
|
var METHOD_NAME_ALL = "ALL";
|
|
1025
1040
|
var METHOD_NAME_ALL_LOWERCASE = "all";
|
|
1026
1041
|
var METHODS = ["get", "post", "put", "delete", "options", "patch"];
|
|
@@ -1028,10 +1043,10 @@ var MESSAGE_MATCHER_IS_ALREADY_BUILT = "Can not add a route since the matcher is
|
|
|
1028
1043
|
var UnsupportedPathError = class extends Error {
|
|
1029
1044
|
};
|
|
1030
1045
|
|
|
1031
|
-
// ../node_modules/.bun/hono@4.12.
|
|
1046
|
+
// ../node_modules/.bun/hono@4.12.22/node_modules/hono/dist/utils/constants.js
|
|
1032
1047
|
var COMPOSED_HANDLER = "__COMPOSED_HANDLER";
|
|
1033
1048
|
|
|
1034
|
-
// ../node_modules/.bun/hono@4.12.
|
|
1049
|
+
// ../node_modules/.bun/hono@4.12.22/node_modules/hono/dist/hono-base.js
|
|
1035
1050
|
var notFoundHandler = (c) => {
|
|
1036
1051
|
return c.text("404 Not Found", 404);
|
|
1037
1052
|
};
|
|
@@ -1240,7 +1255,7 @@ var Hono = (_a3 = class {
|
|
|
1240
1255
|
handler = async (c, next) => (await compose([], app.errorHandler)(c, () => r.handler(c, next))).res;
|
|
1241
1256
|
handler[COMPOSED_HANDLER] = r.handler;
|
|
1242
1257
|
}
|
|
1243
|
-
__privateMethod(_a10 = subApp, __Hono_instances, addRoute_fn).call(_a10, r.method, r.path, handler);
|
|
1258
|
+
__privateMethod(_a10 = subApp, __Hono_instances, addRoute_fn).call(_a10, r.method, r.path, handler, r.basePath);
|
|
1244
1259
|
});
|
|
1245
1260
|
return this;
|
|
1246
1261
|
}
|
|
@@ -1325,7 +1340,7 @@ var Hono = (_a3 = class {
|
|
|
1325
1340
|
const pathPrefixLength = mergedPath === "/" ? 0 : mergedPath.length;
|
|
1326
1341
|
return (request) => {
|
|
1327
1342
|
const url = new URL(request.url);
|
|
1328
|
-
url.pathname =
|
|
1343
|
+
url.pathname = this.getPath(request).slice(pathPrefixLength) || "/";
|
|
1329
1344
|
return new Request(url, request);
|
|
1330
1345
|
};
|
|
1331
1346
|
})());
|
|
@@ -1348,10 +1363,15 @@ var Hono = (_a3 = class {
|
|
|
1348
1363
|
__privateSet(clone, _notFoundHandler2, __privateGet(this, _notFoundHandler2));
|
|
1349
1364
|
clone.routes = this.routes;
|
|
1350
1365
|
return clone;
|
|
1351
|
-
}, _notFoundHandler2 = new WeakMap(), addRoute_fn = function(method, path, handler) {
|
|
1366
|
+
}, _notFoundHandler2 = new WeakMap(), addRoute_fn = function(method, path, handler, baseRoutePath) {
|
|
1352
1367
|
method = method.toUpperCase();
|
|
1353
1368
|
path = mergePath(this._basePath, path);
|
|
1354
|
-
const r = {
|
|
1369
|
+
const r = {
|
|
1370
|
+
basePath: baseRoutePath !== void 0 ? mergePath(this._basePath, baseRoutePath) : this._basePath,
|
|
1371
|
+
path,
|
|
1372
|
+
method,
|
|
1373
|
+
handler
|
|
1374
|
+
};
|
|
1355
1375
|
this.router.add(method, path, [handler, r]);
|
|
1356
1376
|
this.routes.push(r);
|
|
1357
1377
|
}, handleError_fn = function(err, c) {
|
|
@@ -1401,7 +1421,7 @@ var Hono = (_a3 = class {
|
|
|
1401
1421
|
})();
|
|
1402
1422
|
}, _a3);
|
|
1403
1423
|
|
|
1404
|
-
// ../node_modules/.bun/hono@4.12.
|
|
1424
|
+
// ../node_modules/.bun/hono@4.12.22/node_modules/hono/dist/router/reg-exp-router/matcher.js
|
|
1405
1425
|
var emptyParam = [];
|
|
1406
1426
|
function match(method, path) {
|
|
1407
1427
|
const matchers = this.buildAllMatchers();
|
|
@@ -1422,7 +1442,7 @@ function match(method, path) {
|
|
|
1422
1442
|
return match2(method, path);
|
|
1423
1443
|
}
|
|
1424
1444
|
|
|
1425
|
-
// ../node_modules/.bun/hono@4.12.
|
|
1445
|
+
// ../node_modules/.bun/hono@4.12.22/node_modules/hono/dist/router/reg-exp-router/node.js
|
|
1426
1446
|
var LABEL_REG_EXP_STR = "[^/]+";
|
|
1427
1447
|
var ONLY_WILDCARD_REG_EXP_STR = ".*";
|
|
1428
1448
|
var TAIL_WILDCARD_REG_EXP_STR = "(?:|/.*)";
|
|
@@ -1533,7 +1553,7 @@ var Node = (_a4 = class {
|
|
|
1533
1553
|
}
|
|
1534
1554
|
}, _index = new WeakMap(), _varIndex = new WeakMap(), _children = new WeakMap(), _a4);
|
|
1535
1555
|
|
|
1536
|
-
// ../node_modules/.bun/hono@4.12.
|
|
1556
|
+
// ../node_modules/.bun/hono@4.12.22/node_modules/hono/dist/router/reg-exp-router/trie.js
|
|
1537
1557
|
var _context, _root, _a5;
|
|
1538
1558
|
var Trie = (_a5 = class {
|
|
1539
1559
|
constructor() {
|
|
@@ -1592,7 +1612,7 @@ var Trie = (_a5 = class {
|
|
|
1592
1612
|
}
|
|
1593
1613
|
}, _context = new WeakMap(), _root = new WeakMap(), _a5);
|
|
1594
1614
|
|
|
1595
|
-
// ../node_modules/.bun/hono@4.12.
|
|
1615
|
+
// ../node_modules/.bun/hono@4.12.22/node_modules/hono/dist/router/reg-exp-router/router.js
|
|
1596
1616
|
var nullMatcher = [/^$/, [], /* @__PURE__ */ Object.create(null)];
|
|
1597
1617
|
var wildcardRegExpCache = /* @__PURE__ */ Object.create(null);
|
|
1598
1618
|
function buildWildcardRegExp(path) {
|
|
@@ -1774,7 +1794,7 @@ var RegExpRouter = (_a6 = class {
|
|
|
1774
1794
|
}
|
|
1775
1795
|
}, _a6);
|
|
1776
1796
|
|
|
1777
|
-
// ../node_modules/.bun/hono@4.12.
|
|
1797
|
+
// ../node_modules/.bun/hono@4.12.22/node_modules/hono/dist/router/smart-router/router.js
|
|
1778
1798
|
var _routers, _routes2, _a7;
|
|
1779
1799
|
var SmartRouter = (_a7 = class {
|
|
1780
1800
|
constructor(init) {
|
|
@@ -1830,7 +1850,7 @@ var SmartRouter = (_a7 = class {
|
|
|
1830
1850
|
}
|
|
1831
1851
|
}, _routers = new WeakMap(), _routes2 = new WeakMap(), _a7);
|
|
1832
1852
|
|
|
1833
|
-
// ../node_modules/.bun/hono@4.12.
|
|
1853
|
+
// ../node_modules/.bun/hono@4.12.22/node_modules/hono/dist/router/trie-router/node.js
|
|
1834
1854
|
var emptyParams = /* @__PURE__ */ Object.create(null);
|
|
1835
1855
|
var hasChildren = (children) => {
|
|
1836
1856
|
for (const _ in children) {
|
|
@@ -2000,7 +2020,7 @@ var Node2 = (_a8 = class {
|
|
|
2000
2020
|
}
|
|
2001
2021
|
}, _a8);
|
|
2002
2022
|
|
|
2003
|
-
// ../node_modules/.bun/hono@4.12.
|
|
2023
|
+
// ../node_modules/.bun/hono@4.12.22/node_modules/hono/dist/router/trie-router/router.js
|
|
2004
2024
|
var _node, _a9;
|
|
2005
2025
|
var TrieRouter = (_a9 = class {
|
|
2006
2026
|
constructor() {
|
|
@@ -2023,7 +2043,7 @@ var TrieRouter = (_a9 = class {
|
|
|
2023
2043
|
}
|
|
2024
2044
|
}, _node = new WeakMap(), _a9);
|
|
2025
2045
|
|
|
2026
|
-
// ../node_modules/.bun/hono@4.12.
|
|
2046
|
+
// ../node_modules/.bun/hono@4.12.22/node_modules/hono/dist/hono.js
|
|
2027
2047
|
var Hono2 = class extends Hono {
|
|
2028
2048
|
/**
|
|
2029
2049
|
* Creates an instance of the Hono class.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { safe, generateIdempotencyKey, CatalogueQueries, CartOperations, CheckoutService, OrderQueries, LinkService, AuthService, BusinessService, InventoryService, SchedulingService, LiteService, FxService, createElements } from './chunk-
|
|
1
|
+
import { safe, generateIdempotencyKey, CatalogueQueries, CartOperations, CheckoutService, OrderQueries, LinkService, AuthService, BusinessService, InventoryService, SchedulingService, LiteService, FxService, createElements } from './chunk-B3Y4C4A7.mjs';
|
|
2
2
|
import { CimplifyError, ErrorCode, IdempotencyMismatchError, enrichError } from './chunk-AMZXALF6.mjs';
|
|
3
3
|
|
|
4
4
|
// src/activity.ts
|
|
@@ -282,6 +282,14 @@ var DEFAULT_RETRY_DELAY_MS = 1e3;
|
|
|
282
282
|
function sleep(ms) {
|
|
283
283
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
284
284
|
}
|
|
285
|
+
function nextInit(cacheOptions) {
|
|
286
|
+
if (!cacheOptions) return {};
|
|
287
|
+
const next = {};
|
|
288
|
+
if (cacheOptions.revalidate !== void 0) next.revalidate = cacheOptions.revalidate;
|
|
289
|
+
if (cacheOptions.tags && cacheOptions.tags.length > 0) next.tags = [...cacheOptions.tags];
|
|
290
|
+
if (next.revalidate === void 0 && !next.tags) return {};
|
|
291
|
+
return { next };
|
|
292
|
+
}
|
|
285
293
|
function mergeOptionHeaders(base, opts) {
|
|
286
294
|
if (!opts) return base;
|
|
287
295
|
const merged = { ...base };
|
|
@@ -698,8 +706,9 @@ var CimplifyClient = class {
|
|
|
698
706
|
});
|
|
699
707
|
throw finalError;
|
|
700
708
|
}
|
|
701
|
-
getDedupeKey(type, payload) {
|
|
702
|
-
|
|
709
|
+
getDedupeKey(type, payload, cacheOptions) {
|
|
710
|
+
const cacheKey = cacheOptions ? `|${JSON.stringify(cacheOptions)}` : "";
|
|
711
|
+
return `${type}:${JSON.stringify(payload)}${cacheKey}`;
|
|
703
712
|
}
|
|
704
713
|
async deduplicatedRequest(key, requestFn) {
|
|
705
714
|
const existing = this.inflightRequests.get(key);
|
|
@@ -712,13 +721,14 @@ var CimplifyClient = class {
|
|
|
712
721
|
this.inflightRequests.set(key, request);
|
|
713
722
|
return request;
|
|
714
723
|
}
|
|
715
|
-
async get(path) {
|
|
716
|
-
const key = this.getDedupeKey("get", path);
|
|
724
|
+
async get(path, opts) {
|
|
725
|
+
const key = this.getDedupeKey("get", path, opts?.cacheOptions);
|
|
717
726
|
return this.deduplicatedRequest(key, async () => {
|
|
718
727
|
const response = await this.resilientFetch(this.buildUrl(this.baseUrl, path), {
|
|
719
728
|
method: "GET",
|
|
720
729
|
credentials: this.credentials,
|
|
721
|
-
headers: this.getHeaders()
|
|
730
|
+
headers: this.getHeaders(),
|
|
731
|
+
...nextInit(opts?.cacheOptions)
|
|
722
732
|
});
|
|
723
733
|
return this.handleRestResponse(response);
|
|
724
734
|
});
|
|
@@ -749,13 +759,14 @@ var CimplifyClient = class {
|
|
|
749
759
|
});
|
|
750
760
|
return this.handleRestResponse(response);
|
|
751
761
|
}
|
|
752
|
-
async linkGet(path) {
|
|
753
|
-
const key = this.getDedupeKey("linkGet", path);
|
|
762
|
+
async linkGet(path, opts) {
|
|
763
|
+
const key = this.getDedupeKey("linkGet", path, opts?.cacheOptions);
|
|
754
764
|
return this.deduplicatedRequest(key, async () => {
|
|
755
765
|
const response = await this.resilientFetch(`${this.linkApiUrl}${path}`, {
|
|
756
766
|
method: "GET",
|
|
757
767
|
credentials: this.credentials,
|
|
758
|
-
headers: this.getHeaders()
|
|
768
|
+
headers: this.getHeaders(),
|
|
769
|
+
...nextInit(opts?.cacheOptions)
|
|
759
770
|
});
|
|
760
771
|
return this.handleRestResponse(response);
|
|
761
772
|
});
|
|
@@ -252,12 +252,12 @@ var CatalogueQueries = class {
|
|
|
252
252
|
constructor(client) {
|
|
253
253
|
this.client = client;
|
|
254
254
|
}
|
|
255
|
-
async getCatalogue() {
|
|
256
|
-
const result = await safe(this.client.get("/api/v1/catalogue"));
|
|
255
|
+
async getCatalogue(opts) {
|
|
256
|
+
const result = await safe(this.client.get("/api/v1/catalogue", opts));
|
|
257
257
|
if (!result.ok) return result;
|
|
258
258
|
return ok(normalizeCatalogueSnapshot(result.value));
|
|
259
259
|
}
|
|
260
|
-
async getProducts(options) {
|
|
260
|
+
async getProducts(options, opts) {
|
|
261
261
|
const path = withQuery("/api/v1/catalogue/products", {
|
|
262
262
|
category_id: options?.category,
|
|
263
263
|
taxonomy_id: options?.taxonomy,
|
|
@@ -275,13 +275,13 @@ var CatalogueQueries = class {
|
|
|
275
275
|
cursor: options?.cursor,
|
|
276
276
|
properties: options?.properties ? JSON.stringify(options.properties) : void 0
|
|
277
277
|
});
|
|
278
|
-
const result = await safe(this.client.get(path));
|
|
278
|
+
const result = await safe(this.client.get(path, opts));
|
|
279
279
|
if (!result.ok) return result;
|
|
280
280
|
return ok(normalizeCatalogueResult(result.value));
|
|
281
281
|
}
|
|
282
|
-
async getProduct(id) {
|
|
282
|
+
async getProduct(id, opts) {
|
|
283
283
|
const encodedId = encodeURIComponent(id);
|
|
284
|
-
const result = await safe(this.client.get(`/api/v1/catalogue/products/${encodedId}
|
|
284
|
+
const result = await safe(this.client.get(`/api/v1/catalogue/products/${encodedId}`, opts));
|
|
285
285
|
if (!result.ok) return result;
|
|
286
286
|
const payload = result.value;
|
|
287
287
|
const rawProduct = isRecord(payload.item) ? payload.item : payload;
|
|
@@ -291,15 +291,15 @@ var CatalogueQueries = class {
|
|
|
291
291
|
}
|
|
292
292
|
const addOnIds = rawProduct.add_on_ids;
|
|
293
293
|
if (Array.isArray(addOnIds) && addOnIds.length > 0) {
|
|
294
|
-
const addOnsResult = await this.getAddOns(product.id);
|
|
294
|
+
const addOnsResult = await this.getAddOns(product.id, opts);
|
|
295
295
|
if (addOnsResult.ok) {
|
|
296
296
|
product.add_ons = addOnsResult.value;
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
299
|
return ok(product);
|
|
300
300
|
}
|
|
301
|
-
async getProductBySlug(slug) {
|
|
302
|
-
return this.getProduct(slug);
|
|
301
|
+
async getProductBySlug(slug, opts) {
|
|
302
|
+
return this.getProduct(slug, opts);
|
|
303
303
|
}
|
|
304
304
|
async getVariants(productId) {
|
|
305
305
|
const encodedId = encodeURIComponent(productId);
|
|
@@ -327,45 +327,45 @@ var CatalogueQueries = class {
|
|
|
327
327
|
)
|
|
328
328
|
);
|
|
329
329
|
}
|
|
330
|
-
async getAddOns(productId) {
|
|
330
|
+
async getAddOns(productId, opts) {
|
|
331
331
|
const encodedId = encodeURIComponent(productId);
|
|
332
|
-
return safe(this.client.get(`/api/v1/catalogue/products/${encodedId}/add-ons
|
|
332
|
+
return safe(this.client.get(`/api/v1/catalogue/products/${encodedId}/add-ons`, opts));
|
|
333
333
|
}
|
|
334
|
-
async getCategories() {
|
|
335
|
-
return safe(this.client.get("/api/v1/catalogue/categories"));
|
|
334
|
+
async getCategories(opts) {
|
|
335
|
+
return safe(this.client.get("/api/v1/catalogue/categories", opts));
|
|
336
336
|
}
|
|
337
|
-
async getCategory(id) {
|
|
337
|
+
async getCategory(id, opts) {
|
|
338
338
|
const encodedId = encodeURIComponent(id);
|
|
339
|
-
return safe(this.client.get(`/api/v1/catalogue/categories/${encodedId}
|
|
339
|
+
return safe(this.client.get(`/api/v1/catalogue/categories/${encodedId}`, opts));
|
|
340
340
|
}
|
|
341
|
-
async getCategoryBySlug(slug) {
|
|
342
|
-
return this.getCategory(slug);
|
|
341
|
+
async getCategoryBySlug(slug, opts) {
|
|
342
|
+
return this.getCategory(slug, opts);
|
|
343
343
|
}
|
|
344
|
-
async getCategoryProducts(categoryId, options) {
|
|
344
|
+
async getCategoryProducts(categoryId, options, opts) {
|
|
345
345
|
const encodedId = encodeURIComponent(categoryId);
|
|
346
346
|
const path = withQuery(`/api/v1/catalogue/categories/${encodedId}/products`, {
|
|
347
347
|
limit: options?.limit,
|
|
348
348
|
offset: options?.offset
|
|
349
349
|
});
|
|
350
|
-
return safe(this.client.get(path));
|
|
350
|
+
return safe(this.client.get(path, opts));
|
|
351
351
|
}
|
|
352
|
-
async getCollections() {
|
|
353
|
-
return safe(this.client.get("/api/v1/catalogue/collections"));
|
|
352
|
+
async getCollections(opts) {
|
|
353
|
+
return safe(this.client.get("/api/v1/catalogue/collections", opts));
|
|
354
354
|
}
|
|
355
|
-
async getCollection(id) {
|
|
355
|
+
async getCollection(id, opts) {
|
|
356
356
|
const encodedId = encodeURIComponent(id);
|
|
357
|
-
return safe(this.client.get(`/api/v1/catalogue/collections/${encodedId}
|
|
357
|
+
return safe(this.client.get(`/api/v1/catalogue/collections/${encodedId}`, opts));
|
|
358
358
|
}
|
|
359
|
-
async getCollectionBySlug(slug) {
|
|
360
|
-
return this.getCollection(slug);
|
|
359
|
+
async getCollectionBySlug(slug, opts) {
|
|
360
|
+
return this.getCollection(slug, opts);
|
|
361
361
|
}
|
|
362
|
-
async getCollectionProducts(collectionId, options) {
|
|
362
|
+
async getCollectionProducts(collectionId, options, opts) {
|
|
363
363
|
const encodedId = encodeURIComponent(collectionId);
|
|
364
364
|
const path = withQuery(`/api/v1/catalogue/collections/${encodedId}/products`, {
|
|
365
365
|
limit: options?.limit,
|
|
366
366
|
offset: options?.offset
|
|
367
367
|
});
|
|
368
|
-
return safe(this.client.get(path));
|
|
368
|
+
return safe(this.client.get(path, opts));
|
|
369
369
|
}
|
|
370
370
|
async searchCollections(query, limit = 20) {
|
|
371
371
|
const path = withQuery("/api/v1/catalogue/collections", { search: query, limit });
|
|
@@ -490,17 +490,20 @@ var CatalogueQueries = class {
|
|
|
490
490
|
})
|
|
491
491
|
);
|
|
492
492
|
}
|
|
493
|
-
async search(query, options) {
|
|
494
|
-
const result = await this.getProducts(
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
493
|
+
async search(query, options, opts) {
|
|
494
|
+
const result = await this.getProducts(
|
|
495
|
+
{
|
|
496
|
+
...options,
|
|
497
|
+
search: query,
|
|
498
|
+
limit: options?.limit ?? 20
|
|
499
|
+
},
|
|
500
|
+
opts
|
|
501
|
+
);
|
|
499
502
|
if (!result.ok) return result;
|
|
500
503
|
return ok(result.value.items);
|
|
501
504
|
}
|
|
502
|
-
async searchProducts(query, options) {
|
|
503
|
-
return this.search(query, options);
|
|
505
|
+
async searchProducts(query, options, opts) {
|
|
506
|
+
return this.search(query, options, opts);
|
|
504
507
|
}
|
|
505
508
|
async getMenu(options) {
|
|
506
509
|
const path = withQuery("/api/v1/catalogue/menu", {
|
|
@@ -1955,25 +1958,25 @@ var BusinessService = class {
|
|
|
1955
1958
|
constructor(client) {
|
|
1956
1959
|
this.client = client;
|
|
1957
1960
|
}
|
|
1958
|
-
async getInfo() {
|
|
1959
|
-
return safe(this.client.get("/api/v1/business"));
|
|
1961
|
+
async getInfo(opts) {
|
|
1962
|
+
return safe(this.client.get("/api/v1/business", opts));
|
|
1960
1963
|
}
|
|
1961
|
-
async getByHandle(handle) {
|
|
1964
|
+
async getByHandle(handle, opts) {
|
|
1962
1965
|
const encodedHandle = encodeURIComponent(handle);
|
|
1963
|
-
return safe(this.client.get(`/api/v1/business/by-handle/${encodedHandle}
|
|
1966
|
+
return safe(this.client.get(`/api/v1/business/by-handle/${encodedHandle}`, opts));
|
|
1964
1967
|
}
|
|
1965
|
-
async getByDomain(domain) {
|
|
1968
|
+
async getByDomain(domain, opts) {
|
|
1966
1969
|
const encodedDomain = encodeURIComponent(domain);
|
|
1967
|
-
return safe(this.client.get(`/api/v1/business/by-domain?domain=${encodedDomain}
|
|
1970
|
+
return safe(this.client.get(`/api/v1/business/by-domain?domain=${encodedDomain}`, opts));
|
|
1968
1971
|
}
|
|
1969
|
-
async getSettings() {
|
|
1970
|
-
return safe(this.client.get("/api/v1/business/settings"));
|
|
1972
|
+
async getSettings(opts) {
|
|
1973
|
+
return safe(this.client.get("/api/v1/business/settings", opts));
|
|
1971
1974
|
}
|
|
1972
|
-
async getLocations() {
|
|
1973
|
-
return safe(this.client.get("/api/v1/business/locations"));
|
|
1975
|
+
async getLocations(opts) {
|
|
1976
|
+
return safe(this.client.get("/api/v1/business/locations", opts));
|
|
1974
1977
|
}
|
|
1975
|
-
async getLocation(locationId) {
|
|
1976
|
-
const result = await this.getLocations();
|
|
1978
|
+
async getLocation(locationId, opts) {
|
|
1979
|
+
const result = await this.getLocations(opts);
|
|
1977
1980
|
if (!result.ok) return err(result.error);
|
|
1978
1981
|
const location = result.value.find((item) => item.id === locationId);
|
|
1979
1982
|
if (!location) {
|
|
@@ -1981,16 +1984,16 @@ var BusinessService = class {
|
|
|
1981
1984
|
}
|
|
1982
1985
|
return ok(location);
|
|
1983
1986
|
}
|
|
1984
|
-
async getHours() {
|
|
1985
|
-
return safe(this.client.get("/api/v1/business/hours"));
|
|
1987
|
+
async getHours(opts) {
|
|
1988
|
+
return safe(this.client.get("/api/v1/business/hours", opts));
|
|
1986
1989
|
}
|
|
1987
|
-
async getLocationHours(locationId) {
|
|
1988
|
-
const result = await this.getHours();
|
|
1990
|
+
async getLocationHours(locationId, opts) {
|
|
1991
|
+
const result = await this.getHours(opts);
|
|
1989
1992
|
if (!result.ok) return result;
|
|
1990
1993
|
return ok(result.value.filter((hour) => hour.location_id === locationId));
|
|
1991
1994
|
}
|
|
1992
|
-
async getBootstrap() {
|
|
1993
|
-
return safe(this.client.get("/api/v1/bootstrap"));
|
|
1995
|
+
async getBootstrap(opts) {
|
|
1996
|
+
return safe(this.client.get("/api/v1/bootstrap", opts));
|
|
1994
1997
|
}
|
|
1995
1998
|
};
|
|
1996
1999
|
|