@cosmicdrift/kumiko-types 0.336.0 → 0.337.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/feature.d.ts CHANGED
@@ -39,8 +39,27 @@ export type SecretKeyDefinition = {
39
39
  };
40
40
  readonly scope: "tenant";
41
41
  readonly required?: boolean;
42
+ readonly writeRoles?: readonly string[];
42
43
  };
43
44
  export type SecretOptions = Omit<SecretKeyDefinition, "shortName" | "qualifiedName">;
45
+ export type SecretNamespaceDefinition = {
46
+ readonly shortName: string;
47
+ readonly qualifiedPrefix: string;
48
+ readonly label: {
49
+ readonly [locale: string]: string;
50
+ };
51
+ readonly hint?: {
52
+ readonly [locale: string]: string;
53
+ };
54
+ readonly scope: "tenant";
55
+ readonly writeRoles?: readonly string[];
56
+ readonly nameSchema?: ZodType<string>;
57
+ };
58
+ export type SecretNamespaceOptions = Omit<SecretNamespaceDefinition, "shortName" | "qualifiedPrefix">;
59
+ export type SecretNamespaceHandle = {
60
+ readonly prefix: string;
61
+ keyFor(name: string): string;
62
+ };
44
63
  export type SecretKeyHandle = {
45
64
  readonly name: string;
46
65
  };
@@ -150,6 +169,7 @@ export type FeatureDefinition = {
150
169
  readonly handlerEntityMappings: Readonly<Record<string, string>>;
151
170
  readonly metrics: Readonly<Record<string, FeatureMetricDef>>;
152
171
  readonly secretKeys: Readonly<Record<string, SecretKeyDefinition>>;
172
+ readonly secretNamespaces: Readonly<Record<string, SecretNamespaceDefinition>>;
153
173
  readonly projections: Readonly<Record<string, ProjectionDefinition>>;
154
174
  readonly entityProjectionExtensions?: Readonly<Record<string, readonly EntityProjectionExtension[]>>;
155
175
  readonly multiStreamProjections: Readonly<Record<string, MultiStreamProjectionDefinition>>;
@@ -409,6 +429,10 @@ export type FeatureRegistrar<TFeature extends string = string> = {
409
429
  secret(definition: {
410
430
  readonly name: string;
411
431
  } & SecretOptions): SecretKeyHandle;
432
+ secretNamespace(shortName: string, options: SecretNamespaceOptions): SecretNamespaceHandle;
433
+ secretNamespace(definition: {
434
+ readonly name: string;
435
+ } & SecretNamespaceOptions): SecretNamespaceHandle;
412
436
  projection(definition: ProjectionDefinition): void;
413
437
  multiStreamProjection(definition: MultiStreamProjectionDefinition): void;
414
438
  extendEntityProjection(entityName: string, extension: EntityProjectionExtension): void;
@@ -485,6 +509,7 @@ export type Registry = {
485
509
  getAllConfigSeeds(): readonly ConfigSeedDef[];
486
510
  getAllSecretKeys(): ReadonlyMap<string, SecretKeyDefinition>;
487
511
  getSecretKey(qualifiedName: string): SecretKeyDefinition | undefined;
512
+ findSecretNamespace(key: string): SecretNamespaceDefinition | undefined;
488
513
  getJob(qualifiedName: string): JobDefinition | undefined;
489
514
  getAllJobs(): ReadonlyMap<string, JobDefinition>;
490
515
  getEvent(qualifiedName: string): EventDef | undefined;
package/dist/screen.d.ts CHANGED
@@ -920,13 +920,17 @@ export type RelatedListGroupBy = {
920
920
  readonly collapsedWhen?: string | number | boolean | null;
921
921
  /** i18n key of the group header. Placeholders: `{count}` rows in the group,
922
922
  * `{value}` the group's field value, `{lastDate}` the group's latest
923
- * `dateField` value as a locale date. */
924
- readonly label: string;
923
+ * `dateField` value as a locale date. A group with neither `label` nor an
924
+ * entry in `labels` renders its rows without a header and never collapses. */
925
+ readonly label?: string;
925
926
  /** Header i18n key per group value (as string), overriding `label`. */
926
927
  readonly labels?: Readonly<Record<string, string>>;
927
928
  /** Row field (ISO date or timestamp) behind `{lastDate}`. */
928
929
  readonly dateField?: string;
929
930
  };
931
+ /** Group key of a field value; `collapsedWhen` and row values both go through it. */
932
+ export declare function relatedListGroupKey(value: unknown): string;
933
+ export declare function relatedListGroupHeaderLabel(groupBy: RelatedListGroupBy, groupKey: string): string | undefined;
930
934
  /** Row tint rule: rows where the `FieldCondition` (`{ field, eq }`, `{ field,
931
935
  * in }` …) holds get the tone. `bad` renders red. */
932
936
  export type RelatedListRowTone = Exclude<FieldCondition, boolean> & {
@@ -969,7 +973,8 @@ export type EditRelatedListSection = {
969
973
  readonly itemNoun?: string;
970
974
  readonly pageSize?: number;
971
975
  /** Initial sort on mount, applied client-side over the already-loaded rows
972
- * (this section has no pager, so there is no "loaded subset" to mislead).
976
+ * (this section has no pager; if the fetch is truncated, `nextCursor !== null`,
977
+ * the section shows a hint banner that the sort covers only the loaded rows).
973
978
  * `field` must name a column with `sortable: true` — boot-validator pins
974
979
  * that, same as `entityList.defaultSort`. */
975
980
  readonly defaultSort?: ListSortSpec;
@@ -1481,6 +1486,10 @@ export type SecretsEditScreenDefinition = {
1481
1486
  readonly fieldHints?: Readonly<Record<string, string>>;
1482
1487
  /** field ids whose declaration set `required: true`. */
1483
1488
  readonly requiredFields?: readonly string[];
1489
+ /** field id -> write access derived from the key's `writeRoles`. The screen
1490
+ * hides fields the viewer fails; UI only, the secrets write gate stays
1491
+ * authoritative. */
1492
+ readonly fieldAccess?: Readonly<Record<string, AccessRule>>;
1484
1493
  readonly sections: readonly SecretsEditSection[];
1485
1494
  readonly access?: AccessRule;
1486
1495
  };
package/dist/screen.js CHANGED
@@ -1,3 +1,11 @@
1
1
  export function metricField(metric) {
2
2
  return typeof metric === "string" ? metric : metric.field;
3
3
  }
4
+ /** Group key of a field value; `collapsedWhen` and row values both go through it. */
5
+ export function relatedListGroupKey(value) {
6
+ return value === undefined || value === null ? "" : String(value);
7
+ }
8
+ export function relatedListGroupHeaderLabel(groupBy, groupKey) {
9
+ const labels = groupBy.labels;
10
+ return labels !== undefined && Object.hasOwn(labels, groupKey) ? labels[groupKey] : groupBy.label;
11
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-types",
3
- "version": "0.336.0",
3
+ "version": "0.337.1",
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>",
package/src/changes.json CHANGED
@@ -1,4 +1,11 @@
1
1
  [
2
+ {
3
+ "version": "0.337.0",
4
+ "type": "improvement",
5
+ "title": "relatedList groupBy.label is optional; groups without a header show their rows directly",
6
+ "detail": "`RelatedListGroupBy.label` is optional. The header key of a group is `labels[value] ?? label`; a group without one renders its rows without a header row and never collapses. `relatedListGroupKey` and `relatedListGroupHeaderLabel` resolve the group key and its header key; `collapsedWhen: null` now matches rows whose field is empty.",
7
+ "migration": "No code change needed. To hide a header, drop `label` and name only the groups that keep one in `labels`, for example `{ field: \"status\", collapsedWhen: \"done\", labels: { done: \"<key>\" } }`."
8
+ },
2
9
  {
3
10
  "version": "0.336.0",
4
11
  "type": "improvement",