@cosmicdrift/kumiko-types 0.225.0 → 0.226.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 +1 -1
- package/src/define-handler.ts +7 -0
- package/src/feature.ts +1 -1
- package/src/handlers.ts +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.226.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>",
|
package/src/define-handler.ts
CHANGED
|
@@ -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 = {
|