@cimplify/sdk 0.55.0 → 0.56.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/react.js CHANGED
@@ -1773,7 +1773,7 @@ function CimplifySignInButton({
1773
1773
  ...signInOpts
1774
1774
  }) {
1775
1775
  const [busy, setBusy] = React11.useState(false);
1776
- const onClick = React11.useCallback(async () => {
1776
+ const onClick = async () => {
1777
1777
  if (busy || disabled) return;
1778
1778
  setBusy(true);
1779
1779
  await chunkJYPLT56O_js.startSignIn({
@@ -1787,7 +1787,7 @@ function CimplifySignInButton({
1787
1787
  onError?.(e);
1788
1788
  }
1789
1789
  });
1790
- }, [busy, disabled, signInOpts, onSuccess, onError]);
1790
+ };
1791
1791
  return /* @__PURE__ */ jsxRuntime.jsxs(
1792
1792
  "button",
1793
1793
  {
package/dist/react.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { DURATION_UNIT, startSignIn, getVariantDisplayName, INPUT_FIELD_TYPE, PRODUCT_TYPE, RENDER_HINT } from './chunk-XYI4NXWG.mjs';
2
+ import { DURATION_UNIT, getVariantDisplayName, INPUT_FIELD_TYPE, PRODUCT_TYPE, startSignIn, RENDER_HINT } from './chunk-XYI4NXWG.mjs';
3
3
  export { getVariantDisplayName } from './chunk-XYI4NXWG.mjs';
4
4
  import { createCimplifyClient } from './chunk-SQ7U3BWY.mjs';
5
5
  import { ELEMENT_TYPES, EVENT_TYPES } from './chunk-I4IXPQIX.mjs';
@@ -1768,7 +1768,7 @@ function CimplifySignInButton({
1768
1768
  ...signInOpts
1769
1769
  }) {
1770
1770
  const [busy, setBusy] = useState(false);
1771
- const onClick = useCallback(async () => {
1771
+ const onClick = async () => {
1772
1772
  if (busy || disabled) return;
1773
1773
  setBusy(true);
1774
1774
  await startSignIn({
@@ -1782,7 +1782,7 @@ function CimplifySignInButton({
1782
1782
  onError?.(e);
1783
1783
  }
1784
1784
  });
1785
- }, [busy, disabled, signInOpts, onSuccess, onError]);
1785
+ };
1786
1786
  return /* @__PURE__ */ jsxs(
1787
1787
  "button",
1788
1788
  {
package/dist/server.d.mts CHANGED
@@ -19,6 +19,13 @@ interface ServerClientOptions {
19
19
  secretKey?: string;
20
20
  /** Optional location id used by location-scoped queries. */
21
21
  locationId?: string;
22
+ /**
23
+ * Customer OAuth access token. When present, the client attaches
24
+ * `Authorization: Bearer <token>` to every request so lenses scopes
25
+ * responses to the signed-in customer (their orders, their assigned
26
+ * price list, their subscriptions).
27
+ */
28
+ accessToken?: string;
22
29
  }
23
30
  /**
24
31
  * Returns a `CimplifyClient` configured for server-side execution and
@@ -191,6 +198,7 @@ interface OidcConfig {
191
198
  clientId: string;
192
199
  cookieName?: string;
193
200
  cookieDomain?: string;
201
+ accessTokenCookieName?: string;
194
202
  }
195
203
  interface CimplifySession {
196
204
  sub: string;
@@ -218,6 +226,9 @@ declare function exchangeCode(opts: CodeExchangeOptions): Promise<CodeExchangeRe
218
226
  declare function verifyIdToken(cfg: OidcConfig, idToken: string): Promise<JWTVerifyResult>;
219
227
  declare function buildSessionCookie(cfg: OidcConfig, idToken: string, maxAgeSeconds: number): string;
220
228
  declare function buildSignoutCookie(cfg: OidcConfig): string;
229
+ declare function buildAccessTokenCookie(cfg: OidcConfig, accessToken: string, maxAgeSeconds: number): string;
230
+ declare function buildSignoutCookies(cfg: OidcConfig): string[];
231
+ declare function getAccessTokenFromCookieHeader(cfg: OidcConfig, cookieHeader: string | null | undefined): string | null;
221
232
  interface CallbackHandlerOptions extends OidcConfig {
222
233
  redirectUri: string;
223
234
  }
@@ -225,4 +236,4 @@ declare function handleOidcCallback(req: Request, opts: CallbackHandlerOptions):
225
236
  declare function handleSessionRequest(req: Request, cfg: OidcConfig): Promise<Response>;
226
237
  declare function getSessionFromCookieHeader(cfg: OidcConfig, cookieHeader: string | null | undefined): Promise<CimplifySession | null>;
227
238
 
228
- export { CACHE_LIFE_DEFAULT, CACHE_LIFE_PROBE, type CacheLifeDefault, type CacheLifeProbe, type CallbackHandlerOptions, CimplifyClient, type CimplifySession, type CodeExchangeOptions, type CodeExchangeResult, type OidcConfig, type RevalidateProfile, type ServerClientOptions, buildSessionCookie, buildSignoutCookie, exchangeCode, getServerClient, getSessionFromCookieHeader, handleOidcCallback, handleSessionRequest, refreshPage, revalidateAddOn, revalidateAddOns, revalidateBrand, revalidateBusiness, revalidateByTag, revalidateCategories, revalidateCategory, revalidateCollection, revalidateCollections, revalidateLocation, revalidateLocations, revalidatePricing, revalidateProduct, revalidateProducts, revalidateStock, revalidateSubscription, revalidateSubscriptions, tags, updateAddOn, updateAddOns, updateBrand, updateBusiness, updateByTag, updateCategories, updateCategory, updateCollection, updateCollections, updateLocation, updateLocations, updatePricing, updateProduct, updateProducts, updateStock, updateSubscription, updateSubscriptions, verifyIdToken };
239
+ export { CACHE_LIFE_DEFAULT, CACHE_LIFE_PROBE, type CacheLifeDefault, type CacheLifeProbe, type CallbackHandlerOptions, CimplifyClient, type CimplifySession, type CodeExchangeOptions, type CodeExchangeResult, type OidcConfig, type RevalidateProfile, type ServerClientOptions, buildAccessTokenCookie, buildSessionCookie, buildSignoutCookie, buildSignoutCookies, exchangeCode, getAccessTokenFromCookieHeader, getServerClient, getSessionFromCookieHeader, handleOidcCallback, handleSessionRequest, refreshPage, revalidateAddOn, revalidateAddOns, revalidateBrand, revalidateBusiness, revalidateByTag, revalidateCategories, revalidateCategory, revalidateCollection, revalidateCollections, revalidateLocation, revalidateLocations, revalidatePricing, revalidateProduct, revalidateProducts, revalidateStock, revalidateSubscription, revalidateSubscriptions, tags, updateAddOn, updateAddOns, updateBrand, updateBusiness, updateByTag, updateCategories, updateCategory, updateCollection, updateCollections, updateLocation, updateLocations, updatePricing, updateProduct, updateProducts, updateStock, updateSubscription, updateSubscriptions, verifyIdToken };
package/dist/server.d.ts CHANGED
@@ -19,6 +19,13 @@ interface ServerClientOptions {
19
19
  secretKey?: string;
20
20
  /** Optional location id used by location-scoped queries. */
21
21
  locationId?: string;
22
+ /**
23
+ * Customer OAuth access token. When present, the client attaches
24
+ * `Authorization: Bearer <token>` to every request so lenses scopes
25
+ * responses to the signed-in customer (their orders, their assigned
26
+ * price list, their subscriptions).
27
+ */
28
+ accessToken?: string;
22
29
  }
23
30
  /**
24
31
  * Returns a `CimplifyClient` configured for server-side execution and
@@ -191,6 +198,7 @@ interface OidcConfig {
191
198
  clientId: string;
192
199
  cookieName?: string;
193
200
  cookieDomain?: string;
201
+ accessTokenCookieName?: string;
194
202
  }
195
203
  interface CimplifySession {
196
204
  sub: string;
@@ -218,6 +226,9 @@ declare function exchangeCode(opts: CodeExchangeOptions): Promise<CodeExchangeRe
218
226
  declare function verifyIdToken(cfg: OidcConfig, idToken: string): Promise<JWTVerifyResult>;
219
227
  declare function buildSessionCookie(cfg: OidcConfig, idToken: string, maxAgeSeconds: number): string;
220
228
  declare function buildSignoutCookie(cfg: OidcConfig): string;
229
+ declare function buildAccessTokenCookie(cfg: OidcConfig, accessToken: string, maxAgeSeconds: number): string;
230
+ declare function buildSignoutCookies(cfg: OidcConfig): string[];
231
+ declare function getAccessTokenFromCookieHeader(cfg: OidcConfig, cookieHeader: string | null | undefined): string | null;
221
232
  interface CallbackHandlerOptions extends OidcConfig {
222
233
  redirectUri: string;
223
234
  }
@@ -225,4 +236,4 @@ declare function handleOidcCallback(req: Request, opts: CallbackHandlerOptions):
225
236
  declare function handleSessionRequest(req: Request, cfg: OidcConfig): Promise<Response>;
226
237
  declare function getSessionFromCookieHeader(cfg: OidcConfig, cookieHeader: string | null | undefined): Promise<CimplifySession | null>;
227
238
 
228
- export { CACHE_LIFE_DEFAULT, CACHE_LIFE_PROBE, type CacheLifeDefault, type CacheLifeProbe, type CallbackHandlerOptions, CimplifyClient, type CimplifySession, type CodeExchangeOptions, type CodeExchangeResult, type OidcConfig, type RevalidateProfile, type ServerClientOptions, buildSessionCookie, buildSignoutCookie, exchangeCode, getServerClient, getSessionFromCookieHeader, handleOidcCallback, handleSessionRequest, refreshPage, revalidateAddOn, revalidateAddOns, revalidateBrand, revalidateBusiness, revalidateByTag, revalidateCategories, revalidateCategory, revalidateCollection, revalidateCollections, revalidateLocation, revalidateLocations, revalidatePricing, revalidateProduct, revalidateProducts, revalidateStock, revalidateSubscription, revalidateSubscriptions, tags, updateAddOn, updateAddOns, updateBrand, updateBusiness, updateByTag, updateCategories, updateCategory, updateCollection, updateCollections, updateLocation, updateLocations, updatePricing, updateProduct, updateProducts, updateStock, updateSubscription, updateSubscriptions, verifyIdToken };
239
+ export { CACHE_LIFE_DEFAULT, CACHE_LIFE_PROBE, type CacheLifeDefault, type CacheLifeProbe, type CallbackHandlerOptions, CimplifyClient, type CimplifySession, type CodeExchangeOptions, type CodeExchangeResult, type OidcConfig, type RevalidateProfile, type ServerClientOptions, buildAccessTokenCookie, buildSessionCookie, buildSignoutCookie, buildSignoutCookies, exchangeCode, getAccessTokenFromCookieHeader, getServerClient, getSessionFromCookieHeader, handleOidcCallback, handleSessionRequest, refreshPage, revalidateAddOn, revalidateAddOns, revalidateBrand, revalidateBusiness, revalidateByTag, revalidateCategories, revalidateCategory, revalidateCollection, revalidateCollections, revalidateLocation, revalidateLocations, revalidatePricing, revalidateProduct, revalidateProducts, revalidateStock, revalidateSubscription, revalidateSubscriptions, tags, updateAddOn, updateAddOns, updateBrand, updateBusiness, updateByTag, updateCategories, updateCategory, updateCollection, updateCollections, updateLocation, updateLocations, updatePricing, updateProduct, updateProducts, updateStock, updateSubscription, updateSubscriptions, verifyIdToken };
package/dist/server.js CHANGED
@@ -34,6 +34,9 @@ var getServerClient = react.cache((opts = {}) => {
34
34
  if (opts.locationId) {
35
35
  client.setLocationId(opts.locationId);
36
36
  }
37
+ if (opts.accessToken) {
38
+ client.setAccessToken(opts.accessToken);
39
+ }
37
40
  return client;
38
41
  });
39
42
 
@@ -236,6 +239,7 @@ async function refreshPage() {
236
239
  }
237
240
  var DEFAULT_AUTH_URL = "https://auth.cimplify.io";
238
241
  var SESSION_COOKIE = "cimplify_session";
242
+ var ACCESS_TOKEN_COOKIE = "cimplify_access";
239
243
  var discoveryCache = /* @__PURE__ */ new Map();
240
244
  var jwksCache = /* @__PURE__ */ new Map();
241
245
  function authUrl(cfg) {
@@ -244,6 +248,9 @@ function authUrl(cfg) {
244
248
  function cookieName(cfg) {
245
249
  return cfg.cookieName ?? SESSION_COOKIE;
246
250
  }
251
+ function accessTokenCookieName(cfg) {
252
+ return cfg.accessTokenCookieName ?? ACCESS_TOKEN_COOKIE;
253
+ }
247
254
  async function discovery(cfg) {
248
255
  const base = authUrl(cfg);
249
256
  let p = discoveryCache.get(base);
@@ -332,6 +339,49 @@ function buildSignoutCookie(cfg) {
332
339
  if (cfg.cookieDomain) parts.push(`Domain=${cfg.cookieDomain}`);
333
340
  return parts.join("; ");
334
341
  }
342
+ function buildAccessTokenCookie(cfg, accessToken, maxAgeSeconds) {
343
+ const parts = [
344
+ `${accessTokenCookieName(cfg)}=${accessToken}`,
345
+ "Path=/",
346
+ "HttpOnly",
347
+ "Secure",
348
+ "SameSite=Lax",
349
+ `Max-Age=${maxAgeSeconds}`
350
+ ];
351
+ if (cfg.cookieDomain) parts.push(`Domain=${cfg.cookieDomain}`);
352
+ return parts.join("; ");
353
+ }
354
+ function buildSignoutCookies(cfg) {
355
+ const idTokenParts = [
356
+ `${cookieName(cfg)}=`,
357
+ "Path=/",
358
+ "HttpOnly",
359
+ "Secure",
360
+ "SameSite=Lax",
361
+ "Max-Age=0"
362
+ ];
363
+ const accessParts = [
364
+ `${accessTokenCookieName(cfg)}=`,
365
+ "Path=/",
366
+ "HttpOnly",
367
+ "Secure",
368
+ "SameSite=Lax",
369
+ "Max-Age=0"
370
+ ];
371
+ if (cfg.cookieDomain) {
372
+ idTokenParts.push(`Domain=${cfg.cookieDomain}`);
373
+ accessParts.push(`Domain=${cfg.cookieDomain}`);
374
+ }
375
+ return [idTokenParts.join("; "), accessParts.join("; ")];
376
+ }
377
+ function getAccessTokenFromCookieHeader(cfg, cookieHeader) {
378
+ if (!cookieHeader) return null;
379
+ const name = accessTokenCookieName(cfg);
380
+ const match = cookieHeader.split(/;\s*/).find((p) => p.startsWith(`${name}=`));
381
+ if (!match) return null;
382
+ const token = match.slice(name.length + 1);
383
+ return token || null;
384
+ }
335
385
  async function handleOidcCallback(req, opts) {
336
386
  let body;
337
387
  try {
@@ -360,11 +410,10 @@ async function handleOidcCallback(req, opts) {
360
410
  } catch (e) {
361
411
  return Response.json({ error: "id_token_invalid", detail: String(e) }, { status: 401 });
362
412
  }
363
- const cookie = buildSessionCookie(opts, tokens.idToken, tokens.expiresIn);
364
- return new Response(JSON.stringify({ ok: true }), {
365
- status: 200,
366
- headers: { "Content-Type": "application/json", "Set-Cookie": cookie }
367
- });
413
+ const headers = new Headers({ "Content-Type": "application/json" });
414
+ headers.append("Set-Cookie", buildSessionCookie(opts, tokens.idToken, tokens.expiresIn));
415
+ headers.append("Set-Cookie", buildAccessTokenCookie(opts, tokens.accessToken, tokens.expiresIn));
416
+ return new Response(JSON.stringify({ ok: true }), { status: 200, headers });
368
417
  }
369
418
  async function handleSessionRequest(req, cfg) {
370
419
  const session = await getSessionFromCookieHeader(cfg, req.headers.get("cookie"));
@@ -400,9 +449,12 @@ Object.defineProperty(exports, "CimplifyError", {
400
449
  });
401
450
  exports.CACHE_LIFE_DEFAULT = CACHE_LIFE_DEFAULT;
402
451
  exports.CACHE_LIFE_PROBE = CACHE_LIFE_PROBE;
452
+ exports.buildAccessTokenCookie = buildAccessTokenCookie;
403
453
  exports.buildSessionCookie = buildSessionCookie;
404
454
  exports.buildSignoutCookie = buildSignoutCookie;
455
+ exports.buildSignoutCookies = buildSignoutCookies;
405
456
  exports.exchangeCode = exchangeCode;
457
+ exports.getAccessTokenFromCookieHeader = getAccessTokenFromCookieHeader;
406
458
  exports.getServerClient = getServerClient;
407
459
  exports.getSessionFromCookieHeader = getSessionFromCookieHeader;
408
460
  exports.handleOidcCallback = handleOidcCallback;
package/dist/server.mjs CHANGED
@@ -32,6 +32,9 @@ var getServerClient = cache((opts = {}) => {
32
32
  if (opts.locationId) {
33
33
  client.setLocationId(opts.locationId);
34
34
  }
35
+ if (opts.accessToken) {
36
+ client.setAccessToken(opts.accessToken);
37
+ }
35
38
  return client;
36
39
  });
37
40
 
@@ -234,6 +237,7 @@ async function refreshPage() {
234
237
  }
235
238
  var DEFAULT_AUTH_URL = "https://auth.cimplify.io";
236
239
  var SESSION_COOKIE = "cimplify_session";
240
+ var ACCESS_TOKEN_COOKIE = "cimplify_access";
237
241
  var discoveryCache = /* @__PURE__ */ new Map();
238
242
  var jwksCache = /* @__PURE__ */ new Map();
239
243
  function authUrl(cfg) {
@@ -242,6 +246,9 @@ function authUrl(cfg) {
242
246
  function cookieName(cfg) {
243
247
  return cfg.cookieName ?? SESSION_COOKIE;
244
248
  }
249
+ function accessTokenCookieName(cfg) {
250
+ return cfg.accessTokenCookieName ?? ACCESS_TOKEN_COOKIE;
251
+ }
245
252
  async function discovery(cfg) {
246
253
  const base = authUrl(cfg);
247
254
  let p = discoveryCache.get(base);
@@ -330,6 +337,49 @@ function buildSignoutCookie(cfg) {
330
337
  if (cfg.cookieDomain) parts.push(`Domain=${cfg.cookieDomain}`);
331
338
  return parts.join("; ");
332
339
  }
340
+ function buildAccessTokenCookie(cfg, accessToken, maxAgeSeconds) {
341
+ const parts = [
342
+ `${accessTokenCookieName(cfg)}=${accessToken}`,
343
+ "Path=/",
344
+ "HttpOnly",
345
+ "Secure",
346
+ "SameSite=Lax",
347
+ `Max-Age=${maxAgeSeconds}`
348
+ ];
349
+ if (cfg.cookieDomain) parts.push(`Domain=${cfg.cookieDomain}`);
350
+ return parts.join("; ");
351
+ }
352
+ function buildSignoutCookies(cfg) {
353
+ const idTokenParts = [
354
+ `${cookieName(cfg)}=`,
355
+ "Path=/",
356
+ "HttpOnly",
357
+ "Secure",
358
+ "SameSite=Lax",
359
+ "Max-Age=0"
360
+ ];
361
+ const accessParts = [
362
+ `${accessTokenCookieName(cfg)}=`,
363
+ "Path=/",
364
+ "HttpOnly",
365
+ "Secure",
366
+ "SameSite=Lax",
367
+ "Max-Age=0"
368
+ ];
369
+ if (cfg.cookieDomain) {
370
+ idTokenParts.push(`Domain=${cfg.cookieDomain}`);
371
+ accessParts.push(`Domain=${cfg.cookieDomain}`);
372
+ }
373
+ return [idTokenParts.join("; "), accessParts.join("; ")];
374
+ }
375
+ function getAccessTokenFromCookieHeader(cfg, cookieHeader) {
376
+ if (!cookieHeader) return null;
377
+ const name = accessTokenCookieName(cfg);
378
+ const match = cookieHeader.split(/;\s*/).find((p) => p.startsWith(`${name}=`));
379
+ if (!match) return null;
380
+ const token = match.slice(name.length + 1);
381
+ return token || null;
382
+ }
333
383
  async function handleOidcCallback(req, opts) {
334
384
  let body;
335
385
  try {
@@ -358,11 +408,10 @@ async function handleOidcCallback(req, opts) {
358
408
  } catch (e) {
359
409
  return Response.json({ error: "id_token_invalid", detail: String(e) }, { status: 401 });
360
410
  }
361
- const cookie = buildSessionCookie(opts, tokens.idToken, tokens.expiresIn);
362
- return new Response(JSON.stringify({ ok: true }), {
363
- status: 200,
364
- headers: { "Content-Type": "application/json", "Set-Cookie": cookie }
365
- });
411
+ const headers = new Headers({ "Content-Type": "application/json" });
412
+ headers.append("Set-Cookie", buildSessionCookie(opts, tokens.idToken, tokens.expiresIn));
413
+ headers.append("Set-Cookie", buildAccessTokenCookie(opts, tokens.accessToken, tokens.expiresIn));
414
+ return new Response(JSON.stringify({ ok: true }), { status: 200, headers });
366
415
  }
367
416
  async function handleSessionRequest(req, cfg) {
368
417
  const session = await getSessionFromCookieHeader(cfg, req.headers.get("cookie"));
@@ -392,4 +441,4 @@ async function getSessionFromCookieHeader(cfg, cookieHeader) {
392
441
  }
393
442
  }
394
443
 
395
- export { CACHE_LIFE_DEFAULT, CACHE_LIFE_PROBE, buildSessionCookie, buildSignoutCookie, exchangeCode, getServerClient, getSessionFromCookieHeader, handleOidcCallback, handleSessionRequest, refreshPage, revalidateAddOn, revalidateAddOns, revalidateBrand, revalidateBusiness, revalidateByTag, revalidateCategories, revalidateCategory, revalidateCollection, revalidateCollections, revalidateLocation, revalidateLocations, revalidatePricing, revalidateProduct, revalidateProducts, revalidateStock, revalidateSubscription, revalidateSubscriptions, tags, updateAddOn, updateAddOns, updateBrand, updateBusiness, updateByTag, updateCategories, updateCategory, updateCollection, updateCollections, updateLocation, updateLocations, updatePricing, updateProduct, updateProducts, updateStock, updateSubscription, updateSubscriptions, verifyIdToken };
444
+ export { CACHE_LIFE_DEFAULT, CACHE_LIFE_PROBE, buildAccessTokenCookie, buildSessionCookie, buildSignoutCookie, buildSignoutCookies, exchangeCode, getAccessTokenFromCookieHeader, getServerClient, getSessionFromCookieHeader, handleOidcCallback, handleSessionRequest, refreshPage, revalidateAddOn, revalidateAddOns, revalidateBrand, revalidateBusiness, revalidateByTag, revalidateCategories, revalidateCategory, revalidateCollection, revalidateCollections, revalidateLocation, revalidateLocations, revalidatePricing, revalidateProduct, revalidateProducts, revalidateStock, revalidateSubscription, revalidateSubscriptions, tags, updateAddOn, updateAddOns, updateBrand, updateBusiness, updateByTag, updateCategories, updateCategory, updateCollection, updateCollections, updateLocation, updateLocations, updatePricing, updateProduct, updateProducts, updateStock, updateSubscription, updateSubscriptions, verifyIdToken };
@@ -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">;
package/dist/testing.d.ts CHANGED
@@ -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">;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cimplify/sdk",
3
- "version": "0.55.0",
3
+ "version": "0.56.0",
4
4
  "description": "Cimplify Commerce SDK for storefronts",
5
5
  "keywords": [
6
6
  "cimplify",