@cosmicdrift/kumiko-types 0.371.1 → 0.372.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.
@@ -21,7 +21,7 @@ export type LockGuardOption = {
21
21
  readonly unsafeSkipLockGuard?: boolean;
22
22
  readonly writePurpose?: WritePurpose;
23
23
  };
24
- export type EventStoreExecutor = {
24
+ export type EventStoreExecutor<Row extends Record<string, unknown> = Record<string, unknown>> = {
25
25
  create: (payload: Record<string, unknown>, user: SessionUser, db: TenantDb, options?: StreamTenantOption & {
26
26
  preSave?: PreSaveRunner;
27
27
  }) => Promise<WriteResult<SaveContext>>;
@@ -90,10 +90,10 @@ export type EventStoreExecutor = {
90
90
  readonly resolveEntity: (entityName: string) => EntityDefinition | undefined;
91
91
  };
92
92
  readonly parentVisibility?: ParentVisibilityOption;
93
- }) => Promise<CursorResult<Record<string, unknown>>>;
93
+ }) => Promise<CursorResult<Row>>;
94
94
  detail: (payload: {
95
95
  id: EntityId;
96
96
  }, user: SessionUser, db: TenantDb, options?: {
97
97
  readonly parentVisibility?: ParentVisibilityOption;
98
- }) => Promise<Record<string, unknown> | null>;
98
+ }) => Promise<Row | null>;
99
99
  };
@@ -15,4 +15,6 @@ export type FileContext = {
15
15
  readonly storageKey: string;
16
16
  }): Promise<readonly string[]>;
17
17
  list(prefix: string): Promise<readonly string[]>;
18
+ writeUploadBytes(key: string, data: Uint8Array, mimeType: string): Promise<void>;
19
+ forgetUploadBytes(key: string): Promise<void>;
18
20
  };
@@ -1,3 +1,9 @@
1
1
  import type { FileStorageProvider } from "./file-storage-provider-types.ts";
2
2
  import type { TenantId } from "./identifiers.ts";
3
- export type FileProviderResolver = (tenantId: TenantId) => Promise<FileStorageProvider>;
3
+ export type FileUploadLedger = {
4
+ record(storageKey: string): Promise<void>;
5
+ forget(storageKey: string): Promise<void>;
6
+ };
7
+ export type FileProviderResolver = ((tenantId: TenantId) => Promise<FileStorageProvider>) & {
8
+ readonly uploadLedgerFor?: (tenantId: TenantId) => FileUploadLedger;
9
+ };
@@ -49,7 +49,7 @@ export type TenantDb = {
49
49
  aggregate(table: SchemaTable | EntityTableMeta, spec: AggregateSpec, where?: WhereObject): Promise<readonly AggregateRow[]>;
50
50
  insertOne<T = Record<string, unknown>>(table: WritableTable, values: Record<string, unknown>): Promise<T | undefined>;
51
51
  updateMany<T = Record<string, unknown>>(table: WritableTable, set: Record<string, unknown>, where: WhereObject): Promise<readonly T[]>;
52
- deleteMany(table: WritableTable, where: WhereObject): Promise<void>;
52
+ deleteMany(table: WritableTable, where: WhereObject): Promise<number>;
53
53
  };
54
54
  export declare const SYSTEM_SCOPE_CHECK_BRAND: unique symbol;
55
55
  export type UncheckedSystemDb = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-types",
3
- "version": "0.371.1",
3
+ "version": "0.372.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>",