@cosmicdrift/kumiko-types 0.200.1 → 0.202.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/handlers.ts +4 -1
- package/src/screen.ts +8 -1
- package/src/tenant-db-types.ts +10 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.202.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/handlers.ts
CHANGED
|
@@ -364,7 +364,10 @@ export type HandlerContext<TMap extends object = KumikoEventTypeMap> = SharedCon
|
|
|
364
364
|
// Same tenant scoping as `db`, but never bound to the handler's tx: writes
|
|
365
365
|
// through it survive a rollback, for side effects that already happened
|
|
366
366
|
// outside the DB. `undefined` when the pipeline has no outside-tx source
|
|
367
|
-
// for this dispatch (see dispatch-shared.ts) — callers must check before
|
|
367
|
+
// for this dispatch (see dispatch-shared.ts) — callers must check before
|
|
368
|
+
// use. For r.systemScope() handlers this is fail-closed instead, same as
|
|
369
|
+
// `db` above — a truthy Proxy that throws on first property read, so a
|
|
370
|
+
// system handler must reach for `systemDb.outsideTransaction` below.
|
|
368
371
|
readonly dbOutsideTransaction: TenantDb | undefined;
|
|
369
372
|
// Only present for r.systemScope() handlers. Non-system handlers never
|
|
370
373
|
// receive this — reach for `db` instead, which is fail-closed for them.
|
package/src/screen.ts
CHANGED
|
@@ -806,6 +806,13 @@ export type ScreenNavSugar = {
|
|
|
806
806
|
readonly order?: number;
|
|
807
807
|
};
|
|
808
808
|
|
|
809
|
+
// `detailFor` sits on the intersection, not on one variant, because any
|
|
810
|
+
// screen kind can be the detail view for an entity — including `custom`:
|
|
811
|
+
// in app repos, detail screens are overwhelmingly custom screens today
|
|
812
|
+
// (projectionDetail doesn't carry entity semantics). Value is an entity
|
|
813
|
+
// name in the same (unqualified, globally-unique) form as `entity` on
|
|
814
|
+
// `EntityListScreenDefinition` (screen.ts:259-262) — entities are never
|
|
815
|
+
// feature-prefixed, so there's no separate qualification step.
|
|
809
816
|
export type ScreenDefinition = (
|
|
810
817
|
| EntityListScreenDefinition
|
|
811
818
|
| ProjectionListScreenDefinition
|
|
@@ -815,4 +822,4 @@ export type ScreenDefinition = (
|
|
|
815
822
|
| ActionFormScreenDefinition
|
|
816
823
|
| ConfigEditScreenDefinition
|
|
817
824
|
| CustomScreenDefinition
|
|
818
|
-
) & { readonly nav?: ScreenNavSugar };
|
|
825
|
+
) & { readonly nav?: ScreenNavSugar; readonly detailFor?: string };
|
package/src/tenant-db-types.ts
CHANGED
|
@@ -68,4 +68,14 @@ export type UncheckedSystemDb = {
|
|
|
68
68
|
assertTenantMatch(tenantId: TenantId): TenantDb;
|
|
69
69
|
assertRowsTenant<T>(rows: readonly T[], tenantField: keyof T): readonly T[];
|
|
70
70
|
acknowledgeCrossTenant(reason: string): TenantDb;
|
|
71
|
+
// Same self-check pair as above, but hands back the caller's
|
|
72
|
+
// ctx.dbOutsideTransaction TenantDb instead of the in-tx one — for
|
|
73
|
+
// durability writes that must survive a rollback of the handler's own
|
|
74
|
+
// transaction. Throws if the dispatch has no outside-transaction source
|
|
75
|
+
// configured (e.g. a hand-built UncheckedSystemDb that only ever passed
|
|
76
|
+
// the in-tx db to createUncheckedSystemDb).
|
|
77
|
+
readonly outsideTransaction: {
|
|
78
|
+
assertTenantMatch(tenantId: TenantId): TenantDb;
|
|
79
|
+
acknowledgeCrossTenant(reason: string): TenantDb;
|
|
80
|
+
};
|
|
71
81
|
};
|