@demiurgejs/core 0.2.0-beta.3 → 0.2.0-beta.5

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 (237) hide show
  1. package/README.md +36 -11
  2. package/bin/demiurge.mjs +47 -13
  3. package/dist/adapter/index.d.ts +1 -1
  4. package/dist/adapter/index.d.ts.map +1 -1
  5. package/dist/browser/file-router.d.ts +388 -5
  6. package/dist/browser/file-router.d.ts.map +1 -1
  7. package/dist/browser/focus.d.ts +20 -0
  8. package/dist/browser/focus.d.ts.map +1 -0
  9. package/dist/browser/index.d.ts +7 -1
  10. package/dist/browser/index.d.ts.map +1 -1
  11. package/dist/browser/mutation-action.d.ts +81 -0
  12. package/dist/browser/mutation-action.d.ts.map +1 -0
  13. package/dist/chunks/document-shell-9GPwtcTt.js +36 -0
  14. package/dist/chunks/document-shell-9GPwtcTt.js.map +1 -0
  15. package/dist/chunks/{image-codec-Di53WpcH.js → image-codec-Dh1POFhE.js} +2 -2
  16. package/dist/chunks/{image-codec-Di53WpcH.js.map → image-codec-Dh1POFhE.js.map} +1 -1
  17. package/dist/chunks/{images-Edar3eU1.js → images-CG7ZzayG.js} +99 -91
  18. package/dist/chunks/images-CG7ZzayG.js.map +1 -0
  19. package/dist/chunks/index-0MNiR_wo.js +833 -0
  20. package/dist/chunks/index-0MNiR_wo.js.map +1 -0
  21. package/dist/chunks/manifest-vO6c0G0W.js +19 -0
  22. package/dist/chunks/manifest-vO6c0G0W.js.map +1 -0
  23. package/dist/chunks/plugin-BZauDxRY.js +2310 -0
  24. package/dist/chunks/plugin-BZauDxRY.js.map +1 -0
  25. package/dist/chunks/session-store-ChModVcq.js +92 -0
  26. package/dist/chunks/session-store-ChModVcq.js.map +1 -0
  27. package/dist/chunks/static-files-ehaD1kE7.js +51 -0
  28. package/dist/chunks/static-files-ehaD1kE7.js.map +1 -0
  29. package/dist/chunks/streaming-GYIsVTQH.js +560 -0
  30. package/dist/chunks/streaming-GYIsVTQH.js.map +1 -0
  31. package/dist/chunks/testing-CUwGj2ie.js +4751 -0
  32. package/dist/chunks/testing-CUwGj2ie.js.map +1 -0
  33. package/dist/chunks/vite-QoqrGl6f.js +259 -0
  34. package/dist/chunks/vite-QoqrGl6f.js.map +1 -0
  35. package/dist/cli.d.ts +19 -25
  36. package/dist/cli.d.ts.map +1 -1
  37. package/dist/cli.js +289 -128
  38. package/dist/cli.js.map +1 -1
  39. package/dist/config/define.d.ts +3 -0
  40. package/dist/config/define.d.ts.map +1 -0
  41. package/dist/config/index.d.ts +7 -0
  42. package/dist/config/index.d.ts.map +1 -0
  43. package/dist/config/index.js +78 -0
  44. package/dist/config/index.js.map +1 -0
  45. package/dist/config/load.d.ts +12 -0
  46. package/dist/config/load.d.ts.map +1 -0
  47. package/dist/config/types.d.ts +74 -0
  48. package/dist/config/types.d.ts.map +1 -0
  49. package/dist/config/validate.d.ts +9 -0
  50. package/dist/config/validate.d.ts.map +1 -0
  51. package/dist/config/vite.d.ts +12 -0
  52. package/dist/config/vite.d.ts.map +1 -0
  53. package/dist/data/cache.d.ts +2 -0
  54. package/dist/data/cache.d.ts.map +1 -1
  55. package/dist/data/idempotency.d.ts.map +1 -1
  56. package/dist/deployment/testing.d.ts +25 -0
  57. package/dist/deployment/testing.d.ts.map +1 -0
  58. package/dist/deployment/testing.js +171 -0
  59. package/dist/deployment/testing.js.map +1 -0
  60. package/dist/document/hydration.d.ts +9 -0
  61. package/dist/document/hydration.d.ts.map +1 -1
  62. package/dist/document/index.d.ts +4 -2
  63. package/dist/document/index.d.ts.map +1 -1
  64. package/dist/document/metadata.d.ts +8 -0
  65. package/dist/document/metadata.d.ts.map +1 -1
  66. package/dist/document/navigation.d.ts +28 -0
  67. package/dist/document/navigation.d.ts.map +1 -0
  68. package/dist/document/render.d.ts +3 -1
  69. package/dist/document/render.d.ts.map +1 -1
  70. package/dist/document/seo.d.ts.map +1 -1
  71. package/dist/edge/assets.d.ts.map +1 -1
  72. package/dist/edge/index.js +55 -73
  73. package/dist/edge/index.js.map +1 -1
  74. package/dist/index.d.ts +12 -10
  75. package/dist/index.d.ts.map +1 -1
  76. package/dist/index.js +1883 -692
  77. package/dist/index.js.map +1 -1
  78. package/dist/inspect/command.d.ts +28 -0
  79. package/dist/inspect/command.d.ts.map +1 -0
  80. package/dist/inspect/index.d.ts +9 -0
  81. package/dist/inspect/index.d.ts.map +1 -0
  82. package/dist/inspect/redact.d.ts +35 -0
  83. package/dist/inspect/redact.d.ts.map +1 -0
  84. package/dist/inspect/report.d.ts +24 -0
  85. package/dist/inspect/report.d.ts.map +1 -0
  86. package/dist/inspect/types.d.ts +102 -0
  87. package/dist/inspect/types.d.ts.map +1 -0
  88. package/dist/internal/testing.js +5 -5
  89. package/dist/kv/index.d.ts +2 -0
  90. package/dist/kv/index.d.ts.map +1 -1
  91. package/dist/kv/index.js +170 -73
  92. package/dist/kv/index.js.map +1 -1
  93. package/dist/kv/session-store.d.ts +20 -0
  94. package/dist/kv/session-store.d.ts.map +1 -0
  95. package/dist/manifest.d.ts +10 -0
  96. package/dist/manifest.d.ts.map +1 -0
  97. package/dist/node/http.d.ts +5 -0
  98. package/dist/node/http.d.ts.map +1 -1
  99. package/dist/node/image.d.ts.map +1 -1
  100. package/dist/node/index.d.ts +4 -1
  101. package/dist/node/index.d.ts.map +1 -1
  102. package/dist/node/index.js +257 -182
  103. package/dist/node/index.js.map +1 -1
  104. package/dist/node/serve.d.ts +47 -0
  105. package/dist/node/serve.d.ts.map +1 -0
  106. package/dist/node/static.d.ts.map +1 -1
  107. package/dist/platform/fonts.d.ts.map +1 -1
  108. package/dist/platform/image-url.d.ts.map +1 -1
  109. package/dist/platform/url.d.ts +19 -0
  110. package/dist/platform/url.d.ts.map +1 -0
  111. package/dist/platform/web-vitals.d.ts.map +1 -1
  112. package/dist/redis/index.d.ts +2 -0
  113. package/dist/redis/index.d.ts.map +1 -1
  114. package/dist/redis/index.js +186 -69
  115. package/dist/redis/index.js.map +1 -1
  116. package/dist/redis/session-store.d.ts +9 -0
  117. package/dist/redis/session-store.d.ts.map +1 -0
  118. package/dist/route/index.d.ts +3 -2
  119. package/dist/route/index.d.ts.map +1 -1
  120. package/dist/route/mutation.d.ts +97 -0
  121. package/dist/route/mutation.d.ts.map +1 -0
  122. package/dist/route/serialization.d.ts +24 -0
  123. package/dist/route/serialization.d.ts.map +1 -0
  124. package/dist/route/types.d.ts +6 -1
  125. package/dist/route/types.d.ts.map +1 -1
  126. package/dist/route/webhook.d.ts +6 -1
  127. package/dist/route/webhook.d.ts.map +1 -1
  128. package/dist/router/manifest.d.ts +8 -0
  129. package/dist/router/manifest.d.ts.map +1 -1
  130. package/dist/router/navigation-data.d.ts +9 -1
  131. package/dist/router/navigation-data.d.ts.map +1 -1
  132. package/dist/routing/generate.d.ts +3 -0
  133. package/dist/routing/generate.d.ts.map +1 -1
  134. package/dist/routing/index.d.ts +3 -1
  135. package/dist/routing/index.d.ts.map +1 -1
  136. package/dist/routing/locale.d.ts +43 -0
  137. package/dist/routing/locale.d.ts.map +1 -0
  138. package/dist/routing/types.d.ts +12 -0
  139. package/dist/routing/types.d.ts.map +1 -1
  140. package/dist/security/audit.d.ts +2 -1
  141. package/dist/security/audit.d.ts.map +1 -1
  142. package/dist/security/authorization.d.ts +36 -0
  143. package/dist/security/authorization.d.ts.map +1 -0
  144. package/dist/security/cookie-session.d.ts +43 -0
  145. package/dist/security/cookie-session.d.ts.map +1 -0
  146. package/dist/security/csrf.d.ts +1 -1
  147. package/dist/security/csrf.d.ts.map +1 -1
  148. package/dist/security/env-startup.d.ts +13 -0
  149. package/dist/security/env-startup.d.ts.map +1 -0
  150. package/dist/security/env.d.ts +49 -11
  151. package/dist/security/env.d.ts.map +1 -1
  152. package/dist/security/exceptions.d.ts +29 -0
  153. package/dist/security/exceptions.d.ts.map +1 -0
  154. package/dist/security/finding-codes.d.ts +56 -0
  155. package/dist/security/finding-codes.d.ts.map +1 -0
  156. package/dist/security/index.d.ts +14 -3
  157. package/dist/security/index.d.ts.map +1 -1
  158. package/dist/security/policy.d.ts +2 -5
  159. package/dist/security/policy.d.ts.map +1 -1
  160. package/dist/security/report.d.ts +2 -1
  161. package/dist/security/report.d.ts.map +1 -1
  162. package/dist/security/request.d.ts +1 -0
  163. package/dist/security/request.d.ts.map +1 -1
  164. package/dist/security/session-manager.d.ts +32 -0
  165. package/dist/security/session-manager.d.ts.map +1 -0
  166. package/dist/security/session-store.d.ts +51 -0
  167. package/dist/security/session-store.d.ts.map +1 -0
  168. package/dist/security/testing.d.ts +10 -0
  169. package/dist/security/testing.d.ts.map +1 -0
  170. package/dist/security/testing.js +145 -0
  171. package/dist/security/testing.js.map +1 -0
  172. package/dist/security/types.d.ts +139 -5
  173. package/dist/security/types.d.ts.map +1 -1
  174. package/dist/security/upload.d.ts +3 -3
  175. package/dist/security/upload.d.ts.map +1 -1
  176. package/dist/security/verification.d.ts.map +1 -1
  177. package/dist/server/document-shell.d.ts.map +1 -1
  178. package/dist/server/errors.d.ts +1 -0
  179. package/dist/server/errors.d.ts.map +1 -1
  180. package/dist/server/index.d.ts +1 -0
  181. package/dist/server/index.d.ts.map +1 -1
  182. package/dist/server/not-found.d.ts +1 -0
  183. package/dist/server/not-found.d.ts.map +1 -1
  184. package/dist/server/render-tree.d.ts.map +1 -1
  185. package/dist/server/request-handler.d.ts +7 -2
  186. package/dist/server/request-handler.d.ts.map +1 -1
  187. package/dist/server/request-metadata.d.ts +1 -0
  188. package/dist/server/request-metadata.d.ts.map +1 -1
  189. package/dist/server/ssr.d.ts +2 -0
  190. package/dist/server/ssr.d.ts.map +1 -1
  191. package/dist/server-only/browser.d.ts +2 -0
  192. package/dist/server-only/browser.d.ts.map +1 -0
  193. package/dist/server-only/browser.js +4 -0
  194. package/dist/server-only/browser.js.map +1 -0
  195. package/dist/server-only/index.d.ts +2 -0
  196. package/dist/server-only/index.d.ts.map +1 -0
  197. package/dist/server-only/index.js +2 -0
  198. package/dist/server-only/index.js.map +1 -0
  199. package/dist/static/index.d.ts +2 -0
  200. package/dist/static/index.d.ts.map +1 -1
  201. package/dist/static/index.js +380 -363
  202. package/dist/static/index.js.map +1 -1
  203. package/dist/static/preview.d.ts.map +1 -1
  204. package/dist/static/vercel.d.ts +11 -2
  205. package/dist/static/vercel.d.ts.map +1 -1
  206. package/dist/static-files.d.ts +12 -0
  207. package/dist/static-files.d.ts.map +1 -1
  208. package/dist/type-guards.d.ts +19 -0
  209. package/dist/type-guards.d.ts.map +1 -0
  210. package/dist/vite/env-boundary.d.ts +14 -0
  211. package/dist/vite/env-boundary.d.ts.map +1 -0
  212. package/dist/vite/index.d.ts +13 -6
  213. package/dist/vite/index.d.ts.map +1 -1
  214. package/dist/vite/index.js +29 -1560
  215. package/dist/vite/index.js.map +1 -1
  216. package/dist/vite/plugin.d.ts +24 -3
  217. package/dist/vite/plugin.d.ts.map +1 -1
  218. package/dist/vite/policy-verification.d.ts +33 -2
  219. package/dist/vite/policy-verification.d.ts.map +1 -1
  220. package/dist/vite/route-audit.d.ts +14 -2
  221. package/dist/vite/route-audit.d.ts.map +1 -1
  222. package/dist/vite/server-only-boundary.d.ts +8 -0
  223. package/dist/vite/server-only-boundary.d.ts.map +1 -0
  224. package/package.json +24 -6
  225. package/dist/chunks/document-shell-WoM8yZlR.js +0 -35
  226. package/dist/chunks/document-shell-WoM8yZlR.js.map +0 -1
  227. package/dist/chunks/images-Edar3eU1.js.map +0 -1
  228. package/dist/chunks/request-metadata-DaIYq4Ea.js +0 -677
  229. package/dist/chunks/request-metadata-DaIYq4Ea.js.map +0 -1
  230. package/dist/chunks/static-files-DUjHw-4H.js +0 -11
  231. package/dist/chunks/static-files-DUjHw-4H.js.map +0 -1
  232. package/dist/chunks/streaming-D0fGAuiO.js +0 -469
  233. package/dist/chunks/streaming-D0fGAuiO.js.map +0 -1
  234. package/dist/chunks/testing-CRflAw4X.js +0 -3475
  235. package/dist/chunks/testing-CRflAw4X.js.map +0 -1
  236. package/dist/route/action.d.ts +0 -33
  237. package/dist/route/action.d.ts.map +0 -1
@@ -0,0 +1,28 @@
1
+ import type { ResolvedDemiurgeConfig } from "../config/types";
2
+ /** The exit codes of the `demiurge inspect` command. */
3
+ export declare const INSPECT_EXIT_OK = 0;
4
+ export declare const INSPECT_EXIT_FINDINGS = 1;
5
+ export declare const INSPECT_EXIT_INVALID = 2;
6
+ export type InspectCommandInput = {
7
+ /** The arguments that follow the command name. */
8
+ arguments: readonly string[];
9
+ /** Reads the configuration of the application. */
10
+ loadConfig: () => Promise<ResolvedDemiurgeConfig>;
11
+ };
12
+ export type InspectCommandResult = {
13
+ /** The exit code of the command. */
14
+ exitCode: number;
15
+ /** The human summary that the command writes to standard error. */
16
+ stderr: string;
17
+ /** The JSON document that the command writes to standard output. */
18
+ stdout: string;
19
+ };
20
+ /**
21
+ * Runs the `demiurge inspect` command.
22
+ *
23
+ * The command reads the route tree, resolves the policy cascade, and returns
24
+ * one JSON document. The command loads no route module, so it runs no data
25
+ * loader and no mutation handler.
26
+ */
27
+ export declare function runInspectCommand(input: InspectCommandInput): Promise<InspectCommandResult>;
28
+ //# sourceMappingURL=command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/inspect/command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAe9D,wDAAwD;AACxD,eAAO,MAAM,eAAe,IAAI,CAAC;AACjC,eAAO,MAAM,qBAAqB,IAAI,CAAC;AACvC,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC,MAAM,MAAM,mBAAmB,GAAG;IAChC,kDAAkD;IAClD,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,kDAAkD;IAClD,UAAU,EAAE,MAAM,OAAO,CAAC,sBAAsB,CAAC,CAAC;CACnD,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,oCAAoC;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,mEAAmE;IACnE,MAAM,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,KAAK,EAAE,mBAAmB,GACzB,OAAO,CAAC,oBAAoB,CAAC,CAmC/B"}
@@ -0,0 +1,9 @@
1
+ export { INSPECT_EXIT_FINDINGS, INSPECT_EXIT_INVALID, INSPECT_EXIT_OK, runInspectCommand, } from "./command";
2
+ export type { InspectCommandInput, InspectCommandResult, } from "./command";
3
+ export { redactSecrets, REDACTED_VALUE, serializeInspectionReport, } from "./redact";
4
+ export type { InspectionRedactionResult, InspectionSerializeOptions, } from "./redact";
5
+ export { countErrorFindings, createStaticPolicyReport, findSecretEnvKeys, formatStaticPolicyReportSummary, } from "./report";
6
+ export type { StaticPolicyReportOptions } from "./report";
7
+ export { INSPECTION_PROBLEM_VERSION, STATIC_POLICY_REPORT_VERSION, } from "./types";
8
+ export type { InspectionProblem, InspectionProblemCode, InspectionRedaction, InspectionRedactionReason, InspectionResolution, StaticPolicyReport, StaticPolicyReportSection, StaticRouteKind, StaticRouteReport, } from "./types";
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/inspect/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,iBAAiB,GAClB,MAAM,WAAW,CAAC;AACnB,YAAY,EACV,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,aAAa,EACb,cAAc,EACd,yBAAyB,GAC1B,MAAM,UAAU,CAAC;AAClB,YAAY,EACV,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,iBAAiB,EACjB,+BAA+B,GAChC,MAAM,UAAU,CAAC;AAClB,YAAY,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAC1D,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,SAAS,CAAC;AACjB,YAAY,EACV,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,yBAAyB,EACzB,oBAAoB,EACpB,kBAAkB,EAClB,yBAAyB,EACzB,eAAe,EACf,iBAAiB,GAClB,MAAM,SAAS,CAAC"}
@@ -0,0 +1,35 @@
1
+ import type { InspectionRedaction } from "./types";
2
+ /**
3
+ * The text that replaces a removed value. A reader sees this marker in place
4
+ * of the value, and the `redactions` section names the field and the reason.
5
+ */
6
+ export declare const REDACTED_VALUE = "[redacted]";
7
+ export type InspectionSerializeOptions = {
8
+ /**
9
+ * The names of the environment variables that an `env.secret(...)`
10
+ * declaration produced.
11
+ */
12
+ secretEnvKeys?: Iterable<string>;
13
+ /** The indentation of the JSON output. The default value is 2. */
14
+ space?: number;
15
+ };
16
+ export type InspectionRedactionResult = {
17
+ /** The values that this module removed, sorted by path. */
18
+ redactions: InspectionRedaction[];
19
+ /** The report without the removed values. */
20
+ value: unknown;
21
+ };
22
+ /**
23
+ * Serializes a report and removes each secret value. This function is the one
24
+ * choke point of ADR 0019.
25
+ *
26
+ * The function writes the collected redactions into the `redactions` field of
27
+ * the report when the report declares that field.
28
+ */
29
+ export declare function serializeInspectionReport(report: unknown, options?: InspectionSerializeOptions): string;
30
+ /**
31
+ * Removes each secret value from a report and returns the removed names. The
32
+ * function does not change the report that the caller supplied.
33
+ */
34
+ export declare function redactSecrets(report: unknown, options?: InspectionSerializeOptions): InspectionRedactionResult;
35
+ //# sourceMappingURL=redact.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redact.d.ts","sourceRoot":"","sources":["../../src/inspect/redact.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,mBAAmB,EAEpB,MAAM,SAAS,CAAC;AAEjB;;;GAGG;AACH,eAAO,MAAM,cAAc,eAAe,CAAC;AAE3C,MAAM,MAAM,0BAA0B,GAAG;IACvC;;;OAGG;IACH,aAAa,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjC,kEAAkE;IAClE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,2DAA2D;IAC3D,UAAU,EAAE,mBAAmB,EAAE,CAAC;IAClC,6CAA6C;IAC7C,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AA+BF;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,OAAO,EACf,OAAO,GAAE,0BAA+B,GACvC,MAAM,CAKR;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,OAAO,EACf,OAAO,GAAE,0BAA+B,GACvC,yBAAyB,CAY3B"}
@@ -0,0 +1,24 @@
1
+ import type { EnvSchema } from "../security";
2
+ import { type DemiurgeVitePluginOptions } from "../vite/plugin";
3
+ import { type StaticPolicyReport } from "./types";
4
+ export type StaticPolicyReportOptions = {
5
+ /** The plugin options of the application. */
6
+ options?: DemiurgeVitePluginOptions;
7
+ /** The absolute path of the project root. */
8
+ root: string;
9
+ };
10
+ /**
11
+ * Builds the static inspection report of an application.
12
+ *
13
+ * The function reads the route tree and resolves the policy cascade through
14
+ * `inspectRoutePolicies`. It loads no route module, so it runs no data loader
15
+ * and no mutation handler.
16
+ */
17
+ export declare function createStaticPolicyReport(input: StaticPolicyReportOptions): Promise<StaticPolicyReport>;
18
+ /** Reads the names of the variables that `env.secret(...)` declared. */
19
+ export declare function findSecretEnvKeys(schema: EnvSchema | undefined): string[];
20
+ /** Counts the findings that carry error severity. */
21
+ export declare function countErrorFindings(report: StaticPolicyReport): number;
22
+ /** Writes the human summary that the command sends to standard error. */
23
+ export declare function formatStaticPolicyReportSummary(report: StaticPolicyReport): string;
24
+ //# sourceMappingURL=report.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../src/inspect/report.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAEL,KAAK,kBAAkB,EAExB,MAAM,SAAS,CAAC;AAEjB,MAAM,MAAM,yBAAyB,GAAG;IACtC,6CAA6C;IAC7C,OAAO,CAAC,EAAE,yBAAyB,CAAC;IACpC,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAiBF;;;;;;GAMG;AACH,wBAAsB,wBAAwB,CAC5C,KAAK,EAAE,yBAAyB,GAC/B,OAAO,CAAC,kBAAkB,CAAC,CAqB7B;AAED,wEAAwE;AACxE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,YAK9D;AAED,qDAAqD;AACrD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,kBAAkB,UAG5D;AAED,yEAAyE;AACzE,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,kBAAkB,UAYzE"}
@@ -0,0 +1,102 @@
1
+ import type { HttpMethod } from "../route";
2
+ import type { DocumentCspState, RouteAccessState, StaticPolicyFinding } from "../vite/policy-verification";
3
+ /**
4
+ * The version of the static policy report. ADR 0019 raises this integer when
5
+ * the framework removes a field or changes the meaning of a field.
6
+ */
7
+ export declare const STATIC_POLICY_REPORT_VERSION = 1;
8
+ /**
9
+ * The version of the problem document that the inspect command writes when it
10
+ * cannot produce a report.
11
+ */
12
+ export declare const INSPECTION_PROBLEM_VERSION = 1;
13
+ /**
14
+ * The origin of one fact in a report. The value `static` states that the build
15
+ * knows the fact. The value `request` states that only a request supplies it.
16
+ */
17
+ export type InspectionResolution = "request" | "static";
18
+ /** The rule that removed one value from a report. */
19
+ export type InspectionRedactionReason =
20
+ /** A cookie holds the value. */
21
+ "cookie-value"
22
+ /** An `env.secret(...)` declaration produced the value. */
23
+ | "environment-secret"
24
+ /** A session record holds the value. */
25
+ | "session-record";
26
+ /** One value that the serializer removed from a report. */
27
+ export type InspectionRedaction = {
28
+ /** The name of the field that held the value. */
29
+ name: string;
30
+ /** The dotted path of the field inside the report. */
31
+ path: string;
32
+ /** The rule that removed the value. */
33
+ reason: InspectionRedactionReason;
34
+ };
35
+ /** The named sections of the static policy report. */
36
+ export type StaticPolicyReportSection = "findings" | "redactions" | "request" | "routes";
37
+ /** The kind of route file that the static pass read. */
38
+ export type StaticRouteKind = "attached" | "page" | "resource";
39
+ /**
40
+ * The statically readable description of one route file.
41
+ *
42
+ * Each declared field states what the file itself declares. The framework
43
+ * resolves the cascade of the route tree and reports the result of the
44
+ * cascade in the `findings` section.
45
+ */
46
+ export type StaticRouteReport = {
47
+ /** The access state that the route file declares. */
48
+ declaredAccess: RouteAccessState;
49
+ /** The Content-Security-Policy state that the route file declares. */
50
+ declaredDocumentCsp: DocumentCspState;
51
+ /** `true` when the route file declares a document policy. */
52
+ declaresDocumentPolicy: boolean;
53
+ /** The path of the route file, relative to the route directory. */
54
+ file: string;
55
+ /** The kind of the route file. */
56
+ kind: StaticRouteKind;
57
+ /** The HTTP methods that the route file exports. */
58
+ methods: HttpMethod[];
59
+ /** The route pattern. An attached file has no pattern. */
60
+ pattern?: string;
61
+ };
62
+ /**
63
+ * The report that `demiurge inspect` writes to standard output. Each section
64
+ * states the resolution of its facts in the `resolutions` record.
65
+ */
66
+ export type StaticPolicyReport = {
67
+ /** The static policy findings, sorted by file, export name, and code. */
68
+ findings: StaticPolicyFinding[];
69
+ /** The values that the serializer removed. */
70
+ redactions: InspectionRedaction[];
71
+ /** The names of the facts that only a request supplies. */
72
+ request: string[];
73
+ /** The resolution of each section of the report. */
74
+ resolutions: Record<StaticPolicyReportSection, InspectionResolution>;
75
+ /** Every route file under the route directory. */
76
+ routes: StaticRouteReport[];
77
+ /** The route directory, relative to the project root. */
78
+ routesDir: string;
79
+ /** The version of this report shape. */
80
+ version: number;
81
+ };
82
+ /** The reason that the inspect command could not produce a report. */
83
+ export type InspectionProblemCode =
84
+ /** The framework could not read the configuration. */
85
+ "configuration-unreadable"
86
+ /** The command received an invalid argument. */
87
+ | "invalid-argument";
88
+ /**
89
+ * The document that the inspect command writes when it cannot produce a
90
+ * report. The command then exits with code 2.
91
+ */
92
+ export type InspectionProblem = {
93
+ /** The stable code of the condition. */
94
+ code: InspectionProblemCode;
95
+ /** The description of the condition. */
96
+ detail: string;
97
+ /** The short name of the condition. */
98
+ title: string;
99
+ /** The version of this problem shape. */
100
+ version: number;
101
+ };
102
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/inspect/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,6BAA6B,CAAC;AAErC;;;GAGG;AACH,eAAO,MAAM,4BAA4B,IAAI,CAAC;AAE9C;;;GAGG;AACH,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAE5C;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,QAAQ,CAAC;AAExD,qDAAqD;AACrD,MAAM,MAAM,yBAAyB;AACnC,gCAAgC;AAC9B,cAAc;AAChB,2DAA2D;GACzD,oBAAoB;AACtB,wCAAwC;GACtC,gBAAgB,CAAC;AAErB,2DAA2D;AAC3D,MAAM,MAAM,mBAAmB,GAAG;IAChC,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,uCAAuC;IACvC,MAAM,EAAE,yBAAyB,CAAC;CACnC,CAAC;AAEF,sDAAsD;AACtD,MAAM,MAAM,yBAAyB,GACjC,UAAU,GACV,YAAY,GACZ,SAAS,GACT,QAAQ,CAAC;AAEb,wDAAwD;AACxD,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,MAAM,GAAG,UAAU,CAAC;AAE/D;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,qDAAqD;IACrD,cAAc,EAAE,gBAAgB,CAAC;IACjC,sEAAsE;IACtE,mBAAmB,EAAE,gBAAgB,CAAC;IACtC,6DAA6D;IAC7D,sBAAsB,EAAE,OAAO,CAAC;IAChC,mEAAmE;IACnE,IAAI,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,IAAI,EAAE,eAAe,CAAC;IACtB,oDAAoD;IACpD,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,0DAA0D;IAC1D,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,yEAAyE;IACzE,QAAQ,EAAE,mBAAmB,EAAE,CAAC;IAChC,8CAA8C;IAC9C,UAAU,EAAE,mBAAmB,EAAE,CAAC;IAClC,2DAA2D;IAC3D,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,oDAAoD;IACpD,WAAW,EAAE,MAAM,CAAC,yBAAyB,EAAE,oBAAoB,CAAC,CAAC;IACrE,kDAAkD;IAClD,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAC5B,yDAAyD;IACzD,SAAS,EAAE,MAAM,CAAC;IAClB,wCAAwC;IACxC,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,sEAAsE;AACtE,MAAM,MAAM,qBAAqB;AAC/B,sDAAsD;AACpD,0BAA0B;AAC5B,gDAAgD;GAC9C,kBAAkB,CAAC;AAEvB;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,wCAAwC;IACxC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,wCAAwC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC"}
@@ -1,12 +1,12 @@
1
- import { h as n, b as u, y as b, ay as i, n as _, j as r, az as c, H as d, G as h, i as m, aA as R, aB as g, aC as p, aD as f, aE as F } from "../chunks/testing-CRflAw4X.js";
1
+ import { h as u, d as b, L as n, b9 as i, C as _, A as r, ba as c, Z as d, Y as h, z as m, bb as R, bc as g, bd as p, be as f, a as F } from "../chunks/testing-CUwGj2ie.js";
2
2
  import "react-dom/server";
3
- import "../chunks/request-metadata-DaIYq4Ea.js";
3
+ import "../chunks/index-0MNiR_wo.js";
4
4
  import "react";
5
5
  import "react/jsx-runtime";
6
6
  export {
7
- n as handleRequestWithManifest,
8
- u as unstable_collectStaticRoutePaths,
9
- b as unstable_createRouteManifest,
7
+ u as handleRequestWithManifest,
8
+ b as unstable_collectStaticRoutePaths,
9
+ n as unstable_createRouteManifest,
10
10
  i as unstable_findPageMatch,
11
11
  _ as unstable_findRouteMatch,
12
12
  r as unstable_isAttachedFileForRoute,
@@ -2,4 +2,6 @@ export { createKvCacheStore } from "./store";
2
2
  export type { EdgeKvListKey, EdgeKvListResult, EdgeKvNamespace, EdgeKvPutOptions, KvCacheStoreOptions, } from "./store";
3
3
  export { createKvRateLimitStore } from "./rate-limit-store";
4
4
  export type { KvRateLimitStoreOptions } from "./rate-limit-store";
5
+ export { createKvSessionStore } from "./session-store";
6
+ export type { EdgeKvAtomicOperation, EdgeKvSessionNamespace, KvSessionStoreOptions, } from "./session-store";
5
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/kv/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,YAAY,EACV,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,YAAY,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/kv/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,YAAY,EACV,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,YAAY,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,YAAY,EACV,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,iBAAiB,CAAC"}
package/dist/kv/index.js CHANGED
@@ -1,126 +1,223 @@
1
- const $ = "demiurge:cache:";
2
- function A(n) {
3
- if (!n.namespace || typeof n.namespace.get != "function")
1
+ import { s as R, p as b } from "../chunks/session-store-ChModVcq.js";
2
+ const M = "demiurge:cache:", O = 1e3;
3
+ function T(r) {
4
+ if (!r.namespace || typeof r.namespace.get != "function")
4
5
  throw new Error(
5
6
  "Demiurge KV cache store requires an EdgeKvNamespace. Pass a connected KV client matching the get/put/delete/list interface documented on EdgeKvNamespace."
6
7
  );
7
- const a = n.namespace, d = n.keyPrefix ?? $, g = `${d}entry:`, w = `${d}tag:`, m = `${d}lease:`;
8
- function o(e) {
9
- return g + e;
8
+ const t = r.namespace, d = r.keyPrefix ?? M, w = `${d}entry:`, f = `${d}tag:`, c = `${d}lease:`;
9
+ function s(e) {
10
+ return w + e;
10
11
  }
11
- function r(e) {
12
- return m + e;
12
+ function n(e) {
13
+ return c + e;
13
14
  }
14
- function l(e, t) {
15
- return `${w}${e}:${t}`;
15
+ function o(e, a) {
16
+ return `${f}${e}:${a}`;
16
17
  }
17
- async function s(e) {
18
- const t = await a.get(o(e));
19
- return t ? JSON.parse(t) : void 0;
18
+ async function i(e) {
19
+ const a = await t.get(s(e));
20
+ return a ? JSON.parse(a) : void 0;
20
21
  }
21
- async function u(e, t) {
22
+ async function u(e, a) {
22
23
  await Promise.all(
23
- t.map((i) => a.delete(l(i, e)))
24
+ a.map((l) => t.delete(o(l, e)))
24
25
  );
25
26
  }
26
- async function E(e, t, i) {
27
+ async function y(e, a, l) {
27
28
  await Promise.all(
28
- t.map(
29
- (c) => a.put(l(c, e), "1", { expiration: i })
29
+ a.map(
30
+ (p) => t.put(o(p, e), "1", { expiration: l })
30
31
  )
31
32
  );
32
33
  }
33
- async function x(e, t) {
34
- const i = await s(e);
35
- i && await u(e, i.tags);
36
- const c = S(t);
37
- await a.put(o(e), JSON.stringify(t), { expiration: c }), await E(e, t.tags, c);
34
+ async function g(e, a) {
35
+ const l = await i(e);
36
+ l && await u(e, l.tags);
37
+ const p = J(a);
38
+ await t.put(s(e), JSON.stringify(a), { expiration: p }), await y(e, a.tags, p);
38
39
  }
39
40
  return {
40
- async acquireRefreshLease(e, t, i) {
41
- return await a.get(r(e)) ? !1 : (await a.put(r(e), t, {
42
- expiration: P(i)
41
+ async acquireRefreshLease(e, a, l) {
42
+ return await t.get(n(e)) ? !1 : (await t.put(n(e), a, {
43
+ expiration: $(l)
43
44
  }), !0);
44
45
  },
45
46
  async delete(e) {
46
- const t = await s(e);
47
- return await a.delete(r(e)), t ? (await u(e, t.tags), await a.delete(o(e)), !0) : !1;
47
+ const a = await i(e);
48
+ return await t.delete(n(e)), a ? (await u(e, a.tags), await t.delete(s(e)), !0) : !1;
48
49
  },
49
50
  async get(e) {
50
- return await s(e);
51
+ return await i(e);
51
52
  },
52
53
  async invalidateTags(e) {
53
54
  if (e.length === 0)
54
55
  return 0;
55
- const t = /* @__PURE__ */ new Set();
56
- let i = 0;
57
- for (const c of e) {
58
- const y = l(c, "");
59
- let p;
56
+ const a = /* @__PURE__ */ new Set();
57
+ let l = 0;
58
+ for (const p of e) {
59
+ const E = o(p, "");
60
+ let v;
60
61
  do {
61
- const h = await a.list({
62
- cursor: p,
63
- limit: 1e3,
64
- prefix: y
62
+ const h = await t.list({
63
+ cursor: v,
64
+ limit: O,
65
+ prefix: E
65
66
  });
66
- for (const K of h.keys) {
67
- const f = K.name.slice(y.length);
68
- if (t.has(f))
67
+ for (const S of h.keys) {
68
+ const m = S.name.slice(E.length);
69
+ if (a.has(m))
69
70
  continue;
70
- t.add(f);
71
- const v = await s(f);
72
- if (!v) {
73
- await a.delete(K.name);
71
+ a.add(m);
72
+ const N = await i(m);
73
+ if (!N) {
74
+ await t.delete(S.name);
74
75
  continue;
75
76
  }
76
- await u(f, v.tags), await a.delete(o(f)), await a.delete(r(f)), i += 1;
77
+ await u(m, N.tags), await t.delete(s(m)), await t.delete(n(m)), l += 1;
77
78
  }
78
- p = h.list_complete ? void 0 : h.cursor;
79
- } while (p);
79
+ v = h.list_complete ? void 0 : h.cursor;
80
+ } while (v);
80
81
  }
81
- return i;
82
+ return l;
82
83
  },
83
- async publishRefresh(e, t, i) {
84
- return await a.get(r(e)) !== t ? !1 : (await x(e, i), await a.delete(r(e)), !0);
84
+ async publishRefresh(e, a, l) {
85
+ return await t.get(n(e)) !== a ? !1 : (await g(e, l), await t.delete(n(e)), !0);
85
86
  },
86
- async releaseRefreshLease(e, t) {
87
- await a.get(r(e)) === t && await a.delete(r(e));
87
+ async releaseRefreshLease(e, a) {
88
+ await t.get(n(e)) === a && await t.delete(n(e));
88
89
  },
89
- async set(e, t) {
90
- await x(e, t), await a.delete(r(e));
90
+ async set(e, a) {
91
+ await g(e, a), await t.delete(n(e));
91
92
  }
92
93
  };
93
94
  }
94
- function S(n) {
95
- return n.staleUntil === null ? void 0 : P(n.staleUntil);
95
+ function J(r) {
96
+ return r.staleUntil === null ? void 0 : $(r.staleUntil);
96
97
  }
97
- function P(n) {
98
- return Math.ceil(n / 1e3);
98
+ function $(r) {
99
+ return Math.ceil(r / 1e3);
99
100
  }
100
- const N = "demiurge:rate-limit:";
101
- function L(n) {
102
- if (!n.namespace || typeof n.namespace.get != "function")
101
+ const q = "demiurge:rate-limit:";
102
+ function C(r) {
103
+ if (!r.namespace || typeof r.namespace.get != "function")
103
104
  throw new Error(
104
105
  "Demiurge KV rate limit store requires an EdgeKvNamespace. Pass a connected KV client matching the get/put/delete/list interface documented on EdgeKvNamespace."
105
106
  );
106
- const a = n.namespace, d = n.keyPrefix ?? N;
107
- function g(w) {
108
- return `${d}${w}`;
107
+ const t = r.namespace, d = r.keyPrefix ?? q;
108
+ function w(f) {
109
+ return `${d}${f}`;
109
110
  }
110
111
  return {
111
- async increment(w, m, o) {
112
- const r = g(w), l = await a.get(r), s = l ? JSON.parse(l) : void 0, u = !s || s.resetAt <= o ? { count: 1, resetAt: o + m } : { count: s.count + 1, resetAt: s.resetAt };
113
- return await a.put(r, JSON.stringify(u), {
114
- expiration: b(u.resetAt)
112
+ async increment(f, c, s) {
113
+ const n = w(f), o = await t.get(n), i = o ? JSON.parse(o) : void 0, u = !i || i.resetAt <= s ? { count: 1, resetAt: s + c } : { count: i.count + 1, resetAt: i.resetAt };
114
+ return await t.put(n, JSON.stringify(u), {
115
+ expiration: V(u.resetAt)
115
116
  }), u;
116
117
  }
117
118
  };
118
119
  }
119
- function b(n) {
120
- return Math.ceil(n / 1e3);
120
+ function V(r) {
121
+ return Math.ceil(r / 1e3);
122
+ }
123
+ const D = "demiurge:session:";
124
+ function I(r) {
125
+ if (!r.store || typeof r.store.get != "function")
126
+ throw new Error(
127
+ "Demiurge KV session store requires an EdgeKvSessionNamespace. Pass an application-owned KV client as `store`."
128
+ );
129
+ if (typeof r.store.atomic != "function")
130
+ throw new Error(
131
+ "Demiurge KV session store requires atomic compare-and-swap operations. Adapt the provider transaction API to EdgeKvSessionNamespace.atomic."
132
+ );
133
+ const t = r.store, d = R(r.namespace), w = `${r.keyPrefix ?? D}${d}:`, f = (c) => w + c;
134
+ return {
135
+ async create(c) {
136
+ const s = P(c, 0);
137
+ try {
138
+ return await t.atomic([x(f(s.id), null, s)]) ? { record: s, status: "stored" } : { status: "conflict" };
139
+ } catch {
140
+ return { status: "unavailable" };
141
+ }
142
+ },
143
+ async destroy(c) {
144
+ const s = f(c), n = await t.get(s);
145
+ return n === null ? !1 : await t.atomic([{ expected: n, key: s }]);
146
+ },
147
+ async read(c, s) {
148
+ const n = f(c), o = await t.get(n);
149
+ if (o === null)
150
+ return;
151
+ const i = K(o);
152
+ if (i) {
153
+ if (A(i) <= s) {
154
+ await t.atomic([{ expected: o, key: n }]);
155
+ return;
156
+ }
157
+ return i;
158
+ }
159
+ },
160
+ async rotate(c, s, n) {
161
+ const o = f(c), i = f(s.id), [u, y] = await Promise.all([
162
+ t.get(o),
163
+ o === i ? Promise.resolve(null) : t.get(i)
164
+ ]);
165
+ if (!u || i !== o && y !== null)
166
+ return { status: "conflict" };
167
+ const g = K(u);
168
+ if (!g || g.version !== n)
169
+ return { status: "conflict" };
170
+ const e = P(s, n + 1), a = o === i ? [x(o, u, e)] : [
171
+ { expected: u, key: o },
172
+ x(i, null, e)
173
+ ];
174
+ try {
175
+ return await t.atomic(a) ? { record: e, status: "stored" } : { status: "conflict" };
176
+ } catch {
177
+ return { status: "unavailable" };
178
+ }
179
+ },
180
+ async update(c, s) {
181
+ const n = f(c.id), o = await t.get(n), i = o ? K(o) : void 0;
182
+ if (!i || i.version !== s)
183
+ return { status: "conflict" };
184
+ const u = P(c, s + 1);
185
+ try {
186
+ return await t.atomic([
187
+ x(n, o, u)
188
+ ]) ? { record: u, status: "stored" } : { status: "conflict" };
189
+ } catch {
190
+ return { status: "unavailable" };
191
+ }
192
+ }
193
+ };
194
+ }
195
+ function x(r, t, d) {
196
+ return {
197
+ expected: t,
198
+ key: r,
199
+ write: {
200
+ options: { expiration: Math.ceil(A(d) / 1e3) },
201
+ value: JSON.stringify(d)
202
+ }
203
+ };
204
+ }
205
+ function K(r) {
206
+ try {
207
+ return b(JSON.parse(r));
208
+ } catch {
209
+ return;
210
+ }
211
+ }
212
+ function P(r, t) {
213
+ return structuredClone({ ...r, version: t });
214
+ }
215
+ function A(r) {
216
+ return Math.min(r.expiresAt, r.idleExpiresAt ?? r.expiresAt);
121
217
  }
122
218
  export {
123
- A as createKvCacheStore,
124
- L as createKvRateLimitStore
219
+ T as createKvCacheStore,
220
+ C as createKvRateLimitStore,
221
+ I as createKvSessionStore
125
222
  };
126
223
  //# sourceMappingURL=index.js.map