@cosmicdrift/kumiko-types 0.388.0 → 0.390.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.
@@ -4,6 +4,8 @@ import type { PlatformComponent, ScreenNavSugar, ScreenSlots } from "./screen.ts
4
4
  import type { DashboardPanelVisibility } from "./screen-dashboard.ts";
5
5
  import type { EditLayout, ListEmptyStateSpec } from "./screen-entity-edit.ts";
6
6
  import type { ListColumnSpec, ListPaginationMode, ListSortSpec, RowAction, RowActionMode, RowFieldExtractor, ScreenFilter, ToolbarAction } from "./screen-entity-list.ts";
7
+ import type { ListBulkAction } from "./screen-list-bulk.ts";
8
+ import type { ListTableOptions } from "./screen-list-table.ts";
7
9
  export type ListFacetSpec = {
8
10
  readonly field: string;
9
11
  readonly type: "select";
@@ -71,9 +73,13 @@ export type ProjectionListScreenDefinition = {
71
73
  readonly rowActions?: readonly RowAction[];
72
74
  /** Layout of the row-action column — see `RowActionMode`. */
73
75
  readonly rowActionMode?: RowActionMode;
76
+ /** Bulk actions over checkbox-selected rows, each pointing at a writeHandler row action. Adds a checkbox column and a selection bar; without it the list has no checkboxes. */
77
+ readonly bulkActions?: readonly ListBulkAction[];
74
78
  readonly toolbarActions?: readonly ToolbarAction[];
75
79
  readonly pagination?: ListPaginationMode;
76
80
  readonly pageSize?: number;
81
+ /** Opt-in table behaviour: remembered state, reset, column picker, density. */
82
+ readonly table?: ListTableOptions;
77
83
  readonly defaultSort?: ListSortSpec;
78
84
  /** Replaces the default empty-list title/hint; the create button stays when the list can create. */
79
85
  readonly emptyState?: ListEmptyStateSpec;
package/dist/screen.d.ts CHANGED
@@ -72,8 +72,11 @@ export interface FieldFormatRegistry {
72
72
  };
73
73
  /** FileRef id (or id array) as a download link with the file name. On a
74
74
  * read-only detail field it renders a file list with download links and an
75
- * inline preview for PDFs; elsewhere the raw value is shown. */
76
- file: object;
75
+ * inline preview for PDFs; elsewhere the raw value is shown.
76
+ * `previewOpenByDefault` opens the newest (last) file's PDF preview initially. */
77
+ file: {
78
+ readonly previewOpenByDefault?: boolean;
79
+ };
77
80
  }
78
81
  export type FormatSpec = {
79
82
  [K in keyof FieldFormatRegistry]: {
@@ -111,7 +114,12 @@ export type { ActionFormFooterAction, ActionFormLoad, ActionFormRedirect, Action
111
114
  export type { ConfigEditScreenDefinition, CustomScreenDefinition, CustomScreenRoute, SecretsEditScreenDefinition, SecretsEditSection, } from "./screen-custom-config.ts";
112
115
  export type { DashboardChartKind, DashboardChartMarkerKind, DashboardChartPanel, DashboardChartRangeOption, DashboardChartRanges, DashboardChartTone, DashboardCurrencyFormat, DashboardCustomPanel, DashboardDateParam, DashboardFeedPanel, DashboardFilterDefinition, DashboardI18nText, DashboardListPanel, DashboardMoneyParam, DashboardPanelDefinition, DashboardPanelEmptyState, DashboardPanelGate, DashboardPanelQueryOptions, DashboardPanelSpan, DashboardPanelVisibility, DashboardProgressListPanel, DashboardProgressTone, DashboardRecordBinding, DashboardRefresh, DashboardRelativeTimeFormat, DashboardRelativeTimeParam, DashboardScopeDefinition, DashboardScreenDefinition, DashboardScreenPanel, DashboardStatGroupPanel, DashboardStatPanel, DashboardStatTone, DashboardText, DashboardTextBlock, DashboardTextPanel, DashboardTextParam, DashboardTimeRangeDefinition, DashboardValueFormat, } from "./screen-dashboard.ts";
113
116
  export { DASHBOARD_MIN_REFRESH_SECONDS, DASHBOARD_STAT_TONES } from "./screen-dashboard.ts";
114
- export type { EditExtensionSection, EditFieldGroup, EditFieldPrefill, EditFieldSpec, EditFieldsSection, EditLayout, EditRelatedListSection, EditSectionSpec, EditWriteFormSection, EmbeddedListEditSpec, EntityEditAction, EntityEditActionPlacement, EntityEditScreenDefinition, EntityWriteExcludedFields, FieldAffix, FieldFillAction, FormWidth, ListEmptyStateSpec, RelatedListGroupBy, RelatedListRowTone, } from "./screen-entity-edit.ts";
117
+ export type { EditExtensionSection, EditFieldGroup, EditFieldPrefill, EditFieldSpec, EditFieldsSection, EditLayout, EditRelatedListSection, EditSectionSpec, EditWriteFormSection, EmbeddedListEditSpec, EntityEditAction, EntityEditActionPlacement, EntityEditScreenDefinition, EntityWriteExcludedFields, FieldAffix, FieldFillAction, FormWidth, ListEmptyStateSpec, RelatedListRowTone, } from "./screen-entity-edit.ts";
115
118
  export { relatedListGroupHeaderLabel, relatedListGroupKey } from "./screen-entity-edit.ts";
116
- export type { EntityListExpandableRow, EntityListFacetConfig, EntityListFacetExtraOption, EntityListScreenDefinition, ListBadgeTone, ListColumnDisplay, ListColumnSpec, ListPaginationMode, ListSortDir, ListSortSpec, RelatedListToolbarAction, RowAction, RowActionClientAction, RowActionDisplay, RowActionDrawer, RowActionMode, RowActionNavigate, RowActionNavigateBase, RowActionWriteHandler, RowFieldExtractor, ScreenFilter, ScreenFilterOp, ToolbarAction, } from "./screen-entity-list.ts";
119
+ export type { EntityListFacetConfig, EntityListFacetExtraOption, EntityListScreenDefinition, ListBadgeTone, ListColumnDisplay, ListColumnSpec, ListPaginationMode, ListSortDir, ListSortSpec, RelatedListToolbarAction, RowAction, RowActionClientAction, RowActionDisplay, RowActionDrawer, RowActionMode, RowActionNavigate, RowActionNavigateBase, RowActionWriteHandler, RowFieldExtractor, ScreenFilter, ScreenFilterOp, ToolbarAction, } from "./screen-entity-list.ts";
120
+ export type { EntityListExpandableRow, ExpandableRowGrouping } from "./screen-expandable-row.ts";
121
+ export type { ListBulkAction } from "./screen-list-bulk.ts";
122
+ export { LIST_BULK_ACTION_KEYS, MAX_BULK_SELECTION } from "./screen-list-bulk.ts";
123
+ export type { BundledListsOptions, ListColumnPin, ListTableDensity, ListTableExportOptions, ListTableGrouping, ListTableOptions, ListTableTotal, } from "./screen-list-table.ts";
124
+ export { DEFAULT_EXPORT_MAX_ROWS, LIST_COLUMN_PINS, LIST_TABLE_DENSITIES, LIST_TABLE_DENSITY_KEYS, LIST_TABLE_EXPORT_KEYS, LIST_TABLE_GROUPING_KEYS, LIST_TABLE_OPTION_KEYS, LIST_TABLE_TOTAL_KEYS, MAX_EXPORT_MAX_ROWS, } from "./screen-list-table.ts";
117
125
  export type { ListFacetSpec, MetricNavigate, MetricSpec, ProjectionDetailScreenDefinition, ProjectionListScreenDefinition, RecordHeaderSpec, RecordHeaderSubtitlePart, } from "./screen-projection.ts";
package/dist/screen.js CHANGED
@@ -1,2 +1,4 @@
1
1
  export { DASHBOARD_MIN_REFRESH_SECONDS, DASHBOARD_STAT_TONES } from "./screen-dashboard.js";
2
2
  export { relatedListGroupHeaderLabel, relatedListGroupKey } from "./screen-entity-edit.js";
3
+ export { LIST_BULK_ACTION_KEYS, MAX_BULK_SELECTION } from "./screen-list-bulk.js";
4
+ export { DEFAULT_EXPORT_MAX_ROWS, LIST_COLUMN_PINS, LIST_TABLE_DENSITIES, LIST_TABLE_DENSITY_KEYS, LIST_TABLE_EXPORT_KEYS, LIST_TABLE_GROUPING_KEYS, LIST_TABLE_OPTION_KEYS, LIST_TABLE_TOTAL_KEYS, MAX_EXPORT_MAX_ROWS, } from "./screen-list-table.js";
@@ -6,7 +6,7 @@
6
6
  // but the nominal typing stops it from landing in an HTTP response by
7
7
  // accident — a response-serializer guard + the reveal() cost make the leak
8
8
  // intentional. Framework code that sees `Secret<string>` knows the caller
9
- // has already gone through the audited ctx.secrets.get path.
9
+ // has already gone through the audited ctx.services.secrets.get path.
10
10
  //
11
11
  // Registered symbol, matching KUMIKO_*_SYMBOL in schema-table-types.ts. A
12
12
  // plain Symbol() is per-copy: two resolved copies of this package brand with
@@ -58,6 +58,11 @@ type TenantDbNonWrites = {
58
58
  /** Postgres `now()`; inside a transaction this is the transaction start. */
59
59
  databaseNow(): Promise<Date>;
60
60
  aggregate(table: SchemaTable | EntityTableMeta, spec: AggregateSpec, where?: WhereObject): Promise<readonly AggregateRow[]>;
61
+ upsert<T = Record<string, unknown>>(table: WritableTable, values: Record<string, unknown>, options: TenantDbUpsertOptions): Promise<T | undefined>;
62
+ };
63
+ export type TenantDbUpsertOptions = {
64
+ readonly conflictTarget: readonly string[];
65
+ readonly update?: Record<string, unknown>;
61
66
  };
62
67
  export type TenantDb = TenantDbNonWrites & TenantDbWrites<WritableTable>;
63
68
  export type ExecutorManagedTenantDb = TenantDbNonWrites & TenantDbWrites<EntityTableMeta> & ExecutorManagedWriteCapability;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-types",
3
- "version": "0.388.0",
3
+ "version": "0.390.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": "MIT",
6
6
  "author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
@@ -178,6 +178,10 @@
178
178
  "types": "./dist/feature.d.ts",
179
179
  "default": "./dist/feature.js"
180
180
  },
181
+ "./feature-registrar": {
182
+ "types": "./dist/feature-registrar.d.ts",
183
+ "default": "./dist/feature-registrar.js"
184
+ },
181
185
  "./fields": {
182
186
  "types": "./dist/fields.d.ts",
183
187
  "default": "./dist/fields.js"
@@ -284,18 +288,18 @@
284
288
  }
285
289
  },
286
290
  "devDependencies": {
291
+ "bun-types": "^1.4.4",
287
292
  "hono": "^4.13.1",
288
- "postgres": "npm:@bender0oo0/postgres@3.4.9-kumiko.2",
289
293
  "temporal-polyfill": "^0.3.2",
290
294
  "zod": "^4.4.3",
291
295
  "ioredis": "^5.10.1"
292
296
  },
293
297
  "peerDependencies": {
294
298
  "hono": "^4.13.1",
295
- "postgres": "^3.4.9-0",
296
299
  "temporal-polyfill": "^0.3.2",
297
300
  "zod": "^4.4.3",
298
- "ioredis": "^5.10.1"
301
+ "ioredis": "^5.10.1",
302
+ "bun-types": "^1.4.4"
299
303
  },
300
304
  "publishConfig": {
301
305
  "registry": "https://registry.npmjs.org",
@@ -461,6 +465,10 @@
461
465
  "types": "./dist/feature.d.ts",
462
466
  "default": "./dist/feature.js"
463
467
  },
468
+ "./feature-registrar": {
469
+ "types": "./dist/feature-registrar.d.ts",
470
+ "default": "./dist/feature-registrar.js"
471
+ },
464
472
  "./fields": {
465
473
  "types": "./dist/fields.d.ts",
466
474
  "default": "./dist/fields.js"
package/src/changes.json CHANGED
@@ -1,4 +1,17 @@
1
1
  [
2
+ {
3
+ "version": "0.389.0",
4
+ "type": "breaking",
5
+ "title": "DbConnection, DbTx and PgClient are Bun.SQL types and postgres is no longer a peer dependency",
6
+ "detail": "DbConnection is SQL | RawDbClient, DbTx is TransactionSQL | RawDbClient and PgClient is SQL from the bun module, so the package type-checks against bun-types instead of postgres. The postgres peer dependency is removed.",
7
+ "migration": "Remove postgres from your dependencies unless your own code imports it. Annotations that named postgres.Sql or postgres.TransactionSql for framework handles become SQL and TransactionSQL from \"bun\", or the DbConnection and DbTx aliases. Manual migration, there is no codemod."
8
+ },
9
+ {
10
+ "version": "0.389.0",
11
+ "type": "improvement",
12
+ "title": "Config validators can read a key's cascade",
13
+ "detail": "ConfigValidateContext gains readCascade(qualifiedKey), which returns the full cascade of any registered key from the writing tenant and user. Unknown keys throw."
14
+ },
2
15
  {
3
16
  "version": "0.386.0",
4
17
  "type": "improvement",
@@ -30,7 +43,7 @@
30
43
  "type": "breaking",
31
44
  "title": "HandlerContext.outsideTransaction removed",
32
45
  "detail": "The deprecated outsideTransaction field no longer exists on HandlerContext. ctx.dbOutsideTransaction together with runInOwnTransaction replaces it.",
33
- "migration": "Replace ctx.outsideTransaction(fn) with runInOwnTransaction(requireOutsideTransactionDb(ctx), fn); both are exported from @cosmicdrift/kumiko-framework/db and fn keeps its (db) => Promise signature."
46
+ "migration": "Replace ctx.outsideTransaction(fn) with runInOwnTransaction(requireOutsideTransactionDb(ctx), fn); both are exported from @cosmicdrift/kumiko-framework/db and fn keeps its (db) => Promise signature. Since #4031 the two helpers are internal and no longer exported from /db; narrow ctx.db.outsideTransaction directly (if (ctx.db.outsideTransaction))."
34
47
  },
35
48
  {
36
49
  "version": "0.377.0",