@cosmicdrift/kumiko-types 0.402.0 → 0.403.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/dist/fields.d.ts CHANGED
@@ -5,6 +5,7 @@ export type { EmbeddedDerivedCellDef, EmbeddedFilesSubFieldProps, EmbeddedImages
5
5
  import type { ParentRefDef, ReadGateDef } from "./entity-row-visibility.ts";
6
6
  import type { DerivedFieldsMap } from "./fields-derived.ts";
7
7
  import type { EventUpcastCtx } from "./handlers.ts";
8
+ import type { NamedListFilterDef } from "./named-list-filters.ts";
8
9
  import type { OwnershipMap } from "./ownership.ts";
9
10
  import type { EntityTenancy } from "./tenancy-brand.ts";
10
11
  export type { ClientDerivedFieldDef, DeriveContext, DerivedCondition, DerivedConditionValue, DerivedFieldDef, DerivedFieldsMap, DerivedRelatedMeasure, DerivedSqlSpec, DerivedValueType, JsDerivedFieldDef, SqlDerivedFieldDef, } from "./fields-derived.ts";
@@ -854,6 +855,8 @@ export type EntityDefinition<F extends FieldsMap = FieldsMap, T extends EntityTe
854
855
  * nameable as a column in a declarative `entityList`. See DerivedFieldDef.
855
856
  */
856
857
  readonly derivedFields?: DerivedFieldsMap;
858
+ /** Named work-queue rules keyed by id, selected via `namedFilter`; function-valued, never in the client schema. */
859
+ readonly namedFilters?: Readonly<Record<string, NamedListFilterDef>>;
857
860
  /** Optional free-text semantics for the AI agent manifest — see TextFieldDef.description. */
858
861
  readonly description?: string;
859
862
  /** Opts the rows into `tenant-handover`, a grant-legitimated move from an anonymous tenant to the
@@ -0,0 +1,23 @@
1
+ /// <reference types="temporal-polyfill/global" preserve="true" />
2
+ import type { AccessRule, HandlerContext, SessionUser } from "./handlers.ts";
3
+ export type NamedListFilterOp = "eq" | "ne" | "lt" | "gt" | "lte" | "gte" | "in";
4
+ export type NamedListFilterCondition = {
5
+ readonly field: string;
6
+ readonly op: NamedListFilterOp;
7
+ readonly value: unknown;
8
+ };
9
+ export type NamedListFilterScope = {
10
+ readonly ctx: HandlerContext;
11
+ readonly user: SessionUser;
12
+ readonly now: Temporal.Instant;
13
+ };
14
+ /** A work-queue rule defined once on the entity: the list and every count query resolve the same conditions. */
15
+ export type NamedListFilterDef = {
16
+ readonly access?: AccessRule;
17
+ readonly filters: (scope: NamedListFilterScope) => readonly NamedListFilterCondition[] | Promise<readonly NamedListFilterCondition[]>;
18
+ };
19
+ /** Screen-side reference to an entity-defined named filter; `label` is an i18n key. */
20
+ export type NamedListFilterRef = {
21
+ readonly id: string;
22
+ readonly label: string;
23
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -104,6 +104,13 @@ export type DashboardStatPanel = DashboardPanelQueryOptions & DashboardPanelGate
104
104
  * An accent that should change with the result (e.g. by sign) goes through
105
105
  * `toneField`; leave `accentColor` unset then. */
106
106
  readonly accentColor?: string;
107
+ /** Makes the tile a link to a list screen (qualified screen id). Count tiles use the
108
+ * list's own query with `params.namedFilter`; the boot validator pins that the tile and
109
+ * the target list select the same rows. The click sets `<screenId>.filter`. */
110
+ readonly navigate?: {
111
+ readonly screen: string;
112
+ readonly namedFilter?: string;
113
+ };
107
114
  };
108
115
  export type DashboardChartKind = "timeseries" | "stacked-bars" | "segment-bars" | "stacked-area";
109
116
  export type DashboardChartTone = "positive" | "negative" | "active" | "neutral";
@@ -1,5 +1,6 @@
1
1
  import type { FieldCondition } from "./fields.ts";
2
2
  import type { AccessRule, AgentScreenHints } from "./handlers.ts";
3
+ import type { NamedListFilterRef } from "./named-list-filters.ts";
3
4
  import type { IconKey } from "./nav-icon.ts";
4
5
  import type { FieldRenderer, PlatformComponent, ScreenNavSugar, ScreenSlots } from "./screen.ts";
5
6
  import type { ActionFormRedirect } from "./screen-action-form.ts";
@@ -446,6 +447,10 @@ export type EntityListScreenDefinition = {
446
447
  * through `defaultFilters` and the URL). Fields without an entry keep the
447
448
  * default dropdown. */
448
449
  readonly facets?: Readonly<Record<string, EntityListFacetConfig | false>>;
450
+ /** Named work-queue rules offered on this list: ids declared in `EntityDefinition.namedFilters`,
451
+ * `label` an i18n key. Selected through the `<screenId>.filter` URL key; a dashboard stat's
452
+ * `navigate.namedFilter` links here. While one is active `defaultFilters` are not applied. */
453
+ readonly namedFilters?: readonly NamedListFilterRef[];
449
454
  /** Replaces the default empty-list title/hint; the create button stays when the list can create. */
450
455
  readonly emptyState?: ListEmptyStateSpec;
451
456
  /** i18n key for the primary create button label (default `kumiko.actions.create`). */
@@ -1,5 +1,6 @@
1
1
  import type { SelectOptionTone } from "./fields.ts";
2
2
  import type { AccessRule, AgentScreenHints } from "./handlers.ts";
3
+ import type { NamedListFilterRef } from "./named-list-filters.ts";
3
4
  import type { NavIconKey } from "./nav-icon.ts";
4
5
  import type { FormatSpec, PlatformComponent, ScreenNavSugar, ScreenSlots } from "./screen.ts";
5
6
  import type { DashboardStatTone, ScreenVisibility } from "./screen-dashboard.ts";
@@ -112,6 +113,9 @@ export type ProjectionListScreenDefinition = {
112
113
  * "dateRange" facet instead needs its two `params` keys in that schema;
113
114
  * it sends no `filters` entry. */
114
115
  readonly facets?: readonly ListFacetSpec[];
116
+ /** Named work-queue rules the bound query understands: its Zod schema must have a
117
+ * `namedFilter` key (boot-checked) and is sent the selected id in every list and count query. */
118
+ readonly namedFilters?: readonly NamedListFilterRef[];
115
119
  readonly slots?: ScreenSlots;
116
120
  readonly access?: AccessRule;
117
121
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-types",
3
- "version": "0.402.0",
3
+ "version": "0.403.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>",
@@ -202,6 +202,10 @@
202
202
  "types": "./dist/hooks.d.ts",
203
203
  "default": "./dist/hooks.js"
204
204
  },
205
+ "./named-list-filters": {
206
+ "types": "./dist/named-list-filters.d.ts",
207
+ "default": "./dist/named-list-filters.js"
208
+ },
205
209
  "./nav": {
206
210
  "types": "./dist/nav.d.ts",
207
211
  "default": "./dist/nav.js"
@@ -501,6 +505,10 @@
501
505
  "types": "./dist/hooks.d.ts",
502
506
  "default": "./dist/hooks.js"
503
507
  },
508
+ "./named-list-filters": {
509
+ "types": "./dist/named-list-filters.d.ts",
510
+ "default": "./dist/named-list-filters.js"
511
+ },
504
512
  "./nav": {
505
513
  "types": "./dist/nav.d.ts",
506
514
  "default": "./dist/nav.js"