@nifrajs/node 2.13.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -1
- package/dist/generated/bridge-markers.d.ts +11 -0
- package/dist/generated/bridge-markers.d.ts.map +1 -0
- package/dist/generated/bridge-markers.js +14 -0
- package/dist/generated/bridge-markers.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +394 -61
- package/dist/index.js.map +1 -1
- package/dist/node-stream.d.ts +60 -0
- package/dist/node-stream.d.ts.map +1 -0
- package/dist/node-stream.js +174 -0
- package/dist/node-stream.js.map +1 -0
- package/package.json +1 -1
- package/src/generated/bridge-markers.ts +14 -0
- package/src/index.ts +481 -69
- package/src/node-stream.ts +212 -0
package/README.md
CHANGED
|
@@ -51,7 +51,13 @@ authority. If neither option is set, treat the host in `request.url` as client-c
|
|
|
51
51
|
|
|
52
52
|
The optional `static` root is served before `app.fetch` for GET and HEAD requests. It is a
|
|
53
53
|
public asset directory and must contain nothing private: no secrets, source maps, build
|
|
54
|
-
metadata, or user uploads.
|
|
54
|
+
metadata, or user uploads. The directory and its ancestor path must be read-only and owned by
|
|
55
|
+
the service (or otherwise protected from untrusted local writers). Nifra resolves and confines
|
|
56
|
+
the file before opening it and refuses symlinked final files, but Node does not expose a native
|
|
57
|
+
per-component `openat` primitive; a process that can mutate the tree concurrently can still
|
|
58
|
+
create a local TOCTOU race. Mutable or attacker-writable static trees are therefore outside the
|
|
59
|
+
adapter's guarantee. Store user-controlled files outside the static root and serve them through
|
|
60
|
+
an application or object-storage path with its own validation policy.
|
|
55
61
|
|
|
56
62
|
## Graceful shutdown on signals
|
|
57
63
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const NODE_BRIDGE_MARKER_KEYS: {
|
|
2
|
+
/** A `Response` carrying its already-serialized bytes, so the Node writer emits them without a drain. */
|
|
3
|
+
readonly responseBody: "nifra.response.body";
|
|
4
|
+
/** A plain-data response-result carrier the node lane renders without building a `Response`. */
|
|
5
|
+
readonly responseResult: "nifra.response.result";
|
|
6
|
+
/** Proof that a header record's names are already the lowercase wire spelling. */
|
|
7
|
+
readonly lowercaseHeaderKeys: "nifra.headers.lowercase";
|
|
8
|
+
/** A mounted handler's node-direct resolver entry point. */
|
|
9
|
+
readonly resolveNodeMount: "@nifrajs/core/resolve-node-mount";
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=bridge-markers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge-markers.d.ts","sourceRoot":"","sources":["../../src/generated/bridge-markers.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,uBAAuB;IAClC,yGAAyG;;IAEzG,gGAAgG;;IAEhG,kFAAkF;;IAElF,4DAA4D;;CAEpD,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Generated by scripts/gen-node-outcome.ts - edit packages/core/src/server/bridge-markers.ts instead.
|
|
2
|
+
// The marker strings ARE the wire protocol; copied here so @nifrajs/node reads the identical keys
|
|
3
|
+
// without a runtime dependency on @nifrajs/core.
|
|
4
|
+
export const NODE_BRIDGE_MARKER_KEYS = {
|
|
5
|
+
/** A `Response` carrying its already-serialized bytes, so the Node writer emits them without a drain. */
|
|
6
|
+
responseBody: "nifra.response.body",
|
|
7
|
+
/** A plain-data response-result carrier the node lane renders without building a `Response`. */
|
|
8
|
+
responseResult: "nifra.response.result",
|
|
9
|
+
/** Proof that a header record's names are already the lowercase wire spelling. */
|
|
10
|
+
lowercaseHeaderKeys: "nifra.headers.lowercase",
|
|
11
|
+
/** A mounted handler's node-direct resolver entry point. */
|
|
12
|
+
resolveNodeMount: "@nifrajs/core/resolve-node-mount",
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=bridge-markers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge-markers.js","sourceRoot":"","sources":["../../src/generated/bridge-markers.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,kGAAkG;AAClG,iDAAiD;AAEjD,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,yGAAyG;IACzG,YAAY,EAAE,qBAAqB;IACnC,gGAAgG;IAChG,cAAc,EAAE,uBAAuB;IACvC,kFAAkF;IAClF,mBAAmB,EAAE,yBAAyB;IAC9C,4DAA4D;IAC5D,gBAAgB,EAAE,kCAAkC;CAC5C,CAAA"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA,OAAO,EAGL,KAAK,eAAe,EAErB,MAAM,WAAW,CAAA;AAUlB,sGAAsG;AACtG,UAAU,YAAY;IACpB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAC3B;AAED,6EAA6E;AAC7E,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,YAAY,GAAG,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAA;IAC9E;;kEAE8D;IAC9D,uBAAuB,CAAC,CAAC,OAAO,EAAE,OAAO,GAAG,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAA;CACzF;AAKD,4EAA4E;AAC5E,KAAK,WAAW,GAAG,MAAM,GAAG,UAAU,CAAA;AAEtC,uFAAuF;AACvF,UAAU,OAAO;IACf,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,WAAW,GAAG,IAAI,CAAA;IACxD,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,SAAS,CAAC,KA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