@almadar/core 10.69.0 → 10.71.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/builders.d.ts +3 -3
- package/dist/{effect-CNaVPA4-.d.ts → effect-CrsTJ7h8.d.ts} +33 -7
- package/dist/{entityAccess-9IWedk_w.d.ts → entityAccess-B0r5mJ43.d.ts} +1 -1
- package/dist/factory/index.d.ts +4 -4
- package/dist/factory-runtime/index.d.ts +3 -3
- package/dist/{index-DsuQRFEl.d.ts → index-DOU3UsI-.d.ts} +4 -4
- package/dist/index.d.ts +20 -10
- package/dist/index.js +427 -95
- package/dist/index.js.map +1 -1
- package/dist/mock/index.d.ts +17 -10
- package/dist/mock/index.js +29 -4
- package/dist/mock/index.js.map +1 -1
- package/dist/patterns/component-mapping.json +16 -6
- package/dist/patterns/event-contracts.json +1 -1
- package/dist/patterns/index.d.ts +928 -218
- package/dist/patterns/index.js +414 -94
- package/dist/patterns/index.js.map +1 -1
- package/dist/patterns/patterns-registry.json +394 -86
- package/dist/patterns/registry.json +394 -86
- package/dist/{schema-8Mhua_qQ.d.ts → schema-CrlpehQq.d.ts} +2 -2
- package/dist/{trait-SUGkA3Jn.d.ts → trait-CdcDJqPW.d.ts} +1 -1
- package/dist/types/index.d.ts +5 -5
- package/dist/types/index.js +3 -1
- package/dist/types/index.js.map +1 -1
- package/dist/{types-CUDHzSOr.d.ts → types--R-KklLv.d.ts} +2 -2
- package/package.json +2 -2
package/dist/mock/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { O as OrbitalSchema } from '../schema-
|
|
2
|
-
export { E as EntityAccessPolicies, e as entityAccessPolicies, a as entityAccessTable } from '../entityAccess-
|
|
3
|
-
import { a as EntityPersistence, E as EntityField, F as FieldValue, f as EntityRow } from '../effect-
|
|
4
|
-
import '../trait-
|
|
1
|
+
import { O as OrbitalSchema } from '../schema-CrlpehQq.js';
|
|
2
|
+
export { E as EntityAccessPolicies, e as entityAccessPolicies, a as entityAccessTable } from '../entityAccess-B0r5mJ43.js';
|
|
3
|
+
import { a as EntityPersistence, E as EntityField, F as FieldValue, f as EntityRow } from '../effect-CrsTJ7h8.js';
|
|
4
|
+
import '../trait-CdcDJqPW.js';
|
|
5
5
|
import '../expression-Fk8bQWef.js';
|
|
6
6
|
import 'zod';
|
|
7
7
|
|
|
@@ -80,15 +80,22 @@ declare function randomPhone(): string;
|
|
|
80
80
|
/**
|
|
81
81
|
* The name of the schema's `[identity]` entity, if it declares one.
|
|
82
82
|
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
83
|
+
* A behavior declares its own roster so it runs standalone. Composing it never
|
|
84
|
+
* imports that orbital, but a trait bound to one of its siblings drags the
|
|
85
|
+
* roster in as an auxiliary copy, tag and all — so a PRIMARY roster shadows
|
|
86
|
+
* every imported copy: the composing app decides who `@user` is. With no
|
|
87
|
+
* primary roster the copies still count, which is what lets a thin app that
|
|
88
|
+
* wraps one behavior inherit that behavior's roster.
|
|
89
|
+
*
|
|
90
|
+
* Compiled-path twin: `identity_entities` in
|
|
91
|
+
* `orbital-compiler/src/phases/validation/user_identity.rs`.
|
|
86
92
|
*/
|
|
87
93
|
declare function identityEntityName(schema: OrbitalSchema): string | undefined;
|
|
88
94
|
/**
|
|
89
|
-
* Owner columns as `Entity.field` pairs — every relation field pointing at
|
|
90
|
-
* `[identity]
|
|
91
|
-
* every unmigrated app behaving
|
|
95
|
+
* Owner columns as `Entity.field` pairs — every relation field pointing at an
|
|
96
|
+
* `[identity]`-tagged entity, shadowed imported rosters included. Empty when the
|
|
97
|
+
* program declares no identity, which keeps every unmigrated app behaving
|
|
98
|
+
* exactly as before.
|
|
92
99
|
*/
|
|
93
100
|
declare function ownerFieldsFromSchema(schema: OrbitalSchema): string[];
|
|
94
101
|
|
package/dist/mock/index.js
CHANGED
|
@@ -179,18 +179,43 @@ function inlineEntities(schema) {
|
|
|
179
179
|
}
|
|
180
180
|
return out;
|
|
181
181
|
}
|
|
182
|
+
function identityEntitiesTagged(schema) {
|
|
183
|
+
const out = [];
|
|
184
|
+
for (const orbital of schema.orbitals ?? []) {
|
|
185
|
+
const ref = orbital.entity;
|
|
186
|
+
if (typeof ref === "object" && ref !== null && "fields" in ref && ref.identity === true) {
|
|
187
|
+
out.push({ def: ref, primary: true });
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
for (const orbital of schema.orbitals ?? []) {
|
|
191
|
+
for (const ref of orbital.auxiliaryEntities ?? []) {
|
|
192
|
+
if (typeof ref === "object" && ref !== null && "fields" in ref && ref.identity === true) {
|
|
193
|
+
out.push({ def: ref, primary: false });
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
return out;
|
|
198
|
+
}
|
|
182
199
|
function identityEntityName(schema) {
|
|
183
|
-
|
|
200
|
+
const tagged = identityEntitiesTagged(schema);
|
|
201
|
+
return (tagged.find((e) => e.primary) ?? tagged[0])?.def.name;
|
|
202
|
+
}
|
|
203
|
+
function identityEntityNames(schema) {
|
|
204
|
+
const out = [];
|
|
205
|
+
for (const { def } of identityEntitiesTagged(schema)) {
|
|
206
|
+
if (!out.includes(def.name)) out.push(def.name);
|
|
207
|
+
}
|
|
208
|
+
return out;
|
|
184
209
|
}
|
|
185
210
|
function ownerFieldsFromSchema(schema) {
|
|
186
|
-
const
|
|
187
|
-
if (
|
|
211
|
+
const identities = identityEntityNames(schema);
|
|
212
|
+
if (identities.length === 0) return [];
|
|
188
213
|
const out = [];
|
|
189
214
|
const defs = inlineEntities(schema);
|
|
190
215
|
const declaredByCollection = /* @__PURE__ */ new Map();
|
|
191
216
|
for (const def of defs) {
|
|
192
217
|
for (const field of def.fields ?? []) {
|
|
193
|
-
if (field.name && field.type === "relation" && field.relation.entity
|
|
218
|
+
if (field.name && field.type === "relation" && identities.includes(field.relation.entity)) {
|
|
194
219
|
out.push(`${def.name}.${field.name}`);
|
|
195
220
|
if (def.collection) {
|
|
196
221
|
const cols = declaredByCollection.get(def.collection) ?? [];
|