diff --git a/.changeset/adr-0122-phase-2-bare-name-flip.md b/.changeset/adr-0122-phase-2-bare-name-flip.md new file mode 100644 index 0000000000..6566bcdc42 --- /dev/null +++ b/.changeset/adr-0122-phase-2-bare-name-flip.md @@ -0,0 +1,145 @@ +--- +"@objectstack/spec": major +--- + +feat(spec)!: the bare type name is now the AUTHOR state — 1384 aliases flipped, 102 `XInput` synonyms retired (ADR-0122 phase 2, #6083) + +A Zod schema denotes two types: `z.input` (what an author writes — defaulted keys +optional, pre-transform) and `z.infer` (what `.parse()` returns). Until protocol 17 the +bare name `X` meant the second one in 1384 places and the first one in 86, with nothing +recorded about which was which. + +**[ADR-0122](https://github.com/objectstack-ai/objectstack/blob/main/docs/adr/0122-schema-type-alias-naming-convention.md) +settles it: the bare name `X` is the AUTHOR state, `XParsed` is the PARSED state.** +Phase 1 (16.x, additive) gave every schema with two distinct shapes its `XParsed` name so +nothing would be stranded. **This release is phase 2: it flips the bare names.** It is the +breaking half, and it is the reason `@objectstack/spec` goes to 17.0.0. + +```ts +// before (16.x) // after (17.0.0) +export type Connector = z.infer<…>; export type Connector = z.input<…>; +export type ConnectorParsed = z.infer<…>; export type ConnectorParsed = z.infer<…>; +export type ConnectorInput = z.input<…>; // ConnectorInput: RETIRED +``` + +## FROM → TO + +There are exactly two migrations, and each has a mechanical test. + +### 1. `XInput` → `X` (102 names removed) + +The flip made `XInput` a character-for-character synonym of the bare name, and ADR-0122 +D3 forbids a permanent synonym. Every retired name has the same fix: **drop the `Input` +suffix.** + +```diff +- import type { ConnectorInput } from '@objectstack/spec/integration'; +- const c: ConnectorInput = { name: 'acme', label: 'Acme', type: 'saas' }; ++ import type { Connector } from '@objectstack/spec/integration'; ++ const c: Connector = { name: 'acme', label: 'Acme', type: 'saas' }; +``` + +Find them: `rg '\b\w+Input\b' --type ts` over your own code, then keep only the hits that +resolve to `@objectstack/spec`. Every one of them is a compile error on upgrade — there is +no silent failure in this direction, because the name is gone. + +The 102 retired names, by module: + +| module | retired | +|:---|:---| +| `api/auth` | `SessionUserInput`, `LoginRequestInput` | +| `api/dispatcher` | `DispatcherRouteInput`, `DispatcherConfigInput` | +| `api/endpoint` | `ApiEndpointInput` | +| `api/plugin-rest-api` | `RequestValidationConfigInput`, `ResponseEnvelopeConfigInput`, `ErrorHandlingConfigInput`, `OpenApiGenerationConfigInput`, `RestApiPluginConfigInput` | +| `api/protocol` | `NotificationPreferencesInput`, `NotificationInput` | +| `api/query-adapter` | `RestQueryAdapterInput`, `ODataQueryAdapterInput`, `QueryAdapterConfigInput` | +| `api/rest-server` | `RestApiConfigInput`, `CrudEndpointsConfigInput`, `MetadataEndpointsConfigInput`, `BatchEndpointsConfigInput`, `RouteGenerationConfigInput`, `RestServerConfigInput` | +| `api/versioning` | `VersioningConfigInput` | +| `automation` | `FlowFunctionDeclarationInput`, `ActionDescriptorInput`, `TimeRelativeTriggerInput`, `WebhookInput` | +| `data/analytics` | `CubeInput`, `AnalyticsQueryInput` | +| `data/datasource` | `DatasourceInput` | +| `data/field` | `FieldParseInput` (→ `Field`), `CurrencyConfigInput` | +| `data/mapping` | `MappingInput` | +| `data/object` | `ObjectFieldGroupInput`, `RowCrudActionOverrideInput`, `ServiceObjectInput`, `ObjectExtensionInput` | +| `data/seed`, `data/seed-loader` | `SeedInput`, `SeedLoaderConfigInput`, `SeedLoaderRequestInput` | +| `identity` | `EvalUserInput`, `PositionInput` | +| `integration/connector` | `ConnectorInput` | +| `kernel` | `ClusterCapabilityConfigInput`, `ExecutionContextInput`, `ObjectStackManifestInput`, `PackageArtifactInput`, `PluginVendorInput`, `PluginQualityMetricsInput`, `PluginStatisticsInput`, `PluginRegistryEntryInput`, `PluginSearchFiltersInput`, `PluginInstallConfigInput`, `ServiceRegistryConfigInput`, `StartupOptionsInput` | +| `security` | `ExplainRequestInput`, `AdminScopeInput`, `PermissionSetInput`, `SharingRuleInput` | +| `system` | `CacheTierInput`, `CacheConfigInput`, `DistributedCacheConfigInput`, `BackupConfigInput`, `FailoverConfigInput`, `DisasterRecoveryPlanInput`, `EmailTemplateDefinitionInput`, `KeyRotationPolicyInput`, `EncryptionConfigInput`, `FieldEncryptionInput`, `EnvironmentArtifactInput`, `RouteHandlerMetadataInput`, `MiddlewareConfigInput`, `ServerCapabilitiesInput`, `JobInput`, `FeatureInput`, `PlanInput`, `SecurityContextConfigInput`, `StackServerConfigInput`, `RowLevelIsolationStrategyInput`, `SchemaLevelIsolationStrategyInput`, `DatabaseLevelIsolationStrategyInput`, `TenantSecurityPolicyInput`, `TranslationBundleInput`, `TaskRetryPolicyInput`, `TaskInput`, `QueueConfigInput`, `BatchTaskInput`, `BatchProgressInput`, `WorkerConfigInput` | +| `ui` | `ActionInput`, `InlineActionInput`, `NavigationContributionInput`, `AppInput`, `DashboardInput`, `DatasetDimensionInput`, `DatasetMeasureInput`, `DatasetInput`, `PageInput`, `JoinedReportBlockInput`, `ReportInput`, `ReportChartInput`, `ReportSortInput`, `ThemeInput` | + +**Nine `*Input` names are NOT retired** and need no change: `ExpressionInput`, +`CronExpressionInput`, `TemplateExpressionInput` and `PredicateInput` are the bare aliases +of their own `…InputSchema`, and `FormFieldInput`, `QueryInput`, `FieldInput`, +`ObjectStackDefinitionInput` and `NavigationItemInput` are composed types (recursive or +`Partial`-shaped) that no bare alias denotes. + +### 2. `X` → `XParsed` **only where you hold a parse result** + +If you annotate a value you *wrote*, do nothing — the bare name is now correct, and this +is the whole point of the change: + +```ts +// This did not compile in 16.x unless you knew to write `ConnectorInput`. +// In 17.0.0 it is simply right, in every domain. +const c: Connector = { name: 'acme_erp', label: 'Acme ERP', type: 'saas' }; +``` + +If you annotate a value that came *out of* `.parse()` (or out of a `defineX()` factory, or +off the wire after the engine parsed it) and you read a defaulted key from it, move that +annotation to `XParsed`: + +```diff +- const parsed: Connector = ConnectorSchema.parse(raw); ++ const parsed: ConnectorParsed = ConnectorSchema.parse(raw); + if (parsed.enabled) { … } // `enabled` is `boolean` here, `boolean | undefined` on `Connector` +``` + +**The grep that finds these:** `rg 'Schema\.parse\(' -A2` and `rg ': *\w+ *= *await'` in +your own code, then check each annotation. **The reliable finder is the compiler**: every +site that reads a defaulted key off an author-state value is a `TS18048` / +`TS2532` ("possibly undefined") or a `TS2345`. Upgrade, run `tsc`, and fix what it names. In +this repo — 1127 files annotate a value with a spec type — that came to **40 files outside +`packages/spec`**, and every one of them was a compile error first, never a silent change. + +**The one case tsc cannot name for you:** a *function's declared return type*. A parse +result is structurally assignable to the author state, so + +```ts +function loadConnector(): Connector { return ConnectorSchema.parse(raw); } // still compiles! +``` + +keeps compiling while quietly promising callers less than it delivers. If you have +factories or loaders that return a parsed value, re-declare them as `XParsed` by hand. +`@objectstack/spec`'s own 24 `defineX` factories were migrated exactly this way — +`defineApp(...)` now returns `AppParsed`, `defineConnector(...)` returns `ConnectorParsed`, +and so on for every factory whose schema has two shapes. + +## What did NOT change + +- **No runtime behaviour.** Not one `.parse()` call, `.default()`, `.transform()` or schema + shape moved. This release changes which type name describes which value, nothing else. +- **`json-schema/` and `authorable-surface/` are byte-identical.** Those generators read + runtime `z.ZodType` exports, never type aliases. +- **Your metadata files.** `*.object.ts`, `*.view.ts`, connector and flow definitions + authored with `defineX(...)` are untouched. Bare-literal metadata files typed with + `XInput` need the suffix dropped and nothing else. + +## Also in this release + +- **`check:spec-parsed-alias` is inverted.** It used to require every bare `z.infer` alias + to be paired or pinned; the flip empties that population, so it now refuses a bare name + that reads `z.infer` (the flip, enforced), refuses an `XInput` synonym of a bare name + (the retirement, enforced), and keeps the paired-or-pinned and stale-pin arms on the + flipped form. +- **57 previously ungoverned aliases were audited.** Inverting the gate widened it to the + 86 aliases that already read `z.input`, which phase 1 never examined. 22 gained an + `XParsed`; 35 were proved isomorphic and pinned, adding 35 to the pin registry (716 → 751 + on the merged tree, after #5055's four retirements and #5775's one addition). This closes + #5507's remaining scope. +- **`@objectstack/spec` public surface: 106 export names removed, 24 added.** The removals + are the 102 `XInput` aliases (plus re-exports); the additions are the 22 new `XParsed` + names (plus re-exports). All type-only — no runtime code, no bundle-size change. + + diff --git a/content/docs/getting-started/quick-reference.mdx b/content/docs/getting-started/quick-reference.mdx index 30633e6d1d..dd33af9d4b 100644 --- a/content/docs/getting-started/quick-reference.mdx +++ b/content/docs/getting-started/quick-reference.mdx @@ -298,10 +298,10 @@ is gated at publish and, once it passes, serves real traffic. Full contract: {/* os:check */} ```typescript -import type { ApiEndpointInput } from '@objectstack/spec/api'; +import type { ApiEndpoint } from '@objectstack/spec/api'; // With `manifest: { namespace: 'acme', … }` on the same stack. -export const leadFeed: ApiEndpointInput = { +export const leadFeed: ApiEndpoint = { name: 'acme_lead_feed', path: '/api/v1/apps/acme/leads', // /api/v1/apps// method: 'GET', diff --git a/content/docs/kernel/contracts/data-engine.mdx b/content/docs/kernel/contracts/data-engine.mdx index 038afe0e02..d5dffb3b2f 100644 --- a/content/docs/kernel/contracts/data-engine.mdx +++ b/content/docs/kernel/contracts/data-engine.mdx @@ -114,12 +114,12 @@ interface EngineQueryOptions { search?: FullTextSearch; // Full-text search expand?: Record; // Recursive relation loading distinct?: boolean; // SELECT DISTINCT - context?: ExecutionContextInput; // Identity, tenant, transaction — any subset + context?: ExecutionContext; // Identity, tenant, transaction — any subset } ``` -`ExecutionContextInput` is `ExecutionContext` with every field optional — supply -what you have, the engine reads what it needs. A system read passes +`ExecutionContext` is the author state — every field optional (the parse result, +with defaults applied, is `ExecutionContextParsed`). Supply what you have, the engine reads what it needs. A system read passes `{ isSystem: true }`; an automation run with no resolvable identity passes only its run id (`{ flowRunId }`), a context that deliberately carries no principal. @@ -234,7 +234,7 @@ const tasks = await engine.insert('task', [ ```typescript interface DataEngineInsertOptions { returning?: boolean; // Return inserted record(s)? Default: true - context?: ExecutionContextInput; // Identity, tenant, transaction — any subset + context?: ExecutionContext; // Identity, tenant, transaction — any subset } ``` @@ -261,7 +261,7 @@ interface EngineUpdateOptions { upsert?: boolean; // Insert if not found? Default: false multi?: boolean; // Update multiple records? Default: false returning?: boolean; // Return updated record(s)? Default: false - context?: ExecutionContextInput; + context?: ExecutionContext; } ``` @@ -312,7 +312,7 @@ await engine.delete('task', { interface EngineDeleteOptions { where?: FilterCondition; // Filter to identify records (WHERE) multi?: boolean; // Delete multiple records? Default: false - context?: ExecutionContextInput; + context?: ExecutionContext; } ``` @@ -350,7 +350,7 @@ interface EngineAggregateOptions { where?: FilterCondition; // Pre-aggregation filter (WHERE) groupBy?: string[]; // GROUP BY fields aggregations?: AggregationNode[]; // Aggregation definitions - context?: ExecutionContextInput; + context?: ExecutionContext; } interface AggregationNode { diff --git a/docs/adr/0122-schema-type-alias-naming-convention.md b/docs/adr/0122-schema-type-alias-naming-convention.md index 3320e558ba..359818ddbf 100644 --- a/docs/adr/0122-schema-type-alias-naming-convention.md +++ b/docs/adr/0122-schema-type-alias-naming-convention.md @@ -1,6 +1,6 @@ # ADR-0122: One naming family for schema type aliases — bare name is the author state, `XParsed` is the parsed state -**Status**: Accepted (2026-08-06) — ruled by the maintainer on 2026-08-06 on the #5551 decision brief ("裁 C,分期倾向 C2"). **Phase 1 (additive `XParsed` + backflow gate) implemented in #5551.** Phase 2 (flipping the bare names, and deciding `XInput`'s fate) is deferred to the next `@objectstack/spec` major and is **not** authorized by this record beyond the direction it fixes. +**Status**: Accepted (2026-08-06) — ruled by the maintainer on 2026-08-06 on the #5551 decision brief ("裁 C,分期倾向 C2"). **Phase 1 (additive `XParsed` + backflow gate) implemented in #5551 / PR #6072. Phase 2 (the flip, `XInput`'s retirement, the gate inversion) implemented in #6083, `@objectstack/spec` 17.0.0 — see the [Amendment](#amendment--phase-2-2026-08-07-6083) for what it decided and what it measured.** Both phases have landed; this record is now describing a completed change, and D8's "deferred to the next major" is history. **Deciders**: ObjectStack Protocol Architects **Builds on**: [ADR-0089](./0089-unify-visibility-predicate-naming.md) (canonical name + alias + lint + phased major — the template this reuses, and the reason the phasing looks familiar), [ADR-0087](./0087-metadata-protocol-upgrade-contract.md) (the upgrade contract this change deliberately does *not* need, because phase 1 removes nothing), [ADR-0033](./0033-ai-assisted-metadata-authoring.md) (the AI-authoring population whose default keystroke this decision is chosen to make correct) **Consumers**: `@objectstack/spec` (every `src/**/*.zod.ts`), every package and example app that annotates a value with a spec type, `@objectstack/qa`'s downstream-contract fixtures, and every AI author of `*.object.ts` / `*.view.ts` / connector and flow definitions @@ -329,3 +329,104 @@ the same census that generated the change: Both are cases where the census and the gate disagreed and the gate was right, which is the property that makes it worth running. + +--- + +## Amendment — phase 2 (2026-08-07, #6083) + +Phase 2 landed in `@objectstack/spec` 17.0.0. D8 left three things open — the flip +itself, `XInput`'s fate, and what becomes of the gate — and reserved the last two for +"its own record". This is that record. Everything above stands as written; nothing in +it is retracted. The census figures in the appendices are the numbers that *chose* the +criterion and stay as they were measured. + +**D9 — `XInput` is RETIRED where, and only where, the flip made it a literal synonym.** +D8 offered two routes (retire, or keep one release as a deprecated alias). Retire, in +the same major, because after D1 `export type XInput = z.input` denotes +character-for-character what `X` denotes, and D3 already forbids exactly that: a +permanent synonym is a name an author can only pick wrongly. Deprecating it for a +release would ship the coin flip D3 exists to prevent, in the release whose whole +purpose is to remove it. + +"Where the flip made it a synonym" is a measured set, not the whole population. Of the +**111** `export type *Input` declarations in `packages/spec/src/**/*.zod.ts`: + +| | count | what happens | +|:---|---:|:---| +| simple `z.input` where a bare alias of `S` exists | **102** | **retired** — the bare name now means this | +| simple `z.input` where the bare alias of `S` *is* the `Input` name | 4 | kept — `ExpressionInput`, `CronExpressionInput`, `TemplateExpressionInput`, `PredicateInput` are the bare aliases of `…InputSchema`, not synonyms of anything | +| composed types built *on* `z.input` | 5 | kept — `FormFieldInput`, `QueryInput`, `FieldInput`, `ObjectStackDefinitionInput`, `NavigationItemInput` denote recursive or `Partial`-shaped types no bare alias denotes | + +The dispatch brief said "108, all of them synonyms". It is 102, and the nine survivors +are the reason the criterion had to be computed rather than pattern-matched on the name. + +The `@objectstack/qa` downstream-contract fixtures — the eleven domains D8 flagged as +load-bearing, whose header says "DO NOT migrate these" — moved from `XInput` to the bare +name and **that is the freeze holding, not an exception to it**. Those fixtures pin the +AUTHOR state; phase 2 moved the author state onto the bare name. Every literal in them +is byte-for-byte unchanged and is checked against the same type it always was. Only the +spelling moved, and it moved because the name they used stopped existing. + +**D10 — the backflow gate is INVERTED, not extended.** `check:spec-parsed-alias` was +written over the population "bare aliases that read `z.infer`". The flip empties that +population, and a guard over an empty set is not a weaker guard — it is no guard. + +The concrete behaviour is worth recording, because it is stronger than "the gate goes +quiet". Run the **phase-1 script unchanged against the phase-2 tree** and it reports: + +| arm | phase-1 gate on the phase-2 tree | +|:---|:---| +| missing-parsed-alias | **0 findings** — vacuously green over an empty population | +| stale-pin ("does any bare `z.infer` alias still rely on this pin?") | **719 findings** — every pin in the file, all false | + +One arm silently stops working and the other misfires on the entire registry. Neither +is a gate. So the population is re-pointed at the post-flip convention and the flip +becomes the thing checked. Four arms now: + +1. a bare name may not read `z.infer` (**the flip, enforced** — revert one flipped alias + and this arm names it); +2. a bare alias's schema must have its parsed state named or be pinned (phase 1's rule, + re-pointed at the flipped form); +3. a pin nothing relies on is stale (unchanged); +4. an `XInput` that is a literal synonym of a bare name is refused (**D9, enforced** — + this is what stops the 102 from returning one file at a time). + +**Inverting the gate widened it, and the widening found real work.** Phase 1's gate only +ever looked at bare `z.infer` aliases, so the **86** aliases that already read `z.input` +before the flip — the A family, plus `api/protocol.zod.ts`'s request shapes — had never +been asked whether their parsed state was named. Asking produced **57** that were neither +paired nor pinned. The same probe that chose phase 1's split (same type-level identity +assertion, same deliberate control assertion so a vacuous pass could not be mistaken for +isomorphism — the control failed, as required) split them **22 differ / 35 isomorphic**. +The 22 received an `XParsed`; the 35 became pins, taking the registry 719 → 754. This is +#5507's remaining scope, which the record above said phase 2 would absorb, and it is +absorbed here. + +### What phase 2 actually changed + +| | count | +|:---|---:| +| bare aliases flipped `z.infer` → `z.input` | **1384** | +| `*.zod.ts` files touched by the flip | 189 | +| `XInput` declarations retired | **102** | +| `XParsed` aliases added (the 22 above) | 22 | +| isomorphic pins added (the 35 above) | 35 | +| api-surface: export names removed / added | 106 / 24 | +| `json-schema/`, `authorable-surface/` | **unchanged** — the generators read runtime `z.ZodType` exports, never type aliases | +| final: bare `z.input` aliases / pinned / paired | **1470 / 754 / 716** | + +`defineX` factories are the one migration the compiler cannot force: a parse result is +structurally assignable to the author state, so `function defineApp(...): App` kept +compiling while quietly meaning something new. **24** factory return types therefore moved +to `XParsed` by hand (`defineFlow` had already been written that way in phase 1); the six +whose schema is pinned isomorphic keep the bare name, because there the two are one type. +Every other consumer migration in this change was named by tsc. + +### The evidence the flip was the right direction + +`packages/spec/test-typecheck-debt.json` is a shrink-only ratchet whose own header +describes its contents as "almost all of them fixture literals annotated with a schema +OUTPUT type (`z.infer`) while holding an authored INPUT literal". Phase 2 took it from +**79 files / 691 errors to 59 / 270** without editing a single fixture: 421 of those +errors were the conflation this ADR exists to end, and the flip ended them. Nineteen test +files graduated out of the ledger entirely. diff --git a/docs/protocol-upgrade-guide.md b/docs/protocol-upgrade-guide.md index 65dcb44611..f1ea8e88f9 100644 --- a/docs/protocol-upgrade-guide.md +++ b/docs/protocol-upgrade-guide.md @@ -366,6 +366,9 @@ Last, it reconciles the SDUI component-props surface with the renderers that ser - **`driver-aggregate-undeclared-key-aliases-removed`** — `driver aggregate() call argument — query.aggregate and aggregations[].func` → query.aggregations and aggregations[].function — the spellings QueryASTSchema and AggregationNodeSchema have always declared - Why not automatic: `SqlDriver.aggregate` and `RemoteTransport.aggregate` each read two aliases the Query Protocol has never declared: `query.aggregations || query.aggregate` and `agg.function || agg.func`. "Never declared" is measured, not assumed — `git log -S` over `data/query.zod.ts` finds no commit that ever introduced either name, there is no `retiredKey()` tombstone and no alias-table entry for them (the file's only alias table is `SortNode`'s `direction` → `order`), and neither appears in any upgrade guide or release note. So this entry does not record a declared surface being withdrawn; it records a LENIENCY being withdrawn, which is why it is here rather than behind a tombstone. The only writers in this repository were the two driver packages' own fixtures — #4984's family, where a fixture spelling the alias keeps the tolerant limb green forever and no test in existence can go red on its deletion — so ADR-0049 enforce-or-remove applies once those are re-spelt. ⚠️ Do NOT read this across to `dashboard`/`page` measures: `aggregate` IS the canonical key there and `func` IS a declared, loudly-suggesting alias (`DatasetMeasureSchema`, ui/dataset.zod.ts). That neighbouring vocabulary is untouched, and it is the most likely reason an off-repo caller ever wrote these keys on a QUERY — one habit, two surfaces, only one of which declared it. This is a driver CALL ARGUMENT — code, never stack metadata — so there is no source for the D2 chain to rewrite and deliberately no schema tombstone: nothing ever ran a query through `QueryASTSchema.parse()` on this path. The enforced channel is tsc at the call site, once the parameter is `DriverQuery` — and for an untyped JS caller there is no enforced channel at all, which is exactly why this ledger entry has to exist: the generated upgrade guide is the only way such a reader learns of the rename. Same disposition, and the same reason, as `data-driver-find-stream-retired` (#4484), `storage-service-list-retired` (#5540) and `actor-user-roles-to-positions` (#6011). ADR-0049 / ADR-0087, #6321 (PR #6404). - Done when: No caller passes `aggregate:` to a driver's `aggregate()`, and no aggregation entry spells its function `func:`; both are written `aggregations:` / `function:`. An inline literal still using either old spelling no longer type-checks (TS2353 at the call site). An untyped JS caller that keeps writing `aggregate:` silently receives no aggregate column — the grouping still happens, the measure is simply absent — and one that keeps writing `func:` receives INVALID_QUERY / 400 naming the undeclared function, identically on the local driver and the Turso remote transport. +- **`spec-type-alias-input-suffix-retired`** — `type alias: the 102 XInput names of @objectstack/spec (ConnectorInput, AppInput, PageInput, ActionInput, ServiceObjectInput, ExecutionContextInput, TaskInput, … — 52 files across api/ automation/ data/ identity/ integration/ kernel/ security/ system/ ui/)` → the BARE name. ADR-0122 phase 2 moved the author state onto `X`, which makes `XInput` a character-for-character synonym of it — the permanent synonym D3 forbids. Drop the `Input` suffix: `ConnectorInput` -> `Connector`. Symmetrically, a consumer that held a PARSE RESULT under the bare name moves to `XParsed`, which phase 1 (16.x) already declared for every schema whose two shapes differ, so the target name has existed for a release. NINE `*Input` names are NOT retired and need no edit: `ExpressionInput`, `CronExpressionInput`, `TemplateExpressionInput` and `PredicateInput` are the bare aliases of their own `…InputSchema`, and `FormFieldInput`, `QueryInput`, `FieldInput`, `ObjectStackDefinitionInput` and `NavigationItemInput` are composed (recursive or `Partial`-shaped) types no bare alias denotes. + - Why not automatic: This entry exists for the reason `data-driver-find-stream-retired` (#4484), `storage-service-list-retired` (#5540) and `actor-user-roles-to-positions` (#6011) exist, and it is the same disposition: the surface is a TYPESCRIPT NAME, never stack metadata, so there is no source for a D2 conversion to rewrite and deliberately no schema tombstone — an `XInput` alias never had a carrier key, never emitted a def, and no `.parse()` ever saw it. Measured and verified rather than assumed: `json-schema/`, `json-schema.manifest/` and `authorable-surface/` are BYTE-IDENTICAL across this change, because those generators enumerate runtime `z.ZodType` exports and never read a type alias. So nothing left the published metadata surface and RETIRED_DEFS_BY_MAJOR is deliberately untouched — an entry there would falsely claim the metadata contract shrank. The enforced channel is tsc: the name is gone, so every consumer gets TS2724/TS2305 naming the import. That is loud but MUTE about the replacement — a compile error says `ConnectorInput` does not exist, not that `Connector` now means what it meant. The generated upgrade guide is the only channel that carries the second half, which is precisely the #6048 gap ADR-0087 registration exists to close. ⚠️ Deliberately NOT registered alongside it: the 1384 bare aliases the same change FLIPPED from `z.infer` to `z.input`. Those names all still exist and still resolve; what moved is which of a schema's two shapes they denote, and only where the two differ (663 of 1384 — the rest are isomorphic and the flip is a no-op there, pinned as such). A consumer holding an authored literal is made MORE correct by it, silently; one holding a parse result gets a tsc error at the first defaulted key it reads. Registering that as a rename would misdescribe it — no name was retired — and the changeset carries its own FROM -> TO for it. ADR-0122 D8/D9, #6083 (PR #6279). + - Done when: No source imports a name ending `Input` from `@objectstack/spec` except the nine listed above: `rg "\b\w+Input\b" --type ts` over consumer code resolves only to those. A literal annotated with a bare spec type compiles while listing ONLY the keys the author means — `const c: Connector = { name, label, type }` type-checks, which it did not in 16.x — and a value read out of `XSchema.parse()` annotated with the bare name no longer compiles at the first defaulted key it reads (TS18048/TS2532), the signal that the annotation should be `XParsed`. `pnpm check:spec-parsed-alias` reports every bare alias as `z.input` and refuses both a bare `z.infer` alias and a reintroduced `XInput` synonym. --- diff --git a/packages/client/test-typecheck-debt.json b/packages/client/test-typecheck-debt.json index 173f8c8d17..58282cdf2c 100644 --- a/packages/client/test-typecheck-debt.json +++ b/packages/client/test-typecheck-debt.json @@ -1,8 +1,4 @@ { - "_comment": "Per-file tsc error debt of the @objectstack/client TEST layer (#5286). `tsconfig.test.json` compiles `src/**/*.test.ts` — which `tsconfig.json` excludes and therefore no gate ever read — and every file below still carries errors from before that gate existed, almost all of them fixture literals annotated with a schema OUTPUT type (`z.infer`) while holding an authored INPUT literal. EXACT ratchet, judged by re-running tsc: a file that gains errors is red, a file that loses them is red until its number is re-recorded, a file that reaches zero is red until its entry is deleted, and a file NOT listed here may have no errors at all. Regenerate with: pnpm --filter @objectstack/client gen:test-typecheck-debt", - "entries": { - "src/client.batch-transaction.test.ts": 3, - "src/client.environment-scoping.test.ts": 1, - "src/client.hono.test.ts": 2 - } + "_comment": "Per-file tsc error debt of the @objectstack/client TEST layer (#5286). `tsconfig.test.json` compiles `src/**/*.test.ts` — which `tsconfig.json` excludes and therefore no gate ever read — and every file below still carries errors from before that gate existed, almost all of them fixture literals annotated with a schema OUTPUT type (`z.infer`) while holding an authored INPUT literal. EXACT ratchet, judged by re-running tsc: a file that gains errors is red, a file that loses them is red until its number is re-recorded, a file that reaches zero is red until its entry is deleted, and a file NOT listed here may have no errors at all. Regenerate with: pnpm --filter @objectstack/client gen:test-typecheck-debt ADR-0122 phase 2 (#6083) emptied this ledger: all three remaining files were exactly the conflation described above — an authored literal annotated with the OUTPUT type — and the flip made the bare name mean the INPUT type, so they compile with no edit. An empty `entries` is the goal state, not a disabled gate: a file that gains an error is red on arrival.", + "entries": {} } diff --git a/packages/core/src/health-monitor.test.ts b/packages/core/src/health-monitor.test.ts index cc3399a373..a4ddd28617 100644 --- a/packages/core/src/health-monitor.test.ts +++ b/packages/core/src/health-monitor.test.ts @@ -2,7 +2,7 @@ import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest'; import { PluginHealthMonitor } from './health-monitor.js'; import { createLogger } from './logger.js'; import type { Plugin } from './types.js'; -import type { PluginHealthCheck } from '@objectstack/spec/kernel'; +import type { PluginHealthCheckParsed } from '@objectstack/spec/kernel'; describe('PluginHealthMonitor', () => { let monitor: PluginHealthMonitor; @@ -14,7 +14,7 @@ describe('PluginHealthMonitor', () => { }); it('should register plugin for health monitoring', () => { - const config: PluginHealthCheck = { + const config: PluginHealthCheckParsed = { interval: 5000, timeout: 1000, failureThreshold: 3, @@ -29,7 +29,7 @@ describe('PluginHealthMonitor', () => { }); it('should report healthy status initially', () => { - const config: PluginHealthCheck = { + const config: PluginHealthCheckParsed = { interval: 5000, timeout: 1000, failureThreshold: 3, @@ -44,7 +44,7 @@ describe('PluginHealthMonitor', () => { }); it('should get all health statuses', () => { - const config: PluginHealthCheck = { + const config: PluginHealthCheckParsed = { interval: 5000, timeout: 1000, failureThreshold: 3, @@ -64,7 +64,7 @@ describe('PluginHealthMonitor', () => { }); it('should shutdown cleanly', () => { - const config: PluginHealthCheck = { + const config: PluginHealthCheckParsed = { interval: 5000, timeout: 1000, failureThreshold: 3, @@ -92,7 +92,7 @@ describe('PluginHealthMonitor', () => { // satisfy while still leaving the loop pinned. describe('Health-check timeout guard does not outlive the race (#4875)', () => { /** A guard long enough that a single orphan is unmistakable. */ - const guardedConfig = (overrides: Partial = {}): PluginHealthCheck => ({ + const guardedConfig = (overrides: Partial = {}): PluginHealthCheckParsed => ({ interval: 30_000, timeout: 120_000, failureThreshold: 3, diff --git a/packages/core/src/health-monitor.ts b/packages/core/src/health-monitor.ts index 59d8945e03..2ead09b295 100644 --- a/packages/core/src/health-monitor.ts +++ b/packages/core/src/health-monitor.ts @@ -2,7 +2,7 @@ import type { PluginHealthStatus, - PluginHealthCheck, + PluginHealthCheckParsed, PluginHealthReport } from '@objectstack/spec/kernel'; import type { ObjectLogger } from './logger.js'; @@ -16,7 +16,7 @@ import type { Plugin } from './types.js'; */ export class PluginHealthMonitor { private logger: ObjectLogger; - private healthChecks = new Map(); + private healthChecks = new Map(); private healthStatus = new Map(); private healthReports = new Map(); private checkIntervals = new Map(); @@ -31,7 +31,7 @@ export class PluginHealthMonitor { /** * Register a plugin for health monitoring */ - registerPlugin(pluginName: string, config: PluginHealthCheck): void { + registerPlugin(pluginName: string, config: PluginHealthCheckParsed): void { this.healthChecks.set(pluginName, config); this.healthStatus.set(pluginName, 'unknown'); this.failureCounters.set(pluginName, 0); @@ -97,7 +97,7 @@ export class PluginHealthMonitor { private async performHealthCheck( pluginName: string, plugin: Plugin, - config: PluginHealthCheck + config: PluginHealthCheckParsed ): Promise { const startTime = Date.now(); let status: PluginHealthStatus = 'healthy'; @@ -201,7 +201,7 @@ export class PluginHealthMonitor { private async attemptRestart( pluginName: string, plugin: Plugin, - config: PluginHealthCheck + config: PluginHealthCheckParsed ): Promise { const attempts = this.restartAttempts.get(pluginName) || 0; diff --git a/packages/core/src/hot-reload.test.ts b/packages/core/src/hot-reload.test.ts index 683ad37699..bf6b5b95ed 100644 --- a/packages/core/src/hot-reload.test.ts +++ b/packages/core/src/hot-reload.test.ts @@ -4,7 +4,7 @@ import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest'; import { HotReloadManager } from './hot-reload.js'; import type { ObjectLogger } from './logger.js'; import type { Plugin } from './types.js'; -import type { HotReloadConfig } from '@objectstack/spec/kernel'; +import type { HotReloadConfigParsed } from '@objectstack/spec/kernel'; /** Records `error` reports; every other level is dropped. `child()` is self. */ function createRecordingLogger(errors: { message: string; error?: unknown }[]): ObjectLogger { @@ -44,7 +44,7 @@ describe('HotReloadManager', () => { // satisfy while still leaving the loop pinned. describe('Shutdown timeout guard does not outlive the race (#4952)', () => { /** A guard long enough that a single orphan is unmistakable. */ - const guardedConfig = (overrides: Partial = {}): HotReloadConfig => + const guardedConfig = (overrides: Partial = {}): HotReloadConfigParsed => ({ enabled: true, debounceDelay: 1000, @@ -52,7 +52,7 @@ describe('HotReloadManager', () => { stateStrategy: 'none', shutdownTimeout: 120_000, ...overrides, - }) as HotReloadConfig; + }) as HotReloadConfigParsed; const noState = () => ({}); const noRestore = () => {}; diff --git a/packages/core/src/hot-reload.ts b/packages/core/src/hot-reload.ts index fc1d07acdf..b1eca6f04f 100644 --- a/packages/core/src/hot-reload.ts +++ b/packages/core/src/hot-reload.ts @@ -3,7 +3,7 @@ import { createHash } from 'node:crypto'; import type { - HotReloadConfig, + HotReloadConfigParsed, PluginStateSnapshot } from '@objectstack/spec/kernel'; import type { ObjectLogger } from './logger.js'; @@ -43,7 +43,7 @@ class PluginStateManager { pluginId: string, version: string, state: Record, - config: HotReloadConfig + config: HotReloadConfigParsed ): Promise { const snapshot: PluginStateSnapshot = { pluginId, @@ -163,7 +163,7 @@ class PluginStateManager { export class HotReloadManager { private logger: ObjectLogger; private stateManager: PluginStateManager; - private reloadConfigs = new Map(); + private reloadConfigs = new Map(); private watchHandles = new Map(); private reloadTimers = new Map(); @@ -175,7 +175,7 @@ export class HotReloadManager { /** * Register a plugin for hot reload */ - registerPlugin(pluginName: string, config: HotReloadConfig): void { + registerPlugin(pluginName: string, config: HotReloadConfigParsed): void { if (!config.enabled) { this.logger.debug('Hot reload disabled for plugin', { plugin: pluginName }); return; diff --git a/packages/core/src/logger.ts b/packages/core/src/logger.ts index 784915f89c..bef1d3358b 100644 --- a/packages/core/src/logger.ts +++ b/packages/core/src/logger.ts @@ -238,7 +238,15 @@ export class ObjectLogger implements Logger { redact: config.redact ?? ['password', 'token', 'secret', 'key'], sourceLocation: config.sourceLocation ?? false, file: config.file, - rotation: config.rotation ?? { maxSize: '10m', maxFiles: 5 }, + // Per-key, because `LoggerConfig` is the AUTHOR state (ADR-0122): the + // schema defaults `maxSize`/`maxFiles` *inside* `rotation`, so a caller + // may legitimately write `{ rotation: { maxSize: '5m' } }` and this + // constructor — which does not parse — has to fill the other half the + // same way `LoggerConfigSchema.parse` would. + rotation: { + maxSize: config.rotation?.maxSize ?? '10m', + maxFiles: config.rotation?.maxFiles ?? 5, + }, }; this.bindings = bindings; this.redactPatterns = this.config.redact.map(tokenizeFieldName).filter((words) => words.length > 0); diff --git a/packages/core/src/utils/filter-tokens.ts b/packages/core/src/utils/filter-tokens.ts index b29acf199b..4a36a6e6f3 100644 --- a/packages/core/src/utils/filter-tokens.ts +++ b/packages/core/src/utils/filter-tokens.ts @@ -392,8 +392,9 @@ export function resolveFilterTokens( * `current_user.organization_id`). * * Typed structurally, not as `ExecutionContext`, so both the parsed context - * (defaults applied) and the pre-parse `ExecutionContextInput` a caller holds - * mid-pipeline satisfy it. The three fields read here are optional in both. + * (`ExecutionContextParsed`, defaults applied) and the pre-parse + * `ExecutionContext` a caller holds mid-pipeline satisfy it. The three fields + * read here are optional in both. */ export function filterTokenContextFrom( execCtx: ExecutionContextLike | undefined, diff --git a/packages/drivers/driver-memory/src/memory-analytics-filter-refusal.test.ts b/packages/drivers/driver-memory/src/memory-analytics-filter-refusal.test.ts index 52c1f80e25..06cfec4da4 100644 --- a/packages/drivers/driver-memory/src/memory-analytics-filter-refusal.test.ts +++ b/packages/drivers/driver-memory/src/memory-analytics-filter-refusal.test.ts @@ -30,9 +30,9 @@ import { describe, it, expect, beforeEach } from 'vitest'; import { InMemoryDriver } from './memory-driver.js'; import { MemoryAnalyticsService } from './memory-analytics.js'; import { AnalyticsQuerySchema } from '@objectstack/spec/data'; -import type { AnalyticsQuery, AnalyticsQueryInput, Cube, FilterCondition } from '@objectstack/spec/data'; +import type { AnalyticsQuery, Cube, FilterCondition } from '@objectstack/spec/data'; -const asQuery = (input: AnalyticsQueryInput): AnalyticsQuery => AnalyticsQuerySchema.parse(input); +const asQuery = (input: AnalyticsQuery): AnalyticsQuery => AnalyticsQuerySchema.parse(input); /** Five rows over two stages, so a dropped predicate shows up as a bigger count. */ const DEALS = [ diff --git a/packages/drivers/driver-memory/src/memory-analytics.test.ts b/packages/drivers/driver-memory/src/memory-analytics.test.ts index f0cbbe3bce..b73363ac60 100644 --- a/packages/drivers/driver-memory/src/memory-analytics.test.ts +++ b/packages/drivers/driver-memory/src/memory-analytics.test.ts @@ -4,7 +4,7 @@ import { describe, it, expect, beforeEach } from 'vitest'; import { InMemoryDriver } from './memory-driver.js'; import { MemoryAnalyticsService } from './memory-analytics.js'; import { AnalyticsQuerySchema, defineCube } from '@objectstack/spec/data'; -import type { AnalyticsQuery, AnalyticsQueryInput, Cube } from '@objectstack/spec/data'; +import type { AnalyticsQuery, Cube } from '@objectstack/spec/data'; /** * Validate a literal through the schema before handing it to the service — @@ -14,10 +14,10 @@ import type { AnalyticsQuery, AnalyticsQueryInput, Cube } from '@objectstack/spe * [#4538] The two tiers collapsed: `AnalyticsQuerySchema` no longer carries * any `.default()`/`.transform()` (`timezone` is genuinely optional — absence * means the engine resolves org timezone, #1982/#2018), so `AnalyticsQuery` - * and `AnalyticsQueryInput` are the same shape and the parse is validation + * and `AnalyticsQuery` are the same shape and the parse is validation * only. The helper stays so every test query is proven schema-valid. */ -const asQuery = (input: AnalyticsQueryInput): AnalyticsQuery => AnalyticsQuerySchema.parse(input); +const asQuery = (input: AnalyticsQuery): AnalyticsQuery => AnalyticsQuerySchema.parse(input); describe('MemoryAnalyticsService', () => { let driver: InMemoryDriver; diff --git a/packages/lint/src/build-access-matrix.ts b/packages/lint/src/build-access-matrix.ts index f41e3cdf5c..196ff8208e 100644 --- a/packages/lint/src/build-access-matrix.ts +++ b/packages/lint/src/build-access-matrix.ts @@ -15,7 +15,7 @@ * AI may draft grants freely; it cannot silently change who can do what. */ -import type { AccessMatrix, AccessMatrixEntry } from '@objectstack/spec/security'; +import type { AccessMatrixParsed, AccessMatrixEntry } from '@objectstack/spec/security'; type AnyRec = Record; @@ -28,7 +28,7 @@ function asArray(v: unknown): AnyRec[] { } /** Build the sorted access matrix for a normalized stack. */ -export function buildAccessMatrix(stack: AnyRec): AccessMatrix { +export function buildAccessMatrix(stack: AnyRec): AccessMatrixParsed { const entries: AccessMatrixEntry[] = []; if (!stack || typeof stack !== 'object') return { version: 1, entries }; @@ -85,7 +85,7 @@ const BIT_LABELS: Array<[keyof AccessMatrixEntry, string]> = [ * Semantic diff between two matrices — human-review lines, empty = identical. * Ordered: removals, additions, then per-entry bit/scope changes. */ -export function diffAccessMatrix(before: AccessMatrix, after: AccessMatrix): string[] { +export function diffAccessMatrix(before: AccessMatrixParsed, after: AccessMatrixParsed): string[] { const lines: string[] = []; const key = (e: AccessMatrixEntry) => `${e.permissionSet}\u0000${e.object}`; const beforeMap = new Map((before?.entries ?? []).map((e) => [key(e), e])); diff --git a/packages/lint/src/validate-org-axis-red-lines.test.ts b/packages/lint/src/validate-org-axis-red-lines.test.ts index ef11666181..5fb764f04c 100644 --- a/packages/lint/src/validate-org-axis-red-lines.test.ts +++ b/packages/lint/src/validate-org-axis-red-lines.test.ts @@ -10,8 +10,8 @@ import { RowLevelSecurityPolicySchema, ShareRecipientType, SharingRuleSchema, - type PermissionSetInput, - type SharingRuleInput, + type PermissionSet, + type SharingRule, } from '@objectstack/spec/security'; import { @@ -42,7 +42,7 @@ const rules = (stack: unknown) => validateOrgAxisRedLines(stack).map((f) => f.ru * (`input: 'parsed'`): `condition` arrives as the `{ dialect, source }` * envelope, not the authored string. */ -function sharingRule(input: SharingRuleInput): Record { +function sharingRule(input: SharingRule): Record { const result = SharingRuleSchema.safeParse(input); if (!result.success) { const detail = result.error.issues @@ -66,7 +66,7 @@ function sharingRule(input: SharingRuleInput): Record { * keeps that from quietly coming back: a fixture for a surface the spec does * not have now fails HERE. */ -function permissionSet(input: PermissionSetInput): Record { +function permissionSet(input: PermissionSet): Record { const result = PermissionSetSchema.safeParse(input); if (!result.success) { throw new Error( @@ -104,14 +104,14 @@ describe('sharing-rule fixtures track the spec surface (meta-test, #4984)', () = name: 'hq_rollup', object: 'work_order', criteria: { parent_organization_id: 'org_hq' }, - } as unknown as SharingRuleInput), + } as unknown as SharingRule), ).toThrow(/not spec-valid/); expect(() => sharingRule({ name: 'plant_team', object: 'work_order', sharedTo: { type: 'business_unit', id: 'bu_plant_a' }, - } as unknown as SharingRuleInput), + } as unknown as SharingRule), ).toThrow(/not spec-valid/); }); @@ -124,7 +124,7 @@ describe('sharing-rule fixtures track the spec surface (meta-test, #4984)', () = // `id` is an alias of `value`, rejected by `sharingRecipientUnknownKeyError`. sharedWith: { type: 'business_unit', id: 'bu_plant_a' }, condition: 'true', - } as unknown as SharingRuleInput), + } as unknown as SharingRule), ).toThrow(/not spec-valid/); }); @@ -411,7 +411,7 @@ describe('validateOrgAxisRedLines — undeclared keys are the schema’s job, no objectName: 'material_catalog', sharedWith: { type: 'business_unit', value: 'bu' }, condition: 'true', - } as unknown as SharingRuleInput), + } as unknown as SharingRule), ).toThrow(/not spec-valid/); // ② therefore never needs a fallback for the rule's target object. expect( @@ -454,7 +454,7 @@ describe('validateOrgAxisRedLines — ② business-unit trees stay org-internal' object: 'material_catalog', sharedWith: { type: recipientType, value: 'bu_plant_a' }, condition: 'true', - } as unknown as SharingRuleInput), + } as unknown as SharingRule), ], }); @@ -570,7 +570,7 @@ describe('validateOrgAxisRedLines — ② business-unit trees stay org-internal' object: 'material_catalog', sharedWith: { type: recipientType, value: 'buyer' }, condition: 'true', - } as unknown as SharingRuleInput), + } as unknown as SharingRule), ], }), ).toEqual([]); diff --git a/packages/metadata-protocol/src/protocol.ts b/packages/metadata-protocol/src/protocol.ts index adffff8a9b..54cc0f3c8d 100644 --- a/packages/metadata-protocol/src/protocol.ts +++ b/packages/metadata-protocol/src/protocol.ts @@ -30,7 +30,7 @@ import { SEARCHABLE_TEXTUAL_TYPES, SEARCHABLE_ENUM_TYPES, SEARCH_AUTO_EXCLUDED_FIELDS, RPC_QUERY_ALIAS_SLOTS, foldQueryAliasSlots, type QueryAliasConflict, type QueryAliasSlot, - type DroppedFieldsEvent, type QueryAST, type EngineQueryOptions, + type DroppedFieldsEvent, type QueryAST, type EngineQueryOptionsParsed, } from '@objectstack/spec/data'; import { PLURAL_TO_SINGULAR, SINGULAR_TO_PLURAL } from '@objectstack/spec/shared'; import { applyConversionsToStoredItem, type ConversionNotice } from '@objectstack/spec'; @@ -4140,7 +4140,7 @@ export class ObjectStackProtocolImplementation implements // `.strict()`), which left this query running ascending — the // OLDEST `limit` audit events, i.e. the beginning of an object's // life and never its recent changes (#4674). The `as any` is gone - // for the same reason: `EngineQueryOptions` rejects the wrong key, + // for the same reason: `EngineQueryOptionsParsed` rejects the wrong key, // and erasing the type is what let it through. const rows = await this.engine.find('sys_metadata_audit', { where, @@ -5983,7 +5983,7 @@ export class ObjectStackProtocolImplementation implements // truncated away the recently-edited records a searcher is most // likely to want (#4674). Typed rather than `any` so the // contract rejects the wrong key at the call site. - const opts: EngineQueryOptions = { + const opts: EngineQueryOptionsParsed = { where, limit: perObject, orderBy: [{ field: 'updated_at', order: 'desc' }], diff --git a/packages/metadata-protocol/src/seed-loader.ts b/packages/metadata-protocol/src/seed-loader.ts index e4aae7192d..2f4a6620dc 100644 --- a/packages/metadata-protocol/src/seed-loader.ts +++ b/packages/metadata-protocol/src/seed-loader.ts @@ -2,15 +2,15 @@ import type { IDataEngine, IMetadataService, ISeedLoaderService } from '@objectstack/spec/contracts'; import type { - SeedLoaderRequest, - SeedLoaderResult, + SeedLoaderRequestParsed, + SeedLoaderResultParsed, SeedLoaderConfig, - SeedLoaderConfigInput, - ObjectDependencyGraph, - ObjectDependencyNode, - ReferenceResolution, + SeedLoaderConfigParsed, + ObjectDependencyGraphParsed, + ObjectDependencyNodeParsed, + ReferenceResolutionParsed, ReferenceResolutionError, - SeedLoadResult, + SeedLoadResultParsed, Seed, } from '@objectstack/spec/data'; import { SeedLoaderConfigSchema, isMultiValueField } from '@objectstack/spec/data'; @@ -160,7 +160,7 @@ export class SeedLoaderService implements ISeedLoaderService { // Public API // ========================================================================== - async load(request: SeedLoaderRequest): Promise { + async load(request: SeedLoaderRequestParsed): Promise { const startTime = Date.now(); // Pin the environment `Seed.env` is gated on BEFORE anything reads config. // Resolving it here — the one funnel every seeding path goes through — is @@ -173,7 +173,7 @@ export class SeedLoaderService implements ISeedLoaderService { // seven free to re-open the same hole (framework#4704). const config = this.resolveEnvConfig(request.config, request.seeds); const allErrors: ReferenceResolutionError[] = []; - const allResults: SeedLoadResult[] = []; + const allResults: SeedLoadResultParsed[] = []; // Per-load counter — a service instance can be reused across loads. this.summariesStale = 0; @@ -256,14 +256,14 @@ export class SeedLoaderService implements ISeedLoaderService { return this.buildResult(config, graph, allResults, allErrors, durationMs); } - async buildDependencyGraph(objectNames: string[]): Promise { - const nodes: ObjectDependencyNode[] = []; + async buildDependencyGraph(objectNames: string[]): Promise { + const nodes: ObjectDependencyNodeParsed[] = []; const objectSet = new Set(objectNames); for (const objectName of objectNames) { const objDef = await this.resolveObjectDefinition(objectName); const dependsOn: string[] = []; - const references: ReferenceResolution[] = []; + const references: ReferenceResolutionParsed[] = []; if (objDef && objDef.fields) { const fields = objDef.fields as Record; @@ -331,9 +331,14 @@ export class SeedLoaderService implements ISeedLoaderService { return fromMetadata; } - async validate(datasets: Seed[], config?: SeedLoaderConfigInput): Promise { + async validate(datasets: Seed[], config?: SeedLoaderConfig): Promise { const parsedConfig = SeedLoaderConfigSchema.parse({ ...config, dryRun: true }); - return this.load({ seeds: datasets, config: parsedConfig }); + // `datasets` is the AUTHOR state (that is what `validate` takes); `load` + // takes the parsed request, and `SeedLoaderSchema` fills the per-seed defaults + // this cast stands in for. Parsing each dataset here would be a second + // validation pass with its own failure mode — `load` already reports every + // seed problem it finds, which is the whole point of `dryRun`. + return this.load({ seeds: datasets, config: parsedConfig } as SeedLoaderRequestParsed); } // ========================================================================== @@ -342,12 +347,12 @@ export class SeedLoaderService implements ISeedLoaderService { private async loadDataset( dataset: Seed, - config: SeedLoaderConfig, - refMap: Map, + config: SeedLoaderConfigParsed, + refMap: Map, insertedRecords: Map>, deferredUpdates: DeferredUpdate[], allErrors: ReferenceResolutionError[], - ): Promise { + ): Promise { const objectName = dataset.object; const mode = dataset.mode || config.defaultMode; const externalId = dataset.externalId || 'name'; @@ -1090,7 +1095,7 @@ export class SeedLoaderService implements ISeedLoaderService { private async resolveDeferredUpdates( deferredUpdates: DeferredUpdate[], insertedRecords: Map>, - allResults: SeedLoadResult[], + allResults: SeedLoadResultParsed[], allErrors: ReferenceResolutionError[], organizationId?: string, ): Promise { @@ -1341,7 +1346,7 @@ export class SeedLoaderService implements ISeedLoaderService { */ private recordDeferredError( deferred: DeferredUpdate, - allResults: SeedLoadResult[], + allResults: SeedLoadResultParsed[], allErrors: ReferenceResolutionError[], message: string, ): void { @@ -1428,7 +1433,7 @@ export class SeedLoaderService implements ISeedLoaderService { * while everything looks normal"), so it logs at `error` naming the * consequence and the remedy. * - * It is also COUNTED, into `SeedLoadResult.summariesStale` / + * It is also COUNTED, into `SeedLoadResultParsed.summariesStale` / * `summary.totalSummariesStale`, because a log line is not something a * caller can branch on. `success` deliberately stays `true`: the rows landed, * and every consumer of this result treats `success: false` as "the write @@ -1674,7 +1679,7 @@ export class SeedLoaderService implements ISeedLoaderService { * Kahn's algorithm for topological sort with cycle detection. */ private topologicalSort( - nodes: ObjectDependencyNode[], + nodes: ObjectDependencyNodeParsed[], ): { insertOrder: string[]; circularDependencies: string[][] } { const inDegree = new Map(); const adjacency = new Map(); @@ -1738,7 +1743,7 @@ export class SeedLoaderService implements ISeedLoaderService { return { insertOrder, circularDependencies }; } - private findCycles(nodes: ObjectDependencyNode[]): string[][] { + private findCycles(nodes: ObjectDependencyNodeParsed[]): string[][] { const cycles: string[][] = []; const nodeMap = new Map(nodes.map(n => [n.object, n])); const visited = new Set(); @@ -1801,7 +1806,7 @@ export class SeedLoaderService implements ISeedLoaderService { * paths pin `NODE_ENV` — so this is the embedded-host case, and it is now * signposted rather than silent. */ - private resolveEnvConfig(config: SeedLoaderConfig, seeds: Seed[]): SeedLoaderConfig { + private resolveEnvConfig(config: SeedLoaderConfigParsed, seeds: Seed[]): SeedLoaderConfigParsed { if (config.env) return config; const resolved = resolveSeedEnvFromNodeEnv(); @@ -1861,10 +1866,10 @@ export class SeedLoaderService implements ISeedLoaderService { } private buildReferenceMap( - graph: ObjectDependencyGraph, + graph: ObjectDependencyGraphParsed, externalIdByObject?: Map, - ): Map { - const map = new Map(); + ): Map { + const map = new Map(); for (const node of graph.nodes) { if (node.references.length > 0) { // Resolve against the TARGET dataset's declared externalId when this @@ -1978,7 +1983,7 @@ export class SeedLoaderService implements ISeedLoaderService { return Array.isArray(externalId) ? externalId.join('+') : externalId; } - private buildEmptyResult(config: SeedLoaderConfig, durationMs: number): SeedLoaderResult { + private buildEmptyResult(config: SeedLoaderConfigParsed, durationMs: number): SeedLoaderResultParsed { return { success: true, dryRun: config.dryRun, @@ -2003,12 +2008,12 @@ export class SeedLoaderService implements ISeedLoaderService { } private buildResult( - config: SeedLoaderConfig, - graph: ObjectDependencyGraph, - results: SeedLoadResult[], + config: SeedLoaderConfigParsed, + graph: ObjectDependencyGraphParsed, + results: SeedLoadResultParsed[], errors: ReferenceResolutionError[], durationMs: number, - ): SeedLoaderResult { + ): SeedLoaderResultParsed { const summary = { objectsProcessed: results.length, totalRecords: results.reduce((sum, r) => sum + r.total, 0), diff --git a/packages/metadata/src/metadata-manager.ts b/packages/metadata/src/metadata-manager.ts index 40dd19a731..42c1b27f22 100644 --- a/packages/metadata/src/metadata-manager.ts +++ b/packages/metadata/src/metadata-manager.ts @@ -40,7 +40,7 @@ import type { MetadataValidationResult, MetadataBulkResult, MetadataDependency, - MetadataTypeRegistryEntry, + MetadataTypeRegistryEntryParsed, } from '@objectstack/spec/kernel'; import type { MetadataOverlay } from '@objectstack/spec/kernel'; import { getMetadataTypeActions } from '@objectstack/spec/kernel'; @@ -279,7 +279,7 @@ export class MetadataManager implements IMetadataService { private overlays = new Map(); // Type registry for metadata type info - private typeRegistry: MetadataTypeRegistryEntry[] = []; + private typeRegistry: MetadataTypeRegistryEntryParsed[] = []; // Dependency tracking: "type:name" -> dependencies private dependencies = new Map(); @@ -512,7 +512,7 @@ export class MetadataManager implements IMetadataService { /** * Set the type registry for metadata type discovery. */ - setTypeRegistry(entries: MetadataTypeRegistryEntry[]): void { + setTypeRegistry(entries: MetadataTypeRegistryEntryParsed[]): void { this.typeRegistry = entries; } diff --git a/packages/metadata/src/migration/executor.ts b/packages/metadata/src/migration/executor.ts index f0a0e984aa..f1dc735904 100644 --- a/packages/metadata/src/migration/executor.ts +++ b/packages/metadata/src/migration/executor.ts @@ -6,7 +6,7 @@ import { ISchemaDriver } from '@objectstack/spec/contracts'; export class MigrationExecutor { constructor(private driver: ISchemaDriver) {} - async executeChangeSet(changeSet: System.ChangeSet): Promise { + async executeChangeSet(changeSet: System.ChangeSetParsed): Promise { console.log(`Executing ChangeSet: ${changeSet.name} (${changeSet.id})`); for (const op of changeSet.operations) { @@ -19,7 +19,7 @@ export class MigrationExecutor { } } - private async executeOperation(op: System.MigrationOperation): Promise { + private async executeOperation(op: System.MigrationOperationParsed): Promise { switch (op.type) { case 'create_object': console.log(` > Create Object: ${op.object.name}`); diff --git a/packages/objectql/src/engine-filter-array-lowering.test.ts b/packages/objectql/src/engine-filter-array-lowering.test.ts index a671af09e7..7382910561 100644 --- a/packages/objectql/src/engine-filter-array-lowering.test.ts +++ b/packages/objectql/src/engine-filter-array-lowering.test.ts @@ -29,17 +29,17 @@ import { describe, it, expect, beforeEach } from 'vitest'; import type { EngineAggregateOptions, EngineCountOptions, - EngineQueryOptions, + EngineQueryOptionsParsed, } from '@objectstack/spec/data'; import { ObjectQL } from './engine.js'; /** * [#4918] `FilterArray` on `where` is off-contract BY DECLARATION, and these - * tests exist to drive it: `EngineQueryOptions.where` is a `FilterCondition` / + * tests exist to drive it: `EngineQueryOptionsParsed.where` is a `FilterCondition` / * `Record< string, unknown >`, which an array is not assignable to, because * `FilterArray` is INPUT-ONLY authoring sugar the spec deliberately excludes * (#5285). So a test that hands the engine one has to say so, and - * `as unknown as EngineQueryOptions` is how: it names the contract being + * `as unknown as EngineQueryOptionsParsed` is how: it names the contract being * bypassed, keeps the rest of the call type-checked, and greps as an * intentional act — none of which a bare `as any` does. * @@ -49,8 +49,8 @@ import { ObjectQL } from './engine.js'; * reason the runtime gate this file pins has to exist. Erasing them would hide * that they are type-legal, which is the point. */ -const asFilterArrayQuery = (where: unknown): EngineQueryOptions => - ({ where }) as unknown as EngineQueryOptions; +const asFilterArrayQuery = (where: unknown): EngineQueryOptionsParsed => + ({ where }) as unknown as EngineQueryOptionsParsed; const deal = { name: 'deal', diff --git a/packages/objectql/src/engine-readonly-strip-caller-values.test.ts b/packages/objectql/src/engine-readonly-strip-caller-values.test.ts index 08688f8350..568c1ad7be 100644 --- a/packages/objectql/src/engine-readonly-strip-caller-values.test.ts +++ b/packages/objectql/src/engine-readonly-strip-caller-values.test.ts @@ -31,7 +31,7 @@ // the case is pinned here next to the fix so the two verdicts are read together. import { describe, it, expect, beforeEach } from 'vitest'; -import type { EngineQueryOptions } from '@objectstack/spec/data'; +import type { EngineQueryOptionsParsed } from '@objectstack/spec/data'; import { ObjectQL } from './engine.js'; function makeDriver() { @@ -132,7 +132,7 @@ describe('update strip acts on CALLER-submitted values (#5591)', () => { if (!ctx.previous && ctx.input?.id) { // Typed, not `as any`: the #4918 ratchet counts an erased engine // query-options bag even in test code. - const priorQuery: EngineQueryOptions = { where: { id: ctx.input.id }, limit: 1 }; + const priorQuery: EngineQueryOptionsParsed = { where: { id: ctx.input.id }, limit: 1 }; ctx.previous = await engine.findOne(ctx.object, priorQuery); } }, { priority: 5 }); diff --git a/packages/objectql/src/engine.ts b/packages/objectql/src/engine.ts index 125f0b1e5b..86d4122471 100644 --- a/packages/objectql/src/engine.ts +++ b/packages/objectql/src/engine.ts @@ -3,7 +3,7 @@ import { AsyncLocalStorage } from 'node:async_hooks'; import { QueryAST, HookContext, ServiceObject } from '@objectstack/spec/data'; import { - EngineQueryOptions, + EngineQueryOptionsParsed, DataEngineInsertOptions, EngineUpdateOptions, EngineDeleteOptions, @@ -28,7 +28,7 @@ import { VALUE_SHAPES_MIGRATION_ID, isDataMigrationFlagVerified, } from '@objectstack/spec/system'; -import { ExecutionContext, ExecutionContextInput, ExecutionContextSchema } from '@objectstack/spec/kernel'; +import { ExecutionContext, ExecutionContextSchema } from '@objectstack/spec/kernel'; import type { FlowFunctionEffect } from '@objectstack/spec/automation'; // Imported from spec directly rather than through `@objectstack/core`'s // re-export block: that block is labelled backward-compatibility, and this @@ -606,7 +606,7 @@ function planFormulaProjection( function applyFormulaPlan( plan: FormulaPlanEntry[], records: any[], - execCtx?: ExecutionContextInput, + execCtx?: ExecutionContext, ): void { if (!plan.length) return; const now = new Date(); @@ -662,7 +662,7 @@ function applyFormulaPlan( function hydrateWriteFormulas( schema: any, results: unknown[], - execCtx?: ExecutionContextInput, + execCtx?: ExecutionContext, ): void { const records = results.filter( (r): r is Record => r != null && typeof r === 'object', @@ -732,7 +732,7 @@ export interface OperationContext { ast?: QueryAST; data?: any; options?: any; - context?: ExecutionContextInput; + context?: ExecutionContext; result?: any; } @@ -751,14 +751,14 @@ export interface OperationContext { * are given, `options.context` wins (it is the explicit channel). */ export interface EngineReadOptions { - context?: ExecutionContextInput; + context?: ExecutionContext; } /** Merge read-path execution context from the query and the trailing options. */ function mergeReadContext( - fromQuery?: ExecutionContextInput, - fromOptions?: ExecutionContextInput, -): ExecutionContextInput | undefined { + fromQuery?: ExecutionContext, + fromOptions?: ExecutionContext, +): ExecutionContext | undefined { if (fromOptions == null) return fromQuery; if (fromQuery == null) return fromOptions; return { ...fromQuery, ...fromOptions }; @@ -772,7 +772,7 @@ function mergeReadContext( * for a "historical" import) turns it off. Both are server-set, never * client-supplied. */ -function shouldSkipStateMachine(ctx?: ExecutionContextInput): boolean { +function shouldSkipStateMachine(ctx?: ExecutionContext): boolean { return ctx?.seedReplay === true || ctx?.skipStateMachine === true; } @@ -908,7 +908,7 @@ function eventRecordBody(value: unknown): Record | undefined { } /** `DataEvent.userId` — the acting user, when the execution context names one. */ -function eventUserId(execCtx?: ExecutionContextInput): string | undefined { +function eventUserId(execCtx?: ExecutionContext): string | undefined { const userId = execCtx?.userId; if (userId == null) return undefined; const asString = String(userId); @@ -1648,7 +1648,7 @@ export class ObjectQL implements IObjectQLEngine { * `positions` into the context, so an anonymous HTTP request still yields a * session and stays gated. */ - private buildSession(execCtx?: ExecutionContextInput): HookContext['session'] { + private buildSession(execCtx?: ExecutionContext): HookContext['session'] { if (!execCtx) return undefined; const session = { userId: execCtx.userId, @@ -1708,7 +1708,7 @@ export class ObjectQL implements IObjectQLEngine { * where every caller-gating hook would read them as the caller. Attribution * here, authorization in `session`/`isSystem`, never the two mixed. */ - private buildProvenance(execCtx?: ExecutionContextInput): HookContext['provenance'] { + private buildProvenance(execCtx?: ExecutionContext): HookContext['provenance'] { const flowRunId = (execCtx as any)?.flowRunId; const attributedUserId = (execCtx as any)?.attributedUserId; if (!flowRunId && !attributedUserId) return undefined; @@ -1725,7 +1725,7 @@ export class ObjectQL implements IObjectQLEngine { * system / unauthenticated writes, where membership predicates then fail-open. */ private buildEvalUser( - execCtx?: ExecutionContextInput, + execCtx?: ExecutionContext, ): { id: string; positions: string[]; organizationId: string | null } | undefined { if (!execCtx || execCtx.userId == null) return undefined; return { @@ -1746,7 +1746,7 @@ export class ObjectQL implements IObjectQLEngine { * hooks that need an org regardless of a resolved user read * `ctx.session.organizationId`, which is populated whenever a session is. */ - private buildUser(execCtx?: ExecutionContextInput): HookContext['user'] { + private buildUser(execCtx?: ExecutionContext): HookContext['user'] { if (!execCtx || execCtx.userId == null) return undefined; return { id: String(execCtx.userId), @@ -1778,7 +1778,7 @@ export class ObjectQL implements IObjectQLEngine { * `tenantId` themselves on the resulting object; this helper does not * mask the system path. */ - private buildDriverOptions(object: string, execCtx?: ExecutionContextInput, base?: any): any { + private buildDriverOptions(object: string, execCtx?: ExecutionContext, base?: any): any { // The open transaction may arrive explicitly via the context, or ambiently // via txStore when an internal query runs during a transactional write // (ADR-0034). Explicit wins; ambient is the safety net. @@ -1932,8 +1932,8 @@ export class ObjectQL implements IObjectQLEngine { * Falls back to a system-elevated empty context when no execCtx * is supplied (e.g. system-triggered hooks). */ - private buildHookApi(execCtx?: ExecutionContextInput): ScopedContext { - const safeCtx: ExecutionContextInput = execCtx ?? ({ isSystem: true } as any); + private buildHookApi(execCtx?: ExecutionContext): ScopedContext { + const safeCtx: ExecutionContext = execCtx ?? ({ isSystem: true } as any); return new ScopedContext(safeCtx, this as unknown as IDataEngine); } @@ -1963,7 +1963,7 @@ export class ObjectQL implements IObjectQLEngine { private applyFieldDefaults( object: string, record: Record, - execCtx?: ExecutionContextInput, + execCtx?: ExecutionContext, nowSnapshot?: Date, ): Record { const schema = this.getSchema(object); @@ -2077,7 +2077,7 @@ export class ObjectQL implements IObjectQLEngine { private async applyAutonumbers( object: string, record: Record, - execCtx?: ExecutionContextInput, + execCtx?: ExecutionContext, driverOwnsAutonumber?: boolean, ): Promise { if (driverOwnsAutonumber) return; // driver generates persistently in create() @@ -2131,7 +2131,7 @@ export class ObjectQL implements IObjectQLEngine { object: string, field: string, prefix: string, - execCtx?: ExecutionContextInput, + execCtx?: ExecutionContext, ): Promise { try { // Canonical `fields`, not the wire spelling `select` — this call sat on @@ -2717,7 +2717,7 @@ export class ObjectQL implements IObjectQLEngine { recordId: unknown; changes?: unknown; after?: unknown; - context?: ExecutionContextInput; + context?: ExecutionContext; }, ): Promise { if (!this.realtimeService) return; @@ -2793,7 +2793,7 @@ export class ObjectQL implements IObjectQLEngine { private async publishBulkDataEvent( action: 'updated' | 'deleted', object: string, - input: { matched: unknown; context?: ExecutionContextInput }, + input: { matched: unknown; context?: ExecutionContext }, ): Promise { if (!this.realtimeService) return; @@ -3223,7 +3223,7 @@ export class ObjectQL implements IObjectQLEngine { private async encryptSecretFields( object: string, row: Record, - context: ExecutionContextInput | undefined, + context: ExecutionContext | undefined, driverOptions: unknown, ): Promise { if (!row || typeof row !== 'object') return; @@ -3956,7 +3956,7 @@ export class ObjectQL implements IObjectQLEngine { const rows = await this.find(DATA_MIGRATION_FLAG_OBJECT, { where: { id: migrationId }, limit: 1, - context: { isSystem: true } as ExecutionContextInput, + context: { isSystem: true } as ExecutionContext, }); const row: any = rows?.[0]; if (!row || row.id !== migrationId) return { verified: false, conclusive: true }; @@ -4094,7 +4094,7 @@ export class ObjectQL implements IObjectQLEngine { const rows = await this.find(DATA_MIGRATION_FLAG_OBJECT, { where: { id: migrationId }, limit: 1, - context: { isSystem: true } as ExecutionContextInput, + context: { isSystem: true } as ExecutionContext, }); const row: any = rows?.[0]; if (!row || row.id !== migrationId) return; // nothing certified — nothing to revoke @@ -4124,7 +4124,7 @@ export class ObjectQL implements IObjectQLEngine { }), updated_at: now, }, - { context: { isSystem: true } as ExecutionContextInput }, + { context: { isSystem: true } as ExecutionContext }, ); this.invalidateDataMigrationFlags(); this.logger.warn( @@ -4492,7 +4492,7 @@ export class ObjectQL implements IObjectQLEngine { childObject: string, records: any, previous: any, - execCtx?: ExecutionContextInput, + execCtx?: ExecutionContext, ): Promise { const descriptors = this.getSummaryDescriptors(childObject); if (descriptors.length === 0) return []; @@ -4549,7 +4549,7 @@ export class ObjectQL implements IObjectQLEngine { records: any[], expand: Record, depth: number = 0, - execCtx?: ExecutionContextInput, + execCtx?: ExecutionContext, ): Promise { if (!records || records.length === 0) return records; if (depth >= ObjectQL.MAX_EXPAND_DEPTH) return records; @@ -4667,7 +4667,7 @@ export class ObjectQL implements IObjectQLEngine { where, ...(nestedAST.fields ? { fields: nestedAST.fields as any } : {}), ...(nestedAST.orderBy ? { orderBy: nestedAST.orderBy as any } : {}), - context: { ...(execCtx ?? {}), __expandRead: true } as ExecutionContextInput, + context: { ...(execCtx ?? {}), __expandRead: true } as ExecutionContext, }, ) ?? []; @@ -4739,7 +4739,7 @@ export class ObjectQL implements IObjectQLEngine { private async resolveFileReferences( objectName: string, records: any[], - execCtx?: ExecutionContextInput, + execCtx?: ExecutionContext, ): Promise { if (!records || records.length === 0) return records; // A caller whose subject is the STORED form — the ADR-0104 backfill / @@ -4788,7 +4788,7 @@ export class ObjectQL implements IObjectQLEngine { try { fileRows = (await this.find( 'sys_file', - { where: { id: { $in: uniqueIds } }, context: { ...(execCtx ?? {}), __expandRead: true } as ExecutionContextInput }, + { where: { id: { $in: uniqueIds } }, context: { ...(execCtx ?? {}), __expandRead: true } as ExecutionContext }, )) ?? []; } catch { return records; // sys_file unregistered / unreadable — leave ids as-is @@ -4850,7 +4850,7 @@ export class ObjectQL implements IObjectQLEngine { * An unresolvable placeholder throws (see the resolver's module doc) — the one * outcome an author can act on. */ - private resolveWhereTokens(ast: QueryAST | undefined, execCtx?: ExecutionContextInput): void { + private resolveWhereTokens(ast: QueryAST | undefined, execCtx?: ExecutionContext): void { if (!ast || ast.where == null) return; ast.where = resolveFilterTokens(ast.where, filterTokenContextFrom(execCtx)); } @@ -4866,7 +4866,7 @@ export class ObjectQL implements IObjectQLEngine { * writing back would bake one request's user id into a filter object the * caller may reuse (view metadata and flow node config both get reused). */ - private withResolvedWhere( + private withResolvedWhere( options: T, ): T { if (!options || options.where == null) return options; @@ -4974,7 +4974,7 @@ export class ObjectQL implements IObjectQLEngine { ); } - async find(object: string, query?: EngineQueryOptions, options?: EngineReadOptions): Promise { + async find(object: string, query?: EngineQueryOptionsParsed, options?: EngineReadOptions): Promise { object = this.resolveObjectName(object); // Normalize the alias spellings (`filter`→`where`, `top`→`limit`) by the // spec's slot table — the driver AST only understands the canonical keys, @@ -4993,9 +4993,12 @@ export class ObjectQL implements IObjectQLEngine { // stray `query.object` overwrite it, splitting the AST's object from the // table actually queried (#4371 option-2 survey) — every middleware and // hook reading `ast.object` would have been lied to. - const ast: QueryAST = { ...query, object }; - // Remove context from the AST — it's not a driver concern - delete (ast as any).context; + // `context` is dropped HERE rather than `delete`d from the built AST: since + // ADR-0122 the caller-supplied `context` is the AUTHOR state (every key + // optional) while `QueryAST` carries the parsed one, so spreading it in and + // removing it a line later would type the AST with a context it never holds. + const { context: _findContext, ...findQuery } = query ?? {}; + const ast: QueryAST = { ...findQuery, object }; // Plan formula projection: rewrite ast.fields to drop virtual formula // names and inject their dependencies, so the driver returns the raw @@ -5121,7 +5124,7 @@ export class ObjectQL implements IObjectQLEngine { * * Fires the same `beforeFind`/`afterFind` hooks as `find` (#3195). */ - async findOne(objectName: string, query?: EngineQueryOptions, options?: EngineReadOptions): Promise { + async findOne(objectName: string, query?: EngineQueryOptionsParsed, options?: EngineReadOptions): Promise { objectName = this.resolveObjectName(objectName); // Same alias fold as find() (#4346). Without it, `findOne({ filter })` // matched the first row of the WHOLE table rather than the predicate. @@ -5136,9 +5139,10 @@ export class ObjectQL implements IObjectQLEngine { const driver = this.getDriver(objectName); // `object` after the spread for the same reason as find(); `limit: 1` // last — findOne is single-row by contract. - const ast: QueryAST = { ...query, object: objectName, limit: 1 }; - // Remove context from the AST — it's not a driver concern - delete (ast as any).context; + // Same reason as find(): the caller's `context` is the author state and the + // AST carries the parsed one, so it leaves before the AST is typed. + const { context: _findOneContext, ...findOneQuery } = query ?? {}; + const ast: QueryAST = { ...findOneQuery, object: objectName, limit: 1 }; // Plan formula projection (same as find): rewrite ast.fields so the driver // returns the raw dependency fields, then evaluate formulas after fetch. @@ -6195,7 +6199,7 @@ export class ObjectQL implements IObjectQLEngine { private async cascadeDeleteRelations( object: string, id: string | number, - context?: ExecutionContextInput, + context?: ExecutionContext, depth = 0, ): Promise { if (id == null || depth >= ObjectQL.MAX_CASCADE_DEPTH) return; @@ -6280,7 +6284,7 @@ export class ObjectQL implements IObjectQLEngine { // rides a server-DERIVED context (set here, never from client input // — same trust model as `__expandRead`), so it cannot be forged from // a request to bypass the guard on an ordinary write. - const referentialCtx = { ...(context ?? {}), __referentialFieldClear: true } as ExecutionContextInput; + const referentialCtx = { ...(context ?? {}), __referentialFieldClear: true } as ExecutionContext; await this.update(childName, { id: depId, [fieldName]: null }, { context: referentialCtx } as any); } } @@ -7358,7 +7362,7 @@ export class ObjectQL implements IObjectQLEngine { export class ObjectRepository implements IScopedObjectRepository { constructor( private objectName: string, - private context: ExecutionContextInput, + private context: ExecutionContext, private engine: IDataEngine & { executeAction?: (o: string, a: string, c: any) => Promise } ) {} @@ -7461,7 +7465,7 @@ export class ObjectRepository implements IScopedObjectRepository { */ export class ScopedContext implements IScopedContext { constructor( - private executionContext: ExecutionContextInput, + private executionContext: ExecutionContext, private engine: IDataEngine ) {} diff --git a/packages/objectql/src/hook-input-shape-contract.test.ts b/packages/objectql/src/hook-input-shape-contract.test.ts index 95ef831a7e..5555d83aec 100644 --- a/packages/objectql/src/hook-input-shape-contract.test.ts +++ b/packages/objectql/src/hook-input-shape-contract.test.ts @@ -82,7 +82,7 @@ describe('[#5273] a bulk write carries no `ast` on `input`', () => { const { engine } = await boot(); engine.registerHook('beforeFind', async (ctx: any) => { seen.push(ctx.input); }, { object: 'task' }); - // No `as any` on the options: `find(object, query?: EngineQueryOptions)` + // No `as any` on the options: `find(object, query?: EngineQueryOptionsParsed)` // already infers an empty query, and erasing it would add a site to the // #4918 query-options ratchet (`check:query-options-erasure`) for no gain — // this call is in-contract, not a deliberate off-contract probe. diff --git a/packages/platform-objects/src/apps/account.app.ts b/packages/platform-objects/src/apps/account.app.ts index 6edf6277c3..80c8448d38 100644 --- a/packages/platform-objects/src/apps/account.app.ts +++ b/packages/platform-objects/src/apps/account.app.ts @@ -27,9 +27,9 @@ * self-service view, platform admins get the browsable tables. */ -import type { AppInput } from '@objectstack/spec/ui'; +import type { App } from '@objectstack/spec/ui'; -export const ACCOUNT_APP: AppInput = { +export const ACCOUNT_APP: App = { name: 'account', label: 'Account', description: 'Personal security and identity settings', diff --git a/packages/platform-objects/src/apps/setup-nav.contributions.ts b/packages/platform-objects/src/apps/setup-nav.contributions.ts index 5871922c2b..3fff63011c 100644 --- a/packages/platform-objects/src/apps/setup-nav.contributions.ts +++ b/packages/platform-objects/src/apps/setup-nav.contributions.ts @@ -22,14 +22,14 @@ * contributions in the same group (mirrors object owner priority). */ -import type { NavigationContributionInput } from '@objectstack/spec/ui'; +import type { NavigationContribution } from '@objectstack/spec/ui'; const BASE_PRIORITY = 100; // Marketplace entries (browse / installed) moved to // @objectstack/cloud-connection's marketplace plugins (cloud ADR-0009: // the nav lives and dies with the capability — no plugin, no entry). -export const SETUP_NAV_CONTRIBUTIONS: NavigationContributionInput[] = [ +export const SETUP_NAV_CONTRIBUTIONS: NavigationContribution[] = [ { app: 'setup', group: 'group_overview', diff --git a/packages/platform-objects/src/apps/setup.app.ts b/packages/platform-objects/src/apps/setup.app.ts index 4e44a7f64f..4d0bba95f4 100644 --- a/packages/platform-objects/src/apps/setup.app.ts +++ b/packages/platform-objects/src/apps/setup.app.ts @@ -25,9 +25,9 @@ * matching the convention used by the HotCRM reference app. */ -import type { AppInput } from '@objectstack/spec/ui'; +import type { App } from '@objectstack/spec/ui'; -export const SETUP_APP: AppInput = { +export const SETUP_APP: App = { name: 'setup', label: 'Setup', description: 'Platform settings and administration', diff --git a/packages/platform-objects/src/apps/studio.app.ts b/packages/platform-objects/src/apps/studio.app.ts index 5fbe640dec..5f87f93e60 100644 --- a/packages/platform-objects/src/apps/studio.app.ts +++ b/packages/platform-objects/src/apps/studio.app.ts @@ -25,9 +25,9 @@ * the box whenever the auth/security trio is loaded. */ -import type { AppInput } from '@objectstack/spec/ui'; +import type { App } from '@objectstack/spec/ui'; -export const STUDIO_APP: AppInput = { +export const STUDIO_APP: App = { name: 'studio', label: 'Studio', description: 'Metadata workbench for developers, analysts, and implementers', diff --git a/packages/plugins/plugin-security/src/delegated-admin-gate.ts b/packages/plugins/plugin-security/src/delegated-admin-gate.ts index cccf135e80..07ee0a9ff2 100644 --- a/packages/plugins/plugin-security/src/delegated-admin-gate.ts +++ b/packages/plugins/plugin-security/src/delegated-admin-gate.ts @@ -38,7 +38,7 @@ */ import { isGrantActive } from '@objectstack/core'; -import type { AdminScope, PermissionSet } from '@objectstack/spec/security'; +import type { AdminScope, AdminScopeParsed, PermissionSet } from '@objectstack/spec/security'; import { PermissionDeniedError } from './errors.js'; const SYSTEM_CTX = { isSystem: true } as const; @@ -121,7 +121,14 @@ export interface DelegableScopeReport { interface HeldScope { /** The set that carries the scope (for error messages). */ setName: string; - scope: AdminScope & { assignablePermissionSets: string[] }; + /** + * The scope as `resolveHeldScopes` NORMALISES it, not as it was authored: + * every flag there is forced to a boolean (`!== false` / `=== true`) and the + * allowlist to a string[]. So this names the PARSED shape (ADR-0122) — the + * authored one, which arrives as raw JSON and may state none of them, is + * `AdminScope` and appears at the two `parseMaybeJson` sites below. + */ + scope: AdminScopeParsed & { assignablePermissionSets: string[] }; /** Resolved BU ids covered (root + descendants when includeSubtree). Empty = misconfigured → approves nothing. */ subtree: Set; } diff --git a/packages/plugins/plugin-security/src/permission-evaluator.ts b/packages/plugins/plugin-security/src/permission-evaluator.ts index 49f809b817..eb1a1ec11e 100644 --- a/packages/plugins/plugin-security/src/permission-evaluator.ts +++ b/packages/plugins/plugin-security/src/permission-evaluator.ts @@ -1,6 +1,6 @@ // Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license. -import type { PermissionSet, ObjectPermission, FieldPermission } from '@objectstack/spec/security'; +import type { PermissionSet, ObjectPermission, FieldPermissionParsed } from '@objectstack/spec/security'; /** * Operation type mapping to permission checks. @@ -349,8 +349,8 @@ export class PermissionEvaluator { getFieldPermissions( objectName: string, permissionSets: PermissionSet[] - ): Record { - const result: Record = {}; + ): Record { + const result: Record = {}; for (const ps of permissionSets) { if (!ps.fields) continue; diff --git a/packages/qa/dogfood/test/fixtures/endpoint-policy-fixture.ts b/packages/qa/dogfood/test/fixtures/endpoint-policy-fixture.ts index 5e95c9a650..080e26d82d 100644 --- a/packages/qa/dogfood/test/fixtures/endpoint-policy-fixture.ts +++ b/packages/qa/dogfood/test/fixtures/endpoint-policy-fixture.ts @@ -32,7 +32,7 @@ import { defineStack } from '@objectstack/spec'; import { ObjectSchema, Field } from '@objectstack/spec/data'; -import type { ApiEndpoint, ApiEndpointInput } from '@objectstack/spec/api'; +import type { ApiEndpoint } from '@objectstack/spec/api'; /** One object, so the `object_operation` endpoints have something real to read. */ export const PolicyNote = ObjectSchema.create({ @@ -63,7 +63,7 @@ export const AnonymousMeteredEndpoint: ApiEndpoint = { }; /** The control: same object, same operation, session-gated, unmetered. */ -export const SessionGatedEndpoint: ApiEndpointInput = { +export const SessionGatedEndpoint: ApiEndpoint = { name: 'e8policy_private_notes', path: '/api/v1/apps/e8policy/private-notes', method: 'GET', @@ -76,7 +76,7 @@ export const SessionGatedEndpoint: ApiEndpointInput = { // upgrade guide's central claim is that an omission is safe. This endpoint is // what makes that claim testable rather than asserted. // - // Typed `ApiEndpointInput` rather than `ApiEndpoint` for exactly that reason: + // Typed `ApiEndpoint` rather than `ApiEndpoint` for exactly that reason: // `ApiEndpoint` is the schema's OUTPUT type, where `.default(true)` has // already been materialised and `authRequired` is therefore REQUIRED. A TS // author who annotates `: ApiEndpoint` cannot express the omission at all — diff --git a/packages/qa/downstream-contract/README.md b/packages/qa/downstream-contract/README.md index f1df2276fa..fae002f9ea 100644 --- a/packages/qa/downstream-contract/README.md +++ b/packages/qa/downstream-contract/README.md @@ -34,7 +34,8 @@ So if a change here turns red: ## What it checks - `pnpm --filter @objectstack/downstream-contract typecheck` — the fixtures are typed - with real spec types (`ActionInput`, `ReportInput`, `PageInput`, …). A removed or + with real spec author-state types (`Action`, `Report`, `Page`, …; spelled `XInput` + until ADR-0122 phase 2 retired those synonyms in protocol 17). A removed or narrowed export fails here (the #2023 class of break). - `pnpm --filter @objectstack/downstream-contract test` — runs each bare-literal fixture through its schema's `.parse()` and assembles everything via `defineStack` (schema + diff --git a/packages/qa/downstream-contract/src/additional-domains.fixtures.ts b/packages/qa/downstream-contract/src/additional-domains.fixtures.ts index e1c0adcbff..fe312bca7d 100644 --- a/packages/qa/downstream-contract/src/additional-domains.fixtures.ts +++ b/packages/qa/downstream-contract/src/additional-domains.fixtures.ts @@ -3,17 +3,26 @@ // FROZEN bare-literal fixtures for the remaining authoring domains (#2035), so // the downstream contract exercises the FULL writable surface, not just a few // domains. Authored the way a third party on a published release did, typed with -// the spec's own input aliases. DO NOT migrate these to the defineX factories -// and DO NOT edit them to make a failing spec change pass — see the README. -import type { DatasourceInput, MappingInput, CubeInput, ObjectExtensionInput } from '@objectstack/spec/data'; -import type { ConnectorInput } from '@objectstack/spec/integration'; -import type { SharingRuleInput, PermissionSetInput } from '@objectstack/spec/security'; -import type { PositionInput } from '@objectstack/spec/identity'; -import type { EmailTemplateDefinitionInput, TranslationBundleInput } from '@objectstack/spec/system'; -import type { WebhookInput } from '@objectstack/spec/automation'; -import type { ThemeInput } from '@objectstack/spec/ui'; +// the spec's own author-state aliases. DO NOT migrate these to the defineX +// factories and DO NOT edit them to make a failing spec change pass — see the +// README. +// +// The annotations moved from `XInput` to the BARE name in protocol 17 +// (ADR-0122 phase 2, #6083) and that is not an exception to the freeze — it is +// the freeze working. These fixtures pin the AUTHOR state; phase 2 moved the +// author state onto the bare name and retired `XInput` as a synonym of it, so +// keeping `XInput` here was not an option and switching to it was not a choice. +// Every literal below is byte-for-byte what it was: the type each one is +// checked against did not change, only its spelling. +import type { Datasource, Mapping, Cube, ObjectExtension } from '@objectstack/spec/data'; +import type { Connector } from '@objectstack/spec/integration'; +import type { SharingRule, PermissionSet } from '@objectstack/spec/security'; +import type { Position } from '@objectstack/spec/identity'; +import type { EmailTemplateDefinition, TranslationBundle } from '@objectstack/spec/system'; +import type { Webhook } from '@objectstack/spec/automation'; +import type { Theme } from '@objectstack/spec/ui'; -export const DcDatasource: DatasourceInput = { +export const DcDatasource: Datasource = { name: 'dc_primary', label: 'DC Primary', driver: 'sqlite', @@ -21,7 +30,7 @@ export const DcDatasource: DatasourceInput = { active: true, }; -export const DcConnector: ConnectorInput = { +export const DcConnector: Connector = { name: 'dc_hubspot', label: 'DC HubSpot', type: 'saas', @@ -43,7 +52,7 @@ export const DcConnector: ConnectorInput = { ], }; -export const DcSharingRule: SharingRuleInput = { +export const DcSharingRule: SharingRule = { type: 'criteria', name: 'dc_share_customers', label: 'Customers → managers', @@ -54,13 +63,13 @@ export const DcSharingRule: SharingRuleInput = { active: true, }; -export const DcRole: PositionInput = { +export const DcRole: Position = { name: 'dc_manager', label: 'DC Manager', description: 'Manager role.', }; -export const DcPermissionSet: PermissionSetInput = { +export const DcPermissionSet: PermissionSet = { name: 'dc_user', label: 'DC User', objects: { @@ -68,7 +77,7 @@ export const DcPermissionSet: PermissionSetInput = { }, }; -export const DcEmail: EmailTemplateDefinitionInput = { +export const DcEmail: EmailTemplateDefinition = { name: 'dc.welcome', label: 'DC Welcome', category: 'marketing', @@ -80,7 +89,7 @@ export const DcEmail: EmailTemplateDefinitionInput = { active: true, }; -export const DcWebhook: WebhookInput = { +export const DcWebhook: Webhook = { name: 'dc_account_changed', label: 'Account Changed', object: 'dc_account', @@ -90,7 +99,7 @@ export const DcWebhook: WebhookInput = { isActive: true, }; -export const DcObjectExtension: ObjectExtensionInput = { +export const DcObjectExtension: ObjectExtension = { extend: 'dc_account', label: 'Account (extended)', fields: { @@ -99,7 +108,7 @@ export const DcObjectExtension: ObjectExtensionInput = { priority: 210, }; -export const DcCube: CubeInput = { +export const DcCube: Cube = { name: 'dc_pipeline', title: 'DC Pipeline', description: 'Account analytics.', @@ -112,7 +121,7 @@ export const DcCube: CubeInput = { }, }; -export const DcMapping: MappingInput = { +export const DcMapping: Mapping = { name: 'dc_csv_import', label: 'CSV Import: Accounts', sourceFormat: 'csv', @@ -122,7 +131,7 @@ export const DcMapping: MappingInput = { fieldMapping: [{ source: 'Name', target: 'name', transform: 'none' }], }; -export const DcTheme: ThemeInput = { +export const DcTheme: Theme = { name: 'dc_light', label: 'DC Light', mode: 'light', @@ -135,7 +144,7 @@ export const DcTheme: ThemeInput = { }, }; -export const DcTranslationBundle: TranslationBundleInput = { +export const DcTranslationBundle: TranslationBundle = { en: { objects: { dc_account: { label: 'Account', pluralLabel: 'Accounts' } }, messages: { 'common.save': 'Save' }, diff --git a/packages/qa/downstream-contract/src/log-call.action.ts b/packages/qa/downstream-contract/src/log-call.action.ts index 6bc38f3be6..a34a18d205 100644 --- a/packages/qa/downstream-contract/src/log-call.action.ts +++ b/packages/qa/downstream-contract/src/log-call.action.ts @@ -4,9 +4,9 @@ // party on an older spec did (#2035). No author-time `.parse()` runs here; only // the contract test's schema parse validates it. DO NOT migrate this to the // factory — that would hide the backward-compat break this file exists to catch. -import type { ActionInput } from '@objectstack/spec/ui'; +import type { Action } from '@objectstack/spec/ui'; -export const LogCallAction: ActionInput = { +export const LogCallAction: Action = { name: 'dc_log_call', label: 'Log Call', objectName: 'dc_account', diff --git a/packages/qa/downstream-contract/src/pipeline.report.ts b/packages/qa/downstream-contract/src/pipeline.report.ts index 040c37dcab..173b9b0664 100644 --- a/packages/qa/downstream-contract/src/pipeline.report.ts +++ b/packages/qa/downstream-contract/src/pipeline.report.ts @@ -1,9 +1,9 @@ // Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license. // FROZEN bare-literal fixture (see log-call.action.ts). -import type { ReportInput } from '@objectstack/spec/ui'; +import type { Report } from '@objectstack/spec/ui'; -export const AccountsByStageReport: ReportInput = { +export const AccountsByStageReport: Report = { name: 'dc_accounts_by_stage', label: 'Accounts by Stage', description: 'Account count grouped by stage.', diff --git a/packages/qa/downstream-contract/src/welcome.page.ts b/packages/qa/downstream-contract/src/welcome.page.ts index 6dd419c130..1bc0ac3fe4 100644 --- a/packages/qa/downstream-contract/src/welcome.page.ts +++ b/packages/qa/downstream-contract/src/welcome.page.ts @@ -3,9 +3,9 @@ // FROZEN bare-literal fixture (see log-call.action.ts). Pages were one of the // 16 domains with no factory before #2035, so real third parties authored them // exactly like this. -import type { PageInput } from '@objectstack/spec/ui'; +import type { Page } from '@objectstack/spec/ui'; -export const WelcomePage: PageInput = { +export const WelcomePage: Page = { name: 'dc_welcome', label: 'Welcome', type: 'home', diff --git a/packages/rest/src/rest-server.ts b/packages/rest/src/rest-server.ts index de745762f5..bd73faa9a4 100644 --- a/packages/rest/src/rest-server.ts +++ b/packages/rest/src/rest-server.ts @@ -2934,12 +2934,16 @@ export class RestServer { responseFormat: api.responseFormat, }, crud: { - operations: crud.operations ?? { - create: true, - read: true, - update: true, - delete: true, - list: true, + // Per key, not per object: since ADR-0122 `crud.operations` is the + // AUTHOR state, so a caller may enable three of the five and leave the + // rest to the schema's own per-key `.default(true)`. `??` on the whole + // object would only have filled it when it was absent entirely. + operations: { + create: crud.operations?.create ?? true, + read: crud.operations?.read ?? true, + update: crud.operations?.update ?? true, + delete: crud.operations?.delete ?? true, + list: crud.operations?.list ?? true, }, patterns: crud.patterns, dataPrefix: crud.dataPrefix ?? '/data', @@ -2949,21 +2953,21 @@ export class RestServer { prefix: metadata.prefix ?? '/meta', enableCache: metadata.enableCache ?? true, cacheTtl: metadata.cacheTtl ?? 3600, - endpoints: metadata.endpoints ?? { - types: true, - items: true, - item: true, - schema: true, + endpoints: { + types: metadata.endpoints?.types ?? true, + items: metadata.endpoints?.items ?? true, + item: metadata.endpoints?.item ?? true, + schema: metadata.endpoints?.schema ?? true, }, }, batch: { maxBatchSize: batch.maxBatchSize ?? 200, enableBatchEndpoint: batch.enableBatchEndpoint ?? true, - operations: batch.operations ?? { - createMany: true, - updateMany: true, - deleteMany: true, - upsertMany: true, + operations: { + createMany: batch.operations?.createMany ?? true, + updateMany: batch.operations?.updateMany ?? true, + deleteMany: batch.operations?.deleteMany ?? true, + upsertMany: batch.operations?.upsertMany ?? true, }, defaultAtomic: batch.defaultAtomic ?? true, }, diff --git a/packages/runtime/src/runtime.ts b/packages/runtime/src/runtime.ts index 2a25a2c04d..e41ce2b97c 100644 --- a/packages/runtime/src/runtime.ts +++ b/packages/runtime/src/runtime.ts @@ -6,7 +6,7 @@ import { MetadataClusterBridgePlugin, type ClusterServicePluginOptions, } from '@objectstack/service-cluster'; -import type { ClusterCapabilityConfigInput } from '@objectstack/spec/kernel'; +import type { ClusterCapabilityConfig } from '@objectstack/spec/kernel'; export interface RuntimeConfig { /** @@ -27,12 +27,12 @@ export interface RuntimeConfig { * - Omit (default): a single-node `memory` cluster is auto-registered. * - `false`: skip auto-registration entirely. Register your own * `ClusterServicePlugin` if you need it later. - * - `ClusterCapabilityConfigInput`: forwarded to `defineCluster()`. + * - `ClusterCapabilityConfig`: forwarded to `defineCluster()`. * - `{ cluster: IClusterService }`: bring your own instance. * * See `content/docs/kernel/cluster.mdx` for driver options. */ - cluster?: false | ClusterCapabilityConfigInput | ClusterServicePluginOptions; + cluster?: false | ClusterCapabilityConfig | ClusterServicePluginOptions; } /** @@ -86,8 +86,8 @@ export class Runtime { ) { return raw as ClusterServicePluginOptions; } - // Otherwise treat as `ClusterCapabilityConfigInput`. - return { config: raw as ClusterCapabilityConfigInput }; + // Otherwise treat as `ClusterCapabilityConfig`. + return { config: raw as ClusterCapabilityConfig }; } /** diff --git a/packages/runtime/src/sandbox/quickjs-runner.ts b/packages/runtime/src/sandbox/quickjs-runner.ts index 9f5964ca28..5d29bcc619 100644 --- a/packages/runtime/src/sandbox/quickjs-runner.ts +++ b/packages/runtime/src/sandbox/quickjs-runner.ts @@ -114,7 +114,10 @@ export class QuickJSScriptRunner implements ScriptRunner { return this.execute({ isExpression: false, source: body.source, - capabilities: body.capabilities, + // `ScriptBody` is the AUTHOR state since ADR-0122 and `capabilities` carries + // `.default([])`, so the runner states that default rather than passing + // `undefined` into a Set constructor typed for an array. + capabilities: body.capabilities ?? [], timeoutMs: this.resolveTimeout(opts, body.timeoutMs), memoryMb: body.memoryMb ?? this.opts.memoryMb, ctx, diff --git a/packages/services/service-cluster/src/cluster-service-plugin.ts b/packages/services/service-cluster/src/cluster-service-plugin.ts index 362c65e82c..34ecb12a8f 100644 --- a/packages/services/service-cluster/src/cluster-service-plugin.ts +++ b/packages/services/service-cluster/src/cluster-service-plugin.ts @@ -2,7 +2,7 @@ import type { Plugin, PluginContext } from '@objectstack/core'; import type { IClusterService } from '@objectstack/spec/contracts'; -import type { ClusterCapabilityConfigInput } from '@objectstack/spec/kernel'; +import type { ClusterCapabilityConfig } from '@objectstack/spec/kernel'; import { defineCluster } from './cluster.js'; import { assertClusterDriverSafeForTopology } from './split-brain-guard.js'; @@ -18,7 +18,7 @@ export interface ClusterServicePluginOptions { /** Pre-built cluster service. Wins over `config` when both provided. */ cluster?: IClusterService; /** Config forwarded to `defineCluster()` when `cluster` is absent. */ - config?: ClusterCapabilityConfigInput; + config?: ClusterCapabilityConfig; } /** diff --git a/packages/services/service-cluster/src/cluster.ts b/packages/services/service-cluster/src/cluster.ts index 9cb58d9f6f..757545b5b1 100644 --- a/packages/services/service-cluster/src/cluster.ts +++ b/packages/services/service-cluster/src/cluster.ts @@ -7,7 +7,7 @@ import type { IKV, ICounter, } from '@objectstack/spec/contracts'; -import type { ClusterCapabilityConfigInput } from '@objectstack/spec/kernel'; +import type { ClusterCapabilityConfig } from '@objectstack/spec/kernel'; import { ClusterCapabilityConfigSchema } from '@objectstack/spec/kernel'; import { MemoryPubSub } from './memory/pubsub.js'; @@ -54,7 +54,7 @@ export class ComposedClusterService implements IClusterService { * await cluster.pubsub.publish('metadata.changed', { id: 'x' }); */ export function defineCluster( - config: ClusterCapabilityConfigInput = {}, + config: ClusterCapabilityConfig = {}, ): IClusterService { const parsed = ClusterCapabilityConfigSchema.parse(config); const nodeId = parsed.nodeId ?? generateNodeId(); diff --git a/packages/services/service-datasource/src/external-datasource-service.ts b/packages/services/service-datasource/src/external-datasource-service.ts index a2fbadff03..52f95d136c 100644 --- a/packages/services/service-datasource/src/external-datasource-service.ts +++ b/packages/services/service-datasource/src/external-datasource-service.ts @@ -463,9 +463,9 @@ function renderObjectSource( return [ `// Generated by \`os datasource introspect\` (ADR-0015). Review before committing.`, - `import type { ServiceObjectInput } from '@objectstack/spec/data';`, + `import type { ServiceObject } from '@objectstack/spec/data';`, ``, - `const ${definition.name as string}: ServiceObjectInput = {`, + `const ${definition.name as string}: ServiceObject = {`, ` name: '${definition.name as string}',`, ` label: '${definition.label as string}',`, ` datasource: '${definition.datasource as string}',`, diff --git a/packages/spec/DEVELOPMENT_PLAN.md b/packages/spec/DEVELOPMENT_PLAN.md index 13a21f471f..b5a2967cb2 100644 --- a/packages/spec/DEVELOPMENT_PLAN.md +++ b/packages/spec/DEVELOPMENT_PLAN.md @@ -433,9 +433,9 @@ Already replaced by `locations` array. Remove the deprecated field. Following `ui/report.zod.ts` as the pattern, add `z.input<>` exports to all schemas that use `.default()` or `.transform()`: ```typescript -// Pattern: Export both output and input types -export type Report = z.infer; // output (after parse) -export type ReportInput = z.input; // input (before parse) +// Pattern (ADR-0122): the bare name is the AUTHOR state, XParsed the parse result +export type Report = z.input; // input (before parse) +export type ReportParsed = z.infer; // output (after parse) ``` **Target files:** All schemas with `.default()` or `.transform()` — especially in `ui/`, `data/object.zod.ts`, `kernel/manifest.zod.ts`. diff --git a/packages/spec/api-surface-signatures.json b/packages/spec/api-surface-signatures.json index 1d7d2eeb36..61cbb5119e 100644 --- a/packages/spec/api-surface-signatures.json +++ b/packages/spec/api-surface-signatures.json @@ -1,30 +1,30 @@ { - "defineAction": "sha256:2965269f1fa49863", - "defineAgent": "sha256:130533285b3deea4", - "defineApp": "sha256:bef0d76d5076259a", + "defineAction": "sha256:086070ce124bd43e", + "defineAgent": "sha256:984ce178f9c76408", + "defineApp": "sha256:e899b527075f8834", "defineBook": "sha256:07a6e25c6be3f3bd", "defineCapability": "sha256:b080cc5480782d6c", - "defineConnector": "sha256:827b4a4bb56a83b5", - "defineCube": "sha256:635855b04c960946", - "defineDatasource": "sha256:e0ec3b5f9db26aca", - "defineEmailTemplateDefinition": "sha256:a50aa92001c427ea", + "defineConnector": "sha256:d1b857d07a6a14b6", + "defineCube": "sha256:b7e89a888ed6f52b", + "defineDatasource": "sha256:5f4aec18b148c77b", + "defineEmailTemplateDefinition": "sha256:c1d86a5f074ed7ff", "defineFlow": "sha256:54b60bb867083f61", - "defineForm": "sha256:e009563c8667cfc9", + "defineForm": "sha256:8d5aab9ae1a79219", "defineHook": "sha256:8de712350ec58845", - "defineJob": "sha256:04331c2df9a572eb", - "defineMapping": "sha256:04c233ba6d0f5ab6", - "defineObjectExtension": "sha256:5286253308912bb1", - "definePage": "sha256:e80363c256809a11", - "definePermissionSet": "sha256:67b188ae181994cd", - "definePosition": "sha256:a29bcf5084d08518", - "defineReport": "sha256:f7e85ba0996a5824", - "defineSharingRule": "sha256:03347645bbda2880", - "defineSkill": "sha256:4476c343f35b1521", + "defineJob": "sha256:e0e927ebb165d48d", + "defineMapping": "sha256:c9458652cca717da", + "defineObjectExtension": "sha256:3b4099069f01adfb", + "definePage": "sha256:770a5cdb49ceba18", + "definePermissionSet": "sha256:78d05bdfde46dc0d", + "definePosition": "sha256:e11854797497e5e9", + "defineReport": "sha256:044acff031d89910", + "defineSharingRule": "sha256:239e6649b55712a4", + "defineSkill": "sha256:b928cee8cb3c2861", "defineStack": "sha256:4d36d9603c011c44", - "defineTheme": "sha256:2684b50ef808d236", + "defineTheme": "sha256:21563e61ca2209e8", "defineTool": "sha256:47ab5254a14f1cf5", "defineTranslationBundle": "sha256:2716798bbd575af2", - "defineView": "sha256:a6abada0cf819dac", + "defineView": "sha256:00cf9d0d2f44e843", "defineViewItem": "sha256:7043cc1e7214215d", - "defineWebhook": "sha256:1469ced0bffbddca" + "defineWebhook": "sha256:2140f9f797563709" } diff --git a/packages/spec/api-surface/api.json b/packages/spec/api-surface/api.json index 9b9114c544..f1f253ac7b 100644 --- a/packages/spec/api-surface/api.json +++ b/packages/spec/api-surface/api.json @@ -48,7 +48,6 @@ "ApiDocumentationConfigParsed (type)", "ApiDocumentationConfigSchema (const)", "ApiEndpoint (type)", - "ApiEndpointInput (type)", "ApiEndpointParsed (type)", "ApiEndpointSchema (const)", "ApiError (type)", @@ -109,12 +108,12 @@ "BatchConfigParsed (type)", "BatchConfigSchema (const)", "BatchDataRequest (type)", + "BatchDataRequestParsed (type)", "BatchDataRequestSchema (const)", "BatchDataResponse (type)", "BatchDataResponseParsed (type)", "BatchDataResponseSchema (const)", "BatchEndpointsConfig (type)", - "BatchEndpointsConfigInput (type)", "BatchEndpointsConfigParsed (type)", "BatchEndpointsConfigSchema (const)", "BatchLoadingStrategy (type)", @@ -130,6 +129,7 @@ "BatchRecord (type)", "BatchRecordSchema (const)", "BatchUpdateRequest (type)", + "BatchUpdateRequestParsed (type)", "BatchUpdateRequestSchema (const)", "BatchUpdateResponse (type)", "BatchUpdateResponseParsed (type)", @@ -184,6 +184,7 @@ "CreateExportJobResponseParsed (type)", "CreateExportJobResponseSchema (const)", "CreateFlowRequest (type)", + "CreateFlowRequestParsed (type)", "CreateFlowRequestSchema (const)", "CreateFlowResponse (type)", "CreateFlowResponseParsed (type)", @@ -200,6 +201,7 @@ "CreateRequest (type)", "CreateRequestSchema (const)", "CreateViewRequest (type)", + "CreateViewRequestParsed (type)", "CreateViewRequestSchema (const)", "CreateViewResponse (type)", "CreateViewResponseParsed (type)", @@ -207,15 +209,16 @@ "CrossObjectBatchDroppedFields (type)", "CrossObjectBatchDroppedFieldsSchema (const)", "CrossObjectBatchOperation (type)", + "CrossObjectBatchOperationParsed (type)", "CrossObjectBatchOperationSchema (const)", "CrossObjectBatchRequest (type)", + "CrossObjectBatchRequestParsed (type)", "CrossObjectBatchRequestSchema (const)", "CrossObjectBatchResponse (type)", "CrossObjectBatchResponseSchema (const)", "CrudEndpointPattern (type)", "CrudEndpointPatternSchema (const)", "CrudEndpointsConfig (type)", - "CrudEndpointsConfigInput (type)", "CrudEndpointsConfigParsed (type)", "CrudEndpointsConfigSchema (const)", "CrudOperation (type)", @@ -250,6 +253,7 @@ "DeleteFlowResponseParsed (type)", "DeleteFlowResponseSchema (const)", "DeleteManyDataRequest (type)", + "DeleteManyDataRequestParsed (type)", "DeleteManyDataRequestSchema (const)", "DeleteManyDataResponse (type)", "DeleteManyDataResponseParsed (type)", @@ -282,14 +286,12 @@ "DiscoveryResponse (type)", "DiscoverySchema (const)", "DispatcherConfig (type)", - "DispatcherConfigInput (type)", "DispatcherConfigParsed (type)", "DispatcherConfigSchema (const)", "DispatcherErrorCode (type)", "DispatcherErrorResponse (type)", "DispatcherErrorResponseSchema (const)", "DispatcherRoute (type)", - "DispatcherRouteInput (type)", "DispatcherRouteParsed (type)", "DispatcherRouteSchema (const)", "DocumentState (type)", @@ -321,7 +323,6 @@ "ErrorCategory (type)", "ErrorCode (type)", "ErrorHandlingConfig (type)", - "ErrorHandlingConfigInput (type)", "ErrorHandlingConfigParsed (type)", "ErrorHandlingConfigSchema (const)", "ErrorHttpStatusMap (const)", @@ -365,6 +366,7 @@ "FileUploadResponseParsed (type)", "FileUploadResponseSchema (const)", "FindDataRequest (type)", + "FindDataRequestParsed (type)", "FindDataRequestSchema (const)", "FindDataResponse (type)", "FindDataResponseSchema (const)", @@ -550,6 +552,7 @@ "ListInstalledPackagesResponseParsed (type)", "ListInstalledPackagesResponseSchema (const)", "ListNotificationsRequest (type)", + "ListNotificationsRequestParsed (type)", "ListNotificationsRequestSchema (const)", "ListNotificationsResponse (type)", "ListNotificationsResponseParsed (type)", @@ -573,7 +576,6 @@ "ListViewsResponseParsed (type)", "ListViewsResponseSchema (const)", "LoginRequest (type)", - "LoginRequestInput (type)", "LoginRequestParsed (type)", "LoginRequestSchema (const)", "LoginType (type)", @@ -586,6 +588,7 @@ "MarkNotificationsReadResponse (type)", "MarkNotificationsReadResponseSchema (const)", "MetadataBulkRegisterRequest (type)", + "MetadataBulkRegisterRequestParsed (type)", "MetadataBulkRegisterRequestSchema (const)", "MetadataBulkResponse (type)", "MetadataBulkResponseParsed (type)", @@ -610,7 +613,6 @@ "MetadataEffectiveResponseParsed (type)", "MetadataEffectiveResponseSchema (const)", "MetadataEndpointsConfig (type)", - "MetadataEndpointsConfigInput (type)", "MetadataEndpointsConfigParsed (type)", "MetadataEndpointsConfigSchema (const)", "MetadataEvent (type)", @@ -662,10 +664,8 @@ "ModificationResultParsed (type)", "ModificationResultSchema (const)", "Notification (type)", - "NotificationInput (type)", "NotificationParsed (type)", "NotificationPreferences (type)", - "NotificationPreferencesInput (type)", "NotificationPreferencesParsed (type)", "NotificationPreferencesSchema (const)", "NotificationProtocol (interface)", @@ -683,7 +683,6 @@ "ODataMetadataSchema (const)", "ODataQuery (type)", "ODataQueryAdapter (type)", - "ODataQueryAdapterInput (type)", "ODataQueryAdapterParsed (type)", "ODataQueryAdapterSchema (const)", "ODataQuerySchema (const)", @@ -693,7 +692,6 @@ "ObjectDefinitionResponseParsed (type)", "ObjectDefinitionResponseSchema (const)", "OpenApiGenerationConfig (type)", - "OpenApiGenerationConfigInput (type)", "OpenApiGenerationConfigParsed (type)", "OpenApiGenerationConfigSchema (const)", "OpenApiSecurityScheme (type)", @@ -745,7 +743,6 @@ "PresignedUrlResponseParsed (type)", "PresignedUrlResponseSchema (const)", "QueryAdapterConfig (type)", - "QueryAdapterConfigInput (type)", "QueryAdapterConfigParsed (type)", "QueryAdapterConfigSchema (const)", "QueryAdapterTarget (type)", @@ -797,7 +794,6 @@ "RejectAiPendingActionResponse (type)", "RejectAiPendingActionResponseSchema (const)", "RequestValidationConfig (type)", - "RequestValidationConfigInput (type)", "RequestValidationConfigParsed (type)", "RequestValidationConfigSchema (const)", "ResolveDependenciesRequest (type)", @@ -807,18 +803,15 @@ "ResolveDependenciesResponseParsed (type)", "ResolveDependenciesResponseSchema (const)", "ResponseEnvelopeConfig (type)", - "ResponseEnvelopeConfigInput (type)", "ResponseEnvelopeConfigParsed (type)", "ResponseEnvelopeConfigSchema (const)", "RestApiConfig (type)", - "RestApiConfigInput (type)", "RestApiConfigParsed (type)", "RestApiConfigSchema (const)", "RestApiEndpoint (type)", "RestApiEndpointParsed (type)", "RestApiEndpointSchema (const)", "RestApiPluginConfig (type)", - "RestApiPluginConfigInput (type)", "RestApiPluginConfigParsed (type)", "RestApiPluginConfigSchema (const)", "RestApiRouteCategory (type)", @@ -826,11 +819,9 @@ "RestApiRouteRegistrationParsed (type)", "RestApiRouteRegistrationSchema (const)", "RestQueryAdapter (type)", - "RestQueryAdapterInput (type)", "RestQueryAdapterParsed (type)", "RestQueryAdapterSchema (const)", "RestServerConfig (type)", - "RestServerConfigInput (type)", "RestServerConfigParsed (type)", "RestServerConfigSchema (const)", "RetryStrategy (type)", @@ -843,7 +834,6 @@ "RouteDefinitionParsed (type)", "RouteDefinitionSchema (const)", "RouteGenerationConfig (type)", - "RouteGenerationConfigInput (type)", "RouteGenerationConfigParsed (type)", "RouteGenerationConfigSchema (const)", "RouteHealthEntry (type)", @@ -878,7 +868,6 @@ "SessionResponseSchema (const)", "SessionSchema (const)", "SessionUser (type)", - "SessionUserInput (type)", "SessionUserParsed (type)", "SessionUserSchema (const)", "SetPresenceRequest (type)", @@ -943,6 +932,7 @@ "UpdateFlowResponseParsed (type)", "UpdateFlowResponseSchema (const)", "UpdateManyDataRequest (type)", + "UpdateManyDataRequestParsed (type)", "UpdateManyDataRequestSchema (const)", "UpdateManyDataResponse (type)", "UpdateManyDataResponseParsed (type)", @@ -950,8 +940,10 @@ "UpdateManyRecord (type)", "UpdateManyRecordSchema (const)", "UpdateManyRequest (type)", + "UpdateManyRequestParsed (type)", "UpdateManyRequestSchema (const)", "UpdateNotificationPreferencesRequest (type)", + "UpdateNotificationPreferencesRequestParsed (type)", "UpdateNotificationPreferencesRequestSchema (const)", "UpdateNotificationPreferencesResponse (type)", "UpdateNotificationPreferencesResponseParsed (type)", @@ -959,6 +951,7 @@ "UpdateRequest (type)", "UpdateRequestSchema (const)", "UpdateViewRequest (type)", + "UpdateViewRequestParsed (type)", "UpdateViewRequestSchema (const)", "UpdateViewResponse (type)", "UpdateViewResponseParsed (type)", @@ -987,7 +980,6 @@ "VersionNegotiationResponseSchema (const)", "VersionStatus (type)", "VersioningConfig (type)", - "VersioningConfigInput (type)", "VersioningConfigParsed (type)", "VersioningConfigSchema (const)", "VersioningStrategy (type)", diff --git a/packages/spec/api-surface/automation.json b/packages/spec/api-surface/automation.json index 4f68a6fa0e..31d4703e7d 100644 --- a/packages/spec/api-surface/automation.json +++ b/packages/spec/api-surface/automation.json @@ -13,7 +13,6 @@ "ActionCategory (type)", "ActionCategorySchema (const)", "ActionDescriptor (type)", - "ActionDescriptorInput (type)", "ActionDescriptorParsed (type)", "ActionDescriptorSchema (const)", "ActionParadigm (type)", @@ -132,7 +131,6 @@ "FlowEdgeSchema (const)", "FlowFunctionCallable (type)", "FlowFunctionDeclaration (type)", - "FlowFunctionDeclarationInput (type)", "FlowFunctionDeclarationParsed (type)", "FlowFunctionDeclarationSchema (const)", "FlowFunctionEffect (type)", @@ -193,6 +191,7 @@ "OS_CONSTRUCT_EXT (const)", "PARALLEL_NODE_TYPE (const)", "ParallelBranch (type)", + "ParallelBranchParsed (type)", "ParallelBranchSchema (const)", "ParallelConfig (type)", "ParallelConfigParsed (type)", @@ -226,7 +225,6 @@ "TIME_RELATIVE_DEFAULT_MAX_RECORDS (const)", "TRY_CATCH_NODE_TYPE (const)", "TimeRelativeTrigger (type)", - "TimeRelativeTriggerInput (type)", "TimeRelativeTriggerSchema (const)", "Transition (type)", "TransitionSchema (const)", @@ -247,7 +245,6 @@ "WaitTimeoutBehavior (type)", "WaitTimeoutBehaviorSchema (const)", "Webhook (type)", - "WebhookInput (type)", "WebhookParsed (type)", "WebhookSchema (const)", "WebhookTriggerType (type)", diff --git a/packages/spec/api-surface/cloud.json b/packages/spec/api-surface/cloud.json index 08716d0cec..b53fb81d8e 100644 --- a/packages/spec/api-surface/cloud.json +++ b/packages/spec/api-surface/cloud.json @@ -29,7 +29,7 @@ "CuratedCollectionSchema (const)", "Environment (type)", "EnvironmentArtifact (type)", - "EnvironmentArtifactInput (type)", + "EnvironmentArtifactParsed (type)", "EnvironmentArtifactSchema (const)", "EnvironmentCredential (type)", "EnvironmentCredentialParsed (type)", diff --git a/packages/spec/api-surface/contracts.json b/packages/spec/api-surface/contracts.json index 2e1cf0fc1c..03b5347eca 100644 --- a/packages/spec/api-surface/contracts.json +++ b/packages/spec/api-surface/contracts.json @@ -19,7 +19,6 @@ "AdapterSearchOptions (interface)", "AnalyticsDriverCapabilities (interface)", "AnalyticsQuery (type)", - "AnalyticsQueryInput (type)", "AnalyticsResult (interface)", "AnalyticsStrategy (interface)", "ApiEndpointMatch (interface)", @@ -267,7 +266,7 @@ "SmsDeliveryStatus (type)", "SmsTransportSendResult (interface)", "StartupOptions (type)", - "StartupOptionsInput (type)", + "StartupOptionsParsed (type)", "StorageFileInfo (interface)", "StorageUploadOptions (interface)", "StrategyContext (interface)", diff --git a/packages/spec/api-surface/data.json b/packages/spec/api-surface/data.json index 8c9b219bbb..ba22d16e62 100644 --- a/packages/spec/api-surface/data.json +++ b/packages/spec/api-surface/data.json @@ -20,7 +20,6 @@ "AggregationStage (type)", "AggregationStageSchema (const)", "AnalyticsQuery (type)", - "AnalyticsQueryInput (type)", "AnalyticsQuerySchema (const)", "ApiMethod (type)", "ApiMethodsMode (type)", @@ -62,14 +61,12 @@ "CrossFieldValidationSchema (const)", "CrudAffordances (interface)", "Cube (type)", - "CubeInput (type)", "CubeJoin (type)", "CubeJoinParsed (type)", "CubeJoinSchema (const)", "CubeParsed (type)", "CubeSchema (const)", "CurrencyConfig (type)", - "CurrencyConfigInput (type)", "CurrencyConfigParsed (type)", "CurrencyConfigSchema (const)", "CurrencyValue (type)", @@ -125,7 +122,6 @@ "DataTypeMapping (type)", "DataTypeMappingSchema (const)", "Datasource (type)", - "DatasourceInput (type)", "DatasourceParsed (type)", "DatasourceSchema (const)", "DateGranularity (const)", @@ -228,7 +224,6 @@ "FieldNodeSchema (const)", "FieldOperators (type)", "FieldOperatorsSchema (const)", - "FieldParseInput (type)", "FieldParsed (type)", "FieldReference (type)", "FieldReferenceSchema (const)", @@ -274,6 +269,7 @@ "HookContextSchema (const)", "HookEvent (const)", "HookEventType (type)", + "HookParsed (type)", "HookSchema (const)", "IMPORT_BOOLEAN_FALSE_TOKENS (const)", "IMPORT_BOOLEAN_TRUE_TOKENS (const)", @@ -307,7 +303,6 @@ "MULTI_CAPABLE_TYPES (const)", "MULTI_OPTION_TYPES (const)", "Mapping (type)", - "MappingInput (type)", "MappingParsed (type)", "MappingSchema (const)", "MemoryConfig (type)", @@ -360,14 +355,12 @@ "ObjectDependencyNodeParsed (type)", "ObjectDependencyNodeSchema (const)", "ObjectExtension (type)", - "ObjectExtensionInput (type)", "ObjectExtensionParsed (type)", "ObjectExtensionSchema (const)", "ObjectExternalBinding (type)", "ObjectExternalBindingParsed (type)", "ObjectExternalBindingSchema (const)", "ObjectFieldGroup (type)", - "ObjectFieldGroupInput (type)", "ObjectFieldGroupParsed (type)", "ObjectFieldGroupSchema (const)", "ObjectIndex (type)", @@ -439,7 +432,6 @@ "ResolvedHook (type)", "RetiredFilterOperatorGuidance (interface)", "RowCrudActionOverride (type)", - "RowCrudActionOverrideInput (type)", "RowCrudActionOverrideParsed (type)", "RowCrudActionOverrideSchema (const)", "RowCrudPredicates (interface)", @@ -479,16 +471,13 @@ "SeedIdentity (type)", "SeedIdentitySchema (const)", "SeedImportMode (type)", - "SeedInput (type)", "SeedLoadResult (type)", "SeedLoadResultParsed (type)", "SeedLoadResultSchema (const)", "SeedLoaderConfig (type)", - "SeedLoaderConfigInput (type)", "SeedLoaderConfigParsed (type)", "SeedLoaderConfigSchema (const)", "SeedLoaderRequest (type)", - "SeedLoaderRequestInput (type)", "SeedLoaderRequestParsed (type)", "SeedLoaderRequestSchema (const)", "SeedLoaderResult (type)", @@ -501,7 +490,6 @@ "SelectOptionParsed (type)", "SelectOptionSchema (const)", "ServiceObject (type)", - "ServiceObjectInput (type)", "ServiceObjectParsed (type)", "SetOperatorSchema (const)", "ShardingConfig (type)", diff --git a/packages/spec/api-surface/identity.json b/packages/spec/api-surface/identity.json index a25ba4150b..815c08958b 100644 --- a/packages/spec/api-surface/identity.json +++ b/packages/spec/api-surface/identity.json @@ -26,7 +26,6 @@ "BuiltinMembershipRole (type)", "EVERYONE_POSITION (const)", "EvalUser (type)", - "EvalUserInput (type)", "EvalUserParsed (type)", "EvalUserSchema (const)", "GUEST_POSITION (const)", @@ -46,7 +45,6 @@ "Organization (type)", "OrganizationSchema (const)", "Position (type)", - "PositionInput (type)", "PositionParsed (type)", "PositionSchema (const)", "SCIM (const)", diff --git a/packages/spec/api-surface/integration.json b/packages/spec/api-surface/integration.json index 031bd24d38..424b332ba4 100644 --- a/packages/spec/api-surface/integration.json +++ b/packages/spec/api-surface/integration.json @@ -22,7 +22,6 @@ "ConnectorHealth (type)", "ConnectorHealthParsed (type)", "ConnectorHealthSchema (const)", - "ConnectorInput (type)", "ConnectorInstanceAPIKeyAuthSchema (const)", "ConnectorInstanceAuth (type)", "ConnectorInstanceAuthSchema (const)", diff --git a/packages/spec/api-surface/kernel.json b/packages/spec/api-surface/kernel.json index d0c5a7b939..463beb9405 100644 --- a/packages/spec/api-surface/kernel.json +++ b/packages/spec/api-surface/kernel.json @@ -26,7 +26,6 @@ "CapabilityEdition (type)", "CapabilityProviderStatus (type)", "ClusterCapabilityConfig (type)", - "ClusterCapabilityConfigInput (type)", "ClusterCapabilityConfigParsed (type)", "ClusterCapabilityConfigSchema (const)", "ClusterDriver (type)", @@ -122,7 +121,6 @@ "EventWebhookConfigParsed (type)", "EventWebhookConfigSchema (const)", "ExecutionContext (type)", - "ExecutionContextInput (type)", "ExecutionContextParsed (type)", "ExecutionContextSchema (const)", "ExtensionPoint (type)", @@ -208,18 +206,22 @@ "MetadataLockSource (type)", "MetadataLockSourceSchema (const)", "MetadataManagerConfig (type)", + "MetadataManagerConfigParsed (type)", "MetadataManagerConfigSchema (const)", "MetadataOverlay (type)", "MetadataOverlayParsed (type)", "MetadataOverlaySchema (const)", "MetadataPluginConfig (type)", + "MetadataPluginConfigParsed (type)", "MetadataPluginConfigSchema (const)", "MetadataPluginManifest (type)", + "MetadataPluginManifestParsed (type)", "MetadataPluginManifestSchema (const)", "MetadataProtectionFields (const)", "MetadataProvenance (type)", "MetadataProvenanceSchema (const)", "MetadataQuery (type)", + "MetadataQueryParsed (type)", "MetadataQueryResult (type)", "MetadataQueryResultSchema (const)", "MetadataQuerySchema (const)", @@ -239,7 +241,6 @@ "NamespaceRegistryEntry (type)", "NamespaceRegistryEntrySchema (const)", "ObjectStackManifest (type)", - "ObjectStackManifestInput (type)", "ObjectStackManifestParsed (type)", "OclifPluginConfig (type)", "OclifPluginConfigSchema (const)", @@ -258,7 +259,6 @@ "PUBLIC_AUTH_FEATURES (const)", "PUBLIC_AUTH_FEATURE_NAMES (const)", "PackageArtifact (type)", - "PackageArtifactInput (type)", "PackageArtifactParsed (type)", "PackageArtifactSchema (const)", "PackageDependencyConflict (type)", @@ -320,7 +320,6 @@ "PluginInitializationParsed (type)", "PluginInitializationSchema (const)", "PluginInstallConfig (type)", - "PluginInstallConfigInput (type)", "PluginInstallConfigSchema (const)", "PluginIntegrity (type)", "PluginIntegritySchema (const)", @@ -359,11 +358,9 @@ "PluginProvenanceParsed (type)", "PluginProvenanceSchema (const)", "PluginQualityMetrics (type)", - "PluginQualityMetricsInput (type)", "PluginQualityMetricsParsed (type)", "PluginQualityMetricsSchema (const)", "PluginRegistryEntry (type)", - "PluginRegistryEntryInput (type)", "PluginRegistryEntryParsed (type)", "PluginRegistryEntrySchema (const)", "PluginRuntime (type)", @@ -373,7 +370,6 @@ "PluginSandboxingSchema (const)", "PluginSchema (const)", "PluginSearchFilters (type)", - "PluginSearchFiltersInput (type)", "PluginSearchFiltersSchema (const)", "PluginSecurityManifest (type)", "PluginSecurityManifestParsed (type)", @@ -385,7 +381,6 @@ "PluginStateSnapshotParsed (type)", "PluginStateSnapshotSchema (const)", "PluginStatistics (type)", - "PluginStatisticsInput (type)", "PluginStatisticsParsed (type)", "PluginStatisticsSchema (const)", "PluginTrustLevel (type)", @@ -397,7 +392,6 @@ "PluginUpdateStrategyParsed (type)", "PluginUpdateStrategySchema (const)", "PluginVendor (type)", - "PluginVendorInput (type)", "PluginVendorParsed (type)", "PluginVendorSchema (const)", "PluginVersionMetadata (type)", @@ -476,12 +470,10 @@ "ServiceMetadataParsed (type)", "ServiceMetadataSchema (const)", "ServiceRegistryConfig (type)", - "ServiceRegistryConfigInput (type)", "ServiceRegistryConfigParsed (type)", "ServiceRegistryConfigSchema (const)", "ServiceScopeType (type)", "StartupOptions (type)", - "StartupOptionsInput (type)", "StartupOptionsParsed (type)", "StartupOptionsSchema (const)", "StartupOrchestrationResult (type)", diff --git a/packages/spec/api-surface/root.json b/packages/spec/api-surface/root.json index 4434572224..5b1d1cdba1 100644 --- a/packages/spec/api-surface/root.json +++ b/packages/spec/api-surface/root.json @@ -25,6 +25,7 @@ "CapabilityEdition (type)", "CapabilityProviderStatus (type)", "ComposeStacksOptions (type)", + "ComposeStacksOptionsParsed (type)", "ComposeStacksOptionsSchema (const)", "ConflictStrategy (type)", "ConflictStrategySchema (const)", @@ -40,7 +41,6 @@ "DefineStackOptions (interface)", "EVERYONE_POSITION (const)", "EvalUser (type)", - "EvalUserInput (type)", "EvalUserSchema (const)", "ExpandViewResult (interface)", "ExpandedViewItem (interface)", diff --git a/packages/spec/api-surface/security.json b/packages/spec/api-surface/security.json index 5a9b6efb27..e25586bef7 100644 --- a/packages/spec/api-surface/security.json +++ b/packages/spec/api-surface/security.json @@ -8,7 +8,6 @@ "AccessMatrixParsed (type)", "AccessMatrixSchema (const)", "AdminScope (type)", - "AdminScopeInput (type)", "AdminScopeParsed (type)", "AdminScopeSchema (const)", "AuthzPosture (type)", @@ -35,7 +34,6 @@ "ExplainRecordAttributionParsed (type)", "ExplainRecordAttributionSchema (const)", "ExplainRequest (type)", - "ExplainRequestInput (type)", "ExplainRequestSchema (const)", "FieldPermission (type)", "FieldPermissionParsed (type)", @@ -51,7 +49,6 @@ "PLATFORM_CAPABILITY_NAMES (const)", "PUBLIC_FORM_SERVER_MANAGED_FIELDS (const)", "PermissionSet (type)", - "PermissionSetInput (type)", "PermissionSetParsed (type)", "PermissionSetSchema (const)", "PlatformCapability (interface)", @@ -67,7 +64,6 @@ "ShareRecipientType (const)", "SharingLevel (const)", "SharingRule (type)", - "SharingRuleInput (type)", "SharingRuleParsed (type)", "SharingRuleSchema (const)", "SharingRuleType (const)", diff --git a/packages/spec/api-surface/system.json b/packages/spec/api-surface/system.json index 79b05ff41e..95b84f5c04 100644 --- a/packages/spec/api-surface/system.json +++ b/packages/spec/api-surface/system.json @@ -46,7 +46,6 @@ "AwarenessUserStateSchema (const)", "BUILTIN_VALIDATION_MESSAGES (const)", "BackupConfig (type)", - "BackupConfigInput (type)", "BackupConfigParsed (type)", "BackupConfigSchema (const)", "BackupRetention (type)", @@ -55,11 +54,9 @@ "BackupStrategy (type)", "BackupStrategySchema (const)", "BatchProgress (type)", - "BatchProgressInput (type)", "BatchProgressParsed (type)", "BatchProgressSchema (const)", "BatchTask (type)", - "BatchTaskInput (type)", "BatchTaskParsed (type)", "BatchTaskSchema (const)", "Book (type)", @@ -89,7 +86,6 @@ "CacheAvalanchePreventionParsed (type)", "CacheAvalanchePreventionSchema (const)", "CacheConfig (type)", - "CacheConfigInput (type)", "CacheConfigParsed (type)", "CacheConfigSchema (const)", "CacheConsistency (type)", @@ -99,7 +95,6 @@ "CacheStrategy (type)", "CacheStrategySchema (const)", "CacheTier (type)", - "CacheTierInput (type)", "CacheTierParsed (type)", "CacheTierSchema (const)", "CacheWarmup (type)", @@ -170,7 +165,6 @@ "DataMigrationFlag (type)", "DataMigrationFlagSchema (const)", "DatabaseLevelIsolationStrategy (type)", - "DatabaseLevelIsolationStrategyInput (type)", "DatabaseLevelIsolationStrategyParsed (type)", "DatabaseLevelIsolationStrategySchema (const)", "DatabaseProvider (type)", @@ -196,11 +190,9 @@ "DeployValidationResultParsed (type)", "DeployValidationResultSchema (const)", "DisasterRecoveryPlan (type)", - "DisasterRecoveryPlanInput (type)", "DisasterRecoveryPlanParsed (type)", "DisasterRecoveryPlanSchema (const)", "DistributedCacheConfig (type)", - "DistributedCacheConfigInput (type)", "DistributedCacheConfigParsed (type)", "DistributedCacheConfigSchema (const)", "Doc (type)", @@ -220,7 +212,6 @@ "EmailTemplateDefinition (type)", "EmailTemplateDefinitionCategory (type)", "EmailTemplateDefinitionCategorySchema (const)", - "EmailTemplateDefinitionInput (type)", "EmailTemplateDefinitionParsed (type)", "EmailTemplateDefinitionSchema (const)", "EmailTemplateDefinitionVariable (type)", @@ -231,11 +222,9 @@ "EncryptionAlgorithm (type)", "EncryptionAlgorithmSchema (const)", "EncryptionConfig (type)", - "EncryptionConfigInput (type)", "EncryptionConfigParsed (type)", "EncryptionConfigSchema (const)", "EnvironmentArtifact (type)", - "EnvironmentArtifactInput (type)", "EnvironmentArtifactParsed (type)", "EnvironmentArtifactSchema (const)", "ExecuteSqlOperation (const)", @@ -247,17 +236,14 @@ "FacetConfigParsed (type)", "FacetConfigSchema (const)", "FailoverConfig (type)", - "FailoverConfigInput (type)", "FailoverConfigParsed (type)", "FailoverConfigSchema (const)", "FailoverMode (type)", "FailoverModeSchema (const)", "Feature (type)", - "FeatureInput (type)", "FeatureParsed (type)", "FeatureSchema (const)", "FieldEncryption (type)", - "FieldEncryptionInput (type)", "FieldEncryptionParsed (type)", "FieldEncryptionSchema (const)", "FieldTranslation (type)", @@ -301,14 +287,12 @@ "JobExecution (type)", "JobExecutionSchema (const)", "JobExecutionStatus (type)", - "JobInput (type)", "JobParsed (type)", "JobSchema (const)", "KernelServiceMapSchema (const)", "KeyManagementProvider (type)", "KeyManagementProviderSchema (const)", "KeyRotationPolicy (type)", - "KeyRotationPolicyInput (type)", "KeyRotationPolicyParsed (type)", "KeyRotationPolicySchema (const)", "LEGACY_OBJECT_FIRST_KEYS (const)", @@ -380,6 +364,7 @@ "MetadataLoadResult (type)", "MetadataLoadResultSchema (const)", "MetadataLoaderContract (type)", + "MetadataLoaderContractParsed (type)", "MetadataLoaderContractSchema (const)", "MetadataManagerConfig (type)", "MetadataManagerConfigSchema (const)", @@ -420,7 +405,6 @@ "MetricsConfigParsed (type)", "MetricsConfigSchema (const)", "MiddlewareConfig (type)", - "MiddlewareConfigInput (type)", "MiddlewareConfigParsed (type)", "MiddlewareConfigSchema (const)", "MiddlewareType (type)", @@ -497,13 +481,11 @@ "PageLike (interface)", "PageRegionLike (interface)", "Plan (type)", - "PlanInput (type)", "PlanParsed (type)", "PlanSchema (const)", "PresignedUrlConfig (type)", "PresignedUrlConfigSchema (const)", "QueueConfig (type)", - "QueueConfigInput (type)", "QueueConfigParsed (type)", "QueueConfigSchema (const)", "QuotaEnforcementResult (type)", @@ -541,11 +523,9 @@ "RollbackPlan (type)", "RollbackPlanSchema (const)", "RouteHandlerMetadata (type)", - "RouteHandlerMetadataInput (type)", "RouteHandlerMetadataParsed (type)", "RouteHandlerMetadataSchema (const)", "RowLevelIsolationStrategy (type)", - "RowLevelIsolationStrategyInput (type)", "RowLevelIsolationStrategyParsed (type)", "RowLevelIsolationStrategySchema (const)", "SETTINGS_CHANGE_EVENT (const)", @@ -557,7 +537,6 @@ "SchemaChange (type)", "SchemaChangeSchema (const)", "SchemaLevelIsolationStrategy (type)", - "SchemaLevelIsolationStrategyInput (type)", "SchemaLevelIsolationStrategyParsed (type)", "SchemaLevelIsolationStrategySchema (const)", "SearchConfig (type)", @@ -569,14 +548,12 @@ "SearchProvider (type)", "SearchProviderSchema (const)", "SecurityContextConfig (type)", - "SecurityContextConfigInput (type)", "SecurityContextConfigParsed (type)", "SecurityContextConfigSchema (const)", "SecurityEventCorrelation (type)", "SecurityEventCorrelationParsed (type)", "SecurityEventCorrelationSchema (const)", "ServerCapabilities (type)", - "ServerCapabilitiesInput (type)", "ServerCapabilitiesParsed (type)", "ServerCapabilitiesSchema (const)", "ServerEvent (type)", @@ -641,7 +618,6 @@ "SpecifierScopeSchema (const)", "SpecifierType (type)", "StackServerConfig (type)", - "StackServerConfigInput (type)", "StackServerConfigParsed (type)", "StackServerConfigSchema (const)", "StackServerSecurity (type)", @@ -684,11 +660,9 @@ "Task (type)", "TaskExecutionResult (type)", "TaskExecutionResultSchema (const)", - "TaskInput (type)", "TaskParsed (type)", "TaskPriority (type)", "TaskRetryPolicy (type)", - "TaskRetryPolicyInput (type)", "TaskRetryPolicyParsed (type)", "TaskRetryPolicySchema (const)", "TaskSchema (const)", @@ -704,7 +678,6 @@ "TenantQuotaSchema (const)", "TenantSchema (const)", "TenantSecurityPolicy (type)", - "TenantSecurityPolicyInput (type)", "TenantSecurityPolicyParsed (type)", "TenantSecurityPolicySchema (const)", "TenantUsage (type)", @@ -751,7 +724,6 @@ "TrainingRecord (type)", "TrainingRecordSchema (const)", "TranslationBundle (type)", - "TranslationBundleInput (type)", "TranslationBundleSchema (const)", "TranslationConfig (type)", "TranslationConfigSchema (const)", @@ -775,7 +747,6 @@ "ViewLike (interface)", "WidgetLike (interface)", "WorkerConfig (type)", - "WorkerConfigInput (type)", "WorkerConfigParsed (type)", "WorkerConfigSchema (const)", "WorkerStats (type)", diff --git a/packages/spec/api-surface/ui.json b/packages/spec/api-surface/ui.json index 4b7db7d5f3..73c8edd458 100644 --- a/packages/spec/api-surface/ui.json +++ b/packages/spec/api-surface/ui.json @@ -12,7 +12,6 @@ "ActionEngineFacade (interface)", "ActionHandler (type)", "ActionHandlerContext (interface)", - "ActionInput (type)", "ActionLocation (type)", "ActionLocationSchema (const)", "ActionNavItem (type)", @@ -36,7 +35,6 @@ "AppContextSelector (type)", "AppContextSelectorParsed (type)", "AppContextSelectorSchema (const)", - "AppInput (type)", "AppParsed (type)", "AppSchema (const)", "AppearanceConfig (type)", @@ -107,7 +105,6 @@ "DashboardHeaderActionSchema (const)", "DashboardHeaderParsed (type)", "DashboardHeaderSchema (const)", - "DashboardInput (type)", "DashboardNavItem (type)", "DashboardNavItemParsed (type)", "DashboardNavItemSchema (const)", @@ -120,11 +117,8 @@ "DashboardWidgetSchema (const)", "Dataset (type)", "DatasetDimension (type)", - "DatasetDimensionInput (type)", "DatasetDimensionSchema (const)", - "DatasetInput (type)", "DatasetMeasure (type)", - "DatasetMeasureInput (type)", "DatasetMeasureSchema (const)", "DatasetSchema (const)", "DerivedMeasureOp (const)", @@ -179,14 +173,12 @@ "I18nLabel (type)", "I18nLabelSchema (const)", "InlineAction (type)", - "InlineActionInput (type)", "InlineActionParsed (type)", "InlineActionSchema (const)", "InterfacePageConfig (type)", "InterfacePageConfigParsed (type)", "InterfacePageConfigSchema (const)", "JoinedReportBlock (type)", - "JoinedReportBlockInput (type)", "JoinedReportBlockSchema (const)", "KanbanConfigSchema (const)", "ListChartConfig (type)", @@ -205,7 +197,6 @@ "NavigationConfigParsed (type)", "NavigationConfigSchema (const)", "NavigationContribution (type)", - "NavigationContributionInput (type)", "NavigationContributionParsed (type)", "NavigationContributionSchema (const)", "NavigationItem (type)", @@ -233,7 +224,6 @@ "PageComponentType (const)", "PageContainerProps (type)", "PageHeaderProps (const)", - "PageInput (type)", "PageNavItem (type)", "PageNavItemParsed (type)", "PageNavItemSchema (const)", @@ -268,17 +258,14 @@ "RecordRelatedListProps (const)", "Report (type)", "ReportChart (type)", - "ReportChartInput (type)", "ReportChartParsed (type)", "ReportChartSchema (const)", - "ReportInput (type)", "ReportNavItem (type)", "ReportNavItemParsed (type)", "ReportNavItemSchema (const)", "ReportParsed (type)", "ReportSchema (const)", "ReportSort (type)", - "ReportSortInput (type)", "ReportSortParsed (type)", "ReportSortSchema (const)", "ReportType (const)", @@ -302,7 +289,6 @@ "StyleMap (type)", "StyleMapSchema (const)", "Theme (type)", - "ThemeInput (type)", "ThemeMode (type)", "ThemeModeSchema (const)", "ThemeParsed (type)", diff --git a/packages/spec/docs/SYNC_ARCHITECTURE.md b/packages/spec/docs/SYNC_ARCHITECTURE.md index 4fea98b967..bcc0c0bd72 100644 --- a/packages/spec/docs/SYNC_ARCHITECTURE.md +++ b/packages/spec/docs/SYNC_ARCHITECTURE.md @@ -244,7 +244,7 @@ Complete, production-grade integration with external systems. Includes authentic ### Example -> **`ConnectorInput` is the AUTHOR shape.** It is `z.input` of +> **The bare `Connector` is the AUTHOR shape.** It is `z.input` of > `ConnectorSchema`, so every key carrying a `.default()` — `enabled`, > `status`, `connectionTimeoutMs`, `requestTimeoutMs`, all of `syncConfig`'s > `strategy` / `direction` / `realtimeSync` / `conflictResolution` / @@ -254,29 +254,29 @@ Complete, production-grade integration with external systems. Includes authentic > the schema wraps for you. Annotate the **result** of > `ConnectorSchema.parse(…)` with **`ConnectorParsed`**, which is `z.infer`: > there those keys are all present and `schedule` is already the -> `{ dialect: 'cron', source }` envelope. (The bare **`Connector`** still means -> that same parsed shape today, and both names are live — but `ConnectorParsed` -> is the one that keeps meaning it.) Note the asymmetry with L2 above, where the -> bare `ETLPipeline` *is* the author shape and the parse result is -> `ETLPipelineParsed`. That asymmetry is real and is being removed, in the -> direction L2 already points: **[ADR-0122](../../../docs/adr/0122-schema-type-alias-naming-convention.md) -> makes the bare name the author state and `XParsed` the parsed state** +> `{ dialect: 'cron', source }` envelope. This matches L2 above, where the bare +> `ETLPipeline` is the author shape and the parse result is `ETLPipelineParsed` +> — the two halves of the spec agree now, and +> **[ADR-0122](../../../docs/adr/0122-schema-type-alias-naming-convention.md) +> is why**: the bare name is the author state and `XParsed` is the parsed state, > repo-wide. Earlier revisions of this note called L2's spelling "the house > convention" and said connector had not caught up; #5551 measured the corpus and > that was backwards — connector's spelling was the 1384-alias majority and L2's > the 8-file minority, with neither recorded anywhere. ADR-0122 is that record. -> Its phase 1 (additive, no break) has already given every schema with two -> distinct shapes its `XParsed` name, `Connector` included; phase 2 flips the -> bare names in a major. The example below states the defaulted +> Its phase 1 (#5551, additive) gave every schema with two distinct shapes its +> `XParsed` name; phase 2 (#6083, protocol 17) flipped the bare names and retired +> the `XInput` synonyms the flip created — `ConnectorInput` among them, so write +> `Connector` where you used to write `ConnectorInput`, and `ConnectorParsed` +> where you used to write `Connector`. The example below states the defaulted > keys anyway, because it is a tour of the surface; the Migration Guide's > sketches omit them, because that is what ordinary authoring looks like. > To have the literal validated as you write it, prefer `defineConnector(…)`, > which takes this same input shape and returns the parsed one. ```typescript -import type { ConnectorInput } from '@objectstack/spec/integration'; +import type { Connector } from '@objectstack/spec/integration'; -const sapConnector: ConnectorInput = { +const sapConnector: Connector = { name: 'sap_erp_connector', label: 'SAP ERP Integration', type: 'saas', @@ -453,7 +453,7 @@ aggregations, or a per-field convert that `fieldMappings` cannot do (#5552): **Before (L3 `syncConfig`):** ```typescript -const connector: ConnectorInput = { +const connector: Connector = { name: 'orders', type: 'saas', authentication: { type: 'api-key', ... }, @@ -499,7 +499,7 @@ const pipeline: ETLPipeline = { **After (L3):** ```typescript -const connector: ConnectorInput = { +const connector: Connector = { authentication: { type: 'oauth2', ... }, webhooks: [...], retryConfig: { ... } diff --git a/packages/spec/scripts/def-key-collisions.test.ts b/packages/spec/scripts/def-key-collisions.test.ts index 9d1d4b1475..6b9190188e 100644 --- a/packages/spec/scripts/def-key-collisions.test.ts +++ b/packages/spec/scripts/def-key-collisions.test.ts @@ -183,7 +183,11 @@ describe('build-schemas.ts refuses a second write of one def key (#5832)', () => const httpZod = path.join(dir, 'src', 'shared', 'http.zod.ts'); const original = fs.readFileSync(httpZod, 'utf-8'); - const anchor = 'export type HttpMethodSubset = z.infer;'; + // Reads `z.input` since ADR-0122 phase 2 (#6083) flipped every bare alias. + // The anchor is only an insertion point, and it is asserted to exist on the + // next line — so a future re-spelling fails loudly here instead of mutating + // nothing and reporting the guard green over an unmodified fixture. + const anchor = 'export type HttpMethodSubset = z.input;'; expect(original, 'anchor line must exist — the mutation is pointless otherwise') .toContain(anchor); const mutated = original.replace( diff --git a/packages/spec/spec-changes.json b/packages/spec/spec-changes.json index 450585f59b..159be5a8eb 100644 --- a/packages/spec/spec-changes.json +++ b/packages/spec/spec-changes.json @@ -644,6 +644,13 @@ "migrationId": "driver-aggregate-undeclared-key-aliases-removed", "toMajor": 17, "rationale": "`SqlDriver.aggregate` and `RemoteTransport.aggregate` each read two aliases the Query Protocol has never declared: `query.aggregations || query.aggregate` and `agg.function || agg.func`. \"Never declared\" is measured, not assumed — `git log -S` over `data/query.zod.ts` finds no commit that ever introduced either name, there is no `retiredKey()` tombstone and no alias-table entry for them (the file's only alias table is `SortNode`'s `direction` → `order`), and neither appears in any upgrade guide or release note. So this entry does not record a declared surface being withdrawn; it records a LENIENCY being withdrawn, which is why it is here rather than behind a tombstone. The only writers in this repository were the two driver packages' own fixtures — #4984's family, where a fixture spelling the alias keeps the tolerant limb green forever and no test in existence can go red on its deletion — so ADR-0049 enforce-or-remove applies once those are re-spelt. ⚠️ Do NOT read this across to `dashboard`/`page` measures: `aggregate` IS the canonical key there and `func` IS a declared, loudly-suggesting alias (`DatasetMeasureSchema`, ui/dataset.zod.ts). That neighbouring vocabulary is untouched, and it is the most likely reason an off-repo caller ever wrote these keys on a QUERY — one habit, two surfaces, only one of which declared it. This is a driver CALL ARGUMENT — code, never stack metadata — so there is no source for the D2 chain to rewrite and deliberately no schema tombstone: nothing ever ran a query through `QueryASTSchema.parse()` on this path. The enforced channel is tsc at the call site, once the parameter is `DriverQuery` — and for an untyped JS caller there is no enforced channel at all, which is exactly why this ledger entry has to exist: the generated upgrade guide is the only way such a reader learns of the rename. Same disposition, and the same reason, as `data-driver-find-stream-retired` (#4484), `storage-service-list-retired` (#5540) and `actor-user-roles-to-positions` (#6011). ADR-0049 / ADR-0087, #6321 (PR #6404)." + }, + { + "surface": "type alias: the 102 XInput names of @objectstack/spec (ConnectorInput, AppInput, PageInput, ActionInput, ServiceObjectInput, ExecutionContextInput, TaskInput, … — 52 files across api/ automation/ data/ identity/ integration/ kernel/ security/ system/ ui/)", + "replacement": "the BARE name. ADR-0122 phase 2 moved the author state onto `X`, which makes `XInput` a character-for-character synonym of it — the permanent synonym D3 forbids. Drop the `Input` suffix: `ConnectorInput` -> `Connector`. Symmetrically, a consumer that held a PARSE RESULT under the bare name moves to `XParsed`, which phase 1 (16.x) already declared for every schema whose two shapes differ, so the target name has existed for a release. NINE `*Input` names are NOT retired and need no edit: `ExpressionInput`, `CronExpressionInput`, `TemplateExpressionInput` and `PredicateInput` are the bare aliases of their own `…InputSchema`, and `FormFieldInput`, `QueryInput`, `FieldInput`, `ObjectStackDefinitionInput` and `NavigationItemInput` are composed (recursive or `Partial`-shaped) types no bare alias denotes.", + "migrationId": "spec-type-alias-input-suffix-retired", + "toMajor": 17, + "rationale": "This entry exists for the reason `data-driver-find-stream-retired` (#4484), `storage-service-list-retired` (#5540) and `actor-user-roles-to-positions` (#6011) exist, and it is the same disposition: the surface is a TYPESCRIPT NAME, never stack metadata, so there is no source for a D2 conversion to rewrite and deliberately no schema tombstone — an `XInput` alias never had a carrier key, never emitted a def, and no `.parse()` ever saw it. Measured and verified rather than assumed: `json-schema/`, `json-schema.manifest/` and `authorable-surface/` are BYTE-IDENTICAL across this change, because those generators enumerate runtime `z.ZodType` exports and never read a type alias. So nothing left the published metadata surface and RETIRED_DEFS_BY_MAJOR is deliberately untouched — an entry there would falsely claim the metadata contract shrank. The enforced channel is tsc: the name is gone, so every consumer gets TS2724/TS2305 naming the import. That is loud but MUTE about the replacement — a compile error says `ConnectorInput` does not exist, not that `Connector` now means what it meant. The generated upgrade guide is the only channel that carries the second half, which is precisely the #6048 gap ADR-0087 registration exists to close. ⚠️ Deliberately NOT registered alongside it: the 1384 bare aliases the same change FLIPPED from `z.infer` to `z.input`. Those names all still exist and still resolve; what moved is which of a schema's two shapes they denote, and only where the two differ (663 of 1384 — the rest are isomorphic and the flip is a no-op there, pinned as such). A consumer holding an authored literal is made MORE correct by it, silently; one holding a parse result gets a tsc error at the first defaulted key it reads. Registering that as a rename would misdescribe it — no name was retired — and the changeset carries its own FROM -> TO for it. ADR-0122 D8/D9, #6083 (PR #6279)." } ], "removed": [] @@ -1347,6 +1354,13 @@ "migrationId": "driver-aggregate-undeclared-key-aliases-removed", "toMajor": 17, "rationale": "`SqlDriver.aggregate` and `RemoteTransport.aggregate` each read two aliases the Query Protocol has never declared: `query.aggregations || query.aggregate` and `agg.function || agg.func`. \"Never declared\" is measured, not assumed — `git log -S` over `data/query.zod.ts` finds no commit that ever introduced either name, there is no `retiredKey()` tombstone and no alias-table entry for them (the file's only alias table is `SortNode`'s `direction` → `order`), and neither appears in any upgrade guide or release note. So this entry does not record a declared surface being withdrawn; it records a LENIENCY being withdrawn, which is why it is here rather than behind a tombstone. The only writers in this repository were the two driver packages' own fixtures — #4984's family, where a fixture spelling the alias keeps the tolerant limb green forever and no test in existence can go red on its deletion — so ADR-0049 enforce-or-remove applies once those are re-spelt. ⚠️ Do NOT read this across to `dashboard`/`page` measures: `aggregate` IS the canonical key there and `func` IS a declared, loudly-suggesting alias (`DatasetMeasureSchema`, ui/dataset.zod.ts). That neighbouring vocabulary is untouched, and it is the most likely reason an off-repo caller ever wrote these keys on a QUERY — one habit, two surfaces, only one of which declared it. This is a driver CALL ARGUMENT — code, never stack metadata — so there is no source for the D2 chain to rewrite and deliberately no schema tombstone: nothing ever ran a query through `QueryASTSchema.parse()` on this path. The enforced channel is tsc at the call site, once the parameter is `DriverQuery` — and for an untyped JS caller there is no enforced channel at all, which is exactly why this ledger entry has to exist: the generated upgrade guide is the only way such a reader learns of the rename. Same disposition, and the same reason, as `data-driver-find-stream-retired` (#4484), `storage-service-list-retired` (#5540) and `actor-user-roles-to-positions` (#6011). ADR-0049 / ADR-0087, #6321 (PR #6404)." + }, + { + "surface": "type alias: the 102 XInput names of @objectstack/spec (ConnectorInput, AppInput, PageInput, ActionInput, ServiceObjectInput, ExecutionContextInput, TaskInput, … — 52 files across api/ automation/ data/ identity/ integration/ kernel/ security/ system/ ui/)", + "replacement": "the BARE name. ADR-0122 phase 2 moved the author state onto `X`, which makes `XInput` a character-for-character synonym of it — the permanent synonym D3 forbids. Drop the `Input` suffix: `ConnectorInput` -> `Connector`. Symmetrically, a consumer that held a PARSE RESULT under the bare name moves to `XParsed`, which phase 1 (16.x) already declared for every schema whose two shapes differ, so the target name has existed for a release. NINE `*Input` names are NOT retired and need no edit: `ExpressionInput`, `CronExpressionInput`, `TemplateExpressionInput` and `PredicateInput` are the bare aliases of their own `…InputSchema`, and `FormFieldInput`, `QueryInput`, `FieldInput`, `ObjectStackDefinitionInput` and `NavigationItemInput` are composed (recursive or `Partial`-shaped) types no bare alias denotes.", + "migrationId": "spec-type-alias-input-suffix-retired", + "toMajor": 17, + "rationale": "This entry exists for the reason `data-driver-find-stream-retired` (#4484), `storage-service-list-retired` (#5540) and `actor-user-roles-to-positions` (#6011) exist, and it is the same disposition: the surface is a TYPESCRIPT NAME, never stack metadata, so there is no source for a D2 conversion to rewrite and deliberately no schema tombstone — an `XInput` alias never had a carrier key, never emitted a def, and no `.parse()` ever saw it. Measured and verified rather than assumed: `json-schema/`, `json-schema.manifest/` and `authorable-surface/` are BYTE-IDENTICAL across this change, because those generators enumerate runtime `z.ZodType` exports and never read a type alias. So nothing left the published metadata surface and RETIRED_DEFS_BY_MAJOR is deliberately untouched — an entry there would falsely claim the metadata contract shrank. The enforced channel is tsc: the name is gone, so every consumer gets TS2724/TS2305 naming the import. That is loud but MUTE about the replacement — a compile error says `ConnectorInput` does not exist, not that `Connector` now means what it meant. The generated upgrade guide is the only channel that carries the second half, which is precisely the #6048 gap ADR-0087 registration exists to close. ⚠️ Deliberately NOT registered alongside it: the 1384 bare aliases the same change FLIPPED from `z.infer` to `z.input`. Those names all still exist and still resolve; what moved is which of a schema's two shapes they denote, and only where the two differ (663 of 1384 — the rest are isomorphic and the flip is a no-op there, pinned as such). A consumer holding an authored literal is made MORE correct by it, silently; one holding a parse result gets a tsc error at the first defaulted key it reads. Registering that as a rename would misdescribe it — no name was retired — and the changeset carries its own FROM -> TO for it. ADR-0122 D8/D9, #6083 (PR #6279)." } ], "removed": [] diff --git a/packages/spec/src/ai/agent.zod.ts b/packages/spec/src/ai/agent.zod.ts index 7e5342d2fa..7275c2b7ae 100644 --- a/packages/spec/src/ai/agent.zod.ts +++ b/packages/spec/src/ai/agent.zod.ts @@ -110,9 +110,9 @@ export const StructuredOutputConfigSchema = lazySchema(() => strictObject({ transformPipeline: z.array(TransformPipelineStepSchema).optional().describe('Post-processing steps applied to output'), }).describe('Structured output configuration for agent responses')); -export type StructuredOutputFormat = z.infer; -export type TransformPipelineStep = z.infer; -export type StructuredOutputConfig = z.infer; +export type StructuredOutputFormat = z.input; +export type TransformPipelineStep = z.input; +export type StructuredOutputConfig = z.input; /** Post-parse shape of {@link StructuredOutputConfig} — defaults applied, transforms run (ADR-0122). */ export type StructuredOutputConfigParsed = z.infer; @@ -389,10 +389,10 @@ export const AgentSchema = lazySchema(() => strictObject({ * }); * ``` */ -export function defineAgent(config: z.input): Agent { +export function defineAgent(config: z.input): AgentParsed { return AgentSchema.parse(config); } -export type Agent = z.infer; +export type Agent = z.input; /** Post-parse shape of {@link Agent} — defaults applied, transforms run (ADR-0122). */ export type AgentParsed = z.infer; diff --git a/packages/spec/src/ai/conversation.zod.ts b/packages/spec/src/ai/conversation.zod.ts index fa6676afc0..e682a6db5a 100644 --- a/packages/spec/src/ai/conversation.zod.ts +++ b/packages/spec/src/ai/conversation.zod.ts @@ -310,31 +310,31 @@ export const ConversationAnalyticsSchema = lazySchema(() => z.object({ lastMessageAt: z.string().datetime().optional().describe('ISO 8601 timestamp'), })); -export type MessageRole = z.infer; -export type MessageContentType = z.infer; -export type MessageContent = z.infer; +export type MessageRole = z.input; +export type MessageContentType = z.input; +export type MessageContent = z.input; /** Post-parse shape of {@link MessageContent} — defaults applied, transforms run (ADR-0122). */ export type MessageContentParsed = z.infer; -export type FunctionCall = z.infer; -export type ToolCall = z.infer; +export type FunctionCall = z.input; +export type ToolCall = z.input; /** Post-parse shape of {@link ToolCall} — defaults applied, transforms run (ADR-0122). */ export type ToolCallParsed = z.infer; -export type ConversationMessage = z.infer; +export type ConversationMessage = z.input; /** Post-parse shape of {@link ConversationMessage} — defaults applied, transforms run (ADR-0122). */ export type ConversationMessageParsed = z.infer; -export type TokenBudgetStrategy = z.infer; -export type TokenBudgetConfig = z.infer; +export type TokenBudgetStrategy = z.input; +export type TokenBudgetConfig = z.input; /** Post-parse shape of {@link TokenBudgetConfig} — defaults applied, transforms run (ADR-0122). */ export type TokenBudgetConfigParsed = z.infer; -export type TokenUsageStats = z.infer; +export type TokenUsageStats = z.input; /** Post-parse shape of {@link TokenUsageStats} — defaults applied, transforms run (ADR-0122). */ export type TokenUsageStatsParsed = z.infer; -export type ConversationContext = z.infer; -export type ConversationSession = z.infer; +export type ConversationContext = z.input; +export type ConversationSession = z.input; /** Post-parse shape of {@link ConversationSession} — defaults applied, transforms run (ADR-0122). */ export type ConversationSessionParsed = z.infer; -export type ConversationSummary = z.infer; -export type MessagePruningEvent = z.infer; -export type ConversationAnalytics = z.infer; +export type ConversationSummary = z.input; +export type MessagePruningEvent = z.input; +export type ConversationAnalytics = z.input; /** Post-parse shape of {@link ConversationAnalytics} — defaults applied, transforms run (ADR-0122). */ export type ConversationAnalyticsParsed = z.infer; diff --git a/packages/spec/src/ai/embedding.zod.ts b/packages/spec/src/ai/embedding.zod.ts index 7d0ff1be4f..93768d9424 100644 --- a/packages/spec/src/ai/embedding.zod.ts +++ b/packages/spec/src/ai/embedding.zod.ts @@ -81,6 +81,6 @@ export const VectorStoreSchema = lazySchema(() => z.object({ dimensions: z.number().int().positive().optional(), })); -export type VectorStoreProvider = z.infer; -export type EmbeddingModel = z.infer; -export type VectorStore = z.infer; +export type VectorStoreProvider = z.input; +export type EmbeddingModel = z.input; +export type VectorStore = z.input; diff --git a/packages/spec/src/ai/knowledge-document.zod.ts b/packages/spec/src/ai/knowledge-document.zod.ts index bb20bf6946..26d6818a26 100644 --- a/packages/spec/src/ai/knowledge-document.zod.ts +++ b/packages/spec/src/ai/knowledge-document.zod.ts @@ -92,6 +92,6 @@ export const KnowledgeHitSchema = lazySchema(() => z.object({ metadata: z.record(z.string(), z.unknown()).default({}).optional(), })); -export type KnowledgeDocument = z.infer; -export type KnowledgeChunk = z.infer; -export type KnowledgeHit = z.infer; +export type KnowledgeDocument = z.input; +export type KnowledgeChunk = z.input; +export type KnowledgeHit = z.input; diff --git a/packages/spec/src/ai/knowledge-source.zod.ts b/packages/spec/src/ai/knowledge-source.zod.ts index 1975b78810..1b24e1c3ec 100644 --- a/packages/spec/src/ai/knowledge-source.zod.ts +++ b/packages/spec/src/ai/knowledge-source.zod.ts @@ -115,9 +115,9 @@ export const KnowledgeSourceSchema = lazySchema(() => z.object({ aiExposed: z.boolean().default(true).optional(), })); -export type KnowledgeRefreshPolicy = z.infer; -export type ObjectKnowledgeSource = z.infer; -export type FileKnowledgeSource = z.infer; -export type HttpKnowledgeSource = z.infer; -export type KnowledgeSourceKind = z.infer; -export type KnowledgeSource = z.infer; +export type KnowledgeRefreshPolicy = z.input; +export type ObjectKnowledgeSource = z.input; +export type FileKnowledgeSource = z.input; +export type HttpKnowledgeSource = z.input; +export type KnowledgeSourceKind = z.input; +export type KnowledgeSource = z.input; diff --git a/packages/spec/src/ai/mcp.zod.ts b/packages/spec/src/ai/mcp.zod.ts index dab1686679..129ee5cfd8 100644 --- a/packages/spec/src/ai/mcp.zod.ts +++ b/packages/spec/src/ai/mcp.zod.ts @@ -96,12 +96,12 @@ export const MCPToolBindingSchema = lazySchema(() => z.object({ approval: MCPApprovalPolicySchema.default('never'), })); -export type MCPTransport = z.infer; -export type MCPServerRef = z.infer; +export type MCPTransport = z.input; +export type MCPServerRef = z.input; /** Post-parse shape of {@link MCPServerRef} — defaults applied, transforms run (ADR-0122). */ export type MCPServerRefParsed = z.infer; -export type MCPApprovalPolicy = z.infer; -export type MCPToolBinding = z.infer; +export type MCPApprovalPolicy = z.input; +export type MCPToolBinding = z.input; /** Post-parse shape of {@link MCPToolBinding} — defaults applied, transforms run (ADR-0122). */ export type MCPToolBindingParsed = z.infer; diff --git a/packages/spec/src/ai/model-registry.zod.ts b/packages/spec/src/ai/model-registry.zod.ts index c7bafdc446..cc44195c6d 100644 --- a/packages/spec/src/ai/model-registry.zod.ts +++ b/packages/spec/src/ai/model-registry.zod.ts @@ -185,29 +185,29 @@ export const ModelSelectionCriteriaSchema = lazySchema(() => z.object({ })); // Type exports -export type ModelProvider = z.infer; -export type ModelCapability = z.infer; +export type ModelProvider = z.input; +export type ModelCapability = z.input; /** Post-parse shape of {@link ModelCapability} — defaults applied, transforms run (ADR-0122). */ export type ModelCapabilityParsed = z.infer; -export type ModelLimits = z.infer; -export type ModelPricing = z.infer; +export type ModelLimits = z.input; +export type ModelPricing = z.input; /** Post-parse shape of {@link ModelPricing} — defaults applied, transforms run (ADR-0122). */ export type ModelPricingParsed = z.infer; -export type ModelConfig = z.infer; +export type ModelConfig = z.input; /** Post-parse shape of {@link ModelConfig} — defaults applied, transforms run (ADR-0122). */ export type ModelConfigParsed = z.infer; -export type PromptVariable = z.infer; +export type PromptVariable = z.input; /** Post-parse shape of {@link PromptVariable} — defaults applied, transforms run (ADR-0122). */ export type PromptVariableParsed = z.infer; -export type PromptTemplate = z.infer; +export type PromptTemplate = z.input; /** Post-parse shape of {@link PromptTemplate} — defaults applied, transforms run (ADR-0122). */ export type PromptTemplateParsed = z.infer; -export type ModelRegistryEntry = z.infer; +export type ModelRegistryEntry = z.input; /** Post-parse shape of {@link ModelRegistryEntry} — defaults applied, transforms run (ADR-0122). */ export type ModelRegistryEntryParsed = z.infer; -export type ModelRegistry = z.infer; +export type ModelRegistry = z.input; /** Post-parse shape of {@link ModelRegistry} — defaults applied, transforms run (ADR-0122). */ export type ModelRegistryParsed = z.infer; -export type ModelSelectionCriteria = z.infer; +export type ModelSelectionCriteria = z.input; /** Post-parse shape of {@link ModelSelectionCriteria} — defaults applied, transforms run (ADR-0122). */ export type ModelSelectionCriteriaParsed = z.infer; diff --git a/packages/spec/src/ai/skill.zod.ts b/packages/spec/src/ai/skill.zod.ts index 6caa8ec3e6..92e764b445 100644 --- a/packages/spec/src/ai/skill.zod.ts +++ b/packages/spec/src/ai/skill.zod.ts @@ -28,7 +28,7 @@ export const SkillTriggerConditionSchema = lazySchema(() => z.object({ value: z.union([z.string(), z.array(z.string())]).describe('Expected value or values'), })); -export type SkillTriggerCondition = z.infer; +export type SkillTriggerCondition = z.input; // ========================================== // Skill Schema @@ -232,7 +232,7 @@ export const SkillSchema = lazySchema(() => strictObject({ })); -export type Skill = z.infer; +export type Skill = z.input; /** Post-parse shape of {@link Skill} — defaults applied, transforms run (ADR-0122). */ export type SkillParsed = z.infer; @@ -260,6 +260,6 @@ export type SkillParsed = z.infer; * }); * ``` */ -export function defineSkill(config: z.input): Skill { +export function defineSkill(config: z.input): SkillParsed { return SkillSchema.parse(config); } diff --git a/packages/spec/src/ai/solution-blueprint.zod.ts b/packages/spec/src/ai/solution-blueprint.zod.ts index 9982ca881c..b5b5542d3c 100644 --- a/packages/spec/src/ai/solution-blueprint.zod.ts +++ b/packages/spec/src/ai/solution-blueprint.zod.ts @@ -37,7 +37,7 @@ export const BlueprintConditionSchema = lazySchema(() => z.object({ op: z.enum(['lt', 'lte', 'gt', 'gte', 'eq', 'ne']).describe('Comparison operator'), value: z.union([z.number(), z.string(), z.boolean()]).describe('Comparison value — for a select field use its option VALUE, never its label (e.g. "completed", not "已完成")'), })); -export type BlueprintCondition = z.infer; +export type BlueprintCondition = z.input; /** * A roll-up (`summary` field) declared IN the blueprint — the aggregation of @@ -70,7 +70,7 @@ export const BlueprintSummaryOperationsSchema = lazySchema(() => z.object({ filter: FilterConditionSchema.optional() .describe('The same predicate as a canonical query filter map (e.g. { status: "completed" }, { status: { $in: ["received", "partial"] } }). Use it when hand-authoring a blueprint; the structured design path uses `conditions` instead. Wins over `conditions` when both are given.'), })); -export type BlueprintSummaryOperations = z.infer; +export type BlueprintSummaryOperations = z.input; /** * A proposed field on a blueprint object. `reference` carries the target @@ -93,7 +93,7 @@ export const BlueprintFieldSchema = lazySchema(() => z.object({ expression: z.string().optional() .describe('REQUIRED when `type` is "formula" — the CEL body the field computes, e.g. "record.quantity * record.unit_price", or "record.order_no + \' · \' + record.customer" for a composed title. A "formula" field without it materializes runtime-dead: the engine builds its formula plan only from fields that HAVE an expression, so the field reads null everywhere, forever. Same failure shape as a "summary" with no `summaryOperations`. Note `nameField` on the object recommends a formula for numbered entities (invoice/ticket) — that formula needs THIS key, or the record title is blank on every card, lookup chip and breadcrumb.'), })); -export type BlueprintField = z.infer; +export type BlueprintField = z.input; /** A proposed business object (table) with its fields. */ export const BlueprintObjectSchema = lazySchema(() => z.object({ @@ -104,7 +104,7 @@ export const BlueprintObjectSchema = lazySchema(() => z.object({ nameField: z.string().regex(SNAKE_CASE).optional() .describe('The record title field — which field holds the human-readable name shown on cards, lookup chips, breadcrumbs and search (ADR-0079). Set it to the object\'s text label field (e.g. "product_name"). For a numbered entity (invoice/ticket), set it to a formula field that composes number + name (e.g. "{order_no} · {customer}"). Omitting it lets the platform auto-pick a text field, but declaring it is strongly preferred.'), })); -export type BlueprintObject = z.infer; +export type BlueprintObject = z.input; /** A proposed list/form/kanban/calendar/gallery/gantt view over an object. */ export const BlueprintViewSchema = lazySchema(() => z.object({ @@ -118,7 +118,7 @@ export const BlueprintViewSchema = lazySchema(() => z.object({ groupBy: z.string().regex(SNAKE_CASE).optional() .describe('REQUIRED for kanban views: the select/status field whose options become the board columns (e.g. "stage", "status"). Without it a kanban renders as a plain list. Optional for gantt (groups leaf tasks into summary rows).'), })); -export type BlueprintView = z.infer; +export type BlueprintView = z.input; /** Post-parse shape of {@link BlueprintView} — defaults applied, transforms run (ADR-0122). */ export type BlueprintViewParsed = z.infer; @@ -133,7 +133,7 @@ export type BlueprintViewParsed = z.infer; * sites that name it. */ export const BlueprintWidgetConditionSchema = BlueprintConditionSchema; -export type BlueprintWidgetCondition = z.infer; +export type BlueprintWidgetCondition = z.input; /** A proposed dashboard with a few widgets (kept intentionally light). */ export const BlueprintDashboardSchema = lazySchema(() => z.object({ @@ -152,7 +152,7 @@ export const BlueprintDashboardSchema = lazySchema(() => z.object({ .describe('Restrict WHICH records the widget counts/aggregates when its title implies a threshold or status (e.g. "stock below 10" → {field:"stock_quantity", op:"lt", value:10}; "open tickets" → {field:"status", op:"eq", value:"open"}). Without it the widget covers ALL records — so a "低于10的备件预警" / "overdue" card would wrongly count everything. Omit when the widget genuinely spans every record.'), })).optional().describe('Widgets to place on the dashboard'), })); -export type BlueprintDashboard = z.infer; +export type BlueprintDashboard = z.input; /** * A proposed navigation item in the blueprint app — points at one of the @@ -165,7 +165,7 @@ export const BlueprintNavItemSchema = lazySchema(() => z.object({ label: z.string().optional().describe('Nav entry label (defaults to the target label/name)'), icon: z.string().optional().describe('Lucide icon name for the nav entry'), })); -export type BlueprintNavItem = z.infer; +export type BlueprintNavItem = z.input; /** Post-parse shape of {@link BlueprintNavItem} — defaults applied, transforms run (ADR-0122). */ export type BlueprintNavItemParsed = z.infer; @@ -181,7 +181,7 @@ export const BlueprintAppSchema = lazySchema(() => z.object({ nav: z.array(BlueprintNavItemSchema).optional() .describe('Navigation entries; omit to auto-surface every created object and dashboard'), })); -export type BlueprintApp = z.infer; +export type BlueprintApp = z.input; /** Post-parse shape of {@link BlueprintApp} — defaults applied, transforms run (ADR-0122). */ export type BlueprintAppParsed = z.infer; @@ -195,7 +195,7 @@ export const BlueprintSeedSchema = lazySchema(() => z.object({ object: z.string().regex(SNAKE_CASE).describe('Target object name (snake_case)'), records: z.array(z.record(z.string(), z.unknown())).describe('Rows to seed'), })); -export type BlueprintSeed = z.infer; +export type BlueprintSeed = z.input; /** * The full plan-first blueprint. `assumptions` state the design choices the @@ -223,7 +223,7 @@ export const SolutionBlueprintSchema = lazySchema(() => z.object({ seedData: z.array(BlueprintSeedSchema).optional() .describe('Suggested seed data (reported, not auto-applied in Phase C)'), })); -export type SolutionBlueprint = z.infer; +export type SolutionBlueprint = z.input; /** Post-parse shape of {@link SolutionBlueprint} — defaults applied, transforms run (ADR-0122). */ export type SolutionBlueprintParsed = z.infer; @@ -231,7 +231,7 @@ export type SolutionBlueprintParsed = z.infer; * Factory mirroring `defineAgent` / `defineTool` / `defineSkill`: validates a * blueprint literal at authoring time and returns the parsed value. */ -export function defineSolutionBlueprint(config: z.input): SolutionBlueprint { +export function defineSolutionBlueprint(config: z.input): SolutionBlueprintParsed { return SolutionBlueprintSchema.parse(config); } @@ -353,4 +353,4 @@ export const SolutionBlueprintStrictSchema = z.object({ app: StrictApp.nullable() .describe('The navigation shell (app) that surfaces the created objects/dashboards, or null'), }); -export type SolutionBlueprintStrict = z.infer; +export type SolutionBlueprintStrict = z.input; diff --git a/packages/spec/src/ai/tool.zod.ts b/packages/spec/src/ai/tool.zod.ts index 6b975c11bb..0888ef1d73 100644 --- a/packages/spec/src/ai/tool.zod.ts +++ b/packages/spec/src/ai/tool.zod.ts @@ -179,7 +179,7 @@ export const ToolSchema = lazySchema(() => z.object({ }, { error: strictToolError }).strict().describe('AI tool definition. [READ-ONLY PROJECTION — not an execution entry point] Authoring a tool as metadata does NOT make it runnable: this schema has no `implementation`/`handler` field and no framework executor loads a metadata-authored tool. The runtime executes a separately-registered `AIToolDefinition` (cloud `@objectstack/service-ai`); tool metadata is a one-way projection for Studio/discovery. Do not expect a hand-authored tool to run in the open edition (liveness audit #1878/#1892).')); -export type Tool = z.infer; +export type Tool = z.input; // ========================================== // Factory diff --git a/packages/spec/src/ai/usage.zod.ts b/packages/spec/src/ai/usage.zod.ts index 1a6039be1d..170a122ca8 100644 --- a/packages/spec/src/ai/usage.zod.ts +++ b/packages/spec/src/ai/usage.zod.ts @@ -54,5 +54,5 @@ export const AIUsageRecordSchema = lazySchema(() => z.object({ timestamp: z.string().datetime().optional(), })); -export type TokenUsage = z.infer; -export type AIUsageRecord = z.infer; +export type TokenUsage = z.input; +export type AIUsageRecord = z.input; diff --git a/packages/spec/src/api/analytics.zod.ts b/packages/spec/src/api/analytics.zod.ts index d2a92813f3..f130298bbb 100644 --- a/packages/spec/src/api/analytics.zod.ts +++ b/packages/spec/src/api/analytics.zod.ts @@ -108,11 +108,11 @@ export const AnalyticsSqlResponseSchema = lazySchema(() => BaseResponseSchema.ex }), })); -export type AnalyticsEndpoint = z.infer; -export type AnalyticsQueryRequest = z.infer; -export type AnalyticsMetadataResponse = z.infer; +export type AnalyticsEndpoint = z.input; +export type AnalyticsQueryRequest = z.input; +export type AnalyticsMetadataResponse = z.input; /** Post-parse shape of {@link AnalyticsMetadataResponse} — defaults applied, transforms run (ADR-0122). */ export type AnalyticsMetadataResponseParsed = z.infer; -export type AnalyticsSqlResponse = z.infer; +export type AnalyticsSqlResponse = z.input; /** Post-parse shape of {@link AnalyticsSqlResponse} — defaults applied, transforms run (ADR-0122). */ export type AnalyticsSqlResponseParsed = z.infer; diff --git a/packages/spec/src/api/auth-endpoints.zod.ts b/packages/spec/src/api/auth-endpoints.zod.ts index b4a2e3286b..6ce4b6d4a5 100644 --- a/packages/spec/src/api/auth-endpoints.zod.ts +++ b/packages/spec/src/api/auth-endpoints.zod.ts @@ -225,18 +225,18 @@ export const GetAuthConfigResponseSchema = lazySchema(() => z.object({ // Type Exports // ========================================== -export type AuthEndpoint = z.infer; +export type AuthEndpoint = z.input; export type AuthEndpointPath = typeof AuthEndpointPaths[keyof typeof AuthEndpointPaths]; export type AuthEndpointAlias = keyof typeof AuthEndpointAliases; export type EndpointMappingKey = keyof typeof EndpointMapping; -export type AuthProviderInfo = z.infer; +export type AuthProviderInfo = z.input; /** Post-parse shape of {@link AuthProviderInfo} — defaults applied, transforms run (ADR-0122). */ export type AuthProviderInfoParsed = z.infer; -export type EmailPasswordConfigPublic = z.infer; -export type AuthFeaturesConfig = z.infer; +export type EmailPasswordConfigPublic = z.input; +export type AuthFeaturesConfig = z.input; /** Post-parse shape of {@link AuthFeaturesConfig} — defaults applied, transforms run (ADR-0122). */ export type AuthFeaturesConfigParsed = z.infer; -export type GetAuthConfigResponse = z.infer; +export type GetAuthConfigResponse = z.input; /** Post-parse shape of {@link GetAuthConfigResponse} — defaults applied, transforms run (ADR-0122). */ export type GetAuthConfigResponseParsed = z.infer; @@ -277,7 +277,7 @@ export const DeviceTokenResponseSchema = lazySchema(() => z.discriminatedUnion(' }), ])); -export type DeviceRequestResponse = z.infer; +export type DeviceRequestResponse = z.input; /** Post-parse shape of {@link DeviceRequestResponse} — defaults applied, transforms run (ADR-0122). */ export type DeviceRequestResponseParsed = z.infer; -export type DeviceTokenResponse = z.infer; +export type DeviceTokenResponse = z.input; diff --git a/packages/spec/src/api/auth.zod.ts b/packages/spec/src/api/auth.zod.ts index 70f7d4cdd6..2bb8b4a6f0 100644 --- a/packages/spec/src/api/auth.zod.ts +++ b/packages/spec/src/api/auth.zod.ts @@ -90,22 +90,20 @@ export const UserProfileResponseSchema = lazySchema(() => BaseResponseSchema.ext data: SessionUserSchema, })); -export type AuthProvider = z.infer; -export type SessionUser = z.infer; +export type AuthProvider = z.input; +export type SessionUser = z.input; /** Post-parse shape of {@link SessionUser} — defaults applied, transforms run (ADR-0122). */ export type SessionUserParsed = z.infer; -export type SessionUserInput = z.input; -export type Session = z.infer; -export type LoginType = z.infer; -export type LoginRequest = z.infer; +export type Session = z.input; +export type LoginType = z.input; +export type LoginRequest = z.input; /** Post-parse shape of {@link LoginRequest} — defaults applied, transforms run (ADR-0122). */ export type LoginRequestParsed = z.infer; -export type LoginRequestInput = z.input; -export type RegisterRequest = z.infer; -export type RefreshTokenRequest = z.infer; -export type SessionResponse = z.infer; +export type RegisterRequest = z.input; +export type RefreshTokenRequest = z.input; +export type SessionResponse = z.input; /** Post-parse shape of {@link SessionResponse} — defaults applied, transforms run (ADR-0122). */ export type SessionResponseParsed = z.infer; -export type UserProfileResponse = z.infer; +export type UserProfileResponse = z.input; /** Post-parse shape of {@link UserProfileResponse} — defaults applied, transforms run (ADR-0122). */ export type UserProfileResponseParsed = z.infer; diff --git a/packages/spec/src/api/automation-api.zod.ts b/packages/spec/src/api/automation-api.zod.ts index 25e5916b0c..ee344c1474 100644 --- a/packages/spec/src/api/automation-api.zod.ts +++ b/packages/spec/src/api/automation-api.zod.ts @@ -36,7 +36,7 @@ import { lazySchema } from '../shared/lazy-schema'; export const AutomationFlowPathParamsSchema = lazySchema(() => z.object({ name: z.string().describe('Flow machine name (snake_case)'), })); -export type AutomationFlowPathParams = z.infer; +export type AutomationFlowPathParams = z.input; /** * Path parameters for run-level operations. @@ -44,7 +44,7 @@ export type AutomationFlowPathParams = z.infer AutomationFlowPathParamsSchema.extend({ runId: z.string().describe('Execution run ID'), })); -export type AutomationRunPathParams = z.infer; +export type AutomationRunPathParams = z.input; // ========================================== // 2. List Flows (GET /api/automation) @@ -65,7 +65,7 @@ export const ListFlowsRequestSchema = lazySchema(() => z.object({ cursor: z.string().optional() .describe('Cursor for pagination'), })); -export type ListFlowsRequest = z.infer; +export type ListFlowsRequest = z.input; /** Post-parse shape of {@link ListFlowsRequest} — defaults applied, transforms run (ADR-0122). */ export type ListFlowsRequestParsed = z.infer; @@ -82,7 +82,7 @@ export const FlowSummarySchema = lazySchema(() => z.object({ nodeCount: z.number().int().optional().describe('Number of nodes in the flow'), lastRunAt: z.string().datetime().optional().describe('Last execution timestamp'), })); -export type FlowSummary = z.infer; +export type FlowSummary = z.input; /** * Response for the list flows endpoint. @@ -95,7 +95,7 @@ export const ListFlowsResponseSchema = lazySchema(() => BaseResponseSchema.exten hasMore: z.boolean().describe('Whether more flows are available'), }), })); -export type ListFlowsResponse = z.infer; +export type ListFlowsResponse = z.input; /** Post-parse shape of {@link ListFlowsResponse} — defaults applied, transforms run (ADR-0122). */ export type ListFlowsResponseParsed = z.infer; @@ -107,7 +107,7 @@ export type ListFlowsResponseParsed = z.infer; * Request parameters for getting a single flow. */ export const GetFlowRequestSchema = lazySchema(() => AutomationFlowPathParamsSchema); -export type GetFlowRequest = z.infer; +export type GetFlowRequest = z.input; /** * Response for the get flow endpoint. @@ -115,7 +115,7 @@ export type GetFlowRequest = z.infer; export const GetFlowResponseSchema = lazySchema(() => BaseResponseSchema.extend({ data: FlowSchema.describe('Full flow definition'), })); -export type GetFlowResponse = z.infer; +export type GetFlowResponse = z.input; /** Post-parse shape of {@link GetFlowResponse} — defaults applied, transforms run (ADR-0122). */ export type GetFlowResponseParsed = z.infer; @@ -131,6 +131,8 @@ export type GetFlowResponseParsed = z.infer; */ export const CreateFlowRequestSchema = lazySchema(() => FlowSchema); export type CreateFlowRequest = z.input; +/** Post-parse shape of {@link CreateFlowRequest} — defaults applied, transforms run (ADR-0122). */ +export type CreateFlowRequestParsed = z.infer; /** * Response after creating a flow. @@ -138,7 +140,7 @@ export type CreateFlowRequest = z.input; export const CreateFlowResponseSchema = lazySchema(() => BaseResponseSchema.extend({ data: FlowSchema.describe('The created flow definition'), })); -export type CreateFlowResponse = z.infer; +export type CreateFlowResponse = z.input; /** Post-parse shape of {@link CreateFlowResponse} — defaults applied, transforms run (ADR-0122). */ export type CreateFlowResponseParsed = z.infer; @@ -155,7 +157,7 @@ export type CreateFlowResponseParsed = z.infer; export const UpdateFlowRequestSchema = lazySchema(() => AutomationFlowPathParamsSchema.extend({ definition: FlowSchema.partial().describe('Partial flow definition to update'), })); -export type UpdateFlowRequest = z.infer; +export type UpdateFlowRequest = z.input; /** Post-parse shape of {@link UpdateFlowRequest} — defaults applied, transforms run (ADR-0122). */ export type UpdateFlowRequestParsed = z.infer; @@ -165,7 +167,7 @@ export type UpdateFlowRequestParsed = z.infer; export const UpdateFlowResponseSchema = lazySchema(() => BaseResponseSchema.extend({ data: FlowSchema.describe('The updated flow definition'), })); -export type UpdateFlowResponse = z.infer; +export type UpdateFlowResponse = z.input; /** Post-parse shape of {@link UpdateFlowResponse} — defaults applied, transforms run (ADR-0122). */ export type UpdateFlowResponseParsed = z.infer; @@ -177,7 +179,7 @@ export type UpdateFlowResponseParsed = z.infer; * Request parameters for deleting a flow. */ export const DeleteFlowRequestSchema = lazySchema(() => AutomationFlowPathParamsSchema); -export type DeleteFlowRequest = z.infer; +export type DeleteFlowRequest = z.input; /** * Response after deleting a flow. @@ -188,7 +190,7 @@ export const DeleteFlowResponseSchema = lazySchema(() => BaseResponseSchema.exte deleted: z.boolean().describe('Whether the flow was deleted'), }), })); -export type DeleteFlowResponse = z.infer; +export type DeleteFlowResponse = z.input; /** Post-parse shape of {@link DeleteFlowResponse} — defaults applied, transforms run (ADR-0122). */ export type DeleteFlowResponseParsed = z.infer; @@ -214,7 +216,7 @@ export const TriggerFlowRequestSchema = lazySchema(() => AutomationFlowPathParam params: z.record(z.string(), z.unknown()).optional() .describe('Additional contextual data'), })); -export type TriggerFlowRequest = z.infer; +export type TriggerFlowRequest = z.input; /** * Response after triggering a flow execution. @@ -227,7 +229,7 @@ export const TriggerFlowResponseSchema = lazySchema(() => BaseResponseSchema.ext durationMs: z.number().optional().describe('Execution duration in milliseconds'), }), })); -export type TriggerFlowResponse = z.infer; +export type TriggerFlowResponse = z.input; /** Post-parse shape of {@link TriggerFlowResponse} — defaults applied, transforms run (ADR-0122). */ export type TriggerFlowResponseParsed = z.infer; @@ -244,7 +246,7 @@ export type TriggerFlowResponseParsed = z.infer AutomationFlowPathParamsSchema.extend({ enabled: z.boolean().describe('Whether to enable (true) or disable (false) the flow'), })); -export type ToggleFlowRequest = z.infer; +export type ToggleFlowRequest = z.input; /** * Response after toggling a flow. @@ -255,7 +257,7 @@ export const ToggleFlowResponseSchema = lazySchema(() => BaseResponseSchema.exte enabled: z.boolean().describe('New enabled state'), }), })); -export type ToggleFlowResponse = z.infer; +export type ToggleFlowResponse = z.input; /** Post-parse shape of {@link ToggleFlowResponse} — defaults applied, transforms run (ADR-0122). */ export type ToggleFlowResponseParsed = z.infer; @@ -276,7 +278,7 @@ export const ListRunsRequestSchema = lazySchema(() => AutomationFlowPathParamsSc cursor: z.string().optional() .describe('Cursor for pagination'), })); -export type ListRunsRequest = z.infer; +export type ListRunsRequest = z.input; /** Post-parse shape of {@link ListRunsRequest} — defaults applied, transforms run (ADR-0122). */ export type ListRunsRequestParsed = z.infer; @@ -291,7 +293,7 @@ export const ListRunsResponseSchema = lazySchema(() => BaseResponseSchema.extend hasMore: z.boolean().describe('Whether more runs are available'), }), })); -export type ListRunsResponse = z.infer; +export type ListRunsResponse = z.input; /** Post-parse shape of {@link ListRunsResponse} — defaults applied, transforms run (ADR-0122). */ export type ListRunsResponseParsed = z.infer; @@ -303,7 +305,7 @@ export type ListRunsResponseParsed = z.infer; * Request parameters for getting a single execution run. */ export const GetRunRequestSchema = lazySchema(() => AutomationRunPathParamsSchema); -export type GetRunRequest = z.infer; +export type GetRunRequest = z.input; /** * Response for the get run endpoint. @@ -311,7 +313,7 @@ export type GetRunRequest = z.infer; export const GetRunResponseSchema = lazySchema(() => BaseResponseSchema.extend({ data: ExecutionLogSchema.describe('Full execution log with step details'), })); -export type GetRunResponse = z.infer; +export type GetRunResponse = z.input; /** Post-parse shape of {@link GetRunResponse} — defaults applied, transforms run (ADR-0122). */ export type GetRunResponseParsed = z.infer; @@ -333,7 +335,7 @@ export const AutomationApiErrorCode = z.enum([ 'node_executor_not_found', 'concurrent_execution_limit', ]); -export type AutomationApiErrorCode = z.infer; +export type AutomationApiErrorCode = z.input; // ========================================== // 12. Automation API Contract Registry diff --git a/packages/spec/src/api/batch.zod.ts b/packages/spec/src/api/batch.zod.ts index 00c13d2b95..6b7138aa62 100644 --- a/packages/spec/src/api/batch.zod.ts +++ b/packages/spec/src/api/batch.zod.ts @@ -36,7 +36,7 @@ export const BatchOperationType = z.enum([ 'delete', // Batch delete ]); -export type BatchOperationType = z.infer; +export type BatchOperationType = z.input; // ========================================== // Batch Request Schemas @@ -52,7 +52,7 @@ export const BatchRecordSchema = lazySchema(() => z.object({ externalId: z.string().optional().describe('External ID for upsert matching'), })); -export type BatchRecord = z.infer; +export type BatchRecord = z.input; /** * Batch Operation Options Schema @@ -97,7 +97,7 @@ export const BatchOptionsSchema = lazySchema(() => z.object({ ), })); -export type BatchOptions = z.infer; +export type BatchOptions = z.input; /** Post-parse shape of {@link BatchOptions} — defaults applied, transforms run (ADR-0122). */ export type BatchOptionsParsed = z.infer; @@ -132,6 +132,8 @@ export const BatchUpdateRequestSchema = lazySchema(() => z.object({ })); export type BatchUpdateRequest = z.input; +/** Post-parse shape of {@link BatchUpdateRequest} — defaults applied, transforms run (ADR-0122). */ +export type BatchUpdateRequestParsed = z.infer; /** * Simplified Batch Update Request (for updateMany API) @@ -164,7 +166,7 @@ export const UpdateManyRecordSchema = lazySchema(() => z.object({ data: RecordDataSchema.describe('Fields to update'), })); -export type UpdateManyRecord = z.infer; +export type UpdateManyRecord = z.input; export const UpdateManyRequestSchema = lazySchema(() => z.object({ // [#3939] Cap lives at the route (`batch.maxBatchSize`), not here — see @@ -174,6 +176,8 @@ export const UpdateManyRequestSchema = lazySchema(() => z.object({ })); export type UpdateManyRequest = z.input; +/** Post-parse shape of {@link UpdateManyRequest} — defaults applied, transforms run (ADR-0122). */ +export type UpdateManyRequestParsed = z.infer; // ========================================== // Batch Response Schemas @@ -204,7 +208,7 @@ export const BatchOperationResultSchema = lazySchema(() => z.object({ ), })); -export type BatchOperationResult = z.infer; +export type BatchOperationResult = z.input; /** Post-parse shape of {@link BatchOperationResult} — defaults applied, transforms run (ADR-0122). */ export type BatchOperationResultParsed = z.infer; @@ -257,7 +261,7 @@ export const BatchUpdateResponseSchema = lazySchema(() => BaseResponseSchema.ext results: z.array(BatchOperationResultSchema).describe('Detailed results for each record'), })); -export type BatchUpdateResponse = z.infer; +export type BatchUpdateResponse = z.input; /** Post-parse shape of {@link BatchUpdateResponse} — defaults applied, transforms run (ADR-0122). */ export type BatchUpdateResponseParsed = z.infer; @@ -285,7 +289,7 @@ export const DeleteManyRequestSchema = lazySchema(() => z.object({ options: BatchOptionsSchema.optional().describe('Delete options'), })); -export type DeleteManyRequest = z.infer; +export type DeleteManyRequest = z.input; /** Post-parse shape of {@link DeleteManyRequest} — defaults applied, transforms run (ADR-0122). */ export type DeleteManyRequestParsed = z.infer; @@ -328,7 +332,7 @@ export const BatchConfigSchema = lazySchema(() => z.object({ defaultOptions: BatchOptionsSchema.optional().describe('Default batch options'), }).passthrough()); // Allow additional properties -export type BatchConfig = z.infer; +export type BatchConfig = z.input; /** Post-parse shape of {@link BatchConfig} — defaults applied, transforms run (ADR-0122). */ export type BatchConfigParsed = z.infer; @@ -351,6 +355,8 @@ export const CrossObjectBatchOperationSchema = lazySchema(() => z.object({ })); export type CrossObjectBatchOperation = z.input; +/** Post-parse shape of {@link CrossObjectBatchOperation} — defaults applied, transforms run (ADR-0122). */ +export type CrossObjectBatchOperationParsed = z.infer; /** * Request payload for the cross-object transactional batch @@ -374,6 +380,8 @@ export const CrossObjectBatchRequestSchema = lazySchema(() => z.object({ })); export type CrossObjectBatchRequest = z.input; +/** Post-parse shape of {@link CrossObjectBatchRequest} — defaults applied, transforms run (ADR-0122). */ +export type CrossObjectBatchRequestParsed = z.infer; /** * One strip event on a cross-object batch, tagged with the operation it @@ -387,7 +395,7 @@ export const CrossObjectBatchDroppedFieldsSchema = lazySchema(() => DroppedField index: z.number().int().min(0).describe('Index of the operation in the request `operations` array'), }).describe('A cross-object batch strip event: dropped fields plus the operation index')); -export type CrossObjectBatchDroppedFields = z.infer; +export type CrossObjectBatchDroppedFields = z.input; /** * Response for the cross-object transactional batch — one result per operation, @@ -408,4 +416,4 @@ export const CrossObjectBatchResponseSchema = lazySchema(() => z.object({ ), })); -export type CrossObjectBatchResponse = z.infer; +export type CrossObjectBatchResponse = z.input; diff --git a/packages/spec/src/api/contract.zod.ts b/packages/spec/src/api/contract.zod.ts index 946cfd4914..e8cbf23142 100644 --- a/packages/spec/src/api/contract.zod.ts +++ b/packages/spec/src/api/contract.zod.ts @@ -316,43 +316,43 @@ export const QueryOptimizationConfigSchema = lazySchema(() => z.object({ enableQueryPlan: z.boolean().default(false).describe('Log query execution plans for debugging'), })); -export type ApiError = z.infer; +export type ApiError = z.input; /** Post-parse shape of {@link ApiError} — defaults applied, transforms run (ADR-0122). */ export type ApiErrorParsed = z.infer; -export type BaseResponse = z.infer; +export type BaseResponse = z.input; /** Post-parse shape of {@link BaseResponse} — defaults applied, transforms run (ADR-0122). */ export type BaseResponseParsed = z.infer; -export type RecordData = z.infer; -export type CreateRequest = z.infer; -export type UpdateRequest = z.infer; -export type BulkRequest = z.infer; +export type RecordData = z.input; +export type CreateRequest = z.input; +export type UpdateRequest = z.input; +export type BulkRequest = z.input; /** Post-parse shape of {@link BulkRequest} — defaults applied, transforms run (ADR-0122). */ export type BulkRequestParsed = z.infer; -export type ExportRequest = z.infer; +export type ExportRequest = z.input; /** Post-parse shape of {@link ExportRequest} — defaults applied, transforms run (ADR-0122). */ export type ExportRequestParsed = z.infer; -export type SingleRecordResponse = z.infer; +export type SingleRecordResponse = z.input; /** Post-parse shape of {@link SingleRecordResponse} — defaults applied, transforms run (ADR-0122). */ export type SingleRecordResponseParsed = z.infer; -export type ListRecordResponse = z.infer; +export type ListRecordResponse = z.input; /** Post-parse shape of {@link ListRecordResponse} — defaults applied, transforms run (ADR-0122). */ export type ListRecordResponseParsed = z.infer; -export type IdRequest = z.infer; -export type ModificationResult = z.infer; +export type IdRequest = z.input; +export type ModificationResult = z.input; /** Post-parse shape of {@link ModificationResult} — defaults applied, transforms run (ADR-0122). */ export type ModificationResultParsed = z.infer; -export type BulkResponse = z.infer; +export type BulkResponse = z.input; /** Post-parse shape of {@link BulkResponse} — defaults applied, transforms run (ADR-0122). */ export type BulkResponseParsed = z.infer; -export type DeleteResponse = z.infer; +export type DeleteResponse = z.input; /** Post-parse shape of {@link DeleteResponse} — defaults applied, transforms run (ADR-0122). */ export type DeleteResponseParsed = z.infer; -export type DataLoaderConfig = z.infer; +export type DataLoaderConfig = z.input; /** Post-parse shape of {@link DataLoaderConfig} — defaults applied, transforms run (ADR-0122). */ export type DataLoaderConfigParsed = z.infer; -export type BatchLoadingStrategy = z.infer; +export type BatchLoadingStrategy = z.input; /** Post-parse shape of {@link BatchLoadingStrategy} — defaults applied, transforms run (ADR-0122). */ export type BatchLoadingStrategyParsed = z.infer; -export type QueryOptimizationConfig = z.infer; +export type QueryOptimizationConfig = z.input; /** Post-parse shape of {@link QueryOptimizationConfig} — defaults applied, transforms run (ADR-0122). */ export type QueryOptimizationConfigParsed = z.infer; diff --git a/packages/spec/src/api/discovery.zod.ts b/packages/spec/src/api/discovery.zod.ts index dc2c824f36..7786cf197e 100644 --- a/packages/spec/src/api/discovery.zod.ts +++ b/packages/spec/src/api/discovery.zod.ts @@ -26,7 +26,7 @@ export const ServiceStatus = z.enum([ + 'unavailable = not installed, degraded = partial, stub = placeholder that returns 501' ); -export type ServiceStatus = z.infer; +export type ServiceStatus = z.input; /** * Service Status in Discovery Response @@ -107,7 +107,7 @@ export const ServiceSelfInfoSchema = lazySchema(() => z.object({ message: z.string().optional().describe('Human-readable explanation, e.g. what to install for the full implementation'), })); -export type ServiceSelfInfo = z.infer; +export type ServiceSelfInfo = z.input; /** * Reads the standardized self-description marker off a registered service @@ -281,7 +281,7 @@ export const DiscoveryEnvironmentSchema = lazySchema(() => z + 'environment (that is `sys_environment` / EnvironmentTypeSchema, a richer 7-member taxonomy).' )); -export type DiscoveryEnvironment = z.infer; +export type DiscoveryEnvironment = z.input; /** * `NODE_ENV` spellings accepted for each declared discovery environment (#4828). @@ -462,7 +462,7 @@ export const WellKnownCapabilitiesSchema = lazySchema(() => z.object({ i18n: z.boolean().describe('Whether the backend serves the i18n surface (translations, locale negotiation)'), }).describe('Well-known capability flags for frontend intelligent adaptation')); -export type WellKnownCapabilities = z.infer; +export type WellKnownCapabilities = z.input; /** * The capability vocabulary as a key list, derived from @@ -494,7 +494,7 @@ export const CapabilityDescriptorSchema = lazySchema(() => z.object({ .describe('Human-readable capability description'), })); -export type CapabilityDescriptor = z.infer; +export type CapabilityDescriptor = z.input; /** * `capabilities` as a CLOSED object over the vocabulary — one required entry @@ -612,9 +612,9 @@ export const DiscoverySchema = lazySchema(() => z.object({ metadata: z.record(z.string(), z.unknown()).optional().describe('Custom metadata key-value pairs for extensibility'), })); -export type DiscoveryResponse = z.infer; -export type ApiRoutes = z.infer; -export type ServiceInfo = z.infer; +export type DiscoveryResponse = z.input; +export type ApiRoutes = z.input; +export type ServiceInfo = z.input; // ============================================================================ // Route Health Report @@ -648,7 +648,7 @@ export const RouteHealthEntrySchema = lazySchema(() => z.object({ message: z.string().optional().describe('Diagnostic message'), })); -export type RouteHealthEntry = z.infer; +export type RouteHealthEntry = z.input; /** * Route Health Report Schema @@ -672,4 +672,4 @@ export const RouteHealthReportSchema = lazySchema(() => z.object({ routes: z.array(RouteHealthEntrySchema).describe('Per-route health entries'), })); -export type RouteHealthReport = z.infer; +export type RouteHealthReport = z.input; diff --git a/packages/spec/src/api/dispatcher.zod.ts b/packages/spec/src/api/dispatcher.zod.ts index 1f59808f01..ee543e9f81 100644 --- a/packages/spec/src/api/dispatcher.zod.ts +++ b/packages/spec/src/api/dispatcher.zod.ts @@ -77,10 +77,9 @@ export const DispatcherRouteSchema = z.object({ .describe('Required permissions for this route namespace'), }); -export type DispatcherRoute = z.infer; +export type DispatcherRoute = z.input; /** Post-parse shape of {@link DispatcherRoute} — defaults applied, transforms run (ADR-0122). */ export type DispatcherRouteParsed = z.infer; -export type DispatcherRouteInput = z.input; // ============================================================================ // Dispatcher Configuration @@ -126,10 +125,9 @@ export const DispatcherConfigSchema = z.object({ .describe('Proxy target URL when fallback is "proxy"'), }); -export type DispatcherConfig = z.infer; +export type DispatcherConfig = z.input; /** Post-parse shape of {@link DispatcherConfig} — defaults applied, transforms run (ADR-0122). */ export type DispatcherConfigParsed = z.infer; -export type DispatcherConfigInput = z.input; // ============================================================================ // Default Route Table — REMOVED (#3586) @@ -168,7 +166,7 @@ export const DispatcherErrorCode = z.enum([ 'SERVICE_UNAVAILABLE', ]).describe('Route-resolution failure mode emitted in `error.code`'); -export type DispatcherErrorCode = z.infer; +export type DispatcherErrorCode = z.input; /** * Dispatcher Error Response Schema @@ -209,4 +207,4 @@ export const DispatcherErrorResponseSchema = z.object({ }), }); -export type DispatcherErrorResponse = z.infer; +export type DispatcherErrorResponse = z.input; diff --git a/packages/spec/src/api/documentation.zod.ts b/packages/spec/src/api/documentation.zod.ts index 9d0c609d9c..cc4a5eb5f6 100644 --- a/packages/spec/src/api/documentation.zod.ts +++ b/packages/spec/src/api/documentation.zod.ts @@ -61,7 +61,7 @@ export const OpenApiServerSchema = lazySchema(() => z.object({ })).optional().describe('URL template variables'), })); -export type OpenApiServer = z.infer; +export type OpenApiServer = z.input; /** * OpenAPI Security Scheme Schema @@ -99,7 +99,7 @@ export const OpenApiSecuritySchemeSchema = lazySchema(() => z.object({ description: z.string().optional().describe('Security scheme description'), })); -export type OpenApiSecurityScheme = z.infer; +export type OpenApiSecurityScheme = z.input; /** * OpenAPI Specification Schema @@ -186,7 +186,7 @@ export const OpenApiSpecSchema = lazySchema(() => z.object({ }).optional().describe('External documentation'), })); -export type OpenApiSpec = z.infer; +export type OpenApiSpec = z.input; /** Post-parse shape of {@link OpenApiSpec} — defaults applied, transforms run (ADR-0122). */ export type OpenApiSpecParsed = z.infer; @@ -208,7 +208,7 @@ export const ApiTestingUiType = z.enum([ 'custom', // Custom implementation ]); -export type ApiTestingUiType = z.infer; +export type ApiTestingUiType = z.input; /** * API Testing UI Configuration Schema @@ -278,7 +278,7 @@ export const ApiTestingUiConfigSchema = lazySchema(() => z.object({ }).optional().describe('Layout configuration'), })); -export type ApiTestingUiConfig = z.infer; +export type ApiTestingUiConfig = z.input; /** Post-parse shape of {@link ApiTestingUiConfig} — defaults applied, transforms run (ADR-0122). */ export type ApiTestingUiConfigParsed = z.infer; @@ -339,7 +339,7 @@ export const ApiTestRequestSchema = lazySchema(() => z.object({ }).optional().describe('Expected response for validation'), })); -export type ApiTestRequest = z.infer; +export type ApiTestRequest = z.input; /** Post-parse shape of {@link ApiTestRequest} — defaults applied, transforms run (ADR-0122). */ export type ApiTestRequestParsed = z.infer; @@ -383,7 +383,7 @@ export const ApiTestCollectionSchema = lazySchema(() => z.object({ })).optional().describe('Request folders for organization'), })); -export type ApiTestCollection = z.infer; +export type ApiTestCollection = z.input; /** Post-parse shape of {@link ApiTestCollection} — defaults applied, transforms run (ADR-0122). */ export type ApiTestCollectionParsed = z.infer; @@ -417,7 +417,7 @@ export const ApiChangelogEntrySchema = lazySchema(() => z.object({ migrationGuide: z.string().optional().describe('Migration guide URL or text'), })); -export type ApiChangelogEntry = z.infer; +export type ApiChangelogEntry = z.input; /** Post-parse shape of {@link ApiChangelogEntry} — defaults applied, transforms run (ADR-0122). */ export type ApiChangelogEntryParsed = z.infer; @@ -440,7 +440,7 @@ export const CodeGenerationTemplateSchema = lazySchema(() => z.object({ variables: z.array(z.string()).optional().describe('Required template variables'), })); -export type CodeGenerationTemplate = z.infer; +export type CodeGenerationTemplate = z.input; /** * API Documentation Configuration Schema @@ -543,7 +543,7 @@ export const ApiDocumentationConfigSchema = lazySchema(() => z.object({ })).optional().describe('Global tag definitions'), })); -export type ApiDocumentationConfig = z.infer; +export type ApiDocumentationConfig = z.input; /** Post-parse shape of {@link ApiDocumentationConfig} — defaults applied, transforms run (ADR-0122). */ export type ApiDocumentationConfigParsed = z.infer; @@ -577,7 +577,7 @@ export const GeneratedApiDocumentationSchema = lazySchema(() => z.object({ sourceApis: z.array(z.string()).describe('Source API IDs used for generation'), })); -export type GeneratedApiDocumentation = z.infer; +export type GeneratedApiDocumentation = z.input; /** Post-parse shape of {@link GeneratedApiDocumentation} — defaults applied, transforms run (ADR-0122). */ export type GeneratedApiDocumentationParsed = z.infer; diff --git a/packages/spec/src/api/endpoint.zod.ts b/packages/spec/src/api/endpoint.zod.ts index 6d34592d88..d268d0dde3 100644 --- a/packages/spec/src/api/endpoint.zod.ts +++ b/packages/spec/src/api/endpoint.zod.ts @@ -127,7 +127,6 @@ export const ApiEndpoint = Object.assign(ApiEndpointSchema, { create: >(config: T) => config, }); -export type ApiEndpoint = z.infer; +export type ApiEndpoint = z.input; /** Post-parse shape of {@link ApiEndpoint} — defaults applied, transforms run (ADR-0122). */ export type ApiEndpointParsed = z.infer; -export type ApiEndpointInput = z.input; diff --git a/packages/spec/src/api/errors.zod.ts b/packages/spec/src/api/errors.zod.ts index 4209a6688f..0c661bf621 100644 --- a/packages/spec/src/api/errors.zod.ts +++ b/packages/spec/src/api/errors.zod.ts @@ -39,7 +39,7 @@ export const ErrorCategory = z.enum([ 'maintenance', // Planned maintenance (503) ]); -export type ErrorCategory = z.infer; +export type ErrorCategory = z.input; // ========================================== // Standard Error Codes @@ -124,7 +124,7 @@ export const StandardErrorCode = z.enum([ 'TRANSACTION_FAILED', // Transaction rolled back ]); -export type StandardErrorCode = z.infer; +export type StandardErrorCode = z.input; // ========================================== // Enhanced Error Schema @@ -207,7 +207,7 @@ export const RetryStrategy = z.enum([ 'retry_after', // Retry after specified delay ]); -export type RetryStrategy = z.infer; +export type RetryStrategy = z.input; /** * Which constraint a single value violated (ADR-0114 D2). @@ -265,7 +265,7 @@ export const FieldErrorCode = z.enum([ 'invalid_transition', // state machine: not a legal move from here ]); -export type FieldErrorCode = z.infer; +export type FieldErrorCode = z.input; /** * Field Error Schema @@ -306,7 +306,7 @@ export const FieldErrorSchema = lazySchema(() => z.object({ .describe('The constraint that was violated, as discrete values (e.g. { maxLength: 512, actual: 3000 })'), })); -export type FieldError = z.infer; +export type FieldError = z.input; /** * Enhanced API Error Schema @@ -397,7 +397,7 @@ export const EnhancedApiErrorSchema = lazySchema(() => z.object({ helpText: z.string().optional().describe('Suggested actions to resolve the error'), })); -export type EnhancedApiError = z.infer; +export type EnhancedApiError = z.input; /** Post-parse shape of {@link EnhancedApiError} — defaults applied, transforms run (ADR-0122). */ export type EnhancedApiErrorParsed = z.infer; @@ -431,6 +431,6 @@ export const ErrorResponseSchema = lazySchema(() => z.object({ }).optional().describe('Response metadata'), })); -export type ErrorResponse = z.infer; +export type ErrorResponse = z.input; /** Post-parse shape of {@link ErrorResponse} — defaults applied, transforms run (ADR-0122). */ export type ErrorResponseParsed = z.infer; diff --git a/packages/spec/src/api/events.zod.ts b/packages/spec/src/api/events.zod.ts index c5016c0bbd..1246a568de 100644 --- a/packages/spec/src/api/events.zod.ts +++ b/packages/spec/src/api/events.zod.ts @@ -56,7 +56,7 @@ export const MetadataEventType = z.enum([ 'metadata.permission.deleted', ]); -export type MetadataEventType = z.infer; +export type MetadataEventType = z.input; /** * The `{action}` half of `metadata.{type}.{action}`. @@ -141,7 +141,7 @@ export const DataEventType = z.enum([ 'data.record.deleted', ]); -export type DataEventType = z.infer; +export type DataEventType = z.input; /** * Bulk Data Event Types @@ -174,7 +174,7 @@ export const BulkDataEventType = z.enum([ 'data.records.deleted', ]); -export type BulkDataEventType = z.infer; +export type BulkDataEventType = z.input; /** * Metadata Event Payload @@ -208,7 +208,7 @@ export const MetadataEventSchema = lazySchema(() => z.object({ timestamp: z.string().datetime().describe('Event timestamp'), })); -export type MetadataEvent = z.infer; +export type MetadataEvent = z.input; /** * Data Event Payload @@ -245,7 +245,7 @@ export const DataEventSchema = lazySchema(() => z.object({ timestamp: z.string().datetime().describe('Event timestamp'), })); -export type DataEvent = z.infer; +export type DataEvent = z.input; /** * Bulk Data Event Payload @@ -297,4 +297,4 @@ export const BulkDataEventSchema = lazySchema(() => z.object({ timestamp: z.string().datetime().describe('Event timestamp'), })); -export type BulkDataEvent = z.infer; +export type BulkDataEvent = z.input; diff --git a/packages/spec/src/api/export.zod.ts b/packages/spec/src/api/export.zod.ts index 29b637febb..0ca0022383 100644 --- a/packages/spec/src/api/export.zod.ts +++ b/packages/spec/src/api/export.zod.ts @@ -32,7 +32,7 @@ export const ExportFormat = z.enum([ 'xlsx', 'parquet', ]); -export type ExportFormat = z.infer; +export type ExportFormat = z.input; /** * Export Job Status @@ -45,7 +45,7 @@ export const ExportJobStatus = z.enum([ 'cancelled', 'expired', ]); -export type ExportJobStatus = z.infer; +export type ExportJobStatus = z.input; // ========================================== // 2. Export Job Request / Response @@ -78,7 +78,7 @@ export const CreateExportJobRequestSchema = lazySchema(() => z.object({ templateId: z.string().optional() .describe('Export template ID for predefined field mappings'), })); -export type CreateExportJobRequest = z.infer; +export type CreateExportJobRequest = z.input; /** Post-parse shape of {@link CreateExportJobRequest} — defaults applied, transforms run (ADR-0122). */ export type CreateExportJobRequestParsed = z.infer; @@ -94,7 +94,7 @@ export const CreateExportJobResponseSchema = lazySchema(() => BaseResponseSchema createdAt: z.string().datetime().describe('Job creation timestamp'), }), })); -export type CreateExportJobResponse = z.infer; +export type CreateExportJobResponse = z.input; /** Post-parse shape of {@link CreateExportJobResponse} — defaults applied, transforms run (ADR-0122). */ export type CreateExportJobResponseParsed = z.infer; @@ -125,7 +125,7 @@ export const ExportJobProgressSchema = lazySchema(() => BaseResponseSchema.exten completedAt: z.string().datetime().optional().describe('Completion timestamp'), }), })); -export type ExportJobProgress = z.infer; +export type ExportJobProgress = z.input; /** Post-parse shape of {@link ExportJobProgress} — defaults applied, transforms run (ADR-0122). */ export type ExportJobProgressParsed = z.infer; @@ -141,7 +141,7 @@ export const ImportValidationMode = z.enum([ 'lenient', // Skip invalid records, import valid ones 'dry_run', // Validate all records without persisting ]); -export type ImportValidationMode = z.infer; +export type ImportValidationMode = z.input; /** * Deduplication Strategy @@ -153,7 +153,7 @@ export const DeduplicationStrategy = z.enum([ 'create_new', // Create new record even if duplicate 'fail', // Fail the import if duplicates found ]); -export type DeduplicationStrategy = z.infer; +export type DeduplicationStrategy = z.input; /** * Import Validation Config Schema @@ -185,7 +185,7 @@ export const ImportValidationConfigSchema = lazySchema(() => z.object({ nullValues: z.array(z.string()).optional() .describe('Strings to treat as null (e.g., ["", "N/A", "null"])'), })); -export type ImportValidationConfig = z.infer; +export type ImportValidationConfig = z.input; /** Post-parse shape of {@link ImportValidationConfig} — defaults applied, transforms run (ADR-0122). */ export type ImportValidationConfigParsed = z.infer; @@ -209,7 +209,7 @@ export const ImportValidationResultSchema = lazySchema(() => BaseResponseSchema. .describe('Preview of first N valid records (for dry_run mode)'), }), })); -export type ImportValidationResult = z.infer; +export type ImportValidationResult = z.input; /** Post-parse shape of {@link ImportValidationResult} — defaults applied, transforms run (ADR-0122). */ export type ImportValidationResultParsed = z.infer; @@ -233,7 +233,7 @@ export const FieldMappingEntrySchema = lazySchema(() => z.object({ required: z.boolean().default(false) .describe('Whether this field is required (import validation)'), })); -export type FieldMappingEntry = z.infer; +export type FieldMappingEntry = z.input; /** Post-parse shape of {@link FieldMappingEntry} — defaults applied, transforms run (ADR-0122). */ export type FieldMappingEntryParsed = z.infer; @@ -268,7 +268,7 @@ export const ExportImportTemplateSchema = lazySchema(() => z.object({ updatedAt: z.string().datetime().optional().describe('Last update timestamp'), createdBy: z.string().optional().describe('User who created the template'), })); -export type ExportImportTemplate = z.infer; +export type ExportImportTemplate = z.input; /** Post-parse shape of {@link ExportImportTemplate} — defaults applied, transforms run (ADR-0122). */ export type ExportImportTemplateParsed = z.infer; @@ -285,7 +285,7 @@ export const ImportWriteMode = z.enum([ 'update', // Update an existing record matched by matchFields; skip if none 'upsert', // Update when matched by matchFields, else create ]); -export type ImportWriteMode = z.infer; +export type ImportWriteMode = z.input; /** * Field Mapping (import) @@ -296,7 +296,7 @@ export const ImportMappingSchema = lazySchema(() => z.union([ z.record(z.string(), z.string()), z.array(FieldMappingEntrySchema), ])); -export type ImportMapping = z.infer; +export type ImportMapping = z.input; /** Post-parse shape of {@link ImportMapping} — defaults applied, transforms run (ADR-0122). */ export type ImportMappingParsed = z.infer; @@ -346,7 +346,7 @@ export const ImportRequestSchema = lazySchema(() => z.object({ skipBlankMatchKey: z.boolean().default(false) .describe('Skip rows whose matchFields are blank (default: upsert creates them, update skips them)'), })); -export type ImportRequest = z.infer; +export type ImportRequest = z.input; /** Post-parse shape of {@link ImportRequest} — defaults applied, transforms run (ADR-0122). */ export type ImportRequestParsed = z.infer; @@ -365,7 +365,7 @@ export const ImportRowResultSchema = lazySchema(() => z.object({ code: z.string().optional().describe('Error code (failed rows)'), error: z.string().optional().describe('Human-readable error message (failed rows)'), })); -export type ImportRowResult = z.infer; +export type ImportRowResult = z.input; /** * Import Response Schema @@ -383,7 +383,7 @@ export const ImportResponseSchema = lazySchema(() => z.object({ skipped: z.number().int().describe('Rows skipped (no match in update mode, etc.)'), results: z.array(ImportRowResultSchema).describe('Per-row outcomes'), })); -export type ImportResponse = z.infer; +export type ImportResponse = z.input; // ========================================== // 4b. Asynchronous Import Jobs @@ -407,7 +407,7 @@ export const ImportJobStatus = z.enum([ 'failed', // Aborted on a fatal error 'cancelled', // Cancelled by the caller before completion ]); -export type ImportJobStatus = z.infer; +export type ImportJobStatus = z.input; /** * Create Import Job Request — body for `POST /api/v1/data/:object/import/jobs`. @@ -416,7 +416,7 @@ export type ImportJobStatus = z.infer; * progress instead of blocking until done. */ export const CreateImportJobRequestSchema = ImportRequestSchema; -export type CreateImportJobRequest = z.infer; +export type CreateImportJobRequest = z.input; /** Post-parse shape of {@link CreateImportJobRequest} — defaults applied, transforms run (ADR-0122). */ export type CreateImportJobRequestParsed = z.infer; @@ -430,7 +430,7 @@ export const CreateImportJobResponseSchema = lazySchema(() => z.object({ total: z.number().int().describe('Rows accepted for processing'), createdAt: z.string().describe('Job creation timestamp (ISO 8601)'), })); -export type CreateImportJobResponse = z.infer; +export type CreateImportJobResponse = z.input; /** * Import Job Progress — the live counters a client polls while the job runs. @@ -455,7 +455,7 @@ export const ImportJobProgressSchema = lazySchema(() => z.object({ completedAt: z.string().optional().describe('Completion timestamp (ISO 8601)'), createdAt: z.string().describe('Job creation timestamp (ISO 8601)'), })); -export type ImportJobProgress = z.infer; +export type ImportJobProgress = z.input; /** * Import Job Results — the progress payload plus a capped sample of per-row @@ -465,7 +465,7 @@ export const ImportJobResultsSchema = lazySchema(() => ImportJobProgressSchema.e results: z.array(ImportRowResultSchema).describe('Capped sample of per-row outcomes (failures first)'), resultsTruncated: z.boolean().describe('Whether `results` is a capped sample of a larger set'), })); -export type ImportJobResults = z.infer; +export type ImportJobResults = z.input; /** * List Import Jobs Request — query params for the history endpoint. @@ -476,7 +476,7 @@ export const ListImportJobsRequestSchema = lazySchema(() => z.object({ limit: z.number().int().min(1).max(200).default(50).describe('Max rows to return'), offset: z.number().int().min(0).default(0).describe('Pagination offset'), })); -export type ListImportJobsRequest = z.infer; +export type ListImportJobsRequest = z.input; /** Post-parse shape of {@link ListImportJobsRequest} — defaults applied, transforms run (ADR-0122). */ export type ListImportJobsRequestParsed = z.infer; @@ -496,13 +496,13 @@ export const ImportJobSummarySchema = lazySchema(() => z.object({ undoable: z.boolean().describe('Whether this job can still be logically rolled back'), revertedAt: z.string().optional().describe('When the job was undone / rolled back (ISO 8601)'), })); -export type ImportJobSummary = z.infer; +export type ImportJobSummary = z.input; /** List Import Jobs Response — newest first. */ export const ListImportJobsResponseSchema = lazySchema(() => z.object({ jobs: z.array(ImportJobSummarySchema).describe('Import jobs, newest first'), })); -export type ListImportJobsResponse = z.infer; +export type ListImportJobsResponse = z.input; /** * Undo Import Job Response — the outcome of a logical rollback: created records @@ -516,7 +516,7 @@ export const UndoImportJobResponseSchema = lazySchema(() => z.object({ restored: z.number().int().describe('Updated records restored to pre-import values'), failed: z.number().int().describe('Reversal operations that failed'), })); -export type UndoImportJobResponse = z.infer; +export type UndoImportJobResponse = z.input; // ========================================== // 5. Scheduled Export Jobs @@ -564,7 +564,7 @@ export const ScheduledExportSchema = lazySchema(() => z.object({ createdAt: z.string().datetime().optional().describe('Creation timestamp'), createdBy: z.string().optional().describe('User who created the schedule'), })); -export type ScheduledExport = z.infer; +export type ScheduledExport = z.input; /** Post-parse shape of {@link ScheduledExport} — defaults applied, transforms run (ADR-0122). */ export type ScheduledExportParsed = z.infer; @@ -581,7 +581,7 @@ export type ScheduledExportParsed = z.infer; export const GetExportJobDownloadRequestSchema = lazySchema(() => z.object({ jobId: z.string().describe('Export job ID'), })); -export type GetExportJobDownloadRequest = z.infer; +export type GetExportJobDownloadRequest = z.input; /** * Get Export Job Download Response @@ -598,7 +598,7 @@ export const GetExportJobDownloadResponseSchema = lazySchema(() => BaseResponseS checksum: z.string().optional().describe('File checksum (SHA-256)'), }), })); -export type GetExportJobDownloadResponse = z.infer; +export type GetExportJobDownloadResponse = z.input; /** Post-parse shape of {@link GetExportJobDownloadResponse} — defaults applied, transforms run (ADR-0122). */ export type GetExportJobDownloadResponseParsed = z.infer; @@ -620,7 +620,7 @@ export const ListExportJobsRequestSchema = lazySchema(() => z.object({ cursor: z.string().optional() .describe('Pagination cursor from a previous response'), })); -export type ListExportJobsRequest = z.infer; +export type ListExportJobsRequest = z.input; /** Post-parse shape of {@link ListExportJobsRequest} — defaults applied, transforms run (ADR-0122). */ export type ListExportJobsRequestParsed = z.infer; @@ -639,7 +639,7 @@ export const ExportJobSummarySchema = lazySchema(() => z.object({ completedAt: z.string().datetime().optional().describe('Completion timestamp'), createdBy: z.string().optional().describe('User who initiated the export'), })); -export type ExportJobSummary = z.infer; +export type ExportJobSummary = z.input; /** * List Export Jobs Response @@ -652,7 +652,7 @@ export const ListExportJobsResponseSchema = lazySchema(() => BaseResponseSchema. hasMore: z.boolean().describe('Whether more jobs are available'), }), })); -export type ListExportJobsResponse = z.infer; +export type ListExportJobsResponse = z.input; /** Post-parse shape of {@link ListExportJobsResponse} — defaults applied, transforms run (ADR-0122). */ export type ListExportJobsResponseParsed = z.infer; @@ -689,7 +689,7 @@ export const ScheduleExportRequestSchema = lazySchema(() => z.object({ .describe('Webhook URL (for webhook delivery)'), }).describe('Export delivery configuration'), })); -export type ScheduleExportRequest = z.infer; +export type ScheduleExportRequest = z.input; /** Post-parse shape of {@link ScheduleExportRequest} — defaults applied, transforms run (ADR-0122). */ export type ScheduleExportRequestParsed = z.infer; @@ -706,7 +706,7 @@ export const ScheduleExportResponseSchema = lazySchema(() => BaseResponseSchema. createdAt: z.string().datetime().describe('Creation timestamp'), }), })); -export type ScheduleExportResponse = z.infer; +export type ScheduleExportResponse = z.input; /** Post-parse shape of {@link ScheduleExportResponse} — defaults applied, transforms run (ADR-0122). */ export type ScheduleExportResponseParsed = z.infer; diff --git a/packages/spec/src/api/http-cache.zod.ts b/packages/spec/src/api/http-cache.zod.ts index 10c7295f09..0afef1c93a 100644 --- a/packages/spec/src/api/http-cache.zod.ts +++ b/packages/spec/src/api/http-cache.zod.ts @@ -53,7 +53,7 @@ export const CacheDirective = z.enum([ 'max-age', // Maximum cache age in seconds ]); -export type CacheDirective = z.infer; +export type CacheDirective = z.input; /** * Cache Control Schema @@ -73,7 +73,7 @@ export const CacheControlSchema = lazySchema(() => z.object({ staleIfError: z.number().optional().describe('Allow serving stale content on error (seconds)'), })); -export type CacheControl = z.infer; +export type CacheControl = z.input; // ========================================== // ETag Support @@ -92,7 +92,7 @@ export const ETagSchema = lazySchema(() => z.object({ weak: z.boolean().optional().default(false).describe('Whether this is a weak ETag'), })); -export type ETag = z.infer; +export type ETag = z.input; /** Post-parse shape of {@link ETag} — defaults applied, transforms run (ADR-0122). */ export type ETagParsed = z.infer; @@ -116,7 +116,7 @@ export const MetadataCacheRequestSchema = lazySchema(() => z.object({ cacheControl: CacheControlSchema.optional().describe('Client cache control preferences'), })); -export type MetadataCacheRequest = z.infer; +export type MetadataCacheRequest = z.input; // ========================================== // Metadata Cache Response @@ -157,7 +157,7 @@ export const MetadataCacheResponseSchema = lazySchema(() => z.object({ version: z.string().optional().describe('Metadata version identifier'), })); -export type MetadataCacheResponse = z.infer; +export type MetadataCacheResponse = z.input; /** Post-parse shape of {@link MetadataCacheResponse} — defaults applied, transforms run (ADR-0122). */ export type MetadataCacheResponseParsed = z.infer; @@ -178,7 +178,7 @@ export const CacheInvalidationTarget = z.enum([ 'custom', // Custom invalidation pattern ]); -export type CacheInvalidationTarget = z.infer; +export type CacheInvalidationTarget = z.input; /** * Cache Invalidation Request Schema @@ -199,7 +199,7 @@ export const CacheInvalidationRequestSchema = lazySchema(() => z.object({ pattern: z.string().optional().describe('Pattern for custom invalidation (supports wildcards)'), })); -export type CacheInvalidationRequest = z.infer; +export type CacheInvalidationRequest = z.input; /** Post-parse shape of {@link CacheInvalidationRequest} — defaults applied, transforms run (ADR-0122). */ export type CacheInvalidationRequestParsed = z.infer; @@ -220,7 +220,7 @@ export const CacheInvalidationResponseSchema = lazySchema(() => z.object({ targets: z.array(z.string()).optional().describe('List of invalidated resources'), })); -export type CacheInvalidationResponse = z.infer; +export type CacheInvalidationResponse = z.input; // ========================================== // Metadata Cache API Methods diff --git a/packages/spec/src/api/metadata.zod.ts b/packages/spec/src/api/metadata.zod.ts index 24f4cd3685..c18353dca0 100644 --- a/packages/spec/src/api/metadata.zod.ts +++ b/packages/spec/src/api/metadata.zod.ts @@ -343,32 +343,32 @@ export const MetadataDependentsResponseSchema = lazySchema(() => BaseResponseSch // Type Exports // ========================================== -export type ObjectDefinitionResponse = z.infer; +export type ObjectDefinitionResponse = z.input; /** Post-parse shape of {@link ObjectDefinitionResponse} — defaults applied, transforms run (ADR-0122). */ export type ObjectDefinitionResponseParsed = z.infer; -export type AppDefinitionResponse = z.infer; +export type AppDefinitionResponse = z.input; /** Post-parse shape of {@link AppDefinitionResponse} — defaults applied, transforms run (ADR-0122). */ export type AppDefinitionResponseParsed = z.infer; -export type ConceptListResponse = z.infer; +export type ConceptListResponse = z.input; /** Post-parse shape of {@link ConceptListResponse} — defaults applied, transforms run (ADR-0122). */ export type ConceptListResponseParsed = z.infer; -export type MetadataRegisterRequest = z.infer; -export type MetadataItemResponse = z.infer; +export type MetadataRegisterRequest = z.input; +export type MetadataItemResponse = z.input; /** Post-parse shape of {@link MetadataItemResponse} — defaults applied, transforms run (ADR-0122). */ export type MetadataItemResponseParsed = z.infer; -export type MetadataListResponse = z.infer; +export type MetadataListResponse = z.input; /** Post-parse shape of {@link MetadataListResponse} — defaults applied, transforms run (ADR-0122). */ export type MetadataListResponseParsed = z.infer; -export type MetadataNamesResponse = z.infer; +export type MetadataNamesResponse = z.input; /** Post-parse shape of {@link MetadataNamesResponse} — defaults applied, transforms run (ADR-0122). */ export type MetadataNamesResponseParsed = z.infer; -export type MetadataExistsResponse = z.infer; +export type MetadataExistsResponse = z.input; /** Post-parse shape of {@link MetadataExistsResponse} — defaults applied, transforms run (ADR-0122). */ export type MetadataExistsResponseParsed = z.infer; -export type MetadataDeleteResponse = z.infer; +export type MetadataDeleteResponse = z.input; /** Post-parse shape of {@link MetadataDeleteResponse} — defaults applied, transforms run (ADR-0122). */ export type MetadataDeleteResponseParsed = z.infer; -export type MetadataQueryResponse = z.infer; +export type MetadataQueryResponse = z.input; /** Post-parse shape of {@link MetadataQueryResponse} — defaults applied, transforms run (ADR-0122). */ export type MetadataQueryResponseParsed = z.infer; /** @@ -381,33 +381,35 @@ export type MetadataQueryResponseParsed = z.infer; -export type MetadataBulkResponse = z.infer; +/** Post-parse shape of {@link MetadataBulkRegisterRequest} — defaults applied, transforms run (ADR-0122). */ +export type MetadataBulkRegisterRequestParsed = z.infer; +export type MetadataBulkResponse = z.input; /** Post-parse shape of {@link MetadataBulkResponse} — defaults applied, transforms run (ADR-0122). */ export type MetadataBulkResponseParsed = z.infer; -export type MetadataOverlayResponse = z.infer; +export type MetadataOverlayResponse = z.input; /** Post-parse shape of {@link MetadataOverlayResponse} — defaults applied, transforms run (ADR-0122). */ export type MetadataOverlayResponseParsed = z.infer; -export type MetadataEffectiveResponse = z.infer; +export type MetadataEffectiveResponse = z.input; /** Post-parse shape of {@link MetadataEffectiveResponse} — defaults applied, transforms run (ADR-0122). */ export type MetadataEffectiveResponseParsed = z.infer; -export type MetadataExportResponse = z.infer; +export type MetadataExportResponse = z.input; /** Post-parse shape of {@link MetadataExportResponse} — defaults applied, transforms run (ADR-0122). */ export type MetadataExportResponseParsed = z.infer; -export type MetadataImportResponse = z.infer; +export type MetadataImportResponse = z.input; /** Post-parse shape of {@link MetadataImportResponse} — defaults applied, transforms run (ADR-0122). */ export type MetadataImportResponseParsed = z.infer; -export type MetadataValidateResponse = z.infer; +export type MetadataValidateResponse = z.input; /** Post-parse shape of {@link MetadataValidateResponse} — defaults applied, transforms run (ADR-0122). */ export type MetadataValidateResponseParsed = z.infer; -export type MetadataTypesResponse = z.infer; +export type MetadataTypesResponse = z.input; /** Post-parse shape of {@link MetadataTypesResponse} — defaults applied, transforms run (ADR-0122). */ export type MetadataTypesResponseParsed = z.infer; -export type MetadataTypeInfoResponse = z.infer; +export type MetadataTypeInfoResponse = z.input; /** Post-parse shape of {@link MetadataTypeInfoResponse} — defaults applied, transforms run (ADR-0122). */ export type MetadataTypeInfoResponseParsed = z.infer; -export type MetadataDependenciesResponse = z.infer; +export type MetadataDependenciesResponse = z.input; /** Post-parse shape of {@link MetadataDependenciesResponse} — defaults applied, transforms run (ADR-0122). */ export type MetadataDependenciesResponseParsed = z.infer; -export type MetadataDependentsResponse = z.infer; +export type MetadataDependentsResponse = z.input; /** Post-parse shape of {@link MetadataDependentsResponse} — defaults applied, transforms run (ADR-0122). */ export type MetadataDependentsResponseParsed = z.infer; diff --git a/packages/spec/src/api/odata.zod.ts b/packages/spec/src/api/odata.zod.ts index 0f216de23d..30399fd71a 100644 --- a/packages/spec/src/api/odata.zod.ts +++ b/packages/spec/src/api/odata.zod.ts @@ -207,7 +207,7 @@ export const ODataQuerySchema = lazySchema(() => z.object({ $apply: z.string().optional().describe('Aggregation expression'), })); -export type ODataQuery = z.infer; +export type ODataQuery = z.input; // `ODataFilterOperatorSchema` — one more spelling of comparison // (eq/ne/lt/le/gt/ge, and/or/not, `(`/`)`, in/has) — lived here with no @@ -267,7 +267,7 @@ export const ODataFilterFunctionSchema = lazySchema(() => z.enum([ 'all', // collection/all(d:d/prop eq value) ])); -export type ODataFilterFunction = z.infer; +export type ODataFilterFunction = z.input; /** * OData Response Schema @@ -297,7 +297,7 @@ export const ODataResponseSchema = lazySchema(() => z.object({ value: z.array(z.record(z.string(), z.unknown())).describe('Results array'), })); -export type ODataResponse = z.infer; +export type ODataResponse = z.input; /** * OData Error Response Schema @@ -337,7 +337,7 @@ export const ODataErrorSchema = lazySchema(() => z.object({ }), })); -export type ODataError = z.infer; +export type ODataError = z.input; /** * OData Metadata Configuration @@ -377,7 +377,7 @@ export const ODataMetadataSchema = lazySchema(() => z.object({ })).describe('Entity sets'), })); -export type ODataMetadata = z.infer; +export type ODataMetadata = z.input; /** Post-parse shape of {@link ODataMetadata} — defaults applied, transforms run (ADR-0122). */ export type ODataMetadataParsed = z.infer; @@ -458,6 +458,6 @@ export const ODataConfigSchema = lazySchema(() => z.object({ metadata: ODataMetadataSchema.optional().describe('OData metadata configuration'), }).passthrough()); // Allow additional properties for flexibility -export type ODataConfig = z.infer; +export type ODataConfig = z.input; /** Post-parse shape of {@link ODataConfig} — defaults applied, transforms run (ADR-0122). */ export type ODataConfigParsed = z.infer; diff --git a/packages/spec/src/api/package-api.zod.ts b/packages/spec/src/api/package-api.zod.ts index 37d2389a79..6efdaf7c6c 100644 --- a/packages/spec/src/api/package-api.zod.ts +++ b/packages/spec/src/api/package-api.zod.ts @@ -38,7 +38,7 @@ import { lazySchema } from '../shared/lazy-schema'; export const PackagePathParamsSchema = lazySchema(() => z.object({ packageId: z.string().describe('Package identifier'), })); -export type PackagePathParams = z.infer; +export type PackagePathParams = z.input; // ========================================== // 2. List Packages (GET /api/v1/packages) @@ -61,7 +61,7 @@ export const ListInstalledPackagesRequestSchema = lazySchema(() => z.object({ cursor: z.string().optional() .describe('Cursor for pagination'), }).describe('List installed packages request')); -export type ListInstalledPackagesRequest = z.infer; +export type ListInstalledPackagesRequest = z.input; /** Post-parse shape of {@link ListInstalledPackagesRequest} — defaults applied, transforms run (ADR-0122). */ export type ListInstalledPackagesRequestParsed = z.infer; @@ -76,7 +76,7 @@ export const ListInstalledPackagesResponseSchema = lazySchema(() => BaseResponse hasMore: z.boolean().describe('Whether more packages are available'), }), }).describe('List installed packages response')); -export type ListInstalledPackagesResponse = z.infer; +export type ListInstalledPackagesResponse = z.input; /** Post-parse shape of {@link ListInstalledPackagesResponse} — defaults applied, transforms run (ADR-0122). */ export type ListInstalledPackagesResponseParsed = z.infer; @@ -88,7 +88,7 @@ export type ListInstalledPackagesResponseParsed = z.infer PackagePathParamsSchema); -export type GetInstalledPackageRequest = z.infer; +export type GetInstalledPackageRequest = z.input; /** * Response for getting a single installed package. @@ -96,7 +96,7 @@ export type GetInstalledPackageRequest = z.infer BaseResponseSchema.extend({ data: InstalledPackageSchema.describe('Installed package details'), }).describe('Get installed package response')); -export type GetInstalledPackageResponse = z.infer; +export type GetInstalledPackageResponse = z.input; /** Post-parse shape of {@link GetInstalledPackageResponse} — defaults applied, transforms run (ADR-0122). */ export type GetInstalledPackageResponseParsed = z.infer; @@ -130,7 +130,7 @@ export const PackageInstallRequestSchema = lazySchema(() => z.object({ artifactRef: ArtifactReferenceSchema.optional() .describe('Artifact reference for marketplace installation'), }).describe('Install package request')); -export type PackageInstallRequest = z.infer; +export type PackageInstallRequest = z.input; /** Post-parse shape of {@link PackageInstallRequest} — defaults applied, transforms run (ADR-0122). */ export type PackageInstallRequestParsed = z.infer; @@ -152,7 +152,7 @@ export const PackageInstallResponseSchema = lazySchema(() => BaseResponseSchema. message: z.string().optional().describe('Installation status message'), }), }).describe('Install package response')); -export type PackageInstallResponse = z.infer; +export type PackageInstallResponse = z.input; /** Post-parse shape of {@link PackageInstallResponse} — defaults applied, transforms run (ADR-0122). */ export type PackageInstallResponseParsed = z.infer; @@ -195,7 +195,7 @@ export const PackageUpgradeRequestSchema = lazySchema(() => z.object({ skipValidation: z.boolean().default(false) .describe('Skip pre-upgrade compatibility checks'), }).describe('Upgrade package request')); -export type PackageUpgradeRequest = z.infer; +export type PackageUpgradeRequest = z.input; /** Post-parse shape of {@link PackageUpgradeRequest} — defaults applied, transforms run (ADR-0122). */ export type PackageUpgradeRequestParsed = z.infer; @@ -218,7 +218,7 @@ export const PackageUpgradeResponseSchema = lazySchema(() => BaseResponseSchema. message: z.string().optional().describe('Human-readable status message'), }), }).describe('Upgrade package response')); -export type PackageUpgradeResponse = z.infer; +export type PackageUpgradeResponse = z.input; /** Post-parse shape of {@link PackageUpgradeResponse} — defaults applied, transforms run (ADR-0122). */ export type PackageUpgradeResponseParsed = z.infer; @@ -240,7 +240,7 @@ export const ResolveDependenciesRequestSchema = lazySchema(() => z.object({ platformVersion: z.string().optional() .describe('Current platform version for compatibility filtering'), }).describe('Resolve dependencies request')); -export type ResolveDependenciesRequest = z.infer; +export type ResolveDependenciesRequest = z.input; /** Post-parse shape of {@link ResolveDependenciesRequest} — defaults applied, transforms run (ADR-0122). */ export type ResolveDependenciesRequestParsed = z.infer; @@ -250,7 +250,7 @@ export type ResolveDependenciesRequestParsed = z.infer BaseResponseSchema.extend({ data: DependencyResolutionResultSchema.describe('Dependency resolution result with topological sort'), }).describe('Resolve dependencies response')); -export type ResolveDependenciesResponse = z.infer; +export type ResolveDependenciesResponse = z.input; /** Post-parse shape of {@link ResolveDependenciesResponse} — defaults applied, transforms run (ADR-0122). */ export type ResolveDependenciesResponseParsed = z.infer; @@ -281,7 +281,7 @@ export const UploadArtifactRequestSchema = lazySchema(() => z.object({ releaseNotes: z.string().optional() .describe('Release notes for this version'), }).describe('Upload artifact request')); -export type UploadArtifactRequest = z.infer; +export type UploadArtifactRequest = z.input; /** Post-parse shape of {@link UploadArtifactRequest} — defaults applied, transforms run (ADR-0122). */ export type UploadArtifactRequestParsed = z.infer; @@ -302,7 +302,7 @@ export const UploadArtifactResponseSchema = lazySchema(() => BaseResponseSchema. message: z.string().optional().describe('Upload status message'), }), }).describe('Upload artifact response')); -export type UploadArtifactResponse = z.infer; +export type UploadArtifactResponse = z.input; /** Post-parse shape of {@link UploadArtifactResponse} — defaults applied, transforms run (ADR-0122). */ export type UploadArtifactResponseParsed = z.infer; @@ -321,7 +321,7 @@ export const PackageRollbackRequestSchema = lazySchema(() => PackagePathParamsSc rollbackCustomizations: z.boolean().default(true) .describe('Whether to restore pre-upgrade customizations'), }).describe('Rollback package request')); -export type PackageRollbackRequest = z.infer; +export type PackageRollbackRequest = z.input; /** Post-parse shape of {@link PackageRollbackRequest} — defaults applied, transforms run (ADR-0122). */ export type PackageRollbackRequestParsed = z.infer; @@ -335,7 +335,7 @@ export const PackageRollbackResponseSchema = lazySchema(() => BaseResponseSchema message: z.string().optional().describe('Rollback status message'), }), }).describe('Rollback package response')); -export type PackageRollbackResponse = z.infer; +export type PackageRollbackResponse = z.input; /** Post-parse shape of {@link PackageRollbackResponse} — defaults applied, transforms run (ADR-0122). */ export type PackageRollbackResponseParsed = z.infer; @@ -347,7 +347,7 @@ export type PackageRollbackResponseParsed = z.infer PackagePathParamsSchema); -export type UninstallPackageApiRequest = z.infer; +export type UninstallPackageApiRequest = z.input; /** * Response after uninstalling a package. @@ -359,7 +359,7 @@ export const UninstallPackageApiResponseSchema = lazySchema(() => BaseResponseSc message: z.string().optional().describe('Uninstall status message'), }), }).describe('Uninstall package response')); -export type UninstallPackageApiResponse = z.infer; +export type UninstallPackageApiResponse = z.input; /** Post-parse shape of {@link UninstallPackageApiResponse} — defaults applied, transforms run (ADR-0122). */ export type UninstallPackageApiResponseParsed = z.infer; @@ -385,7 +385,7 @@ export const PackageApiErrorCode = z.enum([ 'snapshot_not_found', 'upload_failed', ]); -export type PackageApiErrorCode = z.infer; +export type PackageApiErrorCode = z.input; // ========================================== // 11. Package API Contract Registry diff --git a/packages/spec/src/api/plugin-rest-api.zod.ts b/packages/spec/src/api/plugin-rest-api.zod.ts index 0aff08ee18..69b7d5afdd 100644 --- a/packages/spec/src/api/plugin-rest-api.zod.ts +++ b/packages/spec/src/api/plugin-rest-api.zod.ts @@ -91,7 +91,7 @@ export const RestApiRouteCategory = z.enum([ 'i18n', // Internationalization ]); -export type RestApiRouteCategory = z.infer; +export type RestApiRouteCategory = z.input; // ========================================== // Route Registration Schema @@ -107,7 +107,7 @@ export type RestApiRouteCategory = z.infer; * - `planned` – Declared in the protocol spec but not yet implemented. */ export const HandlerStatusSchema = lazySchema(() => z.enum(['implemented', 'stub', 'planned'])); -export type HandlerStatus = z.infer; +export type HandlerStatus = z.input; /** * REST API Endpoint Schema @@ -188,7 +188,7 @@ export const RestApiEndpointSchema = lazySchema(() => z.object({ .describe('Handler implementation status: implemented (default if omitted), stub, or planned'), })); -export type RestApiEndpoint = z.infer; +export type RestApiEndpoint = z.input; /** Post-parse shape of {@link RestApiEndpoint} — defaults applied, transforms run (ADR-0122). */ export type RestApiEndpointParsed = z.infer; @@ -261,7 +261,7 @@ export const RestApiRouteRegistrationSchema = z.object({ }).optional().describe('Documentation metadata for this route group'), }); -export type RestApiRouteRegistration = z.infer; +export type RestApiRouteRegistration = z.input; /** Post-parse shape of {@link RestApiRouteRegistration} — defaults applied, transforms run (ADR-0122). */ export type RestApiRouteRegistrationParsed = z.infer; @@ -279,7 +279,7 @@ export const ValidationMode = z.enum([ 'strip', // Remove invalid fields and continue with valid data ]); -export type ValidationMode = z.infer; +export type ValidationMode = z.input; /** * Request Validation Configuration Schema @@ -342,10 +342,9 @@ export const RequestValidationConfigSchema = z.object({ schemaRegistry: z.string().optional().describe('Schema registry name to use for validation'), }); -export type RequestValidationConfig = z.infer; +export type RequestValidationConfig = z.input; /** Post-parse shape of {@link RequestValidationConfig} — defaults applied, transforms run (ADR-0122). */ export type RequestValidationConfigParsed = z.infer; -export type RequestValidationConfigInput = z.input; // ========================================== // Response Envelope Configuration @@ -406,10 +405,9 @@ export const ResponseEnvelopeConfigSchema = z.object({ skipIfWrapped: z.boolean().default(true).describe('Skip wrapping if response already has success field'), }); -export type ResponseEnvelopeConfig = z.infer; +export type ResponseEnvelopeConfig = z.input; /** Post-parse shape of {@link ResponseEnvelopeConfig} — defaults applied, transforms run (ADR-0122). */ export type ResponseEnvelopeConfigParsed = z.infer; -export type ResponseEnvelopeConfigInput = z.input; // ========================================== // Error Handling Configuration @@ -483,10 +481,9 @@ export const ErrorHandlingConfigSchema = z.object({ redactFields: z.array(z.string()).optional().describe('Field names to redact from error details'), }); -export type ErrorHandlingConfig = z.infer; +export type ErrorHandlingConfig = z.input; /** Post-parse shape of {@link ErrorHandlingConfig} — defaults applied, transforms run (ADR-0122). */ export type ErrorHandlingConfigParsed = z.infer; -export type ErrorHandlingConfigInput = z.input; // ========================================== // OpenAPI Documentation Configuration @@ -601,10 +598,9 @@ export const OpenApiGenerationConfigSchema = z.object({ })).optional().describe('Security scheme definitions'), }); -export type OpenApiGenerationConfig = z.infer; +export type OpenApiGenerationConfig = z.input; /** Post-parse shape of {@link OpenApiGenerationConfig} — defaults applied, transforms run (ADR-0122). */ export type OpenApiGenerationConfigParsed = z.infer; -export type OpenApiGenerationConfigInput = z.input; // ========================================== // REST API Plugin Configuration @@ -693,10 +689,9 @@ export const RestApiPluginConfigSchema = z.object({ }).optional().describe('Performance optimization settings'), }); -export type RestApiPluginConfig = z.infer; +export type RestApiPluginConfig = z.input; /** Post-parse shape of {@link RestApiPluginConfig} — defaults applied, transforms run (ADR-0122). */ export type RestApiPluginConfigParsed = z.infer; -export type RestApiPluginConfigInput = z.input; // ========================================== // Default Route Registrations @@ -1378,7 +1373,7 @@ export const RouteCoverageEntrySchema = z.object({ healthCheckPassed: z.boolean().optional().describe('Whether the health check probe succeeded'), }); -export type RouteCoverageEntry = z.infer; +export type RouteCoverageEntry = z.input; /** * Route Coverage Report Schema @@ -1406,4 +1401,4 @@ export const RouteCoverageReportSchema = z.object({ entries: z.array(RouteCoverageEntrySchema).describe('Per-endpoint coverage entries'), }); -export type RouteCoverageReport = z.infer; +export type RouteCoverageReport = z.input; diff --git a/packages/spec/src/api/protocol.zod.ts b/packages/spec/src/api/protocol.zod.ts index 17c923d5a9..4ed8cd462a 100644 --- a/packages/spec/src/api/protocol.zod.ts +++ b/packages/spec/src/api/protocol.zod.ts @@ -1285,29 +1285,28 @@ export const GetFieldLabelsResponseSchema = lazySchema(() => z.object({ // Protocol Interface Schema // ========================================== - /** * TypeScript Types * Derived from Zod schemas using z.infer */ -export type GetDiscoveryRequest = z.infer; -export type GetDiscoveryResponse = z.infer; -export type GetMetaTypesRequest = z.infer; -export type GetMetaTypesResponse = z.infer; -export type GetMetaItemsRequest = z.infer; -export type GetMetaItemsResponse = z.infer; -export type GetMetaItemRequest = z.infer; -export type GetMetaItemResponse = z.infer; -export type SaveMetaItemRequest = z.infer; -export type SaveMetaItemResponse = z.infer; -export type DeleteMetaItemRequest = z.infer; -export type DeleteMetaItemResponse = z.infer; -export type GetMetaItemCachedRequest = z.infer; -export type GetMetaItemCachedResponse = z.infer; +export type GetDiscoveryRequest = z.input; +export type GetDiscoveryResponse = z.input; +export type GetMetaTypesRequest = z.input; +export type GetMetaTypesResponse = z.input; +export type GetMetaItemsRequest = z.input; +export type GetMetaItemsResponse = z.input; +export type GetMetaItemRequest = z.input; +export type GetMetaItemResponse = z.input; +export type SaveMetaItemRequest = z.input; +export type SaveMetaItemResponse = z.input; +export type DeleteMetaItemRequest = z.input; +export type DeleteMetaItemResponse = z.input; +export type GetMetaItemCachedRequest = z.input; +export type GetMetaItemCachedResponse = z.input; /** Post-parse shape of {@link GetMetaItemCachedResponse} — defaults applied, transforms run (ADR-0122). */ export type GetMetaItemCachedResponseParsed = z.infer; -export type GetUiViewRequest = z.infer; -export type GetUiViewResponse = z.infer; +export type GetUiViewRequest = z.input; +export type GetUiViewResponse = z.input; /** Post-parse shape of {@link GetUiViewResponse} — defaults applied, transforms run (ADR-0122). */ export type GetUiViewResponseParsed = z.infer; @@ -1316,147 +1315,161 @@ type AnalyticsResultResponse = z.infer; type GetAnalyticsMetaRequest = z.infer; type GetAnalyticsMetaResponse = z.infer; -export type AutomationTriggerRequest = z.infer; -export type AutomationTriggerResponse = z.infer; -export type AutomationActionsResponse = z.infer; +export type AutomationTriggerRequest = z.input; +export type AutomationTriggerResponse = z.input; +export type AutomationActionsResponse = z.input; /** Post-parse shape of {@link AutomationActionsResponse} — defaults applied, transforms run (ADR-0122). */ export type AutomationActionsResponseParsed = z.infer; export type FindDataRequest = z.input; -export type FindDataResponse = z.infer; +/** Post-parse shape of {@link FindDataRequest} — defaults applied, transforms run (ADR-0122). */ +export type FindDataRequestParsed = z.infer; +export type FindDataResponse = z.input; export type GetDataRequest = z.input; -export type GetDataResponse = z.infer; +export type GetDataResponse = z.input; export type CreateDataRequest = z.input; -export type CreateDataResponse = z.infer; +export type CreateDataResponse = z.input; export type UpdateDataRequest = z.input; -export type UpdateDataResponse = z.infer; +export type UpdateDataResponse = z.input; export type DeleteDataRequest = z.input; -export type DeleteDataResponse = z.infer; +export type DeleteDataResponse = z.input; export type BatchDataRequest = z.input; -export type BatchDataResponse = z.infer; +/** Post-parse shape of {@link BatchDataRequest} — defaults applied, transforms run (ADR-0122). */ +export type BatchDataRequestParsed = z.infer; +export type BatchDataResponse = z.input; /** Post-parse shape of {@link BatchDataResponse} — defaults applied, transforms run (ADR-0122). */ export type BatchDataResponseParsed = z.infer; export type CreateManyDataRequest = z.input; -export type CreateManyDataResponse = z.infer; +export type CreateManyDataResponse = z.input; export type UpdateManyDataRequest = z.input; -export type UpdateManyDataResponse = z.infer; +/** Post-parse shape of {@link UpdateManyDataRequest} — defaults applied, transforms run (ADR-0122). */ +export type UpdateManyDataRequestParsed = z.infer; +export type UpdateManyDataResponse = z.input; /** Post-parse shape of {@link UpdateManyDataResponse} — defaults applied, transforms run (ADR-0122). */ export type UpdateManyDataResponseParsed = z.infer; export type DeleteManyDataRequest = z.input; -export type DeleteManyDataResponse = z.infer; +/** Post-parse shape of {@link DeleteManyDataRequest} — defaults applied, transforms run (ADR-0122). */ +export type DeleteManyDataRequestParsed = z.infer; +export type DeleteManyDataResponse = z.input; /** Post-parse shape of {@link DeleteManyDataResponse} — defaults applied, transforms run (ADR-0122). */ export type DeleteManyDataResponseParsed = z.infer; // View Management Types export type ListViewsRequest = z.input; -export type ListViewsResponse = z.infer; +export type ListViewsResponse = z.input; /** Post-parse shape of {@link ListViewsResponse} — defaults applied, transforms run (ADR-0122). */ export type ListViewsResponseParsed = z.infer; export type GetViewRequest = z.input; -export type GetViewResponse = z.infer; +export type GetViewResponse = z.input; /** Post-parse shape of {@link GetViewResponse} — defaults applied, transforms run (ADR-0122). */ export type GetViewResponseParsed = z.infer; export type CreateViewRequest = z.input; -export type CreateViewResponse = z.infer; +/** Post-parse shape of {@link CreateViewRequest} — defaults applied, transforms run (ADR-0122). */ +export type CreateViewRequestParsed = z.infer; +export type CreateViewResponse = z.input; /** Post-parse shape of {@link CreateViewResponse} — defaults applied, transforms run (ADR-0122). */ export type CreateViewResponseParsed = z.infer; export type UpdateViewRequest = z.input; -export type UpdateViewResponse = z.infer; +/** Post-parse shape of {@link UpdateViewRequest} — defaults applied, transforms run (ADR-0122). */ +export type UpdateViewRequestParsed = z.infer; +export type UpdateViewResponse = z.input; /** Post-parse shape of {@link UpdateViewResponse} — defaults applied, transforms run (ADR-0122). */ export type UpdateViewResponseParsed = z.infer; export type DeleteViewRequest = z.input; -export type DeleteViewResponse = z.infer; +export type DeleteViewResponse = z.input; // Permission Types export type CheckPermissionRequest = z.input; -export type CheckPermissionResponse = z.infer; +export type CheckPermissionResponse = z.input; export type GetObjectPermissionsRequest = z.input; -export type GetObjectPermissionsResponse = z.infer; +export type GetObjectPermissionsResponse = z.input; /** Post-parse shape of {@link GetObjectPermissionsResponse} — defaults applied, transforms run (ADR-0122). */ export type GetObjectPermissionsResponseParsed = z.infer; export type GetEffectivePermissionsRequest = z.input; -export type GetEffectivePermissionsResponse = z.infer; +export type GetEffectivePermissionsResponse = z.input; // Workflow Types — removed with the schemas (#4451, v17); see the block comment // at "Workflow Operations — REMOVED" above. // Realtime Types export type RealtimeConnectRequest = z.input; -export type RealtimeConnectResponse = z.infer; +export type RealtimeConnectResponse = z.input; export type RealtimeDisconnectRequest = z.input; -export type RealtimeDisconnectResponse = z.infer; +export type RealtimeDisconnectResponse = z.input; export type RealtimeSubscribeRequest = z.input; -export type RealtimeSubscribeResponse = z.infer; +export type RealtimeSubscribeResponse = z.input; export type RealtimeUnsubscribeRequest = z.input; -export type RealtimeUnsubscribeResponse = z.infer; +export type RealtimeUnsubscribeResponse = z.input; export type SetPresenceRequest = z.input; -export type SetPresenceResponse = z.infer; +export type SetPresenceResponse = z.input; export type GetPresenceRequest = z.input; -export type GetPresenceResponse = z.infer; +export type GetPresenceResponse = z.input; // Notification Types export type RegisterDeviceRequest = z.input; -export type RegisterDeviceResponse = z.infer; +export type RegisterDeviceResponse = z.input; export type UnregisterDeviceRequest = z.input; -export type UnregisterDeviceResponse = z.infer; -export type NotificationPreferences = z.infer; +export type UnregisterDeviceResponse = z.input; +export type NotificationPreferences = z.input; /** Post-parse shape of {@link NotificationPreferences} — defaults applied, transforms run (ADR-0122). */ export type NotificationPreferencesParsed = z.infer; -export type NotificationPreferencesInput = z.input; export type GetNotificationPreferencesRequest = z.input; -export type GetNotificationPreferencesResponse = z.infer; +export type GetNotificationPreferencesResponse = z.input; /** Post-parse shape of {@link GetNotificationPreferencesResponse} — defaults applied, transforms run (ADR-0122). */ export type GetNotificationPreferencesResponseParsed = z.infer; export type UpdateNotificationPreferencesRequest = z.input; -export type UpdateNotificationPreferencesResponse = z.infer; +/** Post-parse shape of {@link UpdateNotificationPreferencesRequest} — defaults applied, transforms run (ADR-0122). */ +export type UpdateNotificationPreferencesRequestParsed = z.infer; +export type UpdateNotificationPreferencesResponse = z.input; /** Post-parse shape of {@link UpdateNotificationPreferencesResponse} — defaults applied, transforms run (ADR-0122). */ export type UpdateNotificationPreferencesResponseParsed = z.infer; -export type Notification = z.infer; +export type Notification = z.input; /** Post-parse shape of {@link Notification} — defaults applied, transforms run (ADR-0122). */ export type NotificationParsed = z.infer; -export type NotificationInput = z.input; export type ListNotificationsRequest = z.input; -export type ListNotificationsResponse = z.infer; +/** Post-parse shape of {@link ListNotificationsRequest} — defaults applied, transforms run (ADR-0122). */ +export type ListNotificationsRequestParsed = z.infer; +export type ListNotificationsResponse = z.input; /** Post-parse shape of {@link ListNotificationsResponse} — defaults applied, transforms run (ADR-0122). */ export type ListNotificationsResponseParsed = z.infer; export type MarkNotificationsReadRequest = z.input; -export type MarkNotificationsReadResponse = z.infer; +export type MarkNotificationsReadResponse = z.input; export type MarkAllNotificationsReadRequest = z.input; -export type MarkAllNotificationsReadResponse = z.infer; +export type MarkAllNotificationsReadResponse = z.input; // AI Types export type AiMessage = z.input; export type AiChatRequest = z.input; -export type AiChatResponse = z.infer; -export type AiStreamChunk = z.infer; +export type AiChatResponse = z.input; +export type AiStreamChunk = z.input; export type AiCompleteRequest = z.input; -export type AiModelsResponse = z.infer; -export type AiConversation = z.infer; +export type AiModelsResponse = z.input; +export type AiConversation = z.input; export type CreateAiConversationRequest = z.input; export type ListAiConversationsRequest = z.input; -export type ListAiConversationsResponse = z.infer; +export type ListAiConversationsResponse = z.input; export type UpdateAiConversationRequest = z.input; -export type AiAgentCapabilities = z.infer; -export type AiAgentSummary = z.infer; -export type AiAgentsResponse = z.infer; +export type AiAgentCapabilities = z.input; +export type AiAgentSummary = z.input; +export type AiAgentsResponse = z.input; export type AiAgentChatRequest = z.input; -export type AiPendingActionStatus = z.infer; -export type AiPendingAction = z.infer; +export type AiPendingActionStatus = z.input; +export type AiPendingAction = z.input; export type ListAiPendingActionsRequest = z.input; -export type ListAiPendingActionsResponse = z.infer; -export type ApproveAiPendingActionResponse = z.infer; -export type RejectAiPendingActionResponse = z.infer; +export type ListAiPendingActionsResponse = z.input; +export type ApproveAiPendingActionResponse = z.input; +export type RejectAiPendingActionResponse = z.input; // i18n Types export type GetLocalesRequest = z.input; -export type GetLocalesResponse = z.infer; +export type GetLocalesResponse = z.input; /** Post-parse shape of {@link GetLocalesResponse} — defaults applied, transforms run (ADR-0122). */ export type GetLocalesResponseParsed = z.infer; export type GetTranslationsRequest = z.input; -export type GetTranslationsResponse = z.infer; +export type GetTranslationsResponse = z.input; export type GetFieldLabelsRequest = z.input; -export type GetFieldLabelsResponse = z.infer; +export type GetFieldLabelsResponse = z.input; // Package Management Types (re-exported from kernel for convenience) export type { diff --git a/packages/spec/src/api/query-adapter.zod.ts b/packages/spec/src/api/query-adapter.zod.ts index 54470b8607..701431ddc0 100644 --- a/packages/spec/src/api/query-adapter.zod.ts +++ b/packages/spec/src/api/query-adapter.zod.ts @@ -30,7 +30,7 @@ export const QueryAdapterTargetSchema = lazySchema(() => z.enum([ 'odata', // OData ($filter=field op value) ])); -export type QueryAdapterTarget = z.infer; +export type QueryAdapterTarget = z.input; /** * Operator Mapping Entry @@ -44,12 +44,11 @@ export const OperatorMappingSchema = lazySchema(() => z.object({ /** REST query parameter format (e.g., 'filter[{field}][{op}]') */ rest: z.string().optional().describe('REST query parameter template'), - /** OData $filter expression format (e.g., '{field} {op} {value}') */ odata: z.string().optional().describe('OData $filter expression template'), })); -export type OperatorMapping = z.infer; +export type OperatorMapping = z.input; // ========================================== // 2. REST Adapter Configuration @@ -105,10 +104,9 @@ export const RestQueryAdapterSchema = lazySchema(() => z.object({ fieldsParam: z.string().default('fields').describe('Field selection parameter name'), })); -export type RestQueryAdapter = z.infer; +export type RestQueryAdapter = z.input; /** Post-parse shape of {@link RestQueryAdapter} — defaults applied, transforms run (ADR-0122). */ export type RestQueryAdapterParsed = z.infer; -export type RestQueryAdapterInput = z.input; // ========================================== // 4. OData Adapter Configuration @@ -150,10 +148,9 @@ export const ODataQueryAdapterSchema = lazySchema(() => z.object({ }).optional().describe('$expand configuration'), })); -export type ODataQueryAdapter = z.infer; +export type ODataQueryAdapter = z.input; /** Post-parse shape of {@link ODataQueryAdapter} — defaults applied, transforms run (ADR-0122). */ export type ODataQueryAdapterParsed = z.infer; -export type ODataQueryAdapterInput = z.input; // ========================================== // 5. Complete Query Adapter Configuration @@ -172,12 +169,10 @@ export const QueryAdapterConfigSchema = lazySchema(() => z.object({ /** REST adapter configuration */ rest: RestQueryAdapterSchema.optional().describe('REST query adapter configuration'), - /** OData adapter configuration */ odata: ODataQueryAdapterSchema.optional().describe('OData query adapter configuration'), })); -export type QueryAdapterConfig = z.infer; +export type QueryAdapterConfig = z.input; /** Post-parse shape of {@link QueryAdapterConfig} — defaults applied, transforms run (ADR-0122). */ export type QueryAdapterConfigParsed = z.infer; -export type QueryAdapterConfigInput = z.input; diff --git a/packages/spec/src/api/realtime-shared.zod.ts b/packages/spec/src/api/realtime-shared.zod.ts index 0b257630f1..ce8844e474 100644 --- a/packages/spec/src/api/realtime-shared.zod.ts +++ b/packages/spec/src/api/realtime-shared.zod.ts @@ -43,7 +43,7 @@ export const PresenceStatus = z.enum([ 'offline', // User is disconnected ]); -export type PresenceStatus = z.infer; +export type PresenceStatus = z.input; // ========================================== // Shared Realtime Actions @@ -61,7 +61,7 @@ export const RealtimeRecordAction = z.enum([ 'deleted', ]); -export type RealtimeRecordAction = z.infer; +export type RealtimeRecordAction = z.input; // ========================================== // Shared Base Presence Schema @@ -97,4 +97,4 @@ export const BasePresenceSchema = lazySchema(() => z.object({ metadata: z.record(z.string(), z.unknown()).optional().describe('Custom presence data (e.g., current page, custom status)'), })); -export type BasePresence = z.infer; +export type BasePresence = z.input; diff --git a/packages/spec/src/api/realtime.zod.ts b/packages/spec/src/api/realtime.zod.ts index 8981fdbc22..8862790a13 100644 --- a/packages/spec/src/api/realtime.zod.ts +++ b/packages/spec/src/api/realtime.zod.ts @@ -18,7 +18,7 @@ export const TransportProtocol = z.enum([ 'polling', // Short polling, best compatibility ]); -export type TransportProtocol = z.infer; +export type TransportProtocol = z.input; /** * Event Type Enum @@ -37,7 +37,7 @@ export const RealtimeEventType = z.enum([ 'field.changed', ]).describe('Realtime event type (not yet enforced — the runtime emits data.record.* event names instead, and field.changed is never emitted; see #3197)'); -export type RealtimeEventType = z.infer; +export type RealtimeEventType = z.input; /** * Subscription Event Configuration @@ -60,7 +60,7 @@ export const SubscriptionSchema = lazySchema(() => z.object({ channel: z.string().optional().describe('Optional channel name for grouping subscriptions'), })); -export type Subscription = z.infer; +export type Subscription = z.input; /** * Presence Schema @@ -69,7 +69,7 @@ export type Subscription = z.infer; */ export const RealtimePresenceSchema = lazySchema(() => BasePresenceSchema); -export type RealtimePresence = z.infer; +export type RealtimePresence = z.input; /** * Realtime Event Schema @@ -86,7 +86,7 @@ export const RealtimeEventSchema = lazySchema(() => z.object({ sessionId: z.string().optional().describe('Session identifier'), })); -export type RealtimeEvent = z.infer; +export type RealtimeEvent = z.input; /** * Realtime Configuration Schema @@ -104,6 +104,6 @@ export const RealtimeConfigSchema = lazySchema(() => z.object({ subscriptions: z.array(SubscriptionSchema).optional().describe('Default subscriptions'), }).passthrough()); // Allow additional properties -export type RealtimeConfig = z.infer; +export type RealtimeConfig = z.input; /** Post-parse shape of {@link RealtimeConfig} — defaults applied, transforms run (ADR-0122). */ export type RealtimeConfigParsed = z.infer; diff --git a/packages/spec/src/api/rest-server.zod.ts b/packages/spec/src/api/rest-server.zod.ts index c236102080..26e1051048 100644 --- a/packages/spec/src/api/rest-server.zod.ts +++ b/packages/spec/src/api/rest-server.zod.ts @@ -160,10 +160,9 @@ export const RestApiConfigSchema = lazySchema(() => z.object({ }).optional().describe('Response format options'), })); -export type RestApiConfig = z.infer; +export type RestApiConfig = z.input; /** Post-parse shape of {@link RestApiConfig} — defaults applied, transforms run (ADR-0122). */ export type RestApiConfigParsed = z.infer; -export type RestApiConfigInput = z.input; // ========================================== // CRUD Endpoint Configuration @@ -180,7 +179,7 @@ export const CrudOperation = z.enum([ 'list', // GET /api/v1/data/{object} ]); -export type CrudOperation = z.infer; +export type CrudOperation = z.input; /** * CRUD Endpoint Pattern Schema @@ -217,7 +216,7 @@ export const CrudEndpointPatternSchema = lazySchema(() => z.object({ description: z.string().optional().describe('Operation description'), })); -export type CrudEndpointPattern = z.infer; +export type CrudEndpointPattern = z.input; /** * CRUD Endpoints Configuration Schema @@ -253,10 +252,9 @@ export const CrudEndpointsConfigSchema = lazySchema(() => z.object({ .describe('How object name is passed (path param or query param)'), })); -export type CrudEndpointsConfig = z.infer; +export type CrudEndpointsConfig = z.input; /** Post-parse shape of {@link CrudEndpointsConfig} — defaults applied, transforms run (ADR-0122). */ export type CrudEndpointsConfigParsed = z.infer; -export type CrudEndpointsConfigInput = z.input; // ========================================== // Metadata Endpoint Configuration @@ -304,10 +302,9 @@ export const MetadataEndpointsConfigSchema = lazySchema(() => z.object({ }).optional().describe('Enable/disable specific endpoints'), })); -export type MetadataEndpointsConfig = z.infer; +export type MetadataEndpointsConfig = z.input; /** Post-parse shape of {@link MetadataEndpointsConfig} — defaults applied, transforms run (ADR-0122). */ export type MetadataEndpointsConfigParsed = z.infer; -export type MetadataEndpointsConfigInput = z.input; // ========================================== // Batch Operation Endpoint Configuration @@ -356,10 +353,9 @@ export const BatchEndpointsConfigSchema = lazySchema(() => z.object({ .describe('Default atomic/transaction mode for batch operations'), })); -export type BatchEndpointsConfig = z.infer; +export type BatchEndpointsConfig = z.input; /** Post-parse shape of {@link BatchEndpointsConfig} — defaults applied, transforms run (ADR-0122). */ export type BatchEndpointsConfigParsed = z.infer; -export type BatchEndpointsConfigInput = z.input; // ========================================== // Route Generation Configuration @@ -399,10 +395,9 @@ export const RouteGenerationConfigSchema = lazySchema(() => z.object({ })).optional().describe('Per-object route customization'), })); -export type RouteGenerationConfig = z.infer; +export type RouteGenerationConfig = z.input; /** Post-parse shape of {@link RouteGenerationConfig} — defaults applied, transforms run (ADR-0122). */ export type RouteGenerationConfigParsed = z.infer; -export type RouteGenerationConfigInput = z.input; // ========================================== // OpenAPI 3.1 Webhooks & Callbacks — REMOVED (#4579) @@ -505,10 +500,9 @@ export const RestServerConfigSchema = lazySchema(() => z.object({ ), })); -export type RestServerConfig = z.infer; +export type RestServerConfig = z.input; /** Post-parse shape of {@link RestServerConfig} — defaults applied, transforms run (ADR-0122). */ export type RestServerConfigParsed = z.infer; -export type RestServerConfigInput = z.input; // ========================================== // Endpoint Registry @@ -560,7 +554,7 @@ export const GeneratedEndpointSchema = lazySchema(() => z.object({ }).optional(), })); -export type GeneratedEndpoint = z.infer; +export type GeneratedEndpoint = z.input; /** * Endpoint Registry Schema @@ -590,7 +584,7 @@ export const EndpointRegistrySchema = lazySchema(() => z.object({ .describe('Endpoints grouped by operation'), })); -export type EndpointRegistry = z.infer; +export type EndpointRegistry = z.input; // ========================================== // Helper Functions diff --git a/packages/spec/src/api/router.zod.ts b/packages/spec/src/api/router.zod.ts index 25547ccb59..757bd96bd5 100644 --- a/packages/spec/src/api/router.zod.ts +++ b/packages/spec/src/api/router.zod.ts @@ -20,7 +20,7 @@ export const RouteCategory = z.enum([ 'plugin' // Plugin extensions ]); -export type RouteCategory = z.infer; +export type RouteCategory = z.input; /** * Route Conflict Resolution Strategy @@ -52,7 +52,7 @@ export const ConflictResolutionStrategy = z.enum([ 'last-wins', // Last registered endpoint wins (override mode) ]); -export type ConflictResolutionStrategy = z.infer; +export type ConflictResolutionStrategy = z.input; /** * Route Definition Schema @@ -99,7 +99,7 @@ export const RouteDefinitionSchema = lazySchema(() => z.object({ rateLimit: z.string().optional().describe('Rate limit policy name'), })); -export type RouteDefinition = z.infer; +export type RouteDefinition = z.input; /** Post-parse shape of {@link RouteDefinition} — defaults applied, transforms run (ADR-0122). */ export type RouteDefinitionParsed = z.infer; @@ -157,6 +157,6 @@ export const RouterConfigSchema = lazySchema(() => z.object({ staticMounts: z.array(StaticMountSchema).optional(), })); -export type RouterConfig = z.infer; +export type RouterConfig = z.input; /** Post-parse shape of {@link RouterConfig} — defaults applied, transforms run (ADR-0122). */ export type RouterConfigParsed = z.infer; diff --git a/packages/spec/src/api/storage.zod.ts b/packages/spec/src/api/storage.zod.ts index e15392b412..3ab04f1b95 100644 --- a/packages/spec/src/api/storage.zod.ts +++ b/packages/spec/src/api/storage.zod.ts @@ -86,20 +86,20 @@ export const RawUploadResponseSchema = lazySchema(() => BaseResponseSchema.exten }), })); -export type GetPresignedUrlRequest = z.infer; +export type GetPresignedUrlRequest = z.input; /** Post-parse shape of {@link GetPresignedUrlRequest} — defaults applied, transforms run (ADR-0122). */ export type GetPresignedUrlRequestParsed = z.infer; -export type CompleteUploadRequest = z.infer; -export type PresignedUrlResponse = z.infer; +export type CompleteUploadRequest = z.input; +export type PresignedUrlResponse = z.input; /** Post-parse shape of {@link PresignedUrlResponse} — defaults applied, transforms run (ADR-0122). */ export type PresignedUrlResponseParsed = z.infer; -export type FileUploadResponse = z.infer; +export type FileUploadResponse = z.input; /** Post-parse shape of {@link FileUploadResponse} — defaults applied, transforms run (ADR-0122). */ export type FileUploadResponseParsed = z.infer; -export type FileDownloadUrlResponse = z.infer; +export type FileDownloadUrlResponse = z.input; /** Post-parse shape of {@link FileDownloadUrlResponse} — defaults applied, transforms run (ADR-0122). */ export type FileDownloadUrlResponseParsed = z.infer; -export type RawUploadResponse = z.infer; +export type RawUploadResponse = z.input; /** Post-parse shape of {@link RawUploadResponse} — defaults applied, transforms run (ADR-0122). */ export type RawUploadResponseParsed = z.infer; @@ -126,7 +126,7 @@ export const FileTypeValidationSchema = lazySchema(() => z.object({ minFileSize: z.number().int().min(0).optional() .describe('Minimum file size in bytes (e.g., reject empty files)'), })); -export type FileTypeValidation = z.infer; +export type FileTypeValidation = z.input; /** * Initiate Chunked Upload Request @@ -145,7 +145,7 @@ export const InitiateChunkedUploadRequestSchema = lazySchema(() => z.object({ bucket: z.string().optional().describe('Specific bucket override (admin only)'), metadata: z.record(z.string(), z.string()).optional().describe('Custom metadata key-value pairs'), })); -export type InitiateChunkedUploadRequest = z.infer; +export type InitiateChunkedUploadRequest = z.input; /** Post-parse shape of {@link InitiateChunkedUploadRequest} — defaults applied, transforms run (ADR-0122). */ export type InitiateChunkedUploadRequestParsed = z.infer; @@ -163,7 +163,7 @@ export const InitiateChunkedUploadResponseSchema = lazySchema(() => BaseResponse expiresAt: z.string().datetime().describe('Upload session expiration timestamp'), }), })); -export type InitiateChunkedUploadResponse = z.infer; +export type InitiateChunkedUploadResponse = z.input; /** Post-parse shape of {@link InitiateChunkedUploadResponse} — defaults applied, transforms run (ADR-0122). */ export type InitiateChunkedUploadResponseParsed = z.infer; @@ -178,7 +178,7 @@ export const UploadChunkRequestSchema = lazySchema(() => z.object({ chunkIndex: z.number().int().min(0).describe('Zero-based chunk index'), resumeToken: z.string().describe('Resume token from initiate response'), })); -export type UploadChunkRequest = z.infer; +export type UploadChunkRequest = z.input; /** * Upload Chunk Response @@ -191,7 +191,7 @@ export const UploadChunkResponseSchema = lazySchema(() => BaseResponseSchema.ext bytesReceived: z.number().int().describe('Bytes received for this chunk'), }), })); -export type UploadChunkResponse = z.infer; +export type UploadChunkResponse = z.input; /** Post-parse shape of {@link UploadChunkResponse} — defaults applied, transforms run (ADR-0122). */ export type UploadChunkResponseParsed = z.infer; @@ -208,7 +208,7 @@ export const CompleteChunkedUploadRequestSchema = lazySchema(() => z.object({ eTag: z.string().describe('ETag returned from chunk upload'), })).min(1).describe('Ordered list of uploaded parts for assembly'), })); -export type CompleteChunkedUploadRequest = z.infer; +export type CompleteChunkedUploadRequest = z.input; /** * Complete Chunked Upload Response @@ -224,7 +224,7 @@ export const CompleteChunkedUploadResponseSchema = lazySchema(() => BaseResponse url: z.string().optional().describe('Download URL for the assembled file'), }), })); -export type CompleteChunkedUploadResponse = z.infer; +export type CompleteChunkedUploadResponse = z.input; /** Post-parse shape of {@link CompleteChunkedUploadResponse} — defaults applied, transforms run (ADR-0122). */ export type CompleteChunkedUploadResponseParsed = z.infer; @@ -250,7 +250,7 @@ export const UploadProgressSchema = lazySchema(() => BaseResponseSchema.extend({ expiresAt: z.string().datetime().describe('Session expiration timestamp'), }), })); -export type UploadProgress = z.infer; +export type UploadProgress = z.input; /** Post-parse shape of {@link UploadProgress} — defaults applied, transforms run (ADR-0122). */ export type UploadProgressParsed = z.infer; diff --git a/packages/spec/src/api/versioning.zod.ts b/packages/spec/src/api/versioning.zod.ts index 97a31c728c..0bdc027827 100644 --- a/packages/spec/src/api/versioning.zod.ts +++ b/packages/spec/src/api/versioning.zod.ts @@ -37,7 +37,7 @@ export const VersioningStrategy = z.enum([ 'dateBased', ]); -export type VersioningStrategy = z.infer; +export type VersioningStrategy = z.input; // ========================================== // Version Lifecycle @@ -61,7 +61,7 @@ export const VersionStatus = z.enum([ 'retired', ]); -export type VersionStatus = z.infer; +export type VersionStatus = z.input; // ========================================== // Version Definition @@ -121,7 +121,7 @@ export const VersionDefinitionSchema = lazySchema(() => z.object({ .describe('List of breaking changes (for preview/new versions)'), })); -export type VersionDefinition = z.infer; +export type VersionDefinition = z.input; // ========================================== // Versioning Configuration @@ -202,10 +202,9 @@ export const VersioningConfigSchema = lazySchema(() => z.object({ .describe('Include version information in the API discovery endpoint'), })); -export type VersioningConfig = z.infer; +export type VersioningConfig = z.input; /** Post-parse shape of {@link VersioningConfig} — defaults applied, transforms run (ADR-0122). */ export type VersioningConfigParsed = z.infer; -export type VersioningConfigInput = z.input; // ========================================== // Version Negotiation Response @@ -248,7 +247,7 @@ export const VersionNegotiationResponseSchema = lazySchema(() => z.object({ .describe('Full version definitions with lifecycle metadata'), })); -export type VersionNegotiationResponse = z.infer; +export type VersionNegotiationResponse = z.input; // ========================================== // Default Versioning Configuration @@ -258,7 +257,7 @@ export type VersionNegotiationResponse = z.infer; +export type WebSocketMessageType = z.input; // ========================================== // Event Subscription @@ -89,7 +89,7 @@ export const EventPatternSchema = lazySchema(() => z }) .describe('Event pattern (supports wildcards like "record.*" or "*.created")')); -export type EventPattern = z.infer; +export type EventPattern = z.input; /** * Event Subscription Config @@ -112,7 +112,7 @@ export const EventSubscriptionSchema = lazySchema(() => z.object({ channels: z.array(z.string()).optional().describe('Channel names for scoped subscriptions'), })); -export type EventSubscription = z.infer; +export type EventSubscription = z.input; /** * Unsubscribe Request @@ -122,7 +122,7 @@ export const UnsubscribeRequestSchema = lazySchema(() => z.object({ subscriptionId: z.string().uuid().describe('Subscription ID to unsubscribe from'), })); -export type UnsubscribeRequest = z.infer; +export type UnsubscribeRequest = z.input; // ========================================== // Presence Tracking @@ -134,7 +134,7 @@ export type UnsubscribeRequest = z.infer; */ export const WebSocketPresenceStatus = PresenceStatus; -export type WebSocketPresenceStatus = z.infer; +export type WebSocketPresenceStatus = z.input; /** * Presence State Schema @@ -151,7 +151,7 @@ export const PresenceStateSchema = lazySchema(() => z.object({ metadata: z.record(z.string(), z.unknown()).optional().describe('Additional custom presence data'), })); -export type PresenceState = z.infer; +export type PresenceState = z.input; /** * Presence Update Request @@ -164,7 +164,7 @@ export const PresenceUpdateSchema = lazySchema(() => z.object({ metadata: z.record(z.string(), z.unknown()).optional().describe('Updated metadata'), })); -export type PresenceUpdate = z.infer; +export type PresenceUpdate = z.input; // ========================================== // Collaborative Editing Protocol @@ -197,7 +197,7 @@ export const CursorPositionSchema = lazySchema(() => z.object({ lastUpdate: z.string().datetime().describe('ISO 8601 datetime of last cursor update'), })); -export type CursorPosition = z.infer; +export type CursorPosition = z.input; /** * Edit Operation Type Enum @@ -209,7 +209,7 @@ export const EditOperationType = z.enum([ 'replace', // Replace text in range ]); -export type EditOperationType = z.infer; +export type EditOperationType = z.input; /** * Edit Operation Schema @@ -236,7 +236,7 @@ export const EditOperationSchema = lazySchema(() => z.object({ baseOperationId: z.string().uuid().optional().describe('Previous operation ID this builds upon (for OT)'), })); -export type EditOperation = z.infer; +export type EditOperation = z.input; /** * Document State Schema @@ -251,7 +251,7 @@ export const DocumentStateSchema = lazySchema(() => z.object({ checksum: z.string().optional().describe('Content checksum for integrity verification'), })); -export type DocumentState = z.infer; +export type DocumentState = z.input; // ========================================== // WebSocket Messages @@ -276,7 +276,7 @@ export const SubscribeMessageSchema = lazySchema(() => BaseWebSocketMessage.exte subscription: EventSubscriptionSchema.describe('Subscription configuration'), })); -export type SubscribeMessage = z.infer; +export type SubscribeMessage = z.input; /** * Unsubscribe Message @@ -287,7 +287,7 @@ export const UnsubscribeMessageSchema = lazySchema(() => BaseWebSocketMessage.ex request: UnsubscribeRequestSchema.describe('Unsubscribe request'), })); -export type UnsubscribeMessage = z.infer; +export type UnsubscribeMessage = z.input; /** * Event Message @@ -302,7 +302,7 @@ export const EventMessageSchema = lazySchema(() => BaseWebSocketMessage.extend({ userId: z.string().optional().describe('User who triggered the event'), })); -export type EventMessage = z.infer; +export type EventMessage = z.input; /** * Presence Message @@ -313,7 +313,7 @@ export const PresenceMessageSchema = lazySchema(() => BaseWebSocketMessage.exten presence: PresenceStateSchema.describe('Presence state'), })); -export type PresenceMessage = z.infer; +export type PresenceMessage = z.input; /** * Cursor Message @@ -324,7 +324,7 @@ export const CursorMessageSchema = lazySchema(() => BaseWebSocketMessage.extend( cursor: CursorPositionSchema.describe('Cursor position'), })); -export type CursorMessage = z.infer; +export type CursorMessage = z.input; /** * Edit Message @@ -335,7 +335,7 @@ export const EditMessageSchema = lazySchema(() => BaseWebSocketMessage.extend({ operation: EditOperationSchema.describe('Edit operation'), })); -export type EditMessage = z.infer; +export type EditMessage = z.input; /** * Acknowledgment Message @@ -348,7 +348,7 @@ export const AckMessageSchema = lazySchema(() => BaseWebSocketMessage.extend({ error: z.string().optional().describe('Error message if operation failed'), })); -export type AckMessage = z.infer; +export type AckMessage = z.input; /** * Error Message @@ -361,7 +361,7 @@ export const ErrorMessageSchema = lazySchema(() => BaseWebSocketMessage.extend({ details: z.unknown().optional().describe('Additional error details'), })); -export type ErrorMessage = z.infer; +export type ErrorMessage = z.input; /** * Ping Message @@ -371,7 +371,7 @@ export const PingMessageSchema = lazySchema(() => BaseWebSocketMessage.extend({ type: z.literal('ping'), })); -export type PingMessage = z.infer; +export type PingMessage = z.input; /** * Pong Message @@ -382,7 +382,7 @@ export const PongMessageSchema = lazySchema(() => BaseWebSocketMessage.extend({ pingMessageId: z.string().uuid().optional().describe('ID of ping message being responded to'), })); -export type PongMessage = z.infer; +export type PongMessage = z.input; /** * WebSocket Message Union @@ -401,7 +401,7 @@ export const WebSocketMessageSchema = lazySchema(() => z.discriminatedUnion('typ PongMessageSchema, ])); -export type WebSocketMessage = z.infer; +export type WebSocketMessage = z.input; // ========================================== // Connection Configuration @@ -422,7 +422,7 @@ export const WebSocketConfigSchema = lazySchema(() => z.object({ headers: z.record(z.string(), z.string()).optional().describe('Custom headers for WebSocket handshake'), })); -export type WebSocketConfig = z.infer; +export type WebSocketConfig = z.input; /** Post-parse shape of {@link WebSocketConfig} — defaults applied, transforms run (ADR-0122). */ export type WebSocketConfigParsed = z.infer; @@ -470,7 +470,7 @@ export const WebSocketEventSchema = lazySchema(() => z.object({ timestamp: z.number().describe('Unix timestamp in milliseconds'), })); -export type WebSocketEvent = z.infer; +export type WebSocketEvent = z.input; /** * Simplified Presence State Schema @@ -500,7 +500,7 @@ export const SimplePresenceStateSchema = lazySchema(() => z.object({ metadata: z.record(z.string(), z.unknown()).optional().describe('Additional presence metadata (e.g., current page, custom status)'), })); -export type SimplePresenceState = z.infer; +export type SimplePresenceState = z.input; /** * Simplified Cursor Position Schema @@ -533,7 +533,7 @@ export const SimpleCursorPositionSchema = lazySchema(() => z.object({ }).optional().describe('Text selection range (if text is selected)'), })); -export type SimpleCursorPosition = z.infer; +export type SimpleCursorPosition = z.input; /** * WebSocket Server Configuration Schema @@ -562,6 +562,6 @@ export const WebSocketServerConfigSchema = lazySchema(() => z.object({ cursorSharing: z.boolean().default(false).describe('Enable collaborative cursor sharing'), })); -export type WebSocketServerConfig = z.infer; +export type WebSocketServerConfig = z.input; /** Post-parse shape of {@link WebSocketServerConfig} — defaults applied, transforms run (ADR-0122). */ export type WebSocketServerConfigParsed = z.infer; diff --git a/packages/spec/src/automation/approval.zod.ts b/packages/spec/src/automation/approval.zod.ts index 76bad3db34..173e35f5fe 100644 --- a/packages/spec/src/automation/approval.zod.ts +++ b/packages/spec/src/automation/approval.zod.ts @@ -325,7 +325,7 @@ export const APPROVAL_REVISE_NODE_TYPE = 'approval_revise' as const; * (see {@link ApprovalNodeConfigSchema}). */ export const ApprovalDecision = z.enum(['approve', 'reject']); -export type ApprovalDecision = z.infer; +export type ApprovalDecision = z.input; /** * Edge labels an Approval node's out-edges use to declare which branch a @@ -501,7 +501,7 @@ export const ApprovalNodeApproverSchema = lazySchema(() => z.object({ xRef: { kind: 'organization', symbols: [...APPROVER_ORG_SYMBOLS] }, }), }, { error: approvalApproverUnknownKeyError }).strict()); -export type ApprovalNodeApprover = z.infer; +export type ApprovalNodeApprover = z.input; /** * A TYPED decision-output declaration (#3447 P2 follow-up). The bare-string @@ -550,7 +550,7 @@ export const DecisionOutputDefSchema = lazySchema(() => z.object({ */ required: z.boolean().optional().describe('Approver must supply this output to approve'), }, { error: decisionOutputUnknownKeyError }).strict()); -export type DecisionOutputDef = z.infer; +export type DecisionOutputDef = z.input; /** * Normalize a `decisionOutputs` array (bare keys and typed declarations mixed) @@ -617,7 +617,7 @@ export const ApprovalEscalationSchema = lazySchema(() => z.object({ }), notifySubmitter: z.boolean().default(true).describe('Notify the original submitter on escalation'), }, { error: approvalEscalationUnknownKeyError }).strict()); -export type ApprovalEscalation = z.infer; +export type ApprovalEscalation = z.input; /** Post-parse shape of {@link ApprovalEscalation} — defaults applied, transforms run (ADR-0122). */ export type ApprovalEscalationParsed = z.infer; @@ -781,7 +781,7 @@ export const ApprovalNodeConfigSchema = lazySchema(() => z.object({ maxRevisions: z.number().int().min(0).default(3) .describe('Max send-backs for revision before auto-reject (0 = send-back disabled)'), }, { error: approvalNodeConfigUnknownKeyError }).strict()); -export type ApprovalNodeConfig = z.infer; +export type ApprovalNodeConfig = z.input; /** Post-parse shape of {@link ApprovalNodeConfig} — defaults applied, transforms run (ADR-0122). */ export type ApprovalNodeConfigParsed = z.infer; diff --git a/packages/spec/src/automation/bpmn-interop.zod.ts b/packages/spec/src/automation/bpmn-interop.zod.ts index c56b613e17..0806793b22 100644 --- a/packages/spec/src/automation/bpmn-interop.zod.ts +++ b/packages/spec/src/automation/bpmn-interop.zod.ts @@ -35,7 +35,7 @@ export const BpmnElementMappingSchema = lazySchema(() => z.object({ notes: z.string().optional().describe('Notes about mapping limitations'), }).describe('Mapping between BPMN XML element and ObjectStack FlowNodeAction')); -export type BpmnElementMapping = z.infer; +export type BpmnElementMapping = z.input; /** Post-parse shape of {@link BpmnElementMapping} — defaults applied, transforms run (ADR-0122). */ export type BpmnElementMappingParsed = z.infer; @@ -51,7 +51,7 @@ export const BpmnUnmappedStrategySchema = lazySchema(() => z.enum([ 'comment', // Import as annotation/comment nodes ]).describe('Strategy for unmapped BPMN elements during import')); -export type BpmnUnmappedStrategy = z.infer; +export type BpmnUnmappedStrategy = z.input; /** * Options for importing a BPMN 2.0 XML process definition into an ObjectStack flow. @@ -82,7 +82,7 @@ export const BpmnImportOptionsSchema = lazySchema(() => z.object({ .describe('Validate imported flow against FlowSchema after import'), }).describe('Options for importing BPMN 2.0 XML into an ObjectStack flow')); -export type BpmnImportOptions = z.infer; +export type BpmnImportOptions = z.input; /** Post-parse shape of {@link BpmnImportOptions} — defaults applied, transforms run (ADR-0122). */ export type BpmnImportOptionsParsed = z.infer; @@ -96,7 +96,7 @@ export const BpmnVersionSchema = lazySchema(() => z.enum([ '2.0.2', // BPMN 2.0.2 (latest revision) ]).describe('BPMN specification version for export')); -export type BpmnVersion = z.infer; +export type BpmnVersion = z.input; /** * Options for exporting an ObjectStack flow as BPMN 2.0 XML. @@ -127,7 +127,7 @@ export const BpmnExportOptionsSchema = lazySchema(() => z.object({ .describe('XML namespace prefix for BPMN elements'), }).describe('Options for exporting an ObjectStack flow as BPMN 2.0 XML')); -export type BpmnExportOptions = z.infer; +export type BpmnExportOptions = z.input; /** Post-parse shape of {@link BpmnExportOptions} — defaults applied, transforms run (ADR-0122). */ export type BpmnExportOptionsParsed = z.infer; @@ -150,7 +150,7 @@ export const BpmnDiagnosticSchema = lazySchema(() => z.object({ nodeId: z.string().optional().describe('ObjectStack node ID related to this diagnostic'), }).describe('Diagnostic message from BPMN import/export')); -export type BpmnDiagnostic = z.infer; +export type BpmnDiagnostic = z.input; /** * Result of a BPMN import or export operation. @@ -172,7 +172,7 @@ export const BpmnInteropResultSchema = lazySchema(() => z.object({ .describe('Number of elements that could not be mapped'), }).describe('Result of a BPMN import/export operation')); -export type BpmnInteropResult = z.infer; +export type BpmnInteropResult = z.input; /** Post-parse shape of {@link BpmnInteropResult} — defaults applied, transforms run (ADR-0122). */ export type BpmnInteropResultParsed = z.infer; diff --git a/packages/spec/src/automation/control-flow.zod.ts b/packages/spec/src/automation/control-flow.zod.ts index c1c0a991e5..c2e28a7d00 100644 --- a/packages/spec/src/automation/control-flow.zod.ts +++ b/packages/spec/src/automation/control-flow.zod.ts @@ -245,6 +245,8 @@ export const ParallelBranchSchema = lazySchema(() => strictObject( )); export type ParallelBranch = z.input; +/** Post-parse shape of {@link ParallelBranch} — defaults applied, transforms run (ADR-0122). */ +export type ParallelBranchParsed = z.infer; /** * `parallel` block config — N branch regions that run concurrently and **join diff --git a/packages/spec/src/automation/execution.zod.ts b/packages/spec/src/automation/execution.zod.ts index a3a6731863..08296776c6 100644 --- a/packages/spec/src/automation/execution.zod.ts +++ b/packages/spec/src/automation/execution.zod.ts @@ -32,7 +32,7 @@ export const ExecutionStatus = z.enum([ 'timed_out', // Exceeded max execution time 'retrying', // Failed and retrying ]); -export type ExecutionStatus = z.infer; +export type ExecutionStatus = z.input; // ========================================== // 2. Execution Log @@ -77,7 +77,7 @@ export const ExecutionStepMetricsSchema = lazySchema(() => z.object({ unmeasuredEffect: z.boolean().optional() .describe('This execution may have caused an effect the platform cannot count (an external write through a connector). NOT interchangeable with `acted: 0` — it says the count is unknown, not that it is zero.'), })); -export type ExecutionStepMetrics = z.infer; +export type ExecutionStepMetrics = z.input; /** * The gate that kept a step from running — recorded on a `skipped` step so the @@ -92,7 +92,7 @@ export const ExecutionStepSkipReasonSchema = lazySchema(() => z.object({ edgeId: z.string().optional().describe('Edge whose condition evaluated false'), label: z.string().optional().describe('Edge label, when the flow names its branches'), })); -export type ExecutionStepSkipReason = z.infer; +export type ExecutionStepSkipReason = z.input; /** * Execution Step Log Entry @@ -128,7 +128,7 @@ export const ExecutionStepLogSchema = lazySchema(() => z.object({ skippedBy: ExecutionStepSkipReasonSchema.optional() .describe('The gate that closed, when `status` is `skipped`'), })); -export type ExecutionStepLog = z.infer; +export type ExecutionStepLog = z.input; // ========================================== // 2b. Flow Run Summary (#4354) @@ -151,7 +151,7 @@ export const FlowRunNodeSummarySchema = lazySchema(() => z.object({ acted: z.number().int().min(0).optional().describe('Records written / effects dispatched across every execution — omitted for a node that writes none'), unmeasured: z.number().int().min(0).optional().describe('Executions that may have caused an effect the platform cannot count (see ExecutionStepMetrics.unmeasuredEffect)'), })); -export type FlowRunNodeSummary = z.infer; +export type FlowRunNodeSummary = z.input; /** A gate that closed during the run, and how often. */ export const FlowRunGateSummarySchema = lazySchema(() => z.object({ @@ -161,7 +161,7 @@ export const FlowRunGateSummarySchema = lazySchema(() => z.object({ label: z.string().optional().describe('Edge label, when the flow names its branches'), skipped: z.number().int().min(1).describe('Times this gate evaluated false (once per loop iteration)'), })); -export type FlowRunGateSummary = z.infer; +export type FlowRunGateSummary = z.input; /** * Per-run rollup of what a flow execution actually *did* (#4354). @@ -200,7 +200,7 @@ export const FlowRunSummarySchema = lazySchema(() => z.object({ detailOmitted: z.boolean().optional() .describe('Set when persistence dropped `nodes`/`gates` to keep the stored row bounded — the totals are still exact. Declared so empty arrays are never mistaken for "nothing ran".'), })); -export type FlowRunSummary = z.infer; +export type FlowRunSummary = z.input; /** * Execution Log Schema @@ -266,7 +266,7 @@ export const ExecutionLogSchema = lazySchema(() => z.object({ runAs: z.enum(['system', 'user']).optional().describe('Execution context identity'), tenantId: z.string().optional().describe('Tenant ID for multi-tenant isolation'), })); -export type ExecutionLog = z.infer; +export type ExecutionLog = z.input; // ========================================== // 3. Execution Error Tracking & Diagnostics @@ -280,7 +280,7 @@ export const ExecutionErrorSeverity = z.enum([ 'error', // Node-level failure (may be retried) 'critical', // Flow-level failure (execution terminated) ]); -export type ExecutionErrorSeverity = z.infer; +export type ExecutionErrorSeverity = z.input; /** * Execution Error Schema @@ -300,7 +300,7 @@ export const ExecutionErrorSchema = lazySchema(() => z.object({ retryable: z.boolean().default(false).describe('Whether this error can be retried'), resolvedAt: z.string().datetime().optional().describe('When the error was resolved (e.g., after successful retry)'), })); -export type ExecutionError = z.infer; +export type ExecutionError = z.input; // ========================================== // 4. Checkpointing / Resume @@ -333,7 +333,7 @@ export const CheckpointSchema = lazySchema(() => z.object({ reason: z.enum(['wait', 'screen_input', 'approval', 'error', 'manual_pause', 'parallel_join', 'boundary_event']) .describe('Why the execution was checkpointed'), })); -export type Checkpoint = z.infer; +export type Checkpoint = z.input; // ========================================== // 5. Concurrency Control @@ -364,7 +364,7 @@ export const ConcurrencyPolicySchema = lazySchema(() => z.object({ queueTimeoutMs: z.number().int().min(0).optional() .describe('Maximum time to wait in queue before timing out (ms)'), })); -export type ConcurrencyPolicy = z.infer; +export type ConcurrencyPolicy = z.input; // ========================================== // 6. Scheduled Execution Persistence @@ -410,7 +410,7 @@ export const ScheduleStateSchema = lazySchema(() => z.object({ updatedAt: z.string().datetime().optional().describe('Last update timestamp'), createdBy: z.string().optional().describe('User who created the schedule'), })); -export type ScheduleState = z.infer; +export type ScheduleState = z.input; // ========================================== // Type Exports diff --git a/packages/spec/src/automation/flow-function.zod.ts b/packages/spec/src/automation/flow-function.zod.ts index 50fa11cff0..8bfceba1bc 100644 --- a/packages/spec/src/automation/flow-function.zod.ts +++ b/packages/spec/src/automation/flow-function.zod.ts @@ -75,7 +75,7 @@ export const FlowFunctionEffectSchema = lazySchema(() => z.enum([ 'writes', ]).describe("What a script-node function does to data: 'pure' (computes and returns — the contract) or 'writes' (performs uncountable writes/effects, reported as unmeasured)")); -export type FlowFunctionEffect = z.infer; +export type FlowFunctionEffect = z.input; /** * The effect a function is assumed to have when it declares none — the @@ -159,10 +159,9 @@ export const FlowFunctionDeclarationSchema = lazySchema(() => strictObject({ .describe("What the function does to data — omit for the pure default"), }).describe('A named handler function plus its declared effect (#4396)')); -export type FlowFunctionDeclaration = z.infer; +export type FlowFunctionDeclaration = z.input; /** Post-parse shape of {@link FlowFunctionDeclaration} — defaults applied, transforms run (ADR-0122). */ export type FlowFunctionDeclarationParsed = z.infer; -export type FlowFunctionDeclarationInput = z.input; /** * The **lowered** form of {@link FlowFunctionDeclarationSchema}: the same @@ -231,7 +230,7 @@ export const FlowFunctionEntrySchema = lazySchema(() => z.union([ FlowFunctionLoweredDeclarationSchema, ]).describe('A named handler function or a declaration record stating its effect — either as authored, or lowered to a handler ref by `objectstack build`')); -export type FlowFunctionEntry = z.infer; +export type FlowFunctionEntry = z.input; /** Post-parse shape of {@link FlowFunctionEntry} — defaults applied, transforms run (ADR-0122). */ export type FlowFunctionEntryParsed = z.infer; diff --git a/packages/spec/src/automation/node-executor.zod.ts b/packages/spec/src/automation/node-executor.zod.ts index 2b61d112ca..0d1ce84625 100644 --- a/packages/spec/src/automation/node-executor.zod.ts +++ b/packages/spec/src/automation/node-executor.zod.ts @@ -32,7 +32,7 @@ export const WaitEventTypeSchema = lazySchema(() => z.enum([ 'condition', // Resume when a data condition is met (polling) ]).describe('Wait event type determining how a paused flow is resumed')); -export type WaitEventType = z.infer; +export type WaitEventType = z.input; // ─── Wait Resume Payload ───────────────────────────────────────────── @@ -71,7 +71,7 @@ export const WaitResumePayloadSchema = lazySchema(() => z.object({ .describe('Variables to merge into flow context upon resume'), }).describe('Payload for resuming a paused wait node')); -export type WaitResumePayload = z.infer; +export type WaitResumePayload = z.input; // ─── Wait Executor Config ──────────────────────────────────────────── @@ -84,7 +84,7 @@ export const WaitTimeoutBehaviorSchema = lazySchema(() => z.enum([ 'fallback', // Execute a fallback edge ]).describe('Behavior when a wait node exceeds its timeout')); -export type WaitTimeoutBehavior = z.infer; +export type WaitTimeoutBehavior = z.input; /** * Configuration for the wait node executor plugin. @@ -120,7 +120,7 @@ export const WaitExecutorConfigSchema = lazySchema(() => z.object({ .describe('Max concurrent paused executions (0 = unlimited)'), }).describe('Wait node executor plugin configuration')); -export type WaitExecutorConfig = z.infer; +export type WaitExecutorConfig = z.input; /** Post-parse shape of {@link WaitExecutorConfig} — defaults applied, transforms run (ADR-0122). */ export type WaitExecutorConfigParsed = z.infer; @@ -165,7 +165,7 @@ export const NodeExecutorDescriptorSchema = lazySchema(() => z.object({ .describe('JSON Schema $ref for executor-specific config'), }).describe('Node executor plugin descriptor')); -export type NodeExecutorDescriptor = z.infer; +export type NodeExecutorDescriptor = z.input; /** Post-parse shape of {@link NodeExecutorDescriptor} — defaults applied, transforms run (ADR-0122). */ export type NodeExecutorDescriptorParsed = z.infer; @@ -185,7 +185,7 @@ export const ActionCategorySchema = lazySchema(() => z.enum([ 'custom', // plugin-defined, uncategorised ]).describe('Action palette category')); -export type ActionCategory = z.infer; +export type ActionCategory = z.input; /** * Authoring surfaces that may offer an action. A descriptor opts into the @@ -199,7 +199,7 @@ export const ActionParadigmSchema = lazySchema(() => z.enum([ // there is no declarative rule authoring view to compile to Flow. ]).describe('Authoring paradigm that may offer this action')); -export type ActionParadigm = z.infer; +export type ActionParadigm = z.input; /** * Canonical, cross-paradigm **Action descriptor** (ADR-0018 §1). @@ -406,10 +406,9 @@ export const ActionDescriptorSchema = lazySchema(() => z.object({ aliasOf: z.string().optional().describe('Canonical type this alias forwards to'), }).describe('Canonical cross-paradigm action/node descriptor (ADR-0018)')); -export type ActionDescriptor = z.infer; +export type ActionDescriptor = z.input; /** Post-parse shape of {@link ActionDescriptor} — defaults applied, transforms run (ADR-0122). */ export type ActionDescriptorParsed = z.infer; -export type ActionDescriptorInput = z.input; /** * Type-safe factory for an {@link ActionDescriptor}. Validates and applies @@ -427,7 +426,7 @@ export type ActionDescriptorInput = z.input; * }); * ``` */ -export function defineActionDescriptor(input: ActionDescriptorInput): ActionDescriptor { +export function defineActionDescriptor(input: ActionDescriptor): ActionDescriptorParsed { return ActionDescriptorSchema.parse(input); } diff --git a/packages/spec/src/automation/state-machine.zod.ts b/packages/spec/src/automation/state-machine.zod.ts index b6c46efa0f..bb47e67891 100644 --- a/packages/spec/src/automation/state-machine.zod.ts +++ b/packages/spec/src/automation/state-machine.zod.ts @@ -166,8 +166,8 @@ export const TransitionSchema = lazySchema(() => strictObject( // kernel-side analogue of a signal *declaration* is `EventTypeDefinitionSchema` // in the same file. -export type ActionRef = z.infer; -export type Transition = z.infer; +export type ActionRef = z.input; +export type Transition = z.input; export type StateNodeConfig = { type?: 'atomic' | 'compound' | 'parallel' | 'final' | 'history'; @@ -291,4 +291,4 @@ export const StateMachineSchema = lazySchema(() => strictObject( }, )); -export type StateMachineConfig = z.infer; +export type StateMachineConfig = z.input; diff --git a/packages/spec/src/automation/time-relative-trigger.zod.ts b/packages/spec/src/automation/time-relative-trigger.zod.ts index 618386b049..50c43b95e8 100644 --- a/packages/spec/src/automation/time-relative-trigger.zod.ts +++ b/packages/spec/src/automation/time-relative-trigger.zod.ts @@ -210,9 +210,7 @@ export const TimeRelativeTriggerSchema = lazySchema(() => }), ); -export type TimeRelativeTrigger = z.infer; -/** Authoring input for {@link TimeRelativeTrigger} (defaulted fields optional). */ -export type TimeRelativeTriggerInput = z.input; +export type TimeRelativeTrigger = z.input; /** * Default per-sweep record cap when a descriptor omits `maxRecords`. Keeps a diff --git a/packages/spec/src/automation/webhook.zod.ts b/packages/spec/src/automation/webhook.zod.ts index eea2fc47c9..9c0076809b 100644 --- a/packages/spec/src/automation/webhook.zod.ts +++ b/packages/spec/src/automation/webhook.zod.ts @@ -47,7 +47,7 @@ export const WebhookTriggerType = z.enum([ 'bulk_delete', ]); -export type WebhookTriggerType = z.infer; +export type WebhookTriggerType = z.input; /** * CANONICAL WEBHOOK DEFINITION @@ -228,17 +228,15 @@ export const WebhookSchema = lazySchema(() => strictObject({ ...MetadataProtectionFields, })); -export type Webhook = z.infer; +export type Webhook = z.input; /** Post-parse shape of {@link Webhook} — defaults applied, transforms run (ADR-0122). */ export type WebhookParsed = z.infer; -/** Authoring input for {@link Webhook} — defaulted fields are optional. */ -export type WebhookInput = z.input; /** * Type-safe factory for an outbound webhook. Validates at authoring time via * `.parse()` and accepts input-shape config (optional defaults, CEL * shorthand) — preferred over a bare `: Webhook` literal. */ -export function defineWebhook(config: z.input): Webhook { +export function defineWebhook(config: z.input): WebhookParsed { return WebhookSchema.parse(config); } diff --git a/packages/spec/src/cloud/app-store.zod.ts b/packages/spec/src/cloud/app-store.zod.ts index ba6182507f..a9e0d8782e 100644 --- a/packages/spec/src/cloud/app-store.zod.ts +++ b/packages/spec/src/cloud/app-store.zod.ts @@ -381,33 +381,33 @@ export const ListInstalledAppsResponseSchema = lazySchema(() => z.object({ // Export Types // ========================================== -export type ReviewModerationStatus = z.infer; -export type UserReview = z.infer; +export type ReviewModerationStatus = z.input; +export type UserReview = z.input; /** Post-parse shape of {@link UserReview} — defaults applied, transforms run (ADR-0122). */ export type UserReviewParsed = z.infer; -export type SubmitReviewRequest = z.infer; -export type ListReviewsRequest = z.infer; +export type SubmitReviewRequest = z.input; +export type ListReviewsRequest = z.input; /** Post-parse shape of {@link ListReviewsRequest} — defaults applied, transforms run (ADR-0122). */ export type ListReviewsRequestParsed = z.infer; -export type ListReviewsResponse = z.infer; +export type ListReviewsResponse = z.input; /** Post-parse shape of {@link ListReviewsResponse} — defaults applied, transforms run (ADR-0122). */ export type ListReviewsResponseParsed = z.infer; -export type RecommendationReason = z.infer; -export type RecommendedApp = z.infer; -export type AppDiscoveryRequest = z.infer; +export type RecommendationReason = z.input; +export type RecommendedApp = z.input; +export type AppDiscoveryRequest = z.input; /** Post-parse shape of {@link AppDiscoveryRequest} — defaults applied, transforms run (ADR-0122). */ export type AppDiscoveryRequestParsed = z.infer; -export type AppDiscoveryResponse = z.infer; -export type SubscriptionStatus = z.infer; -export type AppSubscription = z.infer; +export type AppDiscoveryResponse = z.input; +export type SubscriptionStatus = z.input; +export type AppSubscription = z.input; /** Post-parse shape of {@link AppSubscription} — defaults applied, transforms run (ADR-0122). */ export type AppSubscriptionParsed = z.infer; -export type InstalledAppSummary = z.infer; +export type InstalledAppSummary = z.input; /** Post-parse shape of {@link InstalledAppSummary} — defaults applied, transforms run (ADR-0122). */ export type InstalledAppSummaryParsed = z.infer; -export type ListInstalledAppsRequest = z.infer; +export type ListInstalledAppsRequest = z.input; /** Post-parse shape of {@link ListInstalledAppsRequest} — defaults applied, transforms run (ADR-0122). */ export type ListInstalledAppsRequestParsed = z.infer; -export type ListInstalledAppsResponse = z.infer; +export type ListInstalledAppsResponse = z.input; /** Post-parse shape of {@link ListInstalledAppsResponse} — defaults applied, transforms run (ADR-0122). */ export type ListInstalledAppsResponseParsed = z.infer; diff --git a/packages/spec/src/cloud/developer-portal.zod.ts b/packages/spec/src/cloud/developer-portal.zod.ts index d56a200fd4..83ef118a5e 100644 --- a/packages/spec/src/cloud/developer-portal.zod.ts +++ b/packages/spec/src/cloud/developer-portal.zod.ts @@ -310,23 +310,23 @@ export const PublishingAnalyticsResponseSchema = lazySchema(() => z.object({ // Export Types // ========================================== -export type PublisherProfile = z.infer; +export type PublisherProfile = z.input; /** Post-parse shape of {@link PublisherProfile} — defaults applied, transforms run (ADR-0122). */ export type PublisherProfileParsed = z.infer; -export type ReleaseChannel = z.infer; -export type VersionRelease = z.infer; +export type ReleaseChannel = z.input; +export type VersionRelease = z.input; /** Post-parse shape of {@link VersionRelease} — defaults applied, transforms run (ADR-0122). */ export type VersionReleaseParsed = z.infer; -export type CreateListingRequest = z.infer; +export type CreateListingRequest = z.input; /** Post-parse shape of {@link CreateListingRequest} — defaults applied, transforms run (ADR-0122). */ export type CreateListingRequestParsed = z.infer; -export type UpdateListingRequest = z.infer; -export type ListingActionRequest = z.infer; -export type AnalyticsTimeRange = z.infer; -export type PublishingAnalyticsRequest = z.infer; +export type UpdateListingRequest = z.input; +export type ListingActionRequest = z.input; +export type AnalyticsTimeRange = z.input; +export type PublishingAnalyticsRequest = z.input; /** Post-parse shape of {@link PublishingAnalyticsRequest} — defaults applied, transforms run (ADR-0122). */ export type PublishingAnalyticsRequestParsed = z.infer; -export type TimeSeriesPoint = z.infer; -export type PublishingAnalyticsResponse = z.infer; +export type TimeSeriesPoint = z.input; +export type PublishingAnalyticsResponse = z.input; /** Post-parse shape of {@link PublishingAnalyticsResponse} — defaults applied, transforms run (ADR-0122). */ export type PublishingAnalyticsResponseParsed = z.infer; diff --git a/packages/spec/src/cloud/environment-artifact.zod.ts b/packages/spec/src/cloud/environment-artifact.zod.ts index 97ff001f80..8da7fb31f5 100644 --- a/packages/spec/src/cloud/environment-artifact.zod.ts +++ b/packages/spec/src/cloud/environment-artifact.zod.ts @@ -21,5 +21,5 @@ export { export type { Sha256Digest, EnvironmentArtifact, - EnvironmentArtifactInput, + EnvironmentArtifactParsed, } from '../system/environment-artifact.zod'; diff --git a/packages/spec/src/cloud/environment-package.zod.ts b/packages/spec/src/cloud/environment-package.zod.ts index 0d7096198b..c614940879 100644 --- a/packages/spec/src/cloud/environment-package.zod.ts +++ b/packages/spec/src/cloud/environment-package.zod.ts @@ -37,7 +37,7 @@ export const EnvironmentPackageStatusSchema = lazySchema(() => z ]) .describe('Package installation status within an environment')); -export type EnvironmentPackageStatus = z.infer; +export type EnvironmentPackageStatus = z.input; // --------------------------------------------------------------------------- // sys_package_installation — Environment ↔ version pairing @@ -110,7 +110,7 @@ export const EnvironmentPackageInstallationSchema = lazySchema(() => z.object({ errorMessage: z.string().optional().describe('Error message when status is error'), }).describe('Package installation record in an environment (sys_package_installation)')); -export type EnvironmentPackageInstallation = z.infer; +export type EnvironmentPackageInstallation = z.input; /** Post-parse shape of {@link EnvironmentPackageInstallation} — defaults applied, transforms run (ADR-0122). */ export type EnvironmentPackageInstallationParsed = z.infer; @@ -143,7 +143,7 @@ export const InstallPackageToEnvironmentRequestSchema = lazySchema(() => z.objec { message: 'Either packageVersionId or packageManifestId must be provided' } )); -export type InstallPackageToEnvironmentRequest = z.infer; +export type InstallPackageToEnvironmentRequest = z.input; /** Post-parse shape of {@link InstallPackageToEnvironmentRequest} — defaults applied, transforms run (ADR-0122). */ export type InstallPackageToEnvironmentRequestParsed = z.infer; @@ -160,7 +160,7 @@ export const UpgradeEnvironmentPackageRequestSchema = lazySchema(() => z.object( upgradedBy: z.string().optional().describe('User ID performing the upgrade'), }).describe('Upgrade a package installation to a newer version')); -export type UpgradeEnvironmentPackageRequest = z.infer; +export type UpgradeEnvironmentPackageRequest = z.input; /** Post-parse shape of {@link UpgradeEnvironmentPackageRequest} — defaults applied, transforms run (ADR-0122). */ export type UpgradeEnvironmentPackageRequestParsed = z.infer; @@ -173,7 +173,7 @@ export const RollbackEnvironmentPackageRequestSchema = lazySchema(() => z.object rolledBackBy: z.string().optional().describe('User ID performing the rollback'), }).describe('Roll back a package installation to a specific older version')); -export type RollbackEnvironmentPackageRequest = z.infer; +export type RollbackEnvironmentPackageRequest = z.input; // --------------------------------------------------------------------------- // Response schemas @@ -188,6 +188,6 @@ export const ListEnvironmentPackagesResponseSchema = lazySchema(() => z.object({ total: z.number().describe('Total count'), }).describe('List of packages installed in an environment')); -export type ListEnvironmentPackagesResponse = z.infer; +export type ListEnvironmentPackagesResponse = z.input; /** Post-parse shape of {@link ListEnvironmentPackagesResponse} — defaults applied, transforms run (ADR-0122). */ export type ListEnvironmentPackagesResponseParsed = z.infer; diff --git a/packages/spec/src/cloud/environment.zod.ts b/packages/spec/src/cloud/environment.zod.ts index 9557aa9d0e..ec02bc12ec 100644 --- a/packages/spec/src/cloud/environment.zod.ts +++ b/packages/spec/src/cloud/environment.zod.ts @@ -60,7 +60,7 @@ export const EnvironmentTypeSchema = lazySchema(() => z .enum(['production', 'sandbox', 'development', 'test', 'staging', 'preview', 'trial']) .describe('Environment categorical tag (prod/sandbox/dev/test/…)')); -export type EnvironmentType = z.infer; +export type EnvironmentType = z.input; /** * Environment lifecycle status. @@ -73,7 +73,7 @@ export const EnvironmentStatusSchema = lazySchema(() => z .enum(['provisioning', 'active', 'suspended', 'archived', 'failed', 'migrating']) .describe('Environment lifecycle status')); -export type EnvironmentStatus = z.infer; +export type EnvironmentStatus = z.input; /** * Backend driver registry — keys used by the data-plane driver factory. @@ -85,7 +85,7 @@ export const EnvironmentDriverSchema = lazySchema(() => z .min(1) .describe('Data-plane driver key (e.g. `turso`, `libsql`, `sqlite`, `postgres`)')); -export type EnvironmentDriver = z.infer; +export type EnvironmentDriver = z.input; /** * Public exposure of an environment's compiled artifacts. @@ -98,7 +98,7 @@ export const EnvironmentVisibilitySchema = lazySchema(() => z .enum(['private', 'unlisted', 'public']) .describe('Public exposure of this environment artifacts (private | unlisted | public).')); -export type EnvironmentVisibility = z.infer; +export type EnvironmentVisibility = z.input; /** * Environment — one logical runtime of an organization's data. @@ -190,7 +190,7 @@ export const EnvironmentSchema = lazySchema(() => z.object({ .describe('Public exposure of this environment artifacts (private | unlisted | public).'), })); -export type Environment = z.infer; +export type Environment = z.input; /** Post-parse shape of {@link Environment} — defaults applied, transforms run (ADR-0122). */ export type EnvironmentParsed = z.infer; @@ -205,7 +205,7 @@ export const EnvironmentCredentialStatusSchema = lazySchema(() => z .enum(['active', 'rotating', 'revoked']) .describe('Credential lifecycle status')); -export type EnvironmentCredentialStatus = z.infer; +export type EnvironmentCredentialStatus = z.input; /** * Encrypted credential for an environment's database. @@ -246,7 +246,7 @@ export const EnvironmentCredentialSchema = lazySchema(() => z.object({ revokedAt: z.string().datetime().optional().describe('Revocation timestamp (if revoked)'), })); -export type EnvironmentCredential = z.infer; +export type EnvironmentCredential = z.input; /** Post-parse shape of {@link EnvironmentCredential} — defaults applied, transforms run (ADR-0122). */ export type EnvironmentCredentialParsed = z.infer; @@ -261,7 +261,7 @@ export const EnvironmentRoleSchema = lazySchema(() => z .enum(['owner', 'admin', 'maker', 'reader', 'guest']) .describe('Per-environment role')); -export type EnvironmentRole = z.infer; +export type EnvironmentRole = z.input; /** * Environment membership — grants a user access to a specific environment. @@ -291,7 +291,7 @@ export const EnvironmentMemberSchema = lazySchema(() => z.object({ updatedAt: z.string().datetime().describe('Last update timestamp (ISO-8601)'), })); -export type EnvironmentMember = z.infer; +export type EnvironmentMember = z.input; // --------------------------------------------------------------------------- // Provisioning requests / responses @@ -323,7 +323,7 @@ export const ProvisionEnvironmentRequestSchema = lazySchema(() => z.object({ ), })); -export type ProvisionEnvironmentRequest = z.infer; +export type ProvisionEnvironmentRequest = z.input; /** Post-parse shape of {@link ProvisionEnvironmentRequest} — defaults applied, transforms run (ADR-0122). */ export type ProvisionEnvironmentRequestParsed = z.infer; @@ -364,7 +364,7 @@ export const ProvisionEnvironmentResponseSchema = lazySchema(() => z.object({ ), })); -export type ProvisionEnvironmentResponse = z.infer; +export type ProvisionEnvironmentResponse = z.input; /** Post-parse shape of {@link ProvisionEnvironmentResponse} — defaults applied, transforms run (ADR-0122). */ export type ProvisionEnvironmentResponseParsed = z.infer; @@ -386,7 +386,7 @@ export const ProvisionOrganizationRequestSchema = lazySchema(() => z.object({ metadata: z.record(z.string(), z.unknown()).optional().describe('Free-form metadata'), })); -export type ProvisionOrganizationRequest = z.infer; +export type ProvisionOrganizationRequest = z.input; /** Post-parse shape of {@link ProvisionOrganizationRequest} — defaults applied, transforms run (ADR-0122). */ export type ProvisionOrganizationRequestParsed = z.infer; @@ -399,6 +399,6 @@ export const ProvisionOrganizationResponseSchema = lazySchema(() => z.object({ warnings: z.array(z.string()).optional().describe('Non-fatal warnings'), })); -export type ProvisionOrganizationResponse = z.infer; +export type ProvisionOrganizationResponse = z.input; /** Post-parse shape of {@link ProvisionOrganizationResponse} — defaults applied, transforms run (ADR-0122). */ export type ProvisionOrganizationResponseParsed = z.infer; diff --git a/packages/spec/src/cloud/marketplace-admin.zod.ts b/packages/spec/src/cloud/marketplace-admin.zod.ts index 550880504e..b25e810f4c 100644 --- a/packages/spec/src/cloud/marketplace-admin.zod.ts +++ b/packages/spec/src/cloud/marketplace-admin.zod.ts @@ -300,23 +300,23 @@ export const TrendingListingSchema = lazySchema(() => z.object({ // Export Types // ========================================== -export type ReviewCriterion = z.infer; +export type ReviewCriterion = z.input; /** Post-parse shape of {@link ReviewCriterion} — defaults applied, transforms run (ADR-0122). */ export type ReviewCriterionParsed = z.infer; -export type ReviewDecision = z.infer; -export type RejectionReason = z.infer; -export type SubmissionReview = z.infer; +export type ReviewDecision = z.input; +export type RejectionReason = z.input; +export type SubmissionReview = z.input; /** Post-parse shape of {@link SubmissionReview} — defaults applied, transforms run (ADR-0122). */ export type SubmissionReviewParsed = z.infer; -export type FeaturedListing = z.infer; +export type FeaturedListing = z.input; /** Post-parse shape of {@link FeaturedListing} — defaults applied, transforms run (ADR-0122). */ export type FeaturedListingParsed = z.infer; -export type CuratedCollection = z.infer; +export type CuratedCollection = z.input; /** Post-parse shape of {@link CuratedCollection} — defaults applied, transforms run (ADR-0122). */ export type CuratedCollectionParsed = z.infer; -export type PolicyViolationType = z.infer; -export type PolicyAction = z.infer; +export type PolicyViolationType = z.input; +export type PolicyAction = z.input; /** Post-parse shape of {@link PolicyAction} — defaults applied, transforms run (ADR-0122). */ export type PolicyActionParsed = z.infer; -export type MarketplaceHealthMetrics = z.infer; -export type TrendingListing = z.infer; +export type MarketplaceHealthMetrics = z.input; +export type TrendingListing = z.input; diff --git a/packages/spec/src/cloud/marketplace.zod.ts b/packages/spec/src/cloud/marketplace.zod.ts index 8ba9e84e20..22796c142b 100644 --- a/packages/spec/src/cloud/marketplace.zod.ts +++ b/packages/spec/src/cloud/marketplace.zod.ts @@ -118,7 +118,7 @@ export const ArtifactReferenceSchema = lazySchema(() => z.object({ uploadedAt: z.string().datetime().describe('Upload timestamp'), }).describe('Reference to a downloadable package artifact')); -export type ArtifactReference = z.infer; +export type ArtifactReference = z.input; /** Post-parse shape of {@link ArtifactReference} — defaults applied, transforms run (ADR-0122). */ export type ArtifactReferenceParsed = z.infer; @@ -146,7 +146,7 @@ export const ArtifactDownloadResponseSchema = lazySchema(() => z.object({ .describe('URL expiration timestamp for pre-signed URLs'), }).describe('Artifact download response with integrity metadata')); -export type ArtifactDownloadResponse = z.infer; +export type ArtifactDownloadResponse = z.input; // ========================================== // Marketplace Listing @@ -523,26 +523,26 @@ export const MarketplaceInstallResponseSchema = lazySchema(() => z.object({ // Export Types // ========================================== -export type PublisherVerification = z.infer; -export type Publisher = z.infer; +export type PublisherVerification = z.input; +export type Publisher = z.input; /** Post-parse shape of {@link Publisher} — defaults applied, transforms run (ADR-0122). */ export type PublisherParsed = z.infer; -export type MarketplaceCategory = z.infer; -export type ListingStatus = z.infer; -export type PricingModel = z.infer; -export type MarketplaceListing = z.infer; +export type MarketplaceCategory = z.input; +export type ListingStatus = z.input; +export type PricingModel = z.input; +export type MarketplaceListing = z.input; /** Post-parse shape of {@link MarketplaceListing} — defaults applied, transforms run (ADR-0122). */ export type MarketplaceListingParsed = z.infer; -export type PackageSubmission = z.infer; +export type PackageSubmission = z.input; /** Post-parse shape of {@link PackageSubmission} — defaults applied, transforms run (ADR-0122). */ export type PackageSubmissionParsed = z.infer; -export type MarketplaceSearchRequest = z.infer; +export type MarketplaceSearchRequest = z.input; /** Post-parse shape of {@link MarketplaceSearchRequest} — defaults applied, transforms run (ADR-0122). */ export type MarketplaceSearchRequestParsed = z.infer; -export type MarketplaceSearchResponse = z.infer; +export type MarketplaceSearchResponse = z.input; /** Post-parse shape of {@link MarketplaceSearchResponse} — defaults applied, transforms run (ADR-0122). */ export type MarketplaceSearchResponseParsed = z.infer; -export type MarketplaceInstallRequest = z.infer; +export type MarketplaceInstallRequest = z.input; /** Post-parse shape of {@link MarketplaceInstallRequest} — defaults applied, transforms run (ADR-0122). */ export type MarketplaceInstallRequestParsed = z.infer; -export type MarketplaceInstallResponse = z.infer; +export type MarketplaceInstallResponse = z.input; diff --git a/packages/spec/src/cloud/package-version.zod.ts b/packages/spec/src/cloud/package-version.zod.ts index 9672b99442..850557bf3e 100644 --- a/packages/spec/src/cloud/package-version.zod.ts +++ b/packages/spec/src/cloud/package-version.zod.ts @@ -35,7 +35,7 @@ export const PackageVersionStatusSchema = lazySchema(() => z .enum(['draft', 'published', 'deprecated']) .describe('Package version lifecycle status')); -export type PackageVersionStatus = z.infer; +export type PackageVersionStatus = z.input; // --------------------------------------------------------------------------- // Manifest content schemas (embedded in packageVersion.manifestJson) @@ -61,7 +61,7 @@ export const PackageDependencySchema = lazySchema(() => z.object({ optional: z.boolean().default(false).describe('Whether this dependency is optional'), }).describe('Package dependency declaration')); -export type PackageDependency = z.infer; +export type PackageDependency = z.input; /** Post-parse shape of {@link PackageDependency} — defaults applied, transforms run (ADR-0122). */ export type PackageDependencyParsed = z.infer; @@ -119,7 +119,7 @@ export const PackageManifestSchema = lazySchema(() => z.object({ metadata: z.record(z.string(), z.unknown()).optional().describe('Extension metadata'), }).describe('Package manifest snapshot embedded in a package version')); -export type PackageManifest = z.infer; +export type PackageManifest = z.input; /** Post-parse shape of {@link PackageManifest} — defaults applied, transforms run (ADR-0122). */ export type PackageManifestParsed = z.infer; @@ -188,7 +188,7 @@ export const PackageVersionSchema = lazySchema(() => z.object({ createdBy: z.string().describe('User ID that created this version'), })); -export type PackageVersion = z.infer; +export type PackageVersion = z.input; /** Post-parse shape of {@link PackageVersion} — defaults applied, transforms run (ADR-0122). */ export type PackageVersionParsed = z.infer; @@ -208,7 +208,7 @@ export const CreatePackageVersionRequestSchema = lazySchema(() => z.object({ createdBy: z.string().describe('User ID creating this version'), }).describe('Create a new draft package version')); -export type CreatePackageVersionRequest = z.infer; +export type CreatePackageVersionRequest = z.input; /** * Request to update a draft version's manifest before publishing. @@ -220,7 +220,7 @@ export const UpdatePackageVersionRequestSchema = lazySchema(() => z.object({ isPreRelease: z.boolean().optional(), }).describe('Update a draft package version (only while status is draft)')); -export type UpdatePackageVersionRequest = z.infer; +export type UpdatePackageVersionRequest = z.input; /** * Request to publish a draft version (seals manifestJson and checksum). @@ -229,4 +229,4 @@ export const PublishPackageVersionRequestSchema = lazySchema(() => z.object({ publishedBy: z.string().describe('User ID publishing this version'), }).describe('Publish a draft version — seals manifestJson and checksum')); -export type PublishPackageVersionRequest = z.infer; +export type PublishPackageVersionRequest = z.input; diff --git a/packages/spec/src/cloud/package.zod.ts b/packages/spec/src/cloud/package.zod.ts index 14fe2bf169..f7943dcf0c 100644 --- a/packages/spec/src/cloud/package.zod.ts +++ b/packages/spec/src/cloud/package.zod.ts @@ -32,7 +32,7 @@ export const PackageVisibilitySchema = lazySchema(() => z 'Package visibility: private = owner org only; org = all envs in owner org; marketplace = public registry' )); -export type PackageVisibility = z.infer; +export type PackageVisibility = z.input; /** * Category hint for marketplace discovery and filtering. @@ -43,7 +43,7 @@ export const PackageCategorySchema = lazySchema(() => z .min(1) .describe('Package category for marketplace discovery (e.g. "crm", "hr", "finance", "devtools")')); -export type PackageCategory = z.infer; +export type PackageCategory = z.input; /** * Provenance tier of a package publisher. @@ -59,7 +59,7 @@ export const PackagePublisherSchema = lazySchema(() => z .enum(['objectstack', 'partner', 'community', 'private']) .describe('Package publisher provenance tier')); -export type PackagePublisher = z.infer; +export type PackagePublisher = z.input; // --------------------------------------------------------------------------- // Per-locale translations for package listings @@ -77,7 +77,7 @@ export const PackageLocaleSchema = lazySchema(() => z .regex(/^[a-z]{2,3}(-[A-Z]{2})?$/, 'must be a BCP-47 locale (e.g. en, zh, zh-CN)') .describe('BCP-47 locale tag')); -export type PackageLocale = z.infer; +export type PackageLocale = z.input; /** * Per-locale overrides for a package's display metadata. @@ -123,7 +123,7 @@ export const PackageTranslationSchema = lazySchema(() => z.object({ .describe('Per-index screenshot caption overrides'), }).describe('Per-locale overrides for a package listing')); -export type PackageTranslation = z.infer; +export type PackageTranslation = z.input; /** * Locale-keyed translation map. @@ -140,7 +140,7 @@ export const PackageTranslationsSchema = lazySchema(() => z .record(PackageLocaleSchema, PackageTranslationSchema) .describe('Locale-keyed overrides; missing keys fall back to base columns')); -export type PackageTranslations = z.infer; +export type PackageTranslations = z.input; // --------------------------------------------------------------------------- // sys_package — Package identity @@ -238,7 +238,7 @@ export const PackageSchema = lazySchema(() => z.object({ createdBy: z.string().describe('User ID that created the package'), })); -export type Package = z.infer; +export type Package = z.input; /** Post-parse shape of {@link Package} — defaults applied, transforms run (ADR-0122). */ export type PackageParsed = z.infer; @@ -266,7 +266,7 @@ export const CreatePackageRequestSchema = lazySchema(() => z.object({ createdBy: z.string().describe('User ID creating the package'), }).describe('Register a new package in the Control Plane')); -export type CreatePackageRequest = z.infer; +export type CreatePackageRequest = z.input; /** * Request to update mutable package metadata (visibility, description, tags…). @@ -287,4 +287,4 @@ export const UpdatePackageRequestSchema = lazySchema(() => z.object({ translations: PackageTranslationsSchema.optional(), }).describe('Update mutable package metadata')); -export type UpdatePackageRequest = z.infer; +export type UpdatePackageRequest = z.input; diff --git a/packages/spec/src/cloud/template-manifest.zod.ts b/packages/spec/src/cloud/template-manifest.zod.ts index 058703ba48..34f41956fc 100644 --- a/packages/spec/src/cloud/template-manifest.zod.ts +++ b/packages/spec/src/cloud/template-manifest.zod.ts @@ -32,4 +32,4 @@ export const TemplateManifestSchema = lazySchema(() => .describe('objectstack.manifest.json — template / package source descriptor') ); -export type TemplateManifest = z.infer; +export type TemplateManifest = z.input; diff --git a/packages/spec/src/cloud/tenant.zod.ts b/packages/spec/src/cloud/tenant.zod.ts index 8542a2cf63..adff8d6e34 100644 --- a/packages/spec/src/cloud/tenant.zod.ts +++ b/packages/spec/src/cloud/tenant.zod.ts @@ -27,7 +27,7 @@ export const TenantDatabaseStatusSchema = lazySchema(() => z.enum([ 'failed', // Provisioning or migration failed ])); -export type TenantDatabaseStatus = z.infer; +export type TenantDatabaseStatus = z.input; /** * Tenant Plan Tier @@ -40,7 +40,7 @@ export const TenantPlanSchema = lazySchema(() => z.enum([ 'custom', ])); -export type TenantPlan = z.infer; +export type TenantPlan = z.input; /** * Tenant Database Registry Entry @@ -126,7 +126,7 @@ export const TenantDatabaseSchema = lazySchema(() => z.object({ metadata: z.record(z.string(), z.unknown()).optional().describe('Custom tenant configuration'), })); -export type TenantDatabase = z.infer; +export type TenantDatabase = z.input; /** Post-parse shape of {@link TenantDatabase} — defaults applied, transforms run (ADR-0122). */ export type TenantDatabaseParsed = z.infer; @@ -141,7 +141,7 @@ export const PackageInstallationStatusSchema = lazySchema(() => z.enum([ 'failed', // Installation failed ])); -export type PackageInstallationStatus = z.infer; +export type PackageInstallationStatus = z.input; /** * Package Installation Record @@ -197,7 +197,7 @@ export const PackageInstallationSchema = lazySchema(() => z.object({ updatedAt: z.string().datetime().describe('Last update timestamp'), })); -export type PackageInstallation = z.infer; +export type PackageInstallation = z.input; /** Post-parse shape of {@link PackageInstallation} — defaults applied, transforms run (ADR-0122). */ export type PackageInstallationParsed = z.infer; @@ -239,7 +239,7 @@ export const TenantContextSchema = lazySchema(() => z.object({ metadata: z.record(z.string(), z.unknown()).optional().describe('Custom tenant metadata'), })); -export type TenantContext = z.infer; +export type TenantContext = z.input; /** * Tenant Identification Source @@ -255,7 +255,7 @@ export const TenantIdentificationSourceSchema = lazySchema(() => z.enum([ 'default', // Default/fallback tenant ])); -export type TenantIdentificationSource = z.infer; +export type TenantIdentificationSource = z.input; /** * Tenant Routing Configuration @@ -306,7 +306,7 @@ export const TenantRoutingConfigSchema = lazySchema(() => z.object({ .describe('JWT claim name for organization ID'), })); -export type TenantRoutingConfig = z.infer; +export type TenantRoutingConfig = z.input; /** Post-parse shape of {@link TenantRoutingConfig} — defaults applied, transforms run (ADR-0122). */ export type TenantRoutingConfigParsed = z.infer; @@ -342,7 +342,7 @@ export const ProvisionTenantRequestSchema = lazySchema(() => z.object({ metadata: z.record(z.string(), z.unknown()).optional().describe('Custom tenant metadata'), })); -export type ProvisionTenantRequest = z.infer; +export type ProvisionTenantRequest = z.input; /** Post-parse shape of {@link ProvisionTenantRequest} — defaults applied, transforms run (ADR-0122). */ export type ProvisionTenantRequestParsed = z.infer; @@ -368,6 +368,6 @@ export const ProvisionTenantResponseSchema = lazySchema(() => z.object({ warnings: z.array(z.string()).optional().describe('Provisioning warnings'), })); -export type ProvisionTenantResponse = z.infer; +export type ProvisionTenantResponse = z.input; /** Post-parse shape of {@link ProvisionTenantResponse} — defaults applied, transforms run (ADR-0122). */ export type ProvisionTenantResponseParsed = z.infer; diff --git a/packages/spec/src/contracts/analytics-service.ts b/packages/spec/src/contracts/analytics-service.ts index 672bb615b7..1f87905315 100644 --- a/packages/spec/src/contracts/analytics-service.ts +++ b/packages/spec/src/contracts/analytics-service.ts @@ -32,7 +32,7 @@ import type { Dataset } from '../ui/dataset.zod.js'; * #1982/#2018) — so what a caller authors is exactly what an executor * receives. */ -export type { AnalyticsQuery, AnalyticsQueryInput } from '../data/analytics.zod.js'; +export type { AnalyticsQuery } from '../data/analytics.zod.js'; /** * Analytics query result diff --git a/packages/spec/src/contracts/app-lifecycle-service.test.ts b/packages/spec/src/contracts/app-lifecycle-service.test.ts index 78a2ba8bfd..2561741940 100644 --- a/packages/spec/src/contracts/app-lifecycle-service.test.ts +++ b/packages/spec/src/contracts/app-lifecycle-service.test.ts @@ -100,8 +100,8 @@ describe('App Lifecycle Service Contract', () => { success: true, appId: manifest.name, version: manifest.version, - installedObjects: manifest.objects, - createdTables: manifest.objects.map(o => `app_${o}`), + installedObjects: manifest.objects ?? [], + createdTables: (manifest.objects ?? []).map(o => `app_${o}`), seededRecords: manifest.hasSeedData ? 50 : 0, durationMs: 2300, }; @@ -142,7 +142,7 @@ describe('App Lifecycle Service Contract', () => { success: true, appId: manifest.name, version: manifest.version, - installedObjects: manifest.objects, + installedObjects: manifest.objects ?? [], createdTables: [], seededRecords: 0, durationMs: 1100, diff --git a/packages/spec/src/contracts/app-lifecycle-service.ts b/packages/spec/src/contracts/app-lifecycle-service.ts index ff926e70d9..d90517f0d7 100644 --- a/packages/spec/src/contracts/app-lifecycle-service.ts +++ b/packages/spec/src/contracts/app-lifecycle-service.ts @@ -13,7 +13,7 @@ * 4. Registers metadata (objects, views, flows) in the tenant registry */ -import type { AppManifest, AppCompatibilityCheck, AppInstallResult } from '../system/app-install.zod.js'; +import type { AppManifest, AppCompatibilityCheckParsed, AppInstallResult } from '../system/app-install.zod.js'; // ========================================================================== // Service Interface @@ -28,7 +28,7 @@ export interface IAppLifecycleService { * @param manifest - App manifest to check * @returns Compatibility check result */ - checkCompatibility(tenantId: string, manifest: AppManifest): Promise; + checkCompatibility(tenantId: string, manifest: AppManifest): Promise; /** * Install an app into a tenant's database. diff --git a/packages/spec/src/contracts/data-engine.ts b/packages/spec/src/contracts/data-engine.ts index 12a34cfe8c..2cb9128c48 100644 --- a/packages/spec/src/contracts/data-engine.ts +++ b/packages/spec/src/contracts/data-engine.ts @@ -2,7 +2,7 @@ import { BaseEngineOptions, - EngineQueryOptions, + EngineQueryOptionsParsed, DataEngineInsertOptions, EngineUpdateOptions, EngineDeleteOptions, @@ -118,7 +118,7 @@ export interface IDataEngine { * exactly the erasure this issue is sweeping. `query.context` remains * supported; when both are given, `options.context` wins. */ - find(objectName: string, query?: EngineQueryOptions, options?: BaseEngineOptions): Promise; + find(objectName: string, query?: EngineQueryOptionsParsed, options?: BaseEngineOptions): Promise; /** * Read the ONE record the query selects, or `null`. * @@ -133,7 +133,7 @@ export interface IDataEngine { * No ordering is imposed when the caller supplies none: `findOne` promises * *a* matching record, never a position in a sequence (#4363). */ - findOne(objectName: string, query?: EngineQueryOptions, options?: BaseEngineOptions): Promise; + findOne(objectName: string, query?: EngineQueryOptionsParsed, options?: BaseEngineOptions): Promise; insert(objectName: string, data: any | any[], options?: DataEngineInsertOptions & WriteObservabilityOptions): Promise; update(objectName: string, data: any, options?: EngineUpdateOptions & WriteObservabilityOptions): Promise; delete(objectName: string, options?: EngineDeleteOptions): Promise; diff --git a/packages/spec/src/contracts/deploy-pipeline-service.test.ts b/packages/spec/src/contracts/deploy-pipeline-service.test.ts index 70420f6a18..647cd88309 100644 --- a/packages/spec/src/contracts/deploy-pipeline-service.test.ts +++ b/packages/spec/src/contracts/deploy-pipeline-service.test.ts @@ -84,7 +84,7 @@ describe('Deploy Pipeline Service Contract', () => { deploymentId: `deploy_${++counter}`, status: 'ready', durationMs: 1500, - statementsExecuted: plan.statements.length, + statementsExecuted: plan.statements?.length ?? 0, completedAt: new Date().toISOString(), }; deployments.set(result.deploymentId, result); diff --git a/packages/spec/src/contracts/seed-loader-service.test.ts b/packages/spec/src/contracts/seed-loader-service.test.ts index a3cc09e575..affe14afd0 100644 --- a/packages/spec/src/contracts/seed-loader-service.test.ts +++ b/packages/spec/src/contracts/seed-loader-service.test.ts @@ -2,13 +2,17 @@ import { describe, it, expect } from 'vitest'; import type { ISeedLoaderService } from './seed-loader-service'; -import type { SeedLoaderRequest, SeedLoaderResult, ObjectDependencyGraph } from '../data/seed-loader.zod'; +import type { + SeedLoaderRequestParsed, + SeedLoaderResultParsed, + ObjectDependencyGraphParsed, +} from '../data/seed-loader.zod'; import type { Seed } from '../data/seed.zod'; describe('Seed Loader Service Contract', () => { it('should allow a minimal implementation with required methods', () => { const service: ISeedLoaderService = { - load: async (_request: SeedLoaderRequest): Promise => { + load: async (_request: SeedLoaderRequestParsed): Promise => { return { success: true, dryRun: false, @@ -24,15 +28,17 @@ describe('Seed Loader Service Contract', () => { totalErrored: 0, totalReferencesResolved: 0, totalReferencesDeferred: 0, + totalReferencesDropped: 0, + totalSummariesStale: 0, circularDependencyCount: 0, durationMs: 0, }, }; }, - buildDependencyGraph: async (_objectNames: string[]): Promise => { + buildDependencyGraph: async (_objectNames: string[]): Promise => { return { nodes: [], insertOrder: [], circularDependencies: [] }; }, - validate: async (_datasets: Seed[]): Promise => { + validate: async (_datasets: Seed[]): Promise => { return { success: true, dryRun: true, @@ -48,6 +54,8 @@ describe('Seed Loader Service Contract', () => { totalErrored: 0, totalReferencesResolved: 0, totalReferencesDeferred: 0, + totalReferencesDropped: 0, + totalSummariesStale: 0, circularDependencyCount: 0, durationMs: 0, }, @@ -77,6 +85,8 @@ describe('Seed Loader Service Contract', () => { totalErrored: 0, totalReferencesResolved: 0, totalReferencesDeferred: 0, + totalReferencesDropped: 0, + totalSummariesStale: 0, circularDependencyCount: 0, durationMs: 42, }, @@ -91,7 +101,8 @@ describe('Seed Loader Service Contract', () => { summary: { objectsProcessed: 0, totalRecords: 0, totalInserted: 0, totalUpdated: 0, totalSkipped: 0, totalErrored: 0, totalReferencesResolved: 0, - totalReferencesDeferred: 0, circularDependencyCount: 0, durationMs: 0, + totalReferencesDeferred: 0, totalReferencesDropped: 0, totalSummariesStale: 0, + circularDependencyCount: 0, durationMs: 0, }, }), }; diff --git a/packages/spec/src/contracts/seed-loader-service.ts b/packages/spec/src/contracts/seed-loader-service.ts index 6c456d6047..ec5cb20bf7 100644 --- a/packages/spec/src/contracts/seed-loader-service.ts +++ b/packages/spec/src/contracts/seed-loader-service.ts @@ -1,10 +1,10 @@ // Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license. import type { - SeedLoaderRequest, - SeedLoaderResult, - SeedLoaderConfigInput, - ObjectDependencyGraph, + SeedLoaderRequestParsed, + SeedLoaderResultParsed, + SeedLoaderConfig, + ObjectDependencyGraphParsed, } from '../data/seed-loader.zod.js'; import type { Seed } from '../data/seed.zod.js'; @@ -39,7 +39,7 @@ export interface ISeedLoaderService { * @param request - Parsed SeedLoaderRequest (datasets + config) * @returns Structured result with per-object stats, errors, and summary */ - load(request: SeedLoaderRequest): Promise; + load(request: SeedLoaderRequestParsed): Promise; /** * Build the object dependency graph from metadata for the given object names. @@ -48,7 +48,7 @@ export interface ISeedLoaderService { * @param objectNames - Object names to include in the graph * @returns Dependency graph with topological insert order and circular dependency detection */ - buildDependencyGraph(objectNames: string[]): Promise; + buildDependencyGraph(objectNames: string[]): Promise; /** * Validate datasets without writing any data (equivalent to config.dryRun = true). @@ -58,5 +58,5 @@ export interface ISeedLoaderService { * @param config - Optional loader config overrides * @returns Structured result with validation errors (no data written) */ - validate(datasets: Seed[], config?: SeedLoaderConfigInput): Promise; + validate(datasets: Seed[], config?: SeedLoaderConfig): Promise; } diff --git a/packages/spec/src/contracts/startup-orchestrator.test.ts b/packages/spec/src/contracts/startup-orchestrator.test.ts index 489667f59e..6ed362c031 100644 --- a/packages/spec/src/contracts/startup-orchestrator.test.ts +++ b/packages/spec/src/contracts/startup-orchestrator.test.ts @@ -1,7 +1,7 @@ import { describe, it, expect } from 'vitest'; import type { StartupOptions, - StartupOptionsInput, + StartupOptionsParsed, PluginStartupResult, HealthStatus, IStartupOrchestrator, @@ -14,7 +14,7 @@ import type { Plugin } from './plugin-validator'; describe('Startup Orchestrator Contract', () => { describe('StartupOptions tiers (re-exported kernel zod types, #4538)', () => { it('should allow an empty INPUT-tier options object (all optional)', () => { - const options: StartupOptionsInput = {}; + const options: StartupOptions = {}; expect(options).toBeDefined(); expect(options.timeout).toBeUndefined(); @@ -22,7 +22,7 @@ describe('Startup Orchestrator Contract', () => { }); it('parses the input tier into the defaulted StartupOptions tier', () => { - const parsed: StartupOptions = StartupOptionsSchema.parse({}); + const parsed: StartupOptionsParsed = StartupOptionsSchema.parse({}); expect(parsed.timeout).toBe(30000); expect(parsed.rollbackOnFailure).toBe(true); @@ -31,7 +31,7 @@ describe('Startup Orchestrator Contract', () => { }); it('should allow full options', () => { - const options: StartupOptionsInput = { + const options: StartupOptions = { timeout: 30000, rollbackOnFailure: true, healthCheck: true, diff --git a/packages/spec/src/contracts/startup-orchestrator.ts b/packages/spec/src/contracts/startup-orchestrator.ts index bae8dd96a8..a4f1413b0f 100644 --- a/packages/spec/src/contracts/startup-orchestrator.ts +++ b/packages/spec/src/contracts/startup-orchestrator.ts @@ -11,13 +11,13 @@ import { Plugin } from './plugin-validator.js'; import type { HealthStatus, PluginStartupResult, - StartupOptionsInput, + StartupOptions, } from '../kernel/startup-orchestrator.zod'; export type { HealthStatus, PluginStartupResult, StartupOptions, - StartupOptionsInput, + StartupOptionsParsed, } from '../kernel/startup-orchestrator.zod'; /** @@ -46,7 +46,7 @@ export interface IStartupOrchestrator { */ orchestrateStartup( plugins: Plugin[], - options: StartupOptionsInput + options: StartupOptions ): Promise; /** diff --git a/packages/spec/src/data/analytics.zod.ts b/packages/spec/src/data/analytics.zod.ts index 8811ab567d..7625634f8a 100644 --- a/packages/spec/src/data/analytics.zod.ts +++ b/packages/spec/src/data/analytics.zod.ts @@ -180,37 +180,22 @@ export const AnalyticsQuerySchema = lazySchema(() => z.object({ timezone: z.string().optional(), })); -export type Metric = z.infer; -export type Dimension = z.infer; -export type CubeJoin = z.infer; +export type Metric = z.input; +export type Dimension = z.input; +export type CubeJoin = z.input; /** Post-parse shape of {@link CubeJoin} — defaults applied, transforms run (ADR-0122). */ export type CubeJoinParsed = z.infer; -export type Cube = z.infer; +export type Cube = z.input; /** Post-parse shape of {@link Cube} — defaults applied, transforms run (ADR-0122). */ export type CubeParsed = z.infer; -/** Authoring input for {@link Cube} — defaulted fields are optional. */ -export type CubeInput = z.input; /** * Type-safe factory for an analytics semantic-layer cube. Validates at authoring time via * `.parse()` and accepts input-shape config (optional defaults, CEL * shorthand) — preferred over a bare `: Cube` literal. */ -export function defineCube(config: z.input): Cube { +export function defineCube(config: z.input): CubeParsed { return CubeSchema.parse(config); } -export type AnalyticsQuery = z.infer; +export type AnalyticsQuery = z.input; -/** - * Input-tier alias of {@link AnalyticsQuery}. - * - * [#4538] The two tiers COLLAPSED when `timezone` lost its `.default('UTC')` - * (see the field's own note): the schema now carries no `.default()` or - * `.transform()` anywhere — `FilterCondition` is declared transform-free — - * so what a caller writes is exactly what an executor receives, and this - * name survives only for source compatibility. `IAnalyticsService.query`, - * the analytics strategies, and the `/analytics` entry all traffic in the - * single {@link AnalyticsQuery} shape (validated at the entry by - * `AnalyticsQueryRequestSchema`, forwarded unmodified). - */ -export type AnalyticsQueryInput = z.input; diff --git a/packages/spec/src/data/data-engine.zod.ts b/packages/spec/src/data/data-engine.zod.ts index a82a091412..447a87ef89 100644 --- a/packages/spec/src/data/data-engine.zod.ts +++ b/packages/spec/src/data/data-engine.zod.ts @@ -735,35 +735,35 @@ export const DataEngineRequestSchema = lazySchema(() => z.discriminatedUnion('me * it sat unused under the "legacy/deprecated" heading below, which is why the * contract went looking for it and did not find it.) */ -export type BaseEngineOptions = z.infer; -export type EngineQueryOptions = z.infer; +export type BaseEngineOptions = z.input; +export type EngineQueryOptions = z.input; /** Post-parse shape of {@link EngineQueryOptions} — defaults applied, transforms run (ADR-0122). */ export type EngineQueryOptionsParsed = z.infer; -export type EngineUpdateOptions = z.infer; -export type DroppedFieldsEvent = z.infer; -export type EngineDeleteOptions = z.infer; -export type EngineAggregateOptions = z.infer; -export type EngineCountOptions = z.infer; +export type EngineUpdateOptions = z.input; +export type DroppedFieldsEvent = z.input; +export type EngineDeleteOptions = z.input; +export type EngineAggregateOptions = z.input; +export type EngineCountOptions = z.input; // --- Legacy: deprecated types (kept for backward compatibility) --- -export type DataEngineFilter = z.infer; +export type DataEngineFilter = z.input; /** @deprecated Use standard `SortNode[]` from QueryAST instead. */ -export type DataEngineSort = z.infer; +export type DataEngineSort = z.input; /** Post-parse shape of {@link DataEngineSort} — defaults applied, transforms run (ADR-0122). */ export type DataEngineSortParsed = z.infer; /** @deprecated Use `EngineQueryOptions` instead. */ -export type DataEngineQueryOptions = z.infer; +export type DataEngineQueryOptions = z.input; /** Post-parse shape of {@link DataEngineQueryOptions} — defaults applied, transforms run (ADR-0122). */ export type DataEngineQueryOptionsParsed = z.infer; -export type DataEngineInsertOptions = z.infer; +export type DataEngineInsertOptions = z.input; /** @deprecated Use `EngineUpdateOptions` instead. */ -export type DataEngineUpdateOptions = z.infer; +export type DataEngineUpdateOptions = z.input; /** @deprecated Use `EngineDeleteOptions` instead. */ -export type DataEngineDeleteOptions = z.infer; +export type DataEngineDeleteOptions = z.input; /** @deprecated Use `EngineAggregateOptions` instead. */ -export type DataEngineAggregateOptions = z.infer; +export type DataEngineAggregateOptions = z.input; /** @deprecated Use `EngineCountOptions` instead. */ -export type DataEngineCountOptions = z.infer; -export type DataEngineRequest = z.infer; +export type DataEngineCountOptions = z.input; +export type DataEngineRequest = z.input; /** Post-parse shape of {@link DataEngineRequest} — defaults applied, transforms run (ADR-0122). */ export type DataEngineRequestParsed = z.infer; diff --git a/packages/spec/src/data/datasource.zod.ts b/packages/spec/src/data/datasource.zod.ts index c9a170e878..da529cadcc 100644 --- a/packages/spec/src/data/datasource.zod.ts +++ b/packages/spec/src/data/datasource.zod.ts @@ -2,7 +2,6 @@ import { z } from 'zod'; - /** * Driver Identifier * Can be a built-in driver or a plugin-contributed driver (e.g., "com.vendor.snowflake"). @@ -321,7 +320,6 @@ const poolUnknownKeyError = strictUnknownKeyError({ + 'no matter what was written. Note both timeouts end in `Millis`, not `Ms`.', }); - const sslUnknownKeyError = strictUnknownKeyError({ surface: "this datasource's ssl config", knownKeys: SSL_KEYS, @@ -346,9 +344,6 @@ const sslUnknownKeyError = strictUnknownKeyError({ + 'effect looked identical to one that did.', }); - - - export const DriverType = z.string().describe('Underlying driver identifier'); /** @@ -382,8 +377,7 @@ export const DriverDefinitionSchema = lazySchema(() => z.object({ }, { error: driverDefinitionUnknownKeyError }).strict()); /** A driver definition — {@link DriverDefinitionSchema}'s parsed shape. */ -export type DriverDefinition = z.infer; - +export type DriverDefinition = z.input; /** * Schema Ownership Mode (ADR-0015) @@ -400,7 +394,7 @@ export const SchemaModeSchema = z .enum(['managed', 'external', 'validate-only']) .describe('Schema ownership mode'); -export type SchemaMode = z.infer; +export type SchemaMode = z.input; /** * External Datasource Settings (ADR-0015) @@ -430,7 +424,7 @@ export const ExternalDatasourceSettingsSchema = z.object({ }, { error: externalSettingsUnknownKeyError }).strict() .describe('External datasource federation settings (schemaMode != "managed")'); -export type ExternalDatasourceSettings = z.infer; +export type ExternalDatasourceSettings = z.input; /** Post-parse shape of {@link ExternalDatasourceSettings} — defaults applied, transforms run (ADR-0122). */ export type ExternalDatasourceSettingsParsed = z.infer; @@ -509,7 +503,6 @@ export const DatasourceSchema = lazySchema(() => z.object({ key: z.string().optional().describe('Client private key (PEM format or path to file)'), }, { error: sslUnknownKeyError }).strict().optional().describe('SSL/TLS configuration for secure database connections'), - /** Description */ description: z.string().optional().describe('Internal description'), @@ -590,17 +583,15 @@ export const DatasourceSchema = lazySchema(() => z.object({ } })); -export type Datasource = z.infer; +export type Datasource = z.input; /** Post-parse shape of {@link Datasource} — defaults applied, transforms run (ADR-0122). */ export type DatasourceParsed = z.infer; -/** Authoring input for {@link Datasource} — defaulted fields are optional. */ -export type DatasourceInput = z.input; /** * Type-safe factory for an external data connection (datasource). Validates at authoring time via * `.parse()` and accepts input-shape config (optional defaults, CEL * shorthand) — preferred over a bare `: Datasource` literal. */ -export function defineDatasource(config: z.input): Datasource { +export function defineDatasource(config: z.input): DatasourceParsed { return DatasourceSchema.parse(config); } diff --git a/packages/spec/src/data/document.zod.ts b/packages/spec/src/data/document.zod.ts index c9a003525b..b1fe0ab42b 100644 --- a/packages/spec/src/data/document.zod.ts +++ b/packages/spec/src/data/document.zod.ts @@ -367,15 +367,15 @@ export const DocumentSchema = lazySchema(() => z.object({ })); // Type exports -export type Document = z.infer; +export type Document = z.input; /** Post-parse shape of {@link Document} — defaults applied, transforms run (ADR-0122). */ export type DocumentParsed = z.infer; -export type DocumentVersion = z.infer; +export type DocumentVersion = z.input; /** Post-parse shape of {@link DocumentVersion} — defaults applied, transforms run (ADR-0122). */ export type DocumentVersionParsed = z.infer; -export type DocumentTemplate = z.infer; +export type DocumentTemplate = z.input; /** Post-parse shape of {@link DocumentTemplate} — defaults applied, transforms run (ADR-0122). */ export type DocumentTemplateParsed = z.infer; -export type ESignatureConfig = z.infer; +export type ESignatureConfig = z.input; /** Post-parse shape of {@link ESignatureConfig} — defaults applied, transforms run (ADR-0122). */ export type ESignatureConfigParsed = z.infer; diff --git a/packages/spec/src/data/driver-nosql.zod.ts b/packages/spec/src/data/driver-nosql.zod.ts index d060813eb1..b625f27362 100644 --- a/packages/spec/src/data/driver-nosql.zod.ts +++ b/packages/spec/src/data/driver-nosql.zod.ts @@ -19,7 +19,7 @@ export const NoSQLDatabaseTypeSchema = lazySchema(() => z.enum([ 'orientdb', ])); -export type NoSQLDatabaseType = z.infer; +export type NoSQLDatabaseType = z.input; /** * NoSQL Query Operation Types @@ -39,7 +39,7 @@ export const NoSQLOperationTypeSchema = lazySchema(() => z.enum([ 'dropIndex', // Drop index ])); -export type NoSQLOperationType = z.infer; +export type NoSQLOperationType = z.input; /** * NoSQL Consistency Level @@ -62,7 +62,7 @@ export const ConsistencyLevelSchema = lazySchema(() => z.enum([ 'eventual', ])); -export type ConsistencyLevel = z.infer; +export type ConsistencyLevel = z.input; /** * NoSQL Index Type @@ -79,7 +79,7 @@ export const NoSQLIndexTypeSchema = lazySchema(() => z.enum([ 'sparse', // Sparse index (only indexed documents with field) ])); -export type NoSQLIndexType = z.infer; +export type NoSQLIndexType = z.input; /** * NoSQL Sharding Configuration @@ -92,7 +92,7 @@ export const ShardingConfigSchema = lazySchema(() => z.object({ numShards: z.number().int().positive().optional().describe('Number of shards'), })); -export type ShardingConfig = z.infer; +export type ShardingConfig = z.input; /** Post-parse shape of {@link ShardingConfig} — defaults applied, transforms run (ADR-0122). */ export type ShardingConfigParsed = z.infer; @@ -112,7 +112,7 @@ export const ReplicationConfigSchema = lazySchema(() => z.object({ .describe('Write concern level'), })); -export type ReplicationConfig = z.infer; +export type ReplicationConfig = z.input; /** Post-parse shape of {@link ReplicationConfig} — defaults applied, transforms run (ADR-0122). */ export type ReplicationConfigParsed = z.infer; @@ -127,7 +127,7 @@ export const DocumentSchemaValidationSchema = lazySchema(() => z.object({ jsonSchema: z.record(z.string(), z.unknown()).optional().describe('JSON Schema for validation'), })); -export type DocumentSchemaValidation = z.infer; +export type DocumentSchemaValidation = z.input; /** Post-parse shape of {@link DocumentSchemaValidation} — defaults applied, transforms run (ADR-0122). */ export type DocumentSchemaValidationParsed = z.infer; @@ -163,7 +163,7 @@ export const NoSQLDataTypeMappingSchema = lazySchema(() => z.object({ geopoint: z.string().optional().describe('NoSQL type for geospatial point fields'), })); -export type NoSQLDataTypeMapping = z.infer; +export type NoSQLDataTypeMapping = z.input; /** * NoSQL Driver Configuration Schema @@ -280,7 +280,7 @@ export const NoSQLDriverConfigSchema = lazySchema(() => DriverConfigSchema.exten collectionPrefix: z.string().optional().describe('Prefix for collection/table names'), })); -export type NoSQLDriverConfig = z.infer; +export type NoSQLDriverConfig = z.input; /** Post-parse shape of {@link NoSQLDriverConfig} — defaults applied, transforms run (ADR-0122). */ export type NoSQLDriverConfigParsed = z.infer; @@ -330,7 +330,7 @@ export const NoSQLQueryOptionsSchema = lazySchema(() => z.object({ hint: z.string().optional().describe('Index hint for query optimization'), })); -export type NoSQLQueryOptions = z.infer; +export type NoSQLQueryOptions = z.input; /** * NoSQL Aggregation Pipeline Stage @@ -348,7 +348,7 @@ export const AggregationStageSchema = lazySchema(() => z.object({ options: z.record(z.string(), z.unknown()).describe('Stage-specific options'), })); -export type AggregationStage = z.infer; +export type AggregationStage = z.input; /** * NoSQL Aggregation Pipeline @@ -371,7 +371,7 @@ export const AggregationPipelineSchema = lazySchema(() => z.object({ options: NoSQLQueryOptionsSchema.optional().describe('Query options'), })); -export type AggregationPipeline = z.infer; +export type AggregationPipeline = z.input; /** * NoSQL Index Definition @@ -423,7 +423,7 @@ export const NoSQLIndexSchema = lazySchema(() => z.object({ background: z.boolean().default(false).describe('Create index in background'), })); -export type NoSQLIndex = z.infer; +export type NoSQLIndex = z.input; /** Post-parse shape of {@link NoSQLIndex} — defaults applied, transforms run (ADR-0122). */ export type NoSQLIndexParsed = z.infer; @@ -455,4 +455,4 @@ export const NoSQLTransactionOptionsSchema = lazySchema(() => z.object({ maxCommitTimeMS: z.number().int().positive().optional().describe('Transaction commit timeout (ms)'), })); -export type NoSQLTransactionOptions = z.infer; +export type NoSQLTransactionOptions = z.input; diff --git a/packages/spec/src/data/driver-sql.zod.ts b/packages/spec/src/data/driver-sql.zod.ts index 3109b7fd73..e35d89f431 100644 --- a/packages/spec/src/data/driver-sql.zod.ts +++ b/packages/spec/src/data/driver-sql.zod.ts @@ -17,7 +17,7 @@ export const SQLDialectSchema = lazySchema(() => z.enum([ 'mariadb', ])); -export type SQLDialect = z.infer; +export type SQLDialect = z.input; /** * Data Type Mapping Schema @@ -46,7 +46,7 @@ export const DataTypeMappingSchema = lazySchema(() => z.object({ binary: z.string().optional().describe('SQL type for binary fields (e.g., BLOB, BYTEA)'), })); -export type DataTypeMapping = z.infer; +export type DataTypeMapping = z.input; /** * SSL Configuration Schema @@ -74,7 +74,7 @@ export const SSLConfigSchema = lazySchema(() => z.object({ message: 'Client certificate (cert) and private key (key) must be provided together', })); -export type SSLConfig = z.infer; +export type SSLConfig = z.input; /** Post-parse shape of {@link SSLConfig} — defaults applied, transforms run (ADR-0122). */ export type SSLConfigParsed = z.infer; @@ -135,7 +135,7 @@ export const SQLDriverConfigSchema = lazySchema(() => DriverConfigSchema.extend( message: 'sslConfig is required when ssl is true', })); -export type SQLDriverConfig = z.infer; +export type SQLDriverConfig = z.input; /** Post-parse shape of {@link SQLDriverConfig} — defaults applied, transforms run (ADR-0122). */ export type SQLDriverConfigParsed = z.infer; diff --git a/packages/spec/src/data/driver.zod.ts b/packages/spec/src/data/driver.zod.ts index 46a7bdd35b..88e94f53cf 100644 --- a/packages/spec/src/data/driver.zod.ts +++ b/packages/spec/src/data/driver.zod.ts @@ -737,14 +737,14 @@ export const DriverConfigSchema = lazySchema(() => z.object({ /** * TypeScript types */ -export type DriverOptions = z.infer; -export type DriverCapabilities = z.infer; -export type DriverInterface = z.infer; +export type DriverOptions = z.input; +export type DriverCapabilities = z.input; +export type DriverInterface = z.input; /** Post-parse shape of {@link DriverInterface} — defaults applied, transforms run (ADR-0122). */ export type DriverInterfaceParsed = z.infer; -export type DriverConfig = z.infer; +export type DriverConfig = z.input; /** Post-parse shape of {@link DriverConfig} — defaults applied, transforms run (ADR-0122). */ export type DriverConfigParsed = z.infer; -export type PoolConfig = z.infer; +export type PoolConfig = z.input; /** Post-parse shape of {@link PoolConfig} — defaults applied, transforms run (ADR-0122). */ export type PoolConfigParsed = z.infer; diff --git a/packages/spec/src/data/driver/common.zod.ts b/packages/spec/src/data/driver/common.zod.ts index fbb7646512..adda9ef766 100644 --- a/packages/spec/src/data/driver/common.zod.ts +++ b/packages/spec/src/data/driver/common.zod.ts @@ -29,7 +29,7 @@ import { z } from 'zod'; export const SqlAutoMigrateSchema = z.enum(['off', 'safe']) .describe('Dev-only non-destructive schema self-heal (#2186)'); -export type SqlAutoMigrate = z.infer; +export type SqlAutoMigrate = z.input; /** * `schemaMode` written inside `config`. Shared by every SQL driver: the factory diff --git a/packages/spec/src/data/driver/memory.zod.ts b/packages/spec/src/data/driver/memory.zod.ts index 7ec33ffb0b..e445611d3c 100644 --- a/packages/spec/src/data/driver/memory.zod.ts +++ b/packages/spec/src/data/driver/memory.zod.ts @@ -44,7 +44,7 @@ export const PersistenceAdapterSchema = lazySchema(() => z.object({ flush: z.function().describe('Flush pending writes and ensure data is persisted. Returns Promise'), }).describe('Custom persistence adapter interface')); -export type PersistenceAdapter = z.infer; +export type PersistenceAdapter = z.input; /** * Persistence type enum. @@ -56,7 +56,7 @@ export type PersistenceAdapter = z.infer; */ export const PersistenceTypeSchema = lazySchema(() => z.enum(['file', 'local', 'auto']).describe('Persistence backend type')); -export type PersistenceType = z.infer; +export type PersistenceType = z.input; /** * File-system persistence configuration. @@ -70,7 +70,7 @@ export const FilePersistenceConfigSchema = lazySchema(() => z.object({ autoSaveInterval: z.number().min(100).default(2000).describe('Auto-save interval in ms'), }).describe('File-system persistence configuration')); -export type FilePersistenceConfig = z.infer; +export type FilePersistenceConfig = z.input; /** Post-parse shape of {@link FilePersistenceConfig} — defaults applied, transforms run (ADR-0122). */ export type FilePersistenceConfigParsed = z.infer; @@ -84,7 +84,7 @@ export const LocalStoragePersistenceConfigSchema = lazySchema(() => z.object({ key: z.string().optional().describe('localStorage key for persisted data'), }).describe('localStorage persistence configuration')); -export type LocalStoragePersistenceConfig = z.infer; +export type LocalStoragePersistenceConfig = z.input; /** * Custom adapter persistence configuration. @@ -94,7 +94,7 @@ export const CustomPersistenceConfigSchema = lazySchema(() => z.object({ adapter: PersistenceAdapterSchema, }).describe('Custom adapter persistence configuration')); -export type CustomPersistenceConfig = z.infer; +export type CustomPersistenceConfig = z.input; /** * Auto-detect persistence configuration. @@ -122,7 +122,7 @@ export const AutoPersistenceConfigSchema = lazySchema(() => z.object({ key: z.string().optional().describe('localStorage key override for browser environments'), }).describe('Auto-detect persistence configuration')); -export type AutoPersistenceConfig = z.infer; +export type AutoPersistenceConfig = z.input; /** * Unified persistence configuration. @@ -331,9 +331,9 @@ export const MemoryDriverSpec = { // 4. Derived Types // ========================================================================== -export type MemoryConfig = z.infer; +export type MemoryConfig = z.input; /** Post-parse shape of {@link MemoryConfig} — defaults applied, transforms run (ADR-0122). */ export type MemoryConfigParsed = z.infer; -export type MemoryPersistenceConfig = z.infer; +export type MemoryPersistenceConfig = z.input; /** Post-parse shape of {@link MemoryPersistenceConfig} — defaults applied, transforms run (ADR-0122). */ export type MemoryPersistenceConfigParsed = z.infer; diff --git a/packages/spec/src/data/driver/mongo.zod.ts b/packages/spec/src/data/driver/mongo.zod.ts index 38d810ce51..c2bcc08db8 100644 --- a/packages/spec/src/data/driver/mongo.zod.ts +++ b/packages/spec/src/data/driver/mongo.zod.ts @@ -162,6 +162,6 @@ export const MongoDriverSpec = { /** * Derived Types */ -export type MongoConfig = z.infer; +export type MongoConfig = z.input; /** Post-parse shape of {@link MongoConfig} — defaults applied, transforms run (ADR-0122). */ export type MongoConfigParsed = z.infer; diff --git a/packages/spec/src/data/driver/mysql.zod.ts b/packages/spec/src/data/driver/mysql.zod.ts index 1e7e9fe5dc..f707f2d3bb 100644 --- a/packages/spec/src/data/driver/mysql.zod.ts +++ b/packages/spec/src/data/driver/mysql.zod.ts @@ -119,7 +119,7 @@ export const MysqlConfigSchema = lazySchema(() => z.object({ } })); -export type MysqlConfig = z.infer; +export type MysqlConfig = z.input; /** Post-parse shape of {@link MysqlConfig} — defaults applied, transforms run (ADR-0122). */ export type MysqlConfigParsed = z.infer; diff --git a/packages/spec/src/data/driver/postgres.zod.ts b/packages/spec/src/data/driver/postgres.zod.ts index 9aaa02ba22..a7fda99659 100644 --- a/packages/spec/src/data/driver/postgres.zod.ts +++ b/packages/spec/src/data/driver/postgres.zod.ts @@ -143,7 +143,7 @@ export const PostgresConfigSchema = lazySchema(() => z.object({ } })); -export type PostgresConfig = z.infer; +export type PostgresConfig = z.input; /** Post-parse shape of {@link PostgresConfig} — defaults applied, transforms run (ADR-0122). */ export type PostgresConfigParsed = z.infer; diff --git a/packages/spec/src/data/driver/sqlite.zod.ts b/packages/spec/src/data/driver/sqlite.zod.ts index dad4cf0a71..66fc6f4d1b 100644 --- a/packages/spec/src/data/driver/sqlite.zod.ts +++ b/packages/spec/src/data/driver/sqlite.zod.ts @@ -77,7 +77,7 @@ export const SqliteConfigSchema = lazySchema(() => z.object({ }, { error: sqliteConfigUnknownKeyError }).strict() .describe('SQLite connection configuration')); -export type SqliteConfig = z.infer; +export type SqliteConfig = z.input; /** Post-parse shape of {@link SqliteConfig} — defaults applied, transforms run (ADR-0122). */ export type SqliteConfigParsed = z.infer; @@ -94,7 +94,7 @@ export const SqliteWasmPersistModeSchema = z.union([ z.string().regex(/^debounced:\d+$/, 'Expected `debounced:`'), ]).describe('When to flush a file-backed wasm database to disk'); -export type SqliteWasmPersistMode = z.infer; +export type SqliteWasmPersistMode = z.input; const SQLITE_WASM_CONFIG_KEYS = ['filename', 'persist'] as const; @@ -130,7 +130,7 @@ export const SqliteWasmConfigSchema = lazySchema(() => z.object({ }, { error: sqliteWasmConfigUnknownKeyError }).strict() .describe('SQLite (WASM) connection configuration')); -export type SqliteWasmConfig = z.infer; +export type SqliteWasmConfig = z.input; /** Post-parse shape of {@link SqliteWasmConfig} — defaults applied, transforms run (ADR-0122). */ export type SqliteWasmConfigParsed = z.infer; diff --git a/packages/spec/src/data/external-catalog.zod.ts b/packages/spec/src/data/external-catalog.zod.ts index 2597512ccd..926e966862 100644 --- a/packages/spec/src/data/external-catalog.zod.ts +++ b/packages/spec/src/data/external-catalog.zod.ts @@ -24,7 +24,7 @@ export const ExternalColumnSchema = z.object({ .describe('ObjectStack field type suggested by the type-compat matrix'), }); -export type ExternalColumn = z.infer; +export type ExternalColumn = z.input; /** Post-parse shape of {@link ExternalColumn} — defaults applied, transforms run (ADR-0122). */ export type ExternalColumnParsed = z.infer; @@ -41,7 +41,7 @@ export const ExternalTableSchema = z.object({ rowCountEstimate: z.number().optional().describe('Approximate row count'), }); -export type ExternalTable = z.infer; +export type ExternalTable = z.input; /** Post-parse shape of {@link ExternalTable} — defaults applied, transforms run (ADR-0122). */ export type ExternalTableParsed = z.infer; @@ -58,6 +58,6 @@ export const ExternalCatalogSchema = lazySchema(() => z.object({ tables: z.array(ExternalTableSchema).describe('Snapshotted remote tables.'), })); -export type ExternalCatalog = z.infer; +export type ExternalCatalog = z.input; /** Post-parse shape of {@link ExternalCatalog} — defaults applied, transforms run (ADR-0122). */ export type ExternalCatalogParsed = z.infer; diff --git a/packages/spec/src/data/external-lookup.zod.ts b/packages/spec/src/data/external-lookup.zod.ts index be6b9a0af9..734f59193e 100644 --- a/packages/spec/src/data/external-lookup.zod.ts +++ b/packages/spec/src/data/external-lookup.zod.ts @@ -306,10 +306,10 @@ export const ExternalLookupSchema = lazySchema(() => z.object({ })); // Type exports -export type ExternalLookup = z.infer; +export type ExternalLookup = z.input; /** Post-parse shape of {@link ExternalLookup} — defaults applied, transforms run (ADR-0122). */ export type ExternalLookupParsed = z.infer; -export type ExternalDataSource = z.infer; -export type ExternalFieldMapping = z.infer; +export type ExternalDataSource = z.input; +export type ExternalFieldMapping = z.input; /** Post-parse shape of {@link ExternalFieldMapping} — defaults applied, transforms run (ADR-0122). */ export type ExternalFieldMappingParsed = z.infer; diff --git a/packages/spec/src/data/feed.zod.ts b/packages/spec/src/data/feed.zod.ts index cc3688f29e..88003a4960 100644 --- a/packages/spec/src/data/feed.zod.ts +++ b/packages/spec/src/data/feed.zod.ts @@ -32,7 +32,7 @@ export const FeedItemType = z.enum([ 'sharing', 'system', ]); -export type FeedItemType = z.infer; +export type FeedItemType = z.input; /** * Feed Filter Mode @@ -44,4 +44,4 @@ export const FeedFilterMode = z.enum([ 'changes_only', 'tasks_only', ]); -export type FeedFilterMode = z.infer; +export type FeedFilterMode = z.input; diff --git a/packages/spec/src/data/field.zod.ts b/packages/spec/src/data/field.zod.ts index ea541099d2..3094253293 100644 --- a/packages/spec/src/data/field.zod.ts +++ b/packages/spec/src/data/field.zod.ts @@ -76,7 +76,7 @@ export const FieldType = z.enum([ 'vector', // Vector embeddings for AI/ML (semantic search, RAG) ]); -export type FieldType = z.infer; +export type FieldType = z.input; /** * Select Option Schema @@ -864,27 +864,29 @@ export const FieldSchema = lazySchema(() => strictObject({ } })); -export type Field = z.infer; -/** Post-parse shape of {@link Field} — defaults applied, transforms run (ADR-0122). */ -export type FieldParsed = z.infer; /** - * Author-facing parse INPUT for a field. Since protocol 17 (#3855) it no longer - * carries the removed `conditionalRequired` alias — the key is tombstoned, so - * writing it is a `tsc` error at the authoring site as well as a parse error. - * Distinct from the `FieldInput` factory-helper type further down, which is - * `Partial`. + * Author-facing shape of a field — what `FieldSchema.parse(...)` accepts. Since + * protocol 17 (#3855) it no longer carries the removed `conditionalRequired` + * alias — the key is tombstoned, so writing it is a `tsc` error at the authoring + * site as well as a parse error. Distinct from the `FieldInput` factory-helper + * type further down, which is `Omit, 'type'>`, and from + * {@link FieldParsed}, which is what a parse returns. + * + * Spelled `FieldParseInput` until protocol 17; ADR-0122 phase 2 moved the author + * state onto the bare name and retired that synonym. */ -export type FieldParseInput = z.input; -export type SelectOption = z.infer; +export type Field = z.input; +/** Post-parse shape of {@link Field} — defaults applied, transforms run (ADR-0122). */ +export type FieldParsed = z.infer; +export type SelectOption = z.input; /** Post-parse shape of {@link SelectOption} — defaults applied, transforms run (ADR-0122). */ export type SelectOptionParsed = z.infer; -export type LocationCoordinates = z.infer; -export type Address = z.infer; -export type CurrencyConfig = z.infer; +export type LocationCoordinates = z.input; +export type Address = z.input; +export type CurrencyConfig = z.input; /** Post-parse shape of {@link CurrencyConfig} — defaults applied, transforms run (ADR-0122). */ export type CurrencyConfigParsed = z.infer; -export type CurrencyConfigInput = z.input; -export type CurrencyValue = z.infer; +export type CurrencyValue = z.input; /** * Field Factory Helper diff --git a/packages/spec/src/data/filter.zod.ts b/packages/spec/src/data/filter.zod.ts index fa8cc921bd..26d9977d33 100644 --- a/packages/spec/src/data/filter.zod.ts +++ b/packages/spec/src/data/filter.zod.ts @@ -67,7 +67,7 @@ export const FieldReferenceSchema = lazySchema(() => z.object({ $field: z.string().describe('Field Reference/Column Name') })); -export type FieldReference = z.infer; +export type FieldReference = z.input; // ============================================================================ // 3.1 Comparison Operators @@ -493,8 +493,8 @@ export type Filter = { export type Scalar = string | number | boolean | Date | null; // Export inferred types -export type FieldOperators = z.infer; -export type QueryFilter = z.infer; +export type FieldOperators = z.input; +export type QueryFilter = z.input; // ============================================================================ // Normalization Utilities (Internal Representation) diff --git a/packages/spec/src/data/hook-body.zod.ts b/packages/spec/src/data/hook-body.zod.ts index 65b992c883..03387ccbf2 100644 --- a/packages/spec/src/data/hook-body.zod.ts +++ b/packages/spec/src/data/hook-body.zod.ts @@ -58,7 +58,7 @@ export const HookBodyCapability = z.enum([ // lists the legal tokens. (The `managedBy: 'system'` precedent, object.zod.ts.) error: (issue) => (issue.input === 'crypto.hash' ? CRYPTO_HASH_RETIRED : undefined), }); -export type HookBodyCapability = z.infer; +export type HookBodyCapability = z.input; /* * ── Unknown-key strictness (#4001 data step) ──────────────────────────────── @@ -144,7 +144,7 @@ export const ExpressionBodySchema = z.object({ /** Formula-engine expression. Pure, side-effect-free. */ source: z.string().min(1).describe('Formula expression source'), }, { error: expressionBodyUnknownKeyError }).strict().describe('L1 expression body — pure formula, no IO'); -export type ExpressionBody = z.infer; +export type ExpressionBody = z.input; /** * L2 — Sandboxed JavaScript source. @@ -222,7 +222,7 @@ export const ScriptBodySchema = z.object({ */ memoryMb: z.number().int().positive().max(256).optional().describe('Per-invocation memory cap (MB)'), }, { error: scriptBodyUnknownKeyError }).strict().describe('L2 sandboxed JS body — runs inside an isolated VM with declared capabilities'); -export type ScriptBody = z.infer; +export type ScriptBody = z.input; /** Post-parse shape of {@link ScriptBody} — defaults applied, transforms run (ADR-0122). */ export type ScriptBodyParsed = z.infer; @@ -243,6 +243,6 @@ export const HookBodySchema = z.discriminatedUnion('language', [ ExpressionBodySchema, ScriptBodySchema, ]).describe('Hook/Action body — expression (L1) or sandboxed JS (L2)'); -export type HookBody = z.infer; +export type HookBody = z.input; /** Post-parse shape of {@link HookBody} — defaults applied, transforms run (ADR-0122). */ export type HookBodyParsed = z.infer; diff --git a/packages/spec/src/data/hook.zod.ts b/packages/spec/src/data/hook.zod.ts index 5448914087..4483c55bfd 100644 --- a/packages/spec/src/data/hook.zod.ts +++ b/packages/spec/src/data/hook.zod.ts @@ -669,9 +669,11 @@ export const HookContextSchema = lazySchema(() => z.object({ })); export type Hook = z.input; +/** Post-parse shape of {@link Hook} — defaults applied, transforms run (ADR-0122). */ +export type HookParsed = z.infer; export type ResolvedHook = z.output; -export type HookEventType = z.infer; -export type HookContext = z.infer; +export type HookEventType = z.input; +export type HookContext = z.input; /** * Type-safe factory for a lifecycle hook. Validates at authoring time via diff --git a/packages/spec/src/data/mapping.zod.ts b/packages/spec/src/data/mapping.zod.ts index f7e942dd02..8511641ef2 100644 --- a/packages/spec/src/data/mapping.zod.ts +++ b/packages/spec/src/data/mapping.zod.ts @@ -241,20 +241,18 @@ export const MappingSchema = lazySchema(() => strictObject({ ...MetadataProtectionFields, })); -export type Mapping = z.infer; +export type Mapping = z.input; /** Post-parse shape of {@link Mapping} — defaults applied, transforms run (ADR-0122). */ export type MappingParsed = z.infer; -/** Authoring input for {@link Mapping} — defaulted fields are optional. */ -export type MappingInput = z.input; /** * Type-safe factory for a data import/export mapping. Validates at authoring time via * `.parse()` and accepts input-shape config (optional defaults, CEL * shorthand) — preferred over a bare `: Mapping` literal. */ -export function defineMapping(config: z.input): Mapping { +export function defineMapping(config: z.input): MappingParsed { return MappingSchema.parse(config); } -export type ImportFieldMapping = z.infer; +export type ImportFieldMapping = z.input; /** Post-parse shape of {@link ImportFieldMapping} — defaults applied, transforms run (ADR-0122). */ export type ImportFieldMappingParsed = z.infer; diff --git a/packages/spec/src/data/object.test.ts b/packages/spec/src/data/object.test.ts index d772f62384..933aa01f3b 100644 --- a/packages/spec/src/data/object.test.ts +++ b/packages/spec/src/data/object.test.ts @@ -1,12 +1,12 @@ import { describe, it, expect, vi, afterEach } from 'vitest'; // Fixtures below are AUTHORED objects — what a developer writes before the -// schema applies its defaults — so they are annotated with `ServiceObjectInput` +// schema applies its defaults — so they are annotated with `ServiceObject` // (`z.input`), not `ServiceObject` (`z.infer`, defaults already materialised). // Under `z.infer` every fixture owes `isSystem`, `datasource`, `searchable`, // `activities`, … and the annotation stops being a contract check at all. This // only became visible when tsconfig.test.json put these files in front of tsc // (#5286). -import { ObjectSchema, ObjectCapabilities, IndexSchema, ObjectFieldGroupSchema, ObjectExternalBindingSchema, ObjectAccessConfigSchema, LifecycleSchema, TenancyConfigSchema, isTenancyDisabled, resolveCrudAffordances, type ServiceObjectInput } from './object.zod'; +import { ObjectSchema, ObjectCapabilities, IndexSchema, ObjectFieldGroupSchema, ObjectExternalBindingSchema, ObjectAccessConfigSchema, LifecycleSchema, TenancyConfigSchema, isTenancyDisabled, resolveCrudAffordances, type ServiceObject } from './object.zod'; import type { StateMachineValidation } from './validation.zod'; describe('ObjectCapabilities', () => { @@ -288,7 +288,7 @@ describe('IndexSchema retired keys (#5248 / #4943)', () => { describe('ObjectSchema', () => { describe('Basic Object Properties', () => { it('should accept minimal valid object', () => { - const validObject: ServiceObjectInput = { + const validObject: ServiceObject = { name: 'account', fields: {}, }; @@ -323,7 +323,7 @@ describe('ObjectSchema', () => { describe('Object with Fields', () => { it('should accept object with multiple fields', () => { - const objectWithFields: ServiceObjectInput = { + const objectWithFields: ServiceObject = { name: 'contact', label: 'Contact', pluralLabel: 'Contacts', @@ -481,7 +481,7 @@ describe('ObjectSchema', () => { describe('Object Metadata', () => { it('should accept object with full metadata', () => { - const fullObject: ServiceObjectInput = { + const fullObject: ServiceObject = { name: 'opportunity', label: 'Opportunity', pluralLabel: 'Opportunities', @@ -504,7 +504,7 @@ describe('ObjectSchema', () => { describe('Object with Indexes', () => { it('should accept object with indexes', () => { - const objectWithIndexes: ServiceObjectInput = { + const objectWithIndexes: ServiceObject = { name: 'user', fields: { email: { @@ -539,7 +539,7 @@ describe('ObjectSchema', () => { describe('Object Capabilities', () => { it('should accept object with custom capabilities', () => { - const objectWithCapabilities: ServiceObjectInput = { + const objectWithCapabilities: ServiceObject = { name: 'case', fields: {}, enable: { @@ -574,7 +574,7 @@ describe('ObjectSchema', () => { describe('Complete Real-World Examples', () => { it('should accept CRM Account object', () => { - const accountObject: ServiceObjectInput = { + const accountObject: ServiceObject = { name: 'account', label: 'Account', pluralLabel: 'Accounts', @@ -639,7 +639,7 @@ describe('ObjectSchema', () => { }); it('should accept Task object with parent relationship', () => { - const taskObject: ServiceObjectInput = { + const taskObject: ServiceObject = { name: 'task', label: 'Task', pluralLabel: 'Tasks', diff --git a/packages/spec/src/data/object.zod.ts b/packages/spec/src/data/object.zod.ts index 09d044a62f..efddf5b2c0 100644 --- a/packages/spec/src/data/object.zod.ts +++ b/packages/spec/src/data/object.zod.ts @@ -21,7 +21,7 @@ export const ApiMethod = z.enum([ 'create', 'update', 'delete', // Write 'bulk', // Batch operations ]); -export type ApiMethod = z.infer; +export type ApiMethod = z.input; /** * The eight RETIRED legacy `apiMethods` values (#3543, P2 of #3391). Each is @@ -574,8 +574,8 @@ export const ObjectRequiredPermissionsSchema = z.union([ z.array(z.string()), PerOperationRequiredPermissionsSchema, ]); -export type PerOperationRequiredPermissions = z.infer; -export type ObjectRequiredPermissions = z.infer; +export type PerOperationRequiredPermissions = z.input; +export type ObjectRequiredPermissions = z.input; /** * Data Lifecycle (ADR-0057) @@ -777,7 +777,6 @@ export const LifecycleSchema = lazySchema(() => strictObject({ } })); - /** * Object Field Group Schema — MVP (data-layer protocol) * @@ -900,10 +899,9 @@ export const ObjectFieldGroupSchema = lazySchema(() => strictObject({ collapsed: z.boolean().optional().describe("[DEPRECATED → collapse] Boolean pair with `collapsible`; use the `collapse` enum."), })); -export type ObjectFieldGroup = z.infer; +export type ObjectFieldGroup = z.input; /** Post-parse shape of {@link ObjectFieldGroup} — defaults applied, transforms run (ADR-0122). */ export type ObjectFieldGroupParsed = z.infer; -export type ObjectFieldGroupInput = z.input; /** * Base Object Schema Definition @@ -988,7 +986,7 @@ export const ObjectExternalBindingSchema = strictObject({ .describe('Remote columns to skip during validation (dev convenience).'), }).describe('External datasource binding (ADR-0015)'); -export type ObjectExternalBinding = z.infer; +export type ObjectExternalBinding = z.input; /** Post-parse shape of {@link ObjectExternalBinding} — defaults applied, transforms run (ADR-0122). */ export type ObjectExternalBindingParsed = z.infer; @@ -1025,10 +1023,9 @@ export const RowCrudActionOverrideSchema = z.object({ 'Per-record CEL predicate; true → render the row button disabled for that record. Fail-soft.', ), }).strict().describe('Boolean-or-predicates override for a built-in row CRUD affordance.'); -export type RowCrudActionOverride = z.infer; +export type RowCrudActionOverride = z.input; /** Post-parse shape of {@link RowCrudActionOverride} — defaults applied, transforms run (ADR-0122). */ export type RowCrudActionOverrideParsed = z.infer; -export type RowCrudActionOverrideInput = z.input; /** * Unknown-key error for {@link ObjectSchemaBase}, built on FIRST USE. @@ -1420,7 +1417,6 @@ const ObjectSchemaBase = z.object({ external: ObjectExternalBindingSchema.optional() .describe('Remote table binding for federated (external) objects.'), - /** * Data Model */ @@ -2197,22 +2193,21 @@ export const ObjectSchema = lazySchema(() => { }); }); -export type ServiceObject = z.infer; +export type ServiceObject = z.input; /** Post-parse shape of {@link ServiceObject} — defaults applied, transforms run (ADR-0122). */ export type ServiceObjectParsed = z.infer; -export type ServiceObjectInput = z.input; -export type ObjectCapabilities = z.infer; +export type ObjectCapabilities = z.input; /** Post-parse shape of {@link ObjectCapabilities} — defaults applied, transforms run (ADR-0122). */ export type ObjectCapabilitiesParsed = z.infer; -export type ObjectIndex = z.infer; +export type ObjectIndex = z.input; /** Post-parse shape of {@link ObjectIndex} — defaults applied, transforms run (ADR-0122). */ export type ObjectIndexParsed = z.infer; -export type TenancyConfig = z.infer; -export type ObjectAccessConfig = z.infer; +export type TenancyConfig = z.input; +export type ObjectAccessConfig = z.input; /** Post-parse shape of {@link ObjectAccessConfig} — defaults applied, transforms run (ADR-0122). */ export type ObjectAccessConfigParsed = z.infer; -export type LifecycleClass = z.infer; -export type Lifecycle = z.infer; +export type LifecycleClass = z.input; +export type Lifecycle = z.input; /** * Resolved CRUD affordance matrix for an object — what generic @@ -2378,7 +2373,7 @@ function normalizeRowCrudOverride( * object name = database table name, globally unique, no namespace prefix. */ export const ObjectOwnershipEnum = z.enum(['own', 'extend']); -export type ObjectOwnership = z.infer; +export type ObjectOwnership = z.input; /** * Object Extension Entry — used in `objectExtensions` array. @@ -2454,17 +2449,15 @@ export const ObjectExtensionSchema = lazySchema(() => strictObject({ priority: z.number().int().min(0).max(999).default(200).describe('Merge priority (higher = applied later)'), })); -export type ObjectExtension = z.infer; +export type ObjectExtension = z.input; /** Post-parse shape of {@link ObjectExtension} — defaults applied, transforms run (ADR-0122). */ export type ObjectExtensionParsed = z.infer; -/** Authoring input for {@link ObjectExtension} — defaulted fields are optional. */ -export type ObjectExtensionInput = z.input; /** * Type-safe factory for an extension to an object owned by another package. Validates at authoring time via * `.parse()` and accepts input-shape config (optional defaults, CEL * shorthand) — preferred over a bare `: ObjectExtension` literal. */ -export function defineObjectExtension(config: z.input): ObjectExtension { +export function defineObjectExtension(config: z.input): ObjectExtensionParsed { return ObjectExtensionSchema.parse(config); } diff --git a/packages/spec/src/data/query.zod.ts b/packages/spec/src/data/query.zod.ts index d5655dc57e..47b89627bf 100644 --- a/packages/spec/src/data/query.zod.ts +++ b/packages/spec/src/data/query.zod.ts @@ -333,7 +333,7 @@ export const FullTextSearchSchema = lazySchema(() => z.object({ highlight: z.boolean().optional().default(false).describe('[EXPERIMENTAL — not enforced] Search result highlighting. No executor emits highlights (#4286).'), })); -export type FullTextSearch = z.infer; +export type FullTextSearch = z.input; /** Post-parse shape of {@link FullTextSearch} — defaults applied, transforms run (ADR-0122). */ export type FullTextSearchParsed = z.infer; @@ -495,12 +495,12 @@ export const QuerySchema: z.ZodType = lazySchema(() => Bas ), })); -export type SortNode = z.infer; +export type SortNode = z.input; /** Post-parse shape of {@link SortNode} — defaults applied, transforms run (ADR-0122). */ export type SortNodeParsed = z.infer; -export type AggregationNode = z.infer; -export type GroupByNode = z.infer; -export type DateGranularityValue = z.infer; +export type AggregationNode = z.input; +export type GroupByNode = z.input; +export type DateGranularityValue = z.input; // `FieldNode` is declared next to its schema rather than here: since #4196 it // is no longer recursive, it is just the name the docs and the engine give to // "one entry of a select list". (`JoinNode` and `WindowFunctionNode`/`WindowSpec` diff --git a/packages/spec/src/data/seed-loader.zod.ts b/packages/spec/src/data/seed-loader.zod.ts index ebb4b9dbe8..8b8deabd8f 100644 --- a/packages/spec/src/data/seed-loader.zod.ts +++ b/packages/spec/src/data/seed-loader.zod.ts @@ -61,7 +61,7 @@ export const ReferenceResolutionSchema = lazySchema(() => z.object({ multiple: z.boolean().optional().describe('Field stores an array of references (multiple: true)'), }).describe('Describes how a field reference is resolved during seed loading')); -export type ReferenceResolution = z.infer; +export type ReferenceResolution = z.input; /** Post-parse shape of {@link ReferenceResolution} — defaults applied, transforms run (ADR-0122). */ export type ReferenceResolutionParsed = z.infer; @@ -90,7 +90,7 @@ export const ObjectDependencyNodeSchema = lazySchema(() => z.object({ references: z.array(ReferenceResolutionSchema).describe('Field-level reference details'), }).describe('Object node in the seed data dependency graph')); -export type ObjectDependencyNode = z.infer; +export type ObjectDependencyNode = z.input; /** Post-parse shape of {@link ObjectDependencyNode} — defaults applied, transforms run (ADR-0122). */ export type ObjectDependencyNodeParsed = z.infer; @@ -123,7 +123,7 @@ export const ObjectDependencyGraphSchema = lazySchema(() => z.object({ .describe('Circular dependency chains (e.g., [["a", "b", "a"]])'), }).describe('Complete object dependency graph for seed data loading')); -export type ObjectDependencyGraph = z.infer; +export type ObjectDependencyGraph = z.input; /** Post-parse shape of {@link ObjectDependencyGraph} — defaults applied, transforms run (ADR-0122). */ export type ObjectDependencyGraphParsed = z.infer; @@ -161,7 +161,7 @@ export const ReferenceResolutionErrorSchema = lazySchema(() => z.object({ message: z.string().describe('Human-readable error description'), }).describe('Actionable error for a failed reference resolution')); -export type ReferenceResolutionError = z.infer; +export type ReferenceResolutionError = z.input; // ========================================================================== // 4b. Seed Identity (os.user / os.org binding) @@ -201,7 +201,7 @@ export const SeedIdentitySchema = z.object({ }).optional().describe('Organization bound to os.org in seed CEL expressions'), }).describe('Identity context for resolving os.user / os.org in seed CEL values'); -export type SeedIdentity = z.infer; +export type SeedIdentity = z.input; // ========================================================================== // 5. Seed Loader Configuration @@ -301,13 +301,10 @@ export const SeedLoaderConfigSchema = lazySchema(() => z.object({ .describe('Identity bound to os.user / os.org when resolving CEL seed values'), }).describe('Seed data loader configuration')); -export type SeedLoaderConfig = z.infer; +export type SeedLoaderConfig = z.input; /** Post-parse shape of {@link SeedLoaderConfig} — defaults applied, transforms run (ADR-0122). */ export type SeedLoaderConfigParsed = z.infer; -/** Input type — all fields with defaults are optional */ -export type SeedLoaderConfigInput = z.input; - // ========================================================================== // 6. Per-Object Load Result // ========================================================================== @@ -392,7 +389,7 @@ export const SeedLoadResultSchema = lazySchema(() => z.object({ .describe('Reference resolution errors'), }).describe('Result of loading a single dataset')); -export type SeedLoadResult = z.infer; +export type SeedLoadResult = z.input; /** Post-parse shape of {@link SeedLoadResult} — defaults applied, transforms run (ADR-0122). */ export type SeedLoadResultParsed = z.infer; @@ -473,7 +470,7 @@ export const SeedLoaderResultSchema = lazySchema(() => z.object({ }).describe('Summary statistics'), }).describe('Complete seed loader result')); -export type SeedLoaderResult = z.infer; +export type SeedLoaderResult = z.input; /** Post-parse shape of {@link SeedLoaderResult} — defaults applied, transforms run (ADR-0122). */ export type SeedLoaderResultParsed = z.infer; @@ -493,9 +490,7 @@ export const SeedLoaderRequestSchema = lazySchema(() => z.object({ config: SeedLoaderConfigSchema.default(() => SeedLoaderConfigSchema.parse({})).describe('Loader configuration'), }).describe('Seed loader request with datasets and configuration')); -export type SeedLoaderRequest = z.infer; +export type SeedLoaderRequest = z.input; /** Post-parse shape of {@link SeedLoaderRequest} — defaults applied, transforms run (ADR-0122). */ export type SeedLoaderRequestParsed = z.infer; -/** Input type — config defaults are optional */ -export type SeedLoaderRequestInput = z.input; diff --git a/packages/spec/src/data/seed.zod.ts b/packages/spec/src/data/seed.zod.ts index c528931b0d..b048725fbe 100644 --- a/packages/spec/src/data/seed.zod.ts +++ b/packages/spec/src/data/seed.zod.ts @@ -107,14 +107,11 @@ export const SeedSchema = lazySchema(() => strictObject({ })); /** Parsed/output type — all defaults are applied (env, mode, externalId always present) */ -export type Seed = z.infer; +export type Seed = z.input; /** Post-parse shape of {@link Seed} — defaults applied, transforms run (ADR-0122). */ export type SeedParsed = z.infer; -/** Input type — fields with defaults (env, mode, externalId) are optional */ -export type SeedInput = z.input; - -export type SeedImportMode = z.infer; +export type SeedImportMode = z.input; /** * Per-field value type for a seed record. @@ -171,7 +168,7 @@ export function defineSeed< const TObj extends { name: string; fields: Record } >( objectDef: TObj, - config: Omit & { + config: Omit & { records: Array>; } ): Seed { diff --git a/packages/spec/src/data/validation.zod.ts b/packages/spec/src/data/validation.zod.ts index a39d135d1e..9b59988aff 100644 --- a/packages/spec/src/data/validation.zod.ts +++ b/packages/spec/src/data/validation.zod.ts @@ -521,22 +521,22 @@ export const ConditionalValidationSchema = lazySchema(() => strictObject({ otherwise: ValidationRuleSchema.optional().describe('Validation rule to apply when condition is false'), })); -export type ValidationRule = z.infer; -export type ScriptValidation = z.infer; +export type ValidationRule = z.input; +export type ScriptValidation = z.input; /** Post-parse shape of {@link ScriptValidation} — defaults applied, transforms run (ADR-0122). */ export type ScriptValidationParsed = z.infer; -export type StateMachineValidation = z.infer; +export type StateMachineValidation = z.input; /** Post-parse shape of {@link StateMachineValidation} — defaults applied, transforms run (ADR-0122). */ export type StateMachineValidationParsed = z.infer; -export type FormatValidation = z.infer; +export type FormatValidation = z.input; /** Post-parse shape of {@link FormatValidation} — defaults applied, transforms run (ADR-0122). */ export type FormatValidationParsed = z.infer; -export type CrossFieldValidation = z.infer; +export type CrossFieldValidation = z.input; /** Post-parse shape of {@link CrossFieldValidation} — defaults applied, transforms run (ADR-0122). */ export type CrossFieldValidationParsed = z.infer; -export type JSONValidation = z.infer; +export type JSONValidation = z.input; /** Post-parse shape of {@link JSONValidation} — defaults applied, transforms run (ADR-0122). */ export type JSONValidationParsed = z.infer; -export type ConditionalValidation = z.infer; +export type ConditionalValidation = z.input; /** Post-parse shape of {@link ConditionalValidation} — defaults applied, transforms run (ADR-0122). */ export type ConditionalValidationParsed = z.infer; \ No newline at end of file diff --git a/packages/spec/src/identity/eval-user.zod.ts b/packages/spec/src/identity/eval-user.zod.ts index 7fa9ead89f..c01756d72c 100644 --- a/packages/spec/src/identity/eval-user.zod.ts +++ b/packages/spec/src/identity/eval-user.zod.ts @@ -130,11 +130,9 @@ export const EvalUserSchema = lazySchema(() => }) ); -export type EvalUser = z.infer; +export type EvalUser = z.input; /** Post-parse shape of {@link EvalUser} — defaults applied, transforms run (ADR-0122). */ export type EvalUserParsed = z.infer; -/** Authoring input for EvalUser — defaulted fields are optional. */ -export type EvalUserInput = z.input; /** * Build a canonical EvalUser from loosely-typed source fields. The single factory @@ -148,7 +146,7 @@ export function createEvalUser(input: { email?: string | null; positions?: readonly string[] | null; organizationId?: string | null; -}): EvalUser { +}): EvalUserParsed { const positions = Array.from( new Set((input.positions ?? []).map((r) => String(r).trim()).filter(Boolean)) ); diff --git a/packages/spec/src/identity/identity.zod.ts b/packages/spec/src/identity/identity.zod.ts index f307c9aaaf..20eba5fb2c 100644 --- a/packages/spec/src/identity/identity.zod.ts +++ b/packages/spec/src/identity/identity.zod.ts @@ -54,7 +54,7 @@ export const UserSchema = lazySchema(() => z.object({ updatedAt: z.string().datetime().describe('Last update timestamp'), })); -export type User = z.infer; +export type User = z.input; /** Post-parse shape of {@link User} — defaults applied, transforms run (ADR-0122). */ export type UserParsed = z.infer; @@ -141,7 +141,7 @@ export const AccountSchema = lazySchema(() => z.object({ updatedAt: z.string().datetime().describe('Last update timestamp'), })); -export type Account = z.infer; +export type Account = z.input; /* * The bare `Session` / `SessionSchema` names are NOT declared here (#4641). @@ -192,7 +192,7 @@ export const VerificationTokenSchema = lazySchema(() => z.object({ createdAt: z.string().datetime().describe('Token creation timestamp'), })); -export type VerificationToken = z.infer; +export type VerificationToken = z.input; /** * API Key Schema @@ -301,6 +301,6 @@ export const ApiKeySchema = lazySchema(() => z.object({ metadata: z.record(z.string(), z.unknown()).optional().describe('Custom metadata'), })); -export type ApiKey = z.infer; +export type ApiKey = z.input; /** Post-parse shape of {@link ApiKey} — defaults applied, transforms run (ADR-0122). */ export type ApiKeyParsed = z.infer; diff --git a/packages/spec/src/identity/organization.zod.ts b/packages/spec/src/identity/organization.zod.ts index b2a93d5b7d..98392b29a6 100644 --- a/packages/spec/src/identity/organization.zod.ts +++ b/packages/spec/src/identity/organization.zod.ts @@ -57,7 +57,7 @@ export const OrganizationSchema = lazySchema(() => z.object({ updatedAt: z.string().datetime().describe('Last update timestamp'), })); -export type Organization = z.infer; +export type Organization = z.input; /** * Organization Member Schema @@ -97,14 +97,14 @@ export const MemberSchema = lazySchema(() => z.object({ updatedAt: z.string().datetime().describe('Last update timestamp'), })); -export type Member = z.infer; +export type Member = z.input; /** * Invitation Status Enum */ export const InvitationStatus = z.enum(['pending', 'accepted', 'rejected', 'expired']); -export type InvitationStatus = z.infer; +export type InvitationStatus = z.input; /** * Organization Invitation Schema @@ -158,6 +158,6 @@ export const InvitationSchema = lazySchema(() => z.object({ updatedAt: z.string().datetime().describe('Last update timestamp'), })); -export type Invitation = z.infer; +export type Invitation = z.input; /** Post-parse shape of {@link Invitation} — defaults applied, transforms run (ADR-0122). */ export type InvitationParsed = z.infer; diff --git a/packages/spec/src/identity/position.zod.ts b/packages/spec/src/identity/position.zod.ts index 60f98111f8..58c970cebf 100644 --- a/packages/spec/src/identity/position.zod.ts +++ b/packages/spec/src/identity/position.zod.ts @@ -132,17 +132,15 @@ export const EVERYONE_POSITION = 'everyone'; export const GUEST_POSITION = 'guest'; export const AUDIENCE_ANCHOR_POSITIONS = [EVERYONE_POSITION, GUEST_POSITION] as const; -export type Position = z.infer; +export type Position = z.input; /** Post-parse shape of {@link Position} — defaults applied, transforms run (ADR-0122). */ export type PositionParsed = z.infer; -/** Authoring input for {@link Position} — defaulted fields are optional. */ -export type PositionInput = z.input; /** * Type-safe factory for a position (flat capability-distribution group). * Validates at authoring time via `.parse()` and accepts input-shape config — * preferred over a bare `: Position` literal. */ -export function definePosition(config: z.input): Position { +export function definePosition(config: z.input): PositionParsed { return PositionSchema.parse(config); } diff --git a/packages/spec/src/identity/scim.zod.ts b/packages/spec/src/identity/scim.zod.ts index d7c640af71..7469438ed0 100644 --- a/packages/spec/src/identity/scim.zod.ts +++ b/packages/spec/src/identity/scim.zod.ts @@ -119,7 +119,7 @@ export const SCIMMetaSchema = lazySchema(() => z.object({ .describe('Entity tag (ETag) for concurrency control'), })); -export type SCIMMeta = z.infer; +export type SCIMMeta = z.input; /** * SCIM Name Schema @@ -175,7 +175,7 @@ export const SCIMNameSchema = lazySchema(() => z.object({ .describe('Honorific suffix (Jr., Sr.)'), })); -export type SCIMName = z.infer; +export type SCIMName = z.input; /** * SCIM Email Schema @@ -213,7 +213,7 @@ export const SCIMEmailSchema = lazySchema(() => z.object({ .describe('Primary email indicator'), })); -export type SCIMEmail = z.infer; +export type SCIMEmail = z.input; /** Post-parse shape of {@link SCIMEmail} — defaults applied, transforms run (ADR-0122). */ export type SCIMEmailParsed = z.infer; @@ -252,7 +252,7 @@ export const SCIMPhoneNumberSchema = lazySchema(() => z.object({ .describe('Primary phone indicator'), })); -export type SCIMPhoneNumber = z.infer; +export type SCIMPhoneNumber = z.input; /** Post-parse shape of {@link SCIMPhoneNumber} — defaults applied, transforms run (ADR-0122). */ export type SCIMPhoneNumberParsed = z.infer; @@ -319,7 +319,7 @@ export const SCIMAddressSchema = lazySchema(() => z.object({ .describe('Primary address indicator'), })); -export type SCIMAddress = z.infer; +export type SCIMAddress = z.input; /** Post-parse shape of {@link SCIMAddress} — defaults applied, transforms run (ADR-0122). */ export type SCIMAddressParsed = z.infer; @@ -357,7 +357,7 @@ export const SCIMGroupReferenceSchema = lazySchema(() => z.object({ .describe('Membership type'), })); -export type SCIMGroupReference = z.infer; +export type SCIMGroupReference = z.input; /** * SCIM Enterprise User Extension @@ -411,7 +411,7 @@ export const SCIMEnterpriseUserSchema = lazySchema(() => z.object({ .describe('Manager reference'), })); -export type SCIMEnterpriseUser = z.infer; +export type SCIMEnterpriseUser = z.input; /** * SCIM User Schema (Core) @@ -646,7 +646,7 @@ export const SCIMUserSchema = lazySchema(() => z.object({ } })); -export type SCIMUser = z.infer; +export type SCIMUser = z.input; /** Post-parse shape of {@link SCIMUser} — defaults applied, transforms run (ADR-0122). */ export type SCIMUserParsed = z.infer; @@ -684,7 +684,7 @@ export const SCIMMemberReferenceSchema = lazySchema(() => z.object({ .describe('Member display name'), })); -export type SCIMMemberReference = z.infer; +export type SCIMMemberReference = z.input; /** * SCIM Group Schema @@ -740,7 +740,7 @@ export const SCIMGroupSchema = lazySchema(() => z.object({ .describe('Resource metadata'), })); -export type SCIMGroup = z.infer; +export type SCIMGroup = z.input; /** Post-parse shape of {@link SCIMGroup} — defaults applied, transforms run (ADR-0122). */ export type SCIMGroupParsed = z.infer; @@ -804,7 +804,7 @@ export const SCIMListResponseSchema = lazySchema(() => z.object({ .describe('Items per page'), })); -export type SCIMListResponse = z.infer; +export type SCIMListResponse = z.input; /** Post-parse shape of {@link SCIMListResponse} — defaults applied, transforms run (ADR-0122). */ export type SCIMListResponseParsed = z.infer; @@ -860,7 +860,7 @@ export const SCIMErrorSchema = lazySchema(() => z.object({ .describe('Error detail message'), })); -export type SCIMError = z.infer; +export type SCIMError = z.input; /** Post-parse shape of {@link SCIMError} — defaults applied, transforms run (ADR-0122). */ export type SCIMErrorParsed = z.infer; @@ -890,7 +890,7 @@ export const SCIMPatchOperationSchema = lazySchema(() => z.object({ .describe('Value to set'), })); -export type SCIMPatchOperation = z.infer; +export type SCIMPatchOperation = z.input; /** * SCIM Patch Request @@ -916,7 +916,7 @@ export const SCIMPatchRequestSchema = lazySchema(() => z.object({ .describe('Patch operations'), })); -export type SCIMPatchRequest = z.infer; +export type SCIMPatchRequest = z.input; /** Post-parse shape of {@link SCIMPatchRequest} — defaults applied, transforms run (ADR-0122). */ export type SCIMPatchRequestParsed = z.infer; @@ -1006,7 +1006,7 @@ export const SCIMBulkOperationSchema = lazySchema(() => z.object({ .describe('ETag for optimistic concurrency control'), })); -export type SCIMBulkOperation = z.infer; +export type SCIMBulkOperation = z.input; /** * SCIM Bulk Request Schema @@ -1030,7 +1030,7 @@ export const SCIMBulkRequestSchema = lazySchema(() => z.object({ .describe('Stop processing after this many errors'), })); -export type SCIMBulkRequest = z.infer; +export type SCIMBulkRequest = z.input; /** Post-parse shape of {@link SCIMBulkRequest} — defaults applied, transforms run (ADR-0122). */ export type SCIMBulkRequestParsed = z.infer; @@ -1063,7 +1063,7 @@ export const SCIMBulkResponseOperationSchema = lazySchema(() => z.object({ .describe('Response body (typically present for errors)'), })); -export type SCIMBulkResponseOperation = z.infer; +export type SCIMBulkResponseOperation = z.input; /** * SCIM Bulk Response Schema @@ -1080,6 +1080,6 @@ export const SCIMBulkResponseSchema = lazySchema(() => z.object({ .describe('Results for each bulk operation'), })); -export type SCIMBulkResponse = z.infer; +export type SCIMBulkResponse = z.input; /** Post-parse shape of {@link SCIMBulkResponse} — defaults applied, transforms run (ADR-0122). */ export type SCIMBulkResponseParsed = z.infer; diff --git a/packages/spec/src/index.ts b/packages/spec/src/index.ts index 96452e0e9c..b9cf1a5901 100644 --- a/packages/spec/src/index.ts +++ b/packages/spec/src/index.ts @@ -198,7 +198,7 @@ export { ORGANIZATION_ADMIN_NO_BYPASS, ORGANIZATION_ADMIN_GRANTS, } from './identity/eval-user.zod'; -export type { EvalUser, EvalUserInput, BuiltinIdentityName } from './identity/eval-user.zod'; +export type { EvalUser, BuiltinIdentityName } from './identity/eval-user.zod'; // #3723 / ADR-0108: organization membership roles — the closed, framework-owned // vocabulary behind better-auth's role registry AND the `sys_invitation` / diff --git a/packages/spec/src/integration/connector-author-shape.test.ts b/packages/spec/src/integration/connector-author-shape.test.ts index 5afbe327c0..d016eb988a 100644 --- a/packages/spec/src/integration/connector-author-shape.test.ts +++ b/packages/spec/src/integration/connector-author-shape.test.ts @@ -49,13 +49,15 @@ import { // // The first three are the example teaching keys and values the schema turns // down; they are fixed in the document. The fourth is an ANNOTATION fact — -// `Connector` is `z.infer` here, so it is the shape a `.parse()` RETURNS, in -// which `syncConfig.schedule` is the post-transform `{ dialect, source }` -// envelope and a bare cron string is correctly rejected. The document now -// annotates with `ConnectorInput` (`z.input`), which is what an author writes. -// Flipping this file's 20 bare `z.infer` aliases to the house `X` / `XParsed` -// convention the way #4963 did for `etl.zod.ts` is a real but separate -// appetite (this file's migration surface is not empty) and is NOT done here. +// the annotation named the PARSED state, in which `syncConfig.schedule` is the +// post-transform `{ dialect, source }` envelope and a bare cron string is +// correctly rejected. When this gate was written that state sat on the bare +// `Connector` and the author state on `ConnectorInput`, and this comment called +// flipping them "a real but separate appetite". ADR-0122 phase 2 (#6083) did it: +// the bare `Connector` is now `z.input` — the shape the document annotates with +// — and `ConnectorParsed` carries the parse result. The pinned FACT is +// unchanged; the two names swapped sides, which is what the last describe block +// in this file now measures. const SPEC_DIR = resolve(dirname(fileURLToPath(import.meta.url)), '../..'); const SYNC_ARCHITECTURE = resolve(SPEC_DIR, 'docs/SYNC_ARCHITECTURE.md'); @@ -170,8 +172,8 @@ describe('[#5515] SYNC_ARCHITECTURE.md L3 connector example compiles', () => { // resolution failure (paths mapping wrong, host overlay not applied) would // report zero diagnostics and read as a green example. probes['harness-self-test'] = [ - "import type { ConnectorInput } from '@objectstack/spec/integration';", - "const broken: ConnectorInput = { label: 'no name, no type' };", + "import type { Connector } from '@objectstack/spec/integration';", + "const broken: Connector = { label: 'no name, no type' };", ].join('\n'); const results = compileProbes(probes); @@ -188,15 +190,15 @@ describe('[#5515] the four spellings the example used to carry are rejected', () // would still pass if the probe broke for an unrelated reason, which is // precisely the failure mode a documentation gate is prone to. // - // Each probe is a whole `ConnectorInput` rather than a bare mapping or + // Each probe is a whole `Connector` rather than a bare mapping or // webhook literal, because that is the shape the document actually teaches — - // and because this file publishes no `*Input` alias for the nested schemas, + // and because the nested schemas publish no author-state name of their own, // so reaching them any other way would mean measuring something the barrel // does not export. - const HEAD = "import type { ConnectorInput } from '@objectstack/spec/integration';"; + const HEAD = "import type { Connector } from '@objectstack/spec/integration';"; const probes = { 'alias-source-field': `${HEAD} - const c: ConnectorInput = { + const c: Connector = { name: 'sap_erp_connector', label: 'SAP ERP Integration', type: 'saas', fieldMappings: [{ sourceField: 'customer_number', targetField: 'customer_id' }], }; @@ -208,7 +210,7 @@ describe('[#5515] the four spellings the example used to carry are rejected', () // alike. The probe body is unchanged on purpose — it is the same wrong // snippet an author copies out of the L3 document. 'transform-retired': `${HEAD} - const c: ConnectorInput = { + const c: Connector = { name: 'sap_erp_connector', label: 'SAP ERP Integration', type: 'saas', fieldMappings: [{ source: 'order_value', target: 'order_total', @@ -223,7 +225,7 @@ describe('[#5515] the four spellings the example used to carry are rejected', () // ("custom is not a member") and nothing would notice the retirement had // been undone. 'transform-retired-valid-member': `${HEAD} - const c: ConnectorInput = { + const c: Connector = { name: 'sap_erp_connector', label: 'SAP ERP Integration', type: 'saas', fieldMappings: [{ source: 'order_value', target: 'order_total', @@ -233,7 +235,7 @@ describe('[#5515] the four spellings the example used to carry are rejected', () void c; `, 'webhook-retry-policy': `${HEAD} - const c: ConnectorInput = { + const c: Connector = { name: 'sap_erp_connector', label: 'SAP ERP Integration', type: 'saas', webhooks: [{ name: 'order_created_webhook', @@ -246,7 +248,7 @@ describe('[#5515] the four spellings the example used to carry are rejected', () // The canonical spellings of all three, as one control: if this were red // the three reds above would say nothing about the SPELLING. 'canonical-control': `${HEAD} - const c: ConnectorInput = { + const c: Connector = { name: 'sap_erp_connector', label: 'SAP ERP Integration', type: 'saas', fieldMappings: [{ source: 'order_value', target: 'order_total', @@ -393,12 +395,15 @@ describe('[#5515] the schema rejects them at RUNTIME too, and how it says so', ( }); }); -describe('[#5515] `ConnectorInput` is the author shape; `Connector` is the parse result', () => { +describe('[#5515] the bare `Connector` is the author shape; `ConnectorParsed` is the parse result', () => { // The fourth diagnostic, pinned as an ANNOTATION fact rather than fixed by // renaming this file's aliases. Direction stated before running: the SAME - // literal is green under `ConnectorInput` and red under `Connector`, because - // `z.infer` is the post-parse shape — `syncConfig.schedule` becomes the + // literal is green under the bare `Connector` and red under `ConnectorParsed`, + // because `z.infer` is the post-parse shape — `syncConfig.schedule` becomes the // `{ dialect, source }` envelope and every `.default()` key becomes required. + // Before ADR-0122 phase 2 these two probes read `ConnectorInput` and + // `Connector`. The literal and both verdicts are unchanged; only which name + // sits on which side moved, which is the whole claim of the flip as a test. const literal = `{ name: 'sap_erp_connector', label: 'SAP ERP Integration', @@ -407,24 +412,24 @@ describe('[#5515] `ConnectorInput` is the author shape; `Connector` is the parse }`; const probes = { 'author-connector': ` - import type { ConnectorInput } from '@objectstack/spec/integration'; - const c: ConnectorInput = ${literal}; + import type { Connector } from '@objectstack/spec/integration'; + const c: Connector = ${literal}; void c; `, 'parsed-connector': ` - import type { Connector } from '@objectstack/spec/integration'; - const c: Connector = ${literal}; + import type { ConnectorParsed } from '@objectstack/spec/integration'; + const c: ConnectorParsed = ${literal}; void c; `, } as const; const results = compileProbes(probes); - it('accepts the bare cron string and the omitted defaults under `ConnectorInput`', () => { + it('accepts the bare cron string and the omitted defaults under the bare `Connector`', () => { expect(render(results.get('author-connector')!)).toBe(''); }); - it('rejects the same literal under `Connector`, on the cron envelope and the defaults', () => { + it('rejects the same literal under `ConnectorParsed`, on the cron envelope and the defaults', () => { const message = render(results.get('parsed-connector')!); expect(message).toContain("Type 'string' is not assignable"); expect(message).toContain('dialect'); diff --git a/packages/spec/src/integration/connector.zod.ts b/packages/spec/src/integration/connector.zod.ts index f4fb73db48..449abf8743 100644 --- a/packages/spec/src/integration/connector.zod.ts +++ b/packages/spec/src/integration/connector.zod.ts @@ -147,7 +147,7 @@ export const ConnectorFieldMappingSchema = lazySchema(() => BaseFieldMappingSche ]).default('bidirectional').describe('Sync mode'), })); -export type ConnectorFieldMapping = z.infer; +export type ConnectorFieldMapping = z.input; /** Post-parse shape of {@link ConnectorFieldMapping} — defaults applied, transforms run (ADR-0122). */ export type ConnectorFieldMappingParsed = z.infer; @@ -165,7 +165,7 @@ export const SyncStrategySchema = lazySchema(() => z.enum([ 'append_only', // Only insert new records ]).describe('Synchronization strategy')); -export type SyncStrategy = z.infer; +export type SyncStrategy = z.input; /** * Connector Conflict Resolution Strategy @@ -191,7 +191,7 @@ export const ConnectorConflictResolutionSchema = lazySchema(() => z.enum([ 'manual', // Flag for manual resolution ]).describe('Conflict resolution strategy')); -export type ConnectorConflictResolution = z.infer; +export type ConnectorConflictResolution = z.input; /** * Data Synchronization Configuration @@ -251,7 +251,7 @@ export const DataSyncConfigSchema = lazySchema(() => z.object({ filters: z.record(z.string(), z.unknown()).optional().describe('Filter criteria for selective sync'), })); -export type DataSyncConfig = z.infer; +export type DataSyncConfig = z.input; /** Post-parse shape of {@link DataSyncConfig} — defaults applied, transforms run (ADR-0122). */ export type DataSyncConfigParsed = z.infer; @@ -273,7 +273,7 @@ export const WebhookEventSchema = lazySchema(() => z.enum([ 'rate_limit.exceeded', ]).describe('Webhook event type')); -export type WebhookEvent = z.infer; +export type WebhookEvent = z.input; /** * Webhook Signature Algorithm @@ -284,7 +284,7 @@ export const WebhookSignatureAlgorithmSchema = lazySchema(() => z.enum([ 'none', ]).describe('Webhook signature algorithm')); -export type WebhookSignatureAlgorithm = z.infer; +export type WebhookSignatureAlgorithm = z.input; /** * Webhook Configuration Schema @@ -310,7 +310,7 @@ export const WebhookConfigSchema = lazySchema(() => WebhookSchema.extend({ signatureAlgorithm: WebhookSignatureAlgorithmSchema.optional().default('hmac_sha256'), })); -export type WebhookConfig = z.infer; +export type WebhookConfig = z.input; /** Post-parse shape of {@link WebhookConfig} — defaults applied, transforms run (ADR-0122). */ export type WebhookConfigParsed = z.infer; @@ -363,7 +363,7 @@ export const ConnectorRetryStrategySchema = lazySchema(() => z.enum([ 'no_retry', ]).describe('Retry strategy')); -export type ConnectorRetryStrategy = z.infer; +export type ConnectorRetryStrategy = z.input; /** * Retry Configuration @@ -410,7 +410,7 @@ export const RetryConfigSchema = lazySchema(() => z.object({ jitter: z.boolean().optional().default(true).describe('Add jitter to retry delays'), })); -export type RetryConfig = z.infer; +export type RetryConfig = z.input; /** Post-parse shape of {@link RetryConfig} — defaults applied, transforms run (ADR-0122). */ export type RetryConfigParsed = z.infer; @@ -439,7 +439,7 @@ export const ConnectorErrorCategorySchema = lazySchema(() => z.enum([ 'integration_error', ]).describe('Standard error category')); -export type ConnectorErrorCategory = z.infer; +export type ConnectorErrorCategory = z.input; /** * Error Mapping Rule @@ -456,7 +456,7 @@ export const ErrorMappingRuleSchema = lazySchema(() => z.object({ userMessage: z.string().optional().describe('Human-readable message to show users'), }).describe('Error mapping rule')); -export type ErrorMappingRule = z.infer; +export type ErrorMappingRule = z.input; /** * Error Mapping Configuration @@ -470,7 +470,7 @@ export const ErrorMappingConfigSchema = lazySchema(() => z.object({ logUnmapped: z.boolean().optional().default(true).describe('Log unmapped errors'), }).describe('Error mapping configuration')); -export type ErrorMappingConfig = z.infer; +export type ErrorMappingConfig = z.input; /** Post-parse shape of {@link ErrorMappingConfig} — defaults applied, transforms run (ADR-0122). */ export type ErrorMappingConfigParsed = z.infer; @@ -494,7 +494,7 @@ export const HealthCheckConfigSchema = lazySchema(() => z.object({ healthyThreshold: z.number().optional().default(1).describe('Consecutive successes before marking healthy'), }).describe('Health check configuration')); -export type HealthCheckConfig = z.infer; +export type HealthCheckConfig = z.input; /** Post-parse shape of {@link HealthCheckConfig} — defaults applied, transforms run (ADR-0122). */ export type HealthCheckConfigParsed = z.infer; @@ -512,7 +512,7 @@ export const CircuitBreakerConfigSchema = lazySchema(() => z.object({ fallbackStrategy: z.enum(['cache', 'default_value', 'error', 'queue']).optional().describe('Fallback strategy when circuit is open'), }).describe('Circuit breaker configuration')); -export type CircuitBreakerConfig = z.infer; +export type CircuitBreakerConfig = z.input; /** Post-parse shape of {@link CircuitBreakerConfig} — defaults applied, transforms run (ADR-0122). */ export type CircuitBreakerConfigParsed = z.infer; @@ -526,7 +526,7 @@ export const ConnectorHealthSchema = lazySchema(() => z.object({ circuitBreaker: CircuitBreakerConfigSchema.optional().describe('Circuit breaker configuration'), }).describe('Connector health configuration')); -export type ConnectorHealth = z.infer; +export type ConnectorHealth = z.input; /** Post-parse shape of {@link ConnectorHealth} — defaults applied, transforms run (ADR-0122). */ export type ConnectorHealthParsed = z.infer; @@ -546,7 +546,7 @@ export const ConnectorTypeSchema = lazySchema(() => z.enum([ 'custom', // Custom connector ]).describe('Connector type')); -export type ConnectorType = z.infer; +export type ConnectorType = z.input; /** * Connector Status @@ -558,7 +558,7 @@ export const ConnectorStatusSchema = lazySchema(() => z.enum([ 'configuring', // Connector is being set up ]).describe('Connector status')); -export type ConnectorStatus = z.infer; +export type ConnectorStatus = z.input; /** * What one connector action does **upstream** (#4395). @@ -597,7 +597,7 @@ export const ConnectorActionEffectSchema = lazySchema(() => z.enum([ 'write', ]).describe("What the action does upstream: 'read' never mutates (reports acted:0); 'write' does (a successful dispatch reports acted:1). Omit when the effect is not knowable — the step is then reported as unmeasured, not as zero")); -export type ConnectorActionEffect = z.infer; +export type ConnectorActionEffect = z.input; /** * Connector Action Definition @@ -808,18 +808,16 @@ export const ConnectorSchema = lazySchema(() => z.object({ metadata: z.record(z.string(), z.unknown()).optional().describe('Custom connector metadata'), })); -export type Connector = z.infer; +export type Connector = z.input; /** Post-parse shape of {@link Connector} — defaults applied, transforms run (ADR-0122). */ export type ConnectorParsed = z.infer; -/** Authoring input for {@link Connector} — defaulted fields are optional. */ -export type ConnectorInput = z.input; /** * Type-safe factory for an external-system connector. Validates at authoring time via * `.parse()` and accepts input-shape config (optional defaults, CEL * shorthand) — preferred over a bare `: Connector` literal. */ -export function defineConnector(config: z.input): Connector { +export function defineConnector(config: z.input): ConnectorParsed { return ConnectorSchema.parse(config); } @@ -885,7 +883,7 @@ export const DeclarativeConnectorEntrySchema = lazySchema(() => }), ); -export type DeclarativeConnectorEntry = z.infer; +export type DeclarativeConnectorEntry = z.input; /** Post-parse shape of {@link DeclarativeConnectorEntry} — defaults applied, transforms run (ADR-0122). */ export type DeclarativeConnectorEntryParsed = z.infer; diff --git a/packages/spec/src/kernel/cli-extension.zod.ts b/packages/spec/src/kernel/cli-extension.zod.ts index 358f907b20..9d6f5eac06 100644 --- a/packages/spec/src/kernel/cli-extension.zod.ts +++ b/packages/spec/src/kernel/cli-extension.zod.ts @@ -125,5 +125,5 @@ export const OclifPluginConfigSchema = lazySchema(() => z.object({ // ─── Types ─────────────────────────────────────────────────────────── -export type CLICommandContribution = z.infer; -export type OclifPluginConfig = z.infer; +export type CLICommandContribution = z.input; +export type OclifPluginConfig = z.input; diff --git a/packages/spec/src/kernel/cluster.zod.ts b/packages/spec/src/kernel/cluster.zod.ts index f1a3450b4d..8936b3c525 100644 --- a/packages/spec/src/kernel/cluster.zod.ts +++ b/packages/spec/src/kernel/cluster.zod.ts @@ -42,7 +42,7 @@ import { lazySchema } from '../shared/lazy-schema'; export const EventScopeSchema = z.enum(['local', 'cluster', 'tenant']) .describe('Where the event must be delivered: local process, whole cluster, or tenant-scoped.'); -export type EventScope = z.infer; +export type EventScope = z.input; /** * Event Delivery Semantics. @@ -68,7 +68,7 @@ export const EventDeliverySemanticsSchema = z.enum([ 'exactly-once', ]).describe('Delivery guarantee offered by the transport.'); -export type EventDeliverySemantics = z.infer; +export type EventDeliverySemantics = z.input; /** * Per-emit cluster options attached to `EventMetadata.cluster`. @@ -104,7 +104,7 @@ export const EventClusterOptionsSchema = lazySchema(() => z.object({ .describe('Stable key that guarantees emit-order delivery for same-key events.'), }).describe('Per-emit cluster routing & ordering options.')); -export type EventClusterOptions = z.infer; +export type EventClusterOptions = z.input; /** Post-parse shape of {@link EventClusterOptions} — defaults applied, transforms run (ADR-0122). */ export type EventClusterOptionsParsed = z.infer; @@ -129,7 +129,7 @@ export type EventClusterOptionsParsed = z.infer; +export type ServiceClusterScope = z.input; /** * Strategy for maintaining the cluster-singleton invariant. @@ -155,7 +155,7 @@ export const ServiceLeaderStrategySchema = z.enum([ 'idempotent-broadcast', ]).describe('How the cluster-singleton invariant is enforced at runtime.'); -export type ServiceLeaderStrategy = z.infer; +export type ServiceLeaderStrategy = z.input; /** * Cluster annotations on a service registration. @@ -190,7 +190,7 @@ export const ServiceClusterAnnotationsSchema = lazySchema(() => z.object({ .describe('Logical cluster identity used for leader election (defaults to service name).'), }).describe('Service-registration annotations governing cluster behaviour.')); -export type ServiceClusterAnnotations = z.infer; +export type ServiceClusterAnnotations = z.input; /** Post-parse shape of {@link ServiceClusterAnnotations} — defaults applied, transforms run (ADR-0122). */ export type ServiceClusterAnnotationsParsed = z.infer; @@ -215,7 +215,7 @@ export const ClusterDriverSchema = z.enum([ 'custom', // Plugin-provided driver; runtime looks it up by name. ]).describe('Cluster transport driver.'); -export type ClusterDriver = z.infer; +export type ClusterDriver = z.input; /** * Tenant isolation strategy on shared transports. @@ -230,7 +230,7 @@ export type ClusterDriver = z.infer; export const ClusterTenantIsolationSchema = z.enum(['channel-prefix', 'none']) .describe('How tenant traffic is separated on shared transports.'); -export type ClusterTenantIsolation = z.infer; +export type ClusterTenantIsolation = z.input; /** * Cluster configuration block on `defineStack({ cluster })`. @@ -316,10 +316,9 @@ export const ClusterCapabilityConfigSchema = lazySchema(() => z.object({ .describe('Driver-specific opaque options.'), }).describe('Cluster capability configuration for the stack.')); -export type ClusterCapabilityConfig = z.infer; +export type ClusterCapabilityConfig = z.input; /** Post-parse shape of {@link ClusterCapabilityConfig} — defaults applied, transforms run (ADR-0122). */ export type ClusterCapabilityConfigParsed = z.infer; -export type ClusterCapabilityConfigInput = z.input; // ========================================================================== // Metadata Change Event Payload @@ -335,7 +334,7 @@ export const MetadataChangeOperationSchema = z.enum([ 'publish', ]).describe('Persistence operation that triggered the change.'); -export type MetadataChangeOperation = z.infer; +export type MetadataChangeOperation = z.input; /** * Canonical payload for the `metadata:changed` event. @@ -389,4 +388,4 @@ export const MetadataChangedEventPayloadSchema = lazySchema(() => z.object({ .describe('Trace correlation id of the originating request.'), }).describe('Canonical payload for the metadata:changed cluster event.')); -export type MetadataChangedEventPayload = z.infer; +export type MetadataChangedEventPayload = z.input; diff --git a/packages/spec/src/kernel/context.zod.ts b/packages/spec/src/kernel/context.zod.ts index b55d63d7af..50d630178b 100644 --- a/packages/spec/src/kernel/context.zod.ts +++ b/packages/spec/src/kernel/context.zod.ts @@ -16,7 +16,7 @@ export const RuntimeMode = z.enum([ 'preview', // Demo/preview mode — bypass auth, simulate admin identity ]).describe('Kernel operating mode'); -export type RuntimeMode = z.infer; +export type RuntimeMode = z.input; /** * Preview Mode Configuration Schema @@ -88,7 +88,7 @@ export const PreviewModeConfigSchema = lazySchema(() => z.object({ .describe('Banner message displayed in the UI during preview mode'), })); -export type PreviewModeConfig = z.infer; +export type PreviewModeConfig = z.input; /** Post-parse shape of {@link PreviewModeConfig} — defaults applied, transforms run (ADR-0122). */ export type PreviewModeConfigParsed = z.infer; @@ -134,7 +134,7 @@ export const KernelContextSchema = lazySchema(() => z.object({ .describe('Preview/demo mode configuration (used when mode is "preview")'), })); -export type KernelContext = z.infer; +export type KernelContext = z.input; /** Post-parse shape of {@link KernelContext} — defaults applied, transforms run (ADR-0122). */ export type KernelContextParsed = z.infer; @@ -167,6 +167,6 @@ export const TenantRuntimeContextSchema = lazySchema(() => KernelContextSchema.e tenantQuotas: TenantQuotaSchema.optional().describe('Tenant resource quotas'), }).describe('Tenant-aware kernel runtime context')); -export type TenantRuntimeContext = z.infer; +export type TenantRuntimeContext = z.input; /** Post-parse shape of {@link TenantRuntimeContext} — defaults applied, transforms run (ADR-0122). */ export type TenantRuntimeContextParsed = z.infer; diff --git a/packages/spec/src/kernel/dependency-resolution.zod.ts b/packages/spec/src/kernel/dependency-resolution.zod.ts index 3ba3cb48df..d135623525 100644 --- a/packages/spec/src/kernel/dependency-resolution.zod.ts +++ b/packages/spec/src/kernel/dependency-resolution.zod.ts @@ -40,7 +40,7 @@ export const DependencyStatusEnum = z.enum([ 'conflict', // Conflicts with another package's dependency ]).describe('Resolution status for a dependency'); -export type DependencyStatus = z.infer; +export type DependencyStatus = z.input; // ========================================== // Resolved Dependency @@ -73,7 +73,7 @@ export const ResolvedDependencySchema = lazySchema(() => z.object({ .describe('Explanation of the conflict'), }).describe('Resolution result for a single dependency')); -export type ResolvedDependency = z.infer; +export type ResolvedDependency = z.input; // ========================================== // Required Action @@ -94,7 +94,7 @@ export const RequiredActionSchema = lazySchema(() => z.object({ description: z.string().describe('Human-readable action description'), }).describe('Action required before installation can proceed')); -export type RequiredAction = z.infer; +export type RequiredAction = z.input; // ========================================== // Dependency Resolution Result @@ -126,4 +126,4 @@ export const DependencyResolutionResultSchema = lazySchema(() => z.object({ .describe('Circular dependency chains detected (e.g. [["A", "B", "A"]])'), }).describe('Complete dependency resolution result')); -export type DependencyResolutionResult = z.infer; +export type DependencyResolutionResult = z.input; diff --git a/packages/spec/src/kernel/events/bus.zod.ts b/packages/spec/src/kernel/events/bus.zod.ts index 5f2ba94a5b..a398304afe 100644 --- a/packages/spec/src/kernel/events/bus.zod.ts +++ b/packages/spec/src/kernel/events/bus.zod.ts @@ -74,6 +74,6 @@ export const EventBusConfigSchema = lazySchema(() => z.object({ handlers: z.array(EventHandlerSchema).optional().describe('Global event handlers'), })); -export type EventBusConfig = z.infer; +export type EventBusConfig = z.input; /** Post-parse shape of {@link EventBusConfig} — defaults applied, transforms run (ADR-0122). */ export type EventBusConfigParsed = z.infer; diff --git a/packages/spec/src/kernel/events/core.zod.ts b/packages/spec/src/kernel/events/core.zod.ts index 41e61f1b32..4d9ed70c6b 100644 --- a/packages/spec/src/kernel/events/core.zod.ts +++ b/packages/spec/src/kernel/events/core.zod.ts @@ -22,7 +22,7 @@ export const EventPriority = z.enum([ 'background', // 4 - Process during idle time ]); -export type EventPriority = z.infer; +export type EventPriority = z.input; /** * Event Priority Values @@ -99,7 +99,7 @@ export const EventTypeDefinitionSchema = lazySchema(() => z.object({ tags: z.array(z.string()).optional().describe('Event type tags'), })); -export type EventTypeDefinition = z.infer; +export type EventTypeDefinition = z.input; /** Post-parse shape of {@link EventTypeDefinition} — defaults applied, transforms run (ADR-0122). */ export type EventTypeDefinitionParsed = z.infer; @@ -132,6 +132,6 @@ export const EventSchema = lazySchema(() => z.object({ metadata: EventMetadataSchema.describe('Event metadata'), })); -export type Event = z.infer; +export type Event = z.input; /** Post-parse shape of {@link Event} — defaults applied, transforms run (ADR-0122). */ export type EventParsed = z.infer; diff --git a/packages/spec/src/kernel/events/dlq.zod.ts b/packages/spec/src/kernel/events/dlq.zod.ts index f0a3b1490e..8504092e41 100644 --- a/packages/spec/src/kernel/events/dlq.zod.ts +++ b/packages/spec/src/kernel/events/dlq.zod.ts @@ -49,7 +49,7 @@ export const DeadLetterQueueEntrySchema = lazySchema(() => z.object({ failedHandler: z.string().optional().describe('Handler ID that failed'), })); -export type DeadLetterQueueEntry = z.infer; +export type DeadLetterQueueEntry = z.input; /** Post-parse shape of {@link DeadLetterQueueEntry} — defaults applied, transforms run (ADR-0122). */ export type DeadLetterQueueEntryParsed = z.infer; @@ -99,6 +99,6 @@ export const EventLogEntrySchema = lazySchema(() => z.object({ totalDurationMs: z.number().int().optional().describe('Total processing time'), })); -export type EventLogEntry = z.infer; +export type EventLogEntry = z.input; /** Post-parse shape of {@link EventLogEntry} — defaults applied, transforms run (ADR-0122). */ export type EventLogEntryParsed = z.infer; diff --git a/packages/spec/src/kernel/events/handlers.zod.ts b/packages/spec/src/kernel/events/handlers.zod.ts index 1fd9584e73..0873251b40 100644 --- a/packages/spec/src/kernel/events/handlers.zod.ts +++ b/packages/spec/src/kernel/events/handlers.zod.ts @@ -60,7 +60,7 @@ export const EventHandlerSchema = lazySchema(() => z.object({ .describe('Optional filter to determine if handler should execute'), })); -export type EventHandler = z.infer; +export type EventHandler = z.input; /** Post-parse shape of {@link EventHandler} — defaults applied, transforms run (ADR-0122). */ export type EventHandlerParsed = z.infer; @@ -74,7 +74,7 @@ export const EventRouteSchema = lazySchema(() => z.object({ transform: z.unknown().optional().describe('Optional function to transform payload'), })); -export type EventRoute = z.infer; +export type EventRoute = z.input; /** * Event Persistence Schema @@ -88,6 +88,6 @@ export const EventPersistenceSchema = lazySchema(() => z.object({ .describe('Storage backend for persisted events'), })); -export type EventPersistence = z.infer; +export type EventPersistence = z.input; /** Post-parse shape of {@link EventPersistence} — defaults applied, transforms run (ADR-0122). */ export type EventPersistenceParsed = z.infer; diff --git a/packages/spec/src/kernel/events/integrations.zod.ts b/packages/spec/src/kernel/events/integrations.zod.ts index bf8583e4be..ffe80dc387 100644 --- a/packages/spec/src/kernel/events/integrations.zod.ts +++ b/packages/spec/src/kernel/events/integrations.zod.ts @@ -81,7 +81,7 @@ export const EventWebhookConfigSchema = lazySchema(() => z.object({ enabled: z.boolean().default(true).describe('Whether webhook is enabled'), })); -export type EventWebhookConfig = z.infer; +export type EventWebhookConfig = z.input; /** Post-parse shape of {@link EventWebhookConfig} — defaults applied, transforms run (ADR-0122). */ export type EventWebhookConfigParsed = z.infer; @@ -149,7 +149,7 @@ export const EventMessageQueueConfigSchema = lazySchema(() => z.object({ flushIntervalMs: z.number().int().positive().default(1000).describe('Flush interval for batching'), })); -export type EventMessageQueueConfig = z.infer; +export type EventMessageQueueConfig = z.input; /** Post-parse shape of {@link EventMessageQueueConfig} — defaults applied, transforms run (ADR-0122). */ export type EventMessageQueueConfigParsed = z.infer; @@ -216,6 +216,6 @@ export const RealTimeNotificationConfigSchema = lazySchema(() => z.object({ }).optional().describe('Rate limiting configuration'), })); -export type RealTimeNotificationConfig = z.infer; +export type RealTimeNotificationConfig = z.input; /** Post-parse shape of {@link RealTimeNotificationConfig} — defaults applied, transforms run (ADR-0122). */ export type RealTimeNotificationConfigParsed = z.infer; diff --git a/packages/spec/src/kernel/events/queue.zod.ts b/packages/spec/src/kernel/events/queue.zod.ts index 88b8ad8581..6d389cb9a5 100644 --- a/packages/spec/src/kernel/events/queue.zod.ts +++ b/packages/spec/src/kernel/events/queue.zod.ts @@ -54,7 +54,7 @@ export const EventQueueConfigSchema = lazySchema(() => z.object({ priorityEnabled: z.boolean().default(true).describe('Process events based on priority'), })); -export type EventQueueConfig = z.infer; +export type EventQueueConfig = z.input; /** Post-parse shape of {@link EventQueueConfig} — defaults applied, transforms run (ADR-0122). */ export type EventQueueConfigParsed = z.infer; @@ -106,7 +106,7 @@ export const EventReplayConfigSchema = lazySchema(() => z.object({ targetHandlers: z.array(z.string()).optional().describe('Handler IDs to execute (empty = all)'), })); -export type EventReplayConfig = z.infer; +export type EventReplayConfig = z.input; /** Post-parse shape of {@link EventReplayConfig} — defaults applied, transforms run (ADR-0122). */ export type EventReplayConfigParsed = z.infer; @@ -168,6 +168,6 @@ export const EventSourcingConfigSchema = lazySchema(() => z.object({ }).optional().describe('Event store configuration'), })); -export type EventSourcingConfig = z.infer; +export type EventSourcingConfig = z.input; /** Post-parse shape of {@link EventSourcingConfig} — defaults applied, transforms run (ADR-0122). */ export type EventSourcingConfigParsed = z.infer; diff --git a/packages/spec/src/kernel/execution-context.zod.ts b/packages/spec/src/kernel/execution-context.zod.ts index 3eac839e2c..d05b5afaaa 100644 --- a/packages/spec/src/kernel/execution-context.zod.ts +++ b/packages/spec/src/kernel/execution-context.zod.ts @@ -376,17 +376,12 @@ export const ExecutionContextSchema = lazySchema(() => z.object({ traceId: z.string().optional(), })); -export type ExecutionContext = z.infer; -/** Post-parse shape of {@link ExecutionContext} — defaults applied, transforms run (ADR-0122). */ -export type ExecutionContextParsed = z.infer; - /** - * The CALLER-SUPPLIED form of {@link ExecutionContext} — any subset of the - * envelope. + * The CALLER-SUPPLIED form of the execution envelope — any subset of it. * * `positions`/`permissions`/`isSystem` carry parse-time defaults, so they are - * required in the inferred *output* type ({@link ExecutionContext}) even though - * a caller never has to write them. This is the *input* side: what a data + * required in the parsed shape ({@link ExecutionContextParsed}) even though a + * caller never has to write them. This is the *input* side: what a data * operation may actually be handed. Use it wherever a context arrives from a * caller rather than out of a parse — `options.context` and everything the * engine threads it into. @@ -394,5 +389,11 @@ export type ExecutionContextParsed = z.infer; * Some callers have no principal to state at all: a system read passes * `{ isSystem: true }`, and a flow run with no resolvable identity passes * provenance alone (`{ flowRunId }`, #3712). + * + * Spelled `ExecutionContextInput` until protocol 17; ADR-0122 phase 2 moved the + * author state onto the bare name and retired that synonym. */ -export type ExecutionContextInput = z.input; +export type ExecutionContext = z.input; +/** Post-parse shape of {@link ExecutionContext} — defaults applied, transforms run (ADR-0122). */ +export type ExecutionContextParsed = z.infer; + diff --git a/packages/spec/src/kernel/manifest.zod.ts b/packages/spec/src/kernel/manifest.zod.ts index eb809cfb27..0444e4e4fb 100644 --- a/packages/spec/src/kernel/manifest.zod.ts +++ b/packages/spec/src/kernel/manifest.zod.ts @@ -44,7 +44,7 @@ export const PluginPermissionsSchema = z .strict() .describe('Structured plugin permission grants (ADR-0025 §3.2)'); -export type PluginPermissions = z.infer; +export type PluginPermissions = z.input; /** * Backward-compatible manifest `permissions` value: either the legacy flat @@ -56,7 +56,7 @@ export const ManifestPermissionsSchema = z.union([ PluginPermissionsSchema, ]); -export type ManifestPermissions = z.infer; +export type ManifestPermissions = z.input; /** * Compatibility ranges for a plugin (ADR-0025 §3.2, §3.10 #3). @@ -73,7 +73,7 @@ export const PluginEnginesSchema = z }) .describe('Plugin compatibility ranges (ADR-0025 §3.2)'); -export type PluginEngines = z.infer; +export type PluginEngines = z.input; /** * Trust / isolation tier the plugin runs under (ADR-0025 §3.6): @@ -85,7 +85,7 @@ export const PluginRuntimeSchema = z .enum(['node', 'sandbox', 'worker']) .describe('Plugin trust tier (ADR-0025 §3.6)'); -export type PluginRuntime = z.infer; +export type PluginRuntime = z.input; /** * Dependency packaging strategy (ADR-0025 §3.3): @@ -96,7 +96,7 @@ export const PluginPackagingSchema = z .enum(['bundled', 'manifest-deps']) .describe('Dependency packaging strategy (ADR-0025 §3.3)'); -export type PluginPackaging = z.infer; +export type PluginPackaging = z.input; /** * Per-file content digests of the packaged artifact (ADR-0025 §3.2), @@ -108,7 +108,7 @@ export const PluginIntegritySchema = z .record(z.string(), z.string()) .describe('Per-file content digests of the plugin artifact (ADR-0025 §3.2)'); -export type PluginIntegrity = z.infer; +export type PluginIntegrity = z.input; /** * Schema for the ObjectStack Manifest. @@ -560,8 +560,7 @@ export const ManifestSchema = z.object({ * TypeScript type inferred from the ManifestSchema. * Use this type for type-safe manifest handling in TypeScript code. */ -export type ObjectStackManifest = z.infer; +export type ObjectStackManifest = z.input; /** Post-parse shape of {@link ObjectStackManifest} — defaults applied, transforms run (ADR-0122). */ export type ObjectStackManifestParsed = z.infer; -export type ObjectStackManifestInput = z.input; diff --git a/packages/spec/src/kernel/metadata-customization.zod.ts b/packages/spec/src/kernel/metadata-customization.zod.ts index 10f127e7c0..078ab6c5ed 100644 --- a/packages/spec/src/kernel/metadata-customization.zod.ts +++ b/packages/spec/src/kernel/metadata-customization.zod.ts @@ -306,16 +306,16 @@ export const CustomizationPolicySchema = lazySchema(() => z.object({ // Export Types // ========================================== -export type CustomizationOrigin = z.infer; -export type FieldChange = z.infer; -export type MetadataOverlay = z.infer; +export type CustomizationOrigin = z.input; +export type FieldChange = z.input; +export type MetadataOverlay = z.input; /** Post-parse shape of {@link MetadataOverlay} — defaults applied, transforms run (ADR-0122). */ export type MetadataOverlayParsed = z.infer; -export type MergeConflict = z.infer; -export type MergeStrategyConfig = z.infer; +export type MergeConflict = z.input; +export type MergeStrategyConfig = z.input; /** Post-parse shape of {@link MergeStrategyConfig} — defaults applied, transforms run (ADR-0122). */ export type MergeStrategyConfigParsed = z.infer; -export type MergeResult = z.infer; -export type CustomizationPolicy = z.infer; +export type MergeResult = z.input; +export type CustomizationPolicy = z.input; /** Post-parse shape of {@link CustomizationPolicy} — defaults applied, transforms run (ADR-0122). */ export type CustomizationPolicyParsed = z.infer; diff --git a/packages/spec/src/kernel/metadata-loader.zod.ts b/packages/spec/src/kernel/metadata-loader.zod.ts index fb02e526e0..53e20f5e55 100644 --- a/packages/spec/src/kernel/metadata-loader.zod.ts +++ b/packages/spec/src/kernel/metadata-loader.zod.ts @@ -147,4 +147,6 @@ export const MetadataManagerConfigSchema = lazySchema(() => z.object({ // Export types export type MetadataManagerConfig = z.input; -export type MetadataFallbackStrategy = z.infer; +/** Post-parse shape of {@link MetadataManagerConfig} — defaults applied, transforms run (ADR-0122). */ +export type MetadataManagerConfigParsed = z.infer; +export type MetadataFallbackStrategy = z.input; diff --git a/packages/spec/src/kernel/metadata-plugin.zod.ts b/packages/spec/src/kernel/metadata-plugin.zod.ts index d1ebfaf72e..7df01b05ca 100644 --- a/packages/spec/src/kernel/metadata-plugin.zod.ts +++ b/packages/spec/src/kernel/metadata-plugin.zod.ts @@ -157,7 +157,7 @@ export const MetadataTypeSchema = lazySchema(() => z.enum([ 'skill', // AI skill definitions (SkillSchema) ])); -export type MetadataType = z.infer; +export type MetadataType = z.input; // ========================================== // Type Registry Entry @@ -301,7 +301,7 @@ export const MetadataTypeRegistryEntrySchema = lazySchema(() => }) ); -export type MetadataTypeRegistryEntry = z.infer; +export type MetadataTypeRegistryEntry = z.input; /** Post-parse shape of {@link MetadataTypeRegistryEntry} — defaults applied, transforms run (ADR-0122). */ export type MetadataTypeRegistryEntryParsed = z.infer; @@ -351,6 +351,8 @@ export const MetadataQuerySchema = lazySchema(() => z.object({ })); export type MetadataQuery = z.input; +/** Post-parse shape of {@link MetadataQuery} — defaults applied, transforms run (ADR-0122). */ +export type MetadataQueryParsed = z.infer; /** * Metadata Query Result @@ -378,7 +380,7 @@ export const MetadataQueryResultSchema = lazySchema(() => z.object({ pageSize: z.number().int().min(1).describe('Page size'), })); -export type MetadataQueryResult = z.infer; +export type MetadataQueryResult = z.input; // ========================================== // Metadata Lifecycle Events @@ -420,7 +422,7 @@ export const MetadataValidationResultSchema = lazySchema(() => z.object({ })).optional().describe('Validation warnings'), })); -export type MetadataValidationResult = z.infer; +export type MetadataValidationResult = z.input; // ========================================== // Metadata Plugin Configuration @@ -515,6 +517,8 @@ export const MetadataPluginConfigSchema = lazySchema(() => z.object({ })); export type MetadataPluginConfig = z.input; +/** Post-parse shape of {@link MetadataPluginConfig} — defaults applied, transforms run (ADR-0122). */ +export type MetadataPluginConfigParsed = z.infer; // ========================================== // Metadata Plugin Manifest @@ -579,6 +583,8 @@ export const MetadataPluginManifestSchema = lazySchema(() => z.object({ })); export type MetadataPluginManifest = z.input; +/** Post-parse shape of {@link MetadataPluginManifest} — defaults applied, transforms run (ADR-0122). */ +export type MetadataPluginManifestParsed = z.infer; // ========================================== // Built-in Type Registry Defaults @@ -590,7 +596,7 @@ export type MetadataPluginManifest = z.input z.object({ })).optional().describe('Per-item errors'), })); -export type MetadataBulkResult = z.infer; +export type MetadataBulkResult = z.input; // ========================================== // Metadata Dependency @@ -895,4 +901,4 @@ export const MetadataDependencySchema = lazySchema(() => z.object({ .describe('How the dependency is formed'), })); -export type MetadataDependency = z.infer; +export type MetadataDependency = z.input; diff --git a/packages/spec/src/kernel/metadata-protection.zod.ts b/packages/spec/src/kernel/metadata-protection.zod.ts index 704b011163..ecd2c253b6 100644 --- a/packages/spec/src/kernel/metadata-protection.zod.ts +++ b/packages/spec/src/kernel/metadata-protection.zod.ts @@ -48,15 +48,15 @@ import { z } from 'zod'; * (which describes an existing item). See ADR-0010 §3.3. */ export const MetadataLockSchema = z.enum(['none', 'no-overlay', 'no-delete', 'full']); -export type MetadataLock = z.infer; +export type MetadataLock = z.input; /** Where the `_lock` declaration came from. Reserved enum for forward compatibility. */ export const MetadataLockSourceSchema = z.enum(['artifact', 'package', 'env-forced']); -export type MetadataLockSource = z.infer; +export type MetadataLockSource = z.input; /** Where the metadata item originated. */ export const MetadataProvenanceSchema = z.enum(['package', 'org', 'env-forced']); -export type MetadataProvenance = z.infer; +export type MetadataProvenance = z.input; // ───────────────────────────────────────────────────────────────────── // Mixin — raw shape that schemas spread into themselves diff --git a/packages/spec/src/kernel/package-artifact.zod.ts b/packages/spec/src/kernel/package-artifact.zod.ts index c63454a8e3..879c181cf9 100644 --- a/packages/spec/src/kernel/package-artifact.zod.ts +++ b/packages/spec/src/kernel/package-artifact.zod.ts @@ -64,7 +64,7 @@ export const MetadataCategoryEnum = z.enum([ 'workflows', ]).describe('Metadata category within the artifact'); -export type MetadataCategory = z.infer; +export type MetadataCategory = z.input; // ========================================== // Artifact File Entry @@ -85,7 +85,7 @@ export const ArtifactFileEntrySchema = lazySchema(() => z.object({ .describe('Metadata category this file belongs to'), }).describe('A single file entry within the artifact')); -export type ArtifactFileEntry = z.infer; +export type ArtifactFileEntry = z.input; // ========================================== // Artifact Checksum @@ -111,7 +111,7 @@ export const ArtifactChecksumSchema = lazySchema(() => z.object({ .describe('File path to hash value mapping'), }).describe('Checksum manifest for artifact integrity verification')); -export type ArtifactChecksum = z.infer; +export type ArtifactChecksum = z.input; /** Post-parse shape of {@link ArtifactChecksum} — defaults applied, transforms run (ADR-0122). */ export type ArtifactChecksumParsed = z.infer; @@ -145,7 +145,7 @@ export const ArtifactSignatureSchema = lazySchema(() => z.object({ .describe('Identity of the signer (publisher ID or email)'), }).describe('Digital signature for artifact authenticity verification')); -export type ArtifactSignature = z.infer; +export type ArtifactSignature = z.input; /** Post-parse shape of {@link ArtifactSignature} — defaults applied, transforms run (ADR-0122). */ export type ArtifactSignatureParsed = z.infer; @@ -203,7 +203,6 @@ export const PackageArtifactSchema = lazySchema(() => z.object({ .describe('Digital signature for artifact authenticity verification'), }).describe('Package artifact structure and metadata')); -export type PackageArtifact = z.infer; +export type PackageArtifact = z.input; /** Post-parse shape of {@link PackageArtifact} — defaults applied, transforms run (ADR-0122). */ export type PackageArtifactParsed = z.infer; -export type PackageArtifactInput = z.input; diff --git a/packages/spec/src/kernel/package-registry.zod.ts b/packages/spec/src/kernel/package-registry.zod.ts index 6f5a705144..e6965c41ca 100644 --- a/packages/spec/src/kernel/package-registry.zod.ts +++ b/packages/spec/src/kernel/package-registry.zod.ts @@ -44,7 +44,7 @@ export const PackageStatusEnum = z.enum([ 'uninstalling', // Removal in progress 'error', // Installation or runtime error ]).describe('Package installation status'); -export type PackageStatus = z.infer; +export type PackageStatus = z.input; /** * Installed Package Schema @@ -140,7 +140,7 @@ export const InstalledPackageSchema = lazySchema(() => z.object({ registeredNamespaces: z.array(z.string()).optional() .describe('Namespace prefixes registered by this package'), }).describe('Installed package with runtime lifecycle state')); -export type InstalledPackage = z.infer; +export type InstalledPackage = z.input; /** Post-parse shape of {@link InstalledPackage} — defaults applied, transforms run (ADR-0122). */ export type InstalledPackageParsed = z.infer; @@ -167,7 +167,7 @@ export const NamespaceRegistryEntrySchema = lazySchema(() => z.object({ .describe('Namespace status'), }).describe('Namespace ownership entry in the registry')); -export type NamespaceRegistryEntry = z.infer; +export type NamespaceRegistryEntry = z.input; /** * Namespace Conflict Error @@ -191,7 +191,7 @@ export const NamespaceConflictErrorSchema = lazySchema(() => z.object({ .describe('Suggested alternative namespace'), }).describe('Namespace collision error during installation')); -export type NamespaceConflictError = z.infer; +export type NamespaceConflictError = z.input; // ========================================== // Package Registry Request/Response Schemas @@ -208,7 +208,7 @@ export const ListPackagesRequestSchema = lazySchema(() => z.object({ /** Filter by enabled state */ enabled: z.boolean().optional().describe('Filter by enabled state'), }).describe('List packages request')); -export type ListPackagesRequest = z.infer; +export type ListPackagesRequest = z.input; /** * List Packages Response @@ -217,7 +217,7 @@ export const ListPackagesResponseSchema = lazySchema(() => z.object({ packages: z.array(InstalledPackageSchema).describe('List of installed packages'), total: z.number().describe('Total package count'), }).describe('List packages response')); -export type ListPackagesResponse = z.infer; +export type ListPackagesResponse = z.input; /** Post-parse shape of {@link ListPackagesResponse} — defaults applied, transforms run (ADR-0122). */ export type ListPackagesResponseParsed = z.infer; @@ -228,7 +228,7 @@ export const GetPackageRequestSchema = lazySchema(() => z.object({ /** Package ID (reverse domain identifier from manifest) */ id: z.string().describe('Package identifier'), }).describe('Get package request')); -export type GetPackageRequest = z.infer; +export type GetPackageRequest = z.input; /** * Get Package Response @@ -236,7 +236,7 @@ export type GetPackageRequest = z.infer; export const GetPackageResponseSchema = lazySchema(() => z.object({ package: InstalledPackageSchema.describe('Package details'), }).describe('Get package response')); -export type GetPackageResponse = z.infer; +export type GetPackageResponse = z.input; /** Post-parse shape of {@link GetPackageResponse} — defaults applied, transforms run (ADR-0122). */ export type GetPackageResponseParsed = z.infer; @@ -263,7 +263,7 @@ export const InstallPackageRequestSchema = lazySchema(() => z.object({ platformVersion: z.string().optional() .describe('Current platform version for compatibility verification'), }).describe('Install package request')); -export type InstallPackageRequest = z.infer; +export type InstallPackageRequest = z.input; /** Post-parse shape of {@link InstallPackageRequest} — defaults applied, transforms run (ADR-0122). */ export type InstallPackageRequestParsed = z.infer; @@ -277,7 +277,7 @@ export const InstallPackageResponseSchema = lazySchema(() => z.object({ dependencyResolution: DependencyResolutionResultSchema.optional() .describe('Dependency resolution result from install analysis'), }).describe('Install package response')); -export type InstallPackageResponse = z.infer; +export type InstallPackageResponse = z.input; /** Post-parse shape of {@link InstallPackageResponse} — defaults applied, transforms run (ADR-0122). */ export type InstallPackageResponseParsed = z.infer; @@ -288,7 +288,7 @@ export const UninstallPackageRequestSchema = lazySchema(() => z.object({ /** Package ID to uninstall */ id: z.string().describe('Package ID to uninstall'), }).describe('Uninstall package request')); -export type UninstallPackageRequest = z.infer; +export type UninstallPackageRequest = z.input; /** * Uninstall Package Response @@ -298,7 +298,7 @@ export const UninstallPackageResponseSchema = lazySchema(() => z.object({ success: z.boolean().describe('Whether uninstall succeeded'), message: z.string().optional().describe('Uninstall status message'), }).describe('Uninstall package response')); -export type UninstallPackageResponse = z.infer; +export type UninstallPackageResponse = z.input; /** * Enable Package Request @@ -307,7 +307,7 @@ export const EnablePackageRequestSchema = lazySchema(() => z.object({ /** Package ID to enable */ id: z.string().describe('Package ID to enable'), }).describe('Enable package request')); -export type EnablePackageRequest = z.infer; +export type EnablePackageRequest = z.input; /** * Enable Package Response @@ -316,7 +316,7 @@ export const EnablePackageResponseSchema = lazySchema(() => z.object({ package: InstalledPackageSchema.describe('Enabled package details'), message: z.string().optional().describe('Enable status message'), }).describe('Enable package response')); -export type EnablePackageResponse = z.infer; +export type EnablePackageResponse = z.input; /** Post-parse shape of {@link EnablePackageResponse} — defaults applied, transforms run (ADR-0122). */ export type EnablePackageResponseParsed = z.infer; @@ -327,7 +327,7 @@ export const DisablePackageRequestSchema = lazySchema(() => z.object({ /** Package ID to disable */ id: z.string().describe('Package ID to disable'), }).describe('Disable package request')); -export type DisablePackageRequest = z.infer; +export type DisablePackageRequest = z.input; /** * Disable Package Response @@ -336,6 +336,6 @@ export const DisablePackageResponseSchema = lazySchema(() => z.object({ package: InstalledPackageSchema.describe('Disabled package details'), message: z.string().optional().describe('Disable status message'), }).describe('Disable package response')); -export type DisablePackageResponse = z.infer; +export type DisablePackageResponse = z.input; /** Post-parse shape of {@link DisablePackageResponse} — defaults applied, transforms run (ADR-0122). */ export type DisablePackageResponseParsed = z.infer; diff --git a/packages/spec/src/kernel/package-upgrade.zod.ts b/packages/spec/src/kernel/package-upgrade.zod.ts index d81b4c737d..e724b5adf9 100644 --- a/packages/spec/src/kernel/package-upgrade.zod.ts +++ b/packages/spec/src/kernel/package-upgrade.zod.ts @@ -300,25 +300,25 @@ export const RollbackPackageResponseSchema = lazySchema(() => z.object({ // Export Types // ========================================== -export type MetadataChangeType = z.infer; -export type MetadataDiffItem = z.infer; +export type MetadataChangeType = z.input; +export type MetadataDiffItem = z.input; /** Post-parse shape of {@link MetadataDiffItem} — defaults applied, transforms run (ADR-0122). */ export type MetadataDiffItemParsed = z.infer; -export type UpgradeImpactLevel = z.infer; -export type UpgradePlan = z.infer; +export type UpgradeImpactLevel = z.input; +export type UpgradePlan = z.input; /** Post-parse shape of {@link UpgradePlan} — defaults applied, transforms run (ADR-0122). */ export type UpgradePlanParsed = z.infer; -export type UpgradeSnapshot = z.infer; +export type UpgradeSnapshot = z.input; /** Post-parse shape of {@link UpgradeSnapshot} — defaults applied, transforms run (ADR-0122). */ export type UpgradeSnapshotParsed = z.infer; -export type UpgradePackageRequest = z.infer; +export type UpgradePackageRequest = z.input; /** Post-parse shape of {@link UpgradePackageRequest} — defaults applied, transforms run (ADR-0122). */ export type UpgradePackageRequestParsed = z.infer; -export type UpgradePhase = z.infer; -export type UpgradePackageResponse = z.infer; +export type UpgradePhase = z.input; +export type UpgradePackageResponse = z.input; /** Post-parse shape of {@link UpgradePackageResponse} — defaults applied, transforms run (ADR-0122). */ export type UpgradePackageResponseParsed = z.infer; -export type RollbackPackageRequest = z.infer; +export type RollbackPackageRequest = z.input; /** Post-parse shape of {@link RollbackPackageRequest} — defaults applied, transforms run (ADR-0122). */ export type RollbackPackageRequestParsed = z.infer; -export type RollbackPackageResponse = z.infer; +export type RollbackPackageResponse = z.input; diff --git a/packages/spec/src/kernel/plugin-capability.zod.ts b/packages/spec/src/kernel/plugin-capability.zod.ts index 78b8e22234..e22eda0ba8 100644 --- a/packages/spec/src/kernel/plugin-capability.zod.ts +++ b/packages/spec/src/kernel/plugin-capability.zod.ts @@ -309,24 +309,24 @@ export const PluginCapabilityManifestSchema = lazySchema(() => z.object({ })); // Export types -export type CapabilityConformanceLevel = z.infer; -export type ProtocolVersion = z.infer; -export type ProtocolReference = z.infer; -export type ProtocolFeature = z.infer; +export type CapabilityConformanceLevel = z.input; +export type ProtocolVersion = z.input; +export type ProtocolReference = z.input; +export type ProtocolFeature = z.input; /** Post-parse shape of {@link ProtocolFeature} — defaults applied, transforms run (ADR-0122). */ export type ProtocolFeatureParsed = z.infer; -export type PluginCapability = z.infer; +export type PluginCapability = z.input; /** Post-parse shape of {@link PluginCapability} — defaults applied, transforms run (ADR-0122). */ export type PluginCapabilityParsed = z.infer; -export type PluginInterface = z.infer; +export type PluginInterface = z.input; /** Post-parse shape of {@link PluginInterface} — defaults applied, transforms run (ADR-0122). */ export type PluginInterfaceParsed = z.infer; -export type PluginDependency = z.infer; +export type PluginDependency = z.input; /** Post-parse shape of {@link PluginDependency} — defaults applied, transforms run (ADR-0122). */ export type PluginDependencyParsed = z.infer; -export type ExtensionPoint = z.infer; +export type ExtensionPoint = z.input; /** Post-parse shape of {@link ExtensionPoint} — defaults applied, transforms run (ADR-0122). */ export type ExtensionPointParsed = z.infer; -export type PluginCapabilityManifest = z.infer; +export type PluginCapabilityManifest = z.input; /** Post-parse shape of {@link PluginCapabilityManifest} — defaults applied, transforms run (ADR-0122). */ export type PluginCapabilityManifestParsed = z.infer; diff --git a/packages/spec/src/kernel/plugin-lifecycle-advanced.zod.ts b/packages/spec/src/kernel/plugin-lifecycle-advanced.zod.ts index 5f01061d81..62ead6b20c 100644 --- a/packages/spec/src/kernel/plugin-lifecycle-advanced.zod.ts +++ b/packages/spec/src/kernel/plugin-lifecycle-advanced.zod.ts @@ -472,26 +472,26 @@ export const AdvancedPluginLifecycleConfigSchema = lazySchema(() => z.object({ })); // Export types -export type PluginHealthStatus = z.infer; -export type PluginHealthCheck = z.infer; +export type PluginHealthStatus = z.input; +export type PluginHealthCheck = z.input; /** Post-parse shape of {@link PluginHealthCheck} — defaults applied, transforms run (ADR-0122). */ export type PluginHealthCheckParsed = z.infer; -export type PluginHealthReport = z.infer; -export type DistributedStateConfig = z.infer; +export type PluginHealthReport = z.input; +export type DistributedStateConfig = z.input; /** Post-parse shape of {@link DistributedStateConfig} — defaults applied, transforms run (ADR-0122). */ export type DistributedStateConfigParsed = z.infer; -export type HotReloadConfig = z.infer; +export type HotReloadConfig = z.input; /** Post-parse shape of {@link HotReloadConfig} — defaults applied, transforms run (ADR-0122). */ export type HotReloadConfigParsed = z.infer; -export type GracefulDegradation = z.infer; +export type GracefulDegradation = z.input; /** Post-parse shape of {@link GracefulDegradation} — defaults applied, transforms run (ADR-0122). */ export type GracefulDegradationParsed = z.infer; -export type PluginUpdateStrategy = z.infer; +export type PluginUpdateStrategy = z.input; /** Post-parse shape of {@link PluginUpdateStrategy} — defaults applied, transforms run (ADR-0122). */ export type PluginUpdateStrategyParsed = z.infer; -export type PluginStateSnapshot = z.infer; +export type PluginStateSnapshot = z.input; /** Post-parse shape of {@link PluginStateSnapshot} — defaults applied, transforms run (ADR-0122). */ export type PluginStateSnapshotParsed = z.infer; -export type AdvancedPluginLifecycleConfig = z.infer; +export type AdvancedPluginLifecycleConfig = z.input; /** Post-parse shape of {@link AdvancedPluginLifecycleConfig} — defaults applied, transforms run (ADR-0122). */ export type AdvancedPluginLifecycleConfigParsed = z.infer; diff --git a/packages/spec/src/kernel/plugin-loading.zod.ts b/packages/spec/src/kernel/plugin-loading.zod.ts index 8adcef676e..f50ed8367a 100644 --- a/packages/spec/src/kernel/plugin-loading.zod.ts +++ b/packages/spec/src/kernel/plugin-loading.zod.ts @@ -822,38 +822,38 @@ export const PluginLoadingStateSchema = lazySchema(() => z.object({ }).describe('Plugin loading state')); // Export types -export type PluginLoadingStrategy = z.infer; -export type PluginPreloadConfig = z.infer; +export type PluginLoadingStrategy = z.input; +export type PluginPreloadConfig = z.input; /** Post-parse shape of {@link PluginPreloadConfig} — defaults applied, transforms run (ADR-0122). */ export type PluginPreloadConfigParsed = z.infer; -export type PluginCodeSplitting = z.infer; +export type PluginCodeSplitting = z.input; /** Post-parse shape of {@link PluginCodeSplitting} — defaults applied, transforms run (ADR-0122). */ export type PluginCodeSplittingParsed = z.infer; -export type PluginDynamicImport = z.infer; +export type PluginDynamicImport = z.input; /** Post-parse shape of {@link PluginDynamicImport} — defaults applied, transforms run (ADR-0122). */ export type PluginDynamicImportParsed = z.infer; -export type PluginInitialization = z.infer; +export type PluginInitialization = z.input; /** Post-parse shape of {@link PluginInitialization} — defaults applied, transforms run (ADR-0122). */ export type PluginInitializationParsed = z.infer; -export type PluginDependencyResolution = z.infer; +export type PluginDependencyResolution = z.input; /** Post-parse shape of {@link PluginDependencyResolution} — defaults applied, transforms run (ADR-0122). */ export type PluginDependencyResolutionParsed = z.infer; -export type PluginHotReload = z.infer; +export type PluginHotReload = z.input; /** Post-parse shape of {@link PluginHotReload} — defaults applied, transforms run (ADR-0122). */ export type PluginHotReloadParsed = z.infer; -export type PluginCaching = z.infer; +export type PluginCaching = z.input; /** Post-parse shape of {@link PluginCaching} — defaults applied, transforms run (ADR-0122). */ export type PluginCachingParsed = z.infer; -export type PluginSandboxing = z.infer; +export type PluginSandboxing = z.input; /** Post-parse shape of {@link PluginSandboxing} — defaults applied, transforms run (ADR-0122). */ export type PluginSandboxingParsed = z.infer; -export type PluginPerformanceMonitoring = z.infer; +export type PluginPerformanceMonitoring = z.input; /** Post-parse shape of {@link PluginPerformanceMonitoring} — defaults applied, transforms run (ADR-0122). */ export type PluginPerformanceMonitoringParsed = z.infer; -export type PluginLoadingConfig = z.infer; +export type PluginLoadingConfig = z.input; /** Post-parse shape of {@link PluginLoadingConfig} — defaults applied, transforms run (ADR-0122). */ export type PluginLoadingConfigParsed = z.infer; -export type PluginLoadingEvent = z.infer; -export type PluginLoadingState = z.infer; +export type PluginLoadingEvent = z.input; +export type PluginLoadingState = z.input; /** Post-parse shape of {@link PluginLoadingState} — defaults applied, transforms run (ADR-0122). */ export type PluginLoadingStateParsed = z.infer; diff --git a/packages/spec/src/kernel/plugin-registry.test.ts b/packages/spec/src/kernel/plugin-registry.test.ts index 07cec3258e..9b419f10e5 100644 --- a/packages/spec/src/kernel/plugin-registry.test.ts +++ b/packages/spec/src/kernel/plugin-registry.test.ts @@ -7,7 +7,7 @@ import { PluginSearchFiltersSchema, PluginInstallConfigSchema, type PluginVendor, - type PluginVendorInput, + type PluginVendorParsed, type PluginQualityMetrics, type PluginStatistics, type PluginRegistryEntry, @@ -81,8 +81,8 @@ describe('Plugin Registry Schemas', () => { }); it('should satisfy type constraints', () => { - const input: PluginVendorInput = { id: 'com.test', name: 'Test' }; - const vendor: PluginVendor = PluginVendorSchema.parse(input); + const input: PluginVendor = { id: 'com.test', name: 'Test' }; + const vendor: PluginVendorParsed = PluginVendorSchema.parse(input); expect(vendor.id).toBe('com.test'); }); }); diff --git a/packages/spec/src/kernel/plugin-registry.zod.ts b/packages/spec/src/kernel/plugin-registry.zod.ts index 3a7cad4bb6..7328b9d41a 100644 --- a/packages/spec/src/kernel/plugin-registry.zod.ts +++ b/packages/spec/src/kernel/plugin-registry.zod.ts @@ -407,23 +407,17 @@ export const PluginInstallConfigSchema = lazySchema(() => z.object({ })); // Export types -export type PluginVendor = z.infer; +export type PluginVendor = z.input; /** Post-parse shape of {@link PluginVendor} — defaults applied, transforms run (ADR-0122). */ export type PluginVendorParsed = z.infer; -export type PluginVendorInput = z.input; -export type PluginQualityMetrics = z.infer; +export type PluginQualityMetrics = z.input; /** Post-parse shape of {@link PluginQualityMetrics} — defaults applied, transforms run (ADR-0122). */ export type PluginQualityMetricsParsed = z.infer; -export type PluginQualityMetricsInput = z.input; -export type PluginStatistics = z.infer; +export type PluginStatistics = z.input; /** Post-parse shape of {@link PluginStatistics} — defaults applied, transforms run (ADR-0122). */ export type PluginStatisticsParsed = z.infer; -export type PluginStatisticsInput = z.input; -export type PluginRegistryEntry = z.infer; +export type PluginRegistryEntry = z.input; /** Post-parse shape of {@link PluginRegistryEntry} — defaults applied, transforms run (ADR-0122). */ export type PluginRegistryEntryParsed = z.infer; -export type PluginRegistryEntryInput = z.input; -export type PluginSearchFilters = z.infer; -export type PluginSearchFiltersInput = z.input; -export type PluginInstallConfig = z.infer; -export type PluginInstallConfigInput = z.input; +export type PluginSearchFilters = z.input; +export type PluginInstallConfig = z.input; diff --git a/packages/spec/src/kernel/plugin-security-advanced.zod.ts b/packages/spec/src/kernel/plugin-security-advanced.zod.ts index ade6d54295..1b699b909a 100644 --- a/packages/spec/src/kernel/plugin-security-advanced.zod.ts +++ b/packages/spec/src/kernel/plugin-security-advanced.zod.ts @@ -700,31 +700,31 @@ export const PluginSecurityManifestSchema = lazySchema(() => z.object({ })); // Export types -export type PermissionScope = z.infer; -export type PermissionAction = z.infer; -export type ResourceType = z.infer; -export type PluginPermission = z.infer; +export type PermissionScope = z.input; +export type PermissionAction = z.input; +export type ResourceType = z.input; +export type PluginPermission = z.input; /** Post-parse shape of {@link PluginPermission} — defaults applied, transforms run (ADR-0122). */ export type PluginPermissionParsed = z.infer; -export type PluginPermissionSet = z.infer; +export type PluginPermissionSet = z.input; /** Post-parse shape of {@link PluginPermissionSet} — defaults applied, transforms run (ADR-0122). */ export type PluginPermissionSetParsed = z.infer; -export type RuntimeConfig = z.infer; +export type RuntimeConfig = z.input; /** Post-parse shape of {@link RuntimeConfig} — defaults applied, transforms run (ADR-0122). */ export type RuntimeConfigParsed = z.infer; -export type SandboxConfig = z.infer; +export type SandboxConfig = z.input; /** Post-parse shape of {@link SandboxConfig} — defaults applied, transforms run (ADR-0122). */ export type SandboxConfigParsed = z.infer; -export type KernelSecurityVulnerability = z.infer; +export type KernelSecurityVulnerability = z.input; /** Post-parse shape of {@link KernelSecurityVulnerability} — defaults applied, transforms run (ADR-0122). */ export type KernelSecurityVulnerabilityParsed = z.infer; -export type KernelSecurityScanResult = z.infer; +export type KernelSecurityScanResult = z.input; /** Post-parse shape of {@link KernelSecurityScanResult} — defaults applied, transforms run (ADR-0122). */ export type KernelSecurityScanResultParsed = z.infer; -export type KernelSecurityPolicy = z.infer; +export type KernelSecurityPolicy = z.input; /** Post-parse shape of {@link KernelSecurityPolicy} — defaults applied, transforms run (ADR-0122). */ export type KernelSecurityPolicyParsed = z.infer; -export type PluginTrustLevel = z.infer; -export type PluginSecurityManifest = z.infer; +export type PluginTrustLevel = z.input; +export type PluginSecurityManifest = z.input; /** Post-parse shape of {@link PluginSecurityManifest} — defaults applied, transforms run (ADR-0122). */ export type PluginSecurityManifestParsed = z.infer; diff --git a/packages/spec/src/kernel/plugin-security.zod.ts b/packages/spec/src/kernel/plugin-security.zod.ts index 7f449d0635..0721054b5e 100644 --- a/packages/spec/src/kernel/plugin-security.zod.ts +++ b/packages/spec/src/kernel/plugin-security.zod.ts @@ -33,7 +33,7 @@ export const VulnerabilitySeverity = z.enum([ 'info', ]).describe('Severity level of a security vulnerability'); -export type VulnerabilitySeverity = z.infer; +export type VulnerabilitySeverity = z.input; /** * Security Vulnerability @@ -112,7 +112,7 @@ export const SecurityVulnerabilitySchema = lazySchema(() => z.object({ mitigation: z.string().optional().describe('Recommended steps to mitigate the vulnerability'), }).describe('A known security vulnerability in a package dependency')); -export type SecurityVulnerability = z.infer; +export type SecurityVulnerability = z.input; /** Post-parse shape of {@link SecurityVulnerability} — defaults applied, transforms run (ADR-0122). */ export type SecurityVulnerabilityParsed = z.infer; @@ -198,7 +198,7 @@ export const SecurityScanResultSchema = lazySchema(() => z.object({ nextScanAt: z.string().datetime().optional().describe('ISO 8601 timestamp for the next scheduled scan'), }).describe('Result of a security scan performed on a plugin')); -export type SecurityScanResult = z.infer; +export type SecurityScanResult = z.input; /** Post-parse shape of {@link SecurityScanResult} — defaults applied, transforms run (ADR-0122). */ export type SecurityScanResultParsed = z.infer; @@ -302,7 +302,7 @@ export const SecurityPolicySchema = lazySchema(() => z.object({ }).optional().describe('Sandbox restrictions for plugin execution'), }).describe('Security policy governing plugin scanning and enforcement')); -export type SecurityPolicy = z.infer; +export type SecurityPolicy = z.input; /** Post-parse shape of {@link SecurityPolicy} — defaults applied, transforms run (ADR-0122). */ export type SecurityPolicyParsed = z.infer; @@ -348,7 +348,7 @@ export const ResolvedPackageDependencySchema = lazySchema(() => z.object({ resolvedVersion: z.string().optional().describe('Concrete version resolved during dependency resolution'), }).describe('A resolver-side package dependency: version constraint plus its resolution outcome')); -export type ResolvedPackageDependency = z.infer; +export type ResolvedPackageDependency = z.input; /** Post-parse shape of {@link ResolvedPackageDependency} — defaults applied, transforms run (ADR-0122). */ export type ResolvedPackageDependencyParsed = z.infer; @@ -392,7 +392,7 @@ export const DependencyGraphNodeSchema = lazySchema(() => z.object({ }).optional().describe('Additional metadata about the package'), }).describe('A node in the dependency graph representing a resolved package')); -export type DependencyGraphNode = z.infer; +export type DependencyGraphNode = z.input; /** Post-parse shape of {@link DependencyGraphNode} — defaults applied, transforms run (ADR-0122). */ export type DependencyGraphNodeParsed = z.infer; @@ -432,7 +432,7 @@ export const DependencyGraphSchema = lazySchema(() => z.object({ }).describe('Summary statistics for the dependency graph'), }).describe('Complete dependency graph for a package and its transitive dependencies')); -export type DependencyGraph = z.infer; +export type DependencyGraph = z.input; /** Post-parse shape of {@link DependencyGraph} — defaults applied, transforms run (ADR-0122). */ export type DependencyGraphParsed = z.infer; @@ -475,7 +475,7 @@ export const PackageDependencyConflictSchema = lazySchema(() => z.object({ severity: z.enum(['error', 'warning', 'info']).describe('Severity level of the dependency conflict'), }).describe('A detected conflict between dependency version requirements')); -export type PackageDependencyConflict = z.infer; +export type PackageDependencyConflict = z.input; /** * Dependency Resolution Result @@ -515,7 +515,7 @@ export const PackageDependencyResolutionResultSchema = lazySchema(() => z.object resolvedIn: z.number().int().min(0).optional().describe('Time taken to resolve dependencies in milliseconds'), }).describe('Result of a dependency resolution process')); -export type PackageDependencyResolutionResult = z.infer; +export type PackageDependencyResolutionResult = z.input; /** Post-parse shape of {@link PackageDependencyResolutionResult} — defaults applied, transforms run (ADR-0122). */ export type PackageDependencyResolutionResultParsed = z.infer; @@ -572,7 +572,7 @@ export const SBOMEntrySchema = lazySchema(() => z.object({ })).default([]).describe('External references related to the component'), }).describe('A single entry in a Software Bill of Materials')); -export type SBOMEntry = z.infer; +export type SBOMEntry = z.input; /** Post-parse shape of {@link SBOMEntry} — defaults applied, transforms run (ADR-0122). */ export type SBOMEntryParsed = z.infer; @@ -618,7 +618,7 @@ export const SBOMSchema = lazySchema(() => z.object({ }).optional().describe('Tool used to generate this SBOM'), }).describe('Software Bill of Materials for a plugin')); -export type SBOM = z.infer; +export type SBOM = z.input; /** Post-parse shape of {@link SBOM} — defaults applied, transforms run (ADR-0122). */ export type SBOMParsed = z.infer; @@ -705,7 +705,7 @@ export const PluginProvenanceSchema = lazySchema(() => z.object({ })).default([]).describe('Verification attestations for the plugin'), }).describe('Verifiable provenance and chain of custody for a plugin artifact')); -export type PluginProvenance = z.infer; +export type PluginProvenance = z.input; /** Post-parse shape of {@link PluginProvenance} — defaults applied, transforms run (ADR-0122). */ export type PluginProvenanceParsed = z.infer; @@ -780,7 +780,7 @@ export const PluginTrustScoreSchema = lazySchema(() => z.object({ updatedAt: z.string().datetime().describe('ISO 8601 timestamp when the trust score was last updated'), }).describe('Trust score and verification status for a plugin')); -export type PluginTrustScore = z.infer; +export type PluginTrustScore = z.input; /** Post-parse shape of {@link PluginTrustScore} — defaults applied, transforms run (ADR-0122). */ export type PluginTrustScoreParsed = z.infer; diff --git a/packages/spec/src/kernel/plugin-structure.zod.ts b/packages/spec/src/kernel/plugin-structure.zod.ts index bf510d4b6a..46f7bbb74e 100644 --- a/packages/spec/src/kernel/plugin-structure.zod.ts +++ b/packages/spec/src/kernel/plugin-structure.zod.ts @@ -122,6 +122,6 @@ export const OpsPluginStructureSchema = lazySchema(() => z.object({ }); })); -export type OpsFilePath = z.infer; -export type OpsDomainModule = z.infer; -export type OpsPluginStructure = z.infer; +export type OpsFilePath = z.input; +export type OpsDomainModule = z.input; +export type OpsPluginStructure = z.input; diff --git a/packages/spec/src/kernel/plugin-validator.zod.ts b/packages/spec/src/kernel/plugin-validator.zod.ts index 21a3ca5151..651007a3af 100644 --- a/packages/spec/src/kernel/plugin-validator.zod.ts +++ b/packages/spec/src/kernel/plugin-validator.zod.ts @@ -45,7 +45,7 @@ export const ValidationErrorSchema = lazySchema(() => z.object({ code: z.string().optional().describe('Machine-readable error code'), })); -export type ValidationError = z.infer; +export type ValidationError = z.input; /** * Validation Warning Schema @@ -75,7 +75,7 @@ export const ValidationWarningSchema = lazySchema(() => z.object({ code: z.string().optional().describe('Machine-readable warning code'), })); -export type ValidationWarning = z.infer; +export type ValidationWarning = z.input; /** * Validation Result Schema @@ -113,7 +113,7 @@ export const ValidationResultSchema = lazySchema(() => z.object({ warnings: z.array(ValidationWarningSchema).optional().describe('Validation warnings'), })); -export type ValidationResult = z.infer; +export type ValidationResult = z.input; // ============================================================================ // Plugin Metadata Schema @@ -182,4 +182,4 @@ export const PluginMetadataSchema = lazySchema(() => z.object({ */ }).passthrough().describe('Plugin metadata for validation')); -export type PluginMetadata = z.infer; +export type PluginMetadata = z.input; diff --git a/packages/spec/src/kernel/plugin-versioning.zod.ts b/packages/spec/src/kernel/plugin-versioning.zod.ts index a999a16716..172263cbf7 100644 --- a/packages/spec/src/kernel/plugin-versioning.zod.ts +++ b/packages/spec/src/kernel/plugin-versioning.zod.ts @@ -461,28 +461,28 @@ export const PluginVersionMetadataSchema = lazySchema(() => z.object({ })); // Export types -export type SemanticVersion = z.infer; -export type VersionConstraint = z.infer; -export type CompatibilityLevel = z.infer; -export type BreakingChange = z.infer; +export type SemanticVersion = z.input; +export type VersionConstraint = z.input; +export type CompatibilityLevel = z.input; +export type BreakingChange = z.input; /** Post-parse shape of {@link BreakingChange} — defaults applied, transforms run (ADR-0122). */ export type BreakingChangeParsed = z.infer; -export type DeprecationNotice = z.infer; -export type CompatibilityMatrixEntry = z.infer; +export type DeprecationNotice = z.input; +export type CompatibilityMatrixEntry = z.input; /** Post-parse shape of {@link CompatibilityMatrixEntry} — defaults applied, transforms run (ADR-0122). */ export type CompatibilityMatrixEntryParsed = z.infer; -export type PluginCompatibilityMatrix = z.infer; +export type PluginCompatibilityMatrix = z.input; /** Post-parse shape of {@link PluginCompatibilityMatrix} — defaults applied, transforms run (ADR-0122). */ export type PluginCompatibilityMatrixParsed = z.infer; -export type DependencyConflict = z.infer; +export type DependencyConflict = z.input; /** Post-parse shape of {@link DependencyConflict} — defaults applied, transforms run (ADR-0122). */ export type DependencyConflictParsed = z.infer; -export type PluginDependencyResolutionResult = z.infer; +export type PluginDependencyResolutionResult = z.input; /** Post-parse shape of {@link PluginDependencyResolutionResult} — defaults applied, transforms run (ADR-0122). */ export type PluginDependencyResolutionResultParsed = z.infer; -export type MultiVersionSupport = z.infer; +export type MultiVersionSupport = z.input; /** Post-parse shape of {@link MultiVersionSupport} — defaults applied, transforms run (ADR-0122). */ export type MultiVersionSupportParsed = z.infer; -export type PluginVersionMetadata = z.infer; +export type PluginVersionMetadata = z.input; /** Post-parse shape of {@link PluginVersionMetadata} — defaults applied, transforms run (ADR-0122). */ export type PluginVersionMetadataParsed = z.infer; diff --git a/packages/spec/src/kernel/plugin.zod.ts b/packages/spec/src/kernel/plugin.zod.ts index 26eed0016c..57aa1e7d32 100644 --- a/packages/spec/src/kernel/plugin.zod.ts +++ b/packages/spec/src/kernel/plugin.zod.ts @@ -50,7 +50,7 @@ export const PluginContextSchema = lazySchema(() => z.object({ }).passthrough().describe('Driver Registry'), })); -export type PluginContextData = z.infer; +export type PluginContextData = z.input; export type PluginContext = PluginContextData; // --------------------------------------------------------------------------- @@ -133,4 +133,4 @@ export const PluginSchema = lazySchema(() => z.object({ homepage: z.string().url().optional(), })); -export type PluginDefinition = z.infer; +export type PluginDefinition = z.input; diff --git a/packages/spec/src/kernel/service-registry.zod.ts b/packages/spec/src/kernel/service-registry.zod.ts index 5e256f3bc6..56dff4cab5 100644 --- a/packages/spec/src/kernel/service-registry.zod.ts +++ b/packages/spec/src/kernel/service-registry.zod.ts @@ -32,7 +32,7 @@ export const ServiceScopeType = z.enum([ 'scoped', // Instance per scope (request, session, transaction, etc.) ]).describe('Service scope type'); -export type ServiceScopeType = z.infer; +export type ServiceScopeType = z.input; /** * Service Metadata Schema @@ -86,7 +86,7 @@ export const ServiceMetadataSchema = lazySchema(() => z.object({ .describe('Cluster scope & leader strategy. See cluster-semantics.mdx §5.'), })); -export type ServiceMetadata = z.infer; +export type ServiceMetadata = z.input; /** Post-parse shape of {@link ServiceMetadata} — defaults applied, transforms run (ADR-0122). */ export type ServiceMetadataParsed = z.infer; @@ -142,10 +142,9 @@ export const ServiceRegistryConfigSchema = lazySchema(() => z.object({ .describe('Maximum number of services that can be registered'), })); -export type ServiceRegistryConfig = z.infer; +export type ServiceRegistryConfig = z.input; /** Post-parse shape of {@link ServiceRegistryConfig} — defaults applied, transforms run (ADR-0122). */ export type ServiceRegistryConfigParsed = z.infer; -export type ServiceRegistryConfigInput = z.input; // ============================================================================ // Service Factory Schemas @@ -193,7 +192,7 @@ export const ServiceFactoryRegistrationSchema = lazySchema(() => z.object({ .describe('Cluster scope & leader strategy for this service.'), })); -export type ServiceFactoryRegistration = z.infer; +export type ServiceFactoryRegistration = z.input; /** Post-parse shape of {@link ServiceFactoryRegistration} — defaults applied, transforms run (ADR-0122). */ export type ServiceFactoryRegistrationParsed = z.infer; @@ -233,7 +232,7 @@ export const ScopeConfigSchema = lazySchema(() => z.object({ .describe('Scope-specific context metadata'), })); -export type ScopeConfig = z.infer; +export type ScopeConfig = z.input; /** * Scope Info Schema @@ -279,4 +278,4 @@ export const ScopeInfoSchema = lazySchema(() => z.object({ .describe('Scope-specific context metadata'), })); -export type ScopeInfo = z.infer; +export type ScopeInfo = z.input; diff --git a/packages/spec/src/kernel/startup-orchestrator.zod.ts b/packages/spec/src/kernel/startup-orchestrator.zod.ts index abe6a1579a..0de4aa3118 100644 --- a/packages/spec/src/kernel/startup-orchestrator.zod.ts +++ b/packages/spec/src/kernel/startup-orchestrator.zod.ts @@ -64,10 +64,9 @@ export const StartupOptionsSchema = lazySchema(() => z.object({ context: z.unknown().optional().describe('Custom context object to pass to plugin lifecycle methods'), })); -export type StartupOptions = z.infer; +export type StartupOptions = z.input; /** Post-parse shape of {@link StartupOptions} — defaults applied, transforms run (ADR-0122). */ export type StartupOptionsParsed = z.infer; -export type StartupOptionsInput = z.input; // ============================================================================ // Health Status Schemas @@ -109,7 +108,7 @@ export const HealthStatusSchema = lazySchema(() => z.object({ message: z.string().optional().describe('Error message if plugin is unhealthy'), })); -export type HealthStatus = z.infer; +export type HealthStatus = z.input; // ============================================================================ // Startup Result Schemas @@ -165,7 +164,7 @@ export const PluginStartupResultSchema = lazySchema(() => z.object({ health: HealthStatusSchema.optional().describe('Health status after startup if health check was enabled'), })); -export type PluginStartupResult = z.infer; +export type PluginStartupResult = z.input; // ============================================================================ // Startup Orchestration Result Schema @@ -207,4 +206,4 @@ export const StartupOrchestrationResultSchema = lazySchema(() => z.object({ rolledBack: z.array(z.string()).optional().describe('Names of plugins that were rolled back'), })); -export type StartupOrchestrationResult = z.infer; +export type StartupOrchestrationResult = z.input; diff --git a/packages/spec/src/migrations/registry.ts b/packages/spec/src/migrations/registry.ts index b4cad0e607..b396bba5a7 100644 --- a/packages/spec/src/migrations/registry.ts +++ b/packages/spec/src/migrations/registry.ts @@ -2304,6 +2304,62 @@ const step17: MigrationStep = { + 'undeclared function, identically on the local driver and the Turso remote ' + 'transport.', }, + { + id: 'spec-type-alias-input-suffix-retired', + // Plain text, no markdown: build-upgrade-guide.ts renders this field inside a + // code span AND inside a table cell, so backticks here break both. + surface: + 'type alias: the 102 XInput names of @objectstack/spec ' + + '(ConnectorInput, AppInput, PageInput, ActionInput, ServiceObjectInput, ' + + 'ExecutionContextInput, TaskInput, … — 52 files across api/ automation/ data/ ' + + 'identity/ integration/ kernel/ security/ system/ ui/)', + replacement: + 'the BARE name. ADR-0122 phase 2 moved the author state onto `X`, which makes `XInput` ' + + 'a character-for-character synonym of it — the permanent synonym D3 forbids. Drop the ' + + '`Input` suffix: `ConnectorInput` -> `Connector`. Symmetrically, a consumer that held ' + + 'a PARSE RESULT under the bare name moves to `XParsed`, which phase 1 (16.x) already ' + + 'declared for every schema whose two shapes differ, so the target name has existed for ' + + 'a release. NINE `*Input` names are NOT retired and need no edit: `ExpressionInput`, ' + + '`CronExpressionInput`, `TemplateExpressionInput` and `PredicateInput` are the bare ' + + 'aliases of their own `…InputSchema`, and `FormFieldInput`, `QueryInput`, `FieldInput`, ' + + '`ObjectStackDefinitionInput` and `NavigationItemInput` are composed (recursive or ' + + '`Partial`-shaped) types no bare alias denotes.', + reason: + 'This entry exists for the reason `data-driver-find-stream-retired` (#4484), ' + + '`storage-service-list-retired` (#5540) and `actor-user-roles-to-positions` (#6011) ' + + 'exist, and it is the same disposition: the surface is a TYPESCRIPT NAME, never stack ' + + 'metadata, so there is no source for a D2 conversion to rewrite and deliberately no ' + + 'schema tombstone — an `XInput` alias never had a carrier key, never emitted a def, ' + + 'and no `.parse()` ever saw it. Measured and verified rather than assumed: ' + + '`json-schema/`, `json-schema.manifest/` and `authorable-surface/` are BYTE-IDENTICAL ' + + 'across this change, because those generators enumerate runtime `z.ZodType` exports ' + + 'and never read a type alias. So nothing left the published metadata surface and ' + + 'RETIRED_DEFS_BY_MAJOR is deliberately untouched — an entry there would falsely claim ' + + 'the metadata contract shrank. The enforced channel is tsc: the name is gone, so every ' + + 'consumer gets TS2724/TS2305 naming the import. That is loud but MUTE about the ' + + 'replacement — a compile error says `ConnectorInput` does not exist, not that ' + + '`Connector` now means what it meant. The generated upgrade guide is the only channel ' + + 'that carries the second half, which is precisely the #6048 gap ADR-0087 registration ' + + 'exists to close. ⚠️ Deliberately NOT registered alongside it: the 1384 bare aliases ' + + 'the same change FLIPPED from `z.infer` to `z.input`. Those names all still exist and ' + + 'still resolve; what moved is which of a schema\'s two shapes they denote, and only ' + + 'where the two differ (663 of 1384 — the rest are isomorphic and the flip is a no-op ' + + 'there, pinned as such). A consumer holding an authored literal is made MORE correct ' + + 'by it, silently; one holding a parse result gets a tsc error at the first defaulted ' + + 'key it reads. Registering that as a rename would misdescribe it — no name was ' + + 'retired — and the changeset carries its own FROM -> TO for it. ADR-0122 D8/D9, ' + + '#6083 (PR #6279).', + acceptanceCriteria: + 'No source imports a name ending `Input` from `@objectstack/spec` except the nine listed ' + + 'above: `rg "\\b\\w+Input\\b" --type ts` over consumer code resolves only to those. A ' + + 'literal annotated with a bare spec type compiles while listing ONLY the keys the ' + + 'author means — `const c: Connector = { name, label, type }` type-checks, which it did ' + + 'not in 16.x — and a value read out of `XSchema.parse()` annotated with the bare name ' + + 'no longer compiles at the first defaulted key it reads (TS18048/TS2532), the signal ' + + 'that the annotation should be `XParsed`. `pnpm check:spec-parsed-alias` reports every ' + + 'bare alias as `z.input` and refuses both a bare `z.infer` alias and a reintroduced ' + + '`XInput` synonym.', + }, ], }; diff --git a/packages/spec/src/qa/testing.zod.ts b/packages/spec/src/qa/testing.zod.ts index 9f7f1c529b..336e89dc49 100644 --- a/packages/spec/src/qa/testing.zod.ts +++ b/packages/spec/src/qa/testing.zod.ts @@ -80,8 +80,8 @@ export const TestSuiteSchema = lazySchema(() => z.object({ scenarios: z.array(TestScenarioSchema).describe('List of test scenarios in this suite') }).describe('A collection of test scenarios grouped into a test suite')); -export type TestSuite = z.infer; -export type TestScenario = z.infer; -export type TestStep = z.infer; -export type TestAction = z.infer; -export type TestAssertion = z.infer; +export type TestSuite = z.input; +export type TestScenario = z.input; +export type TestStep = z.input; +export type TestAction = z.input; +export type TestAssertion = z.input; diff --git a/packages/spec/src/security/explain.zod.ts b/packages/spec/src/security/explain.zod.ts index eb421e9468..018c29c186 100644 --- a/packages/spec/src/security/explain.zod.ts +++ b/packages/spec/src/security/explain.zod.ts @@ -49,7 +49,7 @@ import { lazySchema } from '../shared/lazy-schema'; export const ExplainOperationSchema = z.enum([ 'read', 'create', 'update', 'delete', 'transfer', 'restore', 'purge', 'export', ]); -export type ExplainOperation = z.infer; +export type ExplainOperation = z.input; /** * [ADR-0095 D2] The monotonic posture ladder resolved once in @@ -70,7 +70,7 @@ export const AuthzPostureSchema = z.enum([ 'ADR-0095 D2 posture rung — PLATFORM_ADMIN crosses the tenant wall where object posture permits; ' + 'TENANT_ADMIN sees all rows in the org; MEMBER gets business RLS; EXTERNAL sees only explicitly shared rows.', ); -export type AuthzPosture = z.infer; +export type AuthzPosture = z.input; /** * [C2 / ADR-0090 D6] A single concrete rule that governed a SPECIFIC record at @@ -122,7 +122,7 @@ export const ExplainMatchedRuleSchema = lazySchema(() => z.object({ effect: z.enum(['admits', 'excludes', 'neutral']) .describe('The rule\'s effect on THIS record: admits, excludes, or neutral.'), })); -export type ExplainMatchedRule = z.infer; +export type ExplainMatchedRule = z.input; /** * [C2 / ADR-0090 D6] A pipeline layer's determination for ONE specific record. @@ -150,7 +150,7 @@ export const ExplainRecordAttributionSchema = lazySchema(() => z.object({ detail: z.string().optional() .describe('Human-readable, record-specific explanation of this layer\'s outcome.'), })); -export type ExplainRecordAttribution = z.infer; +export type ExplainRecordAttribution = z.input; /** Post-parse shape of {@link ExplainRecordAttribution} — defaults applied, transforms run (ADR-0122). */ export type ExplainRecordAttributionParsed = z.infer; @@ -213,7 +213,7 @@ export const ExplainLayerSchema = lazySchema(() => z.object({ record: ExplainRecordAttributionSchema.optional() .describe('Row-level determination for the specific record under explanation; set only for record-grained requests.'), })); -export type ExplainLayer = z.infer; +export type ExplainLayer = z.input; /** Post-parse shape of {@link ExplainLayer} — defaults applied, transforms run (ADR-0122). */ export type ExplainLayerParsed = z.infer; @@ -240,9 +240,7 @@ export const ExplainRequestSchema = lazySchema(() => z.object({ */ userId: z.string().optional(), })); -export type ExplainRequest = z.infer; -/** Authoring input for {@link ExplainRequest}. */ -export type ExplainRequestInput = z.input; +export type ExplainRequest = z.input; /** The full decision report. */ export const ExplainDecisionSchema = lazySchema(() => z.object({ @@ -304,7 +302,7 @@ export const ExplainDecisionSchema = lazySchema(() => z.object({ ]).optional().describe('The pipeline layer that decided the record-level outcome (excluded it, or last admitted it).'), })).optional().describe('Row-level verdict for the specific record; set only for record-grained requests.'), })); -export type ExplainDecision = z.infer; +export type ExplainDecision = z.input; /** Post-parse shape of {@link ExplainDecision} — defaults applied, transforms run (ADR-0122). */ export type ExplainDecisionParsed = z.infer; @@ -331,7 +329,7 @@ export const AccessMatrixEntrySchema = lazySchema(() => z.object({ /** The object's declared OWD (record baseline) for context. */ sharingModel: z.string().optional(), })); -export type AccessMatrixEntry = z.infer; +export type AccessMatrixEntry = z.input; export const AccessMatrixSchema = lazySchema(() => z.object({ /** Snapshot format version. */ @@ -339,6 +337,6 @@ export const AccessMatrixSchema = lazySchema(() => z.object({ /** Sorted (permissionSet, object) entries — stable for diffing. */ entries: z.array(AccessMatrixEntrySchema).default([]), })); -export type AccessMatrix = z.infer; +export type AccessMatrix = z.input; /** Post-parse shape of {@link AccessMatrix} — defaults applied, transforms run (ADR-0122). */ export type AccessMatrixParsed = z.infer; diff --git a/packages/spec/src/security/permission.zod.ts b/packages/spec/src/security/permission.zod.ts index ae2ce4a26c..efbb2a721b 100644 --- a/packages/spec/src/security/permission.zod.ts +++ b/packages/spec/src/security/permission.zod.ts @@ -23,7 +23,7 @@ import { strictUnknownKeyError } from '../shared/suggestions.zod'; * layered on top of OWD. Widens the owner-match for owner-scoped objects. */ export const ObjectAccessScopeSchema = z.enum(['own', 'own_and_reports', 'unit', 'unit_and_below', 'org']); -export type ObjectAccessScope = z.infer; +export type ObjectAccessScope = z.input; /* * ── Unknown-key strictness (#4001, ADR-0078) ──────────────────────────────── @@ -220,7 +220,7 @@ export const EffectiveObjectPermissionSchema = lazySchema(() => // authorable/wire split). }).strip(), ); -export type EffectiveObjectPermission = z.infer; +export type EffectiveObjectPermission = z.input; /** * [ADR-0090 D12] Delegated-administration scope. @@ -273,11 +273,9 @@ export const AdminScopeSchema = lazySchema(() => z.object({ assignablePermissionSets: z.array(z.string()).default([]).describe('Allowlist of permission-set names the delegate may hand out'), }, { error: adminScopeUnknownKeyError }).strict()); -export type AdminScope = z.infer; +export type AdminScope = z.input; /** Post-parse shape of {@link AdminScope} — defaults applied, transforms run (ADR-0122). */ export type AdminScopeParsed = z.infer; -/** Authoring input for {@link AdminScope} — defaulted fields are optional. */ -export type AdminScopeInput = z.input; const fieldPermissionUnknownKeyError = strictUnknownKeyError({ surface: 'this field permission', @@ -546,15 +544,13 @@ export const PermissionSetSchema = lazySchema(() => z.object({ ...MetadataProtectionFields, }, { error: permissionSetUnknownKeyError }).strict()); -export type PermissionSet = z.infer; +export type PermissionSet = z.input; /** Post-parse shape of {@link PermissionSet} — defaults applied, transforms run (ADR-0122). */ export type PermissionSetParsed = z.infer; -/** Authoring input for {@link PermissionSet} — defaulted fields are optional. */ -export type PermissionSetInput = z.input; -export type ObjectPermission = z.infer; +export type ObjectPermission = z.input; /** Post-parse shape of {@link ObjectPermission} — defaults applied, transforms run (ADR-0122). */ export type ObjectPermissionParsed = z.infer; -export type FieldPermission = z.infer; +export type FieldPermission = z.input; /** Post-parse shape of {@link FieldPermission} — defaults applied, transforms run (ADR-0122). */ export type FieldPermissionParsed = z.infer; @@ -563,6 +559,6 @@ export type FieldPermissionParsed = z.infer; * `.parse()` and accepts input-shape config (optional defaults, CEL * shorthand) — preferred over a bare `: PermissionSet` literal. */ -export function definePermissionSet(config: z.input): PermissionSet { +export function definePermissionSet(config: z.input): PermissionSetParsed { return PermissionSetSchema.parse(config); } diff --git a/packages/spec/src/security/rls.zod.ts b/packages/spec/src/security/rls.zod.ts index 0181fe9bfd..44f7fd2ff9 100644 --- a/packages/spec/src/security/rls.zod.ts +++ b/packages/spec/src/security/rls.zod.ts @@ -112,7 +112,7 @@ import { strictUnknownKeyError } from '../shared/suggestions.zod'; import { lazySchema } from '../shared/lazy-schema'; export const RLSOperation = z.enum(['select', 'insert', 'update', 'delete', 'all']); -export type RLSOperation = z.infer; +export type RLSOperation = z.input; /** * Row-Level Security Policy Schema @@ -569,11 +569,11 @@ export const RLSEvaluationResultSchema = lazySchema(() => z.object({ /** * Type exports */ -export type RowLevelSecurityPolicy = z.infer; +export type RowLevelSecurityPolicy = z.input; /** Post-parse shape of {@link RowLevelSecurityPolicy} — defaults applied, transforms run (ADR-0122). */ export type RowLevelSecurityPolicyParsed = z.infer; -export type RLSUserContext = z.infer; -export type RLSEvaluationResult = z.infer; +export type RLSUserContext = z.input; +export type RLSEvaluationResult = z.input; /** * Helper factory for creating RLS policies diff --git a/packages/spec/src/security/sharing.zod.ts b/packages/spec/src/security/sharing.zod.ts index 16ef907868..d6a82bd457 100644 --- a/packages/spec/src/security/sharing.zod.ts +++ b/packages/spec/src/security/sharing.zod.ts @@ -233,12 +233,10 @@ export const CriteriaSharingRuleSchema = lazySchema(() => BaseSharingRuleSchema. */ export const SharingRuleSchema = CriteriaSharingRuleSchema; -export type SharingRule = z.infer; +export type SharingRule = z.input; /** Post-parse shape of {@link SharingRule} — defaults applied, transforms run (ADR-0122). */ export type SharingRuleParsed = z.infer; -/** Authoring input for {@link SharingRule} — defaulted fields are optional. */ -export type SharingRuleInput = z.input; -export type CriteriaSharingRule = z.infer; +export type CriteriaSharingRule = z.input; /** Post-parse shape of {@link CriteriaSharingRule} — defaults applied, transforms run (ADR-0122). */ export type CriteriaSharingRuleParsed = z.infer; @@ -247,6 +245,6 @@ export type CriteriaSharingRuleParsed = z.infer): SharingRule { +export function defineSharingRule(config: z.input): SharingRuleParsed { return SharingRuleSchema.parse(config); } diff --git a/packages/spec/src/shared/branded-types.zod.ts b/packages/spec/src/shared/branded-types.zod.ts index 8e265f9a21..91739f8a71 100644 --- a/packages/spec/src/shared/branded-types.zod.ts +++ b/packages/spec/src/shared/branded-types.zod.ts @@ -34,7 +34,7 @@ export const ObjectNameSchema = lazySchema(() => SnakeCaseIdentifierSchema .brand<'ObjectName'>() .describe('Branded object name (snake_case, no dots)')); -export type ObjectName = z.infer; +export type ObjectName = z.input; /** Post-parse shape of {@link ObjectName} — defaults applied, transforms run (ADR-0122). */ export type ObjectNameParsed = z.infer; @@ -49,7 +49,7 @@ export const FieldNameSchema = lazySchema(() => SnakeCaseIdentifierSchema .brand<'FieldName'>() .describe('Branded field name (snake_case, no dots)')); -export type FieldName = z.infer; +export type FieldName = z.input; /** Post-parse shape of {@link FieldName} — defaults applied, transforms run (ADR-0122). */ export type FieldNameParsed = z.infer; @@ -64,7 +64,7 @@ export const ViewNameSchema = lazySchema(() => SystemIdentifierSchema .brand<'ViewName'>() .describe('Branded view name (system identifier)')); -export type ViewName = z.infer; +export type ViewName = z.input; /** Post-parse shape of {@link ViewName} — defaults applied, transforms run (ADR-0122). */ export type ViewNameParsed = z.infer; @@ -79,7 +79,7 @@ export const AppNameSchema = lazySchema(() => SystemIdentifierSchema .brand<'AppName'>() .describe('Branded app name (system identifier)')); -export type AppName = z.infer; +export type AppName = z.input; /** Post-parse shape of {@link AppName} — defaults applied, transforms run (ADR-0122). */ export type AppNameParsed = z.infer; @@ -94,7 +94,7 @@ export const FlowNameSchema = lazySchema(() => SystemIdentifierSchema .brand<'FlowName'>() .describe('Branded flow name (system identifier)')); -export type FlowName = z.infer; +export type FlowName = z.input; /** Post-parse shape of {@link FlowName} — defaults applied, transforms run (ADR-0122). */ export type FlowNameParsed = z.infer; @@ -109,6 +109,6 @@ export const RoleNameSchema = lazySchema(() => SystemIdentifierSchema .brand<'RoleName'>() .describe('Branded role name (system identifier)')); -export type RoleName = z.infer; +export type RoleName = z.input; /** Post-parse shape of {@link RoleName} — defaults applied, transforms run (ADR-0122). */ export type RoleNameParsed = z.infer; diff --git a/packages/spec/src/shared/connector-auth.zod.ts b/packages/spec/src/shared/connector-auth.zod.ts index deda9c528a..a445f8f4b2 100644 --- a/packages/spec/src/shared/connector-auth.zod.ts +++ b/packages/spec/src/shared/connector-auth.zod.ts @@ -69,7 +69,7 @@ export const ConnectorAuthConfigSchema = lazySchema(() => z.discriminatedUnion(' ConnectorNoAuthSchema, ])); -export type ConnectorAuthConfig = z.infer; +export type ConnectorAuthConfig = z.input; /** Post-parse shape of {@link ConnectorAuthConfig} — defaults applied, transforms run (ADR-0122). */ export type ConnectorAuthConfigParsed = z.infer; @@ -143,4 +143,4 @@ export const ConnectorInstanceAuthSchema = lazySchema(() => z.discriminatedUnion ConnectorInstanceBasicAuthSchema, ])); -export type ConnectorInstanceAuth = z.infer; +export type ConnectorInstanceAuth = z.input; diff --git a/packages/spec/src/shared/enums.zod.ts b/packages/spec/src/shared/enums.zod.ts index b9519888f9..2d782681bd 100644 --- a/packages/spec/src/shared/enums.zod.ts +++ b/packages/spec/src/shared/enums.zod.ts @@ -20,26 +20,26 @@ import { lazySchema } from './lazy-schema'; /** Sort direction used across query, data-engine, analytics */ export const SortDirectionEnum = z.enum(['asc', 'desc']) .describe('Sort order direction'); -export type SortDirection = z.infer; +export type SortDirection = z.input; /** Reusable sort item — field + direction pair used across views, data sources, filters */ export const SortItemSchema = lazySchema(() => z.object({ field: z.string().describe('Field name to sort by'), order: SortDirectionEnum.describe('Sort direction'), }).describe('Sort field and direction pair')); -export type SortItem = z.infer; +export type SortItem = z.input; /** CRUD mutation events used across hook, validation, object CDC */ export const MutationEventEnum = z.enum([ 'insert', 'update', 'delete', 'upsert', ]).describe('Data mutation event types'); -export type MutationEvent = z.infer; +export type MutationEvent = z.input; /** Database isolation levels — unified format */ export const IsolationLevelEnum = z.enum([ 'read_uncommitted', 'read_committed', 'repeatable_read', 'serializable', 'snapshot', ]).describe('Transaction isolation levels (snake_case standard)'); -export type IsolationLevel = z.infer; +export type IsolationLevel = z.input; // `CacheStrategyEnum` lived here as a second declaration of the cache eviction // vocabulary next to `CacheStrategySchema` (`system/cache.zod.ts`) — same diff --git a/packages/spec/src/shared/expression.zod.ts b/packages/spec/src/shared/expression.zod.ts index a97dbe3f0a..243184bc8c 100644 --- a/packages/spec/src/shared/expression.zod.ts +++ b/packages/spec/src/shared/expression.zod.ts @@ -47,7 +47,7 @@ import { z } from 'zod'; * dialect. Retired in #3278; see ADR-0058 addendum. */ export const ExpressionDialect = z.enum(['cel', 'cron', 'template']); -export type ExpressionDialect = z.infer; +export type ExpressionDialect = z.input; /** * Authorship metadata for an expression. Optional but encouraged for AI- @@ -59,7 +59,7 @@ export const ExpressionMetaSchema = z.object({ /** Identifier of the agent / tool that produced this expression. */ generatedBy: z.string().optional(), }); -export type ExpressionMeta = z.infer; +export type ExpressionMeta = z.input; /** * Canonical Expression envelope. @@ -87,7 +87,7 @@ export const ExpressionSchema = z.object({ }).refine(e => e.source !== undefined || e.ast !== undefined, { message: 'Expression requires at least one of `source` or `ast`', }); -export type Expression = z.infer; +export type Expression = z.input; /** * Author-time input shape: a bare string is shorthand for `{ dialect: 'cel', @@ -130,7 +130,7 @@ export type TemplateExpressionInput = z.input; +export type Predicate = z.input; export const PredicateInputSchema = ExpressionInputSchema; export type PredicateInput = z.input; diff --git a/packages/spec/src/shared/http.zod.ts b/packages/spec/src/shared/http.zod.ts index 59208ddc17..eea7dd0ba2 100644 --- a/packages/spec/src/shared/http.zod.ts +++ b/packages/spec/src/shared/http.zod.ts @@ -44,7 +44,7 @@ export const HttpMethod = z.enum([ 'OPTIONS' ]).describe('HTTP method — the full routing vocabulary (`api/*` endpoints, router and REST-server routes). The narrower `HttpMethodSubset` is what view data sources may request.'); -export type HttpMethod = z.infer; +export type HttpMethod = z.input; /** * HTTP Method Subset — the five methods a VIEW DATA SOURCE may request. @@ -64,7 +64,7 @@ export type HttpMethod = z.infer; export const HttpMethodSubsetSchema = lazySchema(() => z.enum(['GET', 'POST', 'PUT', 'PATCH', 'DELETE']) .describe('HTTP methods a view data source may request — the subset of `HttpMethod` without `HEAD`/`OPTIONS`.')); -export type HttpMethodSubset = z.infer; +export type HttpMethodSubset = z.input; /** * HTTP Request Configuration Schema @@ -79,7 +79,7 @@ export const HttpRequestSchema = lazySchema(() => z.object({ body: z.unknown().optional().describe('Request body for POST/PUT/PATCH'), })); -export type HttpRequest = z.infer; +export type HttpRequest = z.input; /** Post-parse shape of {@link HttpRequest} — defaults applied, transforms run (ADR-0122). */ export type HttpRequestParsed = z.infer; @@ -139,7 +139,7 @@ export const CorsConfigSchema = lazySchema(() => z.object({ maxAge: z.number().int().optional().describe('Preflight cache duration in seconds'), })); -export type CorsConfig = z.infer; +export type CorsConfig = z.input; /** Post-parse shape of {@link CorsConfig} — defaults applied, transforms run (ADR-0122). */ export type CorsConfigParsed = z.infer; @@ -183,7 +183,7 @@ export const RateLimitConfigSchema = lazySchema(() => z.object({ maxRequests: z.number().int().default(100).describe('Max requests per window'), })); -export type RateLimitConfig = z.infer; +export type RateLimitConfig = z.input; /** Post-parse shape of {@link RateLimitConfig} — defaults applied, transforms run (ADR-0122). */ export type RateLimitConfigParsed = z.infer; @@ -226,4 +226,4 @@ export const StaticMountSchema = lazySchema(() => z.object({ cacheControl: z.string().optional().describe('Cache-Control header value'), })); -export type StaticMount = z.infer; +export type StaticMount = z.input; diff --git a/packages/spec/src/shared/identifiers.zod.ts b/packages/spec/src/shared/identifiers.zod.ts index d65332268b..b004bd172d 100644 --- a/packages/spec/src/shared/identifiers.zod.ts +++ b/packages/spec/src/shared/identifiers.zod.ts @@ -109,6 +109,6 @@ export const EventNameSchema = lazySchema(() => z /** * Type Exports */ -export type SystemIdentifier = z.infer; -export type SnakeCaseIdentifier = z.infer; -export type EventName = z.infer; +export type SystemIdentifier = z.input; +export type SnakeCaseIdentifier = z.input; +export type EventName = z.input; diff --git a/packages/spec/src/shared/mapping.zod.ts b/packages/spec/src/shared/mapping.zod.ts index 2ac0d26a9c..3880a59585 100644 --- a/packages/spec/src/shared/mapping.zod.ts +++ b/packages/spec/src/shared/mapping.zod.ts @@ -105,4 +105,4 @@ export const FieldMappingSchema = lazySchema(() => z.object({ defaultValue: z.unknown().optional().describe('Default if source is null/undefined'), })); -export type FieldMapping = z.infer; +export type FieldMapping = z.input; diff --git a/packages/spec/src/shared/metadata-types.zod.ts b/packages/spec/src/shared/metadata-types.zod.ts index c7ef9bdefb..bfb04a37f5 100644 --- a/packages/spec/src/shared/metadata-types.zod.ts +++ b/packages/spec/src/shared/metadata-types.zod.ts @@ -17,7 +17,7 @@ import { SnakeCaseIdentifierSchema } from './identifiers.zod'; import { lazySchema } from './lazy-schema'; export const MetadataFormatSchema = lazySchema(() => z.enum(['yaml', 'json', 'typescript', 'javascript']) .describe('Metadata file format')); -export type MetadataFormat = z.infer; +export type MetadataFormat = z.input; /** Base metadata record fields shared across kernel and system layers */ export const BaseMetadataRecordSchema = lazySchema(() => z.object({ @@ -26,4 +26,4 @@ export const BaseMetadataRecordSchema = lazySchema(() => z.object({ name: SnakeCaseIdentifierSchema.describe('Machine name (snake_case)'), format: MetadataFormatSchema.optional().describe('Source file format'), }).describe('Base metadata record fields shared across kernel and system')); -export type BaseMetadataRecord = z.infer; +export type BaseMetadataRecord = z.input; diff --git a/packages/spec/src/shared/protection.zod.ts b/packages/spec/src/shared/protection.zod.ts index 9a0cea54db..979759e94a 100644 --- a/packages/spec/src/shared/protection.zod.ts +++ b/packages/spec/src/shared/protection.zod.ts @@ -103,7 +103,7 @@ export const ProtectionSchema = z.object({ ), }).strict(); -export type Protection = z.infer; +export type Protection = z.input; // ───────────────────────────────────────────────────────────────────── // Loader-side translation diff --git a/packages/spec/src/stack.zod.ts b/packages/spec/src/stack.zod.ts index e209be8120..bc6880d8fb 100644 --- a/packages/spec/src/stack.zod.ts +++ b/packages/spec/src/stack.zod.ts @@ -124,7 +124,7 @@ export const DatasourceMappingRuleSchema = lazySchema(() => z.object({ priority: z.number().optional().describe('Rule priority (lower = higher priority)'), }).describe('Datasource routing rule')); -export type DatasourceMappingRule = z.infer; +export type DatasourceMappingRule = z.input; /** * Raise every `apis:` publish-gate failure as a Zod issue (#5040 E7). @@ -606,7 +606,7 @@ export const ObjectStackDefinitionSchema = lazySchema(() => z.object({ runtimeModule: z.string().optional().describe('Path (relative to the artifact JSON) of the compiled runtime ESM bundle. Set by `objectstack build`; do not author by hand.'), }).superRefine(applyApiEndpointGates)); -export type ObjectStackDefinition = z.infer; +export type ObjectStackDefinition = z.input; /** Post-parse shape of {@link ObjectStackDefinition} — defaults applied, transforms run (ADR-0122). */ export type ObjectStackDefinitionParsed = z.infer; @@ -1314,7 +1314,7 @@ export function defineStack( * - `'merge'` — Shallow-merge items with the same name (later fields win). */ export const ConflictStrategySchema = lazySchema(() => z.enum(['error', 'override', 'merge'])); -export type ConflictStrategy = z.infer; +export type ConflictStrategy = z.input; /** * Options for {@link composeStacks}. @@ -1343,6 +1343,8 @@ export const ComposeStacksOptionsSchema = lazySchema(() => z.object({ })); export type ComposeStacksOptions = z.input; +/** Post-parse shape of {@link ComposeStacksOptions} — defaults applied, transforms run (ADR-0122). */ +export type ComposeStacksOptionsParsed = z.infer; /** * How {@link composeStacks} treats one top-level key (#5005). diff --git a/packages/spec/src/studio/flow-builder.test.ts b/packages/spec/src/studio/flow-builder.test.ts index 3fb24e7adf..4466618d6f 100644 --- a/packages/spec/src/studio/flow-builder.test.ts +++ b/packages/spec/src/studio/flow-builder.test.ts @@ -10,7 +10,7 @@ import { FlowBuilderConfigSchema, BUILT_IN_NODE_DESCRIPTORS, defineFlowBuilderConfig, - type FlowBuilderConfig, + type FlowBuilderConfigParsed, type FlowNodeRenderDescriptor, type FlowCanvasNode, type FlowCanvasEdge, @@ -175,7 +175,7 @@ describe('FlowLayoutDirectionSchema', () => { // --------------------------------------------------------------------------- describe('FlowBuilderConfigSchema', () => { it('should accept empty config with defaults', () => { - const config: FlowBuilderConfig = FlowBuilderConfigSchema.parse({}); + const config: FlowBuilderConfigParsed = FlowBuilderConfigSchema.parse({}); expect(config.snap.enabled).toBe(true); expect(config.snap.gridSize).toBe(16); expect(config.zoom.min).toBe(0.25); diff --git a/packages/spec/src/studio/flow-builder.zod.ts b/packages/spec/src/studio/flow-builder.zod.ts index f3819a8d94..3bb5c60f00 100644 --- a/packages/spec/src/studio/flow-builder.zod.ts +++ b/packages/spec/src/studio/flow-builder.zod.ts @@ -64,7 +64,7 @@ export const FlowNodeShapeSchema = lazySchema(() => z.enum([ 'screen_rect', // Screen / user-interaction node ]).describe('Visual shape for rendering a flow node on the canvas')); -export type FlowNodeShape = z.infer; +export type FlowNodeShape = z.input; /** * Maps each FlowNodeAction to its canvas rendering descriptor. @@ -107,7 +107,7 @@ export const FlowNodeRenderDescriptorSchema = lazySchema(() => strictObject({ .describe('Palette category for grouping'), }).describe('Visual render descriptor for a flow node type')); -export type FlowNodeRenderDescriptor = z.infer; +export type FlowNodeRenderDescriptor = z.input; /** Post-parse shape of {@link FlowNodeRenderDescriptor} — defaults applied, transforms run (ADR-0122). */ export type FlowNodeRenderDescriptorParsed = z.infer; @@ -148,7 +148,7 @@ export const FlowCanvasNodeSchema = lazySchema(() => strictObject({ annotation: z.string().optional().describe('User annotation displayed near the node'), }).describe('Canvas layout data for a flow node')); -export type FlowCanvasNode = z.infer; +export type FlowCanvasNode = z.input; /** Post-parse shape of {@link FlowCanvasNode} — defaults applied, transforms run (ADR-0122). */ export type FlowCanvasNodeParsed = z.infer; @@ -167,7 +167,7 @@ export const FlowCanvasEdgeStyleSchema = lazySchema(() => z.enum([ 'back', // ADR-0044 back-edge (revise loop) — curved dashed return arc ]).describe('Edge line style')); -export type FlowCanvasEdgeStyle = z.infer; +export type FlowCanvasEdgeStyle = z.input; /** * A sequence-flow edge on the flow canvas with visual properties. @@ -203,7 +203,7 @@ export const FlowCanvasEdgeSchema = lazySchema(() => strictObject({ animated: z.boolean().default(false).describe('Show animated flow indicator'), }).describe('Canvas layout and visual data for a flow edge')); -export type FlowCanvasEdge = z.infer; +export type FlowCanvasEdge = z.input; /** Post-parse shape of {@link FlowCanvasEdge} — defaults applied, transforms run (ADR-0122). */ export type FlowCanvasEdgeParsed = z.infer; @@ -219,7 +219,7 @@ export const FlowLayoutAlgorithmSchema = lazySchema(() => z.enum([ 'manual', // User-positioned (no auto-layout) ]).describe('Auto-layout algorithm for the flow canvas')); -export type FlowLayoutAlgorithm = z.infer; +export type FlowLayoutAlgorithm = z.input; /** * Direction for the auto-layout. @@ -231,7 +231,7 @@ export const FlowLayoutDirectionSchema = lazySchema(() => z.enum([ 'RL', // Right to left ]).describe('Auto-layout direction')); -export type FlowLayoutDirection = z.infer; +export type FlowLayoutDirection = z.input; // ─── Flow Builder Config ───────────────────────────────────────────── @@ -307,7 +307,7 @@ export const FlowBuilderConfigSchema = lazySchema(() => strictObject({ .describe('Validate connections before creating edges'), }).describe('Studio Flow Builder configuration')); -export type FlowBuilderConfig = z.infer; +export type FlowBuilderConfig = z.input; /** Post-parse shape of {@link FlowBuilderConfig} — defaults applied, transforms run (ADR-0122). */ export type FlowBuilderConfigParsed = z.infer; @@ -355,6 +355,6 @@ export const BUILT_IN_NODE_DESCRIPTORS: FlowNodeRenderDescriptor[] = [ */ export function defineFlowBuilderConfig( input: z.input, -): FlowBuilderConfig { +): FlowBuilderConfigParsed { return FlowBuilderConfigSchema.parse(input); } diff --git a/packages/spec/src/studio/object-designer.zod.ts b/packages/spec/src/studio/object-designer.zod.ts index d11d1765ee..732203924b 100644 --- a/packages/spec/src/studio/object-designer.zod.ts +++ b/packages/spec/src/studio/object-designer.zod.ts @@ -102,7 +102,7 @@ export const FieldPropertySectionSchema = lazySchema(() => strictObject({ order: z.number().default(0).describe('Sort order (lower = higher)'), })); -export type FieldPropertySection = z.infer; +export type FieldPropertySection = z.input; /** Post-parse shape of {@link FieldPropertySection} — defaults applied, transforms run (ADR-0122). */ export type FieldPropertySectionParsed = z.infer; @@ -130,7 +130,7 @@ export const FieldGroupSchema = lazySchema(() => strictObject({ order: z.number().default(0).describe('Sort order (lower = higher)'), })); -export type FieldGroup = z.infer; +export type FieldGroup = z.input; /** Post-parse shape of {@link FieldGroup} — defaults applied, transforms run (ADR-0122). */ export type FieldGroupParsed = z.infer; @@ -176,7 +176,7 @@ export const FieldEditorConfigSchema = lazySchema(() => strictObject({ showUsageStats: z.boolean().default(false).describe('Show field usage statistics'), })); -export type FieldEditorConfig = z.infer; +export type FieldEditorConfig = z.input; /** Post-parse shape of {@link FieldEditorConfig} — defaults applied, transforms run (ADR-0122). */ export type FieldEditorConfigParsed = z.infer; @@ -206,7 +206,7 @@ export const RelationshipDisplaySchema = lazySchema(() => strictObject({ cardinalityLabel: z.string().default('1:N').describe('Cardinality label (e.g., "1:N", "1:1", "N:M")'), })); -export type RelationshipDisplay = z.infer; +export type RelationshipDisplay = z.input; /** Post-parse shape of {@link RelationshipDisplay} — defaults applied, transforms run (ADR-0122). */ export type RelationshipDisplayParsed = z.infer; @@ -235,7 +235,7 @@ export const RelationshipMapperConfigSchema = lazySchema(() => strictObject({ ]).describe('Visual config per relationship type'), })); -export type RelationshipMapperConfig = z.infer; +export type RelationshipMapperConfig = z.input; /** Post-parse shape of {@link RelationshipMapperConfig} — defaults applied, transforms run (ADR-0122). */ export type RelationshipMapperConfigParsed = z.infer; @@ -249,7 +249,7 @@ export const ERLayoutAlgorithmSchema = lazySchema(() => z.enum([ 'circular', // Circular arrangement ]).describe('ER diagram layout algorithm')); -export type ERLayoutAlgorithm = z.infer; +export type ERLayoutAlgorithm = z.input; /** * Node display options — controls what information is shown @@ -281,7 +281,7 @@ export const ERNodeDisplaySchema = lazySchema(() => strictObject({ showDescription: z.boolean().default(true).describe('Show description tooltip on hover'), })); -export type ERNodeDisplay = z.infer; +export type ERNodeDisplay = z.input; /** Post-parse shape of {@link ERNodeDisplay} — defaults applied, transforms run (ADR-0122). */ export type ERNodeDisplayParsed = z.infer; @@ -344,7 +344,7 @@ export const ERDiagramConfigSchema = lazySchema(() => strictObject({ exportFormats: z.array(z.enum(['png', 'svg', 'json'])).default(['png', 'svg']).describe('Available export formats for diagram'), })); -export type ERDiagramConfig = z.infer; +export type ERDiagramConfig = z.input; /** Post-parse shape of {@link ERDiagramConfig} — defaults applied, transforms run (ADR-0122). */ export type ERDiagramConfigParsed = z.infer; @@ -357,7 +357,7 @@ export const ObjectListDisplayModeSchema = lazySchema(() => z.enum([ 'tree', // Hierarchical tree (grouped by package/namespace) ]).describe('Object list display mode')); -export type ObjectListDisplayMode = z.infer; +export type ObjectListDisplayMode = z.input; /** Object list sort field */ export const ObjectSortFieldSchema = lazySchema(() => z.enum([ @@ -367,7 +367,7 @@ export const ObjectSortFieldSchema = lazySchema(() => z.enum([ 'updatedAt', // Sort by last modified ]).describe('Object list sort field')); -export type ObjectSortField = z.infer; +export type ObjectSortField = z.input; /** Object filter criteria */ export const ObjectFilterSchema = lazySchema(() => strictObject({ @@ -396,7 +396,7 @@ export const ObjectFilterSchema = lazySchema(() => strictObject({ searchQuery: z.string().optional().describe('Free-text search across name, label, and description'), })); -export type ObjectFilter = z.infer; +export type ObjectFilter = z.input; /** Post-parse shape of {@link ObjectFilter} — defaults applied, transforms run (ADR-0122). */ export type ObjectFilterParsed = z.infer; @@ -445,7 +445,7 @@ export const ObjectManagerConfigSchema = lazySchema(() => strictObject({ showStatsSummary: z.boolean().default(true).describe('Show statistics summary bar'), })); -export type ObjectManagerConfig = z.infer; +export type ObjectManagerConfig = z.input; /** Post-parse shape of {@link ObjectManagerConfig} — defaults applied, transforms run (ADR-0122). */ export type ObjectManagerConfigParsed = z.infer; @@ -475,7 +475,7 @@ export const ObjectPreviewTabSchema = lazySchema(() => strictObject({ order: z.number().default(0).describe('Sort order (lower = higher)'), })); -export type ObjectPreviewTab = z.infer; +export type ObjectPreviewTab = z.input; /** Post-parse shape of {@link ObjectPreviewTab} — defaults applied, transforms run (ADR-0122). */ export type ObjectPreviewTabParsed = z.infer; @@ -509,7 +509,7 @@ export const ObjectPreviewConfigSchema = lazySchema(() => strictObject({ showBreadcrumbs: z.boolean().default(true).describe('Show navigation breadcrumbs'), })); -export type ObjectPreviewConfig = z.infer; +export type ObjectPreviewConfig = z.input; /** Post-parse shape of {@link ObjectPreviewConfig} — defaults applied, transforms run (ADR-0122). */ export type ObjectPreviewConfigParsed = z.infer; @@ -523,7 +523,7 @@ export const ObjectDesignerDefaultViewSchema = lazySchema(() => z.enum([ 'object-manager', // Object list/manager ]).describe('Default view when entering the Object Designer')); -export type ObjectDesignerDefaultView = z.infer; +export type ObjectDesignerDefaultView = z.input; /** * Object Designer configuration — top-level config that composes @@ -650,7 +650,7 @@ export const ObjectDesignerConfigSchema = lazySchema(() => strictObject({ }).describe('Object preview configuration'), })); -export type ObjectDesignerConfig = z.infer; +export type ObjectDesignerConfig = z.input; /** Post-parse shape of {@link ObjectDesignerConfig} — defaults applied, transforms run (ADR-0122). */ export type ObjectDesignerConfigParsed = z.infer; @@ -675,6 +675,6 @@ export type ObjectDesignerConfigParsed = z.infer, -): ObjectDesignerConfig { +): ObjectDesignerConfigParsed { return ObjectDesignerConfigSchema.parse(input); } diff --git a/packages/spec/src/studio/plugin.zod.ts b/packages/spec/src/studio/plugin.zod.ts index 87322031ed..d08a74d4c3 100644 --- a/packages/spec/src/studio/plugin.zod.ts +++ b/packages/spec/src/studio/plugin.zod.ts @@ -76,7 +76,7 @@ const STUDIO_PLUGIN_HISTORY = + 'loaded and activated, contributing less than its manifest declared.'; export const ViewModeSchema = lazySchema(() => z.enum(['preview', 'design', 'code', 'data', 'history'])); -export type ViewMode = z.infer; +export type ViewMode = z.input; // ─── Metadata Viewer Contribution ──────────────────────────────────── @@ -104,7 +104,7 @@ export const MetadataViewerContributionSchema = lazySchema(() => strictObject({ modes: z.array(ViewModeSchema).default(['preview']).describe('Supported view modes'), })); -export type MetadataViewerContribution = z.infer; +export type MetadataViewerContribution = z.input; /** Post-parse shape of {@link MetadataViewerContribution} — defaults applied, transforms run (ADR-0122). */ export type MetadataViewerContributionParsed = z.infer; @@ -134,7 +134,7 @@ export const SidebarGroupContributionSchema = lazySchema(() => strictObject({ order: z.number().default(100).describe('Sort order (lower = higher)'), })); -export type SidebarGroupContribution = z.infer; +export type SidebarGroupContribution = z.input; /** Post-parse shape of {@link SidebarGroupContribution} — defaults applied, transforms run (ADR-0122). */ export type SidebarGroupContributionParsed = z.infer; @@ -157,7 +157,7 @@ export type SidebarGroupContributionParsed = z.infer z.enum(['toolbar', 'contextMenu', 'commandPalette'])); -export type ActionContributionLocation = z.infer; +export type ActionContributionLocation = z.input; /** * Declares an action that can be triggered on metadata items. @@ -183,7 +183,7 @@ export const ActionContributionSchema = lazySchema(() => strictObject({ metadataTypes: z.array(z.string()).default([]).describe('Applicable metadata types'), })); -export type ActionContribution = z.infer; +export type ActionContribution = z.input; /** Post-parse shape of {@link ActionContribution} — defaults applied, transforms run (ADR-0122). */ export type ActionContributionParsed = z.infer; @@ -207,7 +207,7 @@ export const MetadataIconContributionSchema = lazySchema(() => strictObject({ icon: z.string().describe('Lucide icon name'), })); -export type MetadataIconContribution = z.infer; +export type MetadataIconContribution = z.input; // ─── Panel Contribution ────────────────────────────────────────────── @@ -234,7 +234,7 @@ export const PanelContributionSchema = lazySchema(() => strictObject({ location: PanelLocationSchema.default('bottom').describe('Panel location'), })); -export type PanelContribution = z.infer; +export type PanelContribution = z.input; /** Post-parse shape of {@link PanelContribution} — defaults applied, transforms run (ADR-0122). */ export type PanelContributionParsed = z.infer; @@ -261,7 +261,7 @@ export const CommandContributionSchema = lazySchema(() => strictObject({ icon: z.string().optional().describe('Lucide icon name'), })); -export type CommandContribution = z.infer; +export type CommandContribution = z.input; // ─── Studio Plugin Contributions ───────────────────────────────────── @@ -292,7 +292,7 @@ export const StudioPluginContributionsSchema = lazySchema(() => strictObject({ commands: z.array(CommandContributionSchema).default([]), })); -export type StudioPluginContributions = z.infer; +export type StudioPluginContributions = z.input; /** Post-parse shape of {@link StudioPluginContributions} — defaults applied, transforms run (ADR-0122). */ export type StudioPluginContributionsParsed = z.infer; @@ -403,7 +403,7 @@ export const StudioPluginManifestSchema = lazySchema(() => strictObject({ // existed, so removing the key changes nothing at runtime. })); -export type StudioPluginManifest = z.infer; +export type StudioPluginManifest = z.input; /** Post-parse shape of {@link StudioPluginManifest} — defaults applied, transforms run (ADR-0122). */ export type StudioPluginManifestParsed = z.infer; @@ -431,6 +431,6 @@ export type StudioPluginManifestParsed = z.infer -): StudioPluginManifest { +): StudioPluginManifestParsed { return StudioPluginManifestSchema.parse(input); } diff --git a/packages/spec/src/system/app-install.zod.ts b/packages/spec/src/system/app-install.zod.ts index 39bd996736..3ce3a1ca63 100644 --- a/packages/spec/src/system/app-install.zod.ts +++ b/packages/spec/src/system/app-install.zod.ts @@ -60,7 +60,7 @@ export const AppManifestSchema = lazySchema(() => z.object({ dependencies: z.array(z.string()).default([]).describe('Required app dependencies'), }).describe('App manifest for marketplace installation')); -export type AppManifest = z.infer; +export type AppManifest = z.input; /** Post-parse shape of {@link AppManifest} — defaults applied, transforms run (ADR-0122). */ export type AppManifestParsed = z.infer; @@ -91,7 +91,7 @@ export const AppCompatibilityCheckSchema = lazySchema(() => z.object({ })).default([]).describe('Compatibility issues'), }).describe('App compatibility check result')); -export type AppCompatibilityCheck = z.infer; +export type AppCompatibilityCheck = z.input; /** Post-parse shape of {@link AppCompatibilityCheck} — defaults applied, transforms run (ADR-0122). */ export type AppCompatibilityCheckParsed = z.infer; @@ -116,7 +116,7 @@ export const AppInstallRequestSchema = lazySchema(() => z.object({ skipSeedData: z.boolean().default(false).describe('Skip seed data population'), }).describe('App install request')); -export type AppInstallRequest = z.infer; +export type AppInstallRequest = z.input; /** Post-parse shape of {@link AppInstallRequest} — defaults applied, transforms run (ADR-0122). */ export type AppInstallRequestParsed = z.infer; @@ -149,6 +149,6 @@ export const AppInstallResultSchema = lazySchema(() => z.object({ error: z.string().optional().describe('Error message on failure'), }).describe('App install result')); -export type AppInstallResult = z.infer; +export type AppInstallResult = z.input; /** Post-parse shape of {@link AppInstallResult} — defaults applied, transforms run (ADR-0122). */ export type AppInstallResultParsed = z.infer; diff --git a/packages/spec/src/system/auth-config.zod.ts b/packages/spec/src/system/auth-config.zod.ts index 4c98a1af82..eb0e245fc5 100644 --- a/packages/spec/src/system/auth-config.zod.ts +++ b/packages/spec/src/system/auth-config.zod.ts @@ -176,7 +176,7 @@ export const MutualTLSConfigSchema = lazySchema(() => z.object({ .describe('Certificate pinning configuration'), })); -export type MutualTLSConfig = z.infer; +export type MutualTLSConfig = z.input; /** Post-parse shape of {@link MutualTLSConfig} — defaults applied, transforms run (ADR-0122). */ export type MutualTLSConfigParsed = z.infer; @@ -228,8 +228,8 @@ export const OidcProvidersConfigSchema = lazySchema(() => z.array(OidcProviderCo 'Product or enterprise packages can pass this directly or contribute it through auth:configure.' )); -export type OidcProviderConfig = z.infer; -export type OidcProvidersConfig = z.infer; +export type OidcProviderConfig = z.input; +export type OidcProvidersConfig = z.input; export const EmailAndPasswordConfigSchema = lazySchema(() => z.object({ @@ -333,18 +333,18 @@ export const AuthConfigSchema = lazySchema(() => z.object({ mutualTls: MutualTLSConfigSchema.optional().describe('Mutual TLS (mTLS) configuration'), }).catchall(z.unknown())); -export type AuthProviderConfig = z.infer; -export type AuthPluginConfig = z.infer; +export type AuthProviderConfig = z.input; +export type AuthPluginConfig = z.input; /** Post-parse shape of {@link AuthPluginConfig} — defaults applied, transforms run (ADR-0122). */ export type AuthPluginConfigParsed = z.infer; -export type SocialProviderConfig = z.infer; +export type SocialProviderConfig = z.input; /** Post-parse shape of {@link SocialProviderConfig} — defaults applied, transforms run (ADR-0122). */ export type SocialProviderConfigParsed = z.infer; -export type EmailAndPasswordConfig = z.infer; +export type EmailAndPasswordConfig = z.input; /** Post-parse shape of {@link EmailAndPasswordConfig} — defaults applied, transforms run (ADR-0122). */ export type EmailAndPasswordConfigParsed = z.infer; -export type EmailVerificationConfig = z.infer; -export type AdvancedAuthConfig = z.infer; -export type AuthConfig = z.infer; +export type EmailVerificationConfig = z.input; +export type AdvancedAuthConfig = z.input; +export type AuthConfig = z.input; /** Post-parse shape of {@link AuthConfig} — defaults applied, transforms run (ADR-0122). */ export type AuthConfigParsed = z.infer; diff --git a/packages/spec/src/system/cache.zod.ts b/packages/spec/src/system/cache.zod.ts index e2eeee35f6..e1585142a2 100644 --- a/packages/spec/src/system/cache.zod.ts +++ b/packages/spec/src/system/cache.zod.ts @@ -44,7 +44,7 @@ export const CacheStrategySchema = lazySchema(() => z.enum([ 'ttl', // Time To Live only ]).describe('Cache eviction strategy')); -export type CacheStrategy = z.infer; +export type CacheStrategy = z.input; export const CacheTierSchema = lazySchema(() => z.object({ name: z.string().describe('Unique cache tier name'), @@ -55,10 +55,9 @@ export const CacheTierSchema = lazySchema(() => z.object({ warmup: z.boolean().default(false).describe('Pre-populate cache on startup'), }).describe('Configuration for a single cache tier in the hierarchy')); -export type CacheTier = z.infer; +export type CacheTier = z.input; /** Post-parse shape of {@link CacheTier} — defaults applied, transforms run (ADR-0122). */ export type CacheTierParsed = z.infer; -export type CacheTierInput = z.input; export const CacheInvalidationSchema = lazySchema(() => z.object({ trigger: z.enum(['create', 'update', 'delete', 'manual']).describe('Event that triggers invalidation'), @@ -67,7 +66,7 @@ export const CacheInvalidationSchema = lazySchema(() => z.object({ tags: z.array(z.string()).optional().describe('Cache tags to invalidate'), }).describe('Rule defining when and how cached entries are invalidated')); -export type CacheInvalidation = z.infer; +export type CacheInvalidation = z.input; export const CacheConfigSchema = lazySchema(() => z.object({ enabled: z.boolean().default(false).describe('Enable application-level caching'), @@ -78,10 +77,9 @@ export const CacheConfigSchema = lazySchema(() => z.object({ encryption: z.boolean().default(false).describe('Enable encryption for cached data'), }).describe('Top-level application cache configuration')); -export type CacheConfig = z.infer; +export type CacheConfig = z.input; /** Post-parse shape of {@link CacheConfig} — defaults applied, transforms run (ADR-0122). */ export type CacheConfigParsed = z.infer; -export type CacheConfigInput = z.input; /** * Distributed Cache Consistency Schema @@ -100,7 +98,7 @@ export const CacheConsistencySchema = lazySchema(() => z.enum([ 'refresh_ahead', ]).describe('Distributed cache write consistency strategy')); -export type CacheConsistency = z.infer; +export type CacheConsistency = z.input; /** * Cache Avalanche Prevention Schema @@ -137,7 +135,7 @@ export const CacheAvalanchePreventionSchema = lazySchema(() => z.object({ }).optional().describe('Lock-based stampede prevention'), }).describe('Cache avalanche/stampede prevention configuration')); -export type CacheAvalanchePrevention = z.infer; +export type CacheAvalanchePrevention = z.input; /** Post-parse shape of {@link CacheAvalanchePrevention} — defaults applied, transforms run (ADR-0122). */ export type CacheAvalanchePreventionParsed = z.infer; @@ -160,7 +158,7 @@ export const CacheWarmupSchema = lazySchema(() => z.object({ concurrency: z.number().default(10).describe('Maximum concurrent warmup operations'), }).describe('Cache warmup strategy')); -export type CacheWarmup = z.infer; +export type CacheWarmup = z.input; /** Post-parse shape of {@link CacheWarmup} — defaults applied, transforms run (ADR-0122). */ export type CacheWarmupParsed = z.infer; @@ -200,7 +198,6 @@ export const DistributedCacheConfigSchema = lazySchema(() => CacheConfigSchema.e warmup: CacheWarmupSchema.optional().describe('Cache warmup strategy'), }).describe('Distributed cache configuration with consistency and avalanche prevention')); -export type DistributedCacheConfig = z.infer; +export type DistributedCacheConfig = z.input; /** Post-parse shape of {@link DistributedCacheConfig} — defaults applied, transforms run (ADR-0122). */ export type DistributedCacheConfigParsed = z.infer; -export type DistributedCacheConfigInput = z.input; diff --git a/packages/spec/src/system/change-management.zod.ts b/packages/spec/src/system/change-management.zod.ts index b784ec8b04..fb709abcf2 100644 --- a/packages/spec/src/system/change-management.zod.ts +++ b/packages/spec/src/system/change-management.zod.ts @@ -419,11 +419,11 @@ export const ChangeRequestSchema = lazySchema(() => z.object({ })); // Type exports -export type ChangeRequest = z.infer; +export type ChangeRequest = z.input; /** Post-parse shape of {@link ChangeRequest} — defaults applied, transforms run (ADR-0122). */ export type ChangeRequestParsed = z.infer; -export type ChangeType = z.infer; -export type ChangeStatus = z.infer; -export type ChangePriority = z.infer; -export type ChangeImpact = z.infer; -export type RollbackPlan = z.infer; +export type ChangeType = z.input; +export type ChangeStatus = z.input; +export type ChangePriority = z.input; +export type ChangeImpact = z.input; +export type RollbackPlan = z.input; diff --git a/packages/spec/src/system/collaboration.zod.ts b/packages/spec/src/system/collaboration.zod.ts index 17dcf280b0..9be9905b4b 100644 --- a/packages/spec/src/system/collaboration.zod.ts +++ b/packages/spec/src/system/collaboration.zod.ts @@ -27,7 +27,7 @@ export const OTOperationType = z.enum([ 'retain', // Keep characters (used for composing operations) ]); -export type OTOperationType = z.infer; +export type OTOperationType = z.input; /** * OT Operation Component @@ -50,7 +50,7 @@ export const OTComponentSchema = lazySchema(() => z.discriminatedUnion('type', [ }), ])); -export type OTComponent = z.infer; +export type OTComponent = z.input; /** * OT Operation Schema @@ -68,7 +68,7 @@ export const OTOperationSchema = lazySchema(() => z.object({ metadata: z.record(z.string(), z.unknown()).optional().describe('Additional operation metadata'), })); -export type OTOperation = z.infer; +export type OTOperation = z.input; /** * OT Transform Result @@ -80,7 +80,7 @@ export const OTTransformResultSchema = lazySchema(() => z.object({ conflicts: z.array(z.string()).optional().describe('Conflict descriptions if any'), })); -export type OTTransformResult = z.infer; +export type OTTransformResult = z.input; // ========================================== // CRDT (Conflict-free Replicated Data Types) @@ -102,7 +102,7 @@ export const CRDTType = z.enum([ 'json', // CRDT-based JSON (e.g., Automerge) ]); -export type CRDTType = z.infer; +export type CRDTType = z.input; /** * Vector Clock Schema @@ -112,7 +112,7 @@ export const VectorClockSchema = lazySchema(() => z.object({ clock: z.record(z.string(), z.number().int().nonnegative()).describe('Map of replica ID to logical timestamp'), })); -export type VectorClock = z.infer; +export type VectorClock = z.input; /** * LWW-Register Schema @@ -126,7 +126,7 @@ export const LWWRegisterSchema = lazySchema(() => z.object({ vectorClock: VectorClockSchema.optional().describe('Optional vector clock for causality tracking'), })); -export type LWWRegister = z.infer; +export type LWWRegister = z.input; /** * Counter Operation Schema @@ -138,7 +138,7 @@ export const CounterOperationSchema = lazySchema(() => z.object({ timestamp: z.string().datetime().describe('ISO 8601 datetime of operation'), })); -export type CounterOperation = z.infer; +export type CounterOperation = z.input; /** * G-Counter Schema @@ -149,7 +149,7 @@ export const GCounterSchema = lazySchema(() => z.object({ counts: z.record(z.string(), z.number().int().nonnegative()).describe('Map of replica ID to count'), })); -export type GCounter = z.infer; +export type GCounter = z.input; /** * PN-Counter Schema @@ -161,7 +161,7 @@ export const PNCounterSchema = lazySchema(() => z.object({ negative: z.record(z.string(), z.number().int().nonnegative()).describe('Negative increments per replica'), })); -export type PNCounter = z.infer; +export type PNCounter = z.input; /** * OR-Set Element Schema @@ -175,7 +175,7 @@ export const ORSetElementSchema = lazySchema(() => z.object({ removed: z.boolean().optional().default(false).describe('Whether element has been removed'), })); -export type ORSetElement = z.infer; +export type ORSetElement = z.input; /** Post-parse shape of {@link ORSetElement} — defaults applied, transforms run (ADR-0122). */ export type ORSetElementParsed = z.infer; @@ -188,7 +188,7 @@ export const ORSetSchema = lazySchema(() => z.object({ elements: z.array(ORSetElementSchema).describe('Set elements with metadata'), })); -export type ORSet = z.infer; +export type ORSet = z.input; /** Post-parse shape of {@link ORSet} — defaults applied, transforms run (ADR-0122). */ export type ORSetParsed = z.infer; @@ -206,7 +206,7 @@ export const TextCRDTOperationSchema = lazySchema(() => z.object({ lamportTimestamp: z.number().int().nonnegative().describe('Lamport timestamp for ordering'), })); -export type TextCRDTOperation = z.infer; +export type TextCRDTOperation = z.input; /** * Text CRDT State Schema @@ -221,7 +221,7 @@ export const TextCRDTStateSchema = lazySchema(() => z.object({ vectorClock: VectorClockSchema.describe('Vector clock for causality'), })); -export type TextCRDTState = z.infer; +export type TextCRDTState = z.input; /** * CRDT State Union @@ -235,7 +235,7 @@ export const CRDTStateSchema = lazySchema(() => z.discriminatedUnion('type', [ TextCRDTStateSchema, ])); -export type CRDTState = z.infer; +export type CRDTState = z.input; /** Post-parse shape of {@link CRDTState} — defaults applied, transforms run (ADR-0122). */ export type CRDTStateParsed = z.infer; @@ -252,7 +252,7 @@ export const CRDTMergeResultSchema = lazySchema(() => z.object({ })).optional().describe('Conflicts encountered during merge'), })); -export type CRDTMergeResult = z.infer; +export type CRDTMergeResult = z.input; /** Post-parse shape of {@link CRDTMergeResult} — defaults applied, transforms run (ADR-0122). */ export type CRDTMergeResultParsed = z.infer; @@ -277,7 +277,7 @@ export const CursorColorPreset = z.enum([ 'cyan', ]); -export type CursorColorPreset = z.infer; +export type CursorColorPreset = z.input; /** * Cursor Style Schema @@ -291,7 +291,7 @@ export const CursorStyleSchema = lazySchema(() => z.object({ pulseOnUpdate: z.boolean().optional().default(true).describe('Whether to pulse when cursor moves'), })); -export type CursorStyle = z.infer; +export type CursorStyle = z.input; /** Post-parse shape of {@link CursorStyle} — defaults applied, transforms run (ADR-0122). */ export type CursorStyleParsed = z.infer; @@ -311,7 +311,7 @@ export const CursorSelectionSchema = lazySchema(() => z.object({ direction: z.enum(['forward', 'backward']).optional().describe('Selection direction'), })); -export type CursorSelection = z.infer; +export type CursorSelection = z.input; /** * Collaborative Cursor Schema @@ -333,7 +333,7 @@ export const CollaborativeCursorSchema = lazySchema(() => z.object({ metadata: z.record(z.string(), z.unknown()).optional().describe('Additional cursor metadata'), })); -export type CollaborativeCursor = z.infer; +export type CollaborativeCursor = z.input; /** Post-parse shape of {@link CollaborativeCursor} — defaults applied, transforms run (ADR-0122). */ export type CollaborativeCursorParsed = z.infer; @@ -351,7 +351,7 @@ export const CursorUpdateSchema = lazySchema(() => z.object({ metadata: z.record(z.string(), z.unknown()).optional().describe('Updated metadata'), })); -export type CursorUpdate = z.infer; +export type CursorUpdate = z.input; // ========================================== // Awareness State @@ -368,7 +368,7 @@ export const UserActivityStatus = z.enum([ 'disconnected', // User is disconnected ]); -export type UserActivityStatus = z.infer; +export type UserActivityStatus = z.input; /** * Awareness User State Schema @@ -388,7 +388,7 @@ export const AwarenessUserStateSchema = lazySchema(() => z.object({ metadata: z.record(z.string(), z.unknown()).optional().describe('Additional user state metadata'), })); -export type AwarenessUserState = z.infer; +export type AwarenessUserState = z.input; /** * Awareness Session Schema @@ -403,7 +403,7 @@ export const AwarenessSessionSchema = lazySchema(() => z.object({ metadata: z.record(z.string(), z.unknown()).optional().describe('Session metadata'), })); -export type AwarenessSession = z.infer; +export type AwarenessSession = z.input; /** * Awareness Update Schema @@ -416,7 +416,7 @@ export const AwarenessUpdateSchema = lazySchema(() => z.object({ metadata: z.record(z.string(), z.unknown()).optional().describe('Updated metadata'), })); -export type AwarenessUpdate = z.infer; +export type AwarenessUpdate = z.input; /** * Awareness Event Schema @@ -437,7 +437,7 @@ export const AwarenessEventSchema = lazySchema(() => z.object({ payload: z.unknown().describe('Event payload'), })); -export type AwarenessEvent = z.infer; +export type AwarenessEvent = z.input; // ========================================== // Collaboration Session Management @@ -454,7 +454,7 @@ export const CollaborationMode = z.enum([ 'hybrid', // Hybrid approach ]); -export type CollaborationMode = z.infer; +export type CollaborationMode = z.input; /** * Collaboration Session Config @@ -475,7 +475,7 @@ export const CollaborationSessionConfigSchema = lazySchema(() => z.object({ }).optional().describe('Snapshot configuration'), })); -export type CollaborationSessionConfig = z.infer; +export type CollaborationSessionConfig = z.input; /** Post-parse shape of {@link CollaborationSessionConfig} — defaults applied, transforms run (ADR-0122). */ export type CollaborationSessionConfigParsed = z.infer; @@ -496,6 +496,6 @@ export const CollaborationSessionSchema = lazySchema(() => z.object({ status: z.enum(['active', 'idle', 'ended']).describe('Session status'), })); -export type CollaborationSession = z.infer; +export type CollaborationSession = z.input; /** Post-parse shape of {@link CollaborationSession} — defaults applied, transforms run (ADR-0122). */ export type CollaborationSessionParsed = z.infer; diff --git a/packages/spec/src/system/core-services.zod.ts b/packages/spec/src/system/core-services.zod.ts index 3ff7aa571a..246bc8d620 100644 --- a/packages/spec/src/system/core-services.zod.ts +++ b/packages/spec/src/system/core-services.zod.ts @@ -47,7 +47,7 @@ export const CoreServiceName = z.enum([ // quoted token in this block as an enum member, comments included.) ]); -export type CoreServiceName = z.infer; +export type CoreServiceName = z.input; /** * Which published package actually fills each service slot — or `null` when diff --git a/packages/spec/src/system/deploy-bundle.zod.ts b/packages/spec/src/system/deploy-bundle.zod.ts index 9f8af9b4b0..584eabe13f 100644 --- a/packages/spec/src/system/deploy-bundle.zod.ts +++ b/packages/spec/src/system/deploy-bundle.zod.ts @@ -34,7 +34,7 @@ export const DeployStatusEnum = z.enum([ 'rolling_back', // Rollback in progress ]).describe('Deployment lifecycle status'); -export type DeployStatus = z.infer; +export type DeployStatus = z.input; // ========================================================================== // 2. Deploy Diff @@ -63,7 +63,7 @@ export const SchemaChangeSchema = lazySchema(() => z.object({ newValue: z.unknown().optional().describe('New value'), }).describe('Individual schema change')); -export type SchemaChange = z.infer; +export type SchemaChange = z.input; /** * Deploy Diff — what changed between current and desired state. @@ -83,7 +83,7 @@ export const DeployDiffSchema = lazySchema(() => z.object({ hasBreakingChanges: z.boolean().default(false).describe('Whether diff contains breaking changes'), }).describe('Schema diff between current and desired state')); -export type DeployDiff = z.infer; +export type DeployDiff = z.input; /** Post-parse shape of {@link DeployDiff} — defaults applied, transforms run (ADR-0122). */ export type DeployDiffParsed = z.infer; @@ -108,7 +108,7 @@ export const MigrationStatementSchema = lazySchema(() => z.object({ order: z.number().int().min(0).describe('Execution order'), }).describe('Single DDL migration statement')); -export type MigrationStatement = z.infer; +export type MigrationStatement = z.input; /** Post-parse shape of {@link MigrationStatement} — defaults applied, transforms run (ADR-0122). */ export type MigrationStatementParsed = z.infer; @@ -129,7 +129,7 @@ export const MigrationPlanSchema = lazySchema(() => z.object({ estimatedDurationMs: z.number().int().min(0).optional().describe('Estimated execution time'), }).describe('Ordered migration plan')); -export type MigrationPlan = z.infer; +export type MigrationPlan = z.input; /** Post-parse shape of {@link MigrationPlan} — defaults applied, transforms run (ADR-0122). */ export type MigrationPlanParsed = z.infer; @@ -154,7 +154,7 @@ export const DeployValidationIssueSchema = lazySchema(() => z.object({ code: z.string().optional().describe('Validation error code'), }).describe('Validation issue')); -export type DeployValidationIssue = z.infer; +export type DeployValidationIssue = z.input; /** * Zod validation result for the entire deploy bundle. @@ -173,7 +173,7 @@ export const DeployValidationResultSchema = lazySchema(() => z.object({ warningCount: z.number().int().min(0).default(0).describe('Number of warnings'), }).describe('Bundle validation result')); -export type DeployValidationResult = z.infer; +export type DeployValidationResult = z.input; /** Post-parse shape of {@link DeployValidationResult} — defaults applied, transforms run (ADR-0122). */ export type DeployValidationResultParsed = z.infer; @@ -207,7 +207,7 @@ export const DeployManifestSchema = lazySchema(() => z.object({ createdAt: z.string().datetime().optional().describe('Bundle creation time'), }).describe('Deployment manifest')); -export type DeployManifest = z.infer; +export type DeployManifest = z.input; /** Post-parse shape of {@link DeployManifest} — defaults applied, transforms run (ADR-0122). */ export type DeployManifestParsed = z.infer; @@ -235,6 +235,6 @@ export const DeployBundleSchema = lazySchema(() => z.object({ seedData: z.array(z.record(z.string(), z.unknown())).default([]).describe('Seed data records'), }).describe('Deploy bundle containing all metadata for deployment')); -export type DeployBundle = z.infer; +export type DeployBundle = z.input; /** Post-parse shape of {@link DeployBundle} — defaults applied, transforms run (ADR-0122). */ export type DeployBundleParsed = z.infer; diff --git a/packages/spec/src/system/disaster-recovery.zod.ts b/packages/spec/src/system/disaster-recovery.zod.ts index d06aedf852..6701f7b98a 100644 --- a/packages/spec/src/system/disaster-recovery.zod.ts +++ b/packages/spec/src/system/disaster-recovery.zod.ts @@ -29,7 +29,7 @@ export const BackupStrategySchema = lazySchema(() => z.enum([ 'differential', ]).describe('Backup strategy type')); -export type BackupStrategy = z.infer; +export type BackupStrategy = z.input; /** * Backup Retention Policy Schema @@ -43,7 +43,7 @@ export const BackupRetentionSchema = lazySchema(() => z.object({ maxCopies: z.number().optional().describe('Maximum backup copies to store'), }).describe('Backup retention policy')); -export type BackupRetention = z.infer; +export type BackupRetention = z.input; /** Post-parse shape of {@link BackupRetention} — defaults applied, transforms run (ADR-0122). */ export type BackupRetentionParsed = z.infer; @@ -80,10 +80,9 @@ export const BackupConfigSchema = lazySchema(() => z.object({ verifyAfterBackup: z.boolean().default(true).describe('Verify backup integrity after creation'), }).describe('Backup configuration')); -export type BackupConfig = z.infer; +export type BackupConfig = z.input; /** Post-parse shape of {@link BackupConfig} — defaults applied, transforms run (ADR-0122). */ export type BackupConfigParsed = z.infer; -export type BackupConfigInput = z.input; /** * Failover Mode Schema @@ -102,7 +101,7 @@ export const FailoverModeSchema = lazySchema(() => z.enum([ 'warm_standby', ]).describe('Failover mode')); -export type FailoverMode = z.infer; +export type FailoverMode = z.input; /** * Failover Configuration Schema @@ -131,10 +130,9 @@ export const FailoverConfigSchema = lazySchema(() => z.object({ }).optional().describe('DNS failover settings'), }).describe('Failover configuration')); -export type FailoverConfig = z.infer; +export type FailoverConfig = z.input; /** Post-parse shape of {@link FailoverConfig} — defaults applied, transforms run (ADR-0122). */ export type FailoverConfigParsed = z.infer; -export type FailoverConfigInput = z.input; /** * Recovery Point Objective (RPO) Schema @@ -148,7 +146,7 @@ export const RPOSchema = lazySchema(() => z.object({ unit: z.enum(['seconds', 'minutes', 'hours']).default('minutes').describe('RPO time unit'), }).describe('Recovery Point Objective (maximum acceptable data loss)')); -export type RPO = z.infer; +export type RPO = z.input; /** Post-parse shape of {@link RPO} — defaults applied, transforms run (ADR-0122). */ export type RPOParsed = z.infer; @@ -164,7 +162,7 @@ export const RTOSchema = lazySchema(() => z.object({ unit: z.enum(['seconds', 'minutes', 'hours']).default('minutes').describe('RTO time unit'), }).describe('Recovery Time Objective (maximum acceptable downtime)')); -export type RTO = z.infer; +export type RTO = z.input; /** Post-parse shape of {@link RTO} — defaults applied, transforms run (ADR-0122). */ export type RTOParsed = z.infer; @@ -254,7 +252,6 @@ export const DisasterRecoveryPlanSchema = lazySchema(() => z.object({ })).optional().describe('Emergency contact list for DR incidents'), }).describe('Complete disaster recovery plan configuration')); -export type DisasterRecoveryPlan = z.infer; +export type DisasterRecoveryPlan = z.input; /** Post-parse shape of {@link DisasterRecoveryPlan} — defaults applied, transforms run (ADR-0122). */ export type DisasterRecoveryPlanParsed = z.infer; -export type DisasterRecoveryPlanInput = z.input; diff --git a/packages/spec/src/system/doc.zod.ts b/packages/spec/src/system/doc.zod.ts index 5db3cf172e..484e558948 100644 --- a/packages/spec/src/system/doc.zod.ts +++ b/packages/spec/src/system/doc.zod.ts @@ -151,7 +151,7 @@ export const DocSchema = lazySchema(() => strictObject({ // strict (#4001 findings log, entry 2). ...MetadataProtectionFields, })); -export type Doc = z.infer; +export type Doc = z.input; export type DocTranslation = NonNullable[string]; /** diff --git a/packages/spec/src/system/email-config.zod.ts b/packages/spec/src/system/email-config.zod.ts index 83a2adc826..18f15ec281 100644 --- a/packages/spec/src/system/email-config.zod.ts +++ b/packages/spec/src/system/email-config.zod.ts @@ -62,13 +62,13 @@ import { lazySchema } from '../shared/lazy-schema'; * access keys). */ export const EmailProviderSchema = lazySchema(() => z.enum(['log', 'resend', 'postmark', 'smtp'])); -export type EmailProvider = z.infer; +export type EmailProvider = z.input; export const EmailAddressConfigSchema = lazySchema(() => z.object({ name: z.string().optional().describe('Display name (e.g. "Acme CRM")'), address: z.string().email().describe('RFC-5322 address'), })); -export type EmailAddressConfig = z.infer; +export type EmailAddressConfig = z.input; export const EmailServiceConfigSchema = lazySchema(() => z.object({ /** @@ -214,6 +214,6 @@ export const EmailServiceConfigSchema = lazySchema(() => z.object({ + 'OS_APP_NAME and the appName key both override the value written here', ), })); -export type EmailServiceConfig = z.infer; +export type EmailServiceConfig = z.input; /** Post-parse shape of {@link EmailServiceConfig} — defaults applied, transforms run (ADR-0122). */ export type EmailServiceConfigParsed = z.infer; diff --git a/packages/spec/src/system/email-template.zod.ts b/packages/spec/src/system/email-template.zod.ts index fafc02ca68..5bde3fcbf6 100644 --- a/packages/spec/src/system/email-template.zod.ts +++ b/packages/spec/src/system/email-template.zod.ts @@ -32,7 +32,7 @@ export const EmailTemplateDefinitionCategorySchema = lazySchema(() => z.enum([ 'marketing', // Outbound campaigns 'custom', // App-defined ])); -export type EmailTemplateDefinitionCategory = z.infer; +export type EmailTemplateDefinitionCategory = z.input; export const EmailTemplateDefinitionVariableSchema = lazySchema(() => z.object({ name: z.string().describe('Variable name as referenced in placeholders (snake_case or dotted path)'), @@ -40,7 +40,7 @@ export const EmailTemplateDefinitionVariableSchema = lazySchema(() => z.object({ required: z.boolean().default(false), description: z.string().optional().describe('Author hint shown in Studio'), })); -export type EmailTemplateDefinitionVariable = z.infer; +export type EmailTemplateDefinitionVariable = z.input; /** Post-parse shape of {@link EmailTemplateDefinitionVariable} — defaults applied, transforms run (ADR-0122). */ export type EmailTemplateDefinitionVariableParsed = z.infer; @@ -153,17 +153,15 @@ function EmailAddressInlineSchema() { }); } -export type EmailTemplateDefinition = z.infer; +export type EmailTemplateDefinition = z.input; /** Post-parse shape of {@link EmailTemplateDefinition} — defaults applied, transforms run (ADR-0122). */ export type EmailTemplateDefinitionParsed = z.infer; -/** Authoring input for {@link EmailTemplateDefinition} — defaulted fields are optional. */ -export type EmailTemplateDefinitionInput = z.input; /** * Type-safe factory for an email template. Validates at authoring time via * `.parse()` and accepts input-shape config (optional defaults, CEL * shorthand) — preferred over a bare `: EmailTemplateDefinition` literal. */ -export function defineEmailTemplateDefinition(config: z.input): EmailTemplateDefinition { +export function defineEmailTemplateDefinition(config: z.input): EmailTemplateDefinitionParsed { return EmailTemplateDefinitionSchema.parse(config); } diff --git a/packages/spec/src/system/encryption.zod.ts b/packages/spec/src/system/encryption.zod.ts index 4e3d989410..754c473d4b 100644 --- a/packages/spec/src/system/encryption.zod.ts +++ b/packages/spec/src/system/encryption.zod.ts @@ -17,7 +17,7 @@ export const EncryptionAlgorithmSchema = lazySchema(() => z.enum([ 'chacha20-poly1305', ]).describe('Supported encryption algorithm')); -export type EncryptionAlgorithm = z.infer; +export type EncryptionAlgorithm = z.input; export const KeyManagementProviderSchema = lazySchema(() => z.enum([ 'local', @@ -27,7 +27,7 @@ export const KeyManagementProviderSchema = lazySchema(() => z.enum([ 'hashicorp-vault', ]).describe('Key management service provider')); -export type KeyManagementProvider = z.infer; +export type KeyManagementProvider = z.input; export const KeyRotationPolicySchema = lazySchema(() => z.object({ enabled: z.boolean().default(false).describe('Enable automatic key rotation'), @@ -36,10 +36,9 @@ export const KeyRotationPolicySchema = lazySchema(() => z.object({ autoRotate: z.boolean().default(true).describe('Automatically rotate without manual approval'), }).describe('Policy for automatic encryption key rotation')); -export type KeyRotationPolicy = z.infer; +export type KeyRotationPolicy = z.input; /** Post-parse shape of {@link KeyRotationPolicy} — defaults applied, transforms run (ADR-0122). */ export type KeyRotationPolicyParsed = z.infer; -export type KeyRotationPolicyInput = z.input; export const EncryptionConfigSchema = lazySchema(() => z.object({ enabled: z.boolean().default(false).describe('Enable field-level encryption'), @@ -54,10 +53,9 @@ export const EncryptionConfigSchema = lazySchema(() => z.object({ searchableEncryption: z.boolean().default(false).describe('Allows search on encrypted data'), }).describe('Field-level encryption configuration')); -export type EncryptionConfig = z.infer; +export type EncryptionConfig = z.input; /** Post-parse shape of {@link EncryptionConfig} — defaults applied, transforms run (ADR-0122). */ export type EncryptionConfigParsed = z.infer; -export type EncryptionConfigInput = z.input; export const FieldEncryptionSchema = lazySchema(() => z.object({ fieldName: z.string().describe('Name of the field to encrypt'), @@ -65,7 +63,6 @@ export const FieldEncryptionSchema = lazySchema(() => z.object({ indexable: z.boolean().default(false).describe('Allow indexing on encrypted field'), }).describe('Per-field encryption assignment')); -export type FieldEncryption = z.infer; +export type FieldEncryption = z.input; /** Post-parse shape of {@link FieldEncryption} — defaults applied, transforms run (ADR-0122). */ export type FieldEncryptionParsed = z.infer; -export type FieldEncryptionInput = z.input; diff --git a/packages/spec/src/system/environment-artifact.test.ts b/packages/spec/src/system/environment-artifact.test.ts index adc73ac53b..abaedae32c 100644 --- a/packages/spec/src/system/environment-artifact.test.ts +++ b/packages/spec/src/system/environment-artifact.test.ts @@ -10,7 +10,7 @@ import { // ─── [#4740] `EnvironmentArtifact(Schema)` has ONE declaration — ./system ─── // // `./cloud` and `./system` both exported `EnvironmentArtifact` / -// `EnvironmentArtifactInput` / `EnvironmentArtifactSchema` for two DIFFERENT +// `EnvironmentArtifactInput` (as it was then spelled) / `EnvironmentArtifactSchema` for two DIFFERENT // declarations (the #4411 trap — which shape a consumer got depended only on // the import path): // @@ -108,7 +108,12 @@ describe('[#4740] `EnvironmentArtifact(Schema)` resolves to the ./system declara // by resolving nothing. const systemExports = exportsOf('./system'); expect(systemExports.length, './system must export a non-trivial surface').toBeGreaterThan(100); - const names = ['EnvironmentArtifact', 'EnvironmentArtifactInput', 'EnvironmentArtifactSchema'] as const; + // `EnvironmentArtifactInput` was retired by ADR-0122 phase 2 (#6083) — the + // bare name IS the author state now, and the parsed state moved onto + // `EnvironmentArtifactParsed`. The pin follows the surviving names: the + // dual-source hazard is about WHICH DECLARATION a name resolves to, so it + // must track the names that exist, not the ones that used to. + const names = ['EnvironmentArtifact', 'EnvironmentArtifactParsed', 'EnvironmentArtifactSchema'] as const; const canonical: Record = {}; for (const name of names) { const sym = systemExports.find((e) => e.getName() === name); @@ -144,7 +149,7 @@ describe('[#4740] `EnvironmentArtifact(Schema)` resolves to the ./system declara } // 3. Uniqueness — the dual-source pin proper: across EVERY public entry, - // an export named `EnvironmentArtifact(Input|Schema)` must resolve to + // an export named `EnvironmentArtifact(Parsed|Schema)` must resolve to // the ONE ./system declaration. Re-adding a second declaration under // any entry (S1/S2 sabotage) turns this red. for (const sub of Object.keys(entries)) { diff --git a/packages/spec/src/system/environment-artifact.zod.ts b/packages/spec/src/system/environment-artifact.zod.ts index dea17bf33b..69e2f7d7af 100644 --- a/packages/spec/src/system/environment-artifact.zod.ts +++ b/packages/spec/src/system/environment-artifact.zod.ts @@ -67,7 +67,7 @@ export const Sha256DigestSchema = z .regex(/^[a-f0-9]{64}$/, 'Must be a 64-character lowercase hex SHA-256 digest') .describe('SHA-256 digest (64 hex chars)'); -export type Sha256Digest = z.infer; +export type Sha256Digest = z.input; // ========================================== // Envelope @@ -145,7 +145,6 @@ export const EnvironmentArtifactSchema = lazySchema(() => z.object({ ), })); -export type EnvironmentArtifact = z.infer; +export type EnvironmentArtifact = z.input; /** Post-parse shape of {@link EnvironmentArtifact} — defaults applied, transforms run (ADR-0122). */ export type EnvironmentArtifactParsed = z.infer; -export type EnvironmentArtifactInput = z.input; diff --git a/packages/spec/src/system/http-server.zod.ts b/packages/spec/src/system/http-server.zod.ts index 94c730f39a..26a6119f32 100644 --- a/packages/spec/src/system/http-server.zod.ts +++ b/packages/spec/src/system/http-server.zod.ts @@ -113,10 +113,9 @@ export const RouteHandlerMetadataSchema = lazySchema(() => z.object({ }).optional(), })); -export type RouteHandlerMetadata = z.infer; +export type RouteHandlerMetadata = z.input; /** Post-parse shape of {@link RouteHandlerMetadata} — defaults applied, transforms run (ADR-0122). */ export type RouteHandlerMetadataParsed = z.infer; -export type RouteHandlerMetadataInput = z.input; // ========================================== // Middleware Configuration @@ -135,7 +134,7 @@ export const MiddlewareType = z.enum([ 'custom', // Custom middleware ]); -export type MiddlewareType = z.infer; +export type MiddlewareType = z.input; /** * Middleware Configuration Schema @@ -188,10 +187,9 @@ export const MiddlewareConfigSchema = lazySchema(() => z.object({ }).optional().describe('Path filtering'), })); -export type MiddlewareConfig = z.infer; +export type MiddlewareConfig = z.input; /** Post-parse shape of {@link MiddlewareConfig} — defaults applied, transforms run (ADR-0122). */ export type MiddlewareConfigParsed = z.infer; -export type MiddlewareConfigInput = z.input; // ========================================== // Server Lifecycle Events @@ -210,7 +208,7 @@ export const ServerEventType = z.enum([ 'error', // Error occurred ]); -export type ServerEventType = z.infer; +export type ServerEventType = z.input; /** * Server Event Schema @@ -233,7 +231,7 @@ export const ServerEventSchema = lazySchema(() => z.object({ data: z.record(z.string(), z.unknown()).optional().describe('Event-specific data'), })); -export type ServerEvent = z.infer; +export type ServerEvent = z.input; // ========================================== // Server Capability Declaration @@ -285,10 +283,9 @@ export const ServerCapabilitiesSchema = lazySchema(() => z.object({ compression: z.boolean().default(true).describe('Built-in compression support'), })); -export type ServerCapabilities = z.infer; +export type ServerCapabilities = z.input; /** Post-parse shape of {@link ServerCapabilities} — defaults applied, transforms run (ADR-0122). */ export type ServerCapabilitiesParsed = z.infer; -export type ServerCapabilitiesInput = z.input; // ========================================== // Server Status & Metrics @@ -336,7 +333,7 @@ export const ServerStatusSchema = lazySchema(() => z.object({ }).optional(), })); -export type ServerStatus = z.infer; +export type ServerStatus = z.input; // ========================================== // Helper Functions diff --git a/packages/spec/src/system/incident-response.zod.ts b/packages/spec/src/system/incident-response.zod.ts index 343efecd0d..38898bd3c1 100644 --- a/packages/spec/src/system/incident-response.zod.ts +++ b/packages/spec/src/system/incident-response.zod.ts @@ -107,7 +107,7 @@ export const IncidentResponsePhaseSchema = lazySchema(() => z.object({ notes: z.string().optional().describe('Phase notes and findings'), }).describe('Incident response phase with timing and assignment')); -export type IncidentResponsePhase = z.infer; +export type IncidentResponsePhase = z.input; /** * Notification Rule Schema @@ -154,7 +154,7 @@ export const IncidentNotificationRuleSchema = lazySchema(() => z.object({ .describe('Regulatory notification deadline in hours'), }).describe('Incident notification rule per severity level')); -export type IncidentNotificationRule = z.infer; +export type IncidentNotificationRule = z.input; /** Post-parse shape of {@link IncidentNotificationRule} — defaults applied, transforms run (ADR-0122). */ export type IncidentNotificationRuleParsed = z.infer; @@ -183,7 +183,7 @@ export const IncidentNotificationMatrixSchema = lazySchema(() => z.object({ .describe('Ordered escalation chain of roles'), }).describe('Incident notification matrix with escalation policies')); -export type IncidentNotificationMatrix = z.infer; +export type IncidentNotificationMatrix = z.input; /** Post-parse shape of {@link IncidentNotificationMatrix} — defaults applied, transforms run (ADR-0122). */ export type IncidentNotificationMatrixParsed = z.infer; @@ -365,10 +365,10 @@ export const IncidentResponsePolicySchema = lazySchema(() => z.object({ }).describe('Organization-level incident response policy per ISO 27001:2022')); // Type exports -export type IncidentSeverity = z.infer; -export type IncidentCategory = z.infer; -export type IncidentStatus = z.infer; -export type Incident = z.infer; -export type IncidentResponsePolicy = z.infer; +export type IncidentSeverity = z.input; +export type IncidentCategory = z.input; +export type IncidentStatus = z.input; +export type Incident = z.input; +export type IncidentResponsePolicy = z.input; /** Post-parse shape of {@link IncidentResponsePolicy} — defaults applied, transforms run (ADR-0122). */ export type IncidentResponsePolicyParsed = z.infer; diff --git a/packages/spec/src/system/job.zod.ts b/packages/spec/src/system/job.zod.ts index 853c1d51cd..37b2f08193 100644 --- a/packages/spec/src/system/job.zod.ts +++ b/packages/spec/src/system/job.zod.ts @@ -44,14 +44,14 @@ export const ScheduleSchema = lazySchema(() => z.discriminatedUnion('type', [ OnceScheduleSchema, ])); -export type Schedule = z.infer; +export type Schedule = z.input; /** Post-parse shape of {@link Schedule} — defaults applied, transforms run (ADR-0122). */ export type ScheduleParsed = z.infer; -export type CronSchedule = z.infer; +export type CronSchedule = z.input; /** Post-parse shape of {@link CronSchedule} — defaults applied, transforms run (ADR-0122). */ export type CronScheduleParsed = z.infer; -export type IntervalSchedule = z.infer; -export type OnceSchedule = z.infer; +export type IntervalSchedule = z.input; +export type OnceSchedule = z.input; // NOTE [#4538]: the legacy `export type JobSchedule = Schedule` alias was // removed. It collided with the differently-shaped `JobSchedule` on // `@objectstack/spec/contracts` — the IJobService boundary type every runtime @@ -151,11 +151,9 @@ export const JobSchema = lazySchema(() => strictObject({ ...MetadataProtectionFields, })); -export type Job = z.infer; +export type Job = z.input; /** Post-parse shape of {@link Job} — defaults applied, transforms run (ADR-0122). */ export type JobParsed = z.infer; -/** Authoring input for {@link Job} — defaulted fields are optional. */ -export type JobInput = z.input; /** * Type-safe factory for declaring background jobs in metadata-as-code. @@ -169,7 +167,7 @@ export type JobInput = z.input; * }); * ``` */ -export function defineJob(config: z.input): Job { +export function defineJob(config: z.input): JobParsed { return JobSchema.parse(config); } @@ -184,7 +182,7 @@ export const JobExecutionStatus = z.enum([ 'timeout', ]); -export type JobExecutionStatus = z.infer; +export type JobExecutionStatus = z.input; /** * Job Execution Schema @@ -206,4 +204,4 @@ export const JobExecutionSchema = lazySchema(() => z.object({ durationMs: z.number().int().optional().describe('Execution duration in milliseconds'), })); -export type JobExecution = z.infer; +export type JobExecution = z.input; diff --git a/packages/spec/src/system/license.zod.ts b/packages/spec/src/system/license.zod.ts index ee788bc5b8..9942ba23c2 100644 --- a/packages/spec/src/system/license.zod.ts +++ b/packages/spec/src/system/license.zod.ts @@ -11,7 +11,7 @@ export const LicenseMetricType = z.enum([ 'counter', // Usage Count (e.g. API Calls, Records Created) - Accumulates 'gauge', // Current Level (e.g. Storage Used, Users Active) - Point in time ]).describe('License metric type'); -export type LicenseMetricType = z.infer; +export type LicenseMetricType = z.input; /** * Feature/Limit Definition Schema @@ -80,12 +80,10 @@ export const LicenseSchema = lazySchema(() => z.object({ signature: z.string().optional().describe('Cryptographic signature of the license'), })); -export type Feature = z.infer; +export type Feature = z.input; /** Post-parse shape of {@link Feature} — defaults applied, transforms run (ADR-0122). */ export type FeatureParsed = z.infer; -export type FeatureInput = z.input; -export type Plan = z.infer; +export type Plan = z.input; /** Post-parse shape of {@link Plan} — defaults applied, transforms run (ADR-0122). */ export type PlanParsed = z.infer; -export type PlanInput = z.input; -export type License = z.infer; +export type License = z.input; diff --git a/packages/spec/src/system/logging.zod.ts b/packages/spec/src/system/logging.zod.ts index 6f9ce91df7..0c0b949ebd 100644 --- a/packages/spec/src/system/logging.zod.ts +++ b/packages/spec/src/system/logging.zod.ts @@ -32,7 +32,7 @@ export const LogLevel = z.enum([ 'silent' ]).describe('Log severity level'); -export type LogLevel = z.infer; +export type LogLevel = z.input; /** * Log Format Enum @@ -43,7 +43,7 @@ export const LogFormat = z.enum([ 'pretty' // Colored human-readable output for CLI/console ]).describe('Log output format'); -export type LogFormat = z.infer; +export type LogFormat = z.input; /** * Logger Configuration Schema @@ -91,7 +91,7 @@ export const LoggerConfigSchema = lazySchema(() => z.object({ }).optional() })); -export type LoggerConfig = z.infer; +export type LoggerConfig = z.input; /** Post-parse shape of {@link LoggerConfig} — defaults applied, transforms run (ADR-0122). */ export type LoggerConfigParsed = z.infer; @@ -115,7 +115,7 @@ export const LogEntrySchema = lazySchema(() => z.object({ component: z.string().optional().describe('Component name (e.g. plugin id)'), })); -export type LogEntry = z.infer; +export type LogEntry = z.input; // ============================================================================ // Extended Logging Protocol (enterprise features) @@ -134,7 +134,7 @@ export const ExtendedLogLevel = z.enum([ 'fatal', // Fatal errors causing shutdown ]).describe('Extended log severity level'); -export type ExtendedLogLevel = z.infer; +export type ExtendedLogLevel = z.input; /** * Log Destination Type Enum @@ -157,7 +157,7 @@ export const LogDestinationType = z.enum([ 'custom', // Custom implementation ]).describe('Log destination type'); -export type LogDestinationType = z.infer; +export type LogDestinationType = z.input; /** * Console Destination Configuration @@ -179,7 +179,7 @@ export const ConsoleDestinationConfigSchema = lazySchema(() => z.object({ prettyPrint: z.boolean().optional().default(false), }).describe('Console destination configuration')); -export type ConsoleDestinationConfig = z.infer; +export type ConsoleDestinationConfig = z.input; /** Post-parse shape of {@link ConsoleDestinationConfig} — defaults applied, transforms run (ADR-0122). */ export type ConsoleDestinationConfigParsed = z.infer; @@ -228,7 +228,7 @@ export const FileDestinationConfigSchema = lazySchema(() => z.object({ append: z.boolean().optional().default(true), }).describe('File destination configuration')); -export type FileDestinationConfig = z.infer; +export type FileDestinationConfig = z.input; /** Post-parse shape of {@link FileDestinationConfig} — defaults applied, transforms run (ADR-0122). */ export type FileDestinationConfigParsed = z.infer; @@ -304,7 +304,7 @@ export const HttpDestinationConfigSchema = lazySchema(() => z.object({ timeout: z.number().int().positive().optional().default(30000), }).describe('HTTP destination configuration')); -export type HttpDestinationConfig = z.infer; +export type HttpDestinationConfig = z.input; /** Post-parse shape of {@link HttpDestinationConfig} — defaults applied, transforms run (ADR-0122). */ export type HttpDestinationConfigParsed = z.infer; @@ -346,7 +346,7 @@ export const ExternalServiceDestinationConfigSchema = lazySchema(() => z.object( config: z.record(z.string(), z.unknown()).optional(), }).describe('External service destination configuration')); -export type ExternalServiceDestinationConfig = z.infer; +export type ExternalServiceDestinationConfig = z.input; /** * Log Destination Schema @@ -406,7 +406,7 @@ export const LogDestinationSchema = lazySchema(() => z.object({ filterId: z.string().optional().describe('Filter function identifier'), }).describe('Log destination configuration')); -export type LogDestination = z.infer; +export type LogDestination = z.input; /** Post-parse shape of {@link LogDestination} — defaults applied, transforms run (ADR-0122). */ export type LogDestinationParsed = z.infer; @@ -460,7 +460,7 @@ export const LogEnrichmentConfigSchema = lazySchema(() => z.object({ addCorrelationIds: z.boolean().optional().default(true), }).describe('Log enrichment configuration')); -export type LogEnrichmentConfig = z.infer; +export type LogEnrichmentConfig = z.input; /** Post-parse shape of {@link LogEnrichmentConfig} — defaults applied, transforms run (ADR-0122). */ export type LogEnrichmentConfigParsed = z.infer; @@ -566,7 +566,7 @@ export const StructuredLogEntrySchema = lazySchema(() => z.object({ metadata: z.record(z.string(), z.unknown()).optional().describe('Additional metadata'), }).describe('Structured log entry')); -export type StructuredLogEntry = z.infer; +export type StructuredLogEntry = z.input; /** * Logging Configuration Schema @@ -693,6 +693,6 @@ export const LoggingConfigSchema = lazySchema(() => z.object({ }).optional(), }).describe('Logging configuration')); -export type LoggingConfig = z.infer; +export type LoggingConfig = z.input; /** Post-parse shape of {@link LoggingConfig} — defaults applied, transforms run (ADR-0122). */ export type LoggingConfigParsed = z.infer; diff --git a/packages/spec/src/system/message-queue.zod.ts b/packages/spec/src/system/message-queue.zod.ts index aa0345a8cb..22043ac6cc 100644 --- a/packages/spec/src/system/message-queue.zod.ts +++ b/packages/spec/src/system/message-queue.zod.ts @@ -16,7 +16,7 @@ export const MessageQueueProviderSchema = lazySchema(() => z.enum([ 'azure-service-bus', ]).describe('Supported message queue backend provider')); -export type MessageQueueProvider = z.infer; +export type MessageQueueProvider = z.input; export const TopicConfigSchema = lazySchema(() => z.object({ name: z.string().describe('Topic name identifier'), @@ -26,7 +26,7 @@ export const TopicConfigSchema = lazySchema(() => z.object({ compressionType: z.enum(['none', 'gzip', 'snappy', 'lz4']).default('none').describe('Message compression algorithm'), }).describe('Configuration for a message queue topic')); -export type TopicConfig = z.infer; +export type TopicConfig = z.input; /** Post-parse shape of {@link TopicConfig} — defaults applied, transforms run (ADR-0122). */ export type TopicConfigParsed = z.infer; @@ -37,7 +37,7 @@ export const ConsumerConfigSchema = lazySchema(() => z.object({ maxPollRecords: z.number().default(500).describe('Maximum records returned per poll'), }).describe('Consumer group configuration for topic consumption')); -export type ConsumerConfig = z.infer; +export type ConsumerConfig = z.input; /** Post-parse shape of {@link ConsumerConfig} — defaults applied, transforms run (ADR-0122). */ export type ConsumerConfigParsed = z.infer; @@ -47,7 +47,7 @@ export const DeadLetterQueueSchema = lazySchema(() => z.object({ queueName: z.string().describe('Name of the dead letter queue'), }).describe('Dead letter queue configuration for unprocessable messages')); -export type DeadLetterQueue = z.infer; +export type DeadLetterQueue = z.input; /** Post-parse shape of {@link DeadLetterQueue} — defaults applied, transforms run (ADR-0122). */ export type DeadLetterQueueParsed = z.infer; @@ -64,6 +64,6 @@ export const MessageQueueConfigSchema = lazySchema(() => z.object({ }).optional().describe('SASL authentication configuration'), }).describe('Top-level message queue configuration')); -export type MessageQueueConfig = z.infer; +export type MessageQueueConfig = z.input; /** Post-parse shape of {@link MessageQueueConfig} — defaults applied, transforms run (ADR-0122). */ export type MessageQueueConfigParsed = z.infer; diff --git a/packages/spec/src/system/metadata-persistence.zod.ts b/packages/spec/src/system/metadata-persistence.zod.ts index c80d6e1d98..239f9c44f6 100644 --- a/packages/spec/src/system/metadata-persistence.zod.ts +++ b/packages/spec/src/system/metadata-persistence.zod.ts @@ -140,10 +140,10 @@ export const MetadataRecordSchema = lazySchema(() => z.object({ updatedAt: z.string().datetime().optional().describe('Last update timestamp'), })); -export type MetadataRecord = z.infer; +export type MetadataRecord = z.input; /** Post-parse shape of {@link MetadataRecord} — defaults applied, transforms run (ADR-0122). */ export type MetadataRecordParsed = z.infer; -export type MetadataScope = z.infer; +export type MetadataScope = z.input; /** * Package Publish Result @@ -162,7 +162,7 @@ export const PackagePublishResultSchema = lazySchema(() => z.object({ })).optional().describe('Validation errors if publish failed'), })); -export type PackagePublishResult = z.infer; +export type PackagePublishResult = z.input; // ─── Loader / watch envelope types ─────────────────────────────────────────── // @@ -355,18 +355,20 @@ export { } from '../kernel/metadata-loader.zod'; export type { MetadataFormat } from '../shared/metadata-types.zod'; -export type MetadataStats = z.infer; +export type MetadataStats = z.input; export type MetadataLoaderContract = z.input; -export type MetadataLoadOptions = z.infer; -export type MetadataLoadResult = z.infer; -export type MetadataSaveOptions = z.infer; +/** Post-parse shape of {@link MetadataLoaderContract} — defaults applied, transforms run (ADR-0122). */ +export type MetadataLoaderContractParsed = z.infer; +export type MetadataLoadOptions = z.input; +export type MetadataLoadResult = z.input; +export type MetadataSaveOptions = z.input; /** Post-parse shape of {@link MetadataSaveOptions} — defaults applied, transforms run (ADR-0122). */ export type MetadataSaveOptionsParsed = z.infer; -export type MetadataSaveResult = z.infer; -export type MetadataWatchEvent = z.infer; -export type MetadataCollectionInfo = z.infer; +export type MetadataSaveResult = z.input; +export type MetadataWatchEvent = z.input; +export type MetadataCollectionInfo = z.input; export type { MetadataManagerConfig, MetadataFallbackStrategy } from '../kernel/metadata-loader.zod'; -export type MetadataSource = z.infer; +export type MetadataSource = z.input; /** * Metadata History Record @@ -449,7 +451,7 @@ export const MetadataHistoryRecordSchema = lazySchema(() => z.object({ recordedAt: z.string().datetime().describe('Timestamp when this version was recorded'), })); -export type MetadataHistoryRecord = z.infer; +export type MetadataHistoryRecord = z.input; /** * Metadata History Query Options @@ -475,7 +477,7 @@ export const MetadataHistoryQueryOptionsSchema = lazySchema(() => z.object({ includeMetadata: z.boolean().optional().default(true).describe('Include full metadata payload'), })); -export type MetadataHistoryQueryOptions = z.infer; +export type MetadataHistoryQueryOptions = z.input; /** Post-parse shape of {@link MetadataHistoryQueryOptions} — defaults applied, transforms run (ADR-0122). */ export type MetadataHistoryQueryOptionsParsed = z.infer; @@ -494,7 +496,7 @@ export const MetadataHistoryQueryResultSchema = lazySchema(() => z.object({ hasMore: z.boolean(), })); -export type MetadataHistoryQueryResult = z.infer; +export type MetadataHistoryQueryResult = z.input; /** * Metadata Diff Result @@ -529,7 +531,7 @@ export const MetadataDiffResultSchema = lazySchema(() => z.object({ summary: z.string().optional().describe('Human-readable summary of changes'), })); -export type MetadataDiffResult = z.infer; +export type MetadataDiffResult = z.input; /** * Metadata History Retention Policy @@ -549,6 +551,6 @@ export const MetadataHistoryRetentionPolicySchema = lazySchema(() => z.object({ cleanupIntervalHours: z.number().int().positive().default(24).describe('How often to run cleanup (in hours)'), })); -export type MetadataHistoryRetentionPolicy = z.infer; +export type MetadataHistoryRetentionPolicy = z.input; /** Post-parse shape of {@link MetadataHistoryRetentionPolicy} — defaults applied, transforms run (ADR-0122). */ export type MetadataHistoryRetentionPolicyParsed = z.infer; diff --git a/packages/spec/src/system/metrics.zod.ts b/packages/spec/src/system/metrics.zod.ts index a802deceaf..93c1c73c7d 100644 --- a/packages/spec/src/system/metrics.zod.ts +++ b/packages/spec/src/system/metrics.zod.ts @@ -26,7 +26,7 @@ export const MetricType = z.enum([ 'summary', // Observations with quantiles ]).describe('Metric type'); -export type MetricType = z.infer; +export type MetricType = z.input; /** * Metric Unit Enum @@ -66,7 +66,7 @@ export const MetricUnit = z.enum([ 'custom', ]).describe('Metric unit'); -export type MetricUnit = z.infer; +export type MetricUnit = z.input; /** * Metric Aggregation Type @@ -87,7 +87,7 @@ export const MetricAggregationType = z.enum([ 'stddev', // Standard deviation ]).describe('Metric aggregation type'); -export type MetricAggregationType = z.infer; +export type MetricAggregationType = z.input; /** * Histogram Bucket Configuration @@ -124,7 +124,7 @@ export const HistogramBucketConfigSchema = lazySchema(() => z.object({ }).optional(), }).describe('Histogram bucket configuration')); -export type HistogramBucketConfig = z.infer; +export type HistogramBucketConfig = z.input; /** * Metric Labels Schema @@ -132,7 +132,7 @@ export type HistogramBucketConfig = z.infer; */ export const MetricLabelsSchema = lazySchema(() => z.record(z.string(), z.string()).describe('Metric labels')); -export type MetricLabels = z.infer; +export type MetricLabels = z.input; /** * Metric Definition Schema @@ -201,7 +201,7 @@ export const MetricDefinitionSchema = lazySchema(() => z.object({ enabled: z.boolean().optional().default(true), }).describe('Metric definition')); -export type MetricDefinition = z.infer; +export type MetricDefinition = z.input; /** Post-parse shape of {@link MetricDefinition} — defaults applied, transforms run (ADR-0122). */ export type MetricDefinitionParsed = z.infer; @@ -260,7 +260,7 @@ export const MetricDataPointSchema = lazySchema(() => z.object({ }).optional(), }).describe('Metric data point')); -export type MetricDataPoint = z.infer; +export type MetricDataPoint = z.input; /** * Time Series Data Point Schema @@ -282,7 +282,7 @@ export const TimeSeriesDataPointSchema = lazySchema(() => z.object({ labels: z.record(z.string(), z.string()).optional().describe('Labels'), }).describe('Time series data point')); -export type TimeSeriesDataPoint = z.infer; +export type TimeSeriesDataPoint = z.input; /** * Time Series Schema @@ -314,7 +314,7 @@ export const TimeSeriesSchema = lazySchema(() => z.object({ endTime: z.string().datetime().optional().describe('End time'), }).describe('Time series')); -export type TimeSeries = z.infer; +export type TimeSeries = z.input; /** * Metric Aggregation Configuration @@ -356,7 +356,7 @@ export const MetricAggregationConfigSchema = lazySchema(() => z.object({ filters: z.record(z.string(), z.unknown()).optional().describe('Filter criteria'), }).describe('Metric aggregation configuration')); -export type MetricAggregationConfig = z.infer; +export type MetricAggregationConfig = z.input; /** Post-parse shape of {@link MetricAggregationConfig} — defaults applied, transforms run (ADR-0122). */ export type MetricAggregationConfigParsed = z.infer; @@ -431,7 +431,7 @@ export const ServiceLevelIndicatorSchema = lazySchema(() => z.object({ enabled: z.boolean().optional().default(true), }).describe('Service Level Indicator')); -export type ServiceLevelIndicator = z.infer; +export type ServiceLevelIndicator = z.input; /** Post-parse shape of {@link ServiceLevelIndicator} — defaults applied, transforms run (ADR-0122). */ export type ServiceLevelIndicatorParsed = z.infer; @@ -545,7 +545,7 @@ export const ServiceLevelObjectiveSchema = lazySchema(() => z.object({ enabled: z.boolean().optional().default(true), }).describe('Service Level Objective')); -export type ServiceLevelObjective = z.infer; +export type ServiceLevelObjective = z.input; /** Post-parse shape of {@link ServiceLevelObjective} — defaults applied, transforms run (ADR-0122). */ export type ServiceLevelObjectiveParsed = z.infer; @@ -605,7 +605,7 @@ export const MetricExportConfigSchema = lazySchema(() => z.object({ config: z.record(z.string(), z.unknown()).optional().describe('Additional configuration'), }).describe('Metric export configuration')); -export type MetricExportConfig = z.infer; +export type MetricExportConfig = z.input; /** Post-parse shape of {@link MetricExportConfig} — defaults applied, transforms run (ADR-0122). */ export type MetricExportConfigParsed = z.infer; @@ -707,6 +707,6 @@ export const MetricsConfigSchema = lazySchema(() => z.object({ }).optional(), }).describe('Metrics configuration')); -export type MetricsConfig = z.infer; +export type MetricsConfig = z.input; /** Post-parse shape of {@link MetricsConfig} — defaults applied, transforms run (ADR-0122). */ export type MetricsConfigParsed = z.infer; diff --git a/packages/spec/src/system/migration.zod.ts b/packages/spec/src/system/migration.zod.ts index 075f7b40b3..ec5720a0d9 100644 --- a/packages/spec/src/system/migration.zod.ts +++ b/packages/spec/src/system/migration.zod.ts @@ -100,10 +100,10 @@ export const ChangeSetSchema = lazySchema(() => z.object({ rollback: z.array(MigrationOperationSchema).optional().describe('Operations to reverse this migration') }).describe('A versioned set of atomic schema migration operations')); -export type ChangeSet = z.infer; +export type ChangeSet = z.input; /** Post-parse shape of {@link ChangeSet} — defaults applied, transforms run (ADR-0122). */ export type ChangeSetParsed = z.infer; -export type MigrationOperation = z.infer; +export type MigrationOperation = z.input; /** Post-parse shape of {@link MigrationOperation} — defaults applied, transforms run (ADR-0122). */ export type MigrationOperationParsed = z.infer; @@ -197,7 +197,7 @@ export const DataMigrationFlagSchema = lazySchema(() => z.object({ details: z.string().optional() .describe('JSON-encoded counts from the last run, for diagnostics'), }).describe('Deployment-level record that a data migration ran here and its self-check passed — the evidence gate consumers read instead of the platform version')); -export type DataMigrationFlag = z.infer; +export type DataMigrationFlag = z.input; /** * Does a flag row authorise its consumers? The ONE arbiter for both current @@ -279,7 +279,7 @@ export const MigrationJournalEventSchema = lazySchema(() => z.object({ .describe('JSON-encoded payload — the chunk plan on run_started, the error on run_failed / a failed compensation'), created_at: z.string().datetime().optional().describe('Wall-clock stamp, for humans. Never the ordering authority — that is seq'), }).describe('One event in a migration run journal — the durable trace that lets a killed run be resumed forward or compensated back, with rows proving which')); -export type MigrationJournalEvent = z.infer; +export type MigrationJournalEvent = z.input; /** * What a crashed run should do when it is rediscovered. diff --git a/packages/spec/src/system/notification.zod.ts b/packages/spec/src/system/notification.zod.ts index 04c98b6c32..0a16324a15 100644 --- a/packages/spec/src/system/notification.zod.ts +++ b/packages/spec/src/system/notification.zod.ts @@ -68,4 +68,4 @@ export const NotificationChannelSchema = lazySchema(() => z.enum([ // `@objectstack/spec/contracts` and consumed by `service-messaging`. // Type exports -export type NotificationChannel = z.infer; +export type NotificationChannel = z.input; diff --git a/packages/spec/src/system/object-storage.zod.ts b/packages/spec/src/system/object-storage.zod.ts index d87442ace5..0854886637 100644 --- a/packages/spec/src/system/object-storage.zod.ts +++ b/packages/spec/src/system/object-storage.zod.ts @@ -39,7 +39,7 @@ export const StorageScopeSchema = lazySchema(() => z.enum([ 'public' // Publicly accessible static assets ]).describe('Storage scope classification')); -export type StorageScope = z.infer; +export type StorageScope = z.input; /** * File Metadata Schema @@ -60,7 +60,7 @@ export const FileMetadataSchema = lazySchema(() => z.object({ fileId: z.string().optional().describe('Opaque sys_file id (ADR-0104 D3 file-as-reference)'), })); -export type FileMetadata = z.infer; +export type FileMetadata = z.input; // ============================================================================ // Enums @@ -83,7 +83,7 @@ export const StorageProviderSchema = lazySchema(() => z.enum([ 'local', // Local filesystem (development only) ]).describe('Storage provider type')); -export type StorageProvider = z.infer; +export type StorageProvider = z.input; /** * Storage Access Control List (ACL) @@ -99,7 +99,7 @@ export const StorageAclSchema = lazySchema(() => z.enum([ 'bucket_owner_full_control', // Both object and bucket owner have full control ]).describe('Storage access control level')); -export type StorageAcl = z.infer; +export type StorageAcl = z.input; /** * Storage Class / Tier @@ -115,7 +115,7 @@ export const StorageClassSchema = lazySchema(() => z.enum([ 'deep_archive', // Deep archive (cheapest, slowest retrieval) ]).describe('Storage class/tier for cost optimization')); -export type StorageClass = z.infer; +export type StorageClass = z.input; /** * Lifecycle Transition Action @@ -126,7 +126,7 @@ export const LifecycleActionSchema = lazySchema(() => z.enum([ 'abort', // Abort incomplete multipart uploads ]).describe('Lifecycle policy action type')); -export type LifecycleAction = z.infer; +export type LifecycleAction = z.input; // ============================================================================ // Configuration Schemas @@ -167,7 +167,7 @@ export const ObjectMetadataSchema = lazySchema(() => z.object({ custom: z.record(z.string(), z.string()).optional().describe('Custom user-defined metadata'), })); -export type ObjectMetadata = z.infer; +export type ObjectMetadata = z.input; /** * Presigned URL Configuration @@ -201,7 +201,7 @@ export const PresignedUrlConfigSchema = lazySchema(() => z.object({ responseContentDisposition: z.string().optional().describe('Override content-disposition for GET operations'), })); -export type PresignedUrlConfig = z.infer; +export type PresignedUrlConfig = z.input; /** * Multipart Upload Configuration @@ -228,7 +228,7 @@ export const MultipartUploadConfigSchema = lazySchema(() => z.object({ abortIncompleteAfterDays: z.number().min(1).optional().describe('Auto-abort incomplete uploads after N days'), })); -export type MultipartUploadConfig = z.infer; +export type MultipartUploadConfig = z.input; /** Post-parse shape of {@link MultipartUploadConfig} — defaults applied, transforms run (ADR-0122). */ export type MultipartUploadConfigParsed = z.infer; @@ -266,7 +266,7 @@ export const AccessControlConfigSchema = lazySchema(() => z.object({ blockedIps: z.array(z.string()).optional().describe('Blocked IP addresses/CIDR blocks'), })); -export type AccessControlConfig = z.infer; +export type AccessControlConfig = z.input; /** Post-parse shape of {@link AccessControlConfig} — defaults applied, transforms run (ADR-0122). */ export type AccessControlConfigParsed = z.infer; @@ -313,7 +313,7 @@ export const LifecyclePolicyRuleSchema = lazySchema(() => z.object({ message: 'targetStorageClass is required when action is "transition"', })); -export type LifecyclePolicyRule = z.infer; +export type LifecyclePolicyRule = z.input; /** Post-parse shape of {@link LifecyclePolicyRule} — defaults applied, transforms run (ADR-0122). */ export type LifecyclePolicyRuleParsed = z.infer; @@ -348,7 +348,7 @@ export const LifecyclePolicyConfigSchema = lazySchema(() => z.object({ rules: z.array(LifecyclePolicyRuleSchema).default([]).describe('Lifecycle rules'), })); -export type LifecyclePolicyConfig = z.infer; +export type LifecyclePolicyConfig = z.input; /** Post-parse shape of {@link LifecyclePolicyConfig} — defaults applied, transforms run (ADR-0122). */ export type LifecyclePolicyConfigParsed = z.infer; @@ -401,7 +401,7 @@ export const BucketConfigSchema = lazySchema(() => z.object({ enabled: z.boolean().default(true).describe('Enable this bucket'), })); -export type BucketConfig = z.infer; +export type BucketConfig = z.input; /** Post-parse shape of {@link BucketConfig} — defaults applied, transforms run (ADR-0122). */ export type BucketConfigParsed = z.infer; @@ -447,7 +447,7 @@ export const StorageConnectionSchema = lazySchema(() => z.object({ timeout: z.number().min(0).optional().describe('Connection timeout in milliseconds'), })); -export type StorageConnection = z.infer; +export type StorageConnection = z.input; /** Post-parse shape of {@link StorageConnection} — defaults applied, transforms run (ADR-0122). */ export type StorageConnectionParsed = z.infer; @@ -514,7 +514,7 @@ export const ObjectStorageConfigSchema = lazySchema(() => z.object({ description: z.string().optional().describe('Configuration description'), })); -export type ObjectStorageConfig = z.infer; +export type ObjectStorageConfig = z.input; /** Post-parse shape of {@link ObjectStorageConfig} — defaults applied, transforms run (ADR-0122). */ export type ObjectStorageConfigParsed = z.infer; diff --git a/packages/spec/src/system/registry-config.zod.ts b/packages/spec/src/system/registry-config.zod.ts index 4b77d7d83e..67dbf8a7f3 100644 --- a/packages/spec/src/system/registry-config.zod.ts +++ b/packages/spec/src/system/registry-config.zod.ts @@ -177,10 +177,10 @@ export const RegistryConfigSchema = lazySchema(() => z.object({ .describe('Mirror registries for redundancy'), })); -export type RegistrySyncPolicy = z.infer; -export type RegistryUpstream = z.infer; +export type RegistrySyncPolicy = z.input; +export type RegistryUpstream = z.input; /** Post-parse shape of {@link RegistryUpstream} — defaults applied, transforms run (ADR-0122). */ export type RegistryUpstreamParsed = z.infer; -export type RegistryConfig = z.infer; +export type RegistryConfig = z.input; /** Post-parse shape of {@link RegistryConfig} — defaults applied, transforms run (ADR-0122). */ export type RegistryConfigParsed = z.infer; diff --git a/packages/spec/src/system/search-engine.zod.ts b/packages/spec/src/system/search-engine.zod.ts index e0bb5441f9..014a42da48 100644 --- a/packages/spec/src/system/search-engine.zod.ts +++ b/packages/spec/src/system/search-engine.zod.ts @@ -15,7 +15,7 @@ export const SearchProviderSchema = lazySchema(() => z.enum([ 'opensearch', ]).describe('Supported full-text search engine provider')); -export type SearchProvider = z.infer; +export type SearchProvider = z.input; export const AnalyzerConfigSchema = lazySchema(() => z.object({ type: z.enum(['standard', 'simple', 'whitespace', 'keyword', 'pattern', 'language']).describe('Text analyzer type'), @@ -24,7 +24,7 @@ export const AnalyzerConfigSchema = lazySchema(() => z.object({ customFilters: z.array(z.string()).optional().describe('Additional token filter names to apply'), }).describe('Text analyzer configuration for index tokenization and normalization')); -export type AnalyzerConfig = z.infer; +export type AnalyzerConfig = z.input; export const SearchIndexConfigSchema = lazySchema(() => z.object({ indexName: z.string().describe('Name of the search index'), @@ -42,7 +42,7 @@ export const SearchIndexConfigSchema = lazySchema(() => z.object({ shards: z.number().default(1).describe('Number of index shards for distribution'), }).describe('Search index definition mapping an ObjectQL object to a search engine index')); -export type SearchIndexConfig = z.infer; +export type SearchIndexConfig = z.input; /** Post-parse shape of {@link SearchIndexConfig} — defaults applied, transforms run (ADR-0122). */ export type SearchIndexConfigParsed = z.infer; @@ -52,7 +52,7 @@ export const FacetConfigSchema = lazySchema(() => z.object({ sort: z.enum(['count', 'alpha']).default('count').describe('Facet value sort order'), }).describe('Faceted search configuration for a single field')); -export type FacetConfig = z.infer; +export type FacetConfig = z.input; /** Post-parse shape of {@link FacetConfig} — defaults applied, transforms run (ADR-0122). */ export type FacetConfigParsed = z.infer; @@ -66,6 +66,6 @@ export const SearchConfigSchema = lazySchema(() => z.object({ ranking: z.array(z.enum(['typo', 'geo', 'words', 'filters', 'proximity', 'attribute', 'exact', 'custom'])).optional().describe('Custom ranking rule order'), }).describe('Top-level full-text search engine configuration')); -export type SearchConfig = z.infer; +export type SearchConfig = z.input; /** Post-parse shape of {@link SearchConfig} — defaults applied, transforms run (ADR-0122). */ export type SearchConfigParsed = z.infer; diff --git a/packages/spec/src/system/security-context.test.ts b/packages/spec/src/system/security-context.test.ts index 39b3b0e969..799bb3878b 100644 --- a/packages/spec/src/system/security-context.test.ts +++ b/packages/spec/src/system/security-context.test.ts @@ -12,7 +12,6 @@ import { type SecurityEventCorrelation, type DataClassificationPolicy, type SecurityContextConfig, - type SecurityContextConfigInput, } from './security-context.zod'; describe('ComplianceAuditRequirementSchema', () => { @@ -186,7 +185,7 @@ describe('SecurityContextConfigSchema', () => { }); it('should accept full security context configuration', () => { - const config: SecurityContextConfigInput = { + const config: SecurityContextConfig = { enabled: true, complianceAuditRequirements: [ { framework: 'gdpr', requiredEvents: ['data.delete', 'data.export'], retentionDays: 180 }, @@ -251,7 +250,7 @@ describe('Type exports', () => { const context: SecurityContextConfig = { enabled: true, enforceOnWrite: true, enforceOnRead: true, failOpen: false, }; - const contextInput: SecurityContextConfigInput = { enabled: true }; + const contextInput: SecurityContextConfig = { enabled: true }; expect(audit).toBeDefined(); expect(encryption).toBeDefined(); expect(masking).toBeDefined(); diff --git a/packages/spec/src/system/security-context.zod.ts b/packages/spec/src/system/security-context.zod.ts index 1b33dddcff..e7f55dcf00 100644 --- a/packages/spec/src/system/security-context.zod.ts +++ b/packages/spec/src/system/security-context.zod.ts @@ -37,7 +37,7 @@ export const DataClassificationSchema = lazySchema(() => z.enum([ 'pii', 'phi', 'pci', 'financial', 'confidential', 'internal', 'public', ]).describe('Data classification level')); -export type DataClassification = z.infer; +export type DataClassification = z.input; /** * Shared compliance framework enum used across compliance and security schemas. @@ -47,7 +47,7 @@ export const ComplianceFrameworkSchema = lazySchema(() => z.enum([ 'gdpr', 'hipaa', 'sox', 'pci_dss', 'ccpa', 'iso27001', ]).describe('Compliance framework identifier')); -export type ComplianceFramework = z.infer; +export type ComplianceFramework = z.input; /** * Compliance-driven audit requirement. @@ -64,7 +64,7 @@ export const ComplianceAuditRequirementSchema = lazySchema(() => z.object({ .describe('Raise alert if a required audit event is not being captured'), }).describe('Compliance framework audit event requirements')); -export type ComplianceAuditRequirement = z.infer; +export type ComplianceAuditRequirement = z.input; /** Post-parse shape of {@link ComplianceAuditRequirement} — defaults applied, transforms run (ADR-0122). */ export type ComplianceAuditRequirementParsed = z.infer; @@ -83,7 +83,7 @@ export const ComplianceEncryptionRequirementSchema = lazySchema(() => z.object({ .describe('Maximum key rotation interval required (in days)'), }).describe('Compliance framework encryption requirements')); -export type ComplianceEncryptionRequirement = z.infer; +export type ComplianceEncryptionRequirement = z.input; /** Post-parse shape of {@link ComplianceEncryptionRequirement} — defaults applied, transforms run (ADR-0122). */ export type ComplianceEncryptionRequirementParsed = z.infer; @@ -106,7 +106,7 @@ export const MaskingVisibilityRuleSchema = lazySchema(() => z.object({ .describe('Roles that can approve unmasking requests'), }).describe('Masking visibility and audit rule per data classification')); -export type MaskingVisibilityRule = z.infer; +export type MaskingVisibilityRule = z.input; /** Post-parse shape of {@link MaskingVisibilityRule} — defaults applied, transforms run (ADR-0122). */ export type MaskingVisibilityRuleParsed = z.infer; @@ -127,7 +127,7 @@ export const SecurityEventCorrelationSchema = lazySchema(() => z.object({ .describe('Log masking/unmasking operations in the audit trail'), }).describe('Cross-subsystem security event correlation configuration')); -export type SecurityEventCorrelation = z.infer; +export type SecurityEventCorrelation = z.input; /** Post-parse shape of {@link SecurityEventCorrelation} — defaults applied, transforms run (ADR-0122). */ export type SecurityEventCorrelationParsed = z.infer; @@ -148,7 +148,7 @@ export const DataClassificationPolicySchema = lazySchema(() => z.object({ .describe('Data retention limit in days (for compliance)'), }).describe('Security policy for a specific data classification level')); -export type DataClassificationPolicy = z.infer; +export type DataClassificationPolicy = z.input; /** Post-parse shape of {@link DataClassificationPolicy} — defaults applied, transforms run (ADR-0122). */ export type DataClassificationPolicyParsed = z.infer; @@ -187,7 +187,6 @@ export const SecurityContextConfigSchema = lazySchema(() => z.object({ .describe('When false (default), deny access if security context cannot be evaluated'), }).describe('Unified security context governance configuration')); -export type SecurityContextConfig = z.infer; +export type SecurityContextConfig = z.input; /** Post-parse shape of {@link SecurityContextConfig} — defaults applied, transforms run (ADR-0122). */ export type SecurityContextConfigParsed = z.infer; -export type SecurityContextConfigInput = z.input; diff --git a/packages/spec/src/system/settings-client.zod.ts b/packages/spec/src/system/settings-client.zod.ts index 9f73295a84..9a7ef5af3b 100644 --- a/packages/spec/src/system/settings-client.zod.ts +++ b/packages/spec/src/system/settings-client.zod.ts @@ -71,7 +71,7 @@ export const SettingsChangeEventSchema = lazySchema(() => z.object({ /** Wall-clock timestamp (ISO 8601) when the mutation completed. */ at: z.string().describe('ISO 8601 mutation timestamp'), })); -export type SettingsChangeEvent = z.infer; +export type SettingsChangeEvent = z.input; /** * Bus identifier on which `SettingsChangeEvent`s are published. diff --git a/packages/spec/src/system/settings-manifest.zod.ts b/packages/spec/src/system/settings-manifest.zod.ts index 003c0970a6..e012e6aa30 100644 --- a/packages/spec/src/system/settings-manifest.zod.ts +++ b/packages/spec/src/system/settings-manifest.zod.ts @@ -57,7 +57,7 @@ export const SpecifierType = z.enum([ // Actions 'action_button', // calls handler (test connection / rotate / etc.) ]); -export type SpecifierType = z.infer; +export type SpecifierType = z.input; const SPECIFIERS_REQUIRING_KEY: ReadonlySet = new Set([ 'text', 'textarea', 'password', 'email', 'url', 'phone', @@ -75,7 +75,7 @@ export const SpecifierOptionSchema = lazySchema(() => z.object({ description: z.string().optional().describe('Optional helper text'), icon: z.string().optional().describe('Optional Lucide icon name'), })); -export type SpecifierOption = z.infer; +export type SpecifierOption = z.input; /** * Action handler descriptor for `action_button` specifiers. @@ -107,7 +107,7 @@ export const SpecifierHandlerSchema = lazySchema(() => z.discriminatedUnion('kin target: z.enum(['_self', '_blank']).default('_self'), }), ])); -export type SpecifierHandler = z.infer; +export type SpecifierHandler = z.input; /** Post-parse shape of {@link SpecifierHandler} — defaults applied, transforms run (ADR-0122). */ export type SpecifierHandlerParsed = z.infer; @@ -132,7 +132,7 @@ export type SpecifierHandlerParsed = z.infer; * to ctx.user_id. */ export const SpecifierScopeSchema = z.enum(['global', 'tenant', 'user']); -export type SpecifierScope = z.infer; +export type SpecifierScope = z.input; // --------------------------------------------------------------------------- // Specifier schema (the unit of UI in a manifest) @@ -329,7 +329,7 @@ export const SpecifierSchema = lazySchema(() => z.object({ }); } })); -export type Specifier = z.infer; +export type Specifier = z.input; /** Post-parse shape of {@link Specifier} — defaults applied, transforms run (ADR-0122). */ export type SpecifierParsed = z.infer; @@ -445,7 +445,7 @@ export const SettingsManifestSchema = lazySchema(() => z.object({ } }); })); -export type SettingsManifest = z.infer; +export type SettingsManifest = z.input; /** Post-parse shape of {@link SettingsManifest} — defaults applied, transforms run (ADR-0122). */ export type SettingsManifestParsed = z.infer; @@ -513,7 +513,7 @@ export const SettingsNamespacePayloadSchema = lazySchema(() => z.object({ manifest: SettingsManifestSchema, values: z.record(z.string(), ResolvedSettingValueSchema).describe('Effective values keyed by specifier.key'), })); -export type SettingsNamespacePayload = z.infer; +export type SettingsNamespacePayload = z.input; /** Post-parse shape of {@link SettingsNamespacePayload} — defaults applied, transforms run (ADR-0122). */ export type SettingsNamespacePayloadParsed = z.infer; @@ -527,4 +527,4 @@ export const SettingsActionResultSchema = lazySchema(() => z.object({ severity: z.enum(['info', 'success', 'warning', 'error']).optional(), details: z.unknown().optional().describe('Optional structured detail (renderer-defined)'), })); -export type SettingsActionResult = z.infer; +export type SettingsActionResult = z.input; diff --git a/packages/spec/src/system/stack-server.zod.ts b/packages/spec/src/system/stack-server.zod.ts index 21a2c59df1..e5c3459511 100644 --- a/packages/spec/src/system/stack-server.zod.ts +++ b/packages/spec/src/system/stack-server.zod.ts @@ -131,7 +131,7 @@ export const ServerRateLimitConfigSchema = lazySchema(() => strictObject( } })); -export type ServerRateLimitConfig = z.infer; +export type ServerRateLimitConfig = z.input; /** Post-parse shape of {@link ServerRateLimitConfig} — defaults applied, transforms run (ADR-0122). */ export type ServerRateLimitConfigParsed = z.infer; @@ -169,7 +169,7 @@ export const StackServerSecuritySchema = lazySchema(() => strictObject( }, )); -export type StackServerSecurity = z.infer; +export type StackServerSecurity = z.input; /** Post-parse shape of {@link StackServerSecurity} — defaults applied, transforms run (ADR-0122). */ export type StackServerSecurityParsed = z.infer; @@ -232,7 +232,6 @@ export const StackServerConfigSchema = lazySchema(() => strictObject( }, )); -export type StackServerConfig = z.infer; +export type StackServerConfig = z.input; /** Post-parse shape of {@link StackServerConfig} — defaults applied, transforms run (ADR-0122). */ export type StackServerConfigParsed = z.infer; -export type StackServerConfigInput = z.input; diff --git a/packages/spec/src/system/supplier-security.zod.ts b/packages/spec/src/system/supplier-security.zod.ts index de9b7661bf..170aa1c0df 100644 --- a/packages/spec/src/system/supplier-security.zod.ts +++ b/packages/spec/src/system/supplier-security.zod.ts @@ -81,7 +81,7 @@ export const SupplierSecurityRequirementSchema = lazySchema(() => z.object({ .describe('Compliance evidence or assessment notes'), }).describe('Individual supplier security requirement')); -export type SupplierSecurityRequirement = z.infer; +export type SupplierSecurityRequirement = z.input; /** Post-parse shape of {@link SupplierSecurityRequirement} — defaults applied, transforms run (ADR-0122). */ export type SupplierSecurityRequirementParsed = z.infer; @@ -241,11 +241,11 @@ export const SupplierSecurityPolicySchema = lazySchema(() => z.object({ }).describe('Organization-level supplier security management policy per ISO 27001:2022')); // Type exports -export type SupplierRiskLevel = z.infer; -export type SupplierAssessmentStatus = z.infer; -export type SupplierSecurityAssessment = z.infer; +export type SupplierRiskLevel = z.input; +export type SupplierAssessmentStatus = z.input; +export type SupplierSecurityAssessment = z.input; /** Post-parse shape of {@link SupplierSecurityAssessment} — defaults applied, transforms run (ADR-0122). */ export type SupplierSecurityAssessmentParsed = z.infer; -export type SupplierSecurityPolicy = z.infer; +export type SupplierSecurityPolicy = z.input; /** Post-parse shape of {@link SupplierSecurityPolicy} — defaults applied, transforms run (ADR-0122). */ export type SupplierSecurityPolicyParsed = z.infer; diff --git a/packages/spec/src/system/tenant.zod.ts b/packages/spec/src/system/tenant.zod.ts index a8d6ba895d..bad70792d7 100644 --- a/packages/spec/src/system/tenant.zod.ts +++ b/packages/spec/src/system/tenant.zod.ts @@ -26,7 +26,7 @@ export const TenantIsolationLevel = z.enum([ 'isolated_db', // Separate database per tenant (maximum isolation) ]); -export type TenantIsolationLevel = z.infer; +export type TenantIsolationLevel = z.input; /** * Database Provider Enum @@ -38,7 +38,7 @@ export const DatabaseProviderSchema = lazySchema(() => z.enum([ 'memory', // In-memory (testing/development only) ]).describe('Database provider for tenant data')); -export type DatabaseProvider = z.infer; +export type DatabaseProvider = z.input; /** * Tenant Connection Config Schema @@ -53,7 +53,7 @@ export const TenantConnectionConfigSchema = lazySchema(() => z.object({ group: z.string().optional().describe('Turso database group name'), }).describe('Tenant database connection configuration')); -export type TenantConnectionConfig = z.infer; +export type TenantConnectionConfig = z.input; /** * Tenant Quota Schema @@ -96,7 +96,7 @@ export const TenantQuotaSchema = lazySchema(() => z.object({ maxStorageBytes: z.number().int().positive().optional().describe('Maximum storage in bytes'), })); -export type TenantQuota = z.infer; +export type TenantQuota = z.input; /** * Tenant Usage Schema @@ -119,7 +119,7 @@ export const TenantUsageSchema = lazySchema(() => z.object({ lastUpdatedAt: z.string().datetime().optional().describe('Last usage update time'), }).describe('Current tenant resource usage')); -export type TenantUsage = z.infer; +export type TenantUsage = z.input; /** Post-parse shape of {@link TenantUsage} — defaults applied, transforms run (ADR-0122). */ export type TenantUsageParsed = z.infer; @@ -140,7 +140,7 @@ export const QuotaEnforcementResultSchema = lazySchema(() => z.object({ message: z.string().optional().describe('Human-readable quota message'), }).describe('Quota enforcement check result')); -export type QuotaEnforcementResult = z.infer; +export type QuotaEnforcementResult = z.input; /** * Tenant Schema @@ -223,7 +223,7 @@ export const TenantSchema = lazySchema(() => z.object({ quotas: TenantQuotaSchema.optional(), })); -export type Tenant = z.infer; +export type Tenant = z.input; /** * Tenant Isolation Strategy Documentation @@ -327,10 +327,9 @@ export const RowLevelIsolationStrategySchema = lazySchema(() => z.object({ }).optional().describe('Performance settings'), })); -export type RowLevelIsolationStrategy = z.infer; +export type RowLevelIsolationStrategy = z.input; /** Post-parse shape of {@link RowLevelIsolationStrategy} — defaults applied, transforms run (ADR-0122). */ export type RowLevelIsolationStrategyParsed = z.infer; -export type RowLevelIsolationStrategyInput = z.input; /** * Schema-Level Isolation Strategy (isolated_schema) @@ -447,10 +446,9 @@ export const SchemaLevelIsolationStrategySchema = lazySchema(() => z.object({ }).optional().describe('Performance settings'), })); -export type SchemaLevelIsolationStrategy = z.infer; +export type SchemaLevelIsolationStrategy = z.input; /** Post-parse shape of {@link SchemaLevelIsolationStrategy} — defaults applied, transforms run (ADR-0122). */ export type SchemaLevelIsolationStrategyParsed = z.infer; -export type SchemaLevelIsolationStrategyInput = z.input; /** * Database-Level Isolation Strategy (isolated_db) @@ -604,10 +602,9 @@ export const DatabaseLevelIsolationStrategySchema = lazySchema(() => z.object({ }).optional().describe('Encryption configuration'), })); -export type DatabaseLevelIsolationStrategy = z.infer; +export type DatabaseLevelIsolationStrategy = z.input; /** Post-parse shape of {@link DatabaseLevelIsolationStrategy} — defaults applied, transforms run (ADR-0122). */ export type DatabaseLevelIsolationStrategyParsed = z.infer; -export type DatabaseLevelIsolationStrategyInput = z.input; /** * Tenant Isolation Configuration Schema @@ -621,7 +618,7 @@ export const TenantIsolationConfigSchema = lazySchema(() => z.discriminatedUnion DatabaseLevelIsolationStrategySchema, ])); -export type TenantIsolationConfig = z.infer; +export type TenantIsolationConfig = z.input; /** Post-parse shape of {@link TenantIsolationConfig} — defaults applied, transforms run (ADR-0122). */ export type TenantIsolationConfigParsed = z.infer; @@ -718,7 +715,6 @@ export const TenantSecurityPolicySchema = lazySchema(() => z.object({ }).optional().describe('Compliance requirements'), })); -export type TenantSecurityPolicy = z.infer; +export type TenantSecurityPolicy = z.input; /** Post-parse shape of {@link TenantSecurityPolicy} — defaults applied, transforms run (ADR-0122). */ export type TenantSecurityPolicyParsed = z.infer; -export type TenantSecurityPolicyInput = z.input; diff --git a/packages/spec/src/system/tracing.zod.ts b/packages/spec/src/system/tracing.zod.ts index d0a16335fa..1104dff411 100644 --- a/packages/spec/src/system/tracing.zod.ts +++ b/packages/spec/src/system/tracing.zod.ts @@ -26,7 +26,7 @@ export const TraceStateSchema = lazySchema(() => z.object({ entries: z.record(z.string(), z.string()).describe('Trace state entries'), }).describe('Trace state')); -export type TraceState = z.infer; +export type TraceState = z.input; /** * Trace Flags Enum @@ -34,7 +34,7 @@ export type TraceState = z.infer; */ export const TraceFlagsSchema = lazySchema(() => z.number().int().min(0).max(255).describe('Trace flags bitmap')); -export type TraceFlags = z.infer; +export type TraceFlags = z.input; /** * Trace Context Schema @@ -84,7 +84,7 @@ export const TraceContextSchema = lazySchema(() => z.object({ remote: z.boolean().optional().default(false), }).describe('Trace context (W3C Trace Context)')); -export type TraceContext = z.infer; +export type TraceContext = z.input; /** Post-parse shape of {@link TraceContext} — defaults applied, transforms run (ADR-0122). */ export type TraceContextParsed = z.infer; @@ -100,7 +100,7 @@ export const SpanKind = z.enum([ 'consumer', // Message consumer ]).describe('Span kind'); -export type SpanKind = z.infer; +export type SpanKind = z.input; /** * Span Status Enum @@ -112,7 +112,7 @@ export const SpanStatus = z.enum([ 'error', // Error occurred ]).describe('Span status'); -export type SpanStatus = z.infer; +export type SpanStatus = z.input; /** * Span Attribute Value Schema @@ -126,7 +126,7 @@ export const SpanAttributeValueSchema = lazySchema(() => z.union([ z.array(z.boolean()), ]).describe('Span attribute value')); -export type SpanAttributeValue = z.infer; +export type SpanAttributeValue = z.input; /** * Span Attributes Schema @@ -134,7 +134,7 @@ export type SpanAttributeValue = z.infer; */ export const SpanAttributesSchema = lazySchema(() => z.record(z.string(), SpanAttributeValueSchema).describe('Span attributes')); -export type SpanAttributes = z.infer; +export type SpanAttributes = z.input; /** * Span Event Schema @@ -156,7 +156,7 @@ export const SpanEventSchema = lazySchema(() => z.object({ attributes: SpanAttributesSchema.optional().describe('Event attributes'), }).describe('Span event')); -export type SpanEvent = z.infer; +export type SpanEvent = z.input; /** * Span Link Schema @@ -174,7 +174,7 @@ export const SpanLinkSchema = lazySchema(() => z.object({ attributes: SpanAttributesSchema.optional().describe('Link attributes'), }).describe('Span link')); -export type SpanLink = z.infer; +export type SpanLink = z.input; /** Post-parse shape of {@link SpanLink} — defaults applied, transforms run (ADR-0122). */ export type SpanLinkParsed = z.infer; @@ -250,7 +250,7 @@ export const SpanSchema = lazySchema(() => z.object({ }).optional(), }).describe('OpenTelemetry span')); -export type Span = z.infer; +export type Span = z.input; /** Post-parse shape of {@link Span} — defaults applied, transforms run (ADR-0122). */ export type SpanParsed = z.infer; @@ -263,7 +263,7 @@ export const SamplingDecision = z.enum([ 'record_and_sample', // Record and export ]).describe('Sampling decision'); -export type SamplingDecision = z.infer; +export type SamplingDecision = z.input; /** * Sampling Strategy Type Enum @@ -279,7 +279,7 @@ export const SamplingStrategyType = z.enum([ 'custom', // Custom sampling logic ]).describe('Sampling strategy type'); -export type SamplingStrategyType = z.infer; +export type SamplingStrategyType = z.input; /** * Trace Sampling Configuration Schema @@ -383,7 +383,7 @@ export const TraceSamplingConfigSchema = lazySchema(() => z.object({ customSamplerId: z.string().optional().describe('Custom sampler identifier'), }).describe('Trace sampling configuration')); -export type TraceSamplingConfig = z.infer; +export type TraceSamplingConfig = z.input; /** Post-parse shape of {@link TraceSamplingConfig} — defaults applied, transforms run (ADR-0122). */ export type TraceSamplingConfigParsed = z.infer; @@ -400,7 +400,7 @@ export const TracePropagationFormat = z.enum([ 'custom', // Custom format ]).describe('Trace propagation format'); -export type TracePropagationFormat = z.infer; +export type TracePropagationFormat = z.input; /** * Trace Context Propagation Schema @@ -467,7 +467,7 @@ export const TraceContextPropagationSchema = lazySchema(() => z.object({ }).optional(), }).describe('Trace context propagation')); -export type TraceContextPropagation = z.infer; +export type TraceContextPropagation = z.input; /** Post-parse shape of {@link TraceContextPropagation} — defaults applied, transforms run (ADR-0122). */ export type TraceContextPropagationParsed = z.infer; @@ -487,7 +487,7 @@ export const OtelExporterType = z.enum([ 'custom', // Custom exporter ]).describe('OpenTelemetry exporter type'); -export type OtelExporterType = z.infer; +export type OtelExporterType = z.input; /** * OpenTelemetry Compatibility Schema @@ -619,7 +619,7 @@ export const OpenTelemetryCompatibilitySchema = lazySchema(() => z.object({ semanticConventionsVersion: z.string().optional().describe('Semantic conventions version'), }).describe('OpenTelemetry compatibility configuration')); -export type OpenTelemetryCompatibility = z.infer; +export type OpenTelemetryCompatibility = z.input; /** Post-parse shape of {@link OpenTelemetryCompatibility} — defaults applied, transforms run (ADR-0122). */ export type OpenTelemetryCompatibilityParsed = z.infer; @@ -711,6 +711,6 @@ export const TracingConfigSchema = lazySchema(() => z.object({ }).optional(), }).describe('Tracing configuration')); -export type TracingConfig = z.infer; +export type TracingConfig = z.input; /** Post-parse shape of {@link TracingConfig} — defaults applied, transforms run (ADR-0122). */ export type TracingConfigParsed = z.infer; diff --git a/packages/spec/src/system/training.zod.ts b/packages/spec/src/system/training.zod.ts index 68b5260c43..6831a2ddb4 100644 --- a/packages/spec/src/system/training.zod.ts +++ b/packages/spec/src/system/training.zod.ts @@ -210,12 +210,12 @@ export const TrainingPlanSchema = lazySchema(() => z.object({ }).describe('Organizational training plan per ISO 27001:2022 A.6.3')); // Type exports -export type TrainingCategory = z.infer; -export type TrainingCompletionStatus = z.infer; -export type TrainingCourse = z.infer; +export type TrainingCategory = z.input; +export type TrainingCompletionStatus = z.input; +export type TrainingCourse = z.input; /** Post-parse shape of {@link TrainingCourse} — defaults applied, transforms run (ADR-0122). */ export type TrainingCourseParsed = z.infer; -export type TrainingRecord = z.infer; -export type TrainingPlan = z.infer; +export type TrainingRecord = z.input; +export type TrainingPlan = z.input; /** Post-parse shape of {@link TrainingPlan} — defaults applied, transforms run (ADR-0122). */ export type TrainingPlanParsed = z.infer; diff --git a/packages/spec/src/system/translation.zod.ts b/packages/spec/src/system/translation.zod.ts index 27f3416b57..8d3e0246e7 100644 --- a/packages/spec/src/system/translation.zod.ts +++ b/packages/spec/src/system/translation.zod.ts @@ -45,7 +45,7 @@ export const FieldTranslationSchema = lazySchema(() => strictObject({ options: z.record(z.string(), z.string()).optional().describe('Option value to translated label map'), }).describe('Translation data for a single field')); -export type FieldTranslation = z.infer; +export type FieldTranslation = z.input; /** * Action Result-Dialog Translation Schema @@ -76,7 +76,7 @@ export const ActionResultDialogTranslationSchema = lazySchema(() => strictObject .describe('Result field labels keyed by the literal field path declared in the action metadata (keys may contain dots)'), }).describe('Translations for an action result dialog')); -export type ActionResultDialogTranslation = z.infer; +export type ActionResultDialogTranslation = z.input; /** * Action translations — one shape, used at two addresses: an object's @@ -223,7 +223,7 @@ export const ObjectTranslationDataSchema = lazySchema(() => strictObject({ })).optional().describe('Section translations keyed by section name'), }).describe('Translation data for a single object')); -export type ObjectTranslationData = z.infer; +export type ObjectTranslationData = z.input; // ──────────────────────────────────────────────────────────────────────────── // The retired object-first dialect @@ -617,7 +617,7 @@ export const TranslationDataSchema = lazySchema(() => strictObject({ extraKeys: ['locale'], }, translationDataShape()).describe('Translation data for objects, apps, and UI messages')); -export type TranslationData = z.infer; +export type TranslationData = z.input; // ──────────────────────────────────────────────────────────────────────────── // Translation Bundle (all locales) @@ -625,9 +625,7 @@ export type TranslationData = z.infer; export const TranslationBundleSchema = lazySchema(() => z.record(LocaleSchema, TranslationDataSchema).describe('Map of locale codes to translation data')); -export type TranslationBundle = z.infer; -/** Authoring input for {@link TranslationBundle} — defaulted fields are optional. */ -export type TranslationBundleInput = z.input; +export type TranslationBundle = z.input; /** * Type-safe factory for an i18n translation bundle (locale code → translations map). Validates at authoring time via @@ -690,7 +688,7 @@ export const TranslationConfigSchema = lazySchema(() => strictObject({ fallbackLocale: LocaleSchema.optional().describe('Fallback locale code'), }).describe('Internationalization configuration')); -export type TranslationConfig = z.infer; +export type TranslationConfig = z.input; // ──────────────────────────────────────────────────────────────────────────── // Translation Item (the runtime-authored `translation` metadata type) @@ -769,7 +767,7 @@ export const TranslationItemSchema = lazySchema(() => strictObject({ }).describe('One locale of translations — the `translation` metadata type')); /** A single `translation` metadata item. */ -export type TranslationItem = z.infer; +export type TranslationItem = z.input; /** * Type-safe factory for a single-locale `translation` item. Validates at @@ -795,7 +793,7 @@ export const TranslationDiffStatusSchema = lazySchema(() => z.enum([ 'stale', ]).describe('Translation diff status: missing from bundle, redundant (no matching metadata), or stale (metadata changed)')); -export type TranslationDiffStatus = z.infer; +export type TranslationDiffStatus = z.input; /** * TranslationDiffItemSchema @@ -836,7 +834,7 @@ export const TranslationDiffItemSchema = lazySchema(() => z.object({ aiConfidence: z.number().min(0).max(1).optional().describe('AI suggestion confidence score (0–1)'), }).describe('A single translation diff item')); -export type TranslationDiffItem = z.infer; +export type TranslationDiffItem = z.input; /** * TranslationCoverageResultSchema @@ -872,7 +870,7 @@ export const CoverageBreakdownEntrySchema = lazySchema(() => z.object({ coveragePercent: z.number().min(0).max(100).describe('Coverage percentage for this group'), }).describe('Coverage breakdown for a single translation group')); -export type CoverageBreakdownEntry = z.infer; +export type CoverageBreakdownEntry = z.input; export const TranslationCoverageResultSchema = lazySchema(() => z.object({ /** BCP-47 locale code */ @@ -902,4 +900,4 @@ export const TranslationCoverageResultSchema = lazySchema(() => z.object({ .describe('Per-group coverage breakdown'), }).describe('Aggregated translation coverage result')); -export type TranslationCoverageResult = z.infer; +export type TranslationCoverageResult = z.input; diff --git a/packages/spec/src/system/worker.zod.ts b/packages/spec/src/system/worker.zod.ts index 51948ab396..ab9fe743b3 100644 --- a/packages/spec/src/system/worker.zod.ts +++ b/packages/spec/src/system/worker.zod.ts @@ -48,7 +48,7 @@ export const TaskPriority = z.enum([ 'background', // 4 - Execute during low-traffic periods ]); -export type TaskPriority = z.infer; +export type TaskPriority = z.input; /** * Task Priority Mapping @@ -81,7 +81,7 @@ export const TaskStatus = z.enum([ 'dead', // Moved to dead letter queue ]); -export type TaskStatus = z.infer; +export type TaskStatus = z.input; // ========================================== // Task Schema @@ -100,10 +100,9 @@ export const TaskRetryPolicySchema = lazySchema(() => z.object({ backoffMultiplier: z.number().positive().default(2).describe('Multiplier for exponential backoff'), })); -export type TaskRetryPolicy = z.infer; +export type TaskRetryPolicy = z.input; /** Post-parse shape of {@link TaskRetryPolicy} — defaults applied, transforms run (ADR-0122). */ export type TaskRetryPolicyParsed = z.infer; -export type TaskRetryPolicyInput = z.input; /** * Task Schema @@ -184,10 +183,9 @@ export const TaskSchema = lazySchema(() => z.object({ }).optional().describe('Task metadata'), })); -export type Task = z.infer; +export type Task = z.input; /** Post-parse shape of {@link Task} — defaults applied, transforms run (ADR-0122). */ export type TaskParsed = z.infer; -export type TaskInput = z.input; // ========================================== // Task Execution Result @@ -240,7 +238,7 @@ export const TaskExecutionResultSchema = lazySchema(() => z.object({ willRetry: z.boolean().describe('Whether task will be retried'), })); -export type TaskExecutionResult = z.infer; +export type TaskExecutionResult = z.input; // ========================================== // Queue Configuration @@ -306,10 +304,9 @@ export const QueueConfigSchema = lazySchema(() => z.object({ }).optional().describe('Auto-scaling configuration'), })); -export type QueueConfig = z.infer; +export type QueueConfig = z.input; /** Post-parse shape of {@link QueueConfig} — defaults applied, transforms run (ADR-0122). */ export type QueueConfigParsed = z.infer; -export type QueueConfigInput = z.input; // ========================================== // Batch Processing @@ -389,10 +386,9 @@ export const BatchTaskSchema = lazySchema(() => z.object({ .describe('Progress callback function (called after each batch)'), })); -export type BatchTask = z.infer; +export type BatchTask = z.input; /** Post-parse shape of {@link BatchTask} — defaults applied, transforms run (ADR-0122). */ export type BatchTaskParsed = z.infer; -export type BatchTaskInput = z.input; /** * Batch Progress Schema @@ -441,10 +437,9 @@ export const BatchProgressSchema = lazySchema(() => z.object({ completedAt: z.string().datetime().optional().describe('When batch completed'), })); -export type BatchProgress = z.infer; +export type BatchProgress = z.input; /** Post-parse shape of {@link BatchProgress} — defaults applied, transforms run (ADR-0122). */ export type BatchProgressParsed = z.infer; -export type BatchProgressInput = z.input; // ========================================== // Worker Configuration @@ -498,10 +493,9 @@ export const WorkerConfigSchema = lazySchema(() => z.object({ handlers: z.record(z.string(), z.function()).optional().describe('Task type handlers'), })); -export type WorkerConfig = z.infer; +export type WorkerConfig = z.input; /** Post-parse shape of {@link WorkerConfig} — defaults applied, transforms run (ADR-0122). */ export type WorkerConfigParsed = z.infer; -export type WorkerConfigInput = z.input; // ========================================== // Worker Stats @@ -558,7 +552,7 @@ export const WorkerStatsSchema = lazySchema(() => z.object({ })).optional().describe('Per-queue statistics'), })); -export type WorkerStats = z.infer; +export type WorkerStats = z.input; // ========================================== // Helper Functions diff --git a/packages/spec/src/type-alias-convention.pin.test.ts b/packages/spec/src/type-alias-convention.pin.test.ts index 7ff8962620..0845c25155 100644 --- a/packages/spec/src/type-alias-convention.pin.test.ts +++ b/packages/spec/src/type-alias-convention.pin.test.ts @@ -1,28 +1,31 @@ // Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. // -// ADR-0122 phase-1 pin — the aliases that deliberately carry NO `XParsed`. +// ADR-0122 pin — the aliases that deliberately carry NO `XParsed`. // // ## What this file is // -// ADR-0122 makes `XParsed` the name of a schema's PARSED state, and phase 1 -// declares one for every bare `X = z.infer` alias whose schema -// actually HAS two shapes (`z.input` differs from `z.infer`). The complement — -// aliases where the two coincide, so the phase-2 flip of the bare name changes -// nothing observable — deliberately gets no `XParsed`, because a permanent -// synonym is a name an author can only pick wrongly. +// ADR-0122 makes the bare name `X` the AUTHOR state and `XParsed` the PARSED +// state. Phase 1 (#5551 / PR #6072) declared an `XParsed` for every alias whose +// schema actually HAS two shapes (`z.input` differs from `z.infer`); phase 2 +// (#6083, protocol 17) flipped all 1384 bare aliases to `z.input` and retired +// the 102 `XInput` names the flip turned into synonyms. The complement — +// schemas whose two shapes coincide, so the flip changed nothing observable — +// deliberately gets no `XParsed`, because a permanent synonym is a name an +// author can only pick wrongly. // // "Deliberately" is the word that needs teeth. Isomorphism is not a property // anyone declared; it is a fact about the schema tree, and it ROTS: the day a // nested field gains a `.default()`, `.transform()`, `.catch()` or `.pipe()`, -// its alias silently joins the shape-diff set and phase 2 would break it with -// no migration target — the exact silent failure phase 1 exists to prevent. +// its alias silently gains a second shape that nothing names, and a consumer +// holding a parse result has no type to hold it in — the silent failure the +// pins exist to prevent. // // So the complement is pinned rather than merely documented. Each line below // asserts `z.input === z.infer` for one schema. Add a default anywhere in its // tree and this file goes RED with the alias named, and the fix is the one the // ADR prescribes: declare `XParsed` next to the bare alias and delete the pin -// line. The list can therefore only shrink, and it shrinks for the right -// reason. +// line. The list therefore moves in both directions, and it moves for the right +// reason — phase 2 grew it by 35 for a reason it records at the block itself. // // ## It is also the gate's registry // @@ -186,6 +189,8 @@ import type * as M111 from './shared/expression.zod.js'; import type * as M112 from './shared/http.zod.js'; import type * as M113 from './shared/identifiers.zod.js'; import type * as M169 from './shared/mapping.zod.js'; +import type * as M172 from './automation/builtin-node-config.zod.js'; +import type * as M173 from './automation/schemaless-node-config.zod.js'; import type * as M114 from './shared/metadata-types.zod.js'; import type * as M115 from './shared/protection.zod.js'; import type * as M116 from './stack.zod.js'; @@ -1324,33 +1329,89 @@ export type Iso715 = Assert, z. export type Iso719 = Assert, z.infer< typeof M170.PageContainerProps > >>; // --------------------------------------------------------------------------- -// Representative spot-checks on the phase-1 ADDITIONS. +// Phase 2 (#6083) additions. These 35 schemas were never in phase 1's +// population: their bare alias already read `z.input` before the flip, so the +// phase-1 gate — which only looked at bare `z.infer` aliases — never asked +// whether their parsed state was named. The inverted gate does ask, and the +// same probe that chose phase 1's split (with the same deliberate control +// assertion, so a vacuous pass could not be mistaken for isomorphism) says +// these 35 coincide. The other 22 it found got an `XParsed` instead. +// --------------------------------------------------------------------------- + +// api/protocol.zod.ts +export type Iso720 = Assert, z.infer< typeof M28.GetDataRequestSchema > >>; +export type Iso721 = Assert, z.infer< typeof M28.CreateDataRequestSchema > >>; +export type Iso722 = Assert, z.infer< typeof M28.UpdateDataRequestSchema > >>; +export type Iso723 = Assert, z.infer< typeof M28.DeleteDataRequestSchema > >>; +export type Iso724 = Assert, z.infer< typeof M28.CreateManyDataRequestSchema > >>; +export type Iso725 = Assert, z.infer< typeof M28.ListViewsRequestSchema > >>; +export type Iso726 = Assert, z.infer< typeof M28.GetViewRequestSchema > >>; +export type Iso727 = Assert, z.infer< typeof M28.DeleteViewRequestSchema > >>; +export type Iso728 = Assert, z.infer< typeof M28.CheckPermissionRequestSchema > >>; +export type Iso729 = Assert, z.infer< typeof M28.GetObjectPermissionsRequestSchema > >>; +export type Iso730 = Assert, z.infer< typeof M28.GetEffectivePermissionsRequestSchema > >>; +export type Iso731 = Assert, z.infer< typeof M28.RealtimeConnectRequestSchema > >>; +export type Iso732 = Assert, z.infer< typeof M28.RealtimeDisconnectRequestSchema > >>; +export type Iso733 = Assert, z.infer< typeof M28.RealtimeSubscribeRequestSchema > >>; +export type Iso734 = Assert, z.infer< typeof M28.RealtimeUnsubscribeRequestSchema > >>; +export type Iso735 = Assert, z.infer< typeof M28.SetPresenceRequestSchema > >>; +export type Iso736 = Assert, z.infer< typeof M28.GetPresenceRequestSchema > >>; +export type Iso737 = Assert, z.infer< typeof M28.RegisterDeviceRequestSchema > >>; +export type Iso738 = Assert, z.infer< typeof M28.UnregisterDeviceRequestSchema > >>; +export type Iso739 = Assert, z.infer< typeof M28.GetNotificationPreferencesRequestSchema > >>; +export type Iso740 = Assert, z.infer< typeof M28.MarkNotificationsReadRequestSchema > >>; +export type Iso741 = Assert, z.infer< typeof M28.MarkAllNotificationsReadRequestSchema > >>; +export type Iso742 = Assert, z.infer< typeof M28.AiMessageSchema > >>; +export type Iso743 = Assert, z.infer< typeof M28.AiChatRequestSchema > >>; +export type Iso744 = Assert, z.infer< typeof M28.AiCompleteRequestSchema > >>; +export type Iso745 = Assert, z.infer< typeof M28.CreateAiConversationRequestSchema > >>; +export type Iso746 = Assert, z.infer< typeof M28.ListAiConversationsRequestSchema > >>; +export type Iso747 = Assert, z.infer< typeof M28.UpdateAiConversationRequestSchema > >>; +export type Iso748 = Assert, z.infer< typeof M28.AiAgentChatRequestSchema > >>; +export type Iso749 = Assert, z.infer< typeof M28.ListAiPendingActionsRequestSchema > >>; +export type Iso750 = Assert, z.infer< typeof M28.GetLocalesRequestSchema > >>; +export type Iso751 = Assert, z.infer< typeof M28.GetTranslationsRequestSchema > >>; +export type Iso752 = Assert, z.infer< typeof M28.GetFieldLabelsRequestSchema > >>; + +// automation/builtin-node-config.zod.ts +export type Iso753 = Assert, z.infer< typeof M172.ScreenFieldConfigSchema > >>; + +// automation/schemaless-node-config.zod.ts +export type Iso754 = Assert, z.infer< typeof M173.DecisionConditionSchema > >>; + +// --------------------------------------------------------------------------- +// Representative spot-checks on the phase-2 FLIP. // -// Five aliases across three domains, asserting the two facts that make phase 1 -// non-breaking: each new `XParsed` denotes exactly `z.infer`, -// and the bare name it sits next to still denotes the same thing it did before -// the change. The second half is the one worth pinning — phase 1's whole claim -// is that it renames nothing, and this is that claim in a form tsc rejects. +// Five aliases across three domains, asserting the two facts that make phase 2 +// correct: each `XParsed` still denotes exactly `z.infer`, and +// the bare name beside it now denotes `z.input` — the author state. The second +// half is the one worth pinning: phase 2's whole claim is that these five names +// CHANGED meaning, in exactly one direction, and this is that claim in a form +// tsc rejects. In phase 1 these same five lines read `...Unmoved` and asserted +// the opposite of what they assert now; that inversion is the change. // --------------------------------------------------------------------------- export type Spot1 = Assert >>; -export type Spot1Unmoved = Assert >>; +export type Spot1Flipped = Assert >>; export type Spot2 = Assert >>; -export type Spot2Unmoved = Assert >>; +export type Spot2Flipped = Assert >>; export type Spot3 = Assert >>; -export type Spot3Unmoved = Assert >>; +export type Spot3Flipped = Assert >>; export type Spot4 = Assert >>; -export type Spot4Unmoved = Assert >>; +export type Spot4Flipped = Assert >>; export type Spot5 = Assert< Eq< ObjectFieldGroupParsed, z.infer< typeof ObjectFieldGroupSchema > > >; -export type Spot5Unmoved = Assert< - Eq< ObjectFieldGroup, z.infer< typeof ObjectFieldGroupSchema > > +export type Spot5Flipped = Assert< + Eq< ObjectFieldGroup, z.input< typeof ObjectFieldGroupSchema > > >; // Each of the five is in the covered set because its two shapes DIFFER. Assert // that too, so a spot-check cannot quietly become vacuous by drifting into the // isomorphic complement — which is precisely how a pin stops testing anything. +// Without this, `Spot1` and `Spot1Flipped` would both hold trivially on an +// isomorphic schema and the flip would be untested at the very sites chosen to +// test it. type Differs = Eq extends false ? true : false; export type Spot1Differs = Assert< Differs< z.input< typeof ConnectorSchema >, z.infer< typeof ConnectorSchema > > @@ -1360,9 +1421,11 @@ export type Spot3Differs = Assert< >; // --------------------------------------------------------------------------- -// The A-family, untouched. `shared/retry-policy.zod.ts` already spelled the -// ADR-0122 target shape before phase 1, and phase 1 must not have disturbed it: -// the bare name is the AUTHOR state, the parsed state is on `RetryPolicyParsed`. +// The A-family, untouched — twice over. `shared/retry-policy.zod.ts` already +// spelled the ADR-0122 target shape before phase 1, phase 1 did not disturb it, +// and phase 2 had nothing to flip here: the bare name was already the AUTHOR +// state, and the parsed state was already on `RetryPolicyParsed`. That is the +// control on the whole change — a file the codemod must have left alone. // --------------------------------------------------------------------------- export type AFamilyBareIsAuthorState = Assert< @@ -1378,7 +1441,7 @@ export type AFamilyParsedIsParseState = Assert< // --------------------------------------------------------------------------- describe('ADR-0122 type-alias convention', () => { - it('still declares all 720 isomorphic pins', () => { + it('still declares all 751 isomorphic pins', () => { // The truth of each pin is proved by tsc, not here — an `Assert>` // that stops holding is a compile error with the alias named. What tsc // cannot notice is a pin that was DELETED: removing the assertion removes @@ -1411,9 +1474,18 @@ describe('ADR-0122 type-alias convention', () => { // (`PageContainerProps`, the +1 that had taken the count to 720). Both moves // are in this number at once, which is exactly why it is recomputed from the // source rather than reasoned about: -4 retired, +0 of my own. + // + // The fourth way is the one ADR-0122 phase 2 (#6083) added, and it is a + // BULK rise with no schema change behind it at all: 716 -> 751. Those + // 35 schemas are not new and did not move. Their bare alias already read + // `z.input` before the flip, so phase 1's gate — which only ever looked at + // bare `z.infer` aliases — had never asked them whether their parsed state + // was named. Inverting the gate asked, and 35 of the 57 it turned up + // answered "isomorphic". A jump this size is normally the shape of a + // mistake; this one is a gate widening, and the pins are its receipt. const self = readFileSync(fileURLToPath(import.meta.url), 'utf8'); const pins = self.match(/^export type Iso\d+ = Assert { @@ -1423,19 +1495,27 @@ describe('ADR-0122 type-alias convention', () => { expect(parsed.jitter).toBe(false); }); - it('keeps every pre-existing B-family export, XInput included', () => { - // Phase 1 is additive: nothing was renamed or removed. `ConnectorInput` - // is the one the qa downstream-contract FROZEN fixtures import by name. + it('changes no runtime behaviour — only which type name describes it', () => { + // Phase 2 is a TYPE-only change: 1384 aliases moved from `z.infer` to + // `z.input` and 102 `XInput` synonyms were deleted. Not one `.parse()` call, + // default, transform or schema moved, so the values below are byte-for-byte + // what phase 1 asserted — the difference is that `ConnectorParsed`, not + // `Connector`, is now the name that describes them. `ConnectorInput`, which + // used to be the name for what `Connector` means today, is gone. expect(typeof ConnectorSchema.parse).toBe('function'); - const parsedConnector = ConnectorSchema.parse({ + const parsedConnector: ConnectorParsed = ConnectorSchema.parse({ name: 'acme_erp', label: 'Acme ERP', type: 'saas', }); - // The parsed state is what the bare name still denotes in phase 1, and - // what `ConnectorParsed` will keep denoting after the phase-2 flip. expect(parsedConnector.enabled).toBe(true); expect(parsedConnector.status).toBe('inactive'); + + // And the flip's whole point, stated at runtime: the three keys above are + // everything an author has to write, and the bare name is the type that + // accepts exactly that. + const authored: Connector = { name: 'acme_erp', label: 'Acme ERP', type: 'saas' }; + expect(ConnectorSchema.parse(authored).enabled).toBe(true); }); }); diff --git a/packages/spec/src/ui/action-params.zod.ts b/packages/spec/src/ui/action-params.zod.ts index 1a59935062..47abc07bc0 100644 --- a/packages/spec/src/ui/action-params.zod.ts +++ b/packages/spec/src/ui/action-params.zod.ts @@ -404,7 +404,7 @@ export const ActionSessionSchema = lazySchema(() => z.object({ * type, so the schema and the handler-facing type cannot drift into two shapes * for one object. */ -export type ActionSession = z.infer; +export type ActionSession = z.input; /** * The runtime context an action handler receives (ADR-0104 D2). `params` is diff --git a/packages/spec/src/ui/action.zod.ts b/packages/spec/src/ui/action.zod.ts index 95f3bd9d8e..87240e3272 100644 --- a/packages/spec/src/ui/action.zod.ts +++ b/packages/spec/src/ui/action.zod.ts @@ -173,7 +173,6 @@ const actionParamUnknownKeyError = strictUnknownKeyError({ 'config shipped as a control that quietly ignored it.', }); - export const ActionParamSchema = lazySchema(() => z.object({ /** Request-body key. Defaults to `field` when `field` is set. */ name: z.string().optional(), @@ -479,7 +478,7 @@ export const ACTION_LOCATIONS = [ ] as const; export const ActionLocationSchema = z.enum(ACTION_LOCATIONS); -export type ActionLocation = z.infer; +export type ActionLocation = z.input; /** * Tool category values for {@link ActionAiSchema.category}. @@ -609,7 +608,7 @@ export const ActionAiSchema = strictObject({ requiresConfirmation: z.boolean().optional().describe('Override HITL confirmation for AI invocations.'), }); -export type ActionAi = z.infer; +export type ActionAi = z.input; /** Post-parse shape of {@link ActionAi} — defaults applied, transforms run (ADR-0122). */ export type ActionAiParsed = z.infer; @@ -1099,13 +1098,12 @@ export const ActionSchema = lazySchema(() => actionObject().refine((data) => { path: ['ai', 'paramHints'], }).transform((data, ctx) => lowerRequiresFeature(data, ctx))); -export type Action = z.infer; +export type Action = z.input; /** Post-parse shape of {@link Action} — defaults applied, transforms run (ADR-0122). */ export type ActionParsed = z.infer; -export type ActionParam = z.infer; +export type ActionParam = z.input; /** Post-parse shape of {@link ActionParam} — defaults applied, transforms run (ADR-0122). */ export type ActionParamParsed = z.infer; -export type ActionInput = z.input; /** * Legacy spellings an inline action may carry, folded to canonical on parse. @@ -1194,10 +1192,9 @@ export const InlineActionSchema = lazySchema(() => z.preprocess( }), )); -export type InlineAction = z.infer; +export type InlineAction = z.input; /** Post-parse shape of {@link InlineAction} — defaults applied, transforms run (ADR-0122). */ export type InlineActionParsed = z.infer; -export type InlineActionInput = z.input; /** * Action Factory Helper @@ -1211,6 +1208,6 @@ export const Action = { * `.parse()` and accepts input-shape config (optional defaults, CEL * shorthand) — preferred over a bare `: Action` literal. */ -export function defineAction(config: z.input): Action { +export function defineAction(config: z.input): ActionParsed { return ActionSchema.parse(config); } diff --git a/packages/spec/src/ui/app.nav-type-assertions.ts b/packages/spec/src/ui/app.nav-type-assertions.ts index cb36cc1398..07a1c4b352 100644 --- a/packages/spec/src/ui/app.nav-type-assertions.ts +++ b/packages/spec/src/ui/app.nav-type-assertions.ts @@ -39,7 +39,7 @@ * the half both real failures landed in. */ -import type { AppInput, NavigationItem, NavigationItemInput } from './app.zod'; +import type { App, NavigationItem, NavigationItemInput } from './app.zod'; /* ──────────────────────────────────────────────────────────────────────────── * Output side (`z.infer`) — what a parse RETURNS. @@ -173,28 +173,28 @@ asItem(inputOmitsDefaults); * leaves `z.input` at `unknown` and every authoring path * unchecked — which is precisely the state this file was written to end. * - * These go through `AppInput`, the type `defineApp` takes, so they fail the + * These go through `App`, the type `defineApp` takes, so they fail the * moment the annotation loses its second parameter (verified by mutation: * dropping it back to `z.ZodType` turns all three into unused * suppressions). * ──────────────────────────────────────────────────────────────────────────── */ -const asAppInput = (x: AppInput): AppInput => x; +const asApp = (x: App): App => x; /** The shape every downstream author writes — defaulted keys omitted. */ -export const appInputOmitsDefaults: AppInput = { +export const appInputOmitsDefaults: App = { name: 'probe_app', label: 'Probe', navigation: [{ id: 'grp', type: 'group', label: 'G', children: [] }], }; // @ts-expect-error — nav entries are checked; `unknown` would swallow this -asAppInput({ name: 'probe_app', label: 'Probe', navigation: [42] }); +asApp({ name: 'probe_app', label: 'Probe', navigation: [42] }); // @ts-expect-error — …and this -asAppInput({ name: 'probe_app', label: 'Probe', navigation: [{ totally: 'made up' }] }); +asApp({ name: 'probe_app', label: 'Probe', navigation: [{ totally: 'made up' }] }); // NOTE: kept on one line — `@ts-expect-error` suppresses the NEXT LINE only, and -// the excess-property error lands on the nav entry, not on the opening `asAppInput(`. +// the excess-property error lands on the nav entry, not on the opening `asApp(`. // @ts-expect-error — …and this, the strictness the nav members declare -asAppInput({ name: 'p', label: 'P', navigation: [{ id: 'grp', type: 'group', label: 'G', children: [], defaultOpen: true }] }); +asApp({ name: 'p', label: 'P', navigation: [{ id: 'grp', type: 'group', label: 'G', children: [], defaultOpen: true }] }); diff --git a/packages/spec/src/ui/app.zod.ts b/packages/spec/src/ui/app.zod.ts index 732416a649..877258686a 100644 --- a/packages/spec/src/ui/app.zod.ts +++ b/packages/spec/src/ui/app.zod.ts @@ -635,15 +635,15 @@ export const NavigationContributionSchema = lazySchema(() => z.object({ 'package injected its menu into the wrong place, or nowhere.', }), }).strict().describe('A navigation contribution: a package injecting nav items into an app it does not own (ADR-0029 D7)')); -export type NavigationContribution = z.infer; -/** Post-parse shape of {@link NavigationContribution} — defaults applied, transforms run (ADR-0122). */ -export type NavigationContributionParsed = z.infer; /** * The authoring shape of a contribution (#4195) — `priority` is `.default(200)` * and each item is a {@link NavigationItemInput}, so this is what a package - * declaring its menu entries actually writes. + * declaring its menu entries actually writes. Spelled + * `NavigationContributionInput` until ADR-0122 phase 2 retired that synonym. */ -export type NavigationContributionInput = z.input; +export type NavigationContribution = z.input; +/** Post-parse shape of {@link NavigationContribution} — defaults applied, transforms run (ADR-0122). */ +export type NavigationContributionParsed = z.infer; /** * App Branding Configuration @@ -1001,7 +1001,7 @@ export const AppContextSelectorSchema = lazySchema(() => z.object({ }), }).strict()); -export type AppContextSelector = z.infer; +export type AppContextSelector = z.input; /** Post-parse shape of {@link AppContextSelector} — defaults applied, transforms run (ADR-0122). */ export type AppContextSelectorParsed = z.infer; @@ -1097,7 +1097,6 @@ const HOME_PAGE_ID_RETIRED = + 'should own the root landing. Run `os migrate meta --from 16` to rewrite existing sources ' + 'automatically.'; - const appUnknownKeyError = strictUnknownKeyError({ surface: 'this app', knownKeys: APP_KEYS, @@ -1384,42 +1383,41 @@ export const App = { * }); * ``` */ -export function defineApp(config: z.input): App { +export function defineApp(config: z.input): AppParsed { return AppSchema.parse(config); } // Main Types -export type App = z.infer; +export type App = z.input; /** Post-parse shape of {@link App} — defaults applied, transforms run (ADR-0122). */ export type AppParsed = z.infer; -export type AppInput = z.input; -export type AppBranding = z.infer; +export type AppBranding = z.input; // `NavigationItem` is declared next to NavigationItemSchema — it IS that // schema's annotation, so it cannot be inferred back out of it (#4171). -export type NavigationArea = z.infer; +export type NavigationArea = z.input; /** Post-parse shape of {@link NavigationArea} — defaults applied, transforms run (ADR-0122). */ export type NavigationAreaParsed = z.infer; // Discriminated Item Types (Helper exports) -export type ObjectNavItem = z.infer; +export type ObjectNavItem = z.input; /** Post-parse shape of {@link ObjectNavItem} — defaults applied, transforms run (ADR-0122). */ export type ObjectNavItemParsed = z.infer; -export type DashboardNavItem = z.infer; +export type DashboardNavItem = z.input; /** Post-parse shape of {@link DashboardNavItem} — defaults applied, transforms run (ADR-0122). */ export type DashboardNavItemParsed = z.infer; -export type PageNavItem = z.infer; +export type PageNavItem = z.input; /** Post-parse shape of {@link PageNavItem} — defaults applied, transforms run (ADR-0122). */ export type PageNavItemParsed = z.infer; -export type UrlNavItem = z.infer; +export type UrlNavItem = z.input; /** Post-parse shape of {@link UrlNavItem} — defaults applied, transforms run (ADR-0122). */ export type UrlNavItemParsed = z.infer; -export type ReportNavItem = z.infer; +export type ReportNavItem = z.input; /** Post-parse shape of {@link ReportNavItem} — defaults applied, transforms run (ADR-0122). */ export type ReportNavItemParsed = z.infer; -export type ActionNavItem = z.infer; +export type ActionNavItem = z.input; /** Post-parse shape of {@link ActionNavItem} — defaults applied, transforms run (ADR-0122). */ export type ActionNavItemParsed = z.infer; -export type ComponentNavItem = z.infer; +export type ComponentNavItem = z.input; /** Post-parse shape of {@link ComponentNavItem} — defaults applied, transforms run (ADR-0122). */ export type ComponentNavItemParsed = z.infer; export type GroupNavItem = z.infer & { children: NavigationItem[] }; diff --git a/packages/spec/src/ui/bulk-action.zod.ts b/packages/spec/src/ui/bulk-action.zod.ts index e506e9db17..98658b50e8 100644 --- a/packages/spec/src/ui/bulk-action.zod.ts +++ b/packages/spec/src/ui/bulk-action.zod.ts @@ -98,11 +98,11 @@ import { FieldType } from '../data/field.zod'; /** How the executor mutates the selected records. */ export const BulkActionOperationSchema = z.enum(['update', 'delete', 'custom']); -export type BulkActionOperation = z.infer; +export type BulkActionOperation = z.input; /** How many dispatches a `custom` def makes for a selection of N records. */ export const BulkActionExecutionSchema = z.enum(['perRecord', 'aggregate']); -export type BulkActionExecution = z.infer; +export type BulkActionExecution = z.input; /** * One input collected ONCE by the bulk dialog before the run (never re-prompted @@ -131,7 +131,7 @@ export const BulkActionParamSchema = lazySchema(() => z.object({ multiple: z.boolean().optional().describe('Allow picking multiple values — the param value becomes an array and is written to the patch as-is.'), placeholder: z.string().optional().describe('Placeholder text.'), }).passthrough()); -export type BulkActionParam = z.infer; +export type BulkActionParam = z.input; /** Declared keys of a bulk-action def — the "did you mean" pool. */ const BULK_ACTION_DEF_KEYS = [ @@ -283,6 +283,6 @@ export const BulkActionDefSchema = lazySchema(() => z.object({ }); } })); -export type BulkActionDef = z.infer; +export type BulkActionDef = z.input; /** Post-parse shape of {@link BulkActionDef} — defaults applied, transforms run (ADR-0122). */ export type BulkActionDefParsed = z.infer; diff --git a/packages/spec/src/ui/chart.zod.ts b/packages/spec/src/ui/chart.zod.ts index 025ed9c533..9479e28aeb 100644 --- a/packages/spec/src/ui/chart.zod.ts +++ b/packages/spec/src/ui/chart.zod.ts @@ -136,7 +136,7 @@ export const ChartTypeSchema = lazySchema(() => z.enum([ // `solid-gauge`/`bullet` render a value today and gain a dial when a gauge // renderer lands. -export type ChartType = z.infer; +export type ChartType = z.input; /** * Chart Axis Schema @@ -781,22 +781,22 @@ export const ChartAggregateSchema = lazySchema(() => .describe('Inline aggregation for an object-bound chart'), ); -export type ChartConfig = z.infer; +export type ChartConfig = z.input; /** Post-parse shape of {@link ChartConfig} — defaults applied, transforms run (ADR-0122). */ export type ChartConfigParsed = z.infer; -export type ChartAggregate = z.infer; -export type ChartAggregateFunction = z.infer; -export type ChartGroupBy = z.infer; -export type ChartAxis = z.infer; +export type ChartAggregate = z.input; +export type ChartAggregateFunction = z.input; +export type ChartGroupBy = z.input; +export type ChartAxis = z.input; /** Post-parse shape of {@link ChartAxis} — defaults applied, transforms run (ADR-0122). */ export type ChartAxisParsed = z.infer; -export type ChartSeries = z.infer; +export type ChartSeries = z.input; /** Post-parse shape of {@link ChartSeries} — defaults applied, transforms run (ADR-0122). */ export type ChartSeriesParsed = z.infer; -export type ChartAnnotation = z.infer; +export type ChartAnnotation = z.input; /** Post-parse shape of {@link ChartAnnotation} — defaults applied, transforms run (ADR-0122). */ export type ChartAnnotationParsed = z.infer; -export type ChartInteraction = z.infer; +export type ChartInteraction = z.input; /** Post-parse shape of {@link ChartInteraction} — defaults applied, transforms run (ADR-0122). */ export type ChartInteractionParsed = z.infer; -export type ChartDrillDown = z.infer; +export type ChartDrillDown = z.input; diff --git a/packages/spec/src/ui/component.zod.ts b/packages/spec/src/ui/component.zod.ts index 779ca96253..518a2d16ad 100644 --- a/packages/spec/src/ui/component.zod.ts +++ b/packages/spec/src/ui/component.zod.ts @@ -189,7 +189,7 @@ const EmptyProps = z.object({}); export const PageContainerProps = z.object({ children: z.array(z.unknown()).optional().describe('Child components rendered inside this container, in order'), }); -export type PageContainerProps = z.infer; +export type PageContainerProps = z.input; /** * ---------------------------------------------------------------------- diff --git a/packages/spec/src/ui/dashboard.zod.ts b/packages/spec/src/ui/dashboard.zod.ts index bf8f054b87..07f86da503 100644 --- a/packages/spec/src/ui/dashboard.zod.ts +++ b/packages/spec/src/ui/dashboard.zod.ts @@ -806,24 +806,23 @@ export const DashboardSchema = lazySchema(() => strictObject({ })); -export type Dashboard = z.infer; +export type Dashboard = z.input; /** Post-parse shape of {@link Dashboard} — defaults applied, transforms run (ADR-0122). */ export type DashboardParsed = z.infer; -export type DashboardInput = z.input; -export type DashboardWidget = z.infer; +export type DashboardWidget = z.input; /** Post-parse shape of {@link DashboardWidget} — defaults applied, transforms run (ADR-0122). */ export type DashboardWidgetParsed = z.infer; -export type DashboardWidgetOptions = z.infer; -export type DashboardHeader = z.infer; +export type DashboardWidgetOptions = z.input; +export type DashboardHeader = z.input; /** Post-parse shape of {@link DashboardHeader} — defaults applied, transforms run (ADR-0122). */ export type DashboardHeaderParsed = z.infer; -export type DashboardHeaderAction = z.infer; -export type WidgetColorVariant = z.infer; -export type WidgetActionType = z.infer; -export type GlobalFilter = z.infer; +export type DashboardHeaderAction = z.input; +export type WidgetColorVariant = z.input; +export type WidgetActionType = z.input; +export type GlobalFilter = z.input; /** Post-parse shape of {@link GlobalFilter} — defaults applied, transforms run (ADR-0122). */ export type GlobalFilterParsed = z.infer; -export type GlobalFilterOptionsFrom = z.infer; +export type GlobalFilterOptionsFrom = z.input; /** * Dashboard Factory Helper diff --git a/packages/spec/src/ui/dataset.zod.ts b/packages/spec/src/ui/dataset.zod.ts index fc5c10b7d9..a0736b8268 100644 --- a/packages/spec/src/ui/dataset.zod.ts +++ b/packages/spec/src/ui/dataset.zod.ts @@ -370,16 +370,12 @@ export const DatasetSchema = lazySchema(() => strictObject({ * }); * ``` */ -export function defineDataset(dataset: DatasetInput): DatasetInput { +export function defineDataset(dataset: Dataset): Dataset { return dataset; } -export type DatasetDimension = z.infer; -export type DatasetMeasure = z.infer; -export type DerivedMeasureOpValue = z.infer; -export type Dataset = z.infer; +export type DatasetDimension = z.input; +export type DatasetMeasure = z.input; +export type DerivedMeasureOpValue = z.input; +export type Dataset = z.input; -/** Input types for authoring (optional fields with defaults may be omitted). */ -export type DatasetDimensionInput = z.input; -export type DatasetMeasureInput = z.input; -export type DatasetInput = z.input; diff --git a/packages/spec/src/ui/i18n.zod.ts b/packages/spec/src/ui/i18n.zod.ts index b7ddad026b..0f8bf2ecfd 100644 --- a/packages/spec/src/ui/i18n.zod.ts +++ b/packages/spec/src/ui/i18n.zod.ts @@ -69,7 +69,7 @@ import { strictObject } from '../shared/strict-object'; */ export const I18nLabelSchema = lazySchema(() => z.string().describe('Display label (plain string; i18n keys are auto-generated by the framework)')); -export type I18nLabel = z.infer; +export type I18nLabel = z.input; // The one closed shape in this file (#4001 批 16). Everything below `AriaProps` // stays open on the `no door` verdict recorded at the top. @@ -150,4 +150,4 @@ export const AriaPropsSchema = lazySchema(() => strictObject({ role: z.string().optional().describe('WAI-ARIA role attribute (e.g., "dialog", "navigation", "alert")'), }).describe('ARIA accessibility attributes')); -export type AriaProps = z.infer; +export type AriaProps = z.input; diff --git a/packages/spec/src/ui/notification.zod.ts b/packages/spec/src/ui/notification.zod.ts index 22b7f5dec3..fa61cbc318 100644 --- a/packages/spec/src/ui/notification.zod.ts +++ b/packages/spec/src/ui/notification.zod.ts @@ -15,7 +15,7 @@ export const NotificationTypeSchema = lazySchema(() => z.enum([ 'inline', ]).describe('Notification presentation style')); -export type NotificationType = z.infer; +export type NotificationType = z.input; /** * Notification Severity Schema @@ -28,7 +28,7 @@ export const NotificationSeveritySchema = lazySchema(() => z.enum([ 'error', ]).describe('Notification severity level')); -export type NotificationSeverity = z.infer; +export type NotificationSeverity = z.input; /** * Notification Position Schema @@ -43,7 +43,7 @@ export const NotificationPositionSchema = lazySchema(() => z.enum([ 'bottom_right', ]).describe('Screen position for notification placement')); -export type NotificationPosition = z.infer; +export type NotificationPosition = z.input; // [#5015] `NotificationActionSchema` / `NotificationAction` were REMOVED per // ADR-0049 enforce-or-remove, ruled REMOVE on 2026-08-04. diff --git a/packages/spec/src/ui/page.zod.ts b/packages/spec/src/ui/page.zod.ts index 477aef9ef3..68588b6095 100644 --- a/packages/spec/src/ui/page.zod.ts +++ b/packages/spec/src/ui/page.zod.ts @@ -544,31 +544,29 @@ export const PageSchema = lazySchema(() => strictObject({ // check above. It once also required `recordReview`/`blankLayout` and `slots` // (all removed — unrendered roadmap / "required-but-unauthorable" Studio traps). -export type Page = z.infer; +export type Page = z.input; /** Post-parse shape of {@link Page} — defaults applied, transforms run (ADR-0122). */ export type PageParsed = z.infer; -/** Authoring input for {@link Page} — defaulted fields are optional. */ -export type PageInput = z.input; /** * Type-safe factory for a custom page. Validates at authoring time via * `.parse()` and accepts input-shape config (optional defaults, CEL * shorthand) — preferred over a bare `: Page` literal. */ -export function definePage(config: z.input): Page { +export function definePage(config: z.input): PageParsed { return PageSchema.parse(config); } -export type PageType = z.infer; -export type PageComponent = z.infer; +export type PageType = z.input; +export type PageComponent = z.input; /** Post-parse shape of {@link PageComponent} — defaults applied, transforms run (ADR-0122). */ export type PageComponentParsed = z.infer; -export type PageRegion = z.infer; +export type PageRegion = z.input; /** Post-parse shape of {@link PageRegion} — defaults applied, transforms run (ADR-0122). */ export type PageRegionParsed = z.infer; -export type PageVariable = z.infer; +export type PageVariable = z.input; /** Post-parse shape of {@link PageVariable} — defaults applied, transforms run (ADR-0122). */ export type PageVariableParsed = z.infer; -export type ElementDataSource = z.infer; -export type InterfacePageConfig = z.infer; +export type ElementDataSource = z.input; +export type InterfacePageConfig = z.input; /** Post-parse shape of {@link InterfacePageConfig} — defaults applied, transforms run (ADR-0122). */ export type InterfacePageConfigParsed = z.infer; diff --git a/packages/spec/src/ui/report.zod.ts b/packages/spec/src/ui/report.zod.ts index 6d98f5beb8..c15d609bce 100644 --- a/packages/spec/src/ui/report.zod.ts +++ b/packages/spec/src/ui/report.zod.ts @@ -404,8 +404,7 @@ export const ReportSchema = lazySchema(() => strictObject({ } })); -export type JoinedReportBlock = z.infer; -export type JoinedReportBlockInput = z.input; +export type JoinedReportBlock = z.input; /** * Report Types @@ -413,29 +412,21 @@ export type JoinedReportBlockInput = z.input; * Note: For configuration/definition contexts, use the Input types (e.g., ReportInput) * which allow optional fields with defaults to be omitted. */ -export type Report = z.infer; +export type Report = z.input; /** Post-parse shape of {@link Report} — defaults applied, transforms run (ADR-0122). */ export type ReportParsed = z.infer; -export type ReportChart = z.infer; +export type ReportChart = z.input; /** Post-parse shape of {@link ReportChart} — defaults applied, transforms run (ADR-0122). */ export type ReportChartParsed = z.infer; -export type ReportSort = z.infer; +export type ReportSort = z.input; /** Post-parse shape of {@link ReportSort} — defaults applied, transforms run (ADR-0122). */ export type ReportSortParsed = z.infer; -/** - * Input Types for Report Configuration - * Use these when defining reports in configuration files. - */ -export type ReportInput = z.input; -export type ReportChartInput = z.input; -export type ReportSortInput = z.input; - /** * Report Factory Helper */ export const Report = { - create: (config: ReportInput): Report => ReportSchema.parse(config), + create: (config: Report): ReportParsed => ReportSchema.parse(config), } as const; /** @@ -443,6 +434,6 @@ export const Report = { * `.parse()` and accepts input-shape config (optional defaults, CEL * shorthand) — preferred over a bare `: Report` literal. */ -export function defineReport(config: z.input): Report { +export function defineReport(config: z.input): ReportParsed { return ReportSchema.parse(config); } diff --git a/packages/spec/src/ui/responsive.zod.ts b/packages/spec/src/ui/responsive.zod.ts index e83631d492..b7870b620f 100644 --- a/packages/spec/src/ui/responsive.zod.ts +++ b/packages/spec/src/ui/responsive.zod.ts @@ -72,7 +72,7 @@ import { strictObject } from '../shared/strict-object'; */ export const BreakpointName = z.enum(['xs', 'sm', 'md', 'lg', 'xl', '2xl']); -export type BreakpointName = z.infer; +export type BreakpointName = z.input; /** * Aliases for the two per-breakpoint MAPS (`columns` / `order`), which are keyed @@ -244,7 +244,7 @@ export const ResponsiveConfigSchema = lazySchema(() => strictObject( }, ).describe('Responsive layout configuration')); -export type ResponsiveConfig = z.infer; +export type ResponsiveConfig = z.input; /** * Style Map Schema (ADR-0065) @@ -268,7 +268,7 @@ export const StyleMapSchema = lazySchema(() => z.record(z.string(), z.union([z.string(), z.number()])) .describe('CSS property → value map (camelCase keys; design tokens encouraged)')); -export type StyleMap = z.infer; +export type StyleMap = z.input; /** * Responsive Styles Schema (ADR-0065) @@ -326,7 +326,7 @@ export const ResponsiveStylesSchema = lazySchema(() => strictObject( }, ).describe('Per-breakpoint scoped style maps (ADR-0065)')); -export type ResponsiveStyles = z.infer; +export type ResponsiveStyles = z.input; /* * REMOVED — `PerformanceConfigSchema` / `PerformanceConfig` (#3896 audit diff --git a/packages/spec/src/ui/sharing.zod.ts b/packages/spec/src/ui/sharing.zod.ts index d35a9db67e..8a2be869ba 100644 --- a/packages/spec/src/ui/sharing.zod.ts +++ b/packages/spec/src/ui/sharing.zod.ts @@ -139,6 +139,6 @@ export const SharingConfigSchema = lazySchema(() => strictObject({ // a route that honours the origins first, the vocabulary second. // Type Exports -export type SharingConfig = z.infer; +export type SharingConfig = z.input; /** Post-parse shape of {@link SharingConfig} — defaults applied, transforms run (ADR-0122). */ export type SharingConfigParsed = z.infer; diff --git a/packages/spec/src/ui/theme.zod.ts b/packages/spec/src/ui/theme.zod.ts index 06c9f34416..ea658fddca 100644 --- a/packages/spec/src/ui/theme.zod.ts +++ b/packages/spec/src/ui/theme.zod.ts @@ -455,24 +455,22 @@ export const ThemeSchema = lazySchema(() => strictObject( }, )); -export type Theme = z.infer; +export type Theme = z.input; /** Post-parse shape of {@link Theme} — defaults applied, transforms run (ADR-0122). */ export type ThemeParsed = z.infer; -/** Authoring input for {@link Theme} — defaulted fields are optional. */ -export type ThemeInput = z.input; /** * Type-safe factory for a UI theme. Validates at authoring time via * `.parse()` and accepts input-shape config (optional defaults, CEL * shorthand) — preferred over a bare `: Theme` literal. */ -export function defineTheme(config: z.input): Theme { +export function defineTheme(config: z.input): ThemeParsed { return ThemeSchema.parse(config); } -export type ColorPalette = z.infer; -export type Typography = z.infer; -export type BorderRadius = z.infer; -export type Shadow = z.infer; +export type ColorPalette = z.input; +export type Typography = z.input; +export type BorderRadius = z.input; +export type Shadow = z.input; // `Animation` and `ZIndex` were exported here until #5021, alongside the two // schemas they were inferred from. -export type ThemeMode = z.infer; +export type ThemeMode = z.input; diff --git a/packages/spec/src/ui/view.zod.ts b/packages/spec/src/ui/view.zod.ts index f99f0e8b02..ca31dc2359 100644 --- a/packages/spec/src/ui/view.zod.ts +++ b/packages/spec/src/ui/view.zod.ts @@ -416,7 +416,7 @@ export const ViewFilterRuleSchema = lazySchema(() => strictObject({ .optional().describe('Filter value'), }).describe('View filter rule')); -export type ViewFilterRule = z.infer; +export type ViewFilterRule = z.input; /** Post-parse shape of {@link ViewFilterRule} — defaults applied, transforms run (ADR-0122). */ export type ViewFilterRuleParsed = z.infer; @@ -1574,7 +1574,7 @@ export const FormButtonConfigSchema = lazySchema(() => strictObject({ show: z.boolean().optional().describe('Whether the button is rendered (renderer default applies when omitted)'), label: I18nLabelSchema.optional().describe('Button label (i18n-capable; renderer default when omitted)'), }).strict()); -export type FormButtonConfig = z.infer; +export type FormButtonConfig = z.input; /** * Form View Schema @@ -1967,7 +1967,7 @@ export const ViewSchema = lazySchema(() => strictObject({ * }); * ``` */ -export function defineView(config: z.input): View { +export function defineView(config: z.input): ViewParsed { const parsed = ViewSchema.parse(config); const viewCount = (parsed.list ? 1 : 0) + @@ -2823,7 +2823,7 @@ export function expandViewContainer(object: string, container: any): ExpandedVie */ export function defineForm( config: Omit, 'data'> & { schemaId: string }, -): FormView { +): FormViewParsed { const { schemaId, ...rest } = config; return FormViewSchema.parse({ ...rest, @@ -2831,42 +2831,42 @@ export function defineForm( }); } -export type View = z.infer; +export type View = z.input; /** Post-parse shape of {@link View} — defaults applied, transforms run (ADR-0122). */ export type ViewParsed = z.infer; -export type ViewItem = z.infer; +export type ViewItem = z.input; /** A ViewItem record as it travels the WIRE — the authoring shape plus Studio's round-trip keys (#5074). */ -export type ViewItemWire = z.infer; +export type ViewItemWire = z.input; /** Any persisted `view` metadata body: container | ViewItem record | flattened overlay (#3095). */ -export type ViewMetadata = z.infer; +export type ViewMetadata = z.input; /** Post-parse shape of {@link ViewMetadata} — defaults applied, transforms run (ADR-0122). */ export type ViewMetadataParsed = z.infer; -export type ViewScope = z.infer; -export type ViewKind = z.infer; -export type ListView = z.infer; +export type ViewScope = z.input; +export type ViewKind = z.input; +export type ListView = z.input; /** Post-parse shape of {@link ListView} — defaults applied, transforms run (ADR-0122). */ export type ListViewParsed = z.infer; -export type FormView = z.infer; +export type FormView = z.input; /** Post-parse shape of {@link FormView} — defaults applied, transforms run (ADR-0122). */ export type FormViewParsed = z.infer; -export type FormSection = z.infer; +export type FormSection = z.input; /** Post-parse shape of {@link FormSection} — defaults applied, transforms run (ADR-0122). */ export type FormSectionParsed = z.infer; -export type ListColumn = z.infer; +export type ListColumn = z.input; /** Post-parse shape of {@link ListColumn} — defaults applied, transforms run (ADR-0122). */ export type ListColumnParsed = z.infer; // `FormField` is declared next to FormFieldSchema — it IS that schema's // annotation, so it cannot be inferred back out of it (#4171). -export type SelectionConfig = z.infer; +export type SelectionConfig = z.input; /** Post-parse shape of {@link SelectionConfig} — defaults applied, transforms run (ADR-0122). */ export type SelectionConfigParsed = z.infer; -export type NavigationConfig = z.infer; +export type NavigationConfig = z.input; /** Post-parse shape of {@link NavigationConfig} — defaults applied, transforms run (ADR-0122). */ export type NavigationConfigParsed = z.infer; -export type PaginationConfig = z.infer; +export type PaginationConfig = z.input; /** Post-parse shape of {@link PaginationConfig} — defaults applied, transforms run (ADR-0122). */ export type PaginationConfigParsed = z.infer; -export type ViewData = z.infer; +export type ViewData = z.input; /** Post-parse shape of {@link ViewData} — defaults applied, transforms run (ADR-0122). */ export type ViewDataParsed = z.infer; // `HttpRequest` is NOT inferred here — it is re-exported from its single @@ -2883,42 +2883,42 @@ export type ViewDataParsed = z.infer; // the name was dropped instead; the 5-value type is re-exported as // `HttpMethodSubset` at the top of this file (`HttpMethodType` until #5832), // where the full rationale lives. -export type ColumnSummary = z.infer; -export type ColumnSummaryConfig = z.infer; -export type ColumnPrefix = z.infer; +export type ColumnSummary = z.input; +export type ColumnSummaryConfig = z.input; +export type ColumnPrefix = z.input; /** Post-parse shape of {@link ColumnPrefix} — defaults applied, transforms run (ADR-0122). */ export type ColumnPrefixParsed = z.infer; -export type RowHeight = z.infer; -export type GroupingConfig = z.infer; +export type RowHeight = z.input; +export type GroupingConfig = z.input; /** Post-parse shape of {@link GroupingConfig} — defaults applied, transforms run (ADR-0122). */ export type GroupingConfigParsed = z.infer; -export type GalleryConfig = z.infer; +export type GalleryConfig = z.input; /** Post-parse shape of {@link GalleryConfig} — defaults applied, transforms run (ADR-0122). */ export type GalleryConfigParsed = z.infer; -export type TimelineConfig = z.infer; +export type TimelineConfig = z.input; /** Post-parse shape of {@link TimelineConfig} — defaults applied, transforms run (ADR-0122). */ export type TimelineConfigParsed = z.infer; -export type ListChartConfig = z.infer; +export type ListChartConfig = z.input; /** Post-parse shape of {@link ListChartConfig} — defaults applied, transforms run (ADR-0122). */ export type ListChartConfigParsed = z.infer; -export type ViewSharing = z.infer; +export type ViewSharing = z.input; /** Post-parse shape of {@link ViewSharing} — defaults applied, transforms run (ADR-0122). */ export type ViewSharingParsed = z.infer; -export type RowColorConfig = z.infer; -export type VisualizationType = z.infer; -export type UserActionsConfig = z.infer; +export type RowColorConfig = z.input; +export type VisualizationType = z.input; +export type UserActionsConfig = z.input; /** Post-parse shape of {@link UserActionsConfig} — defaults applied, transforms run (ADR-0122). */ export type UserActionsConfigParsed = z.infer; -export type AppearanceConfig = z.infer; +export type AppearanceConfig = z.input; /** Post-parse shape of {@link AppearanceConfig} — defaults applied, transforms run (ADR-0122). */ export type AppearanceConfigParsed = z.infer; -export type ViewTab = z.infer; +export type ViewTab = z.input; /** Post-parse shape of {@link ViewTab} — defaults applied, transforms run (ADR-0122). */ export type ViewTabParsed = z.infer; -export type UserFilterField = z.infer; -export type UserFilters = z.infer; +export type UserFilterField = z.input; +export type UserFilters = z.input; /** Post-parse shape of {@link UserFilters} — defaults applied, transforms run (ADR-0122). */ export type UserFiltersParsed = z.infer; -export type AddRecordConfig = z.infer; +export type AddRecordConfig = z.input; /** Post-parse shape of {@link AddRecordConfig} — defaults applied, transforms run (ADR-0122). */ export type AddRecordConfigParsed = z.infer; diff --git a/packages/spec/src/ui/widget.zod.ts b/packages/spec/src/ui/widget.zod.ts index 8dc9355824..4b88fdf4c6 100644 --- a/packages/spec/src/ui/widget.zod.ts +++ b/packages/spec/src/ui/widget.zod.ts @@ -158,6 +158,6 @@ export const FieldWidgetPropsSchema = lazySchema(() => z.object({ /** * TypeScript type for Field Widget Props */ -export type FieldWidgetProps = z.infer; +export type FieldWidgetProps = z.input; /** Post-parse shape of {@link FieldWidgetProps} — defaults applied, transforms run (ADR-0122). */ export type FieldWidgetPropsParsed = z.infer; diff --git a/packages/spec/test-typecheck-debt.json b/packages/spec/test-typecheck-debt.json index 3840710b77..8756c8d001 100644 --- a/packages/spec/test-typecheck-debt.json +++ b/packages/spec/test-typecheck-debt.json @@ -1,84 +1,63 @@ { "_comment": "Per-file tsc error debt of the @objectstack/spec TEST layer (#5286). `tsconfig.test.json` compiles `src/**/*.test.ts` — which `tsconfig.json` excludes and therefore no gate ever read — and every file below still carries errors from before that gate existed, almost all of them fixture literals annotated with a schema OUTPUT type (`z.infer`) while holding an authored INPUT literal. EXACT ratchet, judged by re-running tsc: a file that gains errors is red, a file that loses them is red until its number is re-recorded, a file that reaches zero is red until its entry is deleted, and a file NOT listed here may have no errors at all. Regenerate with: pnpm --filter @objectstack/spec gen:test-typecheck-debt", "entries": { - "src/ai/agent.test.ts": 11, - "src/ai/conversation.test.ts": 13, - "src/ai/model-registry.test.ts": 24, - "src/ai/skill.test.ts": 1, + "src/ai/conversation.test.ts": 5, "src/api/documentation.test.ts": 1, "src/api/errors.test.ts": 1, "src/api/metadata.test.ts": 1, "src/api/odata.test.ts": 1, "src/api/package-api.test.ts": 4, - "src/api/rest-server.test.ts": 3, - "src/api/router.test.ts": 9, + "src/api/rest-server.test.ts": 2, + "src/api/router.test.ts": 1, "src/automation/control-flow.test.ts": 5, "src/automation/schemaless-node-config.test.ts": 1, - "src/automation/webhook.test.ts": 1, "src/compose-stacks-key-loss.test.ts": 7, - "src/compose-stacks.test.ts": 69, + "src/compose-stacks.test.ts": 8, "src/contracts/ai-service.test.ts": 1, "src/contracts/analytics-service.test.ts": 1, - "src/contracts/app-lifecycle-service.test.ts": 1, "src/contracts/automation-service.test.ts": 1, "src/contracts/core-service-contracts.test.ts": 15, "src/contracts/data-engine.test.ts": 1, - "src/contracts/export-service.test.ts": 3, "src/contracts/http-server.test.ts": 3, "src/contracts/logger.test.ts": 2, "src/contracts/metadata-service.test.ts": 2, - "src/contracts/package-service.test.ts": 11, + "src/contracts/package-service.test.ts": 2, "src/contracts/plugin-lifecycle-events.test.ts": 2, "src/contracts/security-service.test.ts": 1, - "src/contracts/seed-loader-service.test.ts": 4, "src/contracts/service-registry.test.ts": 7, "src/contracts/storage-service.test.ts": 1, "src/data/data-engine.test.ts": 6, - "src/data/datasource.test.ts": 1, "src/data/display-name.test.ts": 18, "src/data/driver-nosql.test.ts": 2, "src/data/driver-sql.test.ts": 1, "src/data/driver.test.ts": 11, "src/data/driver/memory.test.ts": 1, - "src/data/field.test.ts": 19, - "src/data/mapping.test.ts": 4, + "src/data/field.test.ts": 2, "src/data/object-strictness-batch20.test.ts": 2, "src/data/query.test.ts": 25, - "src/data/seed.test.ts": 1, - "src/identity/identity.test.ts": 1, - "src/identity/position.test.ts": 27, - "src/identity/scim.test.ts": 8, - "src/integration/connector.test.ts": 11, + "src/identity/scim.test.ts": 7, + "src/integration/connector.test.ts": 7, "src/kernel/activation-events-retirement.test.ts": 1, "src/kernel/cluster.test.ts": 2, - "src/kernel/events.test.ts": 14, - "src/kernel/manifest.test.ts": 16, "src/kernel/metadata-plugin.test.ts": 1, "src/kernel/public-auth-features.test.ts": 6, - "src/security/permission.test.ts": 28, - "src/security/sharing.test.ts": 1, "src/shared/metadata-collection.test.ts": 1, "src/stack.test.ts": 33, - "src/system/app-install.test.ts": 1, - "src/system/collaboration.test.ts": 6, - "src/system/deploy-bundle.test.ts": 3, + "src/system/collaboration.test.ts": 2, + "src/system/deploy-bundle.test.ts": 2, "src/system/disaster-recovery.test.ts": 3, "src/system/i18n-resolver.test.ts": 11, - "src/system/job.test.ts": 8, - "src/system/logging.test.ts": 15, - "src/system/metrics.test.ts": 15, + "src/system/logging.test.ts": 1, + "src/system/metrics.test.ts": 1, "src/system/object-storage.test.ts": 14, - "src/system/tenant.test.ts": 3, - "src/system/tracing.test.ts": 14, - "src/system/worker.test.ts": 11, - "src/ui/action.test.ts": 20, - "src/ui/app.test.ts": 19, - "src/ui/chart.test.ts": 5, + "src/system/tracing.test.ts": 1, + "src/system/worker.test.ts": 2, + "src/ui/action.test.ts": 1, + "src/ui/app.test.ts": 13, + "src/ui/chart.test.ts": 1, "src/ui/i18n.test.ts": 1, - "src/ui/page.test.ts": 1, "src/ui/report.test.ts": 3, - "src/ui/theme.test.ts": 6, - "src/ui/view.test.ts": 79, - "src/ui/widget.test.ts": 3 + "src/ui/view.test.ts": 8, + "src/ui/widget.test.ts": 1 } } diff --git a/scripts/analytics-reconcile/boot.ts b/scripts/analytics-reconcile/boot.ts index 5810dac84e..65e9c4b0f5 100644 --- a/scripts/analytics-reconcile/boot.ts +++ b/scripts/analytics-reconcile/boot.ts @@ -11,7 +11,7 @@ import { SqliteWasmDriver } from '@objectstack/driver-sqlite-wasm'; import { ObjectQLPlugin } from '@objectstack/objectql'; import { AnalyticsServicePlugin } from '@objectstack/service-analytics'; import { DatasetSchema } from '@objectstack/spec/ui'; -import type { Dataset, DatasetInput, Dashboard, Report } from '@objectstack/spec/ui'; +import type { Dataset, Dashboard, Report } from '@objectstack/spec/ui'; import type { IAnalyticsService, DatasetSelection } from '@objectstack/spec/contracts'; import type { FilterCondition } from '@objectstack/spec/data'; import { reconcileDashboard, reconcileReports, type ReconcileExecutors, type WidgetReconcileResult } from './reconcile.js'; @@ -34,8 +34,8 @@ export interface ReconcileAppOptions { dashboards: Dashboard[]; /** Reports to reconcile (each dual-form report is checked). */ reports?: Report[]; - /** Authored datasets (DatasetInput) the dashboards/reports reference by name. */ - datasets: DatasetInput[]; + /** Authored datasets (Dataset) the dashboards/reports reference by name. */ + datasets: Dataset[]; } /** Boot, reconcile every dashboard, print a report, and return the mismatch count. */ diff --git a/scripts/check-doc-authoring.mjs b/scripts/check-doc-authoring.mjs index 9d4c713263..40b0d4a95f 100644 --- a/scripts/check-doc-authoring.mjs +++ b/scripts/check-doc-authoring.mjs @@ -135,6 +135,11 @@ const DOMAINS = [ 'Mapping', 'Theme', 'TranslationBundle', 'Page', 'Action', ].join('|'); const NS = '(?:UI\\.|Data\\.|System\\.|Security\\.|Identity\\.|Automation\\.|Integration\\.)?'; +// The optional `Input` suffix is a LEGACY spelling as of protocol 17: ADR-0122 +// phase 2 (#6083) moved the author state onto the bare name and retired every +// `XInput` synonym of it. The arm stays anyway — this gate reads the corpus that +// gets pasted into app code, where a sample carrying the retired spelling is +// still the anti-pattern AND now names a type that no longer exists. const BARE = new RegExp(`^export const \\w+:\\s*${NS}(?:${DOMAINS})(?:Input)?\\s*=\\s*\\{`); const FENCE_OPEN = /^```(?:ts|typescript|tsx)\s*$/; const FENCE_CLOSE = /^```\s*$/; diff --git a/scripts/check-spec-parsed-alias.mjs b/scripts/check-spec-parsed-alias.mjs index 6999ef67d7..ade025dfee 100644 --- a/scripts/check-spec-parsed-alias.mjs +++ b/scripts/check-spec-parsed-alias.mjs @@ -2,7 +2,8 @@ // Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. /** - * ADR-0122 backflow guard — every schema with two shapes names both of them. + * ADR-0122 convention guard — the bare name is the AUTHOR state, `XParsed` is + * the parsed state, and neither gets a synonym. * * ## The failure this exists for * @@ -16,35 +17,60 @@ * and failed in the next. * * ADR-0122 settles it: the **bare name is the author state** and **`XParsed` is - * the parsed state**. Flipping 1384 aliases is a major-window change, so phase 1 - * moves in the one direction that breaks nothing — it declares `XParsed` - * wherever the parsed state is a distinct type, giving every consumer a name - * that survives the flip. This guard is what stops phase 1 from decaying between - * now and then. + * the parsed state**. Flipping 1384 aliases is a major-window change, so it + * landed in two phases: * - * ## What it checks + * - **Phase 1** (#5551 / PR #6072, a minor) declared `XParsed` wherever the + * parsed state is a distinct type, giving every consumer a name that survives + * the flip. This script's first shape guarded that coverage. + * - **Phase 2** (#6083, protocol 17) flipped all 1384 bare aliases to `z.input` + * and retired the 102 `XInput` aliases that the flip turned into literal + * synonyms of a bare name. * - * For every `export type X = z.infer` in - * `packages/spec/src/**\/*.zod.ts` whose name is BARE (does not already end in - * `Parsed` or `Input`), exactly one of these must hold: + * ## Why this guard was INVERTED rather than extended at phase 2 * - * 1. the same file also declares `export type XParsed = z.infer` - * — the schema's parsed state has its own name, so the phase-2 flip has a - * migration target; or - * 2. `XSchema` is pinned in `packages/spec/src/type-alias-convention.pin.test.ts` - * as isomorphic — `z.input` and `z.infer` are the same type, so the flip - * changes nothing observable and a second name would be a synonym an - * author can only pick wrongly. + * Phase 1's guard was written over the population "bare aliases that read + * `z.infer`". The flip empties that population, and a guard over an empty set is + * not a weaker guard — it is no guard at all. Worse, its two arms fail in + * opposite directions once the flip lands: the coverage arm goes silently green + * (0 findings over 0 aliases) while the stale-pin arm, which asks "does any bare + * `z.infer` alias still rely on this pin?", answers "no" for **all 719** pins and + * reports every one of them as stale. Both readings are wrong, and the second is + * the loud one: measured on the phase-2 tree, the phase-1 script reports 0 + * missing-parsed-alias and 719 stale-pin. * - * A new alias that is neither is exactly the backflow: it lands looking like - * every other alias and silently owes a migration target nobody will remember. + * So the population is re-pointed at the post-flip convention, and the flip + * itself becomes the thing that is checked. What the guard now says, for every + * `export type` in `packages/spec/src/**\/*.zod.ts`: + * + * 1. **A bare name may not read `z.infer`.** The bare name is the author state; + * an alias that reads `z.infer` is either an un-flipped survivor or a new + * declaration written in the retired dialect. This is the arm that replaces + * phase 1's, and it is the one that goes red if a phase-2 flip is reverted. + * 2. **A bare alias's schema must have its parsed state named, or be pinned.** + * Unchanged from phase 1 in substance, re-pointed at the flipped form: a + * bare `X = z.input` needs a sibling + * `XParsed = z.infer` unless `XSchema` is pinned isomorphic + * in `packages/spec/src/type-alias-convention.pin.test.ts`. + * 3. **A pin nobody relies on is stale** — same arm as phase 1, now keyed on + * the bare `z.input` aliases. + * 4. **`XInput` may not be a synonym of a bare name.** After the flip + * `export type XInput = z.input` denotes exactly what `X` + * denotes, and ADR-0122 D3 forbids a permanent synonym: it is a name an + * author can only pick wrongly. This arm is what stops the 102 retired + * `XInput` aliases from flowing back one file at a time. An `Input` name + * that is NOT such a synonym is untouched — `ExpressionInput` (the bare + * alias of `ExpressionInputSchema`), and the five composed types + * (`FormFieldInput`, `QueryInput`, `FieldInput`, + * `ObjectStackDefinitionInput`, `NavigationItemInput`) that build something + * no bare alias denotes. * * ## Why the pin file is the registry, and not a list in here * - * Option 2 is a claim about types, and a claim about types that only a comment - * asserts is the "declared but unenforced" shape this repo keeps paying to fix. - * Isomorphism also ROTS: add a `.default()` three levels down and an alias joins - * the shape-diff set with no signal at all. + * Rule 2's exemption is a claim about types, and a claim about types that only a + * comment asserts is the "declared but unenforced" shape this repo keeps paying + * to fix. Isomorphism also ROTS: add a `.default()` three levels down and an + * alias joins the shape-diff set with no signal at all. * * So the exemption list is not kept here — it is kept as compile-time assertions * in the pin file, where tsc proves every entry true on the same run that @@ -74,11 +100,16 @@ const SPEC_SRC = join(ROOT, 'packages/spec/src'); const PIN_FILE = join(SPEC_SRC, 'type-alias-convention.pin.test.ts'); /** - * `export type Name = z.infer;` — the declaration this guard is - * about. Whitespace and line breaks are tolerated because prettier wraps the - * long ones. + * `export type Name = z.input;` / `= z.infer;` — + * the two declarations this guard is about, matched in one pass so the arms can + * disagree about which side a name belongs on. Whitespace and line breaks are + * tolerated because prettier wraps the long ones. The trailing `;` is what keeps + * a composed type (`z.input & { ... }`) out of the corpus: those are + * not aliases of a schema's state, they are new types, and no arm here has + * anything to say about them. */ -const INFER_ALIAS = /export type ([A-Za-z0-9_]+)\s*=\s*z\.infer<\s*typeof ([A-Za-z0-9_]+)\s*>\s*;/g; +const STATE_ALIAS = + /export type ([A-Za-z0-9_]+)\s*=\s*z\.(input|infer)<\s*typeof ([A-Za-z0-9_]+)\s*>\s*;/g; /** A name is BARE when it claims neither state explicitly. */ function isBareName(name) { @@ -130,15 +161,59 @@ export function findViolations(files, pins) { const reliedOnPins = new Set(); for (const [file, source] of files) { - const parsedAliases = new Set(); - INFER_ALIAS.lastIndex = 0; - for (const m of source.matchAll(INFER_ALIAS)) { - if (m[1].endsWith('Parsed')) parsedAliases.add(`${m[1]}::${m[2]}`); - } - INFER_ALIAS.lastIndex = 0; - for (const m of source.matchAll(INFER_ALIAS)) { - const [, name, schema] = m; - if (!isBareName(name)) continue; + const decls = [...source.matchAll(STATE_ALIAS)].map((m) => ({ + name: m[1], + state: m[2], + schema: m[3], + })); + + /** `XParsed = z.infer` siblings, keyed `XParsed::XSchema`. */ + const parsedAliases = new Set( + decls + .filter((d) => d.name.endsWith('Parsed') && d.state === 'infer') + .map((d) => `${d.name}::${d.schema}`), + ); + /** Which schemas already have a bare alias in this file — rule 4's input. */ + const bareBySchema = new Map( + decls.filter((d) => isBareName(d.name)).map((d) => [d.schema, d.name]), + ); + + for (const { name, state, schema } of decls) { + // Rule 4 — an `XInput` that denotes exactly what a bare name denotes. + if (!isBareName(name)) { + if (name.endsWith('Input') && state === 'input' && bareBySchema.has(schema)) { + violations.push({ + kind: 'input-synonym', + file, + name, + schema, + message: + `\`${name}\` is a literal synonym of \`${bareBySchema.get(schema)}\` — since ` + + `ADR-0122 phase 2 the bare name IS \`z.input\`. D3 forbids a ` + + `permanent synonym: it is a name an author can only pick wrongly. Delete it and ` + + `use \`${bareBySchema.get(schema)}\`.`, + }); + } + continue; + } + + // Rule 1 — the flip itself. A bare name may not denote the parsed state. + if (state === 'infer') { + violations.push({ + kind: 'bare-name-is-parsed-state', + file, + name, + schema, + message: + `\`${name}\` names the PARSED state of \`${schema}\`, but ADR-0122 reserves the ` + + `bare name for the AUTHOR state. Write \`export type ${name} = z.input;\` and, if the two shapes differ, put the parsed state on ` + + `\`export type ${name}Parsed = z.infer;\` beside it.`, + }); + continue; + } + + // Rule 2 — the parsed state is named, or the schema is pinned isomorphic. const key = `${file}::${schema}`; if (parsedAliases.has(`${name}Parsed::${schema}`)) continue; if (pins.has(key)) { @@ -151,19 +226,19 @@ export function findViolations(files, pins) { name, schema, message: - `\`${name}\` names the PARSED state of \`${schema}\`, but ADR-0122 reserves the ` + - `bare name for the AUTHOR state. Declare \`export type ${name}Parsed = ` + - `z.infer;\` next to it so the phase-2 flip has a migration ` + - `target — or, if \`z.input\` and \`z.infer\` of \`${schema}\` are the same type, ` + - `pin it in packages/spec/src/type-alias-convention.pin.test.ts instead.`, + `\`${name}\` is the AUTHOR state of \`${schema}\` and nothing names its PARSED ` + + `state. Declare \`export type ${name}Parsed = z.infer;\` next to ` + + `it so a consumer holding a parse result has a name — or, if \`z.input\` and ` + + `\`z.infer\` of \`${schema}\` are the same type, pin it in ` + + `packages/spec/src/type-alias-convention.pin.test.ts instead.`, }); } } - // A pin that no longer describes a bare uncovered alias is stale: it either - // names a schema that gained an `XParsed` (so the pin is now dead weight) or a - // schema/alias that no longer exists. Left alone, a stale pin silently - // exempts a name that comes back later. + // Rule 3 — a pin that no longer describes a bare uncovered alias is stale: it + // either names a schema that gained an `XParsed` (so the pin is now dead + // weight) or a schema/alias that no longer exists. Left alone, a stale pin + // silently exempts a name that comes back later. for (const pin of pins) { if (!reliedOnPins.has(pin)) { const [file, schema] = pin.split('::'); @@ -172,9 +247,9 @@ export function findViolations(files, pins) { file, schema, message: - `\`${schema}\` is pinned as isomorphic in the ADR-0122 pin file, but no bare ` + - `\`z.infer\` alias in ${file} relies on that exemption any more. Delete the pin ` + - `line; the assertion is no longer load-bearing.`, + `\`${schema}\` is pinned as isomorphic in the ADR-0122 pin file, but no bare alias ` + + `in ${file} relies on that exemption any more. Delete the pin line; the assertion is ` + + `no longer load-bearing.`, }); } } @@ -195,6 +270,7 @@ function selfTest() { const check = (label, actual, expected) => { if (actual !== expected) failures.push(`${label}: expected ${expected}, got ${actual}`); }; + const kinds = (vs, kind) => vs.filter((v) => v.kind === kind).length; const pinSample = ` import type * as M0 from './demo/enum.zod.js'; @@ -204,14 +280,14 @@ export type Iso0 = Assert, z.infer< typeof check('pin parser reads one entry', pins.size, 1); check('pin parser keys by path::Schema', pins.has('demo/enum.zod.ts::ColourSchema'), true); - // GOOD: bare alias paired with its XParsed. + // GOOD: the post-flip shape — bare name is the author state, paired with XParsed. check( - 'paired alias passes', + 'flipped alias paired with its XParsed passes', findViolations( new Map([ [ 'demo/a.zod.ts', - 'export type Widget = z.infer;\n' + + 'export type Widget = z.input;\n' + 'export type WidgetParsed = z.infer;\n', ], ]), @@ -222,30 +298,58 @@ export type Iso0 = Assert, z.infer< typeof // GOOD: bare alias exempted by a pin. check( - 'pinned alias passes', + 'pinned flipped alias passes', findViolations( - new Map([['demo/enum.zod.ts', 'export type Colour = z.infer;\n']]), + new Map([['demo/enum.zod.ts', 'export type Colour = z.input;\n']]), new Set(['demo/enum.zod.ts::ColourSchema']), ).length, 0, ); - // BAD: bare alias with neither. - const bare = findViolations( - new Map([['demo/a.zod.ts', 'export type Widget = z.infer;\n']]), + // BAD (rule 1) — THE reversal arm. An un-flipped alias, or a phase-2 flip + // reverted, reads `z.infer` on a bare name and must be named. + const unflipped = findViolations( + new Map([ + [ + 'demo/a.zod.ts', + 'export type Widget = z.infer;\n' + + 'export type WidgetParsed = z.infer;\n', + ], + ]), new Set(), ); - check('unpaired, unpinned alias is reported', bare.length, 1); - check('...with the right kind', bare[0]?.kind, 'missing-parsed-alias'); - check('...naming the alias', bare[0]?.name, 'Widget'); + check('a bare z.infer alias is reported even when paired', kinds(unflipped, 'bare-name-is-parsed-state'), 1); + check('...naming the alias', unflipped[0]?.name, 'Widget'); + check( + 'a bare z.infer alias is reported even when pinned', + kinds( + findViolations( + new Map([['demo/enum.zod.ts', 'export type Colour = z.infer;\n']]), + new Set(['demo/enum.zod.ts::ColourSchema']), + ), + 'bare-name-is-parsed-state', + ), + 1, + ); + + // BAD (rule 2) — flipped, but the parsed state has no name and no pin. + const uncovered = findViolations( + new Map([['demo/a.zod.ts', 'export type Widget = z.input;\n']]), + new Set(), + ); + check('unpaired, unpinned alias is reported', kinds(uncovered, 'missing-parsed-alias'), 1); + check('...naming the alias', uncovered[0]?.name, 'Widget'); // BAD: the pin must be schema-accurate, not merely same-file. check( 'a pin on a different schema does not exempt', - findViolations( - new Map([['demo/a.zod.ts', 'export type Widget = z.infer;\n']]), - new Set(['demo/a.zod.ts::OtherSchema']), - ).filter((v) => v.kind === 'missing-parsed-alias').length, + kinds( + findViolations( + new Map([['demo/a.zod.ts', 'export type Widget = z.input;\n']]), + new Set(['demo/a.zod.ts::OtherSchema']), + ), + 'missing-parsed-alias', + ), 1, ); @@ -253,28 +357,66 @@ export type Iso0 = Assert, z.infer< typeof // shape, where a companion that names the wrong thing reads as coverage. check( 'an XParsed bound to another schema does not cover', + kinds( + findViolations( + new Map([ + [ + 'demo/a.zod.ts', + 'export type Widget = z.input;\n' + + 'export type WidgetParsed = z.infer;\n', + ], + ]), + new Set(), + ), + 'missing-parsed-alias', + ), + 1, + ); + + // BAD (rule 4) — the retired `XInput`, flowing back. + const synonym = findViolations( + new Map([ + [ + 'demo/a.zod.ts', + 'export type Widget = z.input;\n' + + 'export type WidgetParsed = z.infer;\n' + + 'export type WidgetInput = z.input;\n', + ], + ]), + new Set(), + ); + check('an XInput synonym of a bare name is reported', kinds(synonym, 'input-synonym'), 1); + check('...naming the synonym', synonym.find((v) => v.kind === 'input-synonym')?.name, 'WidgetInput'); + + // GOOD: an `Input` name that is the bare alias of an `...InputSchema` is not a + // synonym of anything — `shared/expression.zod.ts` is the live case. + check( + 'the bare alias of an InputSchema is not a synonym', findViolations( new Map([ [ - 'demo/a.zod.ts', - 'export type Widget = z.infer;\n' + - 'export type WidgetParsed = z.infer;\n', + 'demo/expr.zod.ts', + 'export type ExpressionInput = z.input;\n', ], ]), new Set(), - ).filter((v) => v.kind === 'missing-parsed-alias').length, - 1, + ).length, + 0, ); - // Names that already declare their state are not this guard's business. + // GOOD: a composed type built ON z.input is not a state alias at all — no + // trailing `;` after the `>`, so it never enters the corpus. check( - 'XInput and XParsed declarations are not themselves bare aliases', + 'a composed Input type is not matched', findViolations( new Map([ [ - 'demo/a.zod.ts', - 'export type WidgetInput = z.input;\n' + - 'export type WidgetParsed = z.infer;\n', + 'demo/form.zod.ts', + 'export type FormField = z.input;\n' + + 'export type FormFieldParsed = z.infer;\n' + + 'export type FormFieldInput = z.input & {\n' + + ' fields?: FormFieldInput[];\n' + + '};\n', ], ]), new Set(), @@ -287,7 +429,7 @@ export type Iso0 = Assert, z.infer< typeof new Map([ [ 'demo/a.zod.ts', - 'export type Widget = z.infer;\n' + + 'export type Widget = z.input;\n' + 'export type WidgetParsed = z.infer;\n', ], ]), @@ -303,7 +445,7 @@ export type Iso0 = Assert, z.infer< typeof new Map([ [ 'demo/a.zod.ts', - 'export type VeryLongWidgetName =\n z.infer<\n typeof VeryLongWidgetNameSchema\n >;\n', + 'export type VeryLongWidgetName =\n z.input<\n typeof VeryLongWidgetNameSchema\n >;\n', ], ]), new Set(), @@ -316,7 +458,7 @@ export type Iso0 = Assert, z.infer< typeof for (const f of failures) console.error(' - ' + f); process.exit(1); } - console.log('check-spec-parsed-alias --self-test: 11 assertions passed'); + console.log('check-spec-parsed-alias --self-test: 18 assertions passed'); } if (process.argv.includes('--self-test')) { @@ -340,11 +482,11 @@ if (process.argv.includes('--self-test')) { const bareCount = [...files.values()].reduce((n, src) => { let c = 0; - for (const m of src.matchAll(INFER_ALIAS)) if (isBareName(m[1])) c++; + for (const m of src.matchAll(STATE_ALIAS)) if (isBareName(m[1])) c++; return n + c; }, 0); console.log( - `ADR-0122 type-alias convention: ${bareCount} bare z.infer aliases, ` + + `ADR-0122 type-alias convention: ${bareCount} bare z.input aliases, ` + `${pins.size} pinned isomorphic, ${bareCount - pins.size} paired with an XParsed. OK`, ); } diff --git a/skills/objectstack-api/SKILL.md b/skills/objectstack-api/SKILL.md index 40d04d7135..914d341fb3 100644 --- a/skills/objectstack-api/SKILL.md +++ b/skills/objectstack-api/SKILL.md @@ -169,10 +169,10 @@ declarative and the logic in the automation surface that already runs it. ```typescript -import type { ApiEndpointInput } from '@objectstack/spec/api'; +import type { ApiEndpoint } from '@objectstack/spec/api'; // The stack declares `manifest: { namespace: 'acme', … }` — required, see below. -export const leadFeed: ApiEndpointInput = { +export const leadFeed: ApiEndpoint = { name: 'acme_lead_feed', path: '/api/v1/apps/acme/leads', // /api/v1/apps// method: 'GET',