@entifix/core 0.18.2 → 0.19.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.
@@ -1,4 +1,4 @@
1
- import { type ChildConstructor, type EntityLinkSerialization, MetaAccessorType } from '../meta-entities/meta-accessor/index.js';
1
+ import { type ChildConstructor, type EntityLinkSerialization, MetaAccessorType, type MoneyFormat } from '../meta-entities/meta-accessor/index.js';
2
2
  /**
3
3
  * A displayable member of an entity, resolved from its accessor metadata. This
4
4
  * is the contract generic UI builds itself from — a table's columns today, a
@@ -51,6 +51,8 @@ export interface EntityFieldDescriptor {
51
51
  maxItems?: number;
52
52
  /** The `date` member this one may not precede. */
53
53
  notBefore?: string;
54
+ /** The member is an amount of money, read as this declares. `number` members only. */
55
+ money?: MoneyFormat;
54
56
  /** This member holds the parent record's id: the entity forms a tree. */
55
57
  parent?: boolean;
56
58
  }
@@ -1 +1 @@
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,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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AAM,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,EAChB,KAAK,WAAW,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,sFAAsF;IACtF,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,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;AA0HF;;;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;AA8CD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,SAAS,MAAM,EAC1D,iBAAiB,EAAE,gBAAgB,CAAC,OAAO,CAAC,EAC5C,MAAM,CAAC,EAAE,OAAO,GACf,qBAAqB,EAAE,CAkBzB"}
@@ -1,3 +1,4 @@
1
+ import { _ as _extends } from "@swc/helpers/_/_extends";
1
2
  import { extractMetaAccessors } from '../helpers/index.js';
2
3
  import { EntityCollectionLink } from '../links/entity-collection-link/index.js';
3
4
  import { EntityLink } from '../links/entity-link/index.js';
@@ -92,6 +93,25 @@ import { assertBounds } from '../meta-entities/bounds.js';
92
93
  if (type === 'id' || type === 'string') return;
93
94
  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.`);
94
95
  }
96
+ /** Money is a reading of a number; any other member declaring it is a mistake. */ function assertMoneyType(metaAccessor, type) {
97
+ if (metaAccessor.money === undefined || type === 'number') return;
98
+ throw new Error(`"${String(metaAccessor.name)}" is a ${type} and declares money — only a number member can be an amount.`);
99
+ }
100
+ /**
101
+ * A `currencyMember` must be a visible `string` member of the same entity: a
102
+ * hidden one never reaches the client, so the amount would print with no
103
+ * currency and nothing would say why.
104
+ */ function assertCurrencyMembers(descriptors) {
105
+ for (const descriptor of descriptors){
106
+ var _descriptor_money;
107
+ const member = (_descriptor_money = descriptor.money) == null ? void 0 : _descriptor_money.currencyMember;
108
+ if (member === undefined) continue;
109
+ const currency = descriptors.find((other)=>other.name === member);
110
+ if ((currency == null ? void 0 : currency.type) !== 'string') {
111
+ throw new Error(`"${descriptor.name}" reads its currency from "${member}", which must be a visible string member of the entity.`);
112
+ }
113
+ }
114
+ }
95
115
  /**
96
116
  * One parent member per entity. Two would be two trees over the same records,
97
117
  * and which one a table indents by would depend on declaration order.
@@ -120,11 +140,12 @@ function toDescriptor(metaAccessor, index, sample) {
120
140
  assertNotQueryable(metaAccessor, type);
121
141
  assertItemCounts(metaAccessor, type);
122
142
  assertParentType(metaAccessor, type);
143
+ assertMoneyType(metaAccessor, type);
123
144
  // A localized member is queried one locale at a time (`name.en`), which
124
145
  // makes it as queryable as the text each locale holds.
125
146
  const isScalar = SCALAR_TYPES.includes(type) || type === 'localized';
126
147
  const linkLabelProperty = (_metaAccessor_linkLabelProperty = metaAccessor.linkLabelProperty) != null ? _metaAccessor_linkLabelProperty : 'name';
127
- return {
148
+ return _extends({
128
149
  name,
129
150
  key: String((_metaAccessor_alias = metaAccessor.alias) != null ? _metaAccessor_alias : metaAccessor.name),
130
151
  label: (_metaAccessor_label = metaAccessor.label) != null ? _metaAccessor_label : humanize(name),
@@ -144,9 +165,12 @@ function toDescriptor(metaAccessor, index, sample) {
144
165
  resetOnClone: (_metaAccessor_resetOnClone = metaAccessor.resetOnClone) != null ? _metaAccessor_resetOnClone : false,
145
166
  minItems: metaAccessor.minItems,
146
167
  maxItems: metaAccessor.maxItems,
147
- notBefore: metaAccessor.notBefore,
168
+ notBefore: metaAccessor.notBefore
169
+ }, metaAccessor.money === undefined ? {} : {
170
+ money: metaAccessor.money
171
+ }, {
148
172
  parent: (_metaAccessor_parent = metaAccessor.parent) != null ? _metaAccessor_parent : false
149
- };
173
+ });
150
174
  }
151
175
  /**
152
176
  * Resolves an entity's displayable members from its accessor metadata, sorted by
@@ -175,6 +199,7 @@ function toDescriptor(metaAccessor, index, sample) {
175
199
  return true;
176
200
  }).map((metaAccessor, index)=>toDescriptor(metaAccessor, index, sample)).sort((left, right)=>left.order - right.order);
177
201
  assertNotBefore(descriptors);
202
+ assertCurrencyMembers(descriptors);
178
203
  assertOneParent(descriptors);
179
204
  return descriptors;
180
205
  }
@@ -1 +1 @@
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;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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kC;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
+ {"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 type MoneyFormat,\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 /** The member is an amount of money, read as this declares. `number` members only. */\n money?: MoneyFormat;\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/** Money is a reading of a number; any other member declaring it is a mistake. */\nfunction assertMoneyType(metaAccessor: MetaAccessor, type: MetaAccessorType) {\n if (metaAccessor.money === undefined || type === 'number') return;\n throw new Error(\n `\"${String(metaAccessor.name)}\" is a ${type} and declares money — only a number member can be an amount.`,\n );\n}\n\n/**\n * A `currencyMember` must be a visible `string` member of the same entity: a\n * hidden one never reaches the client, so the amount would print with no\n * currency and nothing would say why.\n */\nfunction assertCurrencyMembers(descriptors: readonly EntityFieldDescriptor[]) {\n for (const descriptor of descriptors) {\n const member = descriptor.money?.currencyMember;\n if (member === undefined) continue;\n const currency = descriptors.find(other => other.name === member);\n if (currency?.type !== 'string') {\n throw new Error(\n `\"${descriptor.name}\" reads its currency from \"${member}\", which must be a visible string member of the entity.`,\n );\n }\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 assertMoneyType(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 ...(metaAccessor.money === undefined ? {} : { money: metaAccessor.money }),\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 assertCurrencyMembers(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","assertMoneyType","money","assertCurrencyMembers","member","currencyMember","currency","assertOneParent","members","parents","filter","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;AAmE1D,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,iBAAiBX,YAAY,OAAO;IACxC,IAAIW,iBAAiBZ,sBAAsB,OAAO;IAClD,IAAIY,iBAAiBC,MAAM,OAAO;IAClC,IAAI,OAA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O;IACT,GACC0C,GAAG,CAAC,CAACjC,cAAcwC,QAAUD,aAAavC,cAAcwC,OAAOC,SAC/DsB,IAAI,CAAC,CAACC,MAAMC,QAAUD,KAAKhB,KAAK,GAAGiB,MAAMjB,KAAK;IACjDnC,gBAAgBC;IAChBU,sBAAsBV;IACtBc,gBAAgBd;IAChB,OAAOA;AACT"}
@@ -143,7 +143,30 @@ export interface MetaAccessorOptions {
143
143
  * nothing needs. Absent means a root.
144
144
  */
145
145
  parent?: boolean;
146
+ /**
147
+ * This `number` member is an amount of money, and how to read it: its
148
+ * currency, fixed or held by another member of the same record, and whether
149
+ * the number counts the currency's minor units (cents) or its major ones.
150
+ * Presentation only — the member is still a number to validation, queries
151
+ * and every adapter — so a table prints `Q64,99` rather than `6499`, and a
152
+ * form edits the major amount and writes back the stored one.
153
+ */
154
+ money?: MoneyFormat;
146
155
  }
156
+ /**
157
+ * How a `number` member reads as money: `currency` fixed, or
158
+ * `currencyMember` naming the record's own ISO 4217 code member; `unit`
159
+ * whether the stored number counts minor units (`6499` for 64.99) or major.
160
+ */
161
+ export type MoneyFormat = {
162
+ readonly unit: 'minor' | 'major';
163
+ } & ({
164
+ readonly currency: string;
165
+ readonly currencyMember?: never;
166
+ } | {
167
+ readonly currencyMember: string;
168
+ readonly currency?: never;
169
+ });
147
170
  export declare class MetaAccessor {
148
171
  readonly name: string | symbol;
149
172
  readonly kind: MetaAccessorKind;
@@ -168,6 +191,7 @@ export declare class MetaAccessor {
168
191
  readonly maxItems?: number;
169
192
  readonly notBefore?: string;
170
193
  readonly parent?: boolean;
194
+ readonly money?: MoneyFormat;
171
195
  constructor(name: string | symbol, kind: MetaAccessorKind, options?: MetaAccessorOptions);
172
196
  }
173
197
  //# sourceMappingURL=meta-accessor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"meta-accessor.d.ts","sourceRoot":"","sources":["../../../../src/entity-definition/meta-entities/meta-accessor/meta-accessor.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,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AC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC;gBAM3B,IAAI,EAAE,MAAM,GAAG,MAAM,EACrB,IAAI,EAAE,gBAAgB,EACtB,OAAO,CAAC,EAAE,mBAAmB;CAkChC"}
@@ -54,6 +54,7 @@ export class MetaAccessor {
54
54
  this.maxItems = options == null ? void 0 : options.maxItems;
55
55
  this.notBefore = options == null ? void 0 : options.notBefore;
56
56
  this.parent = options == null ? void 0 : options.parent;
57
+ this.money = options == null ? void 0 : options.money;
57
58
  }
58
59
  }
59
60
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/entity-definition/meta-entities/meta-accessor/meta-accessor.ts"],"sourcesContent":["export type MetaAccessorKind = 'getter' | 'setter';\n\n/**\n * The kinds of value an accessor can hold, as far as generic UI and adapters\n * care. It is deliberately a presentation/behaviour taxonomy rather than a\n * TypeScript mirror: `id` and `enum` are strings at runtime but are rendered,\n * sorted and filtered differently.\n *\n * `localized` holds a text per locale (`LocalizedText`). It is queried only\n * through one locale at a time — `name.en` — never as the whole object.\n */\nexport const MetaAccessorTypes = [\n 'string',\n 'number',\n 'boolean',\n 'date',\n 'enum',\n 'id',\n 'link',\n 'linkCollection',\n 'composition',\n 'scalarCollection',\n 'localized',\n] as const;\nexport type MetaAccessorType = (typeof MetaAccessorTypes)[number];\n\n/**\n * The class whose accessors describe one row of a `composition` member.\n *\n * Deliberately not `EntityConstructor`: a child of a composition is a **value**,\n * not an entity. It has no identity of its own, is never addressed apart from\n * the master that holds it, and therefore has no `id` for `Entity` to require.\n * What it does have is `@accessor()` metadata, which is written to its own\n * class's `Symbol.metadata` bag independently of `@entity()` — so a child is\n * described by its accessors and by nothing else.\n *\n * ⚠️ It is a **shape declaration, not a runtime constructor contract.** Children\n * arrive off the wire as plain objects — the serializer walks `instanceof\n * EntityLink`, not the declared type, so an embedded array passes straight\n * through — and an autosaved draft may hold nothing that does not survive a\n * JSON round trip anyway. Nothing may branch on `instanceof` against this constructor.\n */\nexport type ChildConstructor<TChild extends object = object> = new (\n // Mirrors `EntityConstructor`: the arguments are the child's business, only\n // the class identity matters here.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ...args: any[]\n) => TChild;\n\n/**\n * The wire shape a relation takes: the target's foreign key, or the whole\n * target inlined. Declared here rather than next to `EntityLink` because it is\n * metadata about a member, not state of a link instance.\n */\nexport const EntityLinkSerializations = ['id', 'embedded'] as const;\nexport type EntityLinkSerialization = (typeof EntityLinkSerializations)[number];\n\nexport interface MetaAccessorOptions {\n alias?: string;\n type?: MetaAccessorType;\n readonly?: boolean;\n hidden?: boolean;\n /** Member must hold a value. Drives form validation; defaults to optional. */\n required?: boolean;\n /** Human label for UI. Falls back to a humanized `name`. */\n label?: string;\n /**\n * Translation key for the label, resolved by the presentation layer. Takes\n * precedence over `label`, which stays as the untranslated fallback for a\n * member that has no catalog entry yet.\n *\n * Keys mirror the entity's own `@entity({ key })`, so they are derivable\n * rather than invented: `entity:product-specification.fields.code`.\n */\n labelKey?: string;\n /** Opt in/out of sorting controls. Defaults per `type`. */\n sortable?: boolean;\n /** Opt in/out of filtering controls. Defaults per `type`. */\n filterable?: boolean;\n /** Default position among the entity's members; ties keep declaration order. */\n order?: number;\n /** Allowed values when `type` is `enum` — drives the filter value control. */\n enumValues?: readonly string[];\n /**\n * Catalog prefix for those values; a value's label is `${enumLabelKey}.${value}`.\n * Explicit rather than derived from `labelKey`, so a member whose values are\n * shared with another member can point both at one vocabulary.\n */\n enumLabelKey?: string;\n /** Property of a `link` target used as its display label. Default `name`. */\n linkLabelProperty?: string;\n /**\n * Property of a `link` target a picker searches on. Defaults to\n * {@link linkLabelProperty} — you search for what you read. It must be\n * `filterable` on the target entity, since member metadata is also the\n * server-side filter allowlist.\n */\n linkSearchProperty?: string;\n /**\n * How a `link` travels when its owner is serialized: as the target's scalar\n * foreign key (`id`, the default) or with the whole target inlined\n * (`embedded`). The serializer decides per *link instance* — it inlines\n * whatever `isLoaded` — so without this the shape a write takes would depend\n * on whether the form happened to hold the target. Declaring it on the entity\n * makes the wire shape a property of the relation instead of an accident of\n * the UI.\n */\n linkSerialization?: EntityLinkSerialization;\n /**\n * The class describing one row of a `composition` member — the child's own\n * `@accessor()` metadata is what a detail grid renders its columns from.\n *\n * A **thunk**, because a child module and the entity that owns it are usually\n * declared in the same package and a direct reference makes the decorator's\n * evaluation order load-bearing. Deferring the read to first use removes the\n * ordering question entirely, which is the same reason a to-one relation's\n * target is reached through a resolver rather than an import.\n *\n * Meaningless on any other type. There is no inference fallback: an empty\n * array cannot be told apart from an empty `string[]` at runtime, so a\n * collection must be declared.\n */\n childType?: () => ChildConstructor;\n /**\n * Reset this member when the record is copied.\n *\n * It lives on the **accessor**, not on a use case's descriptor, and that is a\n * decision already made: `UseCaseDescriptor` is closed against per-verb\n * payloads, and this is the exact case, because a descriptor that\n * grows a field per verb ends up a union of every verb's arguments. Which\n * members a copy must not carry is a property of the *member* — a unique\n * code, an audit stamp, a sequence number — and it is the same answer however\n * the copy is triggered.\n *\n * The identity member is always reset and needs no flag.\n */\n resetOnClone?: boolean;\n /**\n * The fewest values a collection member may hold — `1` for \"not empty\". Only\n * meaningful on a collection type (`scalarCollection`, `linkCollection`,\n * `composition`); declaring it elsewhere fails when the entity is described.\n *\n * Distinct from {@link required}: on a collection `required` already means\n * \"at least one\", and a `minItems` of two is a fact `required` cannot state.\n */\n minItems?: number;\n /** The most values a collection member may hold. Collection types only. */\n maxItems?: number;\n /**\n * Another `date` member this one may not precede — a period's `end` declares\n * `notBefore: 'start'`. Checked only when both hold a value. Both members must\n * be `date`s, or describing the entity fails.\n */\n notBefore?: string;\n /**\n * This member holds the id of the record's **parent**, another record of\n * the same entity — so the entity forms a tree. At most one member per\n * entity, and it must be an `id` or a `string`; describing the entity fails\n * otherwise.\n *\n * An id rather than a `link` on purpose. A tree is always built from the\n * whole set of its records ({@link buildTree}), never by resolving one parent\n * at a time, so a link's lazy resolution would be a fetch per node that\n * nothing needs. Absent means a root.\n */\n parent?: boolean;\n}\n\nexport class MetaAccessor {\n //#region Properties\n\n readonly name: string | symbol;\n readonly kind: MetaAccessorKind;\n readonly alias?: string;\n readonly type?: MetaAccessorType;\n readonly readonly?: boolean;\n readonly hidden?: boolean;\n readonly required?: boolean;\n readonly label?: string;\n readonly labelKey?: string;\n readonly sortable?: boolean;\n readonly filterable?: boolean;\n readonly order?: number;\n readonly enumValues?: readonly string[];\n readonly enumLabelKey?: string;\n readonly linkLabelProperty?: string;\n readonly linkSearchProperty?: string;\n readonly linkSerialization?: EntityLinkSerialization;\n readonly childType?: () => ChildConstructor;\n readonly resetOnClone?: boolean;\n readonly minItems?: number;\n readonly maxItems?: number;\n readonly notBefore?: string;\n readonly parent?: boolean;\n\n //#endregion\n\n //#region Constructors\n constructor(\n name: string | symbol,\n kind: MetaAccessorKind,\n options?: MetaAccessorOptions,\n ) {\n this.name = name;\n this.kind = kind;\n this.alias = options?.alias;\n this.type = options?.type;\n this.readonly = options?.readonly;\n this.hidden = options?.hidden;\n this.required = options?.required;\n this.label = options?.label;\n this.labelKey = options?.labelKey;\n this.sortable = options?.sortable;\n this.filterable = options?.filterable;\n this.order = options?.order;\n this.enumValues = options?.enumValues;\n this.enumLabelKey = options?.enumLabelKey;\n this.linkLabelProperty = options?.linkLabelProperty;\n this.linkSearchProperty = options?.linkSearchProperty;\n this.linkSerialization = options?.linkSerialization;\n this.childType = options?.childType;\n this.resetOnClone = options?.resetOnClone;\n this.minItems = options?.minItems;\n this.maxItems = options?.maxItems;\n this.notBefore = options?.notBefore;\n this.parent = options?.parent;\n }\n //#endregion\n\n //#region Methods\n //#endregion\n\n //#region Accessors\n //#endregion\n}\n"],"names":["MetaAccessorTypes","EntityLinkSerializations","MetaAccessor","name","kind","options","alias","type","readonly","hidden","required","label","labelKey","sortable","filterable","order","enumValues","enumLabelKey","linkLabelProperty","linkSearchProperty","linkSerialization","childType","resetOnClone","minItems","maxItems","notBefore","parent"],"mappings":"AAEA;;;;;;;;CAQC,GACD,OAAO,MAAMA,oBAAoB;IAC/B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAU;AA0BX;;;;CAIC,GACD,OAAO,MAAMC,2BAA2B;IAAC;IAAM;CAAW,CAAU;AAkHpE,OAAO,MAAMC;IA2BX,YAAY;IAEZ,sBAAsB;IACtB,YACEC,IAAqB,EACrBC,IAAsB,EACtBC,OAA6B,CAC7B;QACA,IAAI,CAACF,IAAI,GAAGA;QACZ,IAAI,CAACC,IAAI,GAAGA;QACZ,IAAI,CAACE,KAAK,GAAGD,2BAAAA,QAASC,KAAK;QAC3B,IAAI,CAACC,IAAI,GAAGF,2BAAAA,QAASE,IAAI;QACzB,IAAI,CAACC,QAAQ,GAAGH,2BAAAA,QAASG,QAAQ;QACjC,IAAI,CAACC,MAAM,GAAGJ,2BAAAA,QAASI,MAAM;QAC7B,IAAI,CAACC,QAAQ,GAAGL,2BAAAA,QAASK,QAAQ;QACjC,IAAI,CAACC,KAAK,GAAGN,2BAAAA,QAASM,KAAK;QAC3B,IAAI,CAACC,QAAQ,GAAGP,2BAAAA,QAASO,QAAQ;QACjC,IAAI,CAACC,QAAQ,GAAGR,2BAAAA,QAASQ,QAAQ;QACjC,IAAI,CAACC,UAAU,GAAGT,2BAAAA,QAASS,UAAU;QACrC,IAAI,CAACC,KAAK,GAAGV,2BAAAA,QAASU,KAAK;QAC3B,IAAI,CAACC,UAAU,GAAGX,2BAAAA,QAASW,UAAU;QACrC,IAAI,CAACC,YAAY,GAAGZ,2BAAAA,QAASY,YAAY;QACzC,IAAI,CAACC,iBAAiB,GAAGb,2BAAAA,QAASa,iBAAiB;QACnD,IAAI,CAACC,kBAAkB,GAAGd,2BAAAA,QAASc,kBAAkB;QACrD,IAAI,CAACC,iBAAiB,GAAGf,2BAAAA,QAASe,iBAAiB;QACnD,IAAI,CAACC,SAAS,GAAGhB,2BAAAA,QAASgB,SAAS;QACnC,IAAI,CAACC,YAAY,GAAGjB,2BAAAA,QAASiB,YAAY;QACzC,IAAI,CAACC,QAAQ,GAAGlB,2BAAAA,QAASkB,QAAQ;QACjC,IAAI,CAACC,QAAQ,GAAGnB,2BAAAA,QAASmB,QAAQ;QACjC,IAAI,CAACC,SAAS,GAAGpB,2BAAAA,QAASoB,SAAS;QACnC,IAAI,CAACC,MAAM,GAAGrB,2BAAAA,QAASqB,MAAM;IAC/B;AAQF"}
1
+ {"version":3,"sources":["../../../../src/entity-definition/meta-entities/meta-accessor/meta-accessor.ts"],"sourcesContent":["export type MetaAccessorKind = 'getter' | 'setter';\n\n/**\n * The kinds of value an accessor can hold, as far as generic UI and adapters\n * care. It is deliberately a presentation/behaviour taxonomy rather than a\n * TypeScript mirror: `id` and `enum` are strings at runtime but are rendered,\n * sorted and filtered differently.\n *\n * `localized` holds a text per locale (`LocalizedText`). It is queried only\n * through one locale at a time — `name.en` — never as the whole object.\n */\nexport const MetaAccessorTypes = [\n 'string',\n 'number',\n 'boolean',\n 'date',\n 'enum',\n 'id',\n 'link',\n 'linkCollection',\n 'composition',\n 'scalarCollection',\n 'localized',\n] as const;\nexport type MetaAccessorType = (typeof MetaAccessorTypes)[number];\n\n/**\n * The class whose accessors describe one row of a `composition` member.\n *\n * Deliberately not `EntityConstructor`: a child of a composition is a **value**,\n * not an entity. It has no identity of its own, is never addressed apart from\n * the master that holds it, and therefore has no `id` for `Entity` to require.\n * What it does have is `@accessor()` metadata, which is written to its own\n * class's `Symbol.metadata` bag independently of `@entity()` — so a child is\n * described by its accessors and by nothing else.\n *\n * ⚠️ It is a **shape declaration, not a runtime constructor contract.** Children\n * arrive off the wire as plain objects — the serializer walks `instanceof\n * EntityLink`, not the declared type, so an embedded array passes straight\n * through — and an autosaved draft may hold nothing that does not survive a\n * JSON round trip anyway. Nothing may branch on `instanceof` against this constructor.\n */\nexport type ChildConstructor<TChild extends object = object> = new (\n // Mirrors `EntityConstructor`: the arguments are the child's business, only\n // the class identity matters here.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ...args: any[]\n) => TChild;\n\n/**\n * The wire shape a relation takes: the target's foreign key, or the whole\n * target inlined. Declared here rather than next to `EntityLink` because it is\n * metadata about a member, not state of a link instance.\n */\nexport const EntityLinkSerializations = ['id', 'embedded'] as const;\nexport type EntityLinkSerialization = (typeof EntityLinkSerializations)[number];\n\nexport interface MetaAccessorOptions {\n alias?: string;\n type?: MetaAccessorType;\n readonly?: boolean;\n hidden?: boolean;\n /** Member must hold a value. Drives form validation; defaults to optional. */\n required?: boolean;\n /** Human label for UI. Falls back to a humanized `name`. */\n label?: string;\n /**\n * Translation key for the label, resolved by the presentation layer. Takes\n * precedence over `label`, which stays as the untranslated fallback for a\n * member that has no catalog entry yet.\n *\n * Keys mirror the entity's own `@entity({ key })`, so they are derivable\n * rather than invented: `entity:product-specification.fields.code`.\n */\n labelKey?: string;\n /** Opt in/out of sorting controls. Defaults per `type`. */\n sortable?: boolean;\n /** Opt in/out of filtering controls. Defaults per `type`. */\n filterable?: boolean;\n /** Default position among the entity's members; ties keep declaration order. */\n order?: number;\n /** Allowed values when `type` is `enum` — drives the filter value control. */\n enumValues?: readonly string[];\n /**\n * Catalog prefix for those values; a value's label is `${enumLabelKey}.${value}`.\n * Explicit rather than derived from `labelKey`, so a member whose values are\n * shared with another member can point both at one vocabulary.\n */\n enumLabelKey?: string;\n /** Property of a `link` target used as its display label. Default `name`. */\n linkLabelProperty?: string;\n /**\n * Property of a `link` target a picker searches on. Defaults to\n * {@link linkLabelProperty} — you search for what you read. It must be\n * `filterable` on the target entity, since member metadata is also the\n * server-side filter allowlist.\n */\n linkSearchProperty?: string;\n /**\n * How a `link` travels when its owner is serialized: as the target's scalar\n * foreign key (`id`, the default) or with the whole target inlined\n * (`embedded`). The serializer decides per *link instance* — it inlines\n * whatever `isLoaded` — so without this the shape a write takes would depend\n * on whether the form happened to hold the target. Declaring it on the entity\n * makes the wire shape a property of the relation instead of an accident of\n * the UI.\n */\n linkSerialization?: EntityLinkSerialization;\n /**\n * The class describing one row of a `composition` member — the child's own\n * `@accessor()` metadata is what a detail grid renders its columns from.\n *\n * A **thunk**, because a child module and the entity that owns it are usually\n * declared in the same package and a direct reference makes the decorator's\n * evaluation order load-bearing. Deferring the read to first use removes the\n * ordering question entirely, which is the same reason a to-one relation's\n * target is reached through a resolver rather than an import.\n *\n * Meaningless on any other type. There is no inference fallback: an empty\n * array cannot be told apart from an empty `string[]` at runtime, so a\n * collection must be declared.\n */\n childType?: () => ChildConstructor;\n /**\n * Reset this member when the record is copied.\n *\n * It lives on the **accessor**, not on a use case's descriptor, and that is a\n * decision already made: `UseCaseDescriptor` is closed against per-verb\n * payloads, and this is the exact case, because a descriptor that\n * grows a field per verb ends up a union of every verb's arguments. Which\n * members a copy must not carry is a property of the *member* — a unique\n * code, an audit stamp, a sequence number — and it is the same answer however\n * the copy is triggered.\n *\n * The identity member is always reset and needs no flag.\n */\n resetOnClone?: boolean;\n /**\n * The fewest values a collection member may hold — `1` for \"not empty\". Only\n * meaningful on a collection type (`scalarCollection`, `linkCollection`,\n * `composition`); declaring it elsewhere fails when the entity is described.\n *\n * Distinct from {@link required}: on a collection `required` already means\n * \"at least one\", and a `minItems` of two is a fact `required` cannot state.\n */\n minItems?: number;\n /** The most values a collection member may hold. Collection types only. */\n maxItems?: number;\n /**\n * Another `date` member this one may not precede — a period's `end` declares\n * `notBefore: 'start'`. Checked only when both hold a value. Both members must\n * be `date`s, or describing the entity fails.\n */\n notBefore?: string;\n /**\n * This member holds the id of the record's **parent**, another record of\n * the same entity — so the entity forms a tree. At most one member per\n * entity, and it must be an `id` or a `string`; describing the entity fails\n * otherwise.\n *\n * An id rather than a `link` on purpose. A tree is always built from the\n * whole set of its records ({@link buildTree}), never by resolving one parent\n * at a time, so a link's lazy resolution would be a fetch per node that\n * nothing needs. Absent means a root.\n */\n parent?: boolean;\n /**\n * This `number` member is an amount of money, and how to read it: its\n * currency, fixed or held by another member of the same record, and whether\n * the number counts the currency's minor units (cents) or its major ones.\n * Presentation only — the member is still a number to validation, queries\n * and every adapter — so a table prints `Q64,99` rather than `6499`, and a\n * form edits the major amount and writes back the stored one.\n */\n money?: MoneyFormat;\n}\n\n/**\n * How a `number` member reads as money: `currency` fixed, or\n * `currencyMember` naming the record's own ISO 4217 code member; `unit`\n * whether the stored number counts minor units (`6499` for 64.99) or major.\n */\nexport type MoneyFormat = { readonly unit: 'minor' | 'major' } & (\n | { readonly currency: string; readonly currencyMember?: never }\n | { readonly currencyMember: string; readonly currency?: never }\n);\n\nexport class MetaAccessor {\n //#region Properties\n\n readonly name: string | symbol;\n readonly kind: MetaAccessorKind;\n readonly alias?: string;\n readonly type?: MetaAccessorType;\n readonly readonly?: boolean;\n readonly hidden?: boolean;\n readonly required?: boolean;\n readonly label?: string;\n readonly labelKey?: string;\n readonly sortable?: boolean;\n readonly filterable?: boolean;\n readonly order?: number;\n readonly enumValues?: readonly string[];\n readonly enumLabelKey?: string;\n readonly linkLabelProperty?: string;\n readonly linkSearchProperty?: string;\n readonly linkSerialization?: EntityLinkSerialization;\n readonly childType?: () => ChildConstructor;\n readonly resetOnClone?: boolean;\n readonly minItems?: number;\n readonly maxItems?: number;\n readonly notBefore?: string;\n readonly parent?: boolean;\n readonly money?: MoneyFormat;\n\n //#endregion\n\n //#region Constructors\n constructor(\n name: string | symbol,\n kind: MetaAccessorKind,\n options?: MetaAccessorOptions,\n ) {\n this.name = name;\n this.kind = kind;\n this.alias = options?.alias;\n this.type = options?.type;\n this.readonly = options?.readonly;\n this.hidden = options?.hidden;\n this.required = options?.required;\n this.label = options?.label;\n this.labelKey = options?.labelKey;\n this.sortable = options?.sortable;\n this.filterable = options?.filterable;\n this.order = options?.order;\n this.enumValues = options?.enumValues;\n this.enumLabelKey = options?.enumLabelKey;\n this.linkLabelProperty = options?.linkLabelProperty;\n this.linkSearchProperty = options?.linkSearchProperty;\n this.linkSerialization = options?.linkSerialization;\n this.childType = options?.childType;\n this.resetOnClone = options?.resetOnClone;\n this.minItems = options?.minItems;\n this.maxItems = options?.maxItems;\n this.notBefore = options?.notBefore;\n this.parent = options?.parent;\n this.money = options?.money;\n }\n //#endregion\n\n //#region Methods\n //#endregion\n\n //#region Accessors\n //#endregion\n}\n"],"names":["MetaAccessorTypes","EntityLinkSerializations","MetaAccessor","name","kind","options","alias","type","readonly","hidden","required","label","labelKey","sortable","filterable","order","enumValues","enumLabelKey","linkLabelProperty","linkSearchProperty","linkSerialization","childType","resetOnClone","minItems","maxItems","notBefore","parent","money"],"mappings":"AAEA;;;;;;;;CAQC,GACD,OAAO,MAAMA,oBAAoB;IAC/B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAU;AA0BX;;;;CAIC,GACD,OAAO,MAAMC,2BAA2B;IAAC;IAAM;CAAW,CAAU;AAqIpE,OAAO,MAAMC;IA4BX,YAAY;IAEZ,sBAAsB;IACtB,YACEC,IAAqB,EACrBC,IAAsB,EACtBC,OAA6B,CAC7B;QACA,IAAI,CAACF,IAAI,GAAGA;QACZ,IAAI,CAACC,IAAI,GAAGA;QACZ,IAAI,CAACE,KAAK,GAAGD,2BAAAA,QAASC,KAAK;QAC3B,IAAI,CAACC,IAAI,GAAGF,2BAAAA,QAASE,IAAI;QACzB,IAAI,CAACC,QAAQ,GAAGH,2BAAAA,QAASG,QAAQ;QACjC,IAAI,CAACC,MAAM,GAAGJ,2BAAAA,QAASI,MAAM;QAC7B,IAAI,CAACC,QAAQ,GAAGL,2BAAAA,QAASK,QAAQ;QACjC,IAAI,CAACC,KAAK,GAAGN,2BAAAA,QAASM,KAAK;QAC3B,IAAI,CAACC,QAAQ,GAAGP,2BAAAA,QAASO,QAAQ;QACjC,IAAI,CAACC,QAAQ,GAAGR,2BAAAA,QAASQ,QAAQ;QACjC,IAAI,CAACC,UAAU,GAAGT,2BAAAA,QAASS,UAAU;QACrC,IAAI,CAACC,KAAK,GAAGV,2BAAAA,QAASU,KAAK;QAC3B,IAAI,CAACC,UAAU,GAAGX,2BAAAA,QAASW,UAAU;QACrC,IAAI,CAACC,YAAY,GAAGZ,2BAAAA,QAASY,YAAY;QACzC,IAAI,CAACC,iBAAiB,GAAGb,2BAAAA,QAASa,iBAAiB;QACnD,IAAI,CAACC,kBAAkB,GAAGd,2BAAAA,QAASc,kBAAkB;QACrD,IAAI,CAACC,iBAAiB,GAAGf,2BAAAA,QAASe,iBAAiB;QACnD,IAAI,CAACC,SAAS,GAAGhB,2BAAAA,QAASgB,SAAS;QACnC,IAAI,CAACC,YAAY,GAAGjB,2BAAAA,QAASiB,YAAY;QACzC,IAAI,CAACC,QAAQ,GAAGlB,2BAAAA,QAASkB,QAAQ;QACjC,IAAI,CAACC,QAAQ,GAAGnB,2BAAAA,QAASmB,QAAQ;QACjC,IAAI,CAACC,SAAS,GAAGpB,2BAAAA,QAASoB,SAAS;QACnC,IAAI,CAACC,MAAM,GAAGrB,2BAAAA,QAASqB,MAAM;QAC7B,IAAI,CAACC,KAAK,GAAGtB,2BAAAA,QAASsB,KAAK;IAC7B;AAQF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@entifix/core",
3
- "version": "0.18.2",
3
+ "version": "0.19.0",
4
4
  "description": "The entity system: decorators that make a class describe itself, entity serialization, the RSQL query protocol and the wire envelopes.",
5
5
  "license": "MIT",
6
6
  "repository": {