@cimplify/sdk 0.100.2 → 0.100.3
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-IJI7KMTG.js → chunk-CNY2XFN4.js} +255 -74
- package/dist/{chunk-TIQLOH2B.mjs → chunk-FFRQNNUQ.mjs} +3 -0
- package/dist/{chunk-6JEKKL3M.js → chunk-FWKSBF3F.js} +3 -0
- package/dist/{chunk-B2YOCOLH.mjs → chunk-HFTRLRLM.mjs} +2 -2
- package/dist/{chunk-QRBBSIAY.js → chunk-KNCW5DI7.js} +4 -4
- package/dist/{chunk-YWNJJO2U.mjs → chunk-NOGCGI4J.mjs} +2 -2
- package/dist/{chunk-IFAQLFAJ.js → chunk-XCS56XSS.js} +2 -2
- package/dist/{chunk-PJUXAUM2.mjs → chunk-XG4DZT4I.mjs} +209 -28
- package/dist/{client-C6wb92AD.d.mts → client-BGeSemVv.d.mts} +2 -2
- package/dist/{client-LPg_AUUr.d.ts → client-BWdeCgmo.d.ts} +11 -2
- package/dist/{client-D8XcrONA.d.mts → client-Bx4NRdl8.d.mts} +11 -2
- package/dist/{client-CgXkRu2o.d.ts → client-Cvp8W1r9.d.ts} +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +69 -69
- package/dist/index.mjs +3 -3
- package/dist/mock/cli.mjs +2 -2
- package/dist/mock/library.js +2 -2
- package/dist/mock/library.mjs +2 -2
- package/dist/mock/msw.js +2 -2
- package/dist/mock/msw.mjs +2 -2
- package/dist/react.d.mts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +25 -25
- package/dist/react.mjs +2 -2
- package/dist/{server--RyVAfPN.d.mts → server-BRJ61o2J.d.mts} +3 -3
- package/dist/{server-CNyy47HL.d.ts → server-CXrVYtNo.d.ts} +3 -3
- 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 +3 -3
- package/dist/testing.d.ts +3 -3
- package/dist/testing.js +79 -79
- package/dist/testing.mjs +5 -5
- package/package.json +1 -1
package/dist/react.mjs
CHANGED
|
@@ -3,8 +3,8 @@ import { DURATION_UNIT, getVariantDisplayName, INPUT_FIELD_TYPE, isMultiDayServi
|
|
|
3
3
|
export { getVariantDisplayName } from './chunk-4G5UWFC3.mjs';
|
|
4
4
|
import { splitGenUIContent, messagePreview } from './chunk-U4MW6PYU.mjs';
|
|
5
5
|
export { messagePreview, splitGenUIContent } from './chunk-U4MW6PYU.mjs';
|
|
6
|
-
import { SESSION_CLAIMED, SESSION_CLEARED, createCimplifyClient, AUTH_TOKEN_CHANGED, MUTATION_ERROR } from './chunk-
|
|
7
|
-
import { generateIdempotencyKey, ELEMENT_TYPES, EVENT_TYPES, startSignIn } from './chunk-
|
|
6
|
+
import { SESSION_CLAIMED, SESSION_CLEARED, createCimplifyClient, AUTH_TOKEN_CHANGED, MUTATION_ERROR } from './chunk-XG4DZT4I.mjs';
|
|
7
|
+
import { generateIdempotencyKey, ELEMENT_TYPES, EVENT_TYPES, startSignIn } from './chunk-FFRQNNUQ.mjs';
|
|
8
8
|
import { parsePrice, formatMoney, formatPrice, getVariantUnitPrice, getProductCurrency, getUnitPriceAtQuantity, isOnSale, getDiscountPercentage, getBasePrice, getPriceRange, formatPriceRange } from './chunk-DLW3RWRK.mjs';
|
|
9
9
|
import { isSupportedCurrency, currencyCode, CimplifyError } from './chunk-O3YUHLZL.mjs';
|
|
10
10
|
import './chunk-3G6RQLXK.mjs';
|
|
@@ -936,10 +936,10 @@ interface DeliveryService {
|
|
|
936
936
|
}
|
|
937
937
|
|
|
938
938
|
interface ActivityService {
|
|
939
|
-
recordEvents(businessId: string, sessionId: string | undefined, events: {
|
|
940
|
-
|
|
939
|
+
recordEvents(businessId: string, sessionId: string | undefined, events: Array<{
|
|
940
|
+
type: string;
|
|
941
941
|
payload?: Record<string, unknown>;
|
|
942
|
-
}
|
|
942
|
+
}>): {
|
|
943
943
|
recorded: number;
|
|
944
944
|
};
|
|
945
945
|
getState(businessId: string, sessionId: string | undefined): unknown;
|
|
@@ -936,10 +936,10 @@ interface DeliveryService {
|
|
|
936
936
|
}
|
|
937
937
|
|
|
938
938
|
interface ActivityService {
|
|
939
|
-
recordEvents(businessId: string, sessionId: string | undefined, events: {
|
|
940
|
-
|
|
939
|
+
recordEvents(businessId: string, sessionId: string | undefined, events: Array<{
|
|
940
|
+
type: string;
|
|
941
941
|
payload?: Record<string, unknown>;
|
|
942
|
-
}
|
|
942
|
+
}>): {
|
|
943
943
|
recorded: number;
|
|
944
944
|
};
|
|
945
945
|
getState(businessId: string, sessionId: string | undefined): unknown;
|
package/dist/server.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { af as CimplifyClient } from './client-
|
|
2
|
-
export { J as CacheOptions, cD as ReadRequestOptions, c_ as Result } from './client-
|
|
1
|
+
import { af as CimplifyClient } from './client-Bx4NRdl8.mjs';
|
|
2
|
+
export { J as CacheOptions, cD as ReadRequestOptions, c_ as Result } from './client-Bx4NRdl8.mjs';
|
|
3
3
|
export { S as Category, V as CimplifyError, W as Collection, aZ as Product, bb as ProductWithDetails } from './product-CeV8euw4.mjs';
|
|
4
4
|
import { JWTVerifyResult } from 'jose';
|
|
5
5
|
import './payment-BSzy7sly.mjs';
|
package/dist/server.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { af as CimplifyClient } from './client-
|
|
2
|
-
export { J as CacheOptions, cD as ReadRequestOptions, c_ as Result } from './client-
|
|
1
|
+
import { af as CimplifyClient } from './client-BWdeCgmo.js';
|
|
2
|
+
export { J as CacheOptions, cD as ReadRequestOptions, c_ as Result } from './client-BWdeCgmo.js';
|
|
3
3
|
export { S as Category, V as CimplifyError, W as Collection, aZ as Product, bb as ProductWithDetails } from './product-CeV8euw4.js';
|
|
4
4
|
import { JWTVerifyResult } from 'jose';
|
|
5
5
|
import './payment-jK8ztICx.js';
|
package/dist/server.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkCNY2XFN4_js = require('./chunk-CNY2XFN4.js');
|
|
4
|
+
var chunkFWKSBF3F_js = require('./chunk-FWKSBF3F.js');
|
|
5
5
|
require('./chunk-WMEC5JWN.js');
|
|
6
6
|
var chunkNIOUSKQQ_js = require('./chunk-NIOUSKQQ.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 = chunkCNY2XFN4_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 ?? chunkFWKSBF3F_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(`${chunkFWKSBF3F_js.PKCE_COOKIE}=`));
|
|
469
469
|
if (!match) return null;
|
|
470
|
-
return
|
|
470
|
+
return chunkFWKSBF3F_js.decodePkceState(match.slice(chunkFWKSBF3F_js.PKCE_COOKIE.length + 1));
|
|
471
471
|
}
|
|
472
472
|
function buildPkceClearCookie() {
|
|
473
|
-
return `${
|
|
473
|
+
return `${chunkFWKSBF3F_js.PKCE_COOKIE}=; Path=${chunkFWKSBF3F_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-XG4DZT4I.mjs';
|
|
2
|
+
import { PKCE_COOKIE, decodePkceState, PKCE_COOKIE_PATH, DEFAULT_ISSUER } from './chunk-FFRQNNUQ.mjs';
|
|
3
3
|
import './chunk-DLW3RWRK.mjs';
|
|
4
4
|
export { CimplifyError } from './chunk-O3YUHLZL.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,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkXCS56XSS_js = require('../chunk-XCS56XSS.js');
|
|
4
4
|
require('../chunk-XREIZ56K.js');
|
|
5
5
|
require('../chunk-NIOUSKQQ.js');
|
|
6
6
|
require('../chunk-OWW5GUSB.js');
|
|
@@ -8,7 +8,7 @@ require('../chunk-OWW5GUSB.js');
|
|
|
8
8
|
// src/mock/msw.ts
|
|
9
9
|
async function createMswHandlers(options = {}) {
|
|
10
10
|
const baseUrl = options.baseUrl ?? "http://localhost:8787";
|
|
11
|
-
const handle =
|
|
11
|
+
const handle = chunkXCS56XSS_js.createMockApp(options);
|
|
12
12
|
const msw = await import('msw').catch(() => {
|
|
13
13
|
throw new Error("msw is required to use @cimplify/sdk/mock/msw \u2014 install it as a peer dependency");
|
|
14
14
|
});
|
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-BGeSemVv.mjs';
|
|
3
|
+
import { C as CreateAppOptions } from '../server-BRJ61o2J.mjs';
|
|
4
|
+
export { S as SeedName } from '../server-BRJ61o2J.mjs';
|
|
5
|
+
import '../client-Bx4NRdl8.mjs';
|
|
6
6
|
import '../product-CeV8euw4.mjs';
|
|
7
7
|
import '../payment-BSzy7sly.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-Cvp8W1r9.js';
|
|
3
|
+
import { C as CreateAppOptions } from '../server-CXrVYtNo.js';
|
|
4
|
+
export { S as SeedName } from '../server-CXrVYtNo.js';
|
|
5
|
+
import '../client-BWdeCgmo.js';
|
|
6
6
|
import '../product-CeV8euw4.js';
|
|
7
7
|
import '../payment-jK8ztICx.js';
|
|
8
8
|
import 'hono';
|
package/dist/testing/suite.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
3
|
+
var chunkKNCW5DI7_js = require('../chunk-KNCW5DI7.js');
|
|
4
|
+
require('../chunk-XCS56XSS.js');
|
|
5
5
|
require('../chunk-XREIZ56K.js');
|
|
6
|
-
require('../chunk-
|
|
7
|
-
require('../chunk-
|
|
6
|
+
require('../chunk-CNY2XFN4.js');
|
|
7
|
+
require('../chunk-FWKSBF3F.js');
|
|
8
8
|
require('../chunk-WMEC5JWN.js');
|
|
9
9
|
require('../chunk-NIOUSKQQ.js');
|
|
10
10
|
require('../chunk-OWW5GUSB.js');
|
|
@@ -21,11 +21,11 @@ var PLACEHOLDER_PHRASES = [
|
|
|
21
21
|
function createBrandSuite(opts) {
|
|
22
22
|
vitest.describe(opts.label ?? "brand schema", () => {
|
|
23
23
|
vitest.it("conforms to the Cimplify brand contract", () => {
|
|
24
|
-
vitest.expect(() =>
|
|
24
|
+
vitest.expect(() => chunkKNCW5DI7_js.assertBrand(opts.brand)).not.toThrow();
|
|
25
25
|
});
|
|
26
26
|
vitest.it("declares a known mock seed", () => {
|
|
27
27
|
const b = opts.brand;
|
|
28
|
-
vitest.expect(
|
|
28
|
+
vitest.expect(chunkKNCW5DI7_js.SeedNameSchema.safeParse(b.mock?.seed).success).toBe(true);
|
|
29
29
|
});
|
|
30
30
|
vitest.it("has no placeholder copy left in", () => {
|
|
31
31
|
const offenders = [];
|
|
@@ -57,7 +57,7 @@ ${msg}`);
|
|
|
57
57
|
vitest.expect(b.mock?.businessId).toMatch(/^bus_/);
|
|
58
58
|
});
|
|
59
59
|
vitest.it("zod-parses cleanly", () => {
|
|
60
|
-
const result =
|
|
60
|
+
const result = chunkKNCW5DI7_js.BrandSchema.safeParse(opts.brand);
|
|
61
61
|
if (!result.success) {
|
|
62
62
|
throw new Error(
|
|
63
63
|
"Brand schema violations:\n" + result.error.issues.map((i) => ` \u2022 brand.${i.path.join(".")}: ${i.message}`).join("\n")
|
|
@@ -72,23 +72,23 @@ function createCartFlowSuite(opts = {}) {
|
|
|
72
72
|
vitest.describe(opts.label ?? "cart flow against in-process mock", () => {
|
|
73
73
|
let h;
|
|
74
74
|
vitest.beforeEach(() => {
|
|
75
|
-
h =
|
|
75
|
+
h = chunkKNCW5DI7_js.createTestClient(opts);
|
|
76
76
|
});
|
|
77
77
|
vitest.afterEach(() => h.dispose());
|
|
78
78
|
vitest.it("starts with an empty cart matching the canonical shape", async () => {
|
|
79
79
|
const res = await h.client.cart.get();
|
|
80
80
|
vitest.expect(res.ok).toBe(true);
|
|
81
81
|
if (!res.ok) return;
|
|
82
|
-
vitest.expect(() =>
|
|
82
|
+
vitest.expect(() => chunkKNCW5DI7_js.assertCart(res.value)).not.toThrow();
|
|
83
83
|
vitest.expect(res.value.items).toHaveLength(0);
|
|
84
84
|
});
|
|
85
85
|
vitest.it("adds the first product, persists it, and returns a shape-valid cart", async () => {
|
|
86
|
-
const { product, variantId } = await
|
|
86
|
+
const { product, variantId } = await chunkKNCW5DI7_js.fixtures.addFirstProduct(h.client);
|
|
87
87
|
vitest.expect(product.id).toBeTruthy();
|
|
88
88
|
const get = await h.client.cart.get();
|
|
89
89
|
vitest.expect(get.ok).toBe(true);
|
|
90
90
|
if (!get.ok) return;
|
|
91
|
-
vitest.expect(() =>
|
|
91
|
+
vitest.expect(() => chunkKNCW5DI7_js.assertCart(get.value)).not.toThrow();
|
|
92
92
|
vitest.expect(get.value.items).toHaveLength(1);
|
|
93
93
|
vitest.expect(get.value.items[0]?.item_id).toBe(product.id);
|
|
94
94
|
if (variantId) {
|
|
@@ -99,8 +99,8 @@ function createCartFlowSuite(opts = {}) {
|
|
|
99
99
|
vitest.expect(parseFloat(String(get.value.pricing.subtotal))).toBeGreaterThan(0);
|
|
100
100
|
});
|
|
101
101
|
vitest.it("dedupes by line_key when adding the same product twice", async () => {
|
|
102
|
-
await
|
|
103
|
-
await
|
|
102
|
+
await chunkKNCW5DI7_js.fixtures.addFirstProduct(h.client);
|
|
103
|
+
await chunkKNCW5DI7_js.fixtures.addFirstProduct(h.client);
|
|
104
104
|
const res = await h.client.cart.get();
|
|
105
105
|
vitest.expect(res.ok).toBe(true);
|
|
106
106
|
if (!res.ok) return;
|
|
@@ -108,7 +108,7 @@ function createCartFlowSuite(opts = {}) {
|
|
|
108
108
|
vitest.expect(res.value.items[0]?.quantity).toBe(2);
|
|
109
109
|
});
|
|
110
110
|
vitest.it("removes items and zeroes the subtotal", async () => {
|
|
111
|
-
await
|
|
111
|
+
await chunkKNCW5DI7_js.fixtures.addFirstProduct(h.client);
|
|
112
112
|
const before = await h.client.cart.get();
|
|
113
113
|
if (!before.ok) throw before.error;
|
|
114
114
|
const itemId = before.value.items[0]?.id;
|
|
@@ -134,28 +134,28 @@ function createContractSuite(opts = {}) {
|
|
|
134
134
|
vitest.describe(opts.label ?? "SDK \u2194 mock contract", () => {
|
|
135
135
|
let h;
|
|
136
136
|
vitest.beforeEach(() => {
|
|
137
|
-
h =
|
|
137
|
+
h = chunkKNCW5DI7_js.createTestClient(opts);
|
|
138
138
|
});
|
|
139
139
|
vitest.afterEach(() => h.dispose());
|
|
140
140
|
vitest.it("AddItemPayload schema accepts a minimal valid body", () => {
|
|
141
|
-
const result =
|
|
141
|
+
const result = chunkKNCW5DI7_js.AddItemPayloadSchema.safeParse({ item_id: "prod_x", quantity: 1 });
|
|
142
142
|
vitest.expect(result.success).toBe(true);
|
|
143
143
|
});
|
|
144
144
|
vitest.it("AddItemPayload schema rejects negative quantity", () => {
|
|
145
|
-
const result =
|
|
145
|
+
const result = chunkKNCW5DI7_js.AddItemPayloadSchema.safeParse({ item_id: "prod_x", quantity: -1 });
|
|
146
146
|
vitest.expect(result.success).toBe(false);
|
|
147
147
|
});
|
|
148
148
|
vitest.it("AddItemPayload schema rejects empty item_id", () => {
|
|
149
|
-
const result =
|
|
149
|
+
const result = chunkKNCW5DI7_js.AddItemPayloadSchema.safeParse({ item_id: "", quantity: 1 });
|
|
150
150
|
vitest.expect(result.success).toBe(false);
|
|
151
151
|
});
|
|
152
152
|
vitest.it("Cart line items returned by the mock match CartItemSchema", async () => {
|
|
153
|
-
const { product } = await
|
|
153
|
+
const { product } = await chunkKNCW5DI7_js.fixtures.addFirstProduct(h.client);
|
|
154
154
|
const get = await h.client.cart.get();
|
|
155
155
|
if (!get.ok) throw get.error;
|
|
156
156
|
vitest.expect(get.value.items.length).toBeGreaterThan(0);
|
|
157
157
|
for (const item of get.value.items) {
|
|
158
|
-
const result =
|
|
158
|
+
const result = chunkKNCW5DI7_js.CartItemSchema.safeParse(item);
|
|
159
159
|
if (!result.success) {
|
|
160
160
|
const issues = result.error.issues.map((i) => ` \u2022 ${i.path.join(".")}: ${i.message}`).join("\n");
|
|
161
161
|
throw new Error(`Cart item shape mismatch for ${product.name}:
|
|
@@ -165,19 +165,19 @@ ${issues}`);
|
|
|
165
165
|
}
|
|
166
166
|
});
|
|
167
167
|
vitest.it("CheckoutResponse from the mock includes bill_token", async () => {
|
|
168
|
-
await
|
|
168
|
+
await chunkKNCW5DI7_js.fixtures.addFirstProduct(h.client);
|
|
169
169
|
const cartRes = await h.client.cart.get();
|
|
170
170
|
if (!cartRes.ok) throw cartRes.error;
|
|
171
171
|
const checkout = await h.client.checkout.process({
|
|
172
172
|
cart_id: cartRes.value.id,
|
|
173
|
-
customer:
|
|
173
|
+
customer: chunkKNCW5DI7_js.fixtures.customer(),
|
|
174
174
|
order_type: "delivery",
|
|
175
175
|
payment_method: "mobile_money",
|
|
176
176
|
mobile_money_details: { phone_number: "+233244000000", provider: "mtn" }
|
|
177
177
|
});
|
|
178
178
|
vitest.expect(checkout.ok).toBe(true);
|
|
179
179
|
if (!checkout.ok) return;
|
|
180
|
-
const result =
|
|
180
|
+
const result = chunkKNCW5DI7_js.CheckoutResponseSchema.safeParse(checkout.value);
|
|
181
181
|
if (!result.success) {
|
|
182
182
|
const issues = result.error.issues.map((i) => ` \u2022 ${i.path.join(".")}: ${i.message}`).join("\n");
|
|
183
183
|
throw new Error(`CheckoutResponse shape mismatch:
|
package/dist/testing/suite.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { assertBrand, SeedNameSchema, BrandSchema, createTestClient, assertCart, fixtures, AddItemPayloadSchema, CartItemSchema, CheckoutResponseSchema } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
import { assertBrand, SeedNameSchema, BrandSchema, createTestClient, assertCart, fixtures, AddItemPayloadSchema, CartItemSchema, CheckoutResponseSchema } from '../chunk-NOGCGI4J.mjs';
|
|
2
|
+
import '../chunk-HFTRLRLM.mjs';
|
|
3
3
|
import '../chunk-U4MW6PYU.mjs';
|
|
4
|
-
import '../chunk-
|
|
5
|
-
import '../chunk-
|
|
4
|
+
import '../chunk-XG4DZT4I.mjs';
|
|
5
|
+
import '../chunk-FFRQNNUQ.mjs';
|
|
6
6
|
import '../chunk-DLW3RWRK.mjs';
|
|
7
7
|
import '../chunk-O3YUHLZL.mjs';
|
|
8
8
|
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-BGeSemVv.mjs';
|
|
4
|
+
import './client-Bx4NRdl8.mjs';
|
|
5
5
|
import './product-CeV8euw4.mjs';
|
|
6
6
|
import './payment-BSzy7sly.mjs';
|
|
7
|
-
import './server
|
|
7
|
+
import './server-BRJ61o2J.mjs';
|
|
8
8
|
import 'hono';
|
|
9
9
|
|
|
10
10
|
/**
|
package/dist/testing.d.ts
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-Cvp8W1r9.js';
|
|
4
|
+
import './client-BWdeCgmo.js';
|
|
5
5
|
import './product-CeV8euw4.js';
|
|
6
6
|
import './payment-jK8ztICx.js';
|
|
7
|
-
import './server-
|
|
7
|
+
import './server-CXrVYtNo.js';
|
|
8
8
|
import 'hono';
|
|
9
9
|
|
|
10
10
|
/**
|