@marinoscar/platform-contract 0.0.0-stage → 0.1.0-next.3
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/CHANGELOG.md +33 -0
- package/LICENSE +21 -0
- package/README.md +145 -2
- package/dist/cjs/doctor/constants.d.ts +59 -0
- package/dist/cjs/doctor/constants.d.ts.map +1 -0
- package/dist/cjs/doctor/constants.js +57 -0
- package/dist/cjs/doctor/constants.js.map +1 -0
- package/dist/cjs/doctor/index.d.ts +5 -0
- package/dist/cjs/doctor/index.d.ts.map +1 -0
- package/dist/cjs/doctor/index.js +24 -0
- package/dist/cjs/doctor/index.js.map +1 -0
- package/dist/cjs/doctor/schemas.d.ts +186 -0
- package/dist/cjs/doctor/schemas.d.ts.map +1 -0
- package/dist/cjs/doctor/schemas.js +183 -0
- package/dist/cjs/doctor/schemas.js.map +1 -0
- package/dist/cjs/index.d.ts +13 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +16 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/telemetry/assistant.d.ts +173 -0
- package/dist/cjs/telemetry/assistant.d.ts.map +1 -0
- package/dist/cjs/telemetry/assistant.js +43 -0
- package/dist/cjs/telemetry/assistant.js.map +1 -0
- package/dist/cjs/telemetry/config.d.ts +92 -0
- package/dist/cjs/telemetry/config.d.ts.map +1 -0
- package/dist/cjs/telemetry/config.js +101 -0
- package/dist/cjs/telemetry/config.js.map +1 -0
- package/dist/cjs/telemetry/connection.d.ts +355 -0
- package/dist/cjs/telemetry/connection.d.ts.map +1 -0
- package/dist/cjs/telemetry/connection.js +451 -0
- package/dist/cjs/telemetry/connection.js.map +1 -0
- package/dist/cjs/telemetry/constants.d.ts +442 -0
- package/dist/cjs/telemetry/constants.d.ts.map +1 -0
- package/dist/cjs/telemetry/constants.js +400 -0
- package/dist/cjs/telemetry/constants.js.map +1 -0
- package/dist/cjs/telemetry/dashboard.d.ts +826 -0
- package/dist/cjs/telemetry/dashboard.d.ts.map +1 -0
- package/dist/cjs/telemetry/dashboard.js +697 -0
- package/dist/cjs/telemetry/dashboard.js.map +1 -0
- package/dist/cjs/telemetry/enum.d.ts +5 -0
- package/dist/cjs/telemetry/enum.d.ts.map +1 -0
- package/dist/cjs/telemetry/enum.js +12 -0
- package/dist/cjs/telemetry/enum.js.map +1 -0
- package/dist/cjs/telemetry/index.d.ts +5 -0
- package/dist/cjs/telemetry/index.d.ts.map +1 -0
- package/dist/cjs/telemetry/index.js +128 -0
- package/dist/cjs/telemetry/index.js.map +1 -0
- package/dist/cjs/telemetry/query.d.ts +147 -0
- package/dist/cjs/telemetry/query.d.ts.map +1 -0
- package/dist/cjs/telemetry/query.js +141 -0
- package/dist/cjs/telemetry/query.js.map +1 -0
- package/dist/cjs/telemetry/schemas.d.ts +17 -0
- package/dist/cjs/telemetry/schemas.d.ts.map +1 -0
- package/dist/cjs/telemetry/schemas.js +89 -0
- package/dist/cjs/telemetry/schemas.js.map +1 -0
- package/dist/cjs/telemetry/settings.d.ts +65 -0
- package/dist/cjs/telemetry/settings.d.ts.map +1 -0
- package/dist/cjs/telemetry/settings.js +77 -0
- package/dist/cjs/telemetry/settings.js.map +1 -0
- package/dist/cjs/telemetry/stack.d.ts +87 -0
- package/dist/cjs/telemetry/stack.d.ts.map +1 -0
- package/dist/cjs/telemetry/stack.js +93 -0
- package/dist/cjs/telemetry/stack.js.map +1 -0
- package/dist/cjs/telemetry/status.d.ts +65 -0
- package/dist/cjs/telemetry/status.d.ts.map +1 -0
- package/dist/cjs/telemetry/status.js +65 -0
- package/dist/cjs/telemetry/status.js.map +1 -0
- package/dist/esm/doctor/constants.d.ts +59 -0
- package/dist/esm/doctor/constants.d.ts.map +1 -0
- package/dist/esm/doctor/constants.js +54 -0
- package/dist/esm/doctor/constants.js.map +1 -0
- package/dist/esm/doctor/index.d.ts +5 -0
- package/dist/esm/doctor/index.d.ts.map +1 -0
- package/dist/esm/doctor/index.js +10 -0
- package/dist/esm/doctor/index.js.map +1 -0
- package/dist/esm/doctor/schemas.d.ts +186 -0
- package/dist/esm/doctor/schemas.d.ts.map +1 -0
- package/dist/esm/doctor/schemas.js +180 -0
- package/dist/esm/doctor/schemas.js.map +1 -0
- package/dist/esm/index.d.ts +13 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +13 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/telemetry/assistant.d.ts +173 -0
- package/dist/esm/telemetry/assistant.d.ts.map +1 -0
- package/dist/esm/telemetry/assistant.js +40 -0
- package/dist/esm/telemetry/assistant.js.map +1 -0
- package/dist/esm/telemetry/config.d.ts +92 -0
- package/dist/esm/telemetry/config.d.ts.map +1 -0
- package/dist/esm/telemetry/config.js +98 -0
- package/dist/esm/telemetry/config.js.map +1 -0
- package/dist/esm/telemetry/connection.d.ts +355 -0
- package/dist/esm/telemetry/connection.d.ts.map +1 -0
- package/dist/esm/telemetry/connection.js +447 -0
- package/dist/esm/telemetry/connection.js.map +1 -0
- package/dist/esm/telemetry/constants.d.ts +442 -0
- package/dist/esm/telemetry/constants.d.ts.map +1 -0
- package/dist/esm/telemetry/constants.js +397 -0
- package/dist/esm/telemetry/constants.js.map +1 -0
- package/dist/esm/telemetry/dashboard.d.ts +826 -0
- package/dist/esm/telemetry/dashboard.d.ts.map +1 -0
- package/dist/esm/telemetry/dashboard.js +690 -0
- package/dist/esm/telemetry/dashboard.js.map +1 -0
- package/dist/esm/telemetry/enum.d.ts +5 -0
- package/dist/esm/telemetry/enum.d.ts.map +1 -0
- package/dist/esm/telemetry/enum.js +9 -0
- package/dist/esm/telemetry/enum.js.map +1 -0
- package/dist/esm/telemetry/index.d.ts +5 -0
- package/dist/esm/telemetry/index.d.ts.map +1 -0
- package/dist/esm/telemetry/index.js +10 -0
- package/dist/esm/telemetry/index.js.map +1 -0
- package/dist/esm/telemetry/query.d.ts +147 -0
- package/dist/esm/telemetry/query.d.ts.map +1 -0
- package/dist/esm/telemetry/query.js +138 -0
- package/dist/esm/telemetry/query.js.map +1 -0
- package/dist/esm/telemetry/schemas.d.ts +17 -0
- package/dist/esm/telemetry/schemas.d.ts.map +1 -0
- package/dist/esm/telemetry/schemas.js +12 -0
- package/dist/esm/telemetry/schemas.js.map +1 -0
- package/dist/esm/telemetry/settings.d.ts +65 -0
- package/dist/esm/telemetry/settings.d.ts.map +1 -0
- package/dist/esm/telemetry/settings.js +74 -0
- package/dist/esm/telemetry/settings.js.map +1 -0
- package/dist/esm/telemetry/stack.d.ts +87 -0
- package/dist/esm/telemetry/stack.d.ts.map +1 -0
- package/dist/esm/telemetry/stack.js +90 -0
- package/dist/esm/telemetry/stack.js.map +1 -0
- package/dist/esm/telemetry/status.d.ts +65 -0
- package/dist/esm/telemetry/status.d.ts.map +1 -0
- package/dist/esm/telemetry/status.js +62 -0
- package/dist/esm/telemetry/status.js.map +1 -0
- package/package.json +78 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# @marinoscar/platform-contract
|
|
2
|
+
|
|
3
|
+
## 0.1.0-next.3
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 738d71c: Add `@marinoscar/platform-contract/telemetry` (#702): the telemetry wire shapes (config, status, explorer, connection, stack, dashboard, assistant) and the `telemetry` settings namespace as zod schemas with their inferred types, plus the zod-free limits and enums they are built from, the `/metrics` schema builders for a server with its own metric-group registry, and the settings and connection no-secret proofs. Moved from the reference app's API DTOs and web mirrors without changing a field, a limit or a rule; the generated OpenAPI document is byte-identical.
|
|
8
|
+
- 55a3402: Add the support bundle: `@marinoscar/platform-contract/doctor` (`supportBundleSchema`), `GET <doctor path>/support-bundle` with `SupportBundleRegistry`, `SupportBundleService`, redaction rules v1 and the built-in `meta`, `doctor` and `egress` sections in `@marinoscar/platform-api/doctor`, and the "Download support bundle" button and `useSupportBundleDownload` hook in `@marinoscar/platform-web/doctor` (plus the optional `PlatformApiClient.getBlob`).
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- bd9ad6f: Add the telemetry slice (`@marinoscar/platform-web/telemetry/headless`, `/telemetry/ui` and a subpath per page): the telemetry settings page, explorer and dashboard with their client, hooks, config provider, route guard, `TelemetryWebAdapters`, `telemetryAdminCards` and the `withTelemetryTokens` theme-token contract. `PlatformApiClient` gains optional request options (`signal`, `ifMatch`), `postBlob` and `postSse`, and `PlatformApiError` an optional `details`; the test host answers all of them. The contract's telemetry README points at the web client's new home.
|
|
13
|
+
|
|
14
|
+
## 0.1.0-next.2
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- fd29180: Add `@marinoscar/platform-contract/doctor`, the first contract slice (#701): the Doctor's report, row, status and query schemas, their types and the zod-free status constants. `platform-api`'s Doctor DTOs now wrap these schemas and `platform-web`'s Doctor takes its types from them; both re-export the old names (`DOCTOR_STATUS_ORDER` and `DoctorReportQuery` in `platform-web` are deprecated aliases). No wire or OpenAPI change. Sets the contract conventions (slice layout, zod-free constants, import rules, `schema` catalog kind).
|
|
19
|
+
|
|
20
|
+
## 0.1.0-next.1
|
|
21
|
+
|
|
22
|
+
## 0.1.0-next.0
|
|
23
|
+
|
|
24
|
+
### Minor Changes
|
|
25
|
+
|
|
26
|
+
- a66fef1: First pre-release of the platform packages: the six-package scaffold (build formats, boundary lint, pack check, TSDoc and generated API reference, single-instance peer dependencies) plus the first slices.
|
|
27
|
+
|
|
28
|
+
- `@marinoscar/platform-api/core`: the typed registry primitive (`defineRegistry`, `Registry`, `RegistryError`, `RegistryFreezeService`, `withTemporaryEntries`).
|
|
29
|
+
- `@marinoscar/platform-api/testing`: the conformance harness (`runPlatformConformance`, `conformanceSuites`) with the `cron-enqueue-only` suite.
|
|
30
|
+
- `@marinoscar/platform-cli/core`: the CLI command and env-spec fragment registries.
|
|
31
|
+
- `@marinoscar/platform-cli/telemetry`: the node span relay and the telemetry env-spec fragment.
|
|
32
|
+
- `@marinoscar/platform-infra`: `infraFile()`, the `platform-infra` command (`sync` materialises fragments into an app) and the `telemetry` slice (collector and GreptimeDB compose fragments, collector config and overlay, typed manifest).
|
|
33
|
+
- `@marinoscar/platform-contract`, `@marinoscar/platform-web` and `@marinoscar/platform-db` ship their package scaffold only; their slices follow in later releases.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 marinoscar
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,146 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @marinoscar/platform-contract
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Zod schemas, DTOs and TypeScript types shared by `@marinoscar/platform-api` and `@marinoscar/platform-web`, so the server and the browser validate and type the same shapes. It is the only dual-format package: it ships CommonJS (for the API, which is CommonJS) and ESM (for the web app and the CLI) from one source, selected by the `exports` map.
|
|
4
|
+
|
|
5
|
+
## Purpose and scope
|
|
6
|
+
|
|
7
|
+
The request and response shapes of every platform slice, as zod schemas plus the inferred types and plain constants. It holds no runtime behaviour beyond validation: no NestJS, no React, no I/O. The API wraps the schemas as its nestjs-zod DTOs (so the OpenAPI document is generated from them); the web app imports their types and constants. Nothing is described twice by hand.
|
|
8
|
+
|
|
9
|
+
Slices (each a subpath export with its own README):
|
|
10
|
+
|
|
11
|
+
| Subpath | What | README |
|
|
12
|
+
|---|---|---|
|
|
13
|
+
| `@marinoscar/platform-contract/doctor` | The admin Doctor's report, row, status and query (#701), and the support bundle envelope (#772) | [src/doctor/README.md](src/doctor/README.md) |
|
|
14
|
+
| `@marinoscar/platform-contract/telemetry` | Telemetry wire shapes, `stable`: config, status, explorer, connection, stack, dashboard, assistant and the `telemetry` settings namespace (#702) | [src/telemetry/README.md](src/telemetry/README.md) |
|
|
15
|
+
|
|
16
|
+
The root entry exports only `PLATFORM_PACKAGE`; schemas are reached through their slice's subpath, so a consumer loads only the slices it uses.
|
|
17
|
+
|
|
18
|
+
### Conventions
|
|
19
|
+
|
|
20
|
+
Every slice follows these rules. The mechanical ones are enforced.
|
|
21
|
+
|
|
22
|
+
| Rule | Enforced by |
|
|
23
|
+
|---|---|
|
|
24
|
+
| One directory per slice, `src/<slice>/{schemas.ts,constants.ts,index.ts}` plus its `README.md`; subpath export `./<slice>` with an `import` and a `require` condition, each with its own `types` | `test/no-zod-in-constants.test.ts` (layout), `test/dual-format.test.ts` (exports map, both halves load with the same keys), `packages/platform-api/test/slice-graph.spec.ts` (the slice is in `packages/platform-slices.json`), the pack check |
|
|
25
|
+
| `schemas.ts` holds zod schemas named `<thing>Schema` (camelCase) and the inferred types `export type <Thing> = z.infer<typeof <thing>Schema>` (`z.output` where a transform applies) | review, TSDoc catalog |
|
|
26
|
+
| `constants.ts` holds plain readonly values and string-literal unions and never imports zod (nor `schemas.ts`), so a browser that needs only a constant or a type never bundles zod | `test/no-zod-in-constants.test.ts` |
|
|
27
|
+
| `src/` imports zod and its own files only: no `@nestjs/*`, `nestjs-zod`, `react`, `@mui/*`, Node built-in, or other platform package | `no-restricted-imports` block for `packages/platform-contract/src/**` in [`eslint.config.mjs`](../../eslint.config.mjs) (`npm run lint:packages`) |
|
|
28
|
+
| Wire shapes are explicit: a response field that is always present is `.nullable()`, never `.optional()`; dates are ISO strings (`z.iso.datetime()`) | review |
|
|
29
|
+
| Every schema an app may extend is tagged `@extensionPoint schema` and listed in its slice README's catalog | `npm run check:package-docs` |
|
|
30
|
+
| Schemas are extension surface: renaming or removing a field, or narrowing a type, is a breaking change (`major` changeset with a migration note); adding an optional field or a new schema is `minor` | [docs/PACKAGES.md](../../docs/PACKAGES.md#contract-conventions), changeset review |
|
|
31
|
+
| Apps extend in app code with `.extend()` / `.merge()` / `.strict()`; never edit a contract file to add an app field | this README, "Extending a contract in an app" below |
|
|
32
|
+
| A schema moved here from a package keeps its field order, `.describe()` texts and enum order, so the generated OpenAPI document does not change | the OpenAPI diff in the slice's pull request |
|
|
33
|
+
|
|
34
|
+
### Who depends on it
|
|
35
|
+
|
|
36
|
+
`@marinoscar/platform-api` and `@marinoscar/platform-web` depend on this package at the lockstep version (a dependency, not a peer: it is part of the platform). `packages/platform-slices.json` records slice edges inside one package only; the package edges are these two, and the contract depends on no platform package.
|
|
37
|
+
|
|
38
|
+
### Dual format
|
|
39
|
+
|
|
40
|
+
`npm run build` runs `tsc` twice (`tsconfig.cjs.json` into `dist/cjs`, `tsconfig.esm.json` into `dist/esm`) and writes a `package.json` stub into each half that sets its module format. Each half carries its own `.d.ts` files, so a CommonJS consumer on `moduleResolution: node16` never sees ESM-format declarations. `"sideEffects": false` lets a bundler drop a slice's `schemas.ts` (and zod) when only its constants and types are used.
|
|
41
|
+
|
|
42
|
+
## Install and peer dependencies
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npm install @marinoscar/platform-contract zod
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Install these in the app; the package never bundles its own copy (a second copy of zod breaks `instanceof ZodError` across the boundary).
|
|
49
|
+
|
|
50
|
+
| Package | Range |
|
|
51
|
+
|---|---|
|
|
52
|
+
| `zod` | `^4.4.3` |
|
|
53
|
+
|
|
54
|
+
An app that uses `@marinoscar/platform-api` or `@marinoscar/platform-web` gets this package with them, but still installs `zod` itself.
|
|
55
|
+
|
|
56
|
+
## Quick start
|
|
57
|
+
|
|
58
|
+
Validate with a slice's schema, or use its types:
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
import { doctorReportSchema } from '@marinoscar/platform-contract/doctor';
|
|
62
|
+
import type { DoctorReport } from '@marinoscar/platform-contract/doctor';
|
|
63
|
+
|
|
64
|
+
const report: DoctorReport = doctorReportSchema.parse(body.data);
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
In browser code, import types with `import type` and constants only, so zod stays out of the bundle.
|
|
68
|
+
|
|
69
|
+
### Extending a contract in an app
|
|
70
|
+
|
|
71
|
+
An app that needs more than the contract says extends the schema in its own code; it never edits a contract file:
|
|
72
|
+
|
|
73
|
+
```ts
|
|
74
|
+
import { doctorCheckReportSchema, doctorReportSchema } from '@marinoscar/platform-contract/doctor';
|
|
75
|
+
import { z } from 'zod';
|
|
76
|
+
|
|
77
|
+
// Stricter: refuse any field the contract does not declare.
|
|
78
|
+
const exactReportSchema = doctorReportSchema
|
|
79
|
+
.extend({ checks: z.array(doctorCheckReportSchema.strict()) })
|
|
80
|
+
.strict();
|
|
81
|
+
|
|
82
|
+
// Wider: an app-only field on its own rows.
|
|
83
|
+
const ownedRowSchema = doctorCheckReportSchema.extend({ owner: z.string() });
|
|
84
|
+
type OwnedRow = z.infer<typeof ownedRowSchema>;
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
The reference app's Doctor integration test uses the first form ([`doctor.integration.spec.ts`](../../apps/api/test/doctor/doctor.integration.spec.ts)). A field every app needs belongs in the contract: file a seam request.
|
|
88
|
+
|
|
89
|
+
## Configuration
|
|
90
|
+
|
|
91
|
+
None. Schemas take no options; the routes that use them are configured in `@marinoscar/platform-api`.
|
|
92
|
+
|
|
93
|
+
## Extension-point catalog
|
|
94
|
+
|
|
95
|
+
None. The root entry exports only `PLATFORM_PACKAGE`; every schema is an extension point of its slice and is catalogued in that slice's README (`schema` kind), for example [the Doctor's](src/doctor/README.md#extension-point-catalog).
|
|
96
|
+
|
|
97
|
+
## Data
|
|
98
|
+
|
|
99
|
+
None. The package holds schemas of HTTP payloads, not database models; models live in `@marinoscar/platform-db`.
|
|
100
|
+
|
|
101
|
+
## Permissions and settings
|
|
102
|
+
|
|
103
|
+
None. Schemas declare no permission or setting; the API slices that use them do.
|
|
104
|
+
|
|
105
|
+
## UI
|
|
106
|
+
|
|
107
|
+
None. The package renders nothing; `@marinoscar/platform-web` imports its types and constants.
|
|
108
|
+
|
|
109
|
+
## Infra
|
|
110
|
+
|
|
111
|
+
None. The package ships no deployment configuration and reads no environment variable. The API and web images copy and build it before the package that depends on it.
|
|
112
|
+
|
|
113
|
+
## Observability
|
|
114
|
+
|
|
115
|
+
None. Validation is pure; the API and web packages log and trace around it.
|
|
116
|
+
|
|
117
|
+
## Security notes
|
|
118
|
+
|
|
119
|
+
Schemas are the single source of input validation for both sides. Never loosen a schema in an app to accept a payload the API rejects; file a seam request instead. A schema documents which fields never carry secret material, but cannot enforce it; the slice that fills the payload does.
|
|
120
|
+
|
|
121
|
+
## Conformance suite
|
|
122
|
+
|
|
123
|
+
None yet. The package ships no conformance suite; `runPlatformConformance()` and the suites arrive with the platform's conformance harness. Its own tests (`test/`) cover every slice's schemas and both module formats.
|
|
124
|
+
|
|
125
|
+
## Upgrade notes
|
|
126
|
+
|
|
127
|
+
What counts as breaking, for every slice: renaming or removing a field, making an optional field required, narrowing a type (a smaller enum, a stricter pattern), changing a nullable field to optional or the reverse, or changing what a transform outputs. Each is a `major` changeset with a migration note. Adding an optional request field, a new response field an app can ignore, or a new schema or slice is `minor`.
|
|
128
|
+
|
|
129
|
+
- #701: first slice, `./doctor`. The Doctor's schemas moved here from `@marinoscar/platform-api/doctor` and its types from `@marinoscar/platform-web/doctor/headless`; both packages re-export the old names. No wire or OpenAPI change.
|
|
130
|
+
- #702: `./telemetry`. The telemetry wire shapes moved here from the API's telemetry DTOs and the web's hand-written mirrors; both keep their old names. No wire or OpenAPI change.
|
|
131
|
+
|
|
132
|
+
## Troubleshooting
|
|
133
|
+
|
|
134
|
+
- **`Cannot find module '@marinoscar/platform-contract/<slice>'`.** The package is not built (`npm run build:packages` builds it first), or the slice is missing from the `exports` map.
|
|
135
|
+
- **`ERR_REQUIRE_ESM` or `exports is not defined` at load.** A `dist/<cjs|esm>/package.json` stub is missing; rebuild (`scripts/write-dist-stubs.mjs` writes them).
|
|
136
|
+
- **zod appears in the web bundle.** Browser code imports a schema at run time; switch to `import type` and the slice's constants.
|
|
137
|
+
|
|
138
|
+
Build and import problems common to every platform package are in [DEVELOPMENT.md § Platform packages](../../docs/DEVELOPMENT.md#platform-packages).
|
|
139
|
+
|
|
140
|
+
## Links
|
|
141
|
+
|
|
142
|
+
- [Platform packages spec](../../docs/specs/platform-packages.md): the extension contract and the package documentation standard
|
|
143
|
+
- [Package documentation standard and checks](../../docs/PACKAGES.md): how this README, the TSDoc and the catalog are checked, and the contract conventions summary
|
|
144
|
+
- [DEVELOPMENT.md § Platform packages](../../docs/DEVELOPMENT.md#platform-packages): build, test and lint commands
|
|
145
|
+
- [Doctor slice](src/doctor/README.md)
|
|
146
|
+
- [Telemetry slice](src/telemetry/README.md)
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every status of a Doctor check, in severity order, lowest first
|
|
3
|
+
* (`pass < skip < warn < fail`). Also the display order of the web page.
|
|
4
|
+
*
|
|
5
|
+
* - `pass`: verified healthy.
|
|
6
|
+
* - `skip`: not evaluated (a check it depends on did not pass, or the
|
|
7
|
+
* capability is intentionally switched off).
|
|
8
|
+
* - `warn`: works, but needs attention.
|
|
9
|
+
* - `fail`: broken.
|
|
10
|
+
*
|
|
11
|
+
* @stability stable
|
|
12
|
+
*/
|
|
13
|
+
export declare const DOCTOR_STATUSES: readonly ["pass", "skip", "warn", "fail"];
|
|
14
|
+
/**
|
|
15
|
+
* The four outcomes of a check, identical to the CLI doctor's `CheckStatus`:
|
|
16
|
+
* `pass`, `warn`, `fail` or `skip`.
|
|
17
|
+
*
|
|
18
|
+
* @stability stable
|
|
19
|
+
*/
|
|
20
|
+
export type DoctorStatus = (typeof DOCTOR_STATUSES)[number];
|
|
21
|
+
/**
|
|
22
|
+
* How bad a status is, for a report's overall verdict: the worst wins.
|
|
23
|
+
*
|
|
24
|
+
* `skip` ranks just above `pass`: a report whose only non-pass entries are
|
|
25
|
+
* intentional skips (AI off, telemetry off) is healthy, but it proved less than
|
|
26
|
+
* an all-pass one, and a report where nothing ran must not read as `pass`.
|
|
27
|
+
*
|
|
28
|
+
* @stability stable
|
|
29
|
+
*/
|
|
30
|
+
export declare const DOCTOR_STATUS_RANK: Readonly<Record<DoctorStatus, number>>;
|
|
31
|
+
/**
|
|
32
|
+
* The version of the support bundle format (`GET /api/admin/doctor/support-bundle`,
|
|
33
|
+
* issue #772). Bumped only by a breaking change to `supportBundleSchema`.
|
|
34
|
+
*
|
|
35
|
+
* @stability experimental
|
|
36
|
+
*/
|
|
37
|
+
export declare const SUPPORT_BUNDLE_VERSION: 1;
|
|
38
|
+
/**
|
|
39
|
+
* The redaction rule set applied to every support bundle. `v1` is documented
|
|
40
|
+
* in docs/specs/doctor.md ("Support bundle").
|
|
41
|
+
*
|
|
42
|
+
* @stability experimental
|
|
43
|
+
*/
|
|
44
|
+
export declare const SUPPORT_BUNDLE_REDACTION_RULES: "v1";
|
|
45
|
+
/**
|
|
46
|
+
* The statuses of one support-bundle section: `ok` (collected), `omitted` (not
|
|
47
|
+
* collected: a permission is missing or the capability is off) and `error`
|
|
48
|
+
* (the section threw, timed out or broke its schema; its data is dropped).
|
|
49
|
+
*
|
|
50
|
+
* @stability experimental
|
|
51
|
+
*/
|
|
52
|
+
export declare const SUPPORT_BUNDLE_SECTION_STATUSES: readonly ["ok", "omitted", "error"];
|
|
53
|
+
/**
|
|
54
|
+
* One support-bundle section's status.
|
|
55
|
+
*
|
|
56
|
+
* @stability experimental
|
|
57
|
+
*/
|
|
58
|
+
export type SupportBundleSectionStatus = (typeof SUPPORT_BUNDLE_SECTION_STATUSES)[number];
|
|
59
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/doctor/constants.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe,2CAA4C,CAAC;AAEzE;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5D;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAKrE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,EAAG,CAAU,CAAC;AAEjD;;;;;GAKG;AACH,eAAO,MAAM,8BAA8B,EAAG,IAAa,CAAC;AAE5D;;;;;;GAMG;AACH,eAAO,MAAM,+BAA+B,qCAAsC,CAAC;AAEnF;;;;GAIG;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,OAAO,+BAA+B,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// The Doctor's plain values (issue #701). Zod-free by rule: a browser that only
|
|
3
|
+
// needs a status list or a type never pulls the schemas, and with them zod,
|
|
4
|
+
// into its bundle (test/no-zod-in-constants.test.ts).
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SUPPORT_BUNDLE_SECTION_STATUSES = exports.SUPPORT_BUNDLE_REDACTION_RULES = exports.SUPPORT_BUNDLE_VERSION = exports.DOCTOR_STATUS_RANK = exports.DOCTOR_STATUSES = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Every status of a Doctor check, in severity order, lowest first
|
|
9
|
+
* (`pass < skip < warn < fail`). Also the display order of the web page.
|
|
10
|
+
*
|
|
11
|
+
* - `pass`: verified healthy.
|
|
12
|
+
* - `skip`: not evaluated (a check it depends on did not pass, or the
|
|
13
|
+
* capability is intentionally switched off).
|
|
14
|
+
* - `warn`: works, but needs attention.
|
|
15
|
+
* - `fail`: broken.
|
|
16
|
+
*
|
|
17
|
+
* @stability stable
|
|
18
|
+
*/
|
|
19
|
+
exports.DOCTOR_STATUSES = ['pass', 'skip', 'warn', 'fail'];
|
|
20
|
+
/**
|
|
21
|
+
* How bad a status is, for a report's overall verdict: the worst wins.
|
|
22
|
+
*
|
|
23
|
+
* `skip` ranks just above `pass`: a report whose only non-pass entries are
|
|
24
|
+
* intentional skips (AI off, telemetry off) is healthy, but it proved less than
|
|
25
|
+
* an all-pass one, and a report where nothing ran must not read as `pass`.
|
|
26
|
+
*
|
|
27
|
+
* @stability stable
|
|
28
|
+
*/
|
|
29
|
+
exports.DOCTOR_STATUS_RANK = {
|
|
30
|
+
pass: 0,
|
|
31
|
+
skip: 1,
|
|
32
|
+
warn: 2,
|
|
33
|
+
fail: 3,
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* The version of the support bundle format (`GET /api/admin/doctor/support-bundle`,
|
|
37
|
+
* issue #772). Bumped only by a breaking change to `supportBundleSchema`.
|
|
38
|
+
*
|
|
39
|
+
* @stability experimental
|
|
40
|
+
*/
|
|
41
|
+
exports.SUPPORT_BUNDLE_VERSION = 1;
|
|
42
|
+
/**
|
|
43
|
+
* The redaction rule set applied to every support bundle. `v1` is documented
|
|
44
|
+
* in docs/specs/doctor.md ("Support bundle").
|
|
45
|
+
*
|
|
46
|
+
* @stability experimental
|
|
47
|
+
*/
|
|
48
|
+
exports.SUPPORT_BUNDLE_REDACTION_RULES = 'v1';
|
|
49
|
+
/**
|
|
50
|
+
* The statuses of one support-bundle section: `ok` (collected), `omitted` (not
|
|
51
|
+
* collected: a permission is missing or the capability is off) and `error`
|
|
52
|
+
* (the section threw, timed out or broke its schema; its data is dropped).
|
|
53
|
+
*
|
|
54
|
+
* @stability experimental
|
|
55
|
+
*/
|
|
56
|
+
exports.SUPPORT_BUNDLE_SECTION_STATUSES = ['ok', 'omitted', 'error'];
|
|
57
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/doctor/constants.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,4EAA4E;AAC5E,sDAAsD;;;AAEtD;;;;;;;;;;;GAWG;AACU,QAAA,eAAe,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAU,CAAC;AAUzE;;;;;;;;GAQG;AACU,QAAA,kBAAkB,GAA2C;IACxE,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;CACR,CAAC;AAEF;;;;;GAKG;AACU,QAAA,sBAAsB,GAAG,CAAU,CAAC;AAEjD;;;;;GAKG;AACU,QAAA,8BAA8B,GAAG,IAAa,CAAC;AAE5D;;;;;;GAMG;AACU,QAAA,+BAA+B,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,CAAU,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { DOCTOR_STATUSES, DOCTOR_STATUS_RANK, SUPPORT_BUNDLE_REDACTION_RULES, SUPPORT_BUNDLE_SECTION_STATUSES, SUPPORT_BUNDLE_VERSION, } from './constants.js';
|
|
2
|
+
export type { DoctorStatus, SupportBundleSectionStatus } from './constants.js';
|
|
3
|
+
export { doctorCheckReportSchema, doctorQuerySchema, doctorReportSchema, doctorStatusSchema, supportBundleSchema, supportBundleSectionResultSchema, } from './schemas.js';
|
|
4
|
+
export type { DoctorBooleanStringEnum, DoctorCheckReport, DoctorQuery, DoctorReport, DoctorReportQueryInput, DoctorStatusEnum, SupportBundle, SupportBundleSectionResult, } from './schemas.js';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/doctor/index.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,8BAA8B,EAC9B,+BAA+B,EAC/B,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,YAAY,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAC/E,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,gCAAgC,GACjC,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,uBAAuB,EACvB,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,sBAAsB,EACtB,gBAAgB,EAChB,aAAa,EACb,0BAA0B,GAC3B,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// `@marinoscar/platform-contract/doctor`: the Doctor's wire shapes, shared by
|
|
3
|
+
// `@marinoscar/platform-api/doctor` (the DTOs) and
|
|
4
|
+
// `@marinoscar/platform-web/doctor` (the client's types) (issue #701).
|
|
5
|
+
// Documented in ./README.md. Explicit named exports only.
|
|
6
|
+
//
|
|
7
|
+
// constants.ts is zod-free; a consumer that imports only the constants and the
|
|
8
|
+
// types (the web app) never bundles schemas.ts or zod (`"sideEffects": false`).
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.supportBundleSectionResultSchema = exports.supportBundleSchema = exports.doctorStatusSchema = exports.doctorReportSchema = exports.doctorQuerySchema = exports.doctorCheckReportSchema = exports.SUPPORT_BUNDLE_VERSION = exports.SUPPORT_BUNDLE_SECTION_STATUSES = exports.SUPPORT_BUNDLE_REDACTION_RULES = exports.DOCTOR_STATUS_RANK = exports.DOCTOR_STATUSES = void 0;
|
|
11
|
+
var constants_js_1 = require("./constants.js");
|
|
12
|
+
Object.defineProperty(exports, "DOCTOR_STATUSES", { enumerable: true, get: function () { return constants_js_1.DOCTOR_STATUSES; } });
|
|
13
|
+
Object.defineProperty(exports, "DOCTOR_STATUS_RANK", { enumerable: true, get: function () { return constants_js_1.DOCTOR_STATUS_RANK; } });
|
|
14
|
+
Object.defineProperty(exports, "SUPPORT_BUNDLE_REDACTION_RULES", { enumerable: true, get: function () { return constants_js_1.SUPPORT_BUNDLE_REDACTION_RULES; } });
|
|
15
|
+
Object.defineProperty(exports, "SUPPORT_BUNDLE_SECTION_STATUSES", { enumerable: true, get: function () { return constants_js_1.SUPPORT_BUNDLE_SECTION_STATUSES; } });
|
|
16
|
+
Object.defineProperty(exports, "SUPPORT_BUNDLE_VERSION", { enumerable: true, get: function () { return constants_js_1.SUPPORT_BUNDLE_VERSION; } });
|
|
17
|
+
var schemas_js_1 = require("./schemas.js");
|
|
18
|
+
Object.defineProperty(exports, "doctorCheckReportSchema", { enumerable: true, get: function () { return schemas_js_1.doctorCheckReportSchema; } });
|
|
19
|
+
Object.defineProperty(exports, "doctorQuerySchema", { enumerable: true, get: function () { return schemas_js_1.doctorQuerySchema; } });
|
|
20
|
+
Object.defineProperty(exports, "doctorReportSchema", { enumerable: true, get: function () { return schemas_js_1.doctorReportSchema; } });
|
|
21
|
+
Object.defineProperty(exports, "doctorStatusSchema", { enumerable: true, get: function () { return schemas_js_1.doctorStatusSchema; } });
|
|
22
|
+
Object.defineProperty(exports, "supportBundleSchema", { enumerable: true, get: function () { return schemas_js_1.supportBundleSchema; } });
|
|
23
|
+
Object.defineProperty(exports, "supportBundleSectionResultSchema", { enumerable: true, get: function () { return schemas_js_1.supportBundleSectionResultSchema; } });
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/doctor/index.ts"],"names":[],"mappings":";AAAA,8EAA8E;AAC9E,mDAAmD;AACnD,uEAAuE;AACvE,0DAA0D;AAC1D,EAAE;AACF,+EAA+E;AAC/E,gFAAgF;;;AAEhF,+CAMwB;AALtB,+GAAA,eAAe,OAAA;AACf,kHAAA,kBAAkB,OAAA;AAClB,8HAAA,8BAA8B,OAAA;AAC9B,+HAAA,+BAA+B,OAAA;AAC/B,sHAAA,sBAAsB,OAAA;AAGxB,2CAOsB;AANpB,qHAAA,uBAAuB,OAAA;AACvB,+GAAA,iBAAiB,OAAA;AACjB,gHAAA,kBAAkB,OAAA;AAClB,gHAAA,kBAAkB,OAAA;AAClB,iHAAA,mBAAmB,OAAA;AACnB,8HAAA,gCAAgC,OAAA"}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { DoctorStatus } from './constants.js';
|
|
3
|
+
/**
|
|
4
|
+
* The entries of {@link doctorStatusSchema}, as `z.enum` types them: each
|
|
5
|
+
* status keyed by itself. Named so the schema's type reads as a reference.
|
|
6
|
+
*
|
|
7
|
+
* @stability stable
|
|
8
|
+
*/
|
|
9
|
+
export type DoctorStatusEnum = {
|
|
10
|
+
[S in DoctorStatus]: S;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* The entries of the `refresh` query parameter: the strings `'true'` and
|
|
14
|
+
* `'false'`, each keyed by itself, as `z.enum` types them.
|
|
15
|
+
*
|
|
16
|
+
* @stability stable
|
|
17
|
+
*/
|
|
18
|
+
export type DoctorBooleanStringEnum = {
|
|
19
|
+
[S in 'true' | 'false']: S;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* A check's status on the wire.
|
|
23
|
+
*
|
|
24
|
+
* The enum lists the values in the order the OpenAPI document has always
|
|
25
|
+
* published (`pass, warn, fail, skip`), which is not the severity order of
|
|
26
|
+
* {@link DOCTOR_STATUSES}; rank statuses with {@link DOCTOR_STATUS_RANK}.
|
|
27
|
+
*
|
|
28
|
+
* @extensionPoint schema
|
|
29
|
+
* @stability stable
|
|
30
|
+
*/
|
|
31
|
+
export declare const doctorStatusSchema: z.ZodEnum<DoctorStatusEnum>;
|
|
32
|
+
/**
|
|
33
|
+
* One row of the report, as `GET /api/admin/doctor` returns it.
|
|
34
|
+
*
|
|
35
|
+
* Fields: `id` (stable dotted id, `storage.bucket`), `category` (`core`,
|
|
36
|
+
* `auth`, ...; an app may add its own), `label`, `settingsPath` (the web route
|
|
37
|
+
* that fixes it, or `null`), `status`, `detail` (one line: what was found),
|
|
38
|
+
* `remedy` (set on `warn` and `fail`, otherwise `null`), `error` (the
|
|
39
|
+
* underlying probe error, or `null`), `data` (small scalar facts, never secret
|
|
40
|
+
* material, or `null`) and `durationMs` (0 when skipped without running).
|
|
41
|
+
*
|
|
42
|
+
* @extensionPoint schema
|
|
43
|
+
* @stability stable
|
|
44
|
+
*/
|
|
45
|
+
export declare const doctorCheckReportSchema: z.ZodObject<{
|
|
46
|
+
id: z.ZodString;
|
|
47
|
+
category: z.ZodString;
|
|
48
|
+
label: z.ZodString;
|
|
49
|
+
settingsPath: z.ZodNullable<z.ZodString>;
|
|
50
|
+
status: z.ZodEnum<DoctorStatusEnum>;
|
|
51
|
+
detail: z.ZodString;
|
|
52
|
+
remedy: z.ZodNullable<z.ZodString>;
|
|
53
|
+
error: z.ZodNullable<z.ZodString>;
|
|
54
|
+
data: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
|
|
55
|
+
durationMs: z.ZodNumber;
|
|
56
|
+
}, z.core.$strip>;
|
|
57
|
+
/**
|
|
58
|
+
* The whole report, as `GET /api/admin/doctor` returns it: `verdict` (the
|
|
59
|
+
* worst status in `checks`, `skip` when none ran), `generatedAt` (ISO 8601; a
|
|
60
|
+
* cached report keeps its original time), `durationMs` (wall time of the run)
|
|
61
|
+
* and `checks` (sorted by category, configured order first, then registration
|
|
62
|
+
* order).
|
|
63
|
+
*
|
|
64
|
+
* @extensionPoint schema
|
|
65
|
+
* @stability stable
|
|
66
|
+
*/
|
|
67
|
+
export declare const doctorReportSchema: z.ZodObject<{
|
|
68
|
+
verdict: z.ZodEnum<DoctorStatusEnum>;
|
|
69
|
+
generatedAt: z.ZodISODateTime;
|
|
70
|
+
durationMs: z.ZodNumber;
|
|
71
|
+
checks: z.ZodArray<z.ZodObject<{
|
|
72
|
+
id: z.ZodString;
|
|
73
|
+
category: z.ZodString;
|
|
74
|
+
label: z.ZodString;
|
|
75
|
+
settingsPath: z.ZodNullable<z.ZodString>;
|
|
76
|
+
status: z.ZodEnum<DoctorStatusEnum>;
|
|
77
|
+
detail: z.ZodString;
|
|
78
|
+
remedy: z.ZodNullable<z.ZodString>;
|
|
79
|
+
error: z.ZodNullable<z.ZodString>;
|
|
80
|
+
data: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
|
|
81
|
+
durationMs: z.ZodNumber;
|
|
82
|
+
}, z.core.$strip>>;
|
|
83
|
+
}, z.core.$strip>;
|
|
84
|
+
/**
|
|
85
|
+
* `GET /api/admin/doctor` query: `category` (a lowercase identifier; only the
|
|
86
|
+
* checks in that category, plus, unreported, whatever they depend on) and
|
|
87
|
+
* `refresh` (`'true'` bypasses the 15-second report cache).
|
|
88
|
+
*
|
|
89
|
+
* `refresh` is `z.enum(['true','false']).transform(...)` and NOT
|
|
90
|
+
* `z.coerce.boolean()`: every query parameter is a string and
|
|
91
|
+
* `Boolean('false')` is `true`.
|
|
92
|
+
*
|
|
93
|
+
* @extensionPoint schema
|
|
94
|
+
* @stability stable
|
|
95
|
+
*/
|
|
96
|
+
export declare const doctorQuerySchema: z.ZodObject<{
|
|
97
|
+
category: z.ZodOptional<z.ZodString>;
|
|
98
|
+
refresh: z.ZodOptional<z.ZodPipe<z.ZodEnum<DoctorBooleanStringEnum>, z.ZodTransform<boolean, "true" | "false">>>;
|
|
99
|
+
}, z.core.$strip>;
|
|
100
|
+
/**
|
|
101
|
+
* One row of the report. Every nullable field is present on every row.
|
|
102
|
+
*
|
|
103
|
+
* @stability stable
|
|
104
|
+
*/
|
|
105
|
+
export type DoctorCheckReport = z.infer<typeof doctorCheckReportSchema>;
|
|
106
|
+
/**
|
|
107
|
+
* The whole report.
|
|
108
|
+
*
|
|
109
|
+
* @stability stable
|
|
110
|
+
*/
|
|
111
|
+
export type DoctorReport = z.infer<typeof doctorReportSchema>;
|
|
112
|
+
/**
|
|
113
|
+
* The parsed query of `GET /api/admin/doctor` (`refresh` already a boolean).
|
|
114
|
+
*
|
|
115
|
+
* @stability stable
|
|
116
|
+
*/
|
|
117
|
+
export type DoctorQuery = z.output<typeof doctorQuerySchema>;
|
|
118
|
+
/**
|
|
119
|
+
* The query a client builds before serializing it: restrict the run to one
|
|
120
|
+
* `category`, or `refresh` to bypass the server-side cache.
|
|
121
|
+
*
|
|
122
|
+
* @stability stable
|
|
123
|
+
*/
|
|
124
|
+
export interface DoctorReportQueryInput {
|
|
125
|
+
/** Restrict the run to one category (a lowercase identifier). */
|
|
126
|
+
category?: string;
|
|
127
|
+
/** Bypass the server-side report cache and run every probe again. */
|
|
128
|
+
refresh?: boolean;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* One section of a bundle. `truncated: true` with `data: null` means the
|
|
132
|
+
* section was larger than its size cap and its data was dropped.
|
|
133
|
+
*
|
|
134
|
+
* @extensionPoint schema
|
|
135
|
+
* @stability experimental
|
|
136
|
+
*/
|
|
137
|
+
export declare const supportBundleSectionResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
138
|
+
status: z.ZodLiteral<"ok">;
|
|
139
|
+
data: z.ZodUnknown;
|
|
140
|
+
truncated: z.ZodOptional<z.ZodBoolean>;
|
|
141
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
142
|
+
status: z.ZodLiteral<"omitted">;
|
|
143
|
+
reason: z.ZodString;
|
|
144
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
145
|
+
status: z.ZodLiteral<"error">;
|
|
146
|
+
error: z.ZodString;
|
|
147
|
+
}, z.core.$strip>], "status">;
|
|
148
|
+
/**
|
|
149
|
+
* One section of a bundle, as parsed.
|
|
150
|
+
*
|
|
151
|
+
* @stability experimental
|
|
152
|
+
*/
|
|
153
|
+
export type SupportBundleSectionResult = z.infer<typeof supportBundleSectionResultSchema>;
|
|
154
|
+
/**
|
|
155
|
+
* The support bundle: what `GET /api/admin/doctor/support-bundle` returns as a
|
|
156
|
+
* JSON attachment.
|
|
157
|
+
*
|
|
158
|
+
* @extensionPoint schema
|
|
159
|
+
* @stability experimental
|
|
160
|
+
*/
|
|
161
|
+
export declare const supportBundleSchema: z.ZodObject<{
|
|
162
|
+
bundleVersion: z.ZodLiteral<1>;
|
|
163
|
+
generatedAt: z.ZodString;
|
|
164
|
+
redaction: z.ZodObject<{
|
|
165
|
+
rules: z.ZodLiteral<"v1">;
|
|
166
|
+
replacements: z.ZodNumber;
|
|
167
|
+
}, z.core.$strip>;
|
|
168
|
+
sections: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
169
|
+
status: z.ZodLiteral<"ok">;
|
|
170
|
+
data: z.ZodUnknown;
|
|
171
|
+
truncated: z.ZodOptional<z.ZodBoolean>;
|
|
172
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
173
|
+
status: z.ZodLiteral<"omitted">;
|
|
174
|
+
reason: z.ZodString;
|
|
175
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
176
|
+
status: z.ZodLiteral<"error">;
|
|
177
|
+
error: z.ZodString;
|
|
178
|
+
}, z.core.$strip>], "status">>;
|
|
179
|
+
}, z.core.$strip>;
|
|
180
|
+
/**
|
|
181
|
+
* The support bundle, as parsed.
|
|
182
|
+
*
|
|
183
|
+
* @stability experimental
|
|
184
|
+
*/
|
|
185
|
+
export type SupportBundle = z.infer<typeof supportBundleSchema>;
|
|
186
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/doctor/schemas.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGnD;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG;KAAG,CAAC,IAAI,YAAY,GAAG,CAAC;CAAE,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,MAAM,uBAAuB,GAAG;KAAG,CAAC,IAAI,MAAM,GAAG,OAAO,GAAG,CAAC;CAAE,CAAC;AAErE;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,EAAE,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAMxD,CAAC;AAEJ;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;iBAqBlC,CAAC;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;iBAS7B,CAAC;AAKH;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB;;;iBAU5B,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE7D;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACrC,iEAAiE;IACjE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qEAAqE;IACrE,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAkBD;;;;;;GAMG;AACH,eAAO,MAAM,gCAAgC;;;;;;;;;;6BAqB3C,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAE1F;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;iBAkB9B,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|