@almadar/core 10.78.0 → 10.80.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 +8 -3
- package/dist/builders.js +27 -5
- package/dist/builders.js.map +1 -1
- package/dist/{effect-CW3s399G.d.ts → effect-C4uehm-r.d.ts} +1 -1
- package/dist/{entityAccess-B-CK9j-I.d.ts → entityAccess-BMKFgmsc.d.ts} +1 -1
- package/dist/factory/index.d.ts +4 -4
- package/dist/factory/index.js +261 -240
- package/dist/factory/index.js.map +1 -1
- package/dist/factory-runtime/index.d.ts +3 -3
- package/dist/factory-runtime/index.js +27 -5
- package/dist/factory-runtime/index.js.map +1 -1
- package/dist/{index-C5Firrg9.d.ts → index-DqUnw2Oo.d.ts} +4 -4
- package/dist/index.d.ts +10 -10
- package/dist/index.js +306 -254
- package/dist/index.js.map +1 -1
- package/dist/mock/index.d.ts +4 -4
- package/dist/mock/index.js +13 -0
- package/dist/mock/index.js.map +1 -1
- package/dist/patterns/component-mapping.json +1 -1
- package/dist/patterns/event-contracts.json +1 -1
- package/dist/patterns/index.d.ts +536 -357
- package/dist/patterns/index.js +269 -244
- package/dist/patterns/index.js.map +1 -1
- package/dist/patterns/patterns-registry.json +262 -241
- package/dist/patterns/registry.json +262 -241
- package/dist/{schema-BG7mDO7m.d.ts → schema-Cma07_18.d.ts} +301 -38
- package/dist/{trait-jWk0BInU.d.ts → trait-BXkQKZbO.d.ts} +120 -2
- package/dist/types/index.d.ts +5 -5
- package/dist/types/index.js +27 -6
- package/dist/types/index.js.map +1 -1
- package/dist/{types-DwAE_Qu-.d.ts → types-DoAKLgCZ.d.ts} +2 -2
- package/package.json +1 -1
package/dist/builders.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { I as IdentityLedger, A as AnyPatternConfig, U as UISlot, c as Effect, h as RenderBinding, i as RenderUIEffect, d as EntityId, e as Entity, E as EntityField, a as EntityPersistence, f as EntityRow } from './effect-
|
|
2
|
-
import { a as OrbitalDefinition, O as OrbitalSchema, U as UseDeclaration, E as EntityRef, b as ExpectDeclaration, P as PageRef, c as Page, d as PageRefObject } from './schema-
|
|
3
|
-
import { b as TraitConfig,
|
|
1
|
+
import { I as IdentityLedger, A as AnyPatternConfig, U as UISlot, c as Effect, h as RenderBinding, i as RenderUIEffect, d as EntityId, e as Entity, E as EntityField, a as EntityPersistence, f as EntityRow } from './effect-C4uehm-r.js';
|
|
2
|
+
import { a as OrbitalDefinition, O as OrbitalSchema, U as UseDeclaration, E as EntityRef, b as ExpectDeclaration, P as PageRef, c as Page, d as PageRefObject } from './schema-Cma07_18.js';
|
|
3
|
+
import { b as TraitConfig, h as Trait, T as TraitEventListener, i as CallSiteConfig, k as TraitEventContract, d as TraitRef, a as TraitReference } from './trait-BXkQKZbO.js';
|
|
4
4
|
import { S as SExpr } from './expression-Fk8bQWef.js';
|
|
5
5
|
import 'zod';
|
|
6
6
|
|
|
@@ -356,6 +356,11 @@ interface MakeTraitRefOpts {
|
|
|
356
356
|
linkedEntityId?: EntityId;
|
|
357
357
|
/** Per-key rename map, e.g. `{ OPEN: "ADD_ITEM" }`. */
|
|
358
358
|
events?: Record<string, string>;
|
|
359
|
+
/**
|
|
360
|
+
* 3-II trait type-parameter arguments (`:: p SomeType`): declared-param
|
|
361
|
+
* name → type-vocabulary name. Mirrors {@link TraitReference.typeArgs}.
|
|
362
|
+
*/
|
|
363
|
+
typeArgs?: Record<string, string>;
|
|
359
364
|
/**
|
|
360
365
|
* Entity-field remap, e.g. `{ name: "title", folder: "parentId" }`. Rewrites
|
|
361
366
|
* the inlined trait's canonical `@entity.X` / `@payload.row.X` references to
|
package/dist/builders.js
CHANGED
|
@@ -459,11 +459,17 @@ var StateSchema = z.object({
|
|
|
459
459
|
onEntry: z.array(z.string()).optional(),
|
|
460
460
|
onExit: z.array(z.string()).optional()
|
|
461
461
|
});
|
|
462
|
+
var PayloadTypeWhenSchema = z.object({
|
|
463
|
+
knob: z.string().min(1),
|
|
464
|
+
equals: z.string().min(1),
|
|
465
|
+
type: z.string().min(1)
|
|
466
|
+
});
|
|
462
467
|
var PayloadFieldSchema = z.object({
|
|
463
468
|
name: z.string().min(1),
|
|
464
469
|
type: z.string().min(1),
|
|
465
470
|
required: z.boolean().optional(),
|
|
466
|
-
properties: z.lazy(() => z.array(PayloadFieldSchema)).optional()
|
|
471
|
+
properties: z.lazy(() => z.array(PayloadFieldSchema)).optional(),
|
|
472
|
+
typeWhen: z.array(PayloadTypeWhenSchema).optional()
|
|
467
473
|
});
|
|
468
474
|
var EventSchema = z.object({
|
|
469
475
|
key: z.string().min(1, "Event key is required"),
|
|
@@ -516,7 +522,8 @@ var ConfigFieldItemsDeclarationSchema = z.lazy(
|
|
|
516
522
|
() => z.object({
|
|
517
523
|
type: z.string().optional(),
|
|
518
524
|
properties: z.record(TraitEntityFieldSchema).optional(),
|
|
519
|
-
items: ConfigFieldItemsDeclarationSchema.optional()
|
|
525
|
+
items: ConfigFieldItemsDeclarationSchema.optional(),
|
|
526
|
+
values: z.array(z.string()).optional()
|
|
520
527
|
})
|
|
521
528
|
);
|
|
522
529
|
var ConfigFieldDeclarationSchema = z.object({
|
|
@@ -632,7 +639,8 @@ var EventPayloadFieldSchema = z.object({
|
|
|
632
639
|
required: z.boolean().optional(),
|
|
633
640
|
description: z.string().optional(),
|
|
634
641
|
entityType: z.string().optional(),
|
|
635
|
-
properties: z.lazy(() => z.array(EventPayloadFieldSchema)).optional()
|
|
642
|
+
properties: z.lazy(() => z.array(EventPayloadFieldSchema)).optional(),
|
|
643
|
+
typeWhen: z.array(PayloadTypeWhenSchema).optional()
|
|
636
644
|
});
|
|
637
645
|
var TraitEventContractSchema = z.object({
|
|
638
646
|
/**
|
|
@@ -653,6 +661,7 @@ var TraitEventContractSchema = z.object({
|
|
|
653
661
|
synonyms: z.string().optional(),
|
|
654
662
|
tier: z.string().optional(),
|
|
655
663
|
definerKnob: z.string().optional(),
|
|
664
|
+
scopeOverridden: z.boolean().optional(),
|
|
656
665
|
payloadSchema: z.array(EventPayloadFieldSchema).optional(),
|
|
657
666
|
scope: EventScopeSchema.optional()
|
|
658
667
|
});
|
|
@@ -706,6 +715,11 @@ var TraitReferenceSchema = z.object({
|
|
|
706
715
|
z.string().min(1, "events value (caller event name) must be non-empty")
|
|
707
716
|
).optional(),
|
|
708
717
|
eventIds: z.record(z.string().min(1), EventIdSchema).optional(),
|
|
718
|
+
// 3-II type-parameter arguments (see `TraitReference.typeArgs`).
|
|
719
|
+
typeArgs: z.record(
|
|
720
|
+
z.string().min(1, "typeArgs key (declared param name) must be non-empty"),
|
|
721
|
+
z.string().min(1, "typeArgs value (type name) must be non-empty")
|
|
722
|
+
).optional(),
|
|
709
723
|
fields: z.record(
|
|
710
724
|
z.string().min(1, "fields key (canonical field name) must be non-empty"),
|
|
711
725
|
z.string().min(1, "fields value (consumer field name) must be non-empty")
|
|
@@ -766,6 +780,11 @@ var SourceBehaviorMetadataSchema = z.object({
|
|
|
766
780
|
alias: z.string().min(1),
|
|
767
781
|
originalName: z.string().min(1)
|
|
768
782
|
});
|
|
783
|
+
var TraitTypeParamDefSchema = z.object({
|
|
784
|
+
name: z.string().min(1),
|
|
785
|
+
kind: z.string().min(1),
|
|
786
|
+
default: z.string().optional()
|
|
787
|
+
});
|
|
769
788
|
var TraitSchema = z.object({
|
|
770
789
|
id: TraitIdSchema.optional(),
|
|
771
790
|
name: z.string().min(1),
|
|
@@ -792,7 +811,8 @@ var TraitSchema = z.object({
|
|
|
792
811
|
ui: TraitUIBindingSchema.optional(),
|
|
793
812
|
config: DeclaredTraitConfigSchema.optional(),
|
|
794
813
|
sourceBehavior: SourceBehaviorMetadataSchema.optional(),
|
|
795
|
-
sourceEntityDefinition: EntitySchema.optional()
|
|
814
|
+
sourceEntityDefinition: EntitySchema.optional(),
|
|
815
|
+
typeParams: z.array(TraitTypeParamDefSchema).optional()
|
|
796
816
|
});
|
|
797
817
|
var TraitRefSchema = z.union([
|
|
798
818
|
z.string().min(1),
|
|
@@ -1447,7 +1467,8 @@ z.object({
|
|
|
1447
1467
|
// Context fields - persisted throughout orbital lifecycle
|
|
1448
1468
|
domainContext: DomainContextSchema.optional(),
|
|
1449
1469
|
design: DesignPreferencesSchema.optional(),
|
|
1450
|
-
suggestedGuards: z.array(SuggestedGuardSchema).optional()
|
|
1470
|
+
suggestedGuards: z.array(SuggestedGuardSchema).optional(),
|
|
1471
|
+
types: z.record(z.string(), z.array(EventPayloadFieldSchema)).optional()
|
|
1451
1472
|
});
|
|
1452
1473
|
|
|
1453
1474
|
// src/builders/apply-config-overrides.ts
|
|
@@ -1860,6 +1881,7 @@ function makeTraitRef(opts) {
|
|
|
1860
1881
|
if (opts.linkedEntity !== void 0) ref.linkedEntity = opts.linkedEntity;
|
|
1861
1882
|
if (opts.linkedEntityId !== void 0) ref.linkedEntityId = opts.linkedEntityId;
|
|
1862
1883
|
if (opts.events !== void 0) ref.events = opts.events;
|
|
1884
|
+
if (opts.typeArgs !== void 0) ref.typeArgs = opts.typeArgs;
|
|
1863
1885
|
if (opts.fields !== void 0) ref.fields = opts.fields;
|
|
1864
1886
|
if (opts.effects !== void 0) ref.effects = opts.effects;
|
|
1865
1887
|
if (opts.listens !== void 0) ref.listens = opts.listens;
|