@entifix/core 0.13.0 → 0.14.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.
Files changed (113) hide show
  1. package/dist/base-entities/configuration-client/configuration-client-singleton.d.ts +12 -13
  2. package/dist/base-entities/configuration-client/configuration-client-singleton.d.ts.map +1 -1
  3. package/dist/base-entities/configuration-client/configuration-client-singleton.js +4 -17
  4. package/dist/base-entities/configuration-client/configuration-client-singleton.js.map +1 -1
  5. package/dist/base-entities/configuration-client/types.d.ts +13 -13
  6. package/dist/base-entities/configuration-client/types.d.ts.map +1 -1
  7. package/dist/base-entities/configuration-client/types.js.map +1 -1
  8. package/dist/command-palette/command-matching.d.ts.map +1 -1
  9. package/dist/command-palette/command-matching.js +1 -5
  10. package/dist/command-palette/command-matching.js.map +1 -1
  11. package/dist/entity-definition/describe/describe-child-columns.d.ts +3 -3
  12. package/dist/entity-definition/describe/describe-child-columns.d.ts.map +1 -1
  13. package/dist/entity-definition/describe/describe-child-columns.js +5 -10
  14. package/dist/entity-definition/describe/describe-child-columns.js.map +1 -1
  15. package/dist/entity-definition/describe/describe-entity-columns.d.ts.map +1 -1
  16. package/dist/entity-definition/describe/describe-entity-columns.js +6 -7
  17. package/dist/entity-definition/describe/describe-entity-columns.js.map +1 -1
  18. package/dist/entity-definition/describe/entity-view.d.ts.map +1 -1
  19. package/dist/entity-definition/describe/entity-view.js +2 -3
  20. package/dist/entity-definition/describe/entity-view.js.map +1 -1
  21. package/dist/entity-definition/helpers/entity-definition-helpers.d.ts.map +1 -1
  22. package/dist/entity-definition/helpers/entity-definition-helpers.js +4 -5
  23. package/dist/entity-definition/helpers/entity-definition-helpers.js.map +1 -1
  24. package/dist/entity-definition/links/apply-entity-links/apply-entity-links.d.ts +1 -1
  25. package/dist/entity-definition/links/apply-entity-links/apply-entity-links.d.ts.map +1 -1
  26. package/dist/entity-definition/links/apply-entity-links/apply-entity-links.js +2 -6
  27. package/dist/entity-definition/links/apply-entity-links/apply-entity-links.js.map +1 -1
  28. package/dist/entity-definition/links/entity-collection-link/entity-collection-link.d.ts +3 -3
  29. package/dist/entity-definition/links/entity-collection-link/entity-collection-link.d.ts.map +1 -1
  30. package/dist/entity-definition/links/entity-collection-link/entity-collection-link.js.map +1 -1
  31. package/dist/entity-definition/links/entity-link/entity-link.d.ts +4 -4
  32. package/dist/entity-definition/links/entity-link/entity-link.d.ts.map +1 -1
  33. package/dist/entity-definition/links/entity-link/entity-link.js.map +1 -1
  34. package/dist/entity-definition/links/entity-link-source/entity-link-source.d.ts +3 -3
  35. package/dist/entity-definition/links/entity-link-source/entity-link-source.d.ts.map +1 -1
  36. package/dist/entity-definition/links/entity-link-source/entity-link-source.js.map +1 -1
  37. package/dist/entity-definition/links/link-targets/link-targets.d.ts.map +1 -1
  38. package/dist/entity-definition/links/link-targets/link-targets.js +2 -3
  39. package/dist/entity-definition/links/link-targets/link-targets.js.map +1 -1
  40. package/dist/entity-definition/meta-entities/bounds.d.ts.map +1 -1
  41. package/dist/entity-definition/meta-entities/bounds.js +2 -3
  42. package/dist/entity-definition/meta-entities/bounds.js.map +1 -1
  43. package/dist/entity-definition/serializer/deserialize.d.ts +3 -3
  44. package/dist/entity-definition/serializer/deserialize.d.ts.map +1 -1
  45. package/dist/entity-definition/serializer/deserialize.js +11 -18
  46. package/dist/entity-definition/serializer/deserialize.js.map +1 -1
  47. package/dist/failure/failure.d.ts +0 -7
  48. package/dist/failure/failure.d.ts.map +1 -1
  49. package/dist/failure/failure.js.map +1 -1
  50. package/dist/failure/predicates.d.ts +6 -0
  51. package/dist/failure/predicates.d.ts.map +1 -1
  52. package/dist/failure/predicates.js +5 -0
  53. package/dist/failure/predicates.js.map +1 -1
  54. package/dist/hierarchy/hierarchy.d.ts.map +1 -1
  55. package/dist/hierarchy/hierarchy.js +1 -2
  56. package/dist/hierarchy/hierarchy.js.map +1 -1
  57. package/dist/i18n/locales.d.ts.map +1 -1
  58. package/dist/i18n/locales.js +19 -4
  59. package/dist/i18n/locales.js.map +1 -1
  60. package/dist/index.d.ts +0 -1
  61. package/dist/index.d.ts.map +1 -1
  62. package/dist/index.js +0 -1
  63. package/dist/index.js.map +1 -1
  64. package/dist/query/in-memory-query.d.ts.map +1 -1
  65. package/dist/query/in-memory-query.js +1 -2
  66. package/dist/query/in-memory-query.js.map +1 -1
  67. package/dist/rsql/coerce-rsql.d.ts +1 -1
  68. package/dist/rsql/coerce-rsql.d.ts.map +1 -1
  69. package/dist/rsql/coerce-rsql.js +2 -3
  70. package/dist/rsql/coerce-rsql.js.map +1 -1
  71. package/dist/rsql/facet-query-url.d.ts +1 -1
  72. package/dist/rsql/facet-query-url.d.ts.map +1 -1
  73. package/dist/rsql/facet-query-url.js +4 -9
  74. package/dist/rsql/facet-query-url.js.map +1 -1
  75. package/dist/rsql/load-request-url.d.ts +1 -1
  76. package/dist/rsql/load-request-url.d.ts.map +1 -1
  77. package/dist/rsql/load-request-url.js +2 -5
  78. package/dist/rsql/load-request-url.js.map +1 -1
  79. package/dist/rsql/parse-rsql.d.ts +1 -1
  80. package/dist/rsql/parse-rsql.d.ts.map +1 -1
  81. package/dist/rsql/parse-rsql.js +2 -5
  82. package/dist/rsql/parse-rsql.js.map +1 -1
  83. package/dist/use-case-runner/entity-writer.d.ts +24 -0
  84. package/dist/use-case-runner/entity-writer.d.ts.map +1 -0
  85. package/dist/use-case-runner/entity-writer.js +12 -0
  86. package/dist/use-case-runner/entity-writer.js.map +1 -0
  87. package/dist/use-case-runner/index.d.ts +2 -0
  88. package/dist/use-case-runner/index.d.ts.map +1 -1
  89. package/dist/use-case-runner/index.js +2 -0
  90. package/dist/use-case-runner/index.js.map +1 -1
  91. package/dist/use-case-runner/use-case-runner.d.ts +9 -4
  92. package/dist/use-case-runner/use-case-runner.d.ts.map +1 -1
  93. package/dist/use-case-runner/use-case-runner.js.map +1 -1
  94. package/dist/use-case-runner/write-result.d.ts +36 -0
  95. package/dist/use-case-runner/write-result.d.ts.map +1 -0
  96. package/dist/use-case-runner/write-result.js +20 -0
  97. package/dist/use-case-runner/write-result.js.map +1 -0
  98. package/dist/wizard/wizard-definition.d.ts.map +1 -1
  99. package/dist/wizard/wizard-definition.js +10 -11
  100. package/dist/wizard/wizard-definition.js.map +1 -1
  101. package/dist/wizard/wizard-navigation.d.ts +1 -1
  102. package/dist/wizard/wizard-navigation.d.ts.map +1 -1
  103. package/dist/wizard/wizard-navigation.js +2 -3
  104. package/dist/wizard/wizard-navigation.js.map +1 -1
  105. package/package.json +3 -3
  106. package/dist/base-entities/entifix-error/entifix-error.d.ts +0 -31
  107. package/dist/base-entities/entifix-error/entifix-error.d.ts.map +0 -1
  108. package/dist/base-entities/entifix-error/entifix-error.js +0 -56
  109. package/dist/base-entities/entifix-error/entifix-error.js.map +0 -1
  110. package/dist/base-entities/entifix-error/index.d.ts +0 -2
  111. package/dist/base-entities/entifix-error/index.d.ts.map +0 -1
  112. package/dist/base-entities/entifix-error/index.js +0 -3
  113. package/dist/base-entities/entifix-error/index.js.map +0 -1
@@ -1,5 +1,4 @@
1
1
  import { Effect } from 'effect';
2
- import { EntifixBuildError } from '../entifix-error/index.js';
3
2
  import { ConfigurationClient, ConfigurationClientGroup, ConfigurationExtractMode, ConfigurationItem, ConfigurationPlain } from './types.js';
4
3
  /**
5
4
  * In-memory {@link ConfigurationClientGroup} backed by a group's
@@ -13,18 +12,18 @@ import { ConfigurationClient, ConfigurationClientGroup, ConfigurationExtractMode
13
12
  export declare class ConfigurationClientGroupInMemory implements ConfigurationClientGroup {
14
13
  #private;
15
14
  constructor(items?: ConfigurationItem[]);
16
- getString(key: string, extractMode?: ConfigurationExtractMode): Effect.Effect<string, EntifixBuildError>;
17
- getNumber(key: string, extractMode?: ConfigurationExtractMode): Effect.Effect<number, EntifixBuildError>;
18
- getDate(key: string, extractMode?: ConfigurationExtractMode): Effect.Effect<Date, EntifixBuildError>;
19
- getArrayString(key: string, extractMode?: ConfigurationExtractMode): Effect.Effect<string[], EntifixBuildError>;
20
- getArrayNumber(key: string, extractMode?: ConfigurationExtractMode): Effect.Effect<number[], EntifixBuildError>;
21
- getArrayDate(key: string, extractMode?: ConfigurationExtractMode): Effect.Effect<Date[], EntifixBuildError>;
22
- getOptionalString(key: string, extractMode?: ConfigurationExtractMode): Effect.Effect<string | undefined, EntifixBuildError>;
23
- getOptionalNumber(key: string, extractMode?: ConfigurationExtractMode): Effect.Effect<number | undefined, EntifixBuildError>;
24
- getOptionalDate(key: string, extractMode?: ConfigurationExtractMode): Effect.Effect<Date | undefined, EntifixBuildError>;
25
- getOptionalArrayNumber(key: string, extractMode?: ConfigurationExtractMode): Effect.Effect<number[] | undefined, EntifixBuildError>;
26
- getOptionalArrayString(key: string, extractMode?: ConfigurationExtractMode): Effect.Effect<string[] | undefined, EntifixBuildError>;
27
- getOptionalArrayDate(key: string, extractMode?: ConfigurationExtractMode): Effect.Effect<Date[] | undefined, EntifixBuildError>;
15
+ getString(key: string, extractMode?: ConfigurationExtractMode): Effect.Effect<string>;
16
+ getNumber(key: string, extractMode?: ConfigurationExtractMode): Effect.Effect<number>;
17
+ getDate(key: string, extractMode?: ConfigurationExtractMode): Effect.Effect<Date>;
18
+ getArrayString(key: string, extractMode?: ConfigurationExtractMode): Effect.Effect<string[]>;
19
+ getArrayNumber(key: string, extractMode?: ConfigurationExtractMode): Effect.Effect<number[]>;
20
+ getArrayDate(key: string, extractMode?: ConfigurationExtractMode): Effect.Effect<Date[]>;
21
+ getOptionalString(key: string, extractMode?: ConfigurationExtractMode): Effect.Effect<string | undefined>;
22
+ getOptionalNumber(key: string, extractMode?: ConfigurationExtractMode): Effect.Effect<number | undefined>;
23
+ getOptionalDate(key: string, extractMode?: ConfigurationExtractMode): Effect.Effect<Date | undefined>;
24
+ getOptionalArrayNumber(key: string, extractMode?: ConfigurationExtractMode): Effect.Effect<number[] | undefined>;
25
+ getOptionalArrayString(key: string, extractMode?: ConfigurationExtractMode): Effect.Effect<string[] | undefined>;
26
+ getOptionalArrayDate(key: string, extractMode?: ConfigurationExtractMode): Effect.Effect<Date[] | undefined>;
28
27
  }
29
28
  /**
30
29
  * In-memory {@link ConfigurationClient} backed by a loaded
@@ -1 +1 @@
1
- {"version":3,"file":"configuration-client-singleton.d.ts","sourceRoot":"","sources":["../../../src/base-entities/configuration-client/configuration-client-singleton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,wBAAwB,EACxB,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAkEpB;;;;;;;;GAQG;AACH,qBAAa,gCAAiC,YAAW,wBAAwB;;gBAGnE,KAAK,GAAE,iBAAiB,EAAO;IA0C3C,SAAS,CACP,GAAG,EAAE,MAAM,EACX,WAAW,GAAE,wBAAkC,GAC9C,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC;IAa3C,SAAS,CACP,GAAG,EAAE,MAAM,EACX,WAAW,GAAE,wBAAkC,GAC9C,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC;IAK3C,OAAO,CACL,GAAG,EAAE,MAAM,EACX,WAAW,GAAE,wBAAkC,GAC9C,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,iBAAiB,CAAC;IAKzC,cAAc,CACZ,GAAG,EAAE,MAAM,EACX,WAAW,GAAE,wBAAkC,GAC9C,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,iBAAiB,CAAC;IAK7C,cAAc,CACZ,GAAG,EAAE,MAAM,EACX,WAAW,GAAE,wBAAkC,GAC9C,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,iBAAiB,CAAC;IAS7C,YAAY,CACV,GAAG,EAAE,MAAM,EACX,WAAW,GAAE,wBAAkC,GAC9C,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,iBAAiB,CAAC;IAS3C,iBAAiB,CACf,GAAG,EAAE,MAAM,EACX,WAAW,GAAE,wBAAkC,GAC9C,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,SAAS,EAAE,iBAAiB,CAAC;IAKvD,iBAAiB,CACf,GAAG,EAAE,MAAM,EACX,WAAW,GAAE,wBAAkC,GAC9C,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,SAAS,EAAE,iBAAiB,CAAC;IASvD,eAAe,CACb,GAAG,EAAE,MAAM,EACX,WAAW,GAAE,wBAAkC,GAC9C,MAAM,CAAC,MAAM,CAAC,IAAI,GAAG,SAAS,EAAE,iBAAiB,CAAC;IASrD,sBAAsB,CACpB,GAAG,EAAE,MAAM,EACX,WAAW,GAAE,wBAAkC,GAC9C,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,SAAS,EAAE,iBAAiB,CAAC;IAazD,sBAAsB,CACpB,GAAG,EAAE,MAAM,EACX,WAAW,GAAE,wBAAkC,GAC9C,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,SAAS,EAAE,iBAAiB,CAAC;IAOzD,oBAAoB,CAClB,GAAG,EAAE,MAAM,EACX,WAAW,GAAE,wBAAkC,GAC9C,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,SAAS,EAAE,iBAAiB,CAAC;CAUxD;AAED;;;;GAIG;AACH,qBAAa,2BAA4B,YAAW,mBAAmB;;gBAGzD,WAAW,GAAE,kBAAuB;IAIhD,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,wBAAwB;CAG5C"}
1
+ {"version":3,"file":"configuration-client-singleton.d.ts","sourceRoot":"","sources":["../../../src/base-entities/configuration-client/configuration-client-singleton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,wBAAwB,EACxB,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,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;IAatC,sBAAsB,CACpB,GAAG,EAAE,MAAM,EACX,WAAW,GAAE,wBAAkC,GAC9C,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,SAAS,CAAC;IAOtC,oBAAoB,CAClB,GAAG,EAAE,MAAM,EACX,WAAW,GAAE,wBAAkC,GAC9C,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,SAAS,CAAC;CAUrC;AAED;;;;GAIG;AACH,qBAAa,2BAA4B,YAAW,mBAAmB;;gBAGzD,WAAW,GAAE,kBAAuB;IAIhD,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,wBAAwB;CAG5C"}
@@ -1,7 +1,6 @@
1
1
  import { _ as _class_private_field_loose_base } from "@swc/helpers/_/_class_private_field_loose_base";
2
2
  import { _ as _class_private_field_loose_key } from "@swc/helpers/_/_class_private_field_loose_key";
3
3
  import { Effect } from 'effect';
4
- import { EntifixBuildError } from '../entifix-error/index.js';
5
4
  /**
6
5
  * Joins a base URL with extra path segments, normalizing slashes so neither
7
6
  * doubled nor missing separators appear (e.g. `http://h/api` + `['product']`
@@ -15,20 +14,14 @@ import { EntifixBuildError } from '../entifix-error/index.js';
15
14
  /** Parses a raw string into a finite number, failing on non-numeric input. */ function parseNumber(key, raw) {
16
15
  const parsed = Number(raw);
17
16
  if (raw.trim() === '' || Number.isNaN(parsed)) {
18
- return Effect.fail(new EntifixBuildError(`Configuration key "${key}" is not a number`, undefined, {
19
- key,
20
- raw
21
- }));
17
+ return Effect.die(new Error(`Configuration key "${key}" is not a number`));
22
18
  }
23
19
  return Effect.succeed(parsed);
24
20
  }
25
21
  /** Parses a raw string into a valid Date, failing on unparseable input. */ function parseDate(key, raw) {
26
22
  const parsed = new Date(raw);
27
23
  if (Number.isNaN(parsed.getTime())) {
28
- return Effect.fail(new EntifixBuildError(`Configuration key "${key}" is not a date`, undefined, {
29
- key,
30
- raw
31
- }));
24
+ return Effect.die(new Error(`Configuration key "${key}" is not a date`));
32
25
  }
33
26
  return Effect.succeed(parsed);
34
27
  }
@@ -125,10 +118,7 @@ function find(key) {
125
118
  function lookup(key) {
126
119
  const item = _class_private_field_loose_base(this, _find)[_find](key);
127
120
  if (item === undefined || item.value == null) {
128
- return Effect.fail(new EntifixBuildError(`Configuration key "${key}" not found`, undefined, {
129
- key,
130
- availableKeys: _class_private_field_loose_base(this, _items)[_items].map((candidate)=>candidate.key)
131
- }));
121
+ return Effect.die(new Error(`Configuration key "${key}" not found (available: ${_class_private_field_loose_base(this, _items)[_items].map((candidate)=>candidate.key).join(', ') || 'none'})`));
132
122
  }
133
123
  return Effect.succeed(String(item.value));
134
124
  }
@@ -137,10 +127,7 @@ function lookupOptional(key) {
137
127
  return Effect.succeed(item === undefined || item.value == null ? undefined : String(item.value));
138
128
  }
139
129
  function unsupportedMode(key, extractMode) {
140
- return Effect.fail(new EntifixBuildError(`Configuration extract mode "${extractMode}" is not implemented yet`, undefined, {
141
- key,
142
- extractMode
143
- }));
130
+ return Effect.die(new Error(`Configuration extract mode "${extractMode}" is not implemented yet`));
144
131
  }
145
132
  var _plainConfig = /*#__PURE__*/ _class_private_field_loose_key("_plainConfig");
146
133
  /**
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/base-entities/configuration-client/configuration-client-singleton.ts"],"sourcesContent":["import { Effect } from 'effect';\n\nimport { EntifixBuildError } from '../entifix-error/index.js';\nimport {\n ConfigurationClient,\n ConfigurationClientGroup,\n ConfigurationExtractMode,\n ConfigurationItem,\n ConfigurationPlain,\n} from './types.js';\n\n/**\n * Joins a base URL with extra path segments, normalizing slashes so neither\n * doubled nor missing separators appear (e.g. `http://h/api` + `['product']`\n * -> `http://h/api/product`).\n */\nfunction composeUrl(base: string, segments: string[]): string {\n return [\n base.replace(/\\/+$/, ''),\n ...segments.map(segment => segment.replace(/^\\/+|\\/+$/g, '')),\n ]\n .filter(part => part.length > 0)\n .join('/');\n}\n\n/** Parses a raw string into a finite number, failing on non-numeric input. */\nfunction parseNumber(\n key: string,\n raw: string,\n): Effect.Effect<number, EntifixBuildError> {\n const parsed = Number(raw);\n if (raw.trim() === '' || Number.isNaN(parsed)) {\n return Effect.fail(\n new EntifixBuildError(\n `Configuration key \"${key}\" is not a number`,\n undefined,\n {\n key,\n raw,\n },\n ),\n );\n }\n return Effect.succeed(parsed);\n}\n\n/** Parses a raw string into a valid Date, failing on unparseable input. */\nfunction parseDate(\n key: string,\n raw: string,\n): Effect.Effect<Date, EntifixBuildError> {\n const parsed = new Date(raw);\n if (Number.isNaN(parsed.getTime())) {\n return Effect.fail(\n new EntifixBuildError(\n `Configuration key \"${key}\" is not a date`,\n undefined,\n {\n key,\n raw,\n },\n ),\n );\n }\n return Effect.succeed(parsed);\n}\n\n/** Splits a comma-separated raw value into trimmed, non-empty segments. */\nfunction splitArray(raw: string): string[] {\n return raw\n .split(',')\n .map(segment => segment.trim())\n .filter(segment => segment.length > 0);\n}\n\n/**\n * In-memory {@link ConfigurationClientGroup} backed by a group's\n * {@link ConfigurationItem} list.\n *\n * String resolution supports `exact` and `compose`; the numeric/date/array\n * getters resolve the raw value with `exact` semantics (the `compose` mode is\n * URL-oriented and only meaningful for strings). `match` remains unimplemented\n * (no defined semantics / consumer yet) and fails explicitly.\n */\nexport class ConfigurationClientGroupInMemory implements ConfigurationClientGroup {\n #items: ConfigurationItem[];\n\n constructor(items: ConfigurationItem[] = []) {\n this.#items = items;\n }\n\n #find(key: string): ConfigurationItem | undefined {\n return this.#items.find(candidate => candidate.key === key);\n }\n\n #lookup(key: string): Effect.Effect<string, EntifixBuildError> {\n const item = this.#find(key);\n if (item === undefined || item.value == null) {\n return Effect.fail(\n new EntifixBuildError(\n `Configuration key \"${key}\" not found`,\n undefined,\n { key, availableKeys: this.#items.map(candidate => candidate.key) },\n ),\n );\n }\n return Effect.succeed(String(item.value));\n }\n\n #lookupOptional(key: string): Effect.Effect<string | undefined, never> {\n const item = this.#find(key);\n return Effect.succeed(\n item === undefined || item.value == null ? undefined : String(item.value),\n );\n }\n\n #unsupportedMode(\n key: string,\n extractMode: ConfigurationExtractMode,\n ): Effect.Effect<never, EntifixBuildError> {\n return Effect.fail(\n new EntifixBuildError(\n `Configuration extract mode \"${extractMode}\" is not implemented yet`,\n undefined,\n { key, extractMode },\n ),\n );\n }\n\n getString(\n key: string,\n extractMode: ConfigurationExtractMode = 'exact',\n ): Effect.Effect<string, EntifixBuildError> {\n if (extractMode === 'compose') {\n const [head, ...segments] = key.split('.');\n return this.#lookup(head).pipe(\n Effect.map(base => composeUrl(base, segments)),\n );\n }\n if (extractMode === 'exact') {\n return this.#lookup(key);\n }\n return this.#unsupportedMode(key, extractMode);\n }\n\n getNumber(\n key: string,\n extractMode: ConfigurationExtractMode = 'exact',\n ): Effect.Effect<number, EntifixBuildError> {\n if (extractMode !== 'exact') return this.#unsupportedMode(key, extractMode);\n return this.#lookup(key).pipe(Effect.flatMap(raw => parseNumber(key, raw)));\n }\n\n getDate(\n key: string,\n extractMode: ConfigurationExtractMode = 'exact',\n ): Effect.Effect<Date, EntifixBuildError> {\n if (extractMode !== 'exact') return this.#unsupportedMode(key, extractMode);\n return this.#lookup(key).pipe(Effect.flatMap(raw => parseDate(key, raw)));\n }\n\n getArrayString(\n key: string,\n extractMode: ConfigurationExtractMode = 'exact',\n ): Effect.Effect<string[], EntifixBuildError> {\n if (extractMode !== 'exact') return this.#unsupportedMode(key, extractMode);\n return this.#lookup(key).pipe(Effect.map(splitArray));\n }\n\n getArrayNumber(\n key: string,\n extractMode: ConfigurationExtractMode = 'exact',\n ): Effect.Effect<number[], EntifixBuildError> {\n if (extractMode !== 'exact') return this.#unsupportedMode(key, extractMode);\n return this.#lookup(key).pipe(\n Effect.flatMap(raw =>\n Effect.all(splitArray(raw).map(segment => parseNumber(key, segment))),\n ),\n );\n }\n\n getArrayDate(\n key: string,\n extractMode: ConfigurationExtractMode = 'exact',\n ): Effect.Effect<Date[], EntifixBuildError> {\n if (extractMode !== 'exact') return this.#unsupportedMode(key, extractMode);\n return this.#lookup(key).pipe(\n Effect.flatMap(raw =>\n Effect.all(splitArray(raw).map(segment => parseDate(key, segment))),\n ),\n );\n }\n\n getOptionalString(\n key: string,\n extractMode: ConfigurationExtractMode = 'exact',\n ): Effect.Effect<string | undefined, EntifixBuildError> {\n if (extractMode !== 'exact') return this.#unsupportedMode(key, extractMode);\n return this.#lookupOptional(key);\n }\n\n getOptionalNumber(\n key: string,\n extractMode: ConfigurationExtractMode = 'exact',\n ): Effect.Effect<number | undefined, EntifixBuildError> {\n if (extractMode !== 'exact') return this.#unsupportedMode(key, extractMode);\n return this.#lookupOptional(key).pipe(\n Effect.flatMap(raw =>\n raw === undefined ? Effect.succeed(undefined) : parseNumber(key, raw),\n ),\n );\n }\n\n getOptionalDate(\n key: string,\n extractMode: ConfigurationExtractMode = 'exact',\n ): Effect.Effect<Date | undefined, EntifixBuildError> {\n if (extractMode !== 'exact') return this.#unsupportedMode(key, extractMode);\n return this.#lookupOptional(key).pipe(\n Effect.flatMap(raw =>\n raw === undefined ? Effect.succeed(undefined) : parseDate(key, raw),\n ),\n );\n }\n\n getOptionalArrayNumber(\n key: string,\n extractMode: ConfigurationExtractMode = 'exact',\n ): Effect.Effect<number[] | undefined, EntifixBuildError> {\n if (extractMode !== 'exact') return this.#unsupportedMode(key, extractMode);\n return this.#lookupOptional(key).pipe(\n Effect.flatMap(raw =>\n raw === undefined\n ? Effect.succeed(undefined)\n : Effect.all(\n splitArray(raw).map(segment => parseNumber(key, segment)),\n ),\n ),\n );\n }\n\n getOptionalArrayString(\n key: string,\n extractMode: ConfigurationExtractMode = 'exact',\n ): Effect.Effect<string[] | undefined, EntifixBuildError> {\n if (extractMode !== 'exact') return this.#unsupportedMode(key, extractMode);\n return this.#lookupOptional(key).pipe(\n Effect.map(raw => (raw === undefined ? undefined : splitArray(raw))),\n );\n }\n\n getOptionalArrayDate(\n key: string,\n extractMode: ConfigurationExtractMode = 'exact',\n ): Effect.Effect<Date[] | undefined, EntifixBuildError> {\n if (extractMode !== 'exact') return this.#unsupportedMode(key, extractMode);\n return this.#lookupOptional(key).pipe(\n Effect.flatMap(raw =>\n raw === undefined\n ? Effect.succeed(undefined)\n : Effect.all(splitArray(raw).map(segment => parseDate(key, segment))),\n ),\n );\n }\n}\n\n/**\n * In-memory {@link ConfigurationClient} backed by a loaded\n * {@link ConfigurationPlain}. Each `in(group)` returns a group view scoped to\n * that group's items.\n */\nexport class ConfigurationClientInMemory implements ConfigurationClient {\n #plainConfig: ConfigurationPlain;\n\n constructor(plainConfig: ConfigurationPlain = {}) {\n this.#plainConfig = plainConfig;\n }\n\n in(group: string): ConfigurationClientGroup {\n return new ConfigurationClientGroupInMemory(this.#plainConfig[group] ?? []);\n }\n}\n"],"names":["Effect","EntifixBuildError","composeUrl","base","segments","replace","map","segment","filter","part","length","join","parseNumber","key","raw","parsed","Number","trim","isNaN","fail","undefined","succeed","parseDate","Date","getTime","splitArray","split","ConfigurationClientGroupInMemory","getString","extractMode","head","pipe","getNumber","flatMap","getDate","getArrayString","getArrayNumber","all","getArrayDate","getOptionalString","getOptionalNumber","getOptionalDate","getOptionalArrayNumber","getOptionalArrayString","getOptionalArrayDate","items","find","candidate","item","value","availableKeys","String","ConfigurationClientInMemory","in","group","plainConfig"],"mappings":";;AAAA,SAASA,MAAM,QAAQ,SAAS;AAEhC,SAASC,iBAAiB,QAAQ,4BAA4B;AAS9D;;;;CAIC,GACD,SAASC,WAAWC,IAAY,EAAEC,QAAkB;IAClD,OAAO;QACLD,KAAKE,OAAO,CAAC,QAAQ;WAClBD,SAASE,GAAG,CAACC,CAAAA,UAAWA,QAAQF,OAAO,CAAC,cAAc;KAC1D,CACEG,MAAM,CAACC,CAAAA,OAAQA,KAAKC,MAAM,GAAG,GAC7BC,IAAI,CAAC;AACV;AAEA,4EAA4E,GAC5E,SAASC,YACPC,GAAW,EACXC,GAAW;IAEX,MAAMC,SAASC,OAAOF;IACtB,IAAIA,IAAIG,IAAI,OAAO,MAAMD,OAAOE,KAAK,CAACH,SAAS;QAC7C,O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QAAE;IAGxE;IACA,OAAOb,OAAOqB,OAAO,CAAC8B,OAAOH,KAAKC,KAAK;AACzC;AAEA,SAAA,eAAgBpC,GAAW;IACzB,MAAMmC,OAAO,gCAAA,IAAI,EAAC,OAAA,OAAMnC;IACxB,OAAOb,OAAOqB,OAAO,CACnB2B,SAAS5B,aAAa4B,KAAKC,KAAK,IAAI,OAAO7B,YAAY+B,OAAOH,KAAKC,KAAK;AAE5E;AAEA,SAAA,gBACEpC,GAAW,EACXgB,WAAqC;IAErC,OAAO7B,OAAOmB,IAAI,CAChB,IAAIlB,kBACF,CAAC,4BAA4B,EAAE4B,YAAY,wBAAwB,CAAC,EACpET,WACA;QAAEP;QAAKgB;IAAY;AAGzB;IAiJA;AANF;;;;CAIC,GACD,OAAO,MAAMuB;IAOXC,GAAGC,KAAa,EAA4B;YACE;QAA5C,OAAO,IAAI3B,kCAAiC,qDAAA,gCAAA,IAAI,EAAC,cAAA,aAAY,CAAC2B,MAAM,YAAxB,qDAA4B,EAAE;IAC5E;IANA,YAAYC,cAAkC,CAAC,CAAC,CAAE;QAFlD,4BAAA;;mBAAA,KAAA;;QAGE,gCAAA,IAAI,EAAC,cAAA,gBAAeA;IACtB;AAKF"}
1
+ {"version":3,"sources":["../../../src/base-entities/configuration-client/configuration-client-singleton.ts"],"sourcesContent":["import { Effect } from 'effect';\n\nimport {\n ConfigurationClient,\n ConfigurationClientGroup,\n ConfigurationExtractMode,\n ConfigurationItem,\n ConfigurationPlain,\n} from './types.js';\n\n/**\n * Joins a base URL with extra path segments, normalizing slashes so neither\n * doubled nor missing separators appear (e.g. `http://h/api` + `['product']`\n * -> `http://h/api/product`).\n */\nfunction composeUrl(base: string, segments: string[]): string {\n return [\n base.replace(/\\/+$/, ''),\n ...segments.map(segment => segment.replace(/^\\/+|\\/+$/g, '')),\n ]\n .filter(part => part.length > 0)\n .join('/');\n}\n\n/** Parses a raw string into a finite number, failing on non-numeric input. */\nfunction parseNumber(key: string, raw: string): Effect.Effect<number> {\n const parsed = Number(raw);\n if (raw.trim() === '' || Number.isNaN(parsed)) {\n return Effect.die(new Error(`Configuration key \"${key}\" is not a number`));\n }\n return Effect.succeed(parsed);\n}\n\n/** Parses a raw string into a valid Date, failing on unparseable input. */\nfunction parseDate(key: string, raw: string): Effect.Effect<Date> {\n const parsed = new Date(raw);\n if (Number.isNaN(parsed.getTime())) {\n return Effect.die(new Error(`Configuration key \"${key}\" is not a date`));\n }\n return Effect.succeed(parsed);\n}\n\n/** Splits a comma-separated raw value into trimmed, non-empty segments. */\nfunction splitArray(raw: string): string[] {\n return raw\n .split(',')\n .map(segment => segment.trim())\n .filter(segment => segment.length > 0);\n}\n\n/**\n * In-memory {@link ConfigurationClientGroup} backed by a group's\n * {@link ConfigurationItem} list.\n *\n * String resolution supports `exact` and `compose`; the numeric/date/array\n * getters resolve the raw value with `exact` semantics (the `compose` mode is\n * URL-oriented and only meaningful for strings). `match` remains unimplemented\n * (no defined semantics / consumer yet) and fails explicitly.\n */\nexport class ConfigurationClientGroupInMemory implements ConfigurationClientGroup {\n #items: ConfigurationItem[];\n\n constructor(items: ConfigurationItem[] = []) {\n this.#items = items;\n }\n\n #find(key: string): ConfigurationItem | undefined {\n return this.#items.find(candidate => candidate.key === key);\n }\n\n #lookup(key: string): Effect.Effect<string> {\n const item = this.#find(key);\n if (item === undefined || item.value == null) {\n return Effect.die(\n new Error(\n `Configuration key \"${key}\" not found (available: ${this.#items.map(candidate => candidate.key).join(', ') || 'none'})`,\n ),\n );\n }\n return Effect.succeed(String(item.value));\n }\n\n #lookupOptional(key: string): Effect.Effect<string | undefined, never> {\n const item = this.#find(key);\n return Effect.succeed(\n item === undefined || item.value == null ? undefined : String(item.value),\n );\n }\n\n #unsupportedMode(\n key: string,\n extractMode: ConfigurationExtractMode,\n ): Effect.Effect<never> {\n return Effect.die(\n new Error(\n `Configuration extract mode \"${extractMode}\" is not implemented yet`,\n ),\n );\n }\n\n getString(\n key: string,\n extractMode: ConfigurationExtractMode = 'exact',\n ): Effect.Effect<string> {\n if (extractMode === 'compose') {\n const [head, ...segments] = key.split('.');\n return this.#lookup(head).pipe(\n Effect.map(base => composeUrl(base, segments)),\n );\n }\n if (extractMode === 'exact') {\n return this.#lookup(key);\n }\n return this.#unsupportedMode(key, extractMode);\n }\n\n getNumber(\n key: string,\n extractMode: ConfigurationExtractMode = 'exact',\n ): Effect.Effect<number> {\n if (extractMode !== 'exact') return this.#unsupportedMode(key, extractMode);\n return this.#lookup(key).pipe(Effect.flatMap(raw => parseNumber(key, raw)));\n }\n\n getDate(\n key: string,\n extractMode: ConfigurationExtractMode = 'exact',\n ): Effect.Effect<Date> {\n if (extractMode !== 'exact') return this.#unsupportedMode(key, extractMode);\n return this.#lookup(key).pipe(Effect.flatMap(raw => parseDate(key, raw)));\n }\n\n getArrayString(\n key: string,\n extractMode: ConfigurationExtractMode = 'exact',\n ): Effect.Effect<string[]> {\n if (extractMode !== 'exact') return this.#unsupportedMode(key, extractMode);\n return this.#lookup(key).pipe(Effect.map(splitArray));\n }\n\n getArrayNumber(\n key: string,\n extractMode: ConfigurationExtractMode = 'exact',\n ): Effect.Effect<number[]> {\n if (extractMode !== 'exact') return this.#unsupportedMode(key, extractMode);\n return this.#lookup(key).pipe(\n Effect.flatMap(raw =>\n Effect.all(splitArray(raw).map(segment => parseNumber(key, segment))),\n ),\n );\n }\n\n getArrayDate(\n key: string,\n extractMode: ConfigurationExtractMode = 'exact',\n ): Effect.Effect<Date[]> {\n if (extractMode !== 'exact') return this.#unsupportedMode(key, extractMode);\n return this.#lookup(key).pipe(\n Effect.flatMap(raw =>\n Effect.all(splitArray(raw).map(segment => parseDate(key, segment))),\n ),\n );\n }\n\n getOptionalString(\n key: string,\n extractMode: ConfigurationExtractMode = 'exact',\n ): Effect.Effect<string | undefined> {\n if (extractMode !== 'exact') return this.#unsupportedMode(key, extractMode);\n return this.#lookupOptional(key);\n }\n\n getOptionalNumber(\n key: string,\n extractMode: ConfigurationExtractMode = 'exact',\n ): Effect.Effect<number | undefined> {\n if (extractMode !== 'exact') return this.#unsupportedMode(key, extractMode);\n return this.#lookupOptional(key).pipe(\n Effect.flatMap(raw =>\n raw === undefined ? Effect.succeed(undefined) : parseNumber(key, raw),\n ),\n );\n }\n\n getOptionalDate(\n key: string,\n extractMode: ConfigurationExtractMode = 'exact',\n ): Effect.Effect<Date | undefined> {\n if (extractMode !== 'exact') return this.#unsupportedMode(key, extractMode);\n return this.#lookupOptional(key).pipe(\n Effect.flatMap(raw =>\n raw === undefined ? Effect.succeed(undefined) : parseDate(key, raw),\n ),\n );\n }\n\n getOptionalArrayNumber(\n key: string,\n extractMode: ConfigurationExtractMode = 'exact',\n ): Effect.Effect<number[] | undefined> {\n if (extractMode !== 'exact') return this.#unsupportedMode(key, extractMode);\n return this.#lookupOptional(key).pipe(\n Effect.flatMap(raw =>\n raw === undefined\n ? Effect.succeed(undefined)\n : Effect.all(\n splitArray(raw).map(segment => parseNumber(key, segment)),\n ),\n ),\n );\n }\n\n getOptionalArrayString(\n key: string,\n extractMode: ConfigurationExtractMode = 'exact',\n ): Effect.Effect<string[] | undefined> {\n if (extractMode !== 'exact') return this.#unsupportedMode(key, extractMode);\n return this.#lookupOptional(key).pipe(\n Effect.map(raw => (raw === undefined ? undefined : splitArray(raw))),\n );\n }\n\n getOptionalArrayDate(\n key: string,\n extractMode: ConfigurationExtractMode = 'exact',\n ): Effect.Effect<Date[] | undefined> {\n if (extractMode !== 'exact') return this.#unsupportedMode(key, extractMode);\n return this.#lookupOptional(key).pipe(\n Effect.flatMap(raw =>\n raw === undefined\n ? Effect.succeed(undefined)\n : Effect.all(splitArray(raw).map(segment => parseDate(key, segment))),\n ),\n );\n }\n}\n\n/**\n * In-memory {@link ConfigurationClient} backed by a loaded\n * {@link ConfigurationPlain}. Each `in(group)` returns a group view scoped to\n * that group's items.\n */\nexport class ConfigurationClientInMemory implements ConfigurationClient {\n #plainConfig: ConfigurationPlain;\n\n constructor(plainConfig: ConfigurationPlain = {}) {\n this.#plainConfig = plainConfig;\n }\n\n in(group: string): ConfigurationClientGroup {\n return new ConfigurationClientGroupInMemory(this.#plainConfig[group] ?? []);\n }\n}\n"],"names":["Effect","composeUrl","base","segments","replace","map","segment","filter","part","length","join","parseNumber","key","raw","parsed","Number","trim","isNaN","die","Error","succeed","parseDate","Date","getTime","splitArray","split","ConfigurationClientGroupInMemory","getString","extractMode","head","pipe","getNumber","flatMap","getDate","getArrayString","getArrayNumber","all","getArrayDate","getOptionalString","getOptionalNumber","undefined","getOptionalDate","getOptionalArrayNumber","getOptionalArrayString","getOptionalArrayDate","items","find","candidate","item","value","String","ConfigurationClientInMemory","in","group","plainConfig"],"mappings":";;AAAA,SAASA,MAAM,QAAQ,SAAS;AAUhC;;;;CAIC,GACD,SAASC,WAAWC,IAAY,EAAEC,QAAkB;IAClD,OAAO;QACLD,KAAKE,OAAO,CAAC,QAAQ;WAClBD,SAASE,GAAG,CAACC,CAAAA,UAAWA,QAAQF,OAAO,CAAC,cAAc;KAC1D,CACEG,MAAM,CAACC,CAAAA,OAAQA,KAAKC,MAAM,GAAG,GAC7BC,IAAI,CAAC;AACV;AAEA,4EAA4E,GAC5E,SAASC,YAAYC,GAAW,EAAEC,GAAW;IAC3C,MAAMC,SAASC,OAAOF;IACtB,IAAIA,IAAIG,IAAI,OAAO,MAAMD,OAAOE,KAAK,CAACH,SAAS;QAC7C,OAAOd,OAAOkB,GAAG,CAAC,IAAIC,MAAM,CAAC,mBAAmB,EAAEP,IAAI,iBAAiB,CAAC;IAC1E;IACA,OAAOZ,OAAOoB,OAAO,CAACN;AACxB;AAEA,yEAAyE,GACzE,SAASO,UAAUT,GAAW,EAAEC,GAAW;IACzC,MAAMC,SAAS,IAAIQ,KAAKT;IACxB,IAAIE,OAAOE,KAAK,CAACH,OAAOS,OAAO,KAAK;QAClC,OAAOvB,OAAOkB,GAAG,CAAC,IAAIC,MAAM,CAAC,mBAAmB,EAAEP,IAAI,eAAe,CAAC;IACxE;IACA,OAAOZ,OAA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;AANF;;;;CAIC,GACD,OAAO,MAAMuB;IAOXC,GAAGC,KAAa,EAA4B;YACE;QAA5C,OAAO,IAAI3B,kCAAiC,qDAAA,gCAAA,IAAI,EAAC,cAAA,aAAY,CAAC2B,MAAM,YAAxB,qDAA4B,EAAE;IAC5E;IANA,YAAYC,cAAkC,CAAC,CAAC,CAAE;QAFlD,4BAAA;;mBAAA,KAAA;;QAGE,gCAAA,IAAI,EAAC,cAAA,gBAAeA;IACtB;AAKF"}
@@ -1,19 +1,19 @@
1
1
  import { Effect } from 'effect/Effect';
2
- import { EntifixBuildError } from '../entifix-error/index.js';
2
+ import type { Unavailable } from '../../failure/generic.js';
3
3
  export type ConfigurationExtractMode = 'exact' | 'match' | 'compose';
4
4
  export interface ConfigurationClientGroup {
5
- getNumber(key: string, extractMode?: ConfigurationExtractMode): Effect<number, EntifixBuildError>;
6
- getString(key: string, extractMode?: ConfigurationExtractMode): Effect<string, EntifixBuildError>;
7
- getDate(key: string, extractMode?: ConfigurationExtractMode): Effect<Date, EntifixBuildError>;
8
- getArrayNumber(key: string, extractMode?: ConfigurationExtractMode): Effect<number[], EntifixBuildError>;
9
- getArrayString(key: string, extractMode?: ConfigurationExtractMode): Effect<string[], EntifixBuildError>;
10
- getArrayDate(key: string, extractMode?: ConfigurationExtractMode): Effect<Date[], EntifixBuildError>;
11
- getOptionalNumber(key: string, extractMode?: ConfigurationExtractMode): Effect<number | undefined, EntifixBuildError>;
12
- getOptionalString(key: string, extractMode?: ConfigurationExtractMode): Effect<string | undefined, EntifixBuildError>;
13
- getOptionalDate(key: string, extractMode?: ConfigurationExtractMode): Effect<Date | undefined, EntifixBuildError>;
14
- getOptionalArrayNumber(key: string, extractMode?: ConfigurationExtractMode): Effect<number[] | undefined, EntifixBuildError>;
15
- getOptionalArrayString(key: string, extractMode?: ConfigurationExtractMode): Effect<string[] | undefined, EntifixBuildError>;
16
- getOptionalArrayDate(key: string, extractMode?: ConfigurationExtractMode): Effect<Date[] | undefined, EntifixBuildError>;
5
+ getNumber(key: string, extractMode?: ConfigurationExtractMode): Effect<number, Unavailable>;
6
+ getString(key: string, extractMode?: ConfigurationExtractMode): Effect<string, Unavailable>;
7
+ getDate(key: string, extractMode?: ConfigurationExtractMode): Effect<Date, Unavailable>;
8
+ getArrayNumber(key: string, extractMode?: ConfigurationExtractMode): Effect<number[], Unavailable>;
9
+ getArrayString(key: string, extractMode?: ConfigurationExtractMode): Effect<string[], Unavailable>;
10
+ getArrayDate(key: string, extractMode?: ConfigurationExtractMode): Effect<Date[], Unavailable>;
11
+ getOptionalNumber(key: string, extractMode?: ConfigurationExtractMode): Effect<number | undefined, Unavailable>;
12
+ getOptionalString(key: string, extractMode?: ConfigurationExtractMode): Effect<string | undefined, Unavailable>;
13
+ getOptionalDate(key: string, extractMode?: ConfigurationExtractMode): Effect<Date | undefined, Unavailable>;
14
+ getOptionalArrayNumber(key: string, extractMode?: ConfigurationExtractMode): Effect<number[] | undefined, Unavailable>;
15
+ getOptionalArrayString(key: string, extractMode?: ConfigurationExtractMode): Effect<string[] | undefined, Unavailable>;
16
+ getOptionalArrayDate(key: string, extractMode?: ConfigurationExtractMode): Effect<Date[] | undefined, Unavailable>;
17
17
  }
18
18
  export interface ConfigurationClient {
19
19
  in(key: string): ConfigurationClientGroup;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/base-entities/configuration-client/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D,MAAM,MAAM,wBAAwB,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;AAErE,MAAM,WAAW,wBAAwB;IACvC,SAAS,CACP,GAAG,EAAE,MAAM,EACX,WAAW,CAAC,EAAE,wBAAwB,GACrC,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IACrC,SAAS,CACP,GAAG,EAA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B,CAAC,CAAC;IACnD,oBAAoB,CAClB,GAAG,EAAE,MAAM,EACX,WAAW,CAAC,EAAE,wBAAwB,GACrC,MAAM,CAAC,IAAI,EAAE,GAAG,SAAS,EAAE,iBAAiB,CAAC,CAAC;CAClD;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,wBAAwB,CAAC;CAC3C;AAED,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,OAAO,CAAC;IACf;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,EAAE,CAAC;CACpC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/base-entities/configuration-client/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D,MAAM,MAAM,wBAAwB,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;AAErE,MAAM,WAAW,wBAAwB;IACvC,SAAS,CACP,GAAG,EAAE,MAAM,EACX,WAAW,CAAC,EAAE,wBAAwB,GACrC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAC/B,SAAS,CACP,GAAG,EAAE,MAAM,EACX,WAAW,CAAC,EAAE,wBAAwB,GACrC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAC/B,OAAO,CACL,GAAG,EAAE,MAAM,EACX,WAAW,CAAC,EAAE,wBAAwB,GACrC,MAAM,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IAC7B,cAAc,CACZ,GAAG,EAAE,MAAM,EACX,WAAW,CAAC,EAAE,wBAAwB,GACrC,MAAM,CAAC,MAAM,EAAE,EAAE,WAAW,CAAC,CA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;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,EAAE,CAAC;CACpC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/base-entities/configuration-client/types.ts"],"sourcesContent":["import { Effect } from 'effect/Effect';\n\nimport { EntifixBuildError } from '../entifix-error/index.js';\n\nexport type ConfigurationExtractMode = 'exact' | 'match' | 'compose';\n\nexport interface ConfigurationClientGroup {\n getNumber(\n key: string,\n extractMode?: ConfigurationExtractMode,\n ): Effect<number, EntifixBuildError>;\n getString(\n key: string,\n extractMode?: ConfigurationExtractMode,\n ): Effect<string, EntifixBuildError>;\n getDate(\n key: string,\n extractMode?: ConfigurationExtractMode,\n ): Effect<Date, EntifixBuildError>;\n getArrayNumber(\n key: string,\n extractMode?: ConfigurationExtractMode,\n ): Effect<number[], EntifixBuildError>;\n getArrayString(\n key: string,\n extractMode?: ConfigurationExtractMode,\n ): Effect<string[], EntifixBuildError>;\n getArrayDate(\n key: string,\n extractMode?: ConfigurationExtractMode,\n ): Effect<Date[], EntifixBuildError>;\n getOptionalNumber(\n key: string,\n extractMode?: ConfigurationExtractMode,\n ): Effect<number | undefined, EntifixBuildError>;\n getOptionalString(\n key: string,\n extractMode?: ConfigurationExtractMode,\n ): Effect<string | undefined, EntifixBuildError>;\n getOptionalDate(\n key: string,\n extractMode?: ConfigurationExtractMode,\n ): Effect<Date | undefined, EntifixBuildError>;\n getOptionalArrayNumber(\n key: string,\n extractMode?: ConfigurationExtractMode,\n ): Effect<number[] | undefined, EntifixBuildError>;\n getOptionalArrayString(\n key: string,\n extractMode?: ConfigurationExtractMode,\n ): Effect<string[] | undefined, EntifixBuildError>;\n getOptionalArrayDate(\n key: string,\n extractMode?: ConfigurationExtractMode,\n ): Effect<Date[] | undefined, EntifixBuildError>;\n}\n\nexport interface ConfigurationClient {\n in(key: string): ConfigurationClientGroup;\n}\n\nexport interface ConfigurationItem {\n key: string;\n value: unknown;\n /**\n * Marks the value as a credential — a connection password, a signing key.\n *\n * It travels with the item because the only place that knows is the\n * configuration store's own `is_secret` column, while the place that must act\n * on it is a service's `GET /api/config` introspection route, several hops\n * away. Inferring it there from the key's *name* would be a guess, and the\n * cost of guessing wrong is publishing a private key.\n */\n isSecret?: boolean;\n}\n\nexport interface ConfigurationPlain {\n [key: string]: ConfigurationItem[];\n}\n"],"names":[],"mappings":"AA4EA,WAEC"}
1
+ {"version":3,"sources":["../../../src/base-entities/configuration-client/types.ts"],"sourcesContent":["import { Effect } from 'effect/Effect';\n\nimport type { Unavailable } from '../../failure/generic.js';\n\nexport type ConfigurationExtractMode = 'exact' | 'match' | 'compose';\n\nexport interface ConfigurationClientGroup {\n getNumber(\n key: string,\n extractMode?: ConfigurationExtractMode,\n ): Effect<number, Unavailable>;\n getString(\n key: string,\n extractMode?: ConfigurationExtractMode,\n ): Effect<string, Unavailable>;\n getDate(\n key: string,\n extractMode?: ConfigurationExtractMode,\n ): Effect<Date, Unavailable>;\n getArrayNumber(\n key: string,\n extractMode?: ConfigurationExtractMode,\n ): Effect<number[], Unavailable>;\n getArrayString(\n key: string,\n extractMode?: ConfigurationExtractMode,\n ): Effect<string[], Unavailable>;\n getArrayDate(\n key: string,\n extractMode?: ConfigurationExtractMode,\n ): Effect<Date[], Unavailable>;\n getOptionalNumber(\n key: string,\n extractMode?: ConfigurationExtractMode,\n ): Effect<number | undefined, Unavailable>;\n getOptionalString(\n key: string,\n extractMode?: ConfigurationExtractMode,\n ): Effect<string | undefined, Unavailable>;\n getOptionalDate(\n key: string,\n extractMode?: ConfigurationExtractMode,\n ): Effect<Date | undefined, Unavailable>;\n getOptionalArrayNumber(\n key: string,\n extractMode?: ConfigurationExtractMode,\n ): Effect<number[] | undefined, Unavailable>;\n getOptionalArrayString(\n key: string,\n extractMode?: ConfigurationExtractMode,\n ): Effect<string[] | undefined, Unavailable>;\n getOptionalArrayDate(\n key: string,\n extractMode?: ConfigurationExtractMode,\n ): Effect<Date[] | undefined, Unavailable>;\n}\n\nexport interface ConfigurationClient {\n in(key: string): ConfigurationClientGroup;\n}\n\nexport interface ConfigurationItem {\n key: string;\n value: unknown;\n /**\n * Marks the value as a credential — a connection password, a signing key.\n *\n * It travels with the item because the only place that knows is the\n * configuration store's own `is_secret` column, while the place that must act\n * on it is a service's `GET /api/config` introspection route, several hops\n * away. Inferring it there from the key's *name* would be a guess, and the\n * cost of guessing wrong is publishing a private key.\n */\n isSecret?: boolean;\n}\n\nexport interface ConfigurationPlain {\n [key: string]: ConfigurationItem[];\n}\n"],"names":[],"mappings":"AA4EA,WAEC"}
@@ -1 +1 @@
1
- {"version":3,"file":"command-matching.d.ts","sourceRoot":"","sources":["../../src/command-palette/command-matching.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKjD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAWpE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO,CAK3E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,EAAE,CAMjE;AAED,gDAAgD;AAChD,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,UAAU,GAAG,SAAS,CAAC;AAE1D,sEAAsE;AACtE,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,CAQ/D;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,aAAa,GACpB,MAAM,GAAG,KAAK,GAAG,MAAM,CAezB"}
1
+ {"version":3,"file":"command-matching.d.ts","sourceRoot":"","sources":["../../src/command-palette/command-matching.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKjD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAWpE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO,CAK3E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,EAAE,CAMjE;AAED,gDAAgD;AAChD,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,UAAU,GAAG,SAAS,CAAC;AAE1D,sEAAsE;AACtE,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,CAQ/D;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,aAAa,GACpB,MAAM,GAAG,KAAK,GAAG,MAAM,CAazB"}
@@ -1,4 +1,3 @@
1
- import { EntifixLogicError } from '../base-entities/entifix-error/index.js';
2
1
  /**
3
2
  * Normalize a string for matching: case-folded, and with accents removed.
4
3
  *
@@ -105,10 +104,7 @@ import { EntifixLogicError } from '../base-entities/entifix-error/index.js';
105
104
  'push'
106
105
  ].filter((effect)=>option[effect] !== undefined);
107
106
  if (declared.length !== 1) {
108
- throw new EntifixLogicError(`The command "${option.id}" declares ${declared.length} effects (${declared.join(', ') || 'none'}), and must declare exactly one. ` + 'Give it an `href` to navigate, a `run` to invoke, or a `push` to open another page.', undefined, {
109
- id: option.id,
110
- declared
111
- });
107
+ throw new Error(`The command "${option.id}" declares ${declared.length} effects (${declared.join(', ') || 'none'}), and must declare exactly one. ` + 'Give it an `href` to navigate, a `run` to invoke, or a `push` to open another page.');
112
108
  }
113
109
  return declared[0];
114
110
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/command-palette/command-matching.ts"],"sourcesContent":["import { EntifixLogicError } from '../base-entities/entifix-error/index.js';\nimport type { CommandOption } from './command-source.js';\n\n/**\n * Normalize a string for matching: case-folded, and with accents removed.\n *\n * ⚠️ The accent fold is correctness, not polish. The fleet ships Spanish as its\n * default locale, and without it `categoria` does not match `Categoría`, `marron`\n * does not match `Marrón`, and `articulo` does not match `Artículo` — so the\n * palette silently finds nothing for the most natural way to type most of its\n * own copy. Nobody reaches for the accented key in a search box.\n *\n * NFD splits a precomposed letter into its base plus a combining mark, and the\n * `\\p{Diacritic}` class is what then removes only the mark. `ñ` decomposes too,\n * so `nino` matches `Niño` — which is what a person typing quickly wants, even\n * though ñ is a letter of its own in Spanish rather than an accented n.\n */\nexport function foldForMatch(text: string): string {\n return text\n .normalize('NFD')\n .replace(/\\p{Diacritic}/gu, '')\n .toLocaleLowerCase();\n}\n\n/**\n * Does `text` contain every character of `term`, in order?\n *\n * Subsequence rather than substring, so `prbr` finds \"Producto Bruto\" and `numa`\n * finds \"Nueva marca\" — the thing that makes a palette feel fast. Deliberately\n * **not** scored: group order is the ranking, and a score inside\n * a group would reshuffle it on every keystroke for no gain a person can learn.\n *\n * An empty term matches everything, which is what makes an unfiltered palette\n * the same code path as a filtered one.\n */\nexport function subsequenceMatch(term: string, text: string): boolean {\n const needle = foldForMatch(term);\n if (needle === '') return true;\n\n const haystack = foldForMatch(text);\n let cursor = 0;\n for (const character of haystack) {\n if (character === needle[cursor]) cursor += 1;\n if (cursor === needle.length) return true;\n }\n return false;\n}\n\n/**\n * Does this option answer to `term`, by its label or by any of its keywords?\n *\n * The keywords are what let a Spanish command match an English word someone\n * typed — \"Nuevo producto\" answering to `new` — without translating the label.\n */\nexport function matchesCommand(term: string, option: CommandOption): boolean {\n if (subsequenceMatch(term, option.label)) return true;\n return (option.keywords ?? []).some(keyword =>\n subsequenceMatch(term, keyword),\n );\n}\n\n/**\n * Split a catalog-resolved keyword list into terms.\n *\n * `MetaUseCase.keywordsKey` is a catalog **key** rather than a `string[]` so the\n * terms are per-locale; what the catalog holds is therefore one string, and this\n * is the convention for reading it. Commas, because a keyword may itself be two\n * words (\"cerrar sesión\") and splitting on whitespace would break that into\n * terms that match nothing on their own.\n *\n * Empty entries are dropped rather than kept as `''`, which would match every\n * option through {@link subsequenceMatch}'s empty-term rule.\n */\nexport function parseKeywords(value: string | undefined): string[] {\n if (value === undefined) return [];\n return value\n .split(',')\n .map(keyword => keyword.trim())\n .filter(keyword => keyword !== '');\n}\n\n/** Which sources a typed term is asking for. */\nexport type CommandScope = 'all' | 'commands' | 'records';\n\n/** A term, split into the scope its prefix asked for and the rest. */\nexport interface ParsedCommandTerm {\n readonly scope: CommandScope;\n readonly term: string;\n}\n\n/**\n * `>` narrows to commands, `#` to records, anything else searches both.\n *\n * A grammar for *entry* rather than for depth: descending into a sub-picker is a\n * page stack, not a third prefix, because a prefix a person has to remember is\n * worse than a list they can see. Two characters only, and both are the ones\n * VS Code and GitHub already trained people on.\n *\n * The prefix is stripped and the remainder trimmed at the front only — a\n * trailing space is something the person is still typing, and eating it would\n * make the list jump between keystrokes.\n */\nexport function parseCommandTerm(raw: string): ParsedCommandTerm {\n if (raw.startsWith('>')) {\n return { scope: 'commands', term: raw.slice(1).trimStart() };\n }\n if (raw.startsWith('#')) {\n return { scope: 'records', term: raw.slice(1).trimStart() };\n }\n return { scope: 'all', term: raw };\n}\n\n/**\n * The one thing selecting an option does.\n *\n * An option declaring none is a line that looks selectable and does nothing;\n * one declaring two is a line whose behaviour depends on the order a renderer\n * happens to check its members in. Both are silent, so this throws — at the\n * first render of the palette rather than on the click, which is the posture\n * `surfaceFor` and `assertSearchable` already take for the same reason.\n */\nexport function commandEffectOf(\n option: CommandOption,\n): 'href' | 'run' | 'push' {\n const declared = (['href', 'run', 'push'] as const).filter(\n effect => option[effect] !== undefined,\n );\n\n if (declared.length !== 1) {\n throw new EntifixLogicError(\n `The command \"${option.id}\" declares ${declared.length} effects (${declared.join(', ') || 'none'}), and must declare exactly one. ` +\n 'Give it an `href` to navigate, a `run` to invoke, or a `push` to open another page.',\n undefined,\n { id: option.id, declared },\n );\n }\n\n return declared[0];\n}\n"],"names":["EntifixLogicError","foldForMatch","text","normalize","replace","toLocaleLowerCase","subsequenceMatch","term","needle","haystack","cursor","character","length","matchesCommand","option","label","keywords","some","keyword","parseKeywords","value","undefined","split","map","trim","filter","parseCommandTerm","raw","startsWith","scope","slice","trimStart","commandEffectOf","declared","effect","id","join"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,0CAA0C;AAG5E;;;;;;;;;;;;;CAaC,GACD,OAAO,SAASC,aAAaC,IAAY;IACvC,OAAOA,KACJC,SAAS,CAAC,OACVC,OAAO,CAAC,q6FAAmB,IAC3BC,iBAAiB;AACtB;AAEA;;;;;;;;;;CAUC,GACD,OAAO,SAASC,iBAAiBC,IAAY,EAAEL,IAAY;IACzD,MAAMM,SAASP,aAAaM;IAC5B,IAAIC,WAAW,IAAI,OAAO;IAE1B,MAAMC,WAAWR,aAAaC;IAC9B,IAAIQ,SAAS;IACb,KAAK,MAAMC,aAAaF,SAAU;QAChC,IAAIE,cAAcH,MAAM,CAACE,OAAO,EAAEA,UAAU;QAC5C,IAAIA,WAAWF,OAAOI,MAAM,EAAE,OAAO;IACvC;IAC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AIrB,OAAOqB,EAAE;YAAEF;QAAS;IAE9B;IAEA,OAAOA,QAAQ,CAAC,EAAE;AACpB"}
1
+ {"version":3,"sources":["../../src/command-palette/command-matching.ts"],"sourcesContent":["import type { CommandOption } from './command-source.js';\n\n/**\n * Normalize a string for matching: case-folded, and with accents removed.\n *\n * ⚠️ The accent fold is correctness, not polish. The fleet ships Spanish as its\n * default locale, and without it `categoria` does not match `Categoría`, `marron`\n * does not match `Marrón`, and `articulo` does not match `Artículo` — so the\n * palette silently finds nothing for the most natural way to type most of its\n * own copy. Nobody reaches for the accented key in a search box.\n *\n * NFD splits a precomposed letter into its base plus a combining mark, and the\n * `\\p{Diacritic}` class is what then removes only the mark. `ñ` decomposes too,\n * so `nino` matches `Niño` — which is what a person typing quickly wants, even\n * though ñ is a letter of its own in Spanish rather than an accented n.\n */\nexport function foldForMatch(text: string): string {\n return text\n .normalize('NFD')\n .replace(/\\p{Diacritic}/gu, '')\n .toLocaleLowerCase();\n}\n\n/**\n * Does `text` contain every character of `term`, in order?\n *\n * Subsequence rather than substring, so `prbr` finds \"Producto Bruto\" and `numa`\n * finds \"Nueva marca\" — the thing that makes a palette feel fast. Deliberately\n * **not** scored: group order is the ranking, and a score inside\n * a group would reshuffle it on every keystroke for no gain a person can learn.\n *\n * An empty term matches everything, which is what makes an unfiltered palette\n * the same code path as a filtered one.\n */\nexport function subsequenceMatch(term: string, text: string): boolean {\n const needle = foldForMatch(term);\n if (needle === '') return true;\n\n const haystack = foldForMatch(text);\n let cursor = 0;\n for (const character of haystack) {\n if (character === needle[cursor]) cursor += 1;\n if (cursor === needle.length) return true;\n }\n return false;\n}\n\n/**\n * Does this option answer to `term`, by its label or by any of its keywords?\n *\n * The keywords are what let a Spanish command match an English word someone\n * typed — \"Nuevo producto\" answering to `new` — without translating the label.\n */\nexport function matchesCommand(term: string, option: CommandOption): boolean {\n if (subsequenceMatch(term, option.label)) return true;\n return (option.keywords ?? []).some(keyword =>\n subsequenceMatch(term, keyword),\n );\n}\n\n/**\n * Split a catalog-resolved keyword list into terms.\n *\n * `MetaUseCase.keywordsKey` is a catalog **key** rather than a `string[]` so the\n * terms are per-locale; what the catalog holds is therefore one string, and this\n * is the convention for reading it. Commas, because a keyword may itself be two\n * words (\"cerrar sesión\") and splitting on whitespace would break that into\n * terms that match nothing on their own.\n *\n * Empty entries are dropped rather than kept as `''`, which would match every\n * option through {@link subsequenceMatch}'s empty-term rule.\n */\nexport function parseKeywords(value: string | undefined): string[] {\n if (value === undefined) return [];\n return value\n .split(',')\n .map(keyword => keyword.trim())\n .filter(keyword => keyword !== '');\n}\n\n/** Which sources a typed term is asking for. */\nexport type CommandScope = 'all' | 'commands' | 'records';\n\n/** A term, split into the scope its prefix asked for and the rest. */\nexport interface ParsedCommandTerm {\n readonly scope: CommandScope;\n readonly term: string;\n}\n\n/**\n * `>` narrows to commands, `#` to records, anything else searches both.\n *\n * A grammar for *entry* rather than for depth: descending into a sub-picker is a\n * page stack, not a third prefix, because a prefix a person has to remember is\n * worse than a list they can see. Two characters only, and both are the ones\n * VS Code and GitHub already trained people on.\n *\n * The prefix is stripped and the remainder trimmed at the front only — a\n * trailing space is something the person is still typing, and eating it would\n * make the list jump between keystrokes.\n */\nexport function parseCommandTerm(raw: string): ParsedCommandTerm {\n if (raw.startsWith('>')) {\n return { scope: 'commands', term: raw.slice(1).trimStart() };\n }\n if (raw.startsWith('#')) {\n return { scope: 'records', term: raw.slice(1).trimStart() };\n }\n return { scope: 'all', term: raw };\n}\n\n/**\n * The one thing selecting an option does.\n *\n * An option declaring none is a line that looks selectable and does nothing;\n * one declaring two is a line whose behaviour depends on the order a renderer\n * happens to check its members in. Both are silent, so this throws — at the\n * first render of the palette rather than on the click, which is the posture\n * `surfaceFor` and `assertSearchable` already take for the same reason.\n */\nexport function commandEffectOf(\n option: CommandOption,\n): 'href' | 'run' | 'push' {\n const declared = (['href', 'run', 'push'] as const).filter(\n effect => option[effect] !== undefined,\n );\n\n if (declared.length !== 1) {\n throw new Error(\n `The command \"${option.id}\" declares ${declared.length} effects (${declared.join(', ') || 'none'}), and must declare exactly one. ` +\n 'Give it an `href` to navigate, a `run` to invoke, or a `push` to open another page.',\n );\n }\n\n return declared[0];\n}\n"],"names":["foldForMatch","text","normalize","replace","toLocaleLowerCase","subsequenceMatch","term","needle","haystack","cursor","character","length","matchesCommand","option","label","keywords","some","keyword","parseKeywords","value","undefined","split","map","trim","filter","parseCommandTerm","raw","startsWith","scope","slice","trimStart","commandEffectOf","declared","effect","Error","id","join"],"mappings":"AAEA;;;;;;;;;;;;;CAaC,GACD,OAAO,SAASA,aAAaC,IAAY;IACvC,OAAOA,KACJC,SAAS,CAAC,OACVC,OAAO,CAAC,q6FAAmB,IAC3BC,iBAAiB;AACtB;AAEA;;;;;;;;;;CAUC,GACD,OAAO,SAASC,iBAAiBC,IAAY,EAAEL,IAAY;IACzD,MAAMM,SAASP,aAAaM;IAC5B,IAAIC,WAAW,IAAI,OAAO;IAE1B,MAAMC,WAAWR,aAAaC;IAC9B,IAAIQ,SAAS;IACb,KAAK,MAAMC,aAAaF,SAAU;QAChC,IAAIE,cAAcH,MAAM,CAACE,OAAO,EAAEA,UAAU;QAC5C,IAAIA,WAAWF,OAAOI,MAAM,EAAE,OAAO;IACvC;IACA,OAAO;AACT;AAEA;;;;;CAKC,GACD,OAAO,SAASC,eAAeN,IAAY,EAAEO,MAAqB;QAExDA;IADR,IAAIR,iBAAiBC,MAAMO,OAAOC,KAAK,GAAG,OAAO;IACjD,OAAO,EAACD,mBAAAA,OAAOE,QAAQ,YAAfF,mBAAmB,EAAE,EAAEG,IAAI,CAACC,CAAAA,UAClCZ,iBAAiBC,MAAMW;AAE3B;AAEA;;;;;;;;;;;CAWC,GACD,OAAO,SAASC,cAAcC,KAAyB;IACrD,IAAIA,UAAUC,WAAW,OAAO,EAAE;IAClC,OAAOD,MACJE,KAAK,CAAC,KACNC,GAAG,CAACL,CAAAA,UAAWA,QAAQM,IAAI,IAC3BC,MAAM,CAACP,CAAAA,UAAWA,YAAY;AACnC;AAWA;;;;;;;;;;;CAWC,GACD,OAAO,SAASQ,iBAAiBC,GAAW;IAC1C,IAAIA,IAAIC,UAAU,CAAC,MAAM;QACvB,OAAO;YAAEC,OAAO;YAAYtB,MAAMoB,IAAIG,KAAK,CAAC,GAAGC,SAAS;QAAG;IAC7D;IACA,IAAIJ,IAAIC,UAAU,CAAC,MAAM;QACvB,OAAO;YAAEC,OAAO;YAAWtB,MAAMoB,IAAIG,KAAK,CAAC,GAAGC,SAAS;QAAG;IAC5D;IACA,OAAO;QAAEF,OAAO;QAAOtB,MAAMoB;IAAI;AACnC;AAEA;;;;;;;;CAQC,GACD,OAAO,SAASK,gBACdlB,MAAqB;IAErB,MAAMmB,WAAW,AAAC;QAAC;QAAQ;QAAO;KAAO,CAAWR,MAAM,CACxDS,CAAAA,SAAUpB,MAAM,CAACoB,OAAO,KAAKb;IAG/B,IAAIY,SAASrB,MAAM,KAAK,GAAG;QACzB,MAAM,IAAIuB,MACR,CAAC,aAAa,EAAErB,OAAOsB,EAAE,CAAC,WAAW,EAAEH,SAASrB,MAAM,CAAC,UAAU,EAAEqB,SAASI,IAAI,CAAC,SAAS,OAAO,iCAAiC,CAAC,GACjI;IAEN;IAEA,OAAOJ,QAAQ,CAAC,EAAE;AACpB"}
@@ -18,9 +18,9 @@ import { type EntityFieldDescriptor } from './describe-entity-columns.js';
18
18
  * **Nor a `localized` member**, for a reason of the same kind: a row's draft is a
19
19
  * flat string map, and a text per locale has no single cell to live in.
20
20
  *
21
- * `EntifixBuildError` rather than a logic error, because this is a declaration
22
- * fault in the entity — the same class `assertNotQueryable` raises when a
23
- * collection claims to be sortable.
21
+ * Thrown as a plain `Error`, because this is a declaration fault in the
22
+ * entity — what `assertNotQueryable` throws when a collection claims to be
23
+ * sortable.
24
24
  */
25
25
  export declare function describeChildColumns<TChild extends object>(childType: ChildConstructor<TChild>, sample?: TChild): EntityFieldDescriptor[];
26
26
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"describe-child-columns.d.ts","sourceRoot":"","sources":["../../../src/entity-definition/describe/describe-child-columns.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAChF,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,8BAA8B,CAAC;AAEtC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,SAAS,MAAM,EACxD,SAAS,EAAE,gBAAgB,CAAC,MAAM,CAAC,EACnC,MAAM,CAAC,EAAE,MAAM,GACd,qBAAqB,EAAE,CA8BzB;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,SAAS,qBAAqB,EAAE,GAC5C,qBAAqB,EAAE,CAOzB"}
1
+ {"version":3,"file":"describe-child-columns.d.ts","sourceRoot":"","sources":["../../../src/entity-definition/describe/describe-child-columns.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAChF,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,8BAA8B,CAAC;AAEtC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,SAAS,MAAM,EACxD,SAAS,EAAE,gBAAgB,CAAC,MAAM,CAAC,EACnC,MAAM,CAAC,EAAE,MAAM,GACd,qBAAqB,EAAE,CA0BzB;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,SAAS,qBAAqB,EAAE,GAC5C,qBAAqB,EAAE,CAOzB"}
@@ -1,4 +1,3 @@
1
- import { EntifixBuildError } from '../../base-entities/entifix-error/index.js';
2
1
  import { ROW_KEY } from '../../types/EntityRowDraft.js';
3
2
  import { describeEntityColumns } from './describe-entity-columns.js';
4
3
  /**
@@ -19,24 +18,20 @@ import { describeEntityColumns } from './describe-entity-columns.js';
19
18
  * **Nor a `localized` member**, for a reason of the same kind: a row's draft is a
20
19
  * flat string map, and a text per locale has no single cell to live in.
21
20
  *
22
- * `EntifixBuildError` rather than a logic error, because this is a declaration
23
- * fault in the entity — the same class `assertNotQueryable` raises when a
24
- * collection claims to be sortable.
21
+ * Thrown as a plain `Error`, because this is a declaration fault in the
22
+ * entity — what `assertNotQueryable` throws when a collection claims to be
23
+ * sortable.
25
24
  */ export function describeChildColumns(childType, sample) {
26
25
  const descriptors = describeEntityColumns(childType, sample);
27
26
  const reserved = descriptors.find((descriptor)=>descriptor.name === ROW_KEY);
28
27
  if (reserved !== undefined) {
29
- throw new EntifixBuildError(`A composition child declares a member named \`${ROW_KEY}\`, which is reserved ` + 'for the row’s client-side key. Rename the member: the key and the member ' + 'cannot share a name, and the row would lose its identity on every edit.', undefined, {
30
- member: ROW_KEY
31
- });
28
+ throw new Error(`A composition child declares a member named \`${ROW_KEY}\`, which is reserved ` + 'for the row’s client-side key. Rename the member: the key and the member ' + 'cannot share a name, and the row would lose its identity on every edit.');
32
29
  }
33
30
  // A row's draft is a flat string map, which is what keeps a draft's type
34
31
  // bounded for the form engine; a text per locale has no cell to live in.
35
32
  const localized = descriptors.find((descriptor)=>descriptor.type === 'localized');
36
33
  if (localized !== undefined) {
37
- throw new EntifixBuildError(`A composition child declares "${localized.name}" as localized, which a row ` + 'cannot hold: a row is a flat string map. Keep the localized text on the ' + 'entity, or make the child an entity of its own.', undefined, {
38
- member: localized.name
39
- });
34
+ throw new Error(`A composition child declares "${localized.name}" as localized, which a row ` + 'cannot hold: a row is a flat string map. Keep the localized text on the ' + 'entity, or make the child an entity of its own.');
40
35
  }
41
36
  return descriptors;
42
37
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/entity-definition/describe/describe-child-columns.ts"],"sourcesContent":["import { EntifixBuildError } from '../../base-entities/entifix-error/index.js';\nimport { ROW_KEY } from '../../types/EntityRowDraft.js';\nimport type { ChildConstructor } from '../meta-entities/meta-accessor/index.js';\nimport {\n describeEntityColumns,\n type EntityFieldDescriptor,\n} from './describe-entity-columns.js';\n\n/**\n * The columns of one row of an owned collection.\n *\n * Thin over {@link describeEntityColumns}, which already accepts a\n * `ChildConstructor` — a child is described by its accessors and needs no\n * `@entity()`.\n * What this adds is the one rule a row has and an entity does not.\n *\n * **A child may not declare `$key`.** That name is the row's minted client\n * identity, and a member of the same name would be overwritten by it — the row\n * would re-key on every keystroke, drop focus mid-word, and address another\n * row's errors. Throwing is the only honest option: silently renaming the\n * member would write the wrong column, and preferring the member over the key\n * would leave the grid with no identity at all.\n *\n * **Nor a `localized` member**, for a reason of the same kind: a row's draft is a\n * flat string map, and a text per locale has no single cell to live in.\n *\n * `EntifixBuildError` rather than a logic error, because this is a declaration\n * fault in the entity — the same class `assertNotQueryable` raises when a\n * collection claims to be sortable.\n */\nexport function describeChildColumns<TChild extends object>(\n childType: ChildConstructor<TChild>,\n sample?: TChild,\n): EntityFieldDescriptor[] {\n const descriptors = describeEntityColumns(childType, sample);\n const reserved = descriptors.find(descriptor => descriptor.name === ROW_KEY);\n\n if (reserved !== undefined) {\n throw new EntifixBuildError(\n `A composition child declares a member named \\`${ROW_KEY}\\`, which is reserved ` +\n 'for the row’s client-side key. Rename the member: the key and the member ' +\n 'cannot share a name, and the row would lose its identity on every edit.',\n undefined,\n { member: ROW_KEY },\n );\n }\n\n // A row's draft is a flat string map, which is what keeps a draft's type\n // bounded for the form engine; a text per locale has no cell to live in.\n const localized = descriptors.find(\n descriptor => descriptor.type === 'localized',\n );\n if (localized !== undefined) {\n throw new EntifixBuildError(\n `A composition child declares \"${localized.name}\" as localized, which a row ` +\n 'cannot hold: a row is a flat string map. Keep the localized text on the ' +\n 'entity, or make the child an entity of its own.',\n undefined,\n { member: localized.name },\n );\n }\n\n return descriptors;\n}\n\n/**\n * The columns a detail grid actually edits.\n *\n * A read-only member still has a column — it is shown, just not written, exactly\n * as a form shows one. What is dropped is a **nested collection**: a child that\n * owns rows of its own would need a grid inside a grid, and `reconstructChild`\n * is one level deep by decision. Dropping it here rather than rendering a\n * disabled cell keeps that decision in one place.\n */\nexport function editableChildColumns(\n descriptors: readonly EntityFieldDescriptor[],\n): EntityFieldDescriptor[] {\n return descriptors.filter(\n descriptor =>\n descriptor.type !== 'composition' &&\n descriptor.type !== 'linkCollection' &&\n descriptor.type !== 'link',\n );\n}\n"],"names":["EntifixBuildError","ROW_KEY","describeEntityColumns","describeChildColumns","childType","sample","descriptors","reserved","find","descriptor","name","undefined","member","localized","type","editableChildColumns","filter"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,6CAA6C;AAC/E,SAASC,OAAO,QAAQ,gCAAgC;AAExD,SACEC,qBAAqB,QAEhB,+BAA+B;AAEtC;;;;;;;;;;;;;;;;;;;;;CAqBC,GACD,OAAO,SAASC,qBACdC,SAAmC,EACnCC,MAAe;IAEf,MAAMC,cAAcJ,sBAAsBE,WAAWC;IACrD,MAAME,WAAWD,YAAYE,IAAI,CAACC,CAAAA,aAAcA,WAAWC,IAAI,KAAKT;IAEpE,IAAIM,aAAaI,WAAW;QAC1B,MAAM,IAAIX,kBACR,CAAC,8CAA8C,EAAEC,QAAQ,sBAAsB,CAAC,GAC9E,8EACA,2EACFU,WACA;YAAEC,QAAQX;QAAQ;IAEtB;IAEA,yEAAyE;IACzE,yEAAyE;IACzE,MAAMY,YAAYP,YAAYE,IAAI,CAChCC,CAAAA,aAAcA,WAAWK,IAAI,KAAK;IAEpC,IAAID,cAAcF,WAAW;QAC3B,MAAM,IAAIX,kBACR,CAAC,8BAA8B,EAAEa,UAAUH,IAAI,CAAC,4BAA4B,CAAC,GAC3E,6EACA,mDACFC,WACA;YAAEC,QAAQC,UAAUH,IAAI;QAAC;IAE7B;IAEA,OAAOJ;AACT;AAEA;;;;;;;;CAQC,GACD,OAAO,SAASS,qBACdT,WAA6C;IAE7C,OAAOA,YAAYU,MAAM,CACvBP,CAAAA,aACEA,WAAWK,IAAI,KAAK,iBACpBL,WAAWK,IAAI,KAAK,oBACpBL,WAAWK,IAAI,KAAK;AAE1B"}
1
+ {"version":3,"sources":["../../../src/entity-definition/describe/describe-child-columns.ts"],"sourcesContent":["import { ROW_KEY } from '../../types/EntityRowDraft.js';\nimport type { ChildConstructor } from '../meta-entities/meta-accessor/index.js';\nimport {\n describeEntityColumns,\n type EntityFieldDescriptor,\n} from './describe-entity-columns.js';\n\n/**\n * The columns of one row of an owned collection.\n *\n * Thin over {@link describeEntityColumns}, which already accepts a\n * `ChildConstructor` — a child is described by its accessors and needs no\n * `@entity()`.\n * What this adds is the one rule a row has and an entity does not.\n *\n * **A child may not declare `$key`.** That name is the row's minted client\n * identity, and a member of the same name would be overwritten by it — the row\n * would re-key on every keystroke, drop focus mid-word, and address another\n * row's errors. Throwing is the only honest option: silently renaming the\n * member would write the wrong column, and preferring the member over the key\n * would leave the grid with no identity at all.\n *\n * **Nor a `localized` member**, for a reason of the same kind: a row's draft is a\n * flat string map, and a text per locale has no single cell to live in.\n *\n * Thrown as a plain `Error`, because this is a declaration fault in the\n * entity — what `assertNotQueryable` throws when a collection claims to be\n * sortable.\n */\nexport function describeChildColumns<TChild extends object>(\n childType: ChildConstructor<TChild>,\n sample?: TChild,\n): EntityFieldDescriptor[] {\n const descriptors = describeEntityColumns(childType, sample);\n const reserved = descriptors.find(descriptor => descriptor.name === ROW_KEY);\n\n if (reserved !== undefined) {\n throw new Error(\n `A composition child declares a member named \\`${ROW_KEY}\\`, which is reserved ` +\n 'for the row’s client-side key. Rename the member: the key and the member ' +\n 'cannot share a name, and the row would lose its identity on every edit.',\n );\n }\n\n // A row's draft is a flat string map, which is what keeps a draft's type\n // bounded for the form engine; a text per locale has no cell to live in.\n const localized = descriptors.find(\n descriptor => descriptor.type === 'localized',\n );\n if (localized !== undefined) {\n throw new Error(\n `A composition child declares \"${localized.name}\" as localized, which a row ` +\n 'cannot hold: a row is a flat string map. Keep the localized text on the ' +\n 'entity, or make the child an entity of its own.',\n );\n }\n\n return descriptors;\n}\n\n/**\n * The columns a detail grid actually edits.\n *\n * A read-only member still has a column — it is shown, just not written, exactly\n * as a form shows one. What is dropped is a **nested collection**: a child that\n * owns rows of its own would need a grid inside a grid, and `reconstructChild`\n * is one level deep by decision. Dropping it here rather than rendering a\n * disabled cell keeps that decision in one place.\n */\nexport function editableChildColumns(\n descriptors: readonly EntityFieldDescriptor[],\n): EntityFieldDescriptor[] {\n return descriptors.filter(\n descriptor =>\n descriptor.type !== 'composition' &&\n descriptor.type !== 'linkCollection' &&\n descriptor.type !== 'link',\n );\n}\n"],"names":["ROW_KEY","describeEntityColumns","describeChildColumns","childType","sample","descriptors","reserved","find","descriptor","name","undefined","Error","localized","type","editableChildColumns","filter"],"mappings":"AAAA,SAASA,OAAO,QAAQ,gCAAgC;AAExD,SACEC,qBAAqB,QAEhB,+BAA+B;AAEtC;;;;;;;;;;;;;;;;;;;;;CAqBC,GACD,OAAO,SAASC,qBACdC,SAAmC,EACnCC,MAAe;IAEf,MAAMC,cAAcJ,sBAAsBE,WAAWC;IACrD,MAAME,WAAWD,YAAYE,IAAI,CAACC,CAAAA,aAAcA,WAAWC,IAAI,KAAKT;IAEpE,IAAIM,aAAaI,WAAW;QAC1B,MAAM,IAAIC,MACR,CAAC,8CAA8C,EAAEX,QAAQ,sBAAsB,CAAC,GAC9E,8EACA;IAEN;IAEA,yEAAyE;IACzE,yEAAyE;IACzE,MAAMY,YAAYP,YAAYE,IAAI,CAChCC,CAAAA,aAAcA,WAAWK,IAAI,KAAK;IAEpC,IAAID,cAAcF,WAAW;QAC3B,MAAM,IAAIC,MACR,CAAC,8BAA8B,EAAEC,UAAUH,IAAI,CAAC,4BAA4B,CAAC,GAC3E,6EACA;IAEN;IAEA,OAAOJ;AACT;AAEA;;;;;;;;CAQC,GACD,OAAO,SAASS,qBACdT,WAA6C;IAE7C,OAAOA,YAAYU,MAAM,CACvBP,CAAAA,aACEA,WAAWK,IAAI,KAAK,iBACpBL,WAAWK,IAAI,KAAK,oBACpBL,WAAWK,IAAI,KAAK;AAE1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"describe-entity-columns.d.ts","sourceRoot":"","sources":["../../../src/entity-definition/describe/describe-entity-columns.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAE5B,gBAAgB,EACjB,MAAM,yCAAyC,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC,wEAAwE;IACxE,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,gBAAgB,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,QAAQ,EAAE,OAAO,CAAC;IAClB,kEAAkE;IAClE,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,0FAA0F;IAC1F,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6DAA6D;IAC7D,iBAAiB,EAAE,MAAM,CAAC;IAC1B,+EAA+E;IAC/E,kBAAkB,EAAE,MAAM,CAAC;IAC3B,0EAA0E;IAC1E,iBAAiB,EAAE,uBAAuB,CAAC;IAC3C;;;OAGG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B;;;OAGG;IACH,YAAY,EAAE,OAAO,CAAC;IACtB,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,6EAA6E;AAC7E,eAAO,MAAM,YAAY,EAAE,SAAS,gBAAgB,EAMnD,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAAS,gBAAgB,EAIvD,CAAC;AAgGF;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,SAAS;IAChB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;CAC3B,EAAE,QAQJ;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,SAAS;IAChB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B,EAAE,QAWJ;AA4CD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,SAAS,MAAM,EAC1D,iBAAiB,EAAE,gBAAgB,CAAC,OAAO,CAAC,EAC5C,MAAM,CAAC,EAAE,OAAO,GACf,qBAAqB,EAAE,CAiBzB"}
1
+ {"version":3,"file":"describe-entity-columns.d.ts","sourceRoot":"","sources":["../../../src/entity-definition/describe/describe-entity-columns.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAE5B,gBAAgB,EACjB,MAAM,yCAAyC,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC,wEAAwE;IACxE,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,gBAAgB,CAAC;IACvB,QAAQ,EAAE,OAAO,CA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QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B,EAAE,QAWJ;AA4CD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,SAAS,MAAM,EAC1D,iBAAiB,EAAE,gBAAgB,CAAC,OAAO,CAAC,EAC5C,MAAM,CAAC,EAAE,OAAO,GACf,qBAAqB,EAAE,CAiBzB"}
@@ -1,4 +1,3 @@
1
- import { EntifixBuildError } from '../../base-entities/entifix-error/index.js';
2
1
  import { extractMetaAccessors } from '../helpers/index.js';
3
2
  import { EntityCollectionLink } from '../links/entity-collection-link/index.js';
4
3
  import { EntityLink } from '../links/entity-link/index.js';
@@ -54,7 +53,7 @@ import { assertBounds } from '../meta-entities/bounds.js';
54
53
  */ function assertNotQueryable(metaAccessor, type) {
55
54
  if (!COLLECTION_TYPES.includes(type)) return;
56
55
  if (metaAccessor.sortable !== true && metaAccessor.filterable !== true) return;
57
- throw new EntifixBuildError(`"${String(metaAccessor.name)}" is a ${type} and cannot be sortable or filterable — member metadata is the server-side query allowlist, and a collection compared as a scalar matches nothing.`);
56
+ throw new Error(`"${String(metaAccessor.name)}" is a ${type} and cannot be sortable or filterable — member metadata is the server-side query allowlist, and a collection compared as a scalar matches nothing.`);
58
57
  }
59
58
  /**
60
59
  * Item counts belong to a collection, and must be counts. A `minItems` on a
@@ -64,7 +63,7 @@ import { assertBounds } from '../meta-entities/bounds.js';
64
63
  if (minItems === undefined && maxItems === undefined) return;
65
64
  const name = String(metaAccessor.name);
66
65
  if (!COLLECTION_TYPES.includes(type)) {
67
- throw new EntifixBuildError(`"${name}" is a ${type}, and only a collection can declare minItems or maxItems.`);
66
+ throw new Error(`"${name}" is a ${type}, and only a collection can declare minItems or maxItems.`);
68
67
  }
69
68
  assertBounds(`"${name}"`, {
70
69
  min: minItems,
@@ -80,7 +79,7 @@ import { assertBounds } from '../meta-entities/bounds.js';
80
79
  if (descriptor.notBefore === undefined) continue;
81
80
  const earlier = descriptors.find((other)=>other.name === descriptor.notBefore);
82
81
  if (descriptor.type !== 'date' || (earlier == null ? void 0 : earlier.type) !== 'date') {
83
- throw new EntifixBuildError(`"${descriptor.name}" declares notBefore "${descriptor.notBefore}", and both must be date members of the entity.`);
82
+ throw new Error(`"${descriptor.name}" declares notBefore "${descriptor.notBefore}", and both must be date members of the entity.`);
84
83
  }
85
84
  }
86
85
  }
@@ -91,7 +90,7 @@ import { assertBounds } from '../meta-entities/bounds.js';
91
90
  */ function assertParentType(metaAccessor, type) {
92
91
  if (metaAccessor.parent !== true) return;
93
92
  if (type === 'id' || type === 'string') return;
94
- throw new EntifixBuildError(`"${String(metaAccessor.name)}" is a ${type} and cannot be the parent member — a parent is one record's id, so it is an id or a string.`);
93
+ throw new Error(`"${String(metaAccessor.name)}" is a ${type} and cannot be the parent member — a parent is one record's id, so it is an id or a string.`);
95
94
  }
96
95
  /**
97
96
  * One parent member per entity. Two would be two trees over the same records,
@@ -99,7 +98,7 @@ import { assertBounds } from '../meta-entities/bounds.js';
99
98
  */ export function assertOneParent(members) {
100
99
  const parents = members.filter((member)=>member.parent === true);
101
100
  if (parents.length > 1) {
102
- throw new EntifixBuildError(`An entity declares one parent member at most; found ${parents.map((member)=>`"${String(member.name)}"`).join(', ')}.`);
101
+ throw new Error(`An entity declares one parent member at most; found ${parents.map((member)=>`"${String(member.name)}"`).join(', ')}.`);
103
102
  }
104
103
  }
105
104
  /**
@@ -112,7 +111,7 @@ import { assertBounds } from '../meta-entities/bounds.js';
112
111
  */ export function assertParentVisible(members) {
113
112
  const stuck = members.find((member)=>member.parent === true && (member.hidden === true || member.readonly === true));
114
113
  if (stuck === undefined) return;
115
- throw new EntifixBuildError(`"${String(stuck.name)}" is the parent member and is ${stuck.hidden === true ? 'hidden' : 'readonly'} — such a member is never serialized, so the tree would arrive flat. Hide it with a slot instead.`);
114
+ throw new Error(`"${String(stuck.name)}" is the parent member and is ${stuck.hidden === true ? 'hidden' : 'readonly'} — such a member is never serialized, so the tree would arrive flat. Hide it with a slot instead.`);
116
115
  }
117
116
  function toDescriptor(metaAccessor, index, sample) {
118
117
  var _metaAccessor_type, _metaAccessor_linkLabelProperty, _metaAccessor_alias, _metaAccessor_label, _metaAccessor_sortable, _metaAccessor_filterable, _metaAccessor_order, _metaAccessor_readonly, _metaAccessor_required, _metaAccessor_linkSearchProperty, _metaAccessor_linkSerialization, _metaAccessor_resetOnClone, _metaAccessor_parent;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/entity-definition/describe/describe-entity-columns.ts"],"sourcesContent":["import { EntifixBuildError } from '../../base-entities/entifix-error/index.js';\nimport { extractMetaAccessors } from '../helpers/index.js';\nimport { EntityCollectionLink } from '../links/entity-collection-link/index.js';\nimport { EntityLink } from '../links/entity-link/index.js';\nimport { assertBounds } from '../meta-entities/bounds.js';\nimport {\n type ChildConstructor,\n type EntityLinkSerialization,\n MetaAccessor,\n MetaAccessorType,\n} from '../meta-entities/meta-accessor/index.js';\n\n/**\n * A displayable member of an entity, resolved from its accessor metadata. This\n * is the contract generic UI builds itself from — a table's columns today, a\n * form's fields later — so it stays framework-free and lives next to the\n * metadata it derives from.\n */\nexport interface EntityFieldDescriptor {\n /** Accessor name. The stable identity used by preferences and slots. */\n name: string;\n /** Wire/property key: `alias ?? name`. */\n key: string;\n label: string;\n /**\n * Catalog key for {@link label}, when the entity declared one. Resolution is\n * the presentation layer's job — core has no locale and no catalogs, and the\n * same descriptor feeds the server-side filter allowlist, where a translated\n * label would be meaningless.\n */\n labelKey?: string;\n type: MetaAccessorType;\n sortable: boolean;\n filterable: boolean;\n order: number;\n /** Cannot be written back. A form shows it but disables its input. */\n readonly: boolean;\n /** Must hold a value. A form rejects submit while it is empty. */\n required: boolean;\n enumValues?: readonly string[];\n /** Catalog prefix for {@link enumValues}; a value reads as `${enumLabelKey}.${value}`. */\n enumLabelKey?: string;\n /** Property of a `link` target used as its display label. */\n linkLabelProperty: string;\n /** Property of a `link` target a picker searches on. Defaults to the label. */\n linkSearchProperty: string;\n /** Whether a `link` writes back its foreign key or the inlined target. */\n linkSerialization: EntityLinkSerialization;\n /**\n * The class describing one row of a `composition` member, resolved from the\n * accessor's thunk. Absent on every other type.\n */\n childType?: ChildConstructor;\n /**\n * The member is dropped when the record is copied — a unique code, an audit\n * stamp. The identity member is always reset and is not flagged.\n */\n resetOnClone: boolean;\n /** The fewest values a collection member may hold. */\n minItems?: number;\n /** The most values a collection member may hold. */\n maxItems?: number;\n /** The `date` member this one may not precede. */\n notBefore?: string;\n /** This member holds the parent record's id: the entity forms a tree. */\n parent?: boolean;\n}\n\n/** Types whose values are scalars a user can meaningfully sort/filter on. */\nexport const SCALAR_TYPES: readonly MetaAccessorType[] = [\n 'string',\n 'number',\n 'boolean',\n 'date',\n 'enum',\n];\n\n/**\n * Types whose value is a collection. None of them may ever be sorted or\n * filtered: this descriptor is also the **server-side RSQL allowlist**, and an\n * array compared as a scalar matches nothing — so the query would not fail, it\n * would quietly return an empty page.\n *\n * Exported so `describe-entity-columns.spec.ts` can assert that this list,\n * {@link SCALAR_TYPES}, the two reference types and `localized` partition\n * `MetaAccessorTypes` exactly. Nothing in the repo guards `MetaAccessorType`\n * exhaustively — every switch over it has a `default` that treats the value as\n * a string — so that partition spec is what makes an eleventh type impossible\n * to add silently.\n */\nexport const COLLECTION_TYPES: readonly MetaAccessorType[] = [\n 'linkCollection',\n 'composition',\n 'scalarCollection',\n];\n\n/** `productCode` / `product-code` / `product_code` → `Product Code`. */\nfunction humanize(name: string): string {\n return name\n .replace(/[-_]+/g, ' ')\n .replace(/([a-z0-9])([A-Z])/g, '$1 $2')\n .replace(/\\s+/g, ' ')\n .trim()\n .replace(/^./, first => first.toUpperCase());\n}\n\n/**\n * Best-effort type for accessors that did not declare one. Entities are not\n * required to annotate every member, so a sample row keeps a bare `@accessor()`\n * usable; a declared `type` always wins over this.\n */\nfunction inferType(name: string, value: unknown): MetaAccessorType {\n if (value instanceof EntityLink) return 'link';\n if (value instanceof EntityCollectionLink) return 'linkCollection';\n if (value instanceof Date) return 'date';\n if (typeof value === 'number') return 'number';\n if (typeof value === 'boolean') return 'boolean';\n if (name === 'id') return 'id';\n return 'string';\n}\n\n/**\n * A collection member declared queryable is always a mistake, so it breaks the\n * developer rather than the query — the same posture as `applyEntityLinks`\n * throwing on an `embedded` link it cannot build.\n *\n * Silently clamping to `false` was the alternative and is worse: the author\n * keeps a declaration that reads as honoured, and the symptom is an empty\n * result page rather than an error anyone can act on.\n */\nfunction assertNotQueryable(\n metaAccessor: MetaAccessor,\n type: MetaAccessorType,\n) {\n if (!COLLECTION_TYPES.includes(type)) return;\n if (metaAccessor.sortable !== true && metaAccessor.filterable !== true)\n return;\n throw new EntifixBuildError(\n `\"${String(metaAccessor.name)}\" is a ${type} and cannot be sortable or filterable — member metadata is the server-side query allowlist, and a collection compared as a scalar matches nothing.`,\n );\n}\n\n/**\n * Item counts belong to a collection, and must be counts. A `minItems` on a\n * string would read as honoured and constrain nothing.\n */\nfunction assertItemCounts(metaAccessor: MetaAccessor, type: MetaAccessorType) {\n const { minItems, maxItems } = metaAccessor;\n if (minItems === undefined && maxItems === undefined) return;\n const name = String(metaAccessor.name);\n if (!COLLECTION_TYPES.includes(type)) {\n throw new EntifixBuildError(\n `\"${name}\" is a ${type}, and only a collection can declare minItems or maxItems.`,\n );\n }\n assertBounds(`\"${name}\"`, { min: minItems, max: maxItems });\n}\n\n/**\n * `notBefore` compares two instants, so both ends must be `date` members of\n * the same entity. Checked once every member is described, since the one it\n * names may be declared after it.\n */\nfunction assertNotBefore(descriptors: readonly EntityFieldDescriptor[]) {\n for (const descriptor of descriptors) {\n if (descriptor.notBefore === undefined) continue;\n const earlier = descriptors.find(\n other => other.name === descriptor.notBefore,\n );\n if (descriptor.type !== 'date' || earlier?.type !== 'date') {\n throw new EntifixBuildError(\n `\"${descriptor.name}\" declares notBefore \"${descriptor.notBefore}\", and both must be date members of the entity.`,\n );\n }\n }\n}\n\n/**\n * A parent is one record's id, so it is an `id` or a `string` member — a\n * number or a date cannot name a record, and a collection would be two\n * parents. Checked per member, since the type is only known once inferred.\n */\nfunction assertParentType(metaAccessor: MetaAccessor, type: MetaAccessorType) {\n if (metaAccessor.parent !== true) return;\n if (type === 'id' || type === 'string') return;\n throw new EntifixBuildError(\n `\"${String(metaAccessor.name)}\" is a ${type} and cannot be the parent member — a parent is one record's id, so it is an id or a string.`,\n );\n}\n\n/**\n * One parent member per entity. Two would be two trees over the same records,\n * and which one a table indents by would depend on declaration order.\n */\nexport function assertOneParent(\n members: readonly {\n readonly name: string | symbol;\n readonly parent?: boolean;\n }[],\n) {\n const parents = members.filter(member => member.parent === true);\n if (parents.length > 1) {\n throw new EntifixBuildError(\n `An entity declares one parent member at most; found ${parents.map(member => `\"${String(member.name)}\"`).join(', ')}.`,\n );\n }\n}\n\n/**\n * ⚠️ **A parent member must travel.** The serializer skips a `hidden` or\n * `readonly` member in both directions, so the parent key would not survive a\n * single trip over the wire and the tree would arrive flat, with nothing\n * failing. Hide it from a table or a form with a slot instead. Checked before\n * hidden members are dropped, since a hidden parent is exactly the one\n * describing would never see.\n */\nexport function assertParentVisible(\n members: readonly {\n readonly name: string | symbol;\n readonly parent?: boolean;\n readonly hidden?: boolean;\n readonly readonly?: boolean;\n }[],\n) {\n const stuck = members.find(\n member =>\n member.parent === true &&\n (member.hidden === true || member.readonly === true),\n );\n if (stuck === undefined) return;\n throw new EntifixBuildError(\n `\"${String(stuck.name)}\" is the parent member and is ${stuck.hidden === true ? 'hidden' : 'readonly'} — such a member is never serialized, so the tree would arrive flat. Hide it with a slot instead.`,\n );\n}\n\nfunction toDescriptor(\n metaAccessor: MetaAccessor,\n index: number,\n sample: unknown,\n): EntityFieldDescriptor {\n const name = String(metaAccessor.name);\n const type =\n metaAccessor.type ??\n inferType(name, (sample as Record<string, unknown> | undefined)?.[name]);\n assertNotQueryable(metaAccessor, type);\n assertItemCounts(metaAccessor, type);\n assertParentType(metaAccessor, type);\n // A localized member is queried one locale at a time (`name.en`), which\n // makes it as queryable as the text each locale holds.\n const isScalar = SCALAR_TYPES.includes(type) || type === 'localized';\n const linkLabelProperty = metaAccessor.linkLabelProperty ?? 'name';\n\n return {\n name,\n key: String(metaAccessor.alias ?? metaAccessor.name),\n label: metaAccessor.label ?? humanize(name),\n labelKey: metaAccessor.labelKey,\n type,\n sortable: metaAccessor.sortable ?? isScalar,\n filterable: metaAccessor.filterable ?? isScalar,\n order: metaAccessor.order ?? index,\n readonly: metaAccessor.readonly ?? false,\n required: metaAccessor.required ?? false,\n enumValues: metaAccessor.enumValues,\n enumLabelKey: metaAccessor.enumLabelKey,\n linkLabelProperty,\n linkSearchProperty: metaAccessor.linkSearchProperty ?? linkLabelProperty,\n linkSerialization: metaAccessor.linkSerialization ?? 'id',\n childType: metaAccessor.childType?.(),\n resetOnClone: metaAccessor.resetOnClone ?? false,\n minItems: metaAccessor.minItems,\n maxItems: metaAccessor.maxItems,\n notBefore: metaAccessor.notBefore,\n parent: metaAccessor.parent ?? false,\n };\n}\n\n/**\n * Resolves an entity's displayable members from its accessor metadata, sorted by\n * `order` (declaration order when undeclared).\n *\n * Getter-kind and non-`hidden` mirror the filter {@link serializeEntity} walks,\n * minus its `readonly` exclusion: a read-only member is still worth showing,\n * it just cannot be written back.\n *\n * `sample` is an optional instance used only to infer the `type` of accessors\n * that did not declare one.\n *\n * The target is a {@link ChildConstructor} rather than an `EntityConstructor`,\n * which is wider than it looks: nothing here reads `id`, and a `composition`\n * member's child is a **value** with accessors and no identity. So the same\n * walk describes an entity and describes one row of the collection it owns,\n * from one implementation.\n */\nexport function describeEntityColumns<TTarget extends object>(\n entityConstructor: ChildConstructor<TTarget>,\n sample?: TTarget,\n): EntityFieldDescriptor[] {\n const seen = new Set<string>();\n assertParentVisible(extractMetaAccessors(entityConstructor));\n\n const descriptors = extractMetaAccessors(entityConstructor)\n .filter(metaAccessor => {\n if (metaAccessor.hidden || metaAccessor.kind !== 'getter') return false;\n const name = String(metaAccessor.name);\n if (seen.has(name)) return false;\n seen.add(name);\n return true;\n })\n .map((metaAccessor, index) => toDescriptor(metaAccessor, index, sample))\n .sort((left, right) => left.order - right.order);\n assertNotBefore(descriptors);\n assertOneParent(descriptors);\n return descriptors;\n}\n"],"names":["EntifixBuildError","extractMetaAccessors","EntityCollectionLink","EntityLink","assertBounds","SCALAR_TYPES","COLLECTION_TYPES","humanize","name","replace","trim","first","toUpperCase","inferType","value","Date","assertNotQueryable","metaAccessor","type","includes","sortable","filterable","String","assertItemCounts","minItems","maxItems","undefined","min","max","assertNotBefore","descriptors","descriptor","notBefore","earlier","find","other","assertParentType","parent","assertOneParent","members","parents","filter","member","length","map","join","assertParentVisible","stuck","hidden","readonly","toDescriptor","index","sample","isScalar","linkLabelProperty","key","alias","label","labelKey","order","required","enumValues","enumLabelKey","linkSearchProperty","linkSerialization","childType","resetOnClone","describeEntityColumns","entityConstructor","seen","Set","kind","has","add","sort","left","right"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,6CAA6C;AAC/E,SAASC,oBAAoB,QAAQ,sBAAsB;AAC3D,SAASC,oBAAoB,QAAQ,2CAA2C;AAChF,SAASC,UAAU,QAAQ,gCAAgC;AAC3D,SAASC,YAAY,QAAQ,6BAA6B;AAgE1D,2EAA2E,GAC3E,OAAO,MAAMC,eAA4C;IACvD;IACA;IACA;IACA;IACA;CACD,CAAC;AAEF;;;;;;;;;;;;CAYC,GACD,OAAO,MAAMC,mBAAgD;IAC3D;IACA;IACA;CACD,CAAC;AAEF,sEAAsE,GACtE,SAASC,SAASC,IAAY;IAC5B,OAAOA,KACJC,OAAO,CAAC,UAAU,KAClBA,OAAO,CAAC,sBAAsB,SAC9BA,OAAO,CAAC,QAAQ,KAChBC,IAAI,GACJD,OAAO,CAAC,MAAME,CAAAA,QAASA,MAAMC,WAAW;AAC7C;AAEA;;;;CAIC,GACD,SAASC,UAAUL,IAAY,EAAEM,KAAc;IAC7C,IAAIA,iB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,6BAAAA,aAAaiD,YAAY,YAAzBjD,6BAA6B;QAC3CO,UAAUP,aAAaO,QAAQ;QAC/BC,UAAUR,aAAaQ,QAAQ;QAC/BO,WAAWf,aAAae,SAAS;QACjCK,MAAM,GAAEpB,uBAAAA,aAAaoB,MAAM,YAAnBpB,uBAAuB;IACjC;AACF;AAEA;;;;;;;;;;;;;;;;CAgBC,GACD,OAAO,SAASkD,sBACdC,iBAA4C,EAC5ChB,MAAgB;IAEhB,MAAMiB,OAAO,IAAIC;IACjBxB,oBAAoB7C,qBAAqBmE;IAEzC,MAAMtC,cAAc7B,qBAAqBmE,mBACtC3B,MAAM,CAACxB,CAAAA;QACN,IAAIA,aAAa+B,MAAM,IAAI/B,aAAasD,IAAI,KAAK,UAAU,OAAO;QAClE,MAAM/D,OAAOc,OAAOL,aAAaT,IAAI;QACrC,IAAI6D,KAAKG,GAAG,CAAChE,OAAO,OAAO;QAC3B6D,KAAKI,GAAG,CAACjE;QACT,OAAO;IACT,GACCoC,GAAG,CAAC,CAAC3B,cAAckC,QAAUD,aAAajC,cAAckC,OAAOC,SAC/DsB,IAAI,CAAC,CAACC,MAAMC,QAAUD,KAAKhB,KAAK,GAAGiB,MAAMjB,KAAK;IACjD9B,gBAAgBC;IAChBQ,gBAAgBR;IAChB,OAAOA;AACT"}
1
+ {"version":3,"sources":["../../../src/entity-definition/describe/describe-entity-columns.ts"],"sourcesContent":["import { extractMetaAccessors } from '../helpers/index.js';\nimport { EntityCollectionLink } from '../links/entity-collection-link/index.js';\nimport { EntityLink } from '../links/entity-link/index.js';\nimport { assertBounds } from '../meta-entities/bounds.js';\nimport {\n type ChildConstructor,\n type EntityLinkSerialization,\n MetaAccessor,\n MetaAccessorType,\n} from '../meta-entities/meta-accessor/index.js';\n\n/**\n * A displayable member of an entity, resolved from its accessor metadata. This\n * is the contract generic UI builds itself from — a table's columns today, a\n * form's fields later — so it stays framework-free and lives next to the\n * metadata it derives from.\n */\nexport interface EntityFieldDescriptor {\n /** Accessor name. The stable identity used by preferences and slots. */\n name: string;\n /** Wire/property key: `alias ?? name`. */\n key: string;\n label: string;\n /**\n * Catalog key for {@link label}, when the entity declared one. Resolution is\n * the presentation layer's job — core has no locale and no catalogs, and the\n * same descriptor feeds the server-side filter allowlist, where a translated\n * label would be meaningless.\n */\n labelKey?: string;\n type: MetaAccessorType;\n sortable: boolean;\n filterable: boolean;\n order: number;\n /** Cannot be written back. A form shows it but disables its input. */\n readonly: boolean;\n /** Must hold a value. A form rejects submit while it is empty. */\n required: boolean;\n enumValues?: readonly string[];\n /** Catalog prefix for {@link enumValues}; a value reads as `${enumLabelKey}.${value}`. */\n enumLabelKey?: string;\n /** Property of a `link` target used as its display label. */\n linkLabelProperty: string;\n /** Property of a `link` target a picker searches on. Defaults to the label. */\n linkSearchProperty: string;\n /** Whether a `link` writes back its foreign key or the inlined target. */\n linkSerialization: EntityLinkSerialization;\n /**\n * The class describing one row of a `composition` member, resolved from the\n * accessor's thunk. Absent on every other type.\n */\n childType?: ChildConstructor;\n /**\n * The member is dropped when the record is copied — a unique code, an audit\n * stamp. The identity member is always reset and is not flagged.\n */\n resetOnClone: boolean;\n /** The fewest values a collection member may hold. */\n minItems?: number;\n /** The most values a collection member may hold. */\n maxItems?: number;\n /** The `date` member this one may not precede. */\n notBefore?: string;\n /** This member holds the parent record's id: the entity forms a tree. */\n parent?: boolean;\n}\n\n/** Types whose values are scalars a user can meaningfully sort/filter on. */\nexport const SCALAR_TYPES: readonly MetaAccessorType[] = [\n 'string',\n 'number',\n 'boolean',\n 'date',\n 'enum',\n];\n\n/**\n * Types whose value is a collection. None of them may ever be sorted or\n * filtered: this descriptor is also the **server-side RSQL allowlist**, and an\n * array compared as a scalar matches nothing — so the query would not fail, it\n * would quietly return an empty page.\n *\n * Exported so `describe-entity-columns.spec.ts` can assert that this list,\n * {@link SCALAR_TYPES}, the two reference types and `localized` partition\n * `MetaAccessorTypes` exactly. Nothing in the repo guards `MetaAccessorType`\n * exhaustively — every switch over it has a `default` that treats the value as\n * a string — so that partition spec is what makes an eleventh type impossible\n * to add silently.\n */\nexport const COLLECTION_TYPES: readonly MetaAccessorType[] = [\n 'linkCollection',\n 'composition',\n 'scalarCollection',\n];\n\n/** `productCode` / `product-code` / `product_code` → `Product Code`. */\nfunction humanize(name: string): string {\n return name\n .replace(/[-_]+/g, ' ')\n .replace(/([a-z0-9])([A-Z])/g, '$1 $2')\n .replace(/\\s+/g, ' ')\n .trim()\n .replace(/^./, first => first.toUpperCase());\n}\n\n/**\n * Best-effort type for accessors that did not declare one. Entities are not\n * required to annotate every member, so a sample row keeps a bare `@accessor()`\n * usable; a declared `type` always wins over this.\n */\nfunction inferType(name: string, value: unknown): MetaAccessorType {\n if (value instanceof EntityLink) return 'link';\n if (value instanceof EntityCollectionLink) return 'linkCollection';\n if (value instanceof Date) return 'date';\n if (typeof value === 'number') return 'number';\n if (typeof value === 'boolean') return 'boolean';\n if (name === 'id') return 'id';\n return 'string';\n}\n\n/**\n * A collection member declared queryable is always a mistake, so it breaks the\n * developer rather than the query — the same posture as `applyEntityLinks`\n * throwing on an `embedded` link it cannot build.\n *\n * Silently clamping to `false` was the alternative and is worse: the author\n * keeps a declaration that reads as honoured, and the symptom is an empty\n * result page rather than an error anyone can act on.\n */\nfunction assertNotQueryable(\n metaAccessor: MetaAccessor,\n type: MetaAccessorType,\n) {\n if (!COLLECTION_TYPES.includes(type)) return;\n if (metaAccessor.sortable !== true && metaAccessor.filterable !== true)\n return;\n throw new Error(\n `\"${String(metaAccessor.name)}\" is a ${type} and cannot be sortable or filterable — member metadata is the server-side query allowlist, and a collection compared as a scalar matches nothing.`,\n );\n}\n\n/**\n * Item counts belong to a collection, and must be counts. A `minItems` on a\n * string would read as honoured and constrain nothing.\n */\nfunction assertItemCounts(metaAccessor: MetaAccessor, type: MetaAccessorType) {\n const { minItems, maxItems } = metaAccessor;\n if (minItems === undefined && maxItems === undefined) return;\n const name = String(metaAccessor.name);\n if (!COLLECTION_TYPES.includes(type)) {\n throw new Error(\n `\"${name}\" is a ${type}, and only a collection can declare minItems or maxItems.`,\n );\n }\n assertBounds(`\"${name}\"`, { min: minItems, max: maxItems });\n}\n\n/**\n * `notBefore` compares two instants, so both ends must be `date` members of\n * the same entity. Checked once every member is described, since the one it\n * names may be declared after it.\n */\nfunction assertNotBefore(descriptors: readonly EntityFieldDescriptor[]) {\n for (const descriptor of descriptors) {\n if (descriptor.notBefore === undefined) continue;\n const earlier = descriptors.find(\n other => other.name === descriptor.notBefore,\n );\n if (descriptor.type !== 'date' || earlier?.type !== 'date') {\n throw new Error(\n `\"${descriptor.name}\" declares notBefore \"${descriptor.notBefore}\", and both must be date members of the entity.`,\n );\n }\n }\n}\n\n/**\n * A parent is one record's id, so it is an `id` or a `string` member — a\n * number or a date cannot name a record, and a collection would be two\n * parents. Checked per member, since the type is only known once inferred.\n */\nfunction assertParentType(metaAccessor: MetaAccessor, type: MetaAccessorType) {\n if (metaAccessor.parent !== true) return;\n if (type === 'id' || type === 'string') return;\n throw new Error(\n `\"${String(metaAccessor.name)}\" is a ${type} and cannot be the parent member — a parent is one record's id, so it is an id or a string.`,\n );\n}\n\n/**\n * One parent member per entity. Two would be two trees over the same records,\n * and which one a table indents by would depend on declaration order.\n */\nexport function assertOneParent(\n members: readonly {\n readonly name: string | symbol;\n readonly parent?: boolean;\n }[],\n) {\n const parents = members.filter(member => member.parent === true);\n if (parents.length > 1) {\n throw new Error(\n `An entity declares one parent member at most; found ${parents.map(member => `\"${String(member.name)}\"`).join(', ')}.`,\n );\n }\n}\n\n/**\n * ⚠️ **A parent member must travel.** The serializer skips a `hidden` or\n * `readonly` member in both directions, so the parent key would not survive a\n * single trip over the wire and the tree would arrive flat, with nothing\n * failing. Hide it from a table or a form with a slot instead. Checked before\n * hidden members are dropped, since a hidden parent is exactly the one\n * describing would never see.\n */\nexport function assertParentVisible(\n members: readonly {\n readonly name: string | symbol;\n readonly parent?: boolean;\n readonly hidden?: boolean;\n readonly readonly?: boolean;\n }[],\n) {\n const stuck = members.find(\n member =>\n member.parent === true &&\n (member.hidden === true || member.readonly === true),\n );\n if (stuck === undefined) return;\n throw new Error(\n `\"${String(stuck.name)}\" is the parent member and is ${stuck.hidden === true ? 'hidden' : 'readonly'} — such a member is never serialized, so the tree would arrive flat. Hide it with a slot instead.`,\n );\n}\n\nfunction toDescriptor(\n metaAccessor: MetaAccessor,\n index: number,\n sample: unknown,\n): EntityFieldDescriptor {\n const name = String(metaAccessor.name);\n const type =\n metaAccessor.type ??\n inferType(name, (sample as Record<string, unknown> | undefined)?.[name]);\n assertNotQueryable(metaAccessor, type);\n assertItemCounts(metaAccessor, type);\n assertParentType(metaAccessor, type);\n // A localized member is queried one locale at a time (`name.en`), which\n // makes it as queryable as the text each locale holds.\n const isScalar = SCALAR_TYPES.includes(type) || type === 'localized';\n const linkLabelProperty = metaAccessor.linkLabelProperty ?? 'name';\n\n return {\n name,\n key: String(metaAccessor.alias ?? metaAccessor.name),\n label: metaAccessor.label ?? humanize(name),\n labelKey: metaAccessor.labelKey,\n type,\n sortable: metaAccessor.sortable ?? isScalar,\n filterable: metaAccessor.filterable ?? isScalar,\n order: metaAccessor.order ?? index,\n readonly: metaAccessor.readonly ?? false,\n required: metaAccessor.required ?? false,\n enumValues: metaAccessor.enumValues,\n enumLabelKey: metaAccessor.enumLabelKey,\n linkLabelProperty,\n linkSearchProperty: metaAccessor.linkSearchProperty ?? linkLabelProperty,\n linkSerialization: metaAccessor.linkSerialization ?? 'id',\n childType: metaAccessor.childType?.(),\n resetOnClone: metaAccessor.resetOnClone ?? false,\n minItems: metaAccessor.minItems,\n maxItems: metaAccessor.maxItems,\n notBefore: metaAccessor.notBefore,\n parent: metaAccessor.parent ?? false,\n };\n}\n\n/**\n * Resolves an entity's displayable members from its accessor metadata, sorted by\n * `order` (declaration order when undeclared).\n *\n * Getter-kind and non-`hidden` mirror the filter {@link serializeEntity} walks,\n * minus its `readonly` exclusion: a read-only member is still worth showing,\n * it just cannot be written back.\n *\n * `sample` is an optional instance used only to infer the `type` of accessors\n * that did not declare one.\n *\n * The target is a {@link ChildConstructor} rather than an `EntityConstructor`,\n * which is wider than it looks: nothing here reads `id`, and a `composition`\n * member's child is a **value** with accessors and no identity. So the same\n * walk describes an entity and describes one row of the collection it owns,\n * from one implementation.\n */\nexport function describeEntityColumns<TTarget extends object>(\n entityConstructor: ChildConstructor<TTarget>,\n sample?: TTarget,\n): EntityFieldDescriptor[] {\n const seen = new Set<string>();\n assertParentVisible(extractMetaAccessors(entityConstructor));\n\n const descriptors = extractMetaAccessors(entityConstructor)\n .filter(metaAccessor => {\n if (metaAccessor.hidden || metaAccessor.kind !== 'getter') return false;\n const name = String(metaAccessor.name);\n if (seen.has(name)) return false;\n seen.add(name);\n return true;\n })\n .map((metaAccessor, index) => toDescriptor(metaAccessor, index, sample))\n .sort((left, right) => left.order - right.order);\n assertNotBefore(descriptors);\n assertOneParent(descriptors);\n return descriptors;\n}\n"],"names":["extractMetaAccessors","EntityCollectionLink","EntityLink","assertBounds","SCALAR_TYPES","COLLECTION_TYPES","humanize","name","replace","trim","first","toUpperCase","inferType","value","Date","assertNotQueryable","metaAccessor","type","includes","sortable","filterable","Error","String","assertItemCounts","minItems","maxItems","undefined","min","max","assertNotBefore","descriptors","descriptor","notBefore","earlier","find","other","assertParentType","parent","assertOneParent","members","parents","filter","member","length","map","join","assertParentVisible","stuck","hidden","readonly","toDescriptor","index","sample","isScalar","linkLabelProperty","key","alias","label","labelKey","order","required","enumValues","enumLabelKey","linkSearchProperty","linkSerialization","childType","resetOnClone","describeEntityColumns","entityConstructor","seen","Set","kind","has","add","sort","left","right"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,sBAAsB;AAC3D,SAASC,oBAAoB,QAAQ,2CAA2C;AAChF,SAASC,UAAU,QAAQ,gCAAgC;AAC3D,SAASC,YAAY,QAAQ,6BAA6B;AAgE1D,2EAA2E,GAC3E,OAAO,MAAMC,eAA4C;IACvD;IACA;IACA;IACA;IACA;CACD,CAAC;A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A,aAAa4C,QAAQ,YAArB5C,yBAAyB;QACnC6C,YAAY7C,aAAa6C,UAAU;QACnCC,cAAc9C,aAAa8C,YAAY;QACvCR;QACAS,kBAAkB,GAAE/C,mCAAAA,aAAa+C,kBAAkB,YAA/B/C,mCAAmCsC;QACvDU,iBAAiB,GAAEhD,kCAAAA,aAAagD,iBAAiB,YAA9BhD,kCAAkC;QACrDiD,SAAS,EAAEjD,aAAaiD,SAAS,oBAAtBjD,aAAaiD,SAAS,MAAtBjD;QACXkD,YAAY,GAAElD,6BAAAA,aAAakD,YAAY,YAAzBlD,6BAA6B;QAC3CQ,UAAUR,aAAaQ,QAAQ;QAC/BC,UAAUT,aAAaS,QAAQ;QAC/BO,WAAWhB,aAAagB,SAAS;QACjCK,MAAM,GAAErB,uBAAAA,aAAaqB,MAAM,YAAnBrB,uBAAuB;IACjC;AACF;AAEA;;;;;;;;;;;;;;;;CAgBC,GACD,OAAO,SAASmD,sBACdC,iBAA4C,EAC5ChB,MAAgB;IAEhB,MAAMiB,OAAO,IAAIC;IACjBxB,oBAAoB9C,qBAAqBoE;IAEzC,MAAMtC,cAAc9B,qBAAqBoE,mBACtC3B,MAAM,CAACzB,CAAAA;QACN,IAAIA,aAAagC,MAAM,IAAIhC,aAAauD,IAAI,KAAK,UAAU,OAAO;QAClE,MAAMhE,OAAOe,OAAON,aAAaT,IAAI;QACrC,IAAI8D,KAAKG,GAAG,CAACjE,OAAO,OAAO;QAC3B8D,KAAKI,GAAG,CAAClE;QACT,OAAO;IACT,GACCqC,GAAG,CAAC,CAAC5B,cAAcmC,QAAUD,aAAalC,cAAcmC,OAAOC,SAC/DsB,IAAI,CAAC,CAACC,MAAMC,QAAUD,KAAKhB,KAAK,GAAGiB,MAAMjB,KAAK;IACjD9B,gBAAgBC;IAChBQ,gBAAgBR;IAChB,OAAOA;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"entity-view.d.ts","sourceRoot":"","sources":["../../../src/entity-definition/describe/entity-view.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAEvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,8BAA8B,CAAC;AAEtC,yDAAyD;AACzD,MAAM,WAAW,UAAW,SAAQ,iBAAiB;IACnD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,+EAA+E;IAC/E,QAAQ,CAAC,OAAO,EAAE,SAAS,qBAAqB,EAAE,CAAC;CACpD;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,SAAS,MAAM,EACtD,iBAAiB,EAAE,iBAAiB,CAAC,OAAO,CAAC,EAC7C,IAAI,EAAE,MAAM,GACX,UAAU,CAuBZ"}
1
+ {"version":3,"file":"entity-view.d.ts","sourceRoot":"","sources":["../../../src/entity-definition/describe/entity-view.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAEvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,8BAA8B,CAAC;AAEtC,yDAAyD;AACzD,MAAM,WAAW,UAAW,SAAQ,iBAAiB;IACnD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,+EAA+E;IAC/E,QAAQ,CAAC,OAAO,EAAE,SAAS,qBAAqB,EAAE,CAAC;CACpD;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,SAAS,MAAM,EACtD,iBAAiB,EAAE,iBAAiB,CAAC,OAAO,CAAC,EAC7C,IAAI,EAAE,MAAM,GACX,UAAU,CAuBZ"}