@almadar/core 7.24.0 → 7.25.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.
|
@@ -114,6 +114,14 @@ interface DomainEntity extends ASTNode {
|
|
|
114
114
|
* the entity section.
|
|
115
115
|
*/
|
|
116
116
|
persistence?: EntityPersistence;
|
|
117
|
+
/**
|
|
118
|
+
* Storage collection key. Mirrors `OrbitalSchema.entities[i].collection`.
|
|
119
|
+
* Omitted ⇒ defaults to `plural(name).toLowerCase()`. Surfaced to the
|
|
120
|
+
* factory translator so the LLM can override the storage key without
|
|
121
|
+
* touching the entity name (e.g. entity `Product` → collection
|
|
122
|
+
* `"catalog"`).
|
|
123
|
+
*/
|
|
124
|
+
collection?: string;
|
|
117
125
|
}
|
|
118
126
|
interface DomainPageSection extends ASTNode {
|
|
119
127
|
type: 'page_section';
|
|
@@ -361,6 +369,10 @@ interface FactoryCallSiteParams {
|
|
|
361
369
|
entityFields?: ReadonlyArray<EntityField>;
|
|
362
370
|
/** Override `signature.entities[0].persistence`. */
|
|
363
371
|
persistence?: EntityPersistence;
|
|
372
|
+
/** Override the entity's storage collection key. Defaults to
|
|
373
|
+
* `plural(entityName).toLowerCase()` at factory dispatch time
|
|
374
|
+
* when omitted. */
|
|
375
|
+
collection?: string;
|
|
364
376
|
/** Per-page path overrides keyed by `signature.pages[i].name`. */
|
|
365
377
|
pagePaths?: Readonly<Record<string, string>>;
|
|
366
378
|
/** Trait config overrides keyed by `signature.traits[i].name`. Each
|
|
@@ -6436,6 +6436,7 @@ function translateDomainToParams(binding, signature, presentation, ruleOverlay,
|
|
|
6436
6436
|
applyEntityName(binding.entity, signature, params);
|
|
6437
6437
|
applyEntityFields(binding.entity, signature, params, warnings);
|
|
6438
6438
|
applyPersistence(binding.entity, signature, params, warnings);
|
|
6439
|
+
applyCollection(binding.entity, params);
|
|
6439
6440
|
applyPagePaths(binding.pages ?? [], signature, params, warnings);
|
|
6440
6441
|
applyPresentation(presentation, signature, params, warnings);
|
|
6441
6442
|
applyTraitOverlay(traitOverlay, signature, params, warnings);
|
|
@@ -6486,6 +6487,10 @@ function applyPersistence(entity, signature, params, warnings) {
|
|
|
6486
6487
|
if (entity.persistence === signature.entities[0].persistence) return;
|
|
6487
6488
|
params.persistence = entity.persistence;
|
|
6488
6489
|
}
|
|
6490
|
+
function applyCollection(entity, params) {
|
|
6491
|
+
if (!entity.collection) return;
|
|
6492
|
+
params.collection = entity.collection;
|
|
6493
|
+
}
|
|
6489
6494
|
function applyPagePaths(pages, signature, params, warnings) {
|
|
6490
6495
|
if (pages.length === 0) return;
|
|
6491
6496
|
const sigPages = new Map(signature.pages.map((p) => [p.name, p]));
|