@cimplify/sdk 0.79.0 → 0.81.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/advanced.d.mts +1 -1
- package/dist/advanced.d.ts +1 -1
- package/dist/advanced.js +20 -20
- package/dist/advanced.mjs +1 -1
- package/dist/{chunk-3BKMNVTR.mjs → chunk-7BM56JET.mjs} +1 -0
- package/dist/{chunk-FURKCWVG.mjs → chunk-7PAQR3VC.mjs} +2 -2
- package/dist/{chunk-BNA4GW4D.mjs → chunk-BRVIXGUW.mjs} +60 -0
- package/dist/{chunk-5BPBDWAA.js → chunk-GFM5JW45.js} +57 -36
- package/dist/{chunk-CV5QMDQS.js → chunk-HPN5R3K2.js} +1 -0
- package/dist/{chunk-T7ALPOK7.js → chunk-IZDJEDR4.js} +4 -4
- package/dist/{chunk-LBFTEXGD.mjs → chunk-NWUEWUX2.mjs} +22 -1
- package/dist/{chunk-OSTOGR4F.js → chunk-SRJEMEVZ.js} +60 -0
- package/dist/{client-Cn5trGYV.d.ts → client-BmDNlUMx.d.ts} +44 -2
- package/dist/{client-Byysg2IX.d.mts → client-C51FFhDz.d.mts} +2 -2
- package/dist/{client-D16qfHAB.d.mts → client-Cx3WLhMj.d.mts} +44 -2
- package/dist/{client-BAzvXSLJ.d.ts → client-Q_m-GkTl.d.ts} +2 -2
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +69 -69
- package/dist/index.mjs +3 -3
- package/dist/mock/cli.mjs +60 -0
- package/dist/mock/library.js +60 -0
- package/dist/mock/library.mjs +60 -0
- package/dist/mock/msw.js +60 -0
- package/dist/mock/msw.mjs +60 -0
- package/dist/react.d.mts +51 -4
- package/dist/react.d.ts +51 -4
- package/dist/react.js +371 -65
- package/dist/react.mjs +337 -53
- package/dist/{server-Daq42vK7.d.ts → server-N4Q24CnO.d.ts} +21 -0
- package/dist/{server-CGO4zneR.d.mts → server-hP9NLtTh.d.mts} +21 -0
- package/dist/server.d.mts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +7 -7
- package/dist/server.mjs +2 -2
- package/dist/testing/msw.d.mts +1 -1
- package/dist/testing/msw.d.ts +1 -1
- package/dist/testing/msw.js +2 -2
- package/dist/testing/msw.mjs +1 -1
- package/dist/testing/suite.d.mts +4 -4
- package/dist/testing/suite.d.ts +4 -4
- package/dist/testing/suite.js +23 -23
- package/dist/testing/suite.mjs +4 -4
- package/dist/testing.d.mts +18 -18
- package/dist/testing.d.ts +18 -18
- package/dist/testing.js +79 -79
- package/dist/testing.mjs +5 -5
- package/package.json +7 -2
- package/registry/catalogue-page.json +1 -1
- package/registry/product-card.json +1 -1
- package/registry/product-grid.json +1 -1
- package/registry/product-image-gallery.json +1 -1
- package/registry/product-page.json +1 -1
- package/registry/recently-viewed.json +1 -1
- package/registry/recommendation-carousel.json +1 -1
- package/registry/search-input.json +1 -1
- package/dist/server-BXT62nBC.d.mts +0 -1186
- package/dist/server-BXT62nBC.d.ts +0 -1186
|
@@ -894,6 +894,19 @@ interface PlacesService {
|
|
|
894
894
|
}): unknown;
|
|
895
895
|
}
|
|
896
896
|
|
|
897
|
+
interface MockDeliveryOption {
|
|
898
|
+
rate_id: string | null;
|
|
899
|
+
name: string;
|
|
900
|
+
description?: string;
|
|
901
|
+
fee: string;
|
|
902
|
+
currency: string;
|
|
903
|
+
free_delivery_applied: boolean;
|
|
904
|
+
free_over_amount?: string;
|
|
905
|
+
eta_min_minutes?: number;
|
|
906
|
+
eta_max_minutes?: number;
|
|
907
|
+
is_default: boolean;
|
|
908
|
+
details: Record<string, unknown>;
|
|
909
|
+
}
|
|
897
910
|
interface DeliveryService {
|
|
898
911
|
getFee(opts: {
|
|
899
912
|
lat?: number;
|
|
@@ -907,6 +920,14 @@ interface DeliveryService {
|
|
|
907
920
|
provider: string;
|
|
908
921
|
quotes: unknown[];
|
|
909
922
|
};
|
|
923
|
+
getOptions(opts: {
|
|
924
|
+
lat?: number;
|
|
925
|
+
lng?: number;
|
|
926
|
+
order_value?: string;
|
|
927
|
+
}): {
|
|
928
|
+
serviceable: boolean;
|
|
929
|
+
options: MockDeliveryOption[];
|
|
930
|
+
};
|
|
910
931
|
}
|
|
911
932
|
|
|
912
933
|
interface ActivityService {
|
package/dist/server.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ad as CimplifyClient } from './client-
|
|
2
|
-
export { K as CacheOptions,
|
|
1
|
+
import { ad as CimplifyClient } from './client-Cx3WLhMj.mjs';
|
|
2
|
+
export { K as CacheOptions, ct as ReadRequestOptions, cP as Result } from './client-Cx3WLhMj.mjs';
|
|
3
3
|
export { Q as Category, T as CimplifyError, U as Collection, aX as Product, b9 as ProductWithDetails } from './product-BgFOFmQw.mjs';
|
|
4
4
|
import { JWTVerifyResult } from 'jose';
|
|
5
5
|
import './payment-B7qzWdaJ.mjs';
|
package/dist/server.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ad as CimplifyClient } from './client-
|
|
2
|
-
export { K as CacheOptions,
|
|
1
|
+
import { ad as CimplifyClient } from './client-BmDNlUMx.js';
|
|
2
|
+
export { K as CacheOptions, ct as ReadRequestOptions, cP as Result } from './client-BmDNlUMx.js';
|
|
3
3
|
export { Q as Category, T as CimplifyError, U as Collection, aX as Product, b9 as ProductWithDetails } from './product-BgFOFmQw.js';
|
|
4
4
|
import { JWTVerifyResult } from 'jose';
|
|
5
5
|
import './payment-mVIJIJcq.js';
|
package/dist/server.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkGFM5JW45_js = require('./chunk-GFM5JW45.js');
|
|
4
|
+
var chunkHPN5R3K2_js = require('./chunk-HPN5R3K2.js');
|
|
5
5
|
require('./chunk-7Y2O3E4D.js');
|
|
6
6
|
var chunkXA3ZNR75_js = require('./chunk-XA3ZNR75.js');
|
|
7
7
|
require('./chunk-OWW5GUSB.js');
|
|
@@ -26,7 +26,7 @@ function readEnv(...keys) {
|
|
|
26
26
|
var getServerClient = react.cache((opts = {}) => {
|
|
27
27
|
const baseUrl = opts.apiUrl ?? readEnv("CIMPLIFY_API_URL", "NEXT_PUBLIC_CIMPLIFY_API_URL") ?? defaultBaseUrl();
|
|
28
28
|
const publicKey = opts.secretKey ?? readEnv("CIMPLIFY_SECRET_KEY", "NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY") ?? "mock-dev";
|
|
29
|
-
const client =
|
|
29
|
+
const client = chunkGFM5JW45_js.createCimplifyClient({
|
|
30
30
|
baseUrl,
|
|
31
31
|
publicKey,
|
|
32
32
|
suppressPublicKeyWarning: true
|
|
@@ -250,7 +250,7 @@ var QUERY_AUTH_ERROR = "cimplify_auth_error";
|
|
|
250
250
|
var discoveryCache = /* @__PURE__ */ new Map();
|
|
251
251
|
var jwksCache = /* @__PURE__ */ new Map();
|
|
252
252
|
function issuerBase(cfg) {
|
|
253
|
-
return (cfg.issuer ?? cfg.authUrl ??
|
|
253
|
+
return (cfg.issuer ?? cfg.authUrl ?? chunkHPN5R3K2_js.DEFAULT_ISSUER).replace(/\/$/, "");
|
|
254
254
|
}
|
|
255
255
|
function cookieName(cfg) {
|
|
256
256
|
return cfg.cookieName ?? SESSION_COOKIE;
|
|
@@ -465,12 +465,12 @@ async function handleOidcCallback(req, opts) {
|
|
|
465
465
|
}
|
|
466
466
|
function readPkceCookie(cookieHeader) {
|
|
467
467
|
if (!cookieHeader) return null;
|
|
468
|
-
const match = cookieHeader.split(/;\s*/).find((p) => p.startsWith(`${
|
|
468
|
+
const match = cookieHeader.split(/;\s*/).find((p) => p.startsWith(`${chunkHPN5R3K2_js.PKCE_COOKIE}=`));
|
|
469
469
|
if (!match) return null;
|
|
470
|
-
return
|
|
470
|
+
return chunkHPN5R3K2_js.decodePkceState(match.slice(chunkHPN5R3K2_js.PKCE_COOKIE.length + 1));
|
|
471
471
|
}
|
|
472
472
|
function buildPkceClearCookie() {
|
|
473
|
-
return `${
|
|
473
|
+
return `${chunkHPN5R3K2_js.PKCE_COOKIE}=; Path=${chunkHPN5R3K2_js.PKCE_COOKIE_PATH}; Max-Age=0; Secure; SameSite=Lax`;
|
|
474
474
|
}
|
|
475
475
|
function safeReturnPath(returnTo, fallback) {
|
|
476
476
|
if (returnTo && returnTo.startsWith("/") && !returnTo.startsWith("//")) return returnTo;
|
package/dist/server.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createCimplifyClient } from './chunk-
|
|
2
|
-
import { PKCE_COOKIE, decodePkceState, PKCE_COOKIE_PATH, DEFAULT_ISSUER } from './chunk-
|
|
1
|
+
import { createCimplifyClient } from './chunk-NWUEWUX2.mjs';
|
|
2
|
+
import { PKCE_COOKIE, decodePkceState, PKCE_COOKIE_PATH, DEFAULT_ISSUER } from './chunk-7BM56JET.mjs';
|
|
3
3
|
import './chunk-TD3AY34U.mjs';
|
|
4
4
|
export { CimplifyError } from './chunk-AMZXALF6.mjs';
|
|
5
5
|
import './chunk-3G6RQLXK.mjs';
|
package/dist/testing/msw.d.mts
CHANGED
package/dist/testing/msw.d.ts
CHANGED
package/dist/testing/msw.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkSRJEMEVZ_js = require('../chunk-SRJEMEVZ.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 =
|
|
10
|
+
const handle = chunkSRJEMEVZ_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
|
});
|
package/dist/testing/msw.mjs
CHANGED
package/dist/testing/suite.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TestAPI } from 'vitest';
|
|
2
|
-
import { T as TestClientHandle } from '../client-
|
|
3
|
-
import { C as CreateAppOptions } from '../server-
|
|
4
|
-
export { S as SeedName } from '../server-
|
|
5
|
-
import '../client-
|
|
2
|
+
import { T as TestClientHandle } from '../client-C51FFhDz.mjs';
|
|
3
|
+
import { C as CreateAppOptions } from '../server-hP9NLtTh.mjs';
|
|
4
|
+
export { S as SeedName } from '../server-hP9NLtTh.mjs';
|
|
5
|
+
import '../client-Cx3WLhMj.mjs';
|
|
6
6
|
import '../product-BgFOFmQw.mjs';
|
|
7
7
|
import '../payment-B7qzWdaJ.mjs';
|
|
8
8
|
import 'hono';
|
package/dist/testing/suite.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TestAPI } from 'vitest';
|
|
2
|
-
import { T as TestClientHandle } from '../client-
|
|
3
|
-
import { C as CreateAppOptions } from '../server-
|
|
4
|
-
export { S as SeedName } from '../server-
|
|
5
|
-
import '../client-
|
|
2
|
+
import { T as TestClientHandle } from '../client-Q_m-GkTl.js';
|
|
3
|
+
import { C as CreateAppOptions } from '../server-N4Q24CnO.js';
|
|
4
|
+
export { S as SeedName } from '../server-N4Q24CnO.js';
|
|
5
|
+
import '../client-BmDNlUMx.js';
|
|
6
6
|
import '../product-BgFOFmQw.js';
|
|
7
7
|
import '../payment-mVIJIJcq.js';
|
|
8
8
|
import 'hono';
|
package/dist/testing/suite.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
5
|
-
require('../chunk-
|
|
6
|
-
require('../chunk-
|
|
3
|
+
var chunkIZDJEDR4_js = require('../chunk-IZDJEDR4.js');
|
|
4
|
+
require('../chunk-SRJEMEVZ.js');
|
|
5
|
+
require('../chunk-GFM5JW45.js');
|
|
6
|
+
require('../chunk-HPN5R3K2.js');
|
|
7
7
|
require('../chunk-7Y2O3E4D.js');
|
|
8
8
|
require('../chunk-XA3ZNR75.js');
|
|
9
9
|
require('../chunk-OWW5GUSB.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(() =>
|
|
23
|
+
vitest.expect(() => chunkIZDJEDR4_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(
|
|
27
|
+
vitest.expect(chunkIZDJEDR4_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 =
|
|
59
|
+
const result = chunkIZDJEDR4_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 =
|
|
74
|
+
h = chunkIZDJEDR4_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(() =>
|
|
81
|
+
vitest.expect(() => chunkIZDJEDR4_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
|
|
85
|
+
const { product, variantId } = await chunkIZDJEDR4_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(() =>
|
|
90
|
+
vitest.expect(() => chunkIZDJEDR4_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
|
|
102
|
-
await
|
|
101
|
+
await chunkIZDJEDR4_js.fixtures.addFirstProduct(h.client);
|
|
102
|
+
await chunkIZDJEDR4_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
|
|
110
|
+
await chunkIZDJEDR4_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 =
|
|
136
|
+
h = chunkIZDJEDR4_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 =
|
|
140
|
+
const result = chunkIZDJEDR4_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 =
|
|
144
|
+
const result = chunkIZDJEDR4_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 =
|
|
148
|
+
const result = chunkIZDJEDR4_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
|
|
152
|
+
const { product } = await chunkIZDJEDR4_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 =
|
|
157
|
+
const result = chunkIZDJEDR4_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
|
|
167
|
+
await chunkIZDJEDR4_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:
|
|
172
|
+
customer: chunkIZDJEDR4_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 =
|
|
179
|
+
const result = chunkIZDJEDR4_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:
|
package/dist/testing/suite.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { assertBrand, SeedNameSchema, BrandSchema, createTestClient, assertCart, fixtures, AddItemPayloadSchema, CartItemSchema, CheckoutResponseSchema } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-
|
|
1
|
+
import { assertBrand, SeedNameSchema, BrandSchema, createTestClient, assertCart, fixtures, AddItemPayloadSchema, CartItemSchema, CheckoutResponseSchema } from '../chunk-7PAQR3VC.mjs';
|
|
2
|
+
import '../chunk-BRVIXGUW.mjs';
|
|
3
|
+
import '../chunk-NWUEWUX2.mjs';
|
|
4
|
+
import '../chunk-7BM56JET.mjs';
|
|
5
5
|
import '../chunk-TD3AY34U.mjs';
|
|
6
6
|
import '../chunk-AMZXALF6.mjs';
|
|
7
7
|
import '../chunk-3G6RQLXK.mjs';
|
package/dist/testing.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { $ZodType } from 'zod/v4/core';
|
|
3
|
-
export { A as AddFirstProductOptions, a as AddFirstProductResult, P as ProductSummary, T as TestClientHandle, c as createTestClient, f as fixtures } from './client-
|
|
4
|
-
import './client-
|
|
3
|
+
export { A as AddFirstProductOptions, a as AddFirstProductResult, P as ProductSummary, T as TestClientHandle, c as createTestClient, f as fixtures } from './client-C51FFhDz.mjs';
|
|
4
|
+
import './client-Cx3WLhMj.mjs';
|
|
5
5
|
import './product-BgFOFmQw.mjs';
|
|
6
6
|
import './payment-B7qzWdaJ.mjs';
|
|
7
|
-
import './server-
|
|
7
|
+
import './server-hP9NLtTh.mjs';
|
|
8
8
|
import 'hono';
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -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: "
|
|
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: "
|
|
929
|
+
line_type: "simple" | "service" | "digital" | "bundle" | "composite";
|
|
930
930
|
name: string;
|
|
931
931
|
is_available: boolean;
|
|
932
932
|
base_price: string;
|
|
@@ -1079,11 +1079,11 @@ declare const CartSchema: z.ZodObject<{
|
|
|
1079
1079
|
quantity: z.ZodNumber;
|
|
1080
1080
|
line_key: z.ZodString;
|
|
1081
1081
|
line_type: z.ZodEnum<{
|
|
1082
|
+
simple: "simple";
|
|
1082
1083
|
service: "service";
|
|
1083
1084
|
digital: "digital";
|
|
1084
1085
|
bundle: "bundle";
|
|
1085
1086
|
composite: "composite";
|
|
1086
|
-
simple: "simple";
|
|
1087
1087
|
}>;
|
|
1088
1088
|
name: z.ZodString;
|
|
1089
1089
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -1255,7 +1255,7 @@ declare const assertCart: (value: unknown) => asserts value is {
|
|
|
1255
1255
|
item_id: string;
|
|
1256
1256
|
quantity: number;
|
|
1257
1257
|
line_key: string;
|
|
1258
|
-
line_type: "
|
|
1258
|
+
line_type: "simple" | "service" | "digital" | "bundle" | "composite";
|
|
1259
1259
|
name: string;
|
|
1260
1260
|
is_available: boolean;
|
|
1261
1261
|
base_price: string;
|
|
@@ -1471,10 +1471,10 @@ declare const assertCheckoutBody: (value: unknown) => asserts value is {
|
|
|
1471
1471
|
};
|
|
1472
1472
|
declare const AuthorizationTypeSchema: z.ZodEnum<{
|
|
1473
1473
|
phone: "phone";
|
|
1474
|
-
address: "address";
|
|
1475
1474
|
otp: "otp";
|
|
1476
1475
|
pin: "pin";
|
|
1477
1476
|
birthday: "birthday";
|
|
1477
|
+
address: "address";
|
|
1478
1478
|
}>;
|
|
1479
1479
|
declare const NextActionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1480
1480
|
type: z.ZodLiteral<"none">;
|
|
@@ -1494,10 +1494,10 @@ declare const CheckoutResponseSchema: z.ZodObject<{
|
|
|
1494
1494
|
requires_authorization: z.ZodBoolean;
|
|
1495
1495
|
authorization_type: z.ZodOptional<z.ZodEnum<{
|
|
1496
1496
|
phone: "phone";
|
|
1497
|
-
address: "address";
|
|
1498
1497
|
otp: "otp";
|
|
1499
1498
|
pin: "pin";
|
|
1500
1499
|
birthday: "birthday";
|
|
1500
|
+
address: "address";
|
|
1501
1501
|
}>>;
|
|
1502
1502
|
next_action: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1503
1503
|
type: z.ZodLiteral<"none">;
|
|
@@ -1534,7 +1534,7 @@ declare const assertCheckoutResponse: (value: unknown) => asserts value is {
|
|
|
1534
1534
|
display_text?: string | undefined;
|
|
1535
1535
|
};
|
|
1536
1536
|
payment_reference?: string | undefined;
|
|
1537
|
-
authorization_type?: "phone" | "
|
|
1537
|
+
authorization_type?: "phone" | "otp" | "pin" | "birthday" | "address" | undefined;
|
|
1538
1538
|
provider?: string | undefined;
|
|
1539
1539
|
authorization_url?: string | undefined;
|
|
1540
1540
|
display_text?: string | undefined;
|
|
@@ -1733,8 +1733,8 @@ declare const PUBLIC_SCHEMAS: {
|
|
|
1733
1733
|
}, z.core.$strip>;
|
|
1734
1734
|
mock: z.ZodObject<{
|
|
1735
1735
|
seed: z.ZodEnum<{
|
|
1736
|
-
default: "default";
|
|
1737
1736
|
empty: "empty";
|
|
1737
|
+
default: "default";
|
|
1738
1738
|
"reesa-storefront": "reesa-storefront";
|
|
1739
1739
|
restaurant: "restaurant";
|
|
1740
1740
|
retail: "retail";
|
|
@@ -1794,11 +1794,11 @@ declare const PUBLIC_SCHEMAS: {
|
|
|
1794
1794
|
quantity: z.ZodNumber;
|
|
1795
1795
|
line_key: z.ZodString;
|
|
1796
1796
|
line_type: z.ZodEnum<{
|
|
1797
|
+
simple: "simple";
|
|
1797
1798
|
service: "service";
|
|
1798
1799
|
digital: "digital";
|
|
1799
1800
|
bundle: "bundle";
|
|
1800
1801
|
composite: "composite";
|
|
1801
|
-
simple: "simple";
|
|
1802
1802
|
}>;
|
|
1803
1803
|
name: z.ZodString;
|
|
1804
1804
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -1965,11 +1965,11 @@ declare const PUBLIC_SCHEMAS: {
|
|
|
1965
1965
|
quantity: z.ZodNumber;
|
|
1966
1966
|
line_key: z.ZodString;
|
|
1967
1967
|
line_type: z.ZodEnum<{
|
|
1968
|
+
simple: "simple";
|
|
1968
1969
|
service: "service";
|
|
1969
1970
|
digital: "digital";
|
|
1970
1971
|
bundle: "bundle";
|
|
1971
1972
|
composite: "composite";
|
|
1972
|
-
simple: "simple";
|
|
1973
1973
|
}>;
|
|
1974
1974
|
name: z.ZodString;
|
|
1975
1975
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -2146,10 +2146,10 @@ declare const PUBLIC_SCHEMAS: {
|
|
|
2146
2146
|
requires_authorization: z.ZodBoolean;
|
|
2147
2147
|
authorization_type: z.ZodOptional<z.ZodEnum<{
|
|
2148
2148
|
phone: "phone";
|
|
2149
|
-
address: "address";
|
|
2150
2149
|
otp: "otp";
|
|
2151
2150
|
pin: "pin";
|
|
2152
2151
|
birthday: "birthday";
|
|
2152
|
+
address: "address";
|
|
2153
2153
|
}>>;
|
|
2154
2154
|
next_action: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
2155
2155
|
type: z.ZodLiteral<"none">;
|