@demiurgejs/core 0.2.0-beta.4 → 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 (116) hide show
  1. package/README.md +23 -0
  2. package/bin/demiurge.mjs +17 -1
  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 +1 -1
  6. package/dist/chunks/{document-shell-CpJnFtSC.js → document-shell-9GPwtcTt.js} +2 -2
  7. package/dist/chunks/{document-shell-CpJnFtSC.js.map → document-shell-9GPwtcTt.js.map} +1 -1
  8. package/dist/chunks/{image-codec-BmzWnH6W.js → image-codec-Dh1POFhE.js} +2 -2
  9. package/dist/chunks/{image-codec-BmzWnH6W.js.map → image-codec-Dh1POFhE.js.map} +1 -1
  10. package/dist/chunks/{images-BQ80950B.js → images-CG7ZzayG.js} +2 -2
  11. package/dist/chunks/{images-BQ80950B.js.map → images-CG7ZzayG.js.map} +1 -1
  12. package/dist/chunks/{index-BVk9zWbe.js → index-0MNiR_wo.js} +4 -3
  13. package/dist/chunks/{index-BVk9zWbe.js.map → index-0MNiR_wo.js.map} +1 -1
  14. package/dist/chunks/plugin-BZauDxRY.js +2310 -0
  15. package/dist/chunks/plugin-BZauDxRY.js.map +1 -0
  16. package/dist/chunks/streaming-GYIsVTQH.js +560 -0
  17. package/dist/chunks/streaming-GYIsVTQH.js.map +1 -0
  18. package/dist/chunks/testing-CUwGj2ie.js +4751 -0
  19. package/dist/chunks/testing-CUwGj2ie.js.map +1 -0
  20. package/dist/chunks/{vite-DO70kZA6.js → vite-QoqrGl6f.js} +43 -43
  21. package/dist/chunks/vite-QoqrGl6f.js.map +1 -0
  22. package/dist/cli.d.ts +4 -2
  23. package/dist/cli.d.ts.map +1 -1
  24. package/dist/cli.js +224 -98
  25. package/dist/cli.js.map +1 -1
  26. package/dist/config/index.js +2 -2
  27. package/dist/config/types.d.ts +11 -1
  28. package/dist/config/types.d.ts.map +1 -1
  29. package/dist/edge/index.js +3 -3
  30. package/dist/index.d.ts +3 -3
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +161 -139
  33. package/dist/index.js.map +1 -1
  34. package/dist/inspect/command.d.ts +28 -0
  35. package/dist/inspect/command.d.ts.map +1 -0
  36. package/dist/inspect/index.d.ts +9 -0
  37. package/dist/inspect/index.d.ts.map +1 -0
  38. package/dist/inspect/redact.d.ts +35 -0
  39. package/dist/inspect/redact.d.ts.map +1 -0
  40. package/dist/inspect/report.d.ts +24 -0
  41. package/dist/inspect/report.d.ts.map +1 -0
  42. package/dist/inspect/types.d.ts +102 -0
  43. package/dist/inspect/types.d.ts.map +1 -0
  44. package/dist/internal/testing.js +12 -12
  45. package/dist/node/http.d.ts +5 -0
  46. package/dist/node/http.d.ts.map +1 -1
  47. package/dist/node/index.d.ts +1 -1
  48. package/dist/node/index.d.ts.map +1 -1
  49. package/dist/node/index.js +26 -24
  50. package/dist/node/index.js.map +1 -1
  51. package/dist/route/index.d.ts +1 -0
  52. package/dist/route/index.d.ts.map +1 -1
  53. package/dist/route/mutation.d.ts.map +1 -1
  54. package/dist/route/serialization.d.ts +24 -0
  55. package/dist/route/serialization.d.ts.map +1 -0
  56. package/dist/route/webhook.d.ts +6 -1
  57. package/dist/route/webhook.d.ts.map +1 -1
  58. package/dist/router/manifest.d.ts.map +1 -1
  59. package/dist/security/audit.d.ts +2 -1
  60. package/dist/security/audit.d.ts.map +1 -1
  61. package/dist/security/authorization.d.ts +36 -0
  62. package/dist/security/authorization.d.ts.map +1 -0
  63. package/dist/security/csrf.d.ts.map +1 -1
  64. package/dist/security/env-startup.d.ts +0 -2
  65. package/dist/security/env-startup.d.ts.map +1 -1
  66. package/dist/security/env.d.ts +27 -8
  67. package/dist/security/env.d.ts.map +1 -1
  68. package/dist/security/exceptions.d.ts +29 -0
  69. package/dist/security/exceptions.d.ts.map +1 -0
  70. package/dist/security/finding-codes.d.ts +56 -0
  71. package/dist/security/finding-codes.d.ts.map +1 -0
  72. package/dist/security/index.d.ts +5 -2
  73. package/dist/security/index.d.ts.map +1 -1
  74. package/dist/security/policy.d.ts +2 -5
  75. package/dist/security/policy.d.ts.map +1 -1
  76. package/dist/security/report.d.ts +2 -1
  77. package/dist/security/report.d.ts.map +1 -1
  78. package/dist/security/request.d.ts +1 -0
  79. package/dist/security/request.d.ts.map +1 -1
  80. package/dist/security/types.d.ts +138 -5
  81. package/dist/security/types.d.ts.map +1 -1
  82. package/dist/security/upload.d.ts +3 -3
  83. package/dist/security/upload.d.ts.map +1 -1
  84. package/dist/security/verification.d.ts.map +1 -1
  85. package/dist/server/request-handler.d.ts +3 -2
  86. package/dist/server/request-handler.d.ts.map +1 -1
  87. package/dist/server-only/browser.d.ts +2 -0
  88. package/dist/server-only/browser.d.ts.map +1 -0
  89. package/dist/server-only/browser.js +4 -0
  90. package/dist/server-only/browser.js.map +1 -0
  91. package/dist/server-only/index.d.ts +2 -0
  92. package/dist/server-only/index.d.ts.map +1 -0
  93. package/dist/server-only/index.js +2 -0
  94. package/dist/server-only/index.js.map +1 -0
  95. package/dist/static/index.js +4 -4
  96. package/dist/vite/index.d.ts +9 -4
  97. package/dist/vite/index.d.ts.map +1 -1
  98. package/dist/vite/index.js +28 -21
  99. package/dist/vite/plugin.d.ts +18 -2
  100. package/dist/vite/plugin.d.ts.map +1 -1
  101. package/dist/vite/policy-verification.d.ts +33 -2
  102. package/dist/vite/policy-verification.d.ts.map +1 -1
  103. package/dist/vite/route-audit.d.ts +14 -2
  104. package/dist/vite/route-audit.d.ts.map +1 -1
  105. package/dist/vite/server-only-boundary.d.ts +8 -0
  106. package/dist/vite/server-only-boundary.d.ts.map +1 -0
  107. package/package.json +6 -1
  108. package/dist/chunks/env-startup-DOBYWlZD.js +0 -257
  109. package/dist/chunks/env-startup-DOBYWlZD.js.map +0 -1
  110. package/dist/chunks/plugin-BQgMiHxa.js +0 -1827
  111. package/dist/chunks/plugin-BQgMiHxa.js.map +0 -1
  112. package/dist/chunks/streaming-BEbPN7Uk.js +0 -469
  113. package/dist/chunks/streaming-BEbPN7Uk.js.map +0 -1
  114. package/dist/chunks/testing-DueXbMo4.js +0 -4167
  115. package/dist/chunks/testing-DueXbMo4.js.map +0 -1
  116. package/dist/chunks/vite-DO70kZA6.js.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,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;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,23 +1,23 @@
1
- import { h as u, b as n, D as b, aM as i, w as _, q as r, aN as c, Q as R, P as d, p as h, aO as m, aP as p, aQ as P, aR as g, aS as f } from "../chunks/testing-DueXbMo4.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/index-BVk9zWbe.js";
3
+ import "../chunks/index-0MNiR_wo.js";
4
4
  import "react";
5
5
  import "react/jsx-runtime";
6
6
  export {
7
7
  u as handleRequestWithManifest,
8
- n as unstable_collectStaticRoutePaths,
9
- b as unstable_createRouteManifest,
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,
13
13
  c as unstable_isLayoutForPage,
14
- R as unstable_loadErrorFallback,
15
- d as unstable_loadLoadingFallback,
16
- h as unstable_loadPageRoute,
17
- m as unstable_loadRoute,
18
- p as unstable_matchSegments,
19
- P as unstable_scoreRoute,
20
- g as unstable_splitPathname,
21
- f as unstable_toRouteSegments
14
+ d as unstable_loadErrorFallback,
15
+ h as unstable_loadLoadingFallback,
16
+ m as unstable_loadPageRoute,
17
+ R as unstable_loadRoute,
18
+ g as unstable_matchSegments,
19
+ p as unstable_scoreRoute,
20
+ f as unstable_splitPathname,
21
+ F as unstable_toRouteSegments
22
22
  };
23
23
  //# sourceMappingURL=testing.js.map
@@ -5,6 +5,7 @@ export type NodeOriginPolicy = {
5
5
  trustProxy?: TrustProxy;
6
6
  };
7
7
  export type ToWebRequestOptions = NodeOriginPolicy & {
8
+ body?: BodyInit | null;
8
9
  signal?: AbortSignal;
9
10
  };
10
11
  export type TrustProxy = false | {
@@ -20,6 +21,10 @@ export declare class UntrustedHostError extends Error {
20
21
  host: string;
21
22
  constructor(host: string);
22
23
  }
24
+ export declare class ConsumedRequestBodyError extends Error {
25
+ method: string;
26
+ constructor(method: string);
27
+ }
23
28
  export declare function validateNodeOriginPolicy(policy: NodeOriginPolicy): void;
24
29
  export declare function toWebRequest(request: IncomingMessage, options: ToWebRequestOptions): Request;
25
30
  export declare function writeNotImplemented(serverResponse: ServerResponse): void;
@@ -1 +1 @@
1
- {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/node/http.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,mBAAmB,EACnB,eAAe,EACf,cAAc,EACf,MAAM,WAAW,CAAC;AAGnB,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC;AAE1C,MAAM,MAAM,gBAAgB,GAAG;IAC7B,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,gBAAgB,GAAG;IACnD,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,UAAU,GAClB,KAAK,GACL;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC;AAclC,qBAAa,sBAAuB,SAAQ,KAAK;IAC/C,MAAM,EAAE,MAAM,CAAC;gBAEH,MAAM,EAAE,MAAM;CAK3B;AAED,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,IAAI,EAAE,MAAM,CAAC;gBAED,IAAI,EAAE,MAAM;CAKzB;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,gBAAgB,QA+BhE;AAED,wBAAgB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,YAAY,CAC1B,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,mBAAmB,WAwE7B;AA4YD,wBAAgB,mBAAmB,CAAC,cAAc,EAAE,cAAc,QAIjE;AAED,wBAAsB,gBAAgB,CACpC,cAAc,EAAE,cAAc,EAC9B,WAAW,EAAE,QAAQ,iBAiDtB;AAsBD,wBAAgB,SAAS,CAAC,OAAO,EAAE,mBAAmB,WAiBrD"}
@@ -1,7 +1,7 @@
1
1
  import type { IncomingMessage, Server, ServerResponse } from "node:http";
2
2
  import type { RequestHandler } from "../server";
3
3
  import type { StaticFileHandler, StaticFileHandlerOptions } from "./static";
4
- export { UntrustedHostError, UnsupportedMethodError, toHeaders, toWebRequest, validateNodeOriginPolicy, writeWebResponse, } from "./http";
4
+ export { ConsumedRequestBodyError, UntrustedHostError, UnsupportedMethodError, toHeaders, toWebRequest, validateNodeOriginPolicy, writeWebResponse, } from "./http";
5
5
  export { createFontAssetHandler } from "./font";
6
6
  export type { FontAssetHandlerOptions } from "./font";
7
7
  export { createImageOptimizer } from "./image";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAGzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAUhD,OAAO,KAAK,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAE5E,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,SAAS,EACT,YAAY,EACZ,wBAAwB,EACxB,gBAAgB,GACjB,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,sBAAsB,EAAE,MAAM,QAAQ,CAAC;AAChD,YAAY,EAAE,uBAAuB,EAAE,MAAM,QAAQ,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,YAAY,EACV,mB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AAG,OAAO,GAAG,SAAS,CAAC;AAE/D,MAAM,MAAM,2BAA2B,GAAG;IACxC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IACjD,OAAO,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,0BAA0B,GAAG;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,2BAA2B,CAAC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG;IAChC,OAAO,EAAE,MAAM,OAAO,CAAC;IACvB,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,SAAS,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,yBAAyB;;;;CAIC,CAAC;AAIxC,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,0BAA0B,GAClC,mBAAmB,CAsDrB;AAoCD,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,iBAAiB,GACzB,UAAU,CA+BZ"}
@@ -1,14 +1,14 @@
1
1
  import { createServer as H } from "node:http";
2
- import { d as I } from "../chunks/index-BVk9zWbe.js";
3
- import { r as C, v as L, t as x, U as A, w as F, a as M, b as k } from "../chunks/streaming-BEbPN7Uk.js";
4
- import { c as _e, d as je, e as Be, f as ze } from "../chunks/streaming-BEbPN7Uk.js";
2
+ import { d as C } from "../chunks/index-0MNiR_wo.js";
3
+ import { r as I, v as L, t as x, U as A, w as F, a as M, b as k } from "../chunks/streaming-GYIsVTQH.js";
4
+ import { C as _e, c as je, d as Be, e as ze, f as qe } from "../chunks/streaming-GYIsVTQH.js";
5
5
  import { constants as S } from "node:fs";
6
6
  import { realpath as T, open as W, lstat as D, readFile as $ } from "node:fs/promises";
7
7
  import { resolve as P, sep as y, extname as U, relative as _, join as O } from "node:path";
8
- import { Readable as N } from "node:stream";
9
- import { I as j, R as B, i as z, c as G } from "../chunks/static-files-ehaD1kE7.js";
10
- import { fileURLToPath as V } from "node:url";
11
- import { p as q } from "../chunks/manifest-vO6c0G0W.js";
8
+ import { Readable as E } from "node:stream";
9
+ import { I as j, R as B, i as z, c as q } from "../chunks/static-files-ehaD1kE7.js";
10
+ import { fileURLToPath as G } from "node:url";
11
+ import { p as V } from "../chunks/manifest-vO6c0G0W.js";
12
12
  const Y = /* @__PURE__ */ new Set(["demiurge-manifest.json", "index.html"]);
13
13
  function J(e) {
14
14
  const t = P(e.root), n = T(t), r = ae(e.prefix), o = e.exclude ?? se, a = e.immutable ?? ie;
@@ -43,14 +43,14 @@ function J(e) {
43
43
  if (u) {
44
44
  const w = u.end - u.start + 1;
45
45
  return l.set("content-length", String(w)), l.set("content-range", `bytes ${u.start}-${u.end}/${i.size}`), c.method === "HEAD" ? (await h.close(), new Response(null, { headers: l, status: 206 })) : new Response(
46
- N.toWeb(
46
+ E.toWeb(
47
47
  h.createReadStream({ end: u.end, start: u.start })
48
48
  ),
49
49
  { headers: l, status: 206 }
50
50
  );
51
51
  }
52
52
  return c.method === "HEAD" ? (await h.close(), new Response(null, { headers: l })) : new Response(
53
- N.toWeb(h.createReadStream()),
53
+ E.toWeb(h.createReadStream()),
54
54
  { headers: l }
55
55
  );
56
56
  };
@@ -62,7 +62,7 @@ function Q(e, t, n) {
62
62
  const r = e.headers.get("if-none-match");
63
63
  if (r !== null)
64
64
  return r.trim() === "*" || r.split(",").some(
65
- (d) => E(d) === E(t)
65
+ (d) => N(d) === N(t)
66
66
  );
67
67
  const o = e.headers.get("if-modified-since");
68
68
  if (o === null)
@@ -70,7 +70,7 @@ function Q(e, t, n) {
70
70
  const a = Date.parse(o);
71
71
  return Number.isFinite(a) && Math.floor(n / 1e3) * 1e3 <= a;
72
72
  }
73
- function E(e) {
73
+ function N(e) {
74
74
  return e.trim().replace(/^W\//i, "");
75
75
  }
76
76
  function X(e, t) {
@@ -179,13 +179,13 @@ function le(e) {
179
179
  return e.slice(e.lastIndexOf(y) + 1);
180
180
  }
181
181
  function ue(e) {
182
- return G(U(e));
182
+ return q(U(e));
183
183
  }
184
184
  const de = "dist/client", fe = "/.well-known/ready";
185
185
  async function We(e) {
186
- const t = e.env ?? process.env, n = V(
186
+ const t = e.env ?? process.env, n = G(
187
187
  new URL(e.clientDir ?? de, e.base)
188
- ), r = q(
188
+ ), r = V(
189
189
  await $(O(n, "demiurge-manifest.json"), "utf8")
190
190
  ), o = e.host ?? t.HOST ?? "127.0.0.1", a = me(t.PORT, e.port), d = he(
191
191
  e.allowedHosts,
@@ -194,7 +194,7 @@ async function We(e) {
194
194
  ), c = e.name ?? "Demiurge Node server", m = e.readyPath === !1 ? void 0 : e.readyPath ?? fe, g = [], h = {
195
195
  page: {
196
196
  clientEntry: r.clientEntry,
197
- renderPage: C,
197
+ renderPage: I,
198
198
  styles: r.styles
199
199
  },
200
200
  root: n,
@@ -245,12 +245,13 @@ function ge(e, t) {
245
245
  );
246
246
  return n;
247
247
  }
248
- const De = I({
248
+ const De = C({
249
249
  name: "node",
250
250
  capabilities: {
251
251
  backgroundLifetime: !0,
252
252
  crossOriginIsolationHeaders: !0,
253
253
  nonceInjection: !0,
254
+ requestTimeoutEnforcement: !0,
254
255
  streaming: !0
255
256
  }
256
257
  }), we = {
@@ -310,7 +311,7 @@ function Re(e) {
310
311
  e.statusCode = 421, e.setHeader("content-type", "text/plain; charset=utf-8"), e.end("Misdirected Request");
311
312
  }
312
313
  function Se(e) {
313
- const t = Ee(e.timeouts), n = Ne(e.readyPath), r = n ? async (a) => {
314
+ const t = Ne(e.timeouts), n = Ee(e.readyPath), r = n ? async (a) => {
314
315
  if (new URL(a.url).pathname !== n)
315
316
  return e.handler(a);
316
317
  const d = o.isReady();
@@ -326,7 +327,7 @@ function Se(e) {
326
327
  );
327
328
  return o.keepAliveTimeout = t.keepAliveTimeout, o.headersTimeout = t.headersTimeout, o.requestTimeout = t.requestTimeout, Te(o, e.shutdown);
328
329
  }
329
- function Ne(e) {
330
+ function Ee(e) {
330
331
  if (e !== void 0) {
331
332
  if (!e.startsWith("/") || e.includes("?"))
332
333
  throw new Error(
@@ -335,7 +336,7 @@ function Ne(e) {
335
336
  return e;
336
337
  }
337
338
  }
338
- function Ee(e) {
339
+ function Ne(e) {
339
340
  const t = {
340
341
  ...we,
341
342
  ...e
@@ -439,10 +440,11 @@ function Oe(e) {
439
440
  e.statusCode = 500, e.setHeader("content-type", "text/plain; charset=utf-8"), e.end("Internal Server Error");
440
441
  }
441
442
  export {
443
+ _e as ConsumedRequestBodyError,
442
444
  A as UnsupportedMethodError,
443
445
  M as UntrustedHostError,
444
- _e as createFontAssetHandler,
445
- je as createImageOptimizer,
446
+ je as createFontAssetHandler,
447
+ Be as createImageOptimizer,
446
448
  pe as createNodeRequestListener,
447
449
  Se as createNodeServer,
448
450
  J as createStaticFileHandler,
@@ -450,10 +452,10 @@ export {
450
452
  fe as defaultNodeBuildReadyPath,
451
453
  we as defaultNodeServerTimeouts,
452
454
  De as nodeAdapter,
453
- C as renderNodePageResponse,
454
- Be as renderStreamingPageResponse,
455
+ I as renderNodePageResponse,
456
+ ze as renderStreamingPageResponse,
455
457
  We as serveNodeBuild,
456
- ze as toHeaders,
458
+ qe as toHeaders,
457
459
  x as toWebRequest,
458
460
  L as validateNodeOriginPolicy,
459
461
  k as writeWebResponse