@cimplify/sdk 0.100.6 → 0.101.1

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.
Files changed (68) hide show
  1. package/dist/advanced.d.mts +3 -3
  2. package/dist/advanced.d.ts +3 -3
  3. package/dist/advanced.js +20 -20
  4. package/dist/advanced.mjs +1 -1
  5. package/dist/{chunk-KLJLKT6C.mjs → chunk-7H6IL7CX.mjs} +2 -2
  6. package/dist/{chunk-BMFWQNYZ.mjs → chunk-DKLHCZ5M.mjs} +4 -1
  7. package/dist/{chunk-PNTINRAU.js → chunk-H5SSGN7W.js} +28 -0
  8. package/dist/{chunk-BSZJSR62.js → chunk-ICCCSVN3.js} +4 -4
  9. package/dist/{chunk-D3FWJB7Y.js → chunk-YDA46OZ6.js} +50 -47
  10. package/dist/{chunk-3HU5I5VG.js → chunk-YER7DIOM.js} +15 -0
  11. package/dist/{chunk-RQPXLXB2.mjs → chunk-YHPMFTMN.mjs} +28 -0
  12. package/dist/{chunk-Z7M6GAHS.mjs → chunk-Z3K2D3TE.mjs} +15 -0
  13. package/dist/{client-CrPglBBz.d.ts → client-CdTx7X_X.d.mts} +12 -2
  14. package/dist/{client-CPcZIrjC.d.ts → client-D40kI8z2.d.ts} +2 -2
  15. package/dist/{client-BwRAAk4y.d.mts → client-Db554902.d.ts} +12 -2
  16. package/dist/{client-DGrvLiJv.d.mts → client-WkUcvRvO.d.mts} +2 -2
  17. package/dist/{index-D-LUYk1Y.d.mts → index-BjWUkYgY.d.mts} +3 -3
  18. package/dist/{index-B_RYmvlF.d.ts → index-D3UXgAYl.d.ts} +3 -3
  19. package/dist/index.d.mts +7 -7
  20. package/dist/index.d.ts +7 -7
  21. package/dist/index.js +69 -69
  22. package/dist/index.mjs +3 -3
  23. package/dist/mock/cli.mjs +28 -0
  24. package/dist/mock/library.js +28 -0
  25. package/dist/mock/library.mjs +28 -0
  26. package/dist/mock/msw.js +28 -0
  27. package/dist/mock/msw.mjs +28 -0
  28. package/dist/{payment-BSzy7sly.d.mts → payment-CRqjGrx6.d.mts} +1 -1
  29. package/dist/{payment-jK8ztICx.d.ts → payment-DO1Z1Ip6.d.ts} +1 -1
  30. package/dist/{price-D96h6c6L.d.mts → price-CiQUd_XX.d.mts} +1 -1
  31. package/dist/{price-CJLfcYKd.d.ts → price-D9EOj8y8.d.ts} +1 -1
  32. package/dist/{product-CeV8euw4.d.mts → product-DwKdC_to.d.mts} +727 -625
  33. package/dist/{product-CeV8euw4.d.ts → product-DwKdC_to.d.ts} +727 -625
  34. package/dist/react.d.mts +7 -4
  35. package/dist/react.d.ts +7 -4
  36. package/dist/react.js +75 -34
  37. package/dist/react.mjs +52 -11
  38. package/dist/server/evict.d.mts +12 -8
  39. package/dist/server/evict.d.ts +12 -8
  40. package/dist/server/evict.js +53 -7
  41. package/dist/server/evict.mjs +53 -7
  42. package/dist/server/tanstack.d.mts +4 -2
  43. package/dist/server/tanstack.d.ts +4 -2
  44. package/dist/server/tanstack.js +53 -14
  45. package/dist/server/tanstack.mjs +53 -14
  46. package/dist/{server-zyrpzJVn.d.ts → server-CeDb93WA.d.ts} +13 -1
  47. package/dist/{server-DRAW2OOX.d.mts → server-D-nSkrUr.d.mts} +13 -1
  48. package/dist/server.d.mts +4 -4
  49. package/dist/server.d.ts +4 -4
  50. package/dist/server.js +7 -7
  51. package/dist/server.mjs +2 -2
  52. package/dist/testing/msw.d.mts +2 -2
  53. package/dist/testing/msw.d.ts +2 -2
  54. package/dist/testing/msw.js +2 -2
  55. package/dist/testing/msw.mjs +1 -1
  56. package/dist/testing/suite.d.mts +6 -6
  57. package/dist/testing/suite.d.ts +6 -6
  58. package/dist/testing/suite.js +23 -23
  59. package/dist/testing/suite.mjs +4 -4
  60. package/dist/testing.d.mts +5 -5
  61. package/dist/testing.d.ts +5 -5
  62. package/dist/testing.js +79 -79
  63. package/dist/testing.mjs +5 -5
  64. package/dist/utils.d.mts +4 -4
  65. package/dist/utils.d.ts +4 -4
  66. package/package.json +1 -1
  67. package/registry/cart-summary.json +1 -1
  68. package/registry/chat-widget.json +1 -1
@@ -22,6 +22,18 @@ function pathIndexFor(env) {
22
22
  if (!ns || !prefix) return null;
23
23
  return ns.get(ns.idFromName(prefix));
24
24
  }
25
+ function isAcceptedReservation(value) {
26
+ if (typeof value !== "object" || value === null) return false;
27
+ const reservation = value;
28
+ return reservation.accepted === true && typeof reservation.generation === "number" && Number.isSafeInteger(reservation.generation) && reservation.generation >= 0;
29
+ }
30
+ async function removeRejectedWrite(r2, key) {
31
+ try {
32
+ await r2.delete(key);
33
+ } catch {
34
+ reportRejectedTaggedWrite("r2-compensating-delete-failed");
35
+ }
36
+ }
25
37
  var evictIncrementalCache = {
26
38
  name: "cimplify-evict-r2-cache",
27
39
  async get(key, cacheType) {
@@ -44,18 +56,43 @@ var evictIncrementalCache = {
44
56
  const r2 = env[R2_BUCKET_BINDING];
45
57
  if (!r2) return;
46
58
  const k = r2Key(env, key, cacheType);
59
+ const tags = cimplifyTags(value);
60
+ let index = null;
61
+ let reservation = null;
62
+ if (tags.length > 0) {
63
+ index = pathIndexFor(env);
64
+ if (!index) {
65
+ reportRejectedTaggedWrite("path-index-not-configured");
66
+ return;
67
+ }
68
+ try {
69
+ const candidate = await index.indexAdd(key, k, tags, cacheType === "fetch");
70
+ if (!isAcceptedReservation(candidate)) {
71
+ const fenceActive = typeof candidate === "object" && candidate !== null && candidate.accepted === false;
72
+ reportRejectedTaggedWrite(
73
+ fenceActive ? "path-index-eviction-fence-active" : "path-index-invalid-reservation"
74
+ );
75
+ return;
76
+ }
77
+ reservation = candidate;
78
+ } catch {
79
+ reportRejectedTaggedWrite("path-index-write-failed");
80
+ return;
81
+ }
82
+ }
47
83
  try {
48
84
  await r2.put(k, JSON.stringify(value));
49
85
  } catch {
50
86
  return;
51
87
  }
52
- const tags = cimplifyTags(value);
53
- if (tags.length === 0) return;
54
- const index = pathIndexFor(env);
55
- if (!index) return;
56
- try {
57
- await index.indexAdd(key, k, tags, cacheType === "fetch");
58
- } catch {
88
+ if (index && reservation) {
89
+ try {
90
+ if (await index.indexConfirm(reservation.generation, tags)) return;
91
+ reportRejectedTaggedWrite("path-index-reservation-invalidated");
92
+ } catch {
93
+ reportRejectedTaggedWrite("path-index-confirm-failed");
94
+ }
95
+ await removeRejectedWrite(r2, k);
59
96
  }
60
97
  },
61
98
  async delete(key) {
@@ -68,6 +105,15 @@ var evictIncrementalCache = {
68
105
  }
69
106
  }
70
107
  };
108
+ function reportRejectedTaggedWrite(reason) {
109
+ console.error(
110
+ JSON.stringify({
111
+ level: "error",
112
+ event: "storefront_cache_write_rejected",
113
+ reason
114
+ })
115
+ );
116
+ }
71
117
  var evict_incremental_cache_default = evictIncrementalCache;
72
118
 
73
119
  export { evict_incremental_cache_default as evictIncrementalCache };
@@ -9,8 +9,10 @@ import { R2Bucket, DurableObjectNamespace } from '@cloudflare/workers-types';
9
9
  * - CIMPLIFY_PATH_INDEX
10
10
  *
11
11
  * This driver consumes those bindings and mirrors the Next/OpenNext eviction
12
- * contract: write to R2, then register cimplify:* tags in PathIndex so the
13
- * central eviction worker can delete the exact R2 object and purge route URLs.
12
+ * contract: reserve cimplify:* tags in PathIndex, write to R2, then confirm
13
+ * that no eviction crossed the write. Tagged values fail closed when indexing
14
+ * is unavailable or their reservation is invalidated, so the central eviction
15
+ * worker can always delete exact R2 objects before purging edge HTML.
14
16
  */
15
17
 
16
18
  declare const TANSTACK_R2_BUCKET_BINDING = "CIMPLIFY_CACHE_R2_BUCKET";
@@ -9,8 +9,10 @@ import { R2Bucket, DurableObjectNamespace } from '@cloudflare/workers-types';
9
9
  * - CIMPLIFY_PATH_INDEX
10
10
  *
11
11
  * This driver consumes those bindings and mirrors the Next/OpenNext eviction
12
- * contract: write to R2, then register cimplify:* tags in PathIndex so the
13
- * central eviction worker can delete the exact R2 object and purge route URLs.
12
+ * contract: reserve cimplify:* tags in PathIndex, write to R2, then confirm
13
+ * that no eviction crossed the write. Tagged values fail closed when indexing
14
+ * is unavailable or their reservation is invalidated, so the central eviction
15
+ * worker can always delete exact R2 objects before purging edge HTML.
14
16
  */
15
17
 
16
18
  declare const TANSTACK_R2_BUCKET_BINDING = "CIMPLIFY_CACHE_R2_BUCKET";
@@ -120,13 +120,27 @@ async function resolveRuntimeEnv(options) {
120
120
  pathIndex: env?.[TANSTACK_PATH_INDEX_BINDING]
121
121
  };
122
122
  }
123
- async function registerIndex(env, cacheKey, r2Key, tags, isFetch) {
124
- if (tags.length === 0) return;
123
+ function isAcceptedReservation(value) {
124
+ if (!isRecord(value)) return false;
125
+ return value.accepted === true && typeof value.generation === "number" && Number.isSafeInteger(value.generation) && value.generation >= 0;
126
+ }
127
+ async function reserveIndex(env, cacheKey, r2Key, tags, isFetch) {
128
+ if (tags.length === 0) return null;
125
129
  const index = pathIndexFor(env);
126
- if (!index) return;
130
+ if (!index) return null;
131
+ try {
132
+ const reservation = await index.indexAdd(cacheKey, r2Key, tags, isFetch);
133
+ if (!isAcceptedReservation(reservation)) return null;
134
+ return { index, generation: reservation.generation };
135
+ } catch {
136
+ return null;
137
+ }
138
+ }
139
+ async function removeRejectedWrite(r2, r2Key) {
127
140
  try {
128
- await index.indexAdd(cacheKey, r2Key, tags, isFetch);
141
+ await r2.delete(r2Key);
129
142
  } catch {
143
+ reportRejectedTaggedWrite("r2-compensating-delete-failed");
130
144
  }
131
145
  }
132
146
  async function listR2Keys(r2, prefix) {
@@ -142,23 +156,48 @@ async function listR2Keys(r2, prefix) {
142
156
  async function putAndIndex(runtimeEnv, driverOptions, key, storedValue, indexValue, options) {
143
157
  const namespace = driverOptions.namespace ?? TANSTACK_CACHE_NAMESPACE;
144
158
  const r2Key = cimplifyTanstackR2Key(runtimeEnv.prefix, key, namespace);
159
+ let tags;
160
+ let cacheKey;
161
+ let isFetch;
145
162
  try {
146
- await runtimeEnv.r2.put(r2Key, storedValue);
163
+ tags = extractTags(key, indexValue, options, driverOptions);
164
+ cacheKey = extractCacheKey(key, indexValue, options, driverOptions);
165
+ isFetch = extractIsFetch(key, indexValue, options, driverOptions);
147
166
  } catch {
167
+ reportRejectedTaggedWrite("invalid-index-metadata");
148
168
  return;
149
169
  }
170
+ let reservation = null;
171
+ if (tags.length > 0) {
172
+ reservation = await reserveIndex(runtimeEnv, cacheKey, r2Key, tags, isFetch);
173
+ if (!reservation) {
174
+ reportRejectedTaggedWrite("path-index-write-rejected");
175
+ return;
176
+ }
177
+ }
150
178
  try {
151
- const tags = extractTags(key, indexValue, options, driverOptions);
152
- if (tags.length === 0) return;
153
- await registerIndex(
154
- runtimeEnv,
155
- extractCacheKey(key, indexValue, options, driverOptions),
156
- r2Key,
157
- tags,
158
- extractIsFetch(key, indexValue, options, driverOptions)
159
- );
179
+ await runtimeEnv.r2.put(r2Key, storedValue);
160
180
  } catch {
181
+ return;
161
182
  }
183
+ if (reservation) {
184
+ try {
185
+ if (await reservation.index.indexConfirm(reservation.generation, tags)) return;
186
+ reportRejectedTaggedWrite("path-index-reservation-invalidated");
187
+ } catch {
188
+ reportRejectedTaggedWrite("path-index-confirm-failed");
189
+ }
190
+ await removeRejectedWrite(runtimeEnv.r2, r2Key);
191
+ }
192
+ }
193
+ function reportRejectedTaggedWrite(reason) {
194
+ console.error(
195
+ JSON.stringify({
196
+ level: "error",
197
+ event: "storefront_cache_write_rejected",
198
+ reason
199
+ })
200
+ );
162
201
  }
163
202
  async function getRawItem(driverOptions, key) {
164
203
  const runtimeEnv = await resolveRuntimeEnv(driverOptions);
@@ -118,13 +118,27 @@ async function resolveRuntimeEnv(options) {
118
118
  pathIndex: env?.[TANSTACK_PATH_INDEX_BINDING]
119
119
  };
120
120
  }
121
- async function registerIndex(env, cacheKey, r2Key, tags, isFetch) {
122
- if (tags.length === 0) return;
121
+ function isAcceptedReservation(value) {
122
+ if (!isRecord(value)) return false;
123
+ return value.accepted === true && typeof value.generation === "number" && Number.isSafeInteger(value.generation) && value.generation >= 0;
124
+ }
125
+ async function reserveIndex(env, cacheKey, r2Key, tags, isFetch) {
126
+ if (tags.length === 0) return null;
123
127
  const index = pathIndexFor(env);
124
- if (!index) return;
128
+ if (!index) return null;
129
+ try {
130
+ const reservation = await index.indexAdd(cacheKey, r2Key, tags, isFetch);
131
+ if (!isAcceptedReservation(reservation)) return null;
132
+ return { index, generation: reservation.generation };
133
+ } catch {
134
+ return null;
135
+ }
136
+ }
137
+ async function removeRejectedWrite(r2, r2Key) {
125
138
  try {
126
- await index.indexAdd(cacheKey, r2Key, tags, isFetch);
139
+ await r2.delete(r2Key);
127
140
  } catch {
141
+ reportRejectedTaggedWrite("r2-compensating-delete-failed");
128
142
  }
129
143
  }
130
144
  async function listR2Keys(r2, prefix) {
@@ -140,23 +154,48 @@ async function listR2Keys(r2, prefix) {
140
154
  async function putAndIndex(runtimeEnv, driverOptions, key, storedValue, indexValue, options) {
141
155
  const namespace = driverOptions.namespace ?? TANSTACK_CACHE_NAMESPACE;
142
156
  const r2Key = cimplifyTanstackR2Key(runtimeEnv.prefix, key, namespace);
157
+ let tags;
158
+ let cacheKey;
159
+ let isFetch;
143
160
  try {
144
- await runtimeEnv.r2.put(r2Key, storedValue);
161
+ tags = extractTags(key, indexValue, options, driverOptions);
162
+ cacheKey = extractCacheKey(key, indexValue, options, driverOptions);
163
+ isFetch = extractIsFetch(key, indexValue, options, driverOptions);
145
164
  } catch {
165
+ reportRejectedTaggedWrite("invalid-index-metadata");
146
166
  return;
147
167
  }
168
+ let reservation = null;
169
+ if (tags.length > 0) {
170
+ reservation = await reserveIndex(runtimeEnv, cacheKey, r2Key, tags, isFetch);
171
+ if (!reservation) {
172
+ reportRejectedTaggedWrite("path-index-write-rejected");
173
+ return;
174
+ }
175
+ }
148
176
  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
- );
177
+ await runtimeEnv.r2.put(r2Key, storedValue);
158
178
  } catch {
179
+ return;
159
180
  }
181
+ if (reservation) {
182
+ try {
183
+ if (await reservation.index.indexConfirm(reservation.generation, tags)) return;
184
+ reportRejectedTaggedWrite("path-index-reservation-invalidated");
185
+ } catch {
186
+ reportRejectedTaggedWrite("path-index-confirm-failed");
187
+ }
188
+ await removeRejectedWrite(runtimeEnv.r2, r2Key);
189
+ }
190
+ }
191
+ function reportRejectedTaggedWrite(reason) {
192
+ console.error(
193
+ JSON.stringify({
194
+ level: "error",
195
+ event: "storefront_cache_write_rejected",
196
+ reason
197
+ })
198
+ );
160
199
  }
161
200
  async function getRawItem(driverOptions, key) {
162
201
  const runtimeEnv = await resolveRuntimeEnv(driverOptions);
@@ -1,5 +1,5 @@
1
1
  import { Hono } from 'hono';
2
- import { b3 as ProductInputField } from './product-CeV8euw4.js';
2
+ import { b6 as ProductInputField } from './product-DwKdC_to.js';
3
3
 
4
4
  interface Clock {
5
5
  now(): Date;
@@ -702,11 +702,23 @@ interface ComponentSelectionInput {
702
702
  quantity?: number;
703
703
  }
704
704
 
705
+ interface DestinationQuoteBody {
706
+ order_type: string;
707
+ address_info: {
708
+ street_address?: string;
709
+ city?: string;
710
+ region?: string;
711
+ latitude?: number;
712
+ longitude?: number;
713
+ };
714
+ delivery_rate_id?: string | null;
715
+ }
705
716
  interface CartService {
706
717
  get(session: Session): MockCart;
707
718
  getItems(session: Session): MockCartItem[];
708
719
  getCount(session: Session): number;
709
720
  getTotal(session: Session): string;
721
+ quoteDestination(session: Session, body: DestinationQuoteBody): unknown;
710
722
  addItem(session: Session, body: AddItemInput): unknown;
711
723
  updateQuantity(session: Session, cartItemId: string, quantity: number): unknown;
712
724
  removeItem(session: Session, cartItemId: string): unknown;
@@ -1,5 +1,5 @@
1
1
  import { Hono } from 'hono';
2
- import { b3 as ProductInputField } from './product-CeV8euw4.mjs';
2
+ import { b6 as ProductInputField } from './product-DwKdC_to.mjs';
3
3
 
4
4
  interface Clock {
5
5
  now(): Date;
@@ -702,11 +702,23 @@ interface ComponentSelectionInput {
702
702
  quantity?: number;
703
703
  }
704
704
 
705
+ interface DestinationQuoteBody {
706
+ order_type: string;
707
+ address_info: {
708
+ street_address?: string;
709
+ city?: string;
710
+ region?: string;
711
+ latitude?: number;
712
+ longitude?: number;
713
+ };
714
+ delivery_rate_id?: string | null;
715
+ }
705
716
  interface CartService {
706
717
  get(session: Session): MockCart;
707
718
  getItems(session: Session): MockCartItem[];
708
719
  getCount(session: Session): number;
709
720
  getTotal(session: Session): string;
721
+ quoteDestination(session: Session, body: DestinationQuoteBody): unknown;
710
722
  addItem(session: Session, body: AddItemInput): unknown;
711
723
  updateQuantity(session: Session, cartItemId: string, quantity: number): unknown;
712
724
  removeItem(session: Session, cartItemId: string): unknown;
package/dist/server.d.mts CHANGED
@@ -1,8 +1,8 @@
1
- import { af as CimplifyClient } from './client-BwRAAk4y.mjs';
2
- export { J as CacheOptions, cD as ReadRequestOptions, c_ as Result } from './client-BwRAAk4y.mjs';
3
- export { S as Category, V as CimplifyError, W as Collection, aZ as Product, bb as ProductWithDetails } from './product-CeV8euw4.mjs';
1
+ import { af as CimplifyClient } from './client-CdTx7X_X.mjs';
2
+ export { J as CacheOptions, cD as ReadRequestOptions, c_ as Result } from './client-CdTx7X_X.mjs';
3
+ export { S as Category, V as CimplifyError, W as Collection, b0 as Product, be as ProductWithDetails } from './product-DwKdC_to.mjs';
4
4
  import { JWTVerifyResult } from 'jose';
5
- import './payment-BSzy7sly.mjs';
5
+ import './payment-CRqjGrx6.mjs';
6
6
 
7
7
  interface ServerClientOptions {
8
8
  /**
package/dist/server.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { af as CimplifyClient } from './client-CrPglBBz.js';
2
- export { J as CacheOptions, cD as ReadRequestOptions, c_ as Result } from './client-CrPglBBz.js';
3
- export { S as Category, V as CimplifyError, W as Collection, aZ as Product, bb as ProductWithDetails } from './product-CeV8euw4.js';
1
+ import { af as CimplifyClient } from './client-Db554902.js';
2
+ export { J as CacheOptions, cD as ReadRequestOptions, c_ as Result } from './client-Db554902.js';
3
+ export { S as Category, V as CimplifyError, W as Collection, b0 as Product, be as ProductWithDetails } from './product-DwKdC_to.js';
4
4
  import { JWTVerifyResult } from 'jose';
5
- import './payment-jK8ztICx.js';
5
+ import './payment-DO1Z1Ip6.js';
6
6
 
7
7
  interface ServerClientOptions {
8
8
  /**
package/dist/server.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkD3FWJB7Y_js = require('./chunk-D3FWJB7Y.js');
4
- var chunk3HU5I5VG_js = require('./chunk-3HU5I5VG.js');
3
+ var chunkYDA46OZ6_js = require('./chunk-YDA46OZ6.js');
4
+ var chunkYER7DIOM_js = require('./chunk-YER7DIOM.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 = chunkD3FWJB7Y_js.createCimplifyClient({
29
+ const client = chunkYDA46OZ6_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 ?? chunk3HU5I5VG_js.DEFAULT_ISSUER).replace(/\/$/, "");
253
+ return (cfg.issuer ?? cfg.authUrl ?? chunkYER7DIOM_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(`${chunk3HU5I5VG_js.PKCE_COOKIE}=`));
468
+ const match = cookieHeader.split(/;\s*/).find((p) => p.startsWith(`${chunkYER7DIOM_js.PKCE_COOKIE}=`));
469
469
  if (!match) return null;
470
- return chunk3HU5I5VG_js.decodePkceState(match.slice(chunk3HU5I5VG_js.PKCE_COOKIE.length + 1));
470
+ return chunkYER7DIOM_js.decodePkceState(match.slice(chunkYER7DIOM_js.PKCE_COOKIE.length + 1));
471
471
  }
472
472
  function buildPkceClearCookie() {
473
- return `${chunk3HU5I5VG_js.PKCE_COOKIE}=; Path=${chunk3HU5I5VG_js.PKCE_COOKIE_PATH}; Max-Age=0; Secure; SameSite=Lax`;
473
+ return `${chunkYER7DIOM_js.PKCE_COOKIE}=; Path=${chunkYER7DIOM_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-BMFWQNYZ.mjs';
2
- import { PKCE_COOKIE, decodePkceState, PKCE_COOKIE_PATH, DEFAULT_ISSUER } from './chunk-Z7M6GAHS.mjs';
1
+ import { createCimplifyClient } from './chunk-DKLHCZ5M.mjs';
2
+ import { PKCE_COOKIE, decodePkceState, PKCE_COOKIE_PATH, DEFAULT_ISSUER } from './chunk-Z3K2D3TE.mjs';
3
3
  import './chunk-DLW3RWRK.mjs';
4
4
  export { CimplifyError } from './chunk-O3YUHLZL.mjs';
5
5
  import './chunk-3G6RQLXK.mjs';
@@ -1,6 +1,6 @@
1
- import { A as AppHandle, C as CreateAppOptions } from '../server-DRAW2OOX.mjs';
1
+ import { A as AppHandle, C as CreateAppOptions } from '../server-D-nSkrUr.mjs';
2
2
  import 'hono';
3
- import '../product-CeV8euw4.mjs';
3
+ import '../product-DwKdC_to.mjs';
4
4
 
5
5
  interface MswHandlerSetup {
6
6
  handlers: unknown[];
@@ -1,6 +1,6 @@
1
- import { A as AppHandle, C as CreateAppOptions } from '../server-zyrpzJVn.js';
1
+ import { A as AppHandle, C as CreateAppOptions } from '../server-CeDb93WA.js';
2
2
  import 'hono';
3
- import '../product-CeV8euw4.js';
3
+ import '../product-DwKdC_to.js';
4
4
 
5
5
  interface MswHandlerSetup {
6
6
  handlers: unknown[];
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkPNTINRAU_js = require('../chunk-PNTINRAU.js');
3
+ var chunkH5SSGN7W_js = require('../chunk-H5SSGN7W.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 = chunkPNTINRAU_js.createMockApp(options);
11
+ const handle = chunkH5SSGN7W_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
  });
@@ -1,4 +1,4 @@
1
- import { createMockApp } from '../chunk-RQPXLXB2.mjs';
1
+ import { createMockApp } from '../chunk-YHPMFTMN.mjs';
2
2
  import '../chunk-U4MW6PYU.mjs';
3
3
  import '../chunk-O3YUHLZL.mjs';
4
4
  import '../chunk-3G6RQLXK.mjs';
@@ -1,10 +1,10 @@
1
1
  import { TestAPI } from 'vitest';
2
- import { T as TestClientHandle } from '../client-DGrvLiJv.mjs';
3
- import { C as CreateAppOptions } from '../server-DRAW2OOX.mjs';
4
- export { S as SeedName } from '../server-DRAW2OOX.mjs';
5
- import '../client-BwRAAk4y.mjs';
6
- import '../product-CeV8euw4.mjs';
7
- import '../payment-BSzy7sly.mjs';
2
+ import { T as TestClientHandle } from '../client-WkUcvRvO.mjs';
3
+ import { C as CreateAppOptions } from '../server-D-nSkrUr.mjs';
4
+ export { S as SeedName } from '../server-D-nSkrUr.mjs';
5
+ import '../client-CdTx7X_X.mjs';
6
+ import '../product-DwKdC_to.mjs';
7
+ import '../payment-CRqjGrx6.mjs';
8
8
  import 'hono';
9
9
 
10
10
  /**
@@ -1,10 +1,10 @@
1
1
  import { TestAPI } from 'vitest';
2
- import { T as TestClientHandle } from '../client-CPcZIrjC.js';
3
- import { C as CreateAppOptions } from '../server-zyrpzJVn.js';
4
- export { S as SeedName } from '../server-zyrpzJVn.js';
5
- import '../client-CrPglBBz.js';
6
- import '../product-CeV8euw4.js';
7
- import '../payment-jK8ztICx.js';
2
+ import { T as TestClientHandle } from '../client-D40kI8z2.js';
3
+ import { C as CreateAppOptions } from '../server-CeDb93WA.js';
4
+ export { S as SeedName } from '../server-CeDb93WA.js';
5
+ import '../client-Db554902.js';
6
+ import '../product-DwKdC_to.js';
7
+ import '../payment-DO1Z1Ip6.js';
8
8
  import 'hono';
9
9
 
10
10
  /**