@molecule/api-resource-status-page 1.0.2 → 1.0.4

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/index.d.ts CHANGED
@@ -5,6 +5,24 @@
5
5
  * updates, health-check history, and uptime windows. The read endpoints power
6
6
  * a public status page; the mutation endpoints are for operators.
7
7
  *
8
+ * **Tables this package owns: four.** `services` is the parent; `checks`, `incidents` and
9
+ * `uptimeWindows` each join to it on their own `serviceId` = `services.id` (a declared FK,
10
+ * `ON DELETE CASCADE`) — that `serviceId` is the column every per-service query filters on.
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
+ *
8
26
  * @e2e
9
27
  * Integration checklist — drive the real UI (live preview, no mocks), adapt
10
28
  * each item to this app's actual status-page screens/flows, and check every
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoFG;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
@@ -5,6 +5,24 @@
5
5
  * updates, health-check history, and uptime windows. The read endpoints power
6
6
  * a public status page; the mutation endpoints are for operators.
7
7
  *
8
+ * **Tables this package owns: four.** `services` is the parent; `checks`, `incidents` and
9
+ * `uptimeWindows` each join to it on their own `serviceId` = `services.id` (a declared FK,
10
+ * `ON DELETE CASCADE`) — that `serviceId` is the column every per-service query filters on.
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
+ *
8
26
  * @e2e
9
27
  * Integration checklist — drive the real UI (live preview, no mocks), adapt
10
28
  * each item to this app's actual status-page screens/flows, and check every
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoFG;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.2",
3
+ "version": "1.0.4",
4
4
  "description": "System status page resource for molecule.dev.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "devDependencies": {
35
35
  "@molecule/api-bond": "1.0.2",
36
- "@molecule/api-permissions": "1.0.2",
36
+ "@molecule/api-permissions": "1.0.3",
37
37
  "@types/node": "26.1.2",
38
38
  "typescript": "6.0.3",
39
39
  "vitest": "4.1.11",