@cosmicdrift/kumiko-types 0.355.0 → 0.356.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.
@@ -13,7 +13,7 @@ export type StreamTenantOption = {
13
13
  readonly streamTenantId?: TenantId | undefined;
14
14
  };
15
15
  export type EventStoreExecutor = {
16
- create: (payload: Record<string, unknown>, user: SessionUser, db: TenantDb, options?: {
16
+ create: (payload: Record<string, unknown>, user: SessionUser, db: TenantDb, options?: StreamTenantOption & {
17
17
  preSave?: PreSaveRunner;
18
18
  }) => Promise<WriteResult<SaveContext>>;
19
19
  update: (payload: {
@@ -183,6 +183,10 @@ export type EscapeHatchUseEvent = {
183
183
  };
184
184
  export type EscapeHatchAuditSink = (event: EscapeHatchUseEvent) => Promise<void>;
185
185
  export type EscapeHatchReporter = (kind: EscapeHatchKind, reason: string, target?: EscapeHatchTarget) => void;
186
+ export type TenantWriteTarget = {
187
+ readonly db: TenantDb;
188
+ readonly streamTenantId: TenantId | undefined;
189
+ };
186
190
  type SharedContextFields = {
187
191
  readonly redis?: Redis;
188
192
  readonly cacheSync?: CacheSyncBus;
@@ -197,6 +201,15 @@ type SharedContextFields = {
197
201
  * the config feature wired its accessor factory.
198
202
  */
199
203
  readonly configFor?: (tenantId: TenantId) => ConfigAccessor;
204
+ /**
205
+ * Write target for ANOTHER tenant: a tenant-mode db bound to it plus the
206
+ * `streamTenantId` to hand the executor, so the event actor stays the
207
+ * operator. Cross-tenant calls throw AccessDeniedError unless the caller is
208
+ * SystemAdmin (the tenantIdOverride gate); the caller's own tenant needs no
209
+ * privilege and yields `streamTenantId: undefined`. Write handlers only;
210
+ * absent for r.systemScope() handlers and without a db.
211
+ */
212
+ readonly forTenant?: (tenantId: TenantId) => TenantWriteTarget;
200
213
  readonly _configAccessorFactory?: ConfigAccessorFactory;
201
214
  readonly configEncryption?: import("./envelope-cipher-types.js").EnvelopeCipher;
202
215
  readonly rateLimit?: import("./rate-limit-types.js").RateLimitResolver;
package/dist/screen.d.ts CHANGED
@@ -1299,16 +1299,24 @@ export type EntityEditScreenDefinition = {
1299
1299
  * das `mask.title`-Label des Config-Keys. Fehlt ein Eintrag, gilt die
1300
1300
  * Konvention. */
1301
1301
  readonly fieldLabels?: Readonly<Record<string, string>>;
1302
- /** Header action buttons. Reuses `RowAction` — analogous to
1302
+ /** Record actions. Reuses `RowAction` — analogous to
1303
1303
  * `ProjectionDetailScreenDefinition.actions` (the loaded record stands
1304
1304
  * in for the "row"). `rowClick` has no target here and is rejected by
1305
1305
  * the boot-validator, same as on projectionDetail. Not rendered in
1306
1306
  * create mode — every action targets an existing record, which the
1307
- * create branch doesn't have yet. */
1308
- readonly actions?: readonly RowAction[];
1307
+ * create branch doesn't have yet. By default an action renders with the
1308
+ * secondary form actions (footer, next to copy-link/delete/cancel);
1309
+ * `placement: "menu"` moves it into the header "…" menu, ahead of
1310
+ * copy-link/delete. Without a header menu (drawer, card form, shell
1311
+ * without a header slot) a "menu" action falls back to inline. */
1312
+ readonly actions?: readonly EntityEditAction[];
1309
1313
  readonly slots?: ScreenSlots;
1310
1314
  readonly access?: AccessRule;
1311
1315
  };
1316
+ export type EntityEditActionPlacement = "inline" | "menu";
1317
+ export type EntityEditAction = RowAction & {
1318
+ readonly placement?: EntityEditActionPlacement;
1319
+ };
1312
1320
  export type ActionFormScreenDefinition = {
1313
1321
  readonly id: string;
1314
1322
  readonly type: "actionForm";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-types",
3
- "version": "0.355.0",
3
+ "version": "0.356.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>",