@cosmicdrift/kumiko-types 0.225.0 → 0.227.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-types",
3
- "version": "0.225.0",
3
+ "version": "0.227.0",
4
4
  "description": "Framework-Type-Definitions für Kumiko — FeatureDefinition, BootCheck-Types und die reinen Engine-Types. Erlaubt Downstream-Konsumenten, gegen die Type-Contracts zu bauen, ohne das ganze Framework-Package zu importieren. Enthaelt keine identitaets-sensitiven Runtime-Werte mehr (Error-Klassen leben seit #1629 in kumiko-framework, Brand-Symbole nutzen Symbol.for) und ist deshalb eine plain dependency, keine peerDependency.",
5
5
  "license": "BUSL-1.1",
6
6
  "author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
@@ -91,6 +91,13 @@ export type QueryHandlerDefinition<
91
91
  query: QueryEvent<z.infer<TSchema>>,
92
92
  context: HandlerContext<TMap>,
93
93
  ) => Promise<TResult>;
94
+ /** Zod schema of `handler`'s actual return value — see QueryHandlerDef's
95
+ * doc (handlers.ts) for the boot-validator checks this unlocks. Not
96
+ * inferred from `TResult`: TResult is a compile-time-only type param
97
+ * (this function never receives a runtime schema for it), so callers
98
+ * that want boot-time column checks declare `outputSchema` explicitly,
99
+ * same as `schema` for the input side. */
100
+ readonly outputSchema?: ZodType;
94
101
  };
95
102
 
96
103
  // --- Stream Handler Definition ---
package/src/feature.ts CHANGED
@@ -463,7 +463,7 @@ export type FeatureRegistrar<TFeature extends string = string> = {
463
463
  name: string,
464
464
  schema: TSchema,
465
465
  handler: QueryHandlerFn<z.infer<TSchema>>,
466
- options?: { access?: AccessRule; rateLimit?: RateLimitOption },
466
+ options?: { access?: AccessRule; rateLimit?: RateLimitOption; outputSchema?: ZodType },
467
467
  ): HandlerRef;
468
468
 
469
469
  streamHandler<TName extends string, TSchema extends ZodType>(
package/src/handlers.ts CHANGED
@@ -952,6 +952,15 @@ export type QueryHandlerDef = {
952
952
  readonly handler: QueryHandlerFn;
953
953
  readonly access?: AccessRule;
954
954
  readonly rateLimit?: RateLimitOption;
955
+ /** Zod schema of the handler's actual return value — the paged envelope
956
+ * `{ rows, nextCursor, total? }` for a `definePagedQueryHandler`, or the
957
+ * flat record (optionally `.nullable()`) for a plain query handler.
958
+ * Optional and purely additive: absent on every existing handler, and
959
+ * the boot-validator skips any column-reference check that would need
960
+ * it (screens.ts projectionList/relatedList `columns`, projectionDetail
961
+ * `header`/`metrics`, dashboard `valueField`/`subField`/etc.) rather
962
+ * than requiring it retroactively. See fw#2493. */
963
+ readonly outputSchema?: ZodType;
955
964
  };
956
965
 
957
966
  export type StreamHandlerDef = {
package/src/screen.ts CHANGED
@@ -689,6 +689,12 @@ export type EditExtensionSection = {
689
689
  * writes (e.g. notes-history NotesSection) — otherwise a read-only form
690
690
  * shows a Save button that does nothing (fw#2359). */
691
691
  readonly contributesToFormSubmit?: boolean;
692
+ /** Overrides the host-derived entity name passed to the mounted component.
693
+ * Required on `projectionDetail` (which has no real entity — the host
694
+ * value there is an internal placeholder) so a self-persisting extension
695
+ * like NotesSection filters/writes against the right domain entity. Takes
696
+ * precedence over the host value on every screen type. */
697
+ readonly entityName?: string;
692
698
  };
693
699
 
694
700
  // Read-only list of related records, driven by its own query — for a