@cosmicdrift/kumiko-types 0.327.0 → 0.328.1
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/dist/action-icon.d.ts +3 -0
- package/dist/action-icon.js +51 -0
- package/{src/agent-exposure.ts → dist/agent-exposure.d.ts} +8 -15
- package/dist/agent-exposure.js +16 -0
- package/dist/concurrency-mode.d.ts +1 -0
- package/dist/config-scope.d.ts +1 -0
- package/dist/config-scope.js +1 -0
- package/dist/config.d.ts +234 -0
- package/dist/config.js +1 -0
- package/dist/cursor-types.d.ts +16 -0
- package/dist/cursor-types.js +1 -0
- package/dist/db-connection.d.ts +14 -0
- package/dist/db-connection.js +1 -0
- package/dist/define-handler.d.ts +58 -0
- package/dist/define-handler.js +1 -0
- package/dist/derivatives-types.d.ts +53 -0
- package/dist/derivatives-types.js +3 -0
- package/dist/entity-cache.d.ts +16 -0
- package/dist/entity-cache.js +1 -0
- package/dist/entity-handlers.d.ts +54 -0
- package/dist/entity-handlers.js +1 -0
- package/dist/entity-table-meta-types.d.ts +44 -0
- package/dist/entity-table-meta-types.js +6 -0
- package/dist/envelope-cipher-types.d.ts +5 -0
- package/dist/envelope-cipher-types.js +1 -0
- package/dist/event-store-executor-types.d.ts +86 -0
- package/dist/event-store-executor-types.js +1 -0
- package/dist/event-store-types.d.ts +37 -0
- package/dist/event-store-types.js +7 -0
- package/dist/event-type-map.d.ts +8 -0
- package/{src/event-type-map.ts → dist/event-type-map.js} +1 -16
- package/dist/executor-brand.d.ts +8 -0
- package/dist/executor-brand.js +1 -0
- package/dist/extension-options-map.d.ts +9 -0
- package/dist/extension-options-map.js +4 -0
- package/dist/feature.d.ts +518 -0
- package/dist/feature.js +1 -0
- package/dist/field-icon.d.ts +1 -0
- package/dist/field-icon.js +1 -0
- package/dist/fields.d.ts +729 -0
- package/dist/fields.js +50 -0
- package/dist/file-handle-types.d.ts +12 -0
- package/dist/file-handle-types.js +1 -0
- package/dist/file-provider-resolver-types.d.ts +3 -0
- package/dist/file-provider-resolver-types.js +1 -0
- package/dist/file-storage-provider-types.d.ts +17 -0
- package/dist/file-storage-provider-types.js +1 -0
- package/dist/geo-tz.d.ts +17 -0
- package/{src/geo-tz.ts → dist/geo-tz.js} +1 -20
- package/dist/handlers.d.ts +493 -0
- package/dist/handlers.js +49 -0
- package/dist/hook-phase.d.ts +1 -0
- package/dist/hook-phase.js +1 -0
- package/dist/hooks.d.ts +75 -0
- package/dist/hooks.js +1 -0
- package/dist/http-route.d.ts +52 -0
- package/dist/http-route.js +13 -0
- package/dist/identifiers.d.ts +8 -0
- package/{src/identifiers.ts → dist/identifiers.js} +7 -24
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/kms-adapter-types.d.ts +68 -0
- package/dist/kms-adapter-types.js +49 -0
- package/dist/logger.d.ts +7 -0
- package/dist/logger.js +1 -0
- package/dist/multi-stream-apply-context-types.d.ts +18 -0
- package/dist/multi-stream-apply-context-types.js +1 -0
- package/dist/nav-icon.d.ts +3 -0
- package/dist/nav-icon.js +100 -0
- package/dist/nav.d.ts +39 -0
- package/dist/nav.js +1 -0
- package/dist/observability/index.d.ts +3 -0
- package/dist/observability/index.js +2 -0
- package/dist/observability/metric.d.ts +34 -0
- package/dist/observability/metric.js +3 -0
- package/dist/observability/provider.d.ts +24 -0
- package/dist/observability/provider.js +4 -0
- package/dist/observability/span.d.ts +32 -0
- package/dist/observability/span.js +4 -0
- package/dist/ownership.d.ts +33 -0
- package/dist/ownership.js +5 -0
- package/dist/projection.d.ts +38 -0
- package/dist/projection.js +1 -0
- package/dist/rate-limit-types.d.ts +19 -0
- package/dist/rate-limit-types.js +1 -0
- package/dist/relations.d.ts +25 -0
- package/dist/relations.js +1 -0
- package/dist/schema-table-types.d.ts +15 -0
- package/{src/schema-table-types.ts → dist/schema-table-types.js} +0 -20
- package/dist/screen.d.ts +1265 -0
- package/dist/screen.js +3 -0
- package/dist/search-adapter.d.ts +32 -0
- package/dist/search-adapter.js +1 -0
- package/dist/secrets-types.d.ts +52 -0
- package/dist/secrets-types.js +30 -0
- package/dist/snapshot-types.d.ts +13 -0
- package/dist/snapshot-types.js +1 -0
- package/dist/step.d.ts +304 -0
- package/dist/step.js +11 -0
- package/dist/target-ref.d.ts +5 -0
- package/{src/target-ref.ts → dist/target-ref.js} +1 -6
- package/dist/tenancy-brand.d.ts +6 -0
- package/dist/tenancy-brand.js +1 -0
- package/dist/tenant-db-types.d.ts +67 -0
- package/dist/tenant-db-types.js +5 -0
- package/dist/tree-node.d.ts +26 -0
- package/dist/tree-node.js +22 -0
- package/dist/tz-context.d.ts +48 -0
- package/dist/tz-context.js +6 -0
- package/dist/websocket-route.d.ts +46 -0
- package/dist/websocket-route.js +10 -0
- package/dist/where-clause-types.d.ts +20 -0
- package/dist/where-clause-types.js +1 -0
- package/dist/workspace.d.ts +10 -0
- package/dist/workspace.js +1 -0
- package/dist/write-error-info-types.d.ts +12 -0
- package/dist/write-error-info-types.js +1 -0
- package/package.json +372 -124
- package/src/changes.json +18 -0
- package/src/__tests__/handlers.test.ts +0 -40
- package/src/__tests__/plural-forms.test.ts +0 -18
- package/src/action-icon.ts +0 -57
- package/src/concurrency-mode.ts +0 -5
- package/src/config-scope.ts +0 -5
- package/src/config.ts +0 -563
- package/src/cursor-types.ts +0 -18
- package/src/db-connection.ts +0 -25
- package/src/define-handler.ts +0 -138
- package/src/derivatives-types.ts +0 -106
- package/src/entity-cache.ts +0 -35
- package/src/entity-handlers.ts +0 -68
- package/src/entity-table-meta-types.ts +0 -101
- package/src/envelope-cipher-types.ts +0 -6
- package/src/event-store-executor-types.ts +0 -163
- package/src/event-store-types.ts +0 -85
- package/src/executor-brand.ts +0 -19
- package/src/extension-options-map.ts +0 -21
- package/src/feature.ts +0 -1141
- package/src/field-icon.ts +0 -23
- package/src/fields.ts +0 -1114
- package/src/file-handle-types.ts +0 -20
- package/src/file-provider-resolver-types.ts +0 -7
- package/src/file-storage-provider-types.ts +0 -54
- package/src/handlers.ts +0 -1246
- package/src/hook-phase.ts +0 -2
- package/src/hooks.ts +0 -170
- package/src/http-route.ts +0 -78
- package/src/kms-adapter-types.ts +0 -128
- package/src/logger.ts +0 -7
- package/src/multi-stream-apply-context-types.ts +0 -52
- package/src/nav-icon.ts +0 -105
- package/src/nav.ts +0 -139
- package/src/observability/index.ts +0 -28
- package/src/observability/metric.ts +0 -56
- package/src/observability/provider.ts +0 -32
- package/src/observability/span.ts +0 -58
- package/src/ownership.ts +0 -83
- package/src/projection.ts +0 -170
- package/src/rate-limit-types.ts +0 -32
- package/src/relations.ts +0 -52
- package/src/screen.ts +0 -1593
- package/src/search-adapter.ts +0 -45
- package/src/secrets-types.ts +0 -182
- package/src/snapshot-types.ts +0 -36
- package/src/step.ts +0 -390
- package/src/tenancy-brand.ts +0 -9
- package/src/tenant-db-types.ts +0 -116
- package/src/tree-node.ts +0 -134
- package/src/tz-context.ts +0 -63
- package/src/websocket-route.ts +0 -68
- package/src/where-clause-types.ts +0 -31
- package/src/workspace.ts +0 -42
- package/src/write-error-info-types.ts +0 -20
- /package/{src/index.ts → dist/concurrency-mode.js} +0 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { CursorResult } from "./cursor-types.js";
|
|
2
|
+
import type { EntityDefinition } from "./fields.js";
|
|
3
|
+
import type { SessionUser, WriteResult } from "./handlers.js";
|
|
4
|
+
import type { DeleteContext, SaveContext } from "./hooks.js";
|
|
5
|
+
import type { EntityId } from "./identifiers.js";
|
|
6
|
+
import type { SearchAdapter } from "./search-adapter.js";
|
|
7
|
+
import type { TenantDb } from "./tenant-db-types.js";
|
|
8
|
+
export type ParentVisibilityOption = {
|
|
9
|
+
readonly entities: ReadonlyMap<string, EntityDefinition>;
|
|
10
|
+
};
|
|
11
|
+
export type PreSaveRunner = (changes: Record<string, unknown>, previous: Readonly<Record<string, unknown>>, isNew: boolean) => Promise<Record<string, unknown>>;
|
|
12
|
+
export type EventStoreExecutor = {
|
|
13
|
+
create: (payload: Record<string, unknown>, user: SessionUser, db: TenantDb, options?: {
|
|
14
|
+
preSave?: PreSaveRunner;
|
|
15
|
+
}) => Promise<WriteResult<SaveContext>>;
|
|
16
|
+
update: (payload: {
|
|
17
|
+
id: EntityId;
|
|
18
|
+
version?: number | undefined;
|
|
19
|
+
changes: Record<string, unknown>;
|
|
20
|
+
}, user: SessionUser, db: TenantDb, options?: {
|
|
21
|
+
skipOptimisticLock?: boolean;
|
|
22
|
+
skipUnchanged?: boolean;
|
|
23
|
+
preSave?: PreSaveRunner;
|
|
24
|
+
expect?: Readonly<Record<string, string | number | boolean | null>>;
|
|
25
|
+
}) => Promise<WriteResult<SaveContext>>;
|
|
26
|
+
delete: (payload: {
|
|
27
|
+
id: EntityId;
|
|
28
|
+
}, user: SessionUser, db: TenantDb) => Promise<WriteResult<DeleteContext>>;
|
|
29
|
+
forget: (payload: {
|
|
30
|
+
id: EntityId;
|
|
31
|
+
}, user: SessionUser, db: TenantDb) => Promise<WriteResult<DeleteContext>>;
|
|
32
|
+
restore: (payload: {
|
|
33
|
+
id: EntityId;
|
|
34
|
+
}, user: SessionUser, db: TenantDb) => Promise<WriteResult<SaveContext>>;
|
|
35
|
+
list: (payload: {
|
|
36
|
+
cursor?: string | undefined;
|
|
37
|
+
limit?: number | undefined;
|
|
38
|
+
search?: string | undefined;
|
|
39
|
+
sort?: string | undefined;
|
|
40
|
+
sortDirection?: "asc" | "desc" | undefined;
|
|
41
|
+
offset?: number | undefined;
|
|
42
|
+
totalCount?: boolean | undefined;
|
|
43
|
+
filter?: {
|
|
44
|
+
readonly field: string;
|
|
45
|
+
readonly op: "eq" | "ne" | "lt" | "gt" | "lte" | "gte" | "in";
|
|
46
|
+
readonly value: unknown;
|
|
47
|
+
} | undefined;
|
|
48
|
+
filters?: ReadonlyArray<{
|
|
49
|
+
readonly field: string;
|
|
50
|
+
readonly op: "eq" | "ne" | "lt" | "gt" | "lte" | "gte" | "in";
|
|
51
|
+
readonly value: unknown;
|
|
52
|
+
}> | undefined;
|
|
53
|
+
}, user: SessionUser, db: TenantDb,
|
|
54
|
+
/** Tier 2.7e audit fix: per-call SearchAdapter override. When the
|
|
55
|
+
* executor didn't get a SearchAdapter via Options at build time
|
|
56
|
+
* (defaultEntityQueryHandler path), the caller (handler) can pass
|
|
57
|
+
* one from ctx.searchAdapter here at runtime.
|
|
58
|
+
* options.searchAdapter (build-time) wins — the runtime override
|
|
59
|
+
* is the fallback for the default wrapper. */
|
|
60
|
+
runtimeOptions?: {
|
|
61
|
+
readonly searchAdapter?: SearchAdapter;
|
|
62
|
+
readonly includeDeleted?: boolean;
|
|
63
|
+
readonly referenceSearch?: {
|
|
64
|
+
readonly fields: ReadonlyArray<{
|
|
65
|
+
readonly fieldName: string;
|
|
66
|
+
readonly targetEntityName: string;
|
|
67
|
+
readonly labelField: string;
|
|
68
|
+
}>;
|
|
69
|
+
readonly resolveEntity: (entityName: string) => EntityDefinition | undefined;
|
|
70
|
+
};
|
|
71
|
+
readonly referenceSort?: {
|
|
72
|
+
readonly fields: ReadonlyArray<{
|
|
73
|
+
readonly fieldName: string;
|
|
74
|
+
readonly targetEntityName: string;
|
|
75
|
+
readonly labelField: string;
|
|
76
|
+
}>;
|
|
77
|
+
readonly resolveEntity: (entityName: string) => EntityDefinition | undefined;
|
|
78
|
+
};
|
|
79
|
+
readonly parentVisibility?: ParentVisibilityOption;
|
|
80
|
+
}) => Promise<CursorResult<Record<string, unknown>>>;
|
|
81
|
+
detail: (payload: {
|
|
82
|
+
id: EntityId;
|
|
83
|
+
}, user: SessionUser, db: TenantDb, options?: {
|
|
84
|
+
readonly parentVisibility?: ParentVisibilityOption;
|
|
85
|
+
}) => Promise<Record<string, unknown> | null>;
|
|
86
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { TenantId } from "./identifiers.js";
|
|
2
|
+
export interface VersionConflict extends Error {
|
|
3
|
+
readonly aggregateId: string;
|
|
4
|
+
readonly expectedVersion: number;
|
|
5
|
+
}
|
|
6
|
+
export type EventMetadata = {
|
|
7
|
+
readonly userId: string;
|
|
8
|
+
readonly requestId?: string;
|
|
9
|
+
readonly correlationId?: string;
|
|
10
|
+
readonly causationId?: string;
|
|
11
|
+
readonly idempotencyKey?: string;
|
|
12
|
+
readonly headers?: Readonly<Record<string, string | number | boolean>>;
|
|
13
|
+
readonly feature?: string;
|
|
14
|
+
readonly handler?: string;
|
|
15
|
+
readonly writeOrigin?: WriteOrigin;
|
|
16
|
+
};
|
|
17
|
+
export type WriteOrigin = {
|
|
18
|
+
readonly rootHandler: string;
|
|
19
|
+
readonly anonymousRoot: boolean;
|
|
20
|
+
readonly publicIntake: boolean;
|
|
21
|
+
readonly viaJob?: string;
|
|
22
|
+
};
|
|
23
|
+
export declare function isPersonalDataGated(origin: WriteOrigin): boolean;
|
|
24
|
+
export declare const UNATTRIBUTED_ORIGIN = "unknown";
|
|
25
|
+
export type StoredEvent<TPayload = Record<string, unknown>> = {
|
|
26
|
+
readonly id: string;
|
|
27
|
+
readonly aggregateId: string;
|
|
28
|
+
readonly aggregateType: string;
|
|
29
|
+
readonly tenantId: TenantId;
|
|
30
|
+
readonly version: number;
|
|
31
|
+
readonly type: string;
|
|
32
|
+
readonly eventVersion: number;
|
|
33
|
+
readonly payload: TPayload;
|
|
34
|
+
readonly metadata: EventMetadata;
|
|
35
|
+
readonly createdAt: Temporal.Instant;
|
|
36
|
+
readonly createdBy: string;
|
|
37
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export function isPersonalDataGated(origin) {
|
|
2
|
+
return origin.anonymousRoot && !origin.publicIntake;
|
|
3
|
+
}
|
|
4
|
+
// Stamped when an append runs outside any attributed scope (seed scripts,
|
|
5
|
+
// tests, direct event-store use). A distinct value, not an omission —
|
|
6
|
+
// omitted would be indistinguishable from a pre-#3043 row.
|
|
7
|
+
export const UNATTRIBUTED_ORIGIN = "unknown";
|
|
@@ -19,19 +19,4 @@
|
|
|
19
19
|
// "users:user.created": z.infer<typeof userCreatedSchema>;
|
|
20
20
|
// }
|
|
21
21
|
// }
|
|
22
|
-
|
|
23
|
-
// MUST be `interface` (not `type`): only interfaces support TS declaration-
|
|
24
|
-
// merging. Apps/features extend these via `declare module "@cosmicdrift/kumiko-framework/engine"`
|
|
25
|
-
// blocks. A `type X = {}` alias would silently break that augmentation channel.
|
|
26
|
-
|
|
27
|
-
// biome-ignore lint/suspicious/noEmptyInterface: declaration-merging marker — augmented per feature
|
|
28
|
-
export interface KumikoEventTypeMap {}
|
|
29
|
-
|
|
30
|
-
// biome-ignore lint/suspicious/noEmptyInterface: declaration-merging marker
|
|
31
|
-
export interface KumikoEntityTypeMap {}
|
|
32
|
-
|
|
33
|
-
// biome-ignore lint/suspicious/noEmptyInterface: declaration-merging marker
|
|
34
|
-
export interface KumikoHandlerPayloadMap {}
|
|
35
|
-
|
|
36
|
-
// biome-ignore lint/suspicious/noEmptyInterface: declaration-merging marker
|
|
37
|
-
export interface KumikoHandlerResultMap {}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { EscapeHatchDeclaration } from "./handlers.js";
|
|
2
|
+
export interface KumikoExtensionOptionsMap {
|
|
3
|
+
}
|
|
4
|
+
/** Options shape for an extension name: the augmented hook shape plus `escapeHatch`, or an untyped bag if unaugmented. */
|
|
5
|
+
export type ExtensionOptionsFor<N extends string> = N extends keyof KumikoExtensionOptionsMap ? KumikoExtensionOptionsMap[N] & {
|
|
6
|
+
readonly escapeHatch?: EscapeHatchDeclaration;
|
|
7
|
+
} : Record<string, unknown>;
|
|
8
|
+
/** Rest-tuple for useExtension's positional options arg: required for an augmented name, optional otherwise. */
|
|
9
|
+
export type ExtensionOptionsArgs<N extends string> = N extends keyof KumikoExtensionOptionsMap ? [options: ExtensionOptionsFor<N>] : [options?: Record<string, unknown>];
|