@molecule/api-resource-status-page 1.0.3 → 1.0.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.
package/README.md CHANGED
@@ -3,15 +3,11 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
3
3
  Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
4
4
  Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
5
5
  To change this document, edit the module-level JSDoc in src/index.ts.
6
- Generated: 2026-10-16T15:23:41.923Z
6
+ Generated: 2026-10-17T19:17:38.780Z
7
7
  -->
8
8
 
9
9
  # @molecule/api-resource-status-page
10
10
 
11
- > **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
12
- > It is written to be read by coding agents as much as by people, and is generated from this
13
- > package's source — edit `src/index.ts` JSDoc, not this file.
14
-
15
11
  Status page resource for molecule.dev.
16
12
 
17
13
  Public status-page backend: monitored services, incidents with lifecycle
@@ -22,6 +18,24 @@ a public status page; the mutation endpoints are for operators.
22
18
  `uptimeWindows` each join to it on their own `serviceId` = `services.id` (a declared FK,
23
19
  `ON DELETE CASCADE`) — that `serviceId` is the column every per-service query filters on.
24
20
 
21
+ **`handlers.*` return `{ statusCode, headers?, body }` and never write to `res`** — not through
22
+ `res.json`, not through `res.send`, not through `res.end`. The mounted routes apply that object
23
+ for you (`createRequestHandler` does `res.set(headers)`, `res.status(statusCode)`,
24
+ `res.send(body)`); calling a handler directly is only correct if you apply the result yourself:
25
+
26
+ ```typescript
27
+ const { statusCode, headers, body } = await handlers.getStatus(resource)(req, res)
28
+ if (headers) res.set(headers)
29
+ res.status(statusCode).send(body)
30
+ ```
31
+
32
+ Monkey-patching `res.json` to re-shape a handler's answer intercepts nothing the handler
33
+ produces, so the request it was meant to answer is left unanswered and hangs.
34
+
35
+ > **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
36
+ > It is written to be read by coding agents as much as by people, and is generated from this
37
+ > package's source — edit `src/index.ts` JSDoc, not this file.
38
+
25
39
  ## Quick Start
26
40
 
27
41
  ```typescript
@@ -929,7 +943,7 @@ deface the public status page (fabricate outages, delete services).
929
943
  Handler text flows through `t()` with English defaults; the companion
930
944
  locale bond `@molecule/api-locales-status-page` provides translations.
931
945
 
932
- Tables: `setup/*.sql` creates `services`, `incidents`, `checks`, and
946
+ Tables: `src/__setup__/*.sql` creates `services`, `incidents`, `checks`, and
933
947
  `uptimeWindows`. An mlcl-scaffolded API replays these setup files
934
948
  automatically on migrate; anywhere else run them once — nothing at runtime
935
949
  creates them.
package/dist/index.d.ts CHANGED
@@ -9,6 +9,20 @@
9
9
  * `uptimeWindows` each join to it on their own `serviceId` = `services.id` (a declared FK,
10
10
  * `ON DELETE CASCADE`) — that `serviceId` is the column every per-service query filters on.
11
11
  *
12
+ * **`handlers.*` return `{ statusCode, headers?, body }` and never write to `res`** — not through
13
+ * `res.json`, not through `res.send`, not through `res.end`. The mounted routes apply that object
14
+ * for you (`createRequestHandler` does `res.set(headers)`, `res.status(statusCode)`,
15
+ * `res.send(body)`); calling a handler directly is only correct if you apply the result yourself:
16
+ *
17
+ * ```typescript
18
+ * const { statusCode, headers, body } = await handlers.getStatus(resource)(req, res)
19
+ * if (headers) res.set(headers)
20
+ * res.status(statusCode).send(body)
21
+ * ```
22
+ *
23
+ * Monkey-patching `res.json` to re-shape a handler's answer intercepts nothing the handler
24
+ * produces, so the request it was meant to answer is left unanswered and hangs.
25
+ *
12
26
  * @e2e
13
27
  * Integration checklist — drive the real UI (live preview, no mocks), adapt
14
28
  * each item to this app's actual status-page screens/flows, and check every
@@ -82,7 +96,7 @@
82
96
  * Handler text flows through `t()` with English defaults; the companion
83
97
  * locale bond `@molecule/api-locales-status-page` provides translations.
84
98
  *
85
- * Tables: `setup/*.sql` creates `services`, `incidents`, `checks`, and
99
+ * Tables: `src/__setup__/*.sql` creates `services`, `incidents`, `checks`, and
86
100
  * `uptimeWindows`. An mlcl-scaffolded API replays these setup files
87
101
  * automatically on migrate; anywhere else run them once — nothing at runtime
88
102
  * creates them.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwFG;AAEH,cAAc,wBAAwB,CAAA;AACtC,cAAc,oBAAoB,CAAA;AAClC,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAA;AAC/C,cAAc,WAAW,CAAA;AACzB,cAAc,wBAAwB,CAAA;AACtC,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsGG;AAEH,cAAc,wBAAwB,CAAA;AACtC,cAAc,oBAAoB,CAAA;AAClC,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAA;AAC/C,cAAc,WAAW,CAAA;AACzB,cAAc,wBAAwB,CAAA;AACtC,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA"}
package/dist/index.js CHANGED
@@ -9,6 +9,20 @@
9
9
  * `uptimeWindows` each join to it on their own `serviceId` = `services.id` (a declared FK,
10
10
  * `ON DELETE CASCADE`) — that `serviceId` is the column every per-service query filters on.
11
11
  *
12
+ * **`handlers.*` return `{ statusCode, headers?, body }` and never write to `res`** — not through
13
+ * `res.json`, not through `res.send`, not through `res.end`. The mounted routes apply that object
14
+ * for you (`createRequestHandler` does `res.set(headers)`, `res.status(statusCode)`,
15
+ * `res.send(body)`); calling a handler directly is only correct if you apply the result yourself:
16
+ *
17
+ * ```typescript
18
+ * const { statusCode, headers, body } = await handlers.getStatus(resource)(req, res)
19
+ * if (headers) res.set(headers)
20
+ * res.status(statusCode).send(body)
21
+ * ```
22
+ *
23
+ * Monkey-patching `res.json` to re-shape a handler's answer intercepts nothing the handler
24
+ * produces, so the request it was meant to answer is left unanswered and hangs.
25
+ *
12
26
  * @e2e
13
27
  * Integration checklist — drive the real UI (live preview, no mocks), adapt
14
28
  * each item to this app's actual status-page screens/flows, and check every
@@ -82,7 +96,7 @@
82
96
  * Handler text flows through `t()` with English defaults; the companion
83
97
  * locale bond `@molecule/api-locales-status-page` provides translations.
84
98
  *
85
- * Tables: `setup/*.sql` creates `services`, `incidents`, `checks`, and
99
+ * Tables: `src/__setup__/*.sql` creates `services`, `incidents`, `checks`, and
86
100
  * `uptimeWindows`. An mlcl-scaffolded API replays these setup files
87
101
  * automatically on migrate; anywhere else run them once — nothing at runtime
88
102
  * creates them.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwFG;AAEH,cAAc,wBAAwB,CAAA;AACtC,cAAc,oBAAoB,CAAA;AAClC,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAA;AAC/C,cAAc,WAAW,CAAA;AACzB,cAAc,wBAAwB,CAAA;AACtC,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsGG;AAEH,cAAc,wBAAwB,CAAA;AACtC,cAAc,oBAAoB,CAAA;AAClC,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAA;AAC/C,cAAc,WAAW,CAAA;AACzB,cAAc,wBAAwB,CAAA;AACtC,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molecule/api-resource-status-page",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "System status page resource for molecule.dev.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "files": [
20
20
  "dist",
21
- "setup",
21
+ "src/__setup__",
22
22
  "README.md"
23
23
  ],
24
24
  "keywords": [
File without changes
File without changes
File without changes
File without changes