@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.
@@ -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 § 400 vs 422).
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 § 400 vs 422).
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,CAsDlF"}
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/wire-format.md § Server implementation checklist),
31
- // but the operator is not the adversary: an unscoped probe, on a path
32
- // already failing, recovers the distinction for the log alone. Debug
33
- // rather than warn — this is the sharing graph, which the spec asks
34
- // stay out of a general-purpose aggregator by default.
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,kBAAkB,CAAC;AAExF,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,eAAe,CAAC,MAAc,EAAE,KAAY;IAC1D,OAAO,KAAK,EAAE,GAAG,EAAE,CAA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,OAAO,EAAE,uBAAuB,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC;IACxF,CAAC,CAAC;AACJ,CAAC"}
@@ -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/wire-format.md § Feed implementation
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haverstack/server",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "Reference server implementation for Haverstack",
5
5
  "type": "module",
6
6
  "engines": {