@selvajs/server 1.3.0 → 1.3.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.
package/dist/api/deps.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Handlers used to reach module-global getters (`getProjectProvider()`,
|
|
5
5
|
* `getDefinitionService()`, …) from the Selva app's composition root — 77 call
|
|
6
6
|
* sites across the v1 routes. That welded them to one app's boot: a second app
|
|
7
|
-
* on a different provider set
|
|
7
|
+
* on a different provider set could not call them at all.
|
|
8
8
|
*
|
|
9
9
|
* Most fields are sub-stores of `IDataProvider`, so a host that already built a
|
|
10
10
|
* `SelvaConfig` gets them via `depsFromConfig`. `services` stays host-defined:
|
package/dist/api/deps.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Handlers used to reach module-global getters (`getProjectProvider()`,
|
|
5
5
|
* `getDefinitionService()`, …) from the Selva app's composition root — 77 call
|
|
6
6
|
* sites across the v1 routes. That welded them to one app's boot: a second app
|
|
7
|
-
* on a different provider set
|
|
7
|
+
* on a different provider set could not call them at all.
|
|
8
8
|
*
|
|
9
9
|
* Most fields are sub-stores of `IDataProvider`, so a host that already built a
|
|
10
10
|
* `SelvaConfig` gets them via `depsFromConfig`. `services` stays host-defined:
|
|
@@ -32,6 +32,10 @@ export declare function resolveRequestId(headers: Headers, generate?: () => stri
|
|
|
32
32
|
* `[object Object]` and destroy the only record of the failure. Errors keep
|
|
33
33
|
* their stack; anything else is JSON-serialized, with `String()` as the last
|
|
34
34
|
* resort for cycles and exotic values.
|
|
35
|
+
*
|
|
36
|
+
* A `code` / `statusCode` carried on the error (ComputeError, ProviderError,
|
|
37
|
+
* Node's ECONNREFUSED-style errors) is appended as a `[code=… status=…]` tag —
|
|
38
|
+
* it classifies the failure and stacks alone don't show it.
|
|
35
39
|
*/
|
|
36
40
|
export declare function renderThrown(error: unknown): string;
|
|
37
41
|
//# sourceMappingURL=requestId.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestId.d.ts","sourceRoot":"","sources":["../../src/logging/requestId.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,kFAAkF;AAClF,eAAO,MAAM,iBAAiB,iBAAiB,CAAC;AAahD,oFAAoF;AACpF,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAI/E;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,GAAE,MAAM,MAAiB,GAAG,MAAM,CAE5F;AAED
|
|
1
|
+
{"version":3,"file":"requestId.d.ts","sourceRoot":"","sources":["../../src/logging/requestId.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,kFAAkF;AAClF,eAAO,MAAM,iBAAiB,iBAAiB,CAAC;AAahD,oFAAoF;AACpF,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAI/E;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,GAAE,MAAM,MAAiB,GAAG,MAAM,CAE5F;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAenD"}
|
|
@@ -48,10 +48,23 @@ export function resolveRequestId(headers, generate = randomId) {
|
|
|
48
48
|
* `[object Object]` and destroy the only record of the failure. Errors keep
|
|
49
49
|
* their stack; anything else is JSON-serialized, with `String()` as the last
|
|
50
50
|
* resort for cycles and exotic values.
|
|
51
|
+
*
|
|
52
|
+
* A `code` / `statusCode` carried on the error (ComputeError, ProviderError,
|
|
53
|
+
* Node's ECONNREFUSED-style errors) is appended as a `[code=… status=…]` tag —
|
|
54
|
+
* it classifies the failure and stacks alone don't show it.
|
|
51
55
|
*/
|
|
52
56
|
export function renderThrown(error) {
|
|
53
|
-
if (error instanceof Error)
|
|
54
|
-
|
|
57
|
+
if (error instanceof Error) {
|
|
58
|
+
const base = error.stack ?? error.message;
|
|
59
|
+
const code = error.code;
|
|
60
|
+
const statusCode = error.statusCode;
|
|
61
|
+
const tags = [];
|
|
62
|
+
if (typeof code === 'string' || typeof code === 'number')
|
|
63
|
+
tags.push(`code=${code}`);
|
|
64
|
+
if (typeof statusCode === 'number')
|
|
65
|
+
tags.push(`status=${statusCode}`);
|
|
66
|
+
return tags.length > 0 ? `${base} [${tags.join(' ')}]` : base;
|
|
67
|
+
}
|
|
55
68
|
try {
|
|
56
69
|
return JSON.stringify(error) ?? String(error);
|
|
57
70
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestId.js","sourceRoot":"","sources":["../../src/logging/requestId.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,kFAAkF;AAClF,MAAM,CAAC,MAAM,iBAAiB,GAAG,cAAc,CAAC;AAEhD,gFAAgF;AAChF,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAElC;;;;;GAKG;AACH,MAAM,uBAAuB,GAAG,mBAAmB,CAAC;AAEpD,oFAAoF;AACpF,MAAM,UAAU,iBAAiB,CAAC,GAA8B;IAC/D,IAAI,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;IACtB,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,uBAAuB,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,qBAAqB,CAAC,CAAC;IACzF,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;AAC5C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAgB,EAAE,WAAyB,QAAQ;IACnF,OAAO,iBAAiB,CAAC,OAAO,CAAC,GAAG,CAAC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AI,KAAK,QAAQ;YAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;QACpF,IAAI,OAAO,UAAU,KAAK,QAAQ;YAAE,IAAI,CAAC,IAAI,CAAC,UAAU,UAAU,EAAE,CAAC,CAAC;QACtE,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;IAC/D,CAAC;IACD,IAAI,CAAC;QACJ,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;AACF,CAAC;AAED;;;;;GAKG;AACH,SAAS,QAAQ;IAChB,MAAM,CAAC,GAAuB,UAAU,CAAC,MAAM,CAAC;IAChD,IAAI,CAAC,IAAI,OAAO,CAAC,CAAC,UAAU,KAAK,UAAU;QAAE,OAAO,CAAC,CAAC,UAAU,EAAE,CAAC;IACnE,OAAO,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;AACpF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@selvajs/server",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "Transport-agnostic server building blocks for apps built on the Selva engine (limits, rate limiting, SSRF guard, remote-definition fetch, definition service + render loader); the solve core lives in @selvajs/solve/server",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "VektorNode",
|
|
@@ -110,10 +110,10 @@
|
|
|
110
110
|
],
|
|
111
111
|
"dependencies": {
|
|
112
112
|
"zod": "^4.3.6",
|
|
113
|
-
"@selvajs/compute": "^4.0.2",
|
|
114
|
-
"@selvajs/notifications": "^0.2.0",
|
|
115
113
|
"@selvajs/platform": "^0.20.0",
|
|
116
|
-
"@selvajs/
|
|
114
|
+
"@selvajs/notifications": "^0.2.0",
|
|
115
|
+
"@selvajs/schemas": "^5.0.1",
|
|
116
|
+
"@selvajs/compute": "^4.0.3"
|
|
117
117
|
},
|
|
118
118
|
"peerDependencies": {
|
|
119
119
|
"@sentry/node": ">=8",
|