@cosmicdrift/kumiko-types 0.316.0 → 0.318.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/entity-handlers.ts +12 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.318.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/entity-handlers.ts
CHANGED
|
@@ -25,6 +25,15 @@ export type EntityHandlerOptions = {
|
|
|
25
25
|
readonly crossTenant?: boolean;
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
+
/** Options for the generic create/update handlers. */
|
|
29
|
+
export type EntityWriteHandlerOptions = EntityHandlerOptions & {
|
|
30
|
+
/** Fields this handler never writes. They leave the payload schema as
|
|
31
|
+
* "must be absent": a payload that still carries one fails validation
|
|
32
|
+
* instead of being stripped silently. create rejects a required field
|
|
33
|
+
* without default here, since the row could never be created. */
|
|
34
|
+
readonly excludeFields?: readonly string[];
|
|
35
|
+
};
|
|
36
|
+
|
|
28
37
|
export type EntityQueryHandlerOptions = EntityHandlerOptions;
|
|
29
38
|
|
|
30
39
|
export type EntityCrudVerb = "create" | "update" | "delete" | "restore" | "list" | "detail";
|
|
@@ -44,6 +53,9 @@ export type RegisterEntityCrudOptions = {
|
|
|
44
53
|
* manifest exposes only the verbs described here (fail-closed, same rule as
|
|
45
54
|
* hand-written handlers). Falls back to `write.description`/`read.description`. */
|
|
46
55
|
readonly descriptions?: Partial<Record<EntityCrudVerb, string>>;
|
|
56
|
+
/** Per-verb `excludeFields` for the generic create/update handlers — see
|
|
57
|
+
* EntityWriteHandlerOptions. */
|
|
58
|
+
readonly excludeFields?: Partial<Record<"create" | "update", readonly string[]>>;
|
|
47
59
|
/** Default true. Set false when the entity was already registered (e.g. before r.relation). */
|
|
48
60
|
readonly registerEntity?: boolean;
|
|
49
61
|
};
|