@cimplify/sdk 0.70.3 → 0.71.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.
@@ -0,0 +1,279 @@
1
+ import '../chunk-3G6RQLXK.mjs';
2
+
3
+ // src/server/tanstack.ts
4
+ var TANSTACK_R2_BUCKET_BINDING = "CIMPLIFY_CACHE_R2_BUCKET";
5
+ var TANSTACK_R2_PREFIX_ENV = "CIMPLIFY_CACHE_R2_PREFIX";
6
+ var TANSTACK_PATH_INDEX_BINDING = "CIMPLIFY_PATH_INDEX";
7
+ var TANSTACK_CACHE_NAMESPACE = "nitro";
8
+ var CIMPLIFY_TAG_PREFIX = "cimplify:";
9
+ var CIMPLIFY_CACHE_META_FIELD = "__cimplifyCache";
10
+ var EMPTY_STORAGE_KEY = "__cimplify_empty_key__";
11
+ function isRecord(value) {
12
+ return typeof value === "object" && value !== null && !Array.isArray(value);
13
+ }
14
+ function stringArray(value) {
15
+ return Array.isArray(value) ? value.filter((item) => typeof item === "string") : [];
16
+ }
17
+ function metadataFrom(value) {
18
+ if (!isRecord(value)) return void 0;
19
+ const metadata = value[CIMPLIFY_CACHE_META_FIELD];
20
+ return isRecord(metadata) ? metadata : void 0;
21
+ }
22
+ function cimplifyTagsFrom(candidates) {
23
+ const seen = /* @__PURE__ */ new Set();
24
+ for (const candidate of candidates) {
25
+ for (const tag of candidate ?? []) {
26
+ if (!tag.startsWith(CIMPLIFY_TAG_PREFIX) || seen.has(tag)) continue;
27
+ seen.add(tag);
28
+ }
29
+ }
30
+ return [...seen];
31
+ }
32
+ function extractTags(key, value, options, driverOptions) {
33
+ const optionMeta = metadataFrom(options);
34
+ const valueMeta = metadataFrom(value);
35
+ const valueRecord = isRecord(value) ? value : void 0;
36
+ const nestedValue = isRecord(valueRecord?.value) ? valueRecord.value : void 0;
37
+ const configured = typeof driverOptions.tags === "function" ? driverOptions.tags(key, value, options) : driverOptions.tags;
38
+ return cimplifyTagsFrom([
39
+ configured,
40
+ optionMeta?.tags,
41
+ options?.tags,
42
+ options?.cimplifyTags,
43
+ options?.cacheTags,
44
+ valueMeta?.tags,
45
+ stringArray(valueRecord?.tags),
46
+ stringArray(valueRecord?.cimplifyTags),
47
+ stringArray(valueRecord?.cacheTags),
48
+ stringArray(nestedValue?.tags),
49
+ stringArray(nestedValue?.cimplifyTags),
50
+ stringArray(nestedValue?.cacheTags)
51
+ ]);
52
+ }
53
+ function extractCacheKey(key, value, options, driverOptions) {
54
+ const configured = typeof driverOptions.cacheKey === "function" ? driverOptions.cacheKey(key, value, options) : driverOptions.cacheKey;
55
+ if (configured) return configured;
56
+ const optionMeta = metadataFrom(options);
57
+ const valueMeta = metadataFrom(value);
58
+ if (optionMeta?.cacheKey) return optionMeta.cacheKey;
59
+ if (options?.cacheKey) return options.cacheKey;
60
+ if (options?.cimplifyCacheKey) return options.cimplifyCacheKey;
61
+ if (valueMeta?.cacheKey) return valueMeta.cacheKey;
62
+ return key;
63
+ }
64
+ function extractIsFetch(key, value, options, driverOptions) {
65
+ if (typeof driverOptions.isFetch === "function") {
66
+ return driverOptions.isFetch(key, value, options);
67
+ }
68
+ if (typeof driverOptions.isFetch === "boolean") return driverOptions.isFetch;
69
+ const optionMeta = metadataFrom(options);
70
+ const valueMeta = metadataFrom(value);
71
+ return Boolean(
72
+ optionMeta?.isFetch ?? options?.isFetch ?? options?.cimplifyIsFetch ?? valueMeta?.isFetch ?? false
73
+ );
74
+ }
75
+ function valueForStorage(value) {
76
+ if (!isRecord(value) || !(CIMPLIFY_CACHE_META_FIELD in value)) return value;
77
+ const { [CIMPLIFY_CACHE_META_FIELD]: _metadata, ...rest } = value;
78
+ return rest;
79
+ }
80
+ function joinR2Parts(...parts) {
81
+ return parts.map((part) => part.trim().replace(/^\/+|\/+$/g, "")).filter(Boolean).join("/");
82
+ }
83
+ function encodeStorageKey(key) {
84
+ return key === "" ? EMPTY_STORAGE_KEY : encodeURIComponent(key);
85
+ }
86
+ function decodeStorageKey(key) {
87
+ if (key === EMPTY_STORAGE_KEY) return "";
88
+ try {
89
+ return decodeURIComponent(key);
90
+ } catch {
91
+ return key;
92
+ }
93
+ }
94
+ function cimplifyTanstackR2Key(prefix, key, namespace = TANSTACK_CACHE_NAMESPACE) {
95
+ return joinR2Parts(prefix, namespace, encodeStorageKey(key));
96
+ }
97
+ function cimplifyTanstackR2ListPrefix(prefix, base, namespace) {
98
+ if (!base) return `${joinR2Parts(prefix, namespace)}/`;
99
+ return cimplifyTanstackR2Key(prefix, base, namespace);
100
+ }
101
+ function storageKeyFromR2Key(prefix, namespace, key) {
102
+ const base = `${joinR2Parts(prefix, namespace)}/`;
103
+ const encoded = key.startsWith(base) ? key.slice(base.length) : key;
104
+ return decodeStorageKey(encoded);
105
+ }
106
+ function pathIndexFor(env) {
107
+ if (!env.pathIndex) return null;
108
+ return env.pathIndex.get(env.pathIndex.idFromName(env.prefix));
109
+ }
110
+ async function resolveRuntimeEnv(options) {
111
+ const env = await options.getEnv?.() ?? options.env;
112
+ const r2 = env?.[TANSTACK_R2_BUCKET_BINDING];
113
+ const prefix = options.prefix ?? env?.[TANSTACK_R2_PREFIX_ENV];
114
+ if (!r2 || !prefix) return null;
115
+ return {
116
+ r2,
117
+ prefix,
118
+ pathIndex: env?.[TANSTACK_PATH_INDEX_BINDING]
119
+ };
120
+ }
121
+ async function registerIndex(env, cacheKey, r2Key, tags, isFetch) {
122
+ if (tags.length === 0) return;
123
+ const index = pathIndexFor(env);
124
+ if (!index) return;
125
+ try {
126
+ await index.indexAdd(cacheKey, r2Key, tags, isFetch);
127
+ } catch {
128
+ }
129
+ }
130
+ async function listR2Keys(r2, prefix) {
131
+ const keys = [];
132
+ let cursor;
133
+ do {
134
+ const page = await r2.list({ prefix, cursor });
135
+ keys.push(...page.objects.map((object) => object.key));
136
+ cursor = page.truncated ? page.cursor : void 0;
137
+ } while (cursor);
138
+ return keys;
139
+ }
140
+ async function putAndIndex(runtimeEnv, driverOptions, key, storedValue, indexValue, options) {
141
+ const namespace = driverOptions.namespace ?? TANSTACK_CACHE_NAMESPACE;
142
+ const r2Key = cimplifyTanstackR2Key(runtimeEnv.prefix, key, namespace);
143
+ try {
144
+ await runtimeEnv.r2.put(r2Key, storedValue);
145
+ } catch {
146
+ return;
147
+ }
148
+ try {
149
+ const tags = extractTags(key, indexValue, options, driverOptions);
150
+ if (tags.length === 0) return;
151
+ await registerIndex(
152
+ runtimeEnv,
153
+ extractCacheKey(key, indexValue, options, driverOptions),
154
+ r2Key,
155
+ tags,
156
+ extractIsFetch(key, indexValue, options, driverOptions)
157
+ );
158
+ } catch {
159
+ }
160
+ }
161
+ async function getRawItem(driverOptions, key) {
162
+ const runtimeEnv = await resolveRuntimeEnv(driverOptions);
163
+ if (!runtimeEnv) return null;
164
+ try {
165
+ const object = await runtimeEnv.r2.get(
166
+ cimplifyTanstackR2Key(
167
+ runtimeEnv.prefix,
168
+ key,
169
+ driverOptions.namespace ?? TANSTACK_CACHE_NAMESPACE
170
+ )
171
+ );
172
+ return object ? await object.text() : null;
173
+ } catch {
174
+ return null;
175
+ }
176
+ }
177
+ function cimplifyTanstackCacheOptions(metadata) {
178
+ return { [CIMPLIFY_CACHE_META_FIELD]: metadata };
179
+ }
180
+ function withCimplifyCacheMetadata(value, metadata) {
181
+ return { ...value, [CIMPLIFY_CACHE_META_FIELD]: metadata };
182
+ }
183
+ function createCimplifyTanstackCacheDriver(options = {}) {
184
+ const driverOptions = { ...options };
185
+ return {
186
+ name: "cimplify-tanstack-r2-cache",
187
+ options: driverOptions,
188
+ async hasItem(key) {
189
+ const runtimeEnv = await resolveRuntimeEnv(driverOptions);
190
+ if (!runtimeEnv) return false;
191
+ try {
192
+ const object = await runtimeEnv.r2.head(
193
+ cimplifyTanstackR2Key(
194
+ runtimeEnv.prefix,
195
+ key,
196
+ driverOptions.namespace ?? TANSTACK_CACHE_NAMESPACE
197
+ )
198
+ );
199
+ return Boolean(object);
200
+ } catch {
201
+ return false;
202
+ }
203
+ },
204
+ async getItem(key) {
205
+ const raw = await getRawItem(driverOptions, key);
206
+ if (raw === null) return null;
207
+ try {
208
+ return JSON.parse(raw);
209
+ } catch {
210
+ return raw;
211
+ }
212
+ },
213
+ async getItemRaw(key) {
214
+ return getRawItem(driverOptions, key);
215
+ },
216
+ async setItem(key, value, options2) {
217
+ const runtimeEnv = await resolveRuntimeEnv(driverOptions);
218
+ if (!runtimeEnv) return;
219
+ const strippedValue = valueForStorage(value);
220
+ await putAndIndex(
221
+ runtimeEnv,
222
+ driverOptions,
223
+ key,
224
+ JSON.stringify(strippedValue) ?? "null",
225
+ value,
226
+ options2
227
+ );
228
+ },
229
+ async setItemRaw(key, value, options2) {
230
+ const runtimeEnv = await resolveRuntimeEnv(driverOptions);
231
+ if (!runtimeEnv) return;
232
+ await putAndIndex(runtimeEnv, driverOptions, key, value, value, options2);
233
+ },
234
+ async removeItem(key) {
235
+ const runtimeEnv = await resolveRuntimeEnv(driverOptions);
236
+ if (!runtimeEnv) return;
237
+ try {
238
+ await runtimeEnv.r2.delete(
239
+ cimplifyTanstackR2Key(
240
+ runtimeEnv.prefix,
241
+ key,
242
+ driverOptions.namespace ?? TANSTACK_CACHE_NAMESPACE
243
+ )
244
+ );
245
+ } catch {
246
+ }
247
+ },
248
+ async getKeys(base) {
249
+ const runtimeEnv = await resolveRuntimeEnv(driverOptions);
250
+ if (!runtimeEnv) return [];
251
+ const namespace = driverOptions.namespace ?? TANSTACK_CACHE_NAMESPACE;
252
+ try {
253
+ const keys = await listR2Keys(
254
+ runtimeEnv.r2,
255
+ cimplifyTanstackR2ListPrefix(runtimeEnv.prefix, base, namespace)
256
+ );
257
+ return keys.map((key) => storageKeyFromR2Key(runtimeEnv.prefix, namespace, key));
258
+ } catch {
259
+ return [];
260
+ }
261
+ },
262
+ async clear(base) {
263
+ const runtimeEnv = await resolveRuntimeEnv(driverOptions);
264
+ if (!runtimeEnv) return;
265
+ const namespace = driverOptions.namespace ?? TANSTACK_CACHE_NAMESPACE;
266
+ try {
267
+ const keys = await listR2Keys(
268
+ runtimeEnv.r2,
269
+ cimplifyTanstackR2ListPrefix(runtimeEnv.prefix, base, namespace)
270
+ );
271
+ await Promise.all(keys.map((key) => runtimeEnv.r2.delete(key)));
272
+ } catch {
273
+ }
274
+ }
275
+ };
276
+ }
277
+ var cimplifyTanstackCacheDriver = createCimplifyTanstackCacheDriver;
278
+
279
+ export { CIMPLIFY_CACHE_META_FIELD, CIMPLIFY_TAG_PREFIX, TANSTACK_CACHE_NAMESPACE, TANSTACK_PATH_INDEX_BINDING, TANSTACK_R2_BUCKET_BINDING, TANSTACK_R2_PREFIX_ENV, cimplifyTanstackCacheDriver, cimplifyTanstackCacheOptions, cimplifyTanstackR2Key, createCimplifyTanstackCacheDriver, withCimplifyCacheMetadata };
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunkXQ6LEDEO_js = require('../chunk-XQ6LEDEO.js');
3
+ var chunkOGQFDCZM_js = require('../chunk-OGQFDCZM.js');
4
4
  require('../chunk-XA3ZNR75.js');
5
5
  require('../chunk-OWW5GUSB.js');
6
6
 
7
7
  // src/mock/msw.ts
8
8
  async function createMswHandlers(options = {}) {
9
9
  const baseUrl = options.baseUrl ?? "http://localhost:8787";
10
- const handle = chunkXQ6LEDEO_js.createMockApp(options);
10
+ const handle = chunkOGQFDCZM_js.createMockApp(options);
11
11
  const msw = await import('msw').catch(() => {
12
12
  throw new Error("msw is required to use @cimplify/sdk/mock/msw \u2014 install it as a peer dependency");
13
13
  });
@@ -1,4 +1,4 @@
1
- import { createMockApp } from '../chunk-QXMO2LGU.mjs';
1
+ import { createMockApp } from '../chunk-J7L5LHGK.mjs';
2
2
  import '../chunk-AMZXALF6.mjs';
3
3
  import '../chunk-3G6RQLXK.mjs';
4
4
 
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkXGKMSLMJ_js = require('../chunk-XGKMSLMJ.js');
4
- require('../chunk-XQ6LEDEO.js');
3
+ var chunkY64AIRGW_js = require('../chunk-Y64AIRGW.js');
4
+ require('../chunk-OGQFDCZM.js');
5
5
  require('../chunk-QS4XDVHI.js');
6
6
  require('../chunk-CV5QMDQS.js');
7
7
  require('../chunk-7Y2O3E4D.js');
@@ -20,11 +20,11 @@ var PLACEHOLDER_PHRASES = [
20
20
  function createBrandSuite(opts) {
21
21
  vitest.describe(opts.label ?? "brand schema", () => {
22
22
  vitest.it("conforms to the Cimplify brand contract", () => {
23
- vitest.expect(() => chunkXGKMSLMJ_js.assertBrand(opts.brand)).not.toThrow();
23
+ vitest.expect(() => chunkY64AIRGW_js.assertBrand(opts.brand)).not.toThrow();
24
24
  });
25
25
  vitest.it("declares a known mock seed", () => {
26
26
  const b = opts.brand;
27
- vitest.expect(chunkXGKMSLMJ_js.SeedNameSchema.safeParse(b.mock?.seed).success).toBe(true);
27
+ vitest.expect(chunkY64AIRGW_js.SeedNameSchema.safeParse(b.mock?.seed).success).toBe(true);
28
28
  });
29
29
  vitest.it("has no placeholder copy left in", () => {
30
30
  const offenders = [];
@@ -56,7 +56,7 @@ ${msg}`);
56
56
  vitest.expect(b.mock?.businessId).toMatch(/^bus_/);
57
57
  });
58
58
  vitest.it("zod-parses cleanly", () => {
59
- const result = chunkXGKMSLMJ_js.BrandSchema.safeParse(opts.brand);
59
+ const result = chunkY64AIRGW_js.BrandSchema.safeParse(opts.brand);
60
60
  if (!result.success) {
61
61
  throw new Error(
62
62
  "Brand schema violations:\n" + result.error.issues.map((i) => ` \u2022 brand.${i.path.join(".")}: ${i.message}`).join("\n")
@@ -71,23 +71,23 @@ function createCartFlowSuite(opts = {}) {
71
71
  vitest.describe(opts.label ?? "cart flow against in-process mock", () => {
72
72
  let h;
73
73
  vitest.beforeEach(() => {
74
- h = chunkXGKMSLMJ_js.createTestClient(opts);
74
+ h = chunkY64AIRGW_js.createTestClient(opts);
75
75
  });
76
76
  vitest.afterEach(() => h.dispose());
77
77
  vitest.it("starts with an empty cart matching the canonical shape", async () => {
78
78
  const res = await h.client.cart.get();
79
79
  vitest.expect(res.ok).toBe(true);
80
80
  if (!res.ok) return;
81
- vitest.expect(() => chunkXGKMSLMJ_js.assertCart(res.value)).not.toThrow();
81
+ vitest.expect(() => chunkY64AIRGW_js.assertCart(res.value)).not.toThrow();
82
82
  vitest.expect(res.value.items).toHaveLength(0);
83
83
  });
84
84
  vitest.it("adds the first product, persists it, and returns a shape-valid cart", async () => {
85
- const { product, variantId } = await chunkXGKMSLMJ_js.fixtures.addFirstProduct(h.client);
85
+ const { product, variantId } = await chunkY64AIRGW_js.fixtures.addFirstProduct(h.client);
86
86
  vitest.expect(product.id).toBeTruthy();
87
87
  const get = await h.client.cart.get();
88
88
  vitest.expect(get.ok).toBe(true);
89
89
  if (!get.ok) return;
90
- vitest.expect(() => chunkXGKMSLMJ_js.assertCart(get.value)).not.toThrow();
90
+ vitest.expect(() => chunkY64AIRGW_js.assertCart(get.value)).not.toThrow();
91
91
  vitest.expect(get.value.items).toHaveLength(1);
92
92
  vitest.expect(get.value.items[0]?.item_id).toBe(product.id);
93
93
  if (variantId) {
@@ -98,8 +98,8 @@ function createCartFlowSuite(opts = {}) {
98
98
  vitest.expect(parseFloat(String(get.value.pricing.subtotal))).toBeGreaterThan(0);
99
99
  });
100
100
  vitest.it("dedupes by line_key when adding the same product twice", async () => {
101
- await chunkXGKMSLMJ_js.fixtures.addFirstProduct(h.client);
102
- await chunkXGKMSLMJ_js.fixtures.addFirstProduct(h.client);
101
+ await chunkY64AIRGW_js.fixtures.addFirstProduct(h.client);
102
+ await chunkY64AIRGW_js.fixtures.addFirstProduct(h.client);
103
103
  const res = await h.client.cart.get();
104
104
  vitest.expect(res.ok).toBe(true);
105
105
  if (!res.ok) return;
@@ -107,7 +107,7 @@ function createCartFlowSuite(opts = {}) {
107
107
  vitest.expect(res.value.items[0]?.quantity).toBe(2);
108
108
  });
109
109
  vitest.it("removes items and zeroes the subtotal", async () => {
110
- await chunkXGKMSLMJ_js.fixtures.addFirstProduct(h.client);
110
+ await chunkY64AIRGW_js.fixtures.addFirstProduct(h.client);
111
111
  const before = await h.client.cart.get();
112
112
  if (!before.ok) throw before.error;
113
113
  const itemId = before.value.items[0]?.id;
@@ -133,28 +133,28 @@ function createContractSuite(opts = {}) {
133
133
  vitest.describe(opts.label ?? "SDK \u2194 mock contract", () => {
134
134
  let h;
135
135
  vitest.beforeEach(() => {
136
- h = chunkXGKMSLMJ_js.createTestClient(opts);
136
+ h = chunkY64AIRGW_js.createTestClient(opts);
137
137
  });
138
138
  vitest.afterEach(() => h.dispose());
139
139
  vitest.it("AddItemPayload schema accepts a minimal valid body", () => {
140
- const result = chunkXGKMSLMJ_js.AddItemPayloadSchema.safeParse({ item_id: "prod_x", quantity: 1 });
140
+ const result = chunkY64AIRGW_js.AddItemPayloadSchema.safeParse({ item_id: "prod_x", quantity: 1 });
141
141
  vitest.expect(result.success).toBe(true);
142
142
  });
143
143
  vitest.it("AddItemPayload schema rejects negative quantity", () => {
144
- const result = chunkXGKMSLMJ_js.AddItemPayloadSchema.safeParse({ item_id: "prod_x", quantity: -1 });
144
+ const result = chunkY64AIRGW_js.AddItemPayloadSchema.safeParse({ item_id: "prod_x", quantity: -1 });
145
145
  vitest.expect(result.success).toBe(false);
146
146
  });
147
147
  vitest.it("AddItemPayload schema rejects empty item_id", () => {
148
- const result = chunkXGKMSLMJ_js.AddItemPayloadSchema.safeParse({ item_id: "", quantity: 1 });
148
+ const result = chunkY64AIRGW_js.AddItemPayloadSchema.safeParse({ item_id: "", quantity: 1 });
149
149
  vitest.expect(result.success).toBe(false);
150
150
  });
151
151
  vitest.it("Cart line items returned by the mock match CartItemSchema", async () => {
152
- const { product } = await chunkXGKMSLMJ_js.fixtures.addFirstProduct(h.client);
152
+ const { product } = await chunkY64AIRGW_js.fixtures.addFirstProduct(h.client);
153
153
  const get = await h.client.cart.get();
154
154
  if (!get.ok) throw get.error;
155
155
  vitest.expect(get.value.items.length).toBeGreaterThan(0);
156
156
  for (const item of get.value.items) {
157
- const result = chunkXGKMSLMJ_js.CartItemSchema.safeParse(item);
157
+ const result = chunkY64AIRGW_js.CartItemSchema.safeParse(item);
158
158
  if (!result.success) {
159
159
  const issues = result.error.issues.map((i) => ` \u2022 ${i.path.join(".")}: ${i.message}`).join("\n");
160
160
  throw new Error(`Cart item shape mismatch for ${product.name}:
@@ -164,19 +164,19 @@ ${issues}`);
164
164
  }
165
165
  });
166
166
  vitest.it("CheckoutResponse from the mock includes bill_token", async () => {
167
- await chunkXGKMSLMJ_js.fixtures.addFirstProduct(h.client);
167
+ await chunkY64AIRGW_js.fixtures.addFirstProduct(h.client);
168
168
  const cartRes = await h.client.cart.get();
169
169
  if (!cartRes.ok) throw cartRes.error;
170
170
  const checkout = await h.client.checkout.process({
171
171
  cart_id: cartRes.value.id,
172
- customer: chunkXGKMSLMJ_js.fixtures.customer(),
172
+ customer: chunkY64AIRGW_js.fixtures.customer(),
173
173
  order_type: "delivery",
174
174
  payment_method: "mobile_money",
175
175
  mobile_money_details: { phone_number: "+233244000000", provider: "mtn" }
176
176
  });
177
177
  vitest.expect(checkout.ok).toBe(true);
178
178
  if (!checkout.ok) return;
179
- const result = chunkXGKMSLMJ_js.CheckoutResponseSchema.safeParse(checkout.value);
179
+ const result = chunkY64AIRGW_js.CheckoutResponseSchema.safeParse(checkout.value);
180
180
  if (!result.success) {
181
181
  const issues = result.error.issues.map((i) => ` \u2022 ${i.path.join(".")}: ${i.message}`).join("\n");
182
182
  throw new Error(`CheckoutResponse shape mismatch:
@@ -1,5 +1,5 @@
1
- import { assertBrand, SeedNameSchema, BrandSchema, createTestClient, assertCart, fixtures, AddItemPayloadSchema, CartItemSchema, CheckoutResponseSchema } from '../chunk-UUW7WBCG.mjs';
2
- import '../chunk-QXMO2LGU.mjs';
1
+ import { assertBrand, SeedNameSchema, BrandSchema, createTestClient, assertCart, fixtures, AddItemPayloadSchema, CartItemSchema, CheckoutResponseSchema } from '../chunk-BYWJSPT4.mjs';
2
+ import '../chunk-J7L5LHGK.mjs';
3
3
  import '../chunk-H337NF4O.mjs';
4
4
  import '../chunk-3BKMNVTR.mjs';
5
5
  import '../chunk-TD3AY34U.mjs';
@@ -54,8 +54,8 @@ declare const CountryCodeSchema: z.ZodString;
54
54
  declare const LocaleSchema: z.ZodString;
55
55
  declare const PhoneE164Schema: z.ZodString;
56
56
  declare const SeedNameSchema: z.ZodEnum<{
57
- default: "default";
58
57
  empty: "empty";
58
+ default: "default";
59
59
  "reesa-storefront": "reesa-storefront";
60
60
  restaurant: "restaurant";
61
61
  retail: "retail";
@@ -71,11 +71,11 @@ declare const ProductTypeSchema: z.ZodEnum<{
71
71
  composite: "composite";
72
72
  }>;
73
73
  declare const LineTypeSchema: z.ZodEnum<{
74
+ simple: "simple";
74
75
  service: "service";
75
76
  digital: "digital";
76
77
  bundle: "bundle";
77
78
  composite: "composite";
78
- simple: "simple";
79
79
  }>;
80
80
  declare const ServiceStatusSchema: z.ZodEnum<{
81
81
  pending: "pending";
@@ -365,8 +365,8 @@ declare const BrandSchema: z.ZodObject<{
365
365
  }, z.core.$strip>;
366
366
  mock: z.ZodObject<{
367
367
  seed: z.ZodEnum<{
368
- default: "default";
369
368
  empty: "empty";
369
+ default: "default";
370
370
  "reesa-storefront": "reesa-storefront";
371
371
  restaurant: "restaurant";
372
372
  retail: "retail";
@@ -531,7 +531,7 @@ declare const assertBrand: (value: unknown) => asserts value is {
531
531
  summary: string;
532
532
  };
533
533
  mock: {
534
- seed: "default" | "empty" | "reesa-storefront" | "restaurant" | "retail" | "services" | "grocery" | "fashion";
534
+ seed: "empty" | "default" | "reesa-storefront" | "restaurant" | "retail" | "services" | "grocery" | "fashion";
535
535
  businessId: string;
536
536
  };
537
537
  trustItems?: {
@@ -780,11 +780,11 @@ declare const CartItemSchema: z.ZodObject<{
780
780
  quantity: z.ZodNumber;
781
781
  line_key: z.ZodString;
782
782
  line_type: z.ZodEnum<{
783
+ simple: "simple";
783
784
  service: "service";
784
785
  digital: "digital";
785
786
  bundle: "bundle";
786
787
  composite: "composite";
787
- simple: "simple";
788
788
  }>;
789
789
  name: z.ZodString;
790
790
  description: z.ZodOptional<z.ZodString>;
@@ -926,7 +926,7 @@ declare const assertCartItem: (value: unknown) => asserts value is {
926
926
  item_id: string;
927
927
  quantity: number;
928
928
  line_key: string;
929
- line_type: "service" | "digital" | "bundle" | "composite" | "simple";
929
+ line_type: "simple" | "service" | "digital" | "bundle" | "composite";
930
930
  name: string;
931
931
  is_available: boolean;
932
932
  base_price: string;
@@ -1076,11 +1076,11 @@ declare const CartSchema: z.ZodObject<{
1076
1076
  quantity: z.ZodNumber;
1077
1077
  line_key: z.ZodString;
1078
1078
  line_type: z.ZodEnum<{
1079
+ simple: "simple";
1079
1080
  service: "service";
1080
1081
  digital: "digital";
1081
1082
  bundle: "bundle";
1082
1083
  composite: "composite";
1083
- simple: "simple";
1084
1084
  }>;
1085
1085
  name: z.ZodString;
1086
1086
  description: z.ZodOptional<z.ZodString>;
@@ -1249,7 +1249,7 @@ declare const assertCart: (value: unknown) => asserts value is {
1249
1249
  item_id: string;
1250
1250
  quantity: number;
1251
1251
  line_key: string;
1252
- line_type: "service" | "digital" | "bundle" | "composite" | "simple";
1252
+ line_type: "simple" | "service" | "digital" | "bundle" | "composite";
1253
1253
  name: string;
1254
1254
  is_available: boolean;
1255
1255
  base_price: string;
@@ -1462,10 +1462,10 @@ declare const assertCheckoutBody: (value: unknown) => asserts value is {
1462
1462
  };
1463
1463
  declare const AuthorizationTypeSchema: z.ZodEnum<{
1464
1464
  phone: "phone";
1465
- address: "address";
1466
1465
  otp: "otp";
1467
1466
  pin: "pin";
1468
1467
  birthday: "birthday";
1468
+ address: "address";
1469
1469
  }>;
1470
1470
  declare const NextActionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1471
1471
  type: z.ZodLiteral<"none">;
@@ -1485,10 +1485,10 @@ declare const CheckoutResponseSchema: z.ZodObject<{
1485
1485
  requires_authorization: z.ZodBoolean;
1486
1486
  authorization_type: z.ZodOptional<z.ZodEnum<{
1487
1487
  phone: "phone";
1488
- address: "address";
1489
1488
  otp: "otp";
1490
1489
  pin: "pin";
1491
1490
  birthday: "birthday";
1491
+ address: "address";
1492
1492
  }>>;
1493
1493
  next_action: z.ZodDiscriminatedUnion<[z.ZodObject<{
1494
1494
  type: z.ZodLiteral<"none">;
@@ -1525,7 +1525,7 @@ declare const assertCheckoutResponse: (value: unknown) => asserts value is {
1525
1525
  display_text?: string | undefined;
1526
1526
  };
1527
1527
  payment_reference?: string | undefined;
1528
- authorization_type?: "phone" | "address" | "otp" | "pin" | "birthday" | undefined;
1528
+ authorization_type?: "phone" | "otp" | "pin" | "birthday" | "address" | undefined;
1529
1529
  provider?: string | undefined;
1530
1530
  authorization_url?: string | undefined;
1531
1531
  display_text?: string | undefined;
@@ -1724,8 +1724,8 @@ declare const PUBLIC_SCHEMAS: {
1724
1724
  }, z.core.$strip>;
1725
1725
  mock: z.ZodObject<{
1726
1726
  seed: z.ZodEnum<{
1727
- default: "default";
1728
1727
  empty: "empty";
1728
+ default: "default";
1729
1729
  "reesa-storefront": "reesa-storefront";
1730
1730
  restaurant: "restaurant";
1731
1731
  retail: "retail";
@@ -1785,11 +1785,11 @@ declare const PUBLIC_SCHEMAS: {
1785
1785
  quantity: z.ZodNumber;
1786
1786
  line_key: z.ZodString;
1787
1787
  line_type: z.ZodEnum<{
1788
+ simple: "simple";
1788
1789
  service: "service";
1789
1790
  digital: "digital";
1790
1791
  bundle: "bundle";
1791
1792
  composite: "composite";
1792
- simple: "simple";
1793
1793
  }>;
1794
1794
  name: z.ZodString;
1795
1795
  description: z.ZodOptional<z.ZodString>;
@@ -1953,11 +1953,11 @@ declare const PUBLIC_SCHEMAS: {
1953
1953
  quantity: z.ZodNumber;
1954
1954
  line_key: z.ZodString;
1955
1955
  line_type: z.ZodEnum<{
1956
+ simple: "simple";
1956
1957
  service: "service";
1957
1958
  digital: "digital";
1958
1959
  bundle: "bundle";
1959
1960
  composite: "composite";
1960
- simple: "simple";
1961
1961
  }>;
1962
1962
  name: z.ZodString;
1963
1963
  description: z.ZodOptional<z.ZodString>;
@@ -2131,10 +2131,10 @@ declare const PUBLIC_SCHEMAS: {
2131
2131
  requires_authorization: z.ZodBoolean;
2132
2132
  authorization_type: z.ZodOptional<z.ZodEnum<{
2133
2133
  phone: "phone";
2134
- address: "address";
2135
2134
  otp: "otp";
2136
2135
  pin: "pin";
2137
2136
  birthday: "birthday";
2137
+ address: "address";
2138
2138
  }>>;
2139
2139
  next_action: z.ZodDiscriminatedUnion<[z.ZodObject<{
2140
2140
  type: z.ZodLiteral<"none">;