@haverstack/server 0.10.0 → 0.10.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/lib/json.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { AppEnv } from '../types.js';
|
|
|
4
4
|
* `c.req.json()` throws a bare `SyntaxError` on malformed input, which isn't
|
|
5
5
|
* a `StackError` — left uncaught it falls through errorMiddleware's
|
|
6
6
|
* catch-all as an unlabeled 500 instead of the 400 `bad_request` every other
|
|
7
|
-
* structurally-invalid request gets (docs/spec/wire-format.md §
|
|
7
|
+
* structurally-invalid request gets (docs/spec/wire-format.md § Error responses).
|
|
8
8
|
*/
|
|
9
9
|
export declare function readJson<T = unknown>(c: Context<AppEnv>): Promise<T>;
|
|
10
10
|
//# sourceMappingURL=json.d.ts.map
|
package/dist/lib/json.js
CHANGED
|
@@ -3,7 +3,7 @@ import { StackQueryError } from '@haverstack/core';
|
|
|
3
3
|
* `c.req.json()` throws a bare `SyntaxError` on malformed input, which isn't
|
|
4
4
|
* a `StackError` — left uncaught it falls through errorMiddleware's
|
|
5
5
|
* catch-all as an unlabeled 500 instead of the 400 `bad_request` every other
|
|
6
|
-
* structurally-invalid request gets (docs/spec/wire-format.md §
|
|
6
|
+
* structurally-invalid request gets (docs/spec/wire-format.md § Error responses).
|
|
7
7
|
*/
|
|
8
8
|
export async function readJson(c) {
|
|
9
9
|
let parsed;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/middleware/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAEzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,EAA4C,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACxF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAG1C;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,YAAY,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/middleware/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAEzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,EAA4C,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACxF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAG1C;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,YAAY,CAAC,MAAM,CAAC,CAuDlF"}
|
|
@@ -27,11 +27,12 @@ export function errorMiddleware(logger, stack) {
|
|
|
27
27
|
}, 'Denied a verified requester');
|
|
28
28
|
}
|
|
29
29
|
// On the wire a refused record is indistinguishable from a missing
|
|
30
|
-
// one (docs/spec/
|
|
31
|
-
//
|
|
32
|
-
//
|
|
33
|
-
//
|
|
34
|
-
// stay out of a
|
|
30
|
+
// one (docs/spec/disclosure.md), but the operator is not the
|
|
31
|
+
// adversary, and docs/spec/wire-format.md § Server implementation
|
|
32
|
+
// checklist asks for the distinction: an unscoped probe, on a path
|
|
33
|
+
// already failing, recovers it for the log alone. Debug rather than
|
|
34
|
+
// warn — this is the sharing graph, which the spec asks stay out of a
|
|
35
|
+
// general-purpose aggregator by default.
|
|
35
36
|
if (err instanceof StackNotFoundError && auth) {
|
|
36
37
|
const recordId = c.req.param('id');
|
|
37
38
|
if (recordId) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/middleware/errors.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAc,MAAM,kB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,EAAE,SAAS,EAAE,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,EAAE,yBAAyB,CAAC,CAAC;QAChF,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,uBAAuB,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC;IACxF,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/routes/changes.js
CHANGED
|
@@ -47,7 +47,7 @@ export function changeRoutes(ctx, config, logger, opts = {}) {
|
|
|
47
47
|
return auth ? ctx.stack.forSession(auth) : ctx.stack.asEntity(null);
|
|
48
48
|
}
|
|
49
49
|
// Single-process only: events exist only in the process owning the
|
|
50
|
-
// stack's storage (docs/spec/
|
|
50
|
+
// stack's storage (docs/spec/change-feed.md § Feed implementation
|
|
51
51
|
// checklist), and query workers only read. A second process subscribing
|
|
52
52
|
// to its own Stack over the same storage would see nothing and look fine
|
|
53
53
|
// in testing — worth knowing before scaling this horizontally.
|