@almadar/runtime 6.7.0 → 6.8.1
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/index.d.ts
CHANGED
|
@@ -390,6 +390,10 @@ interface EntityField {
|
|
|
390
390
|
default?: unknown;
|
|
391
391
|
/** Validation format: email/url/phone/date/datetime/uuid. Drives mock-value shape without name heuristics. */
|
|
392
392
|
format?: 'email' | 'url' | 'phone' | 'date' | 'datetime' | 'uuid' | 'image' | 'avatar' | 'thumbnail';
|
|
393
|
+
/** Element schema for `type: 'array'`. When omitted, arrays default to []. Mirrors `ArrayEntityField.items` in @almadar/core. */
|
|
394
|
+
items?: EntityField;
|
|
395
|
+
/** Property schemas for `type: 'object'` (or array-of-object via `items.properties`). Mirrors `EntityFieldBase.properties` in @almadar/core. */
|
|
396
|
+
properties?: Record<string, EntityField>;
|
|
393
397
|
}
|
|
394
398
|
interface EntitySchema {
|
|
395
399
|
name: string;
|
|
@@ -440,10 +444,34 @@ declare class MockPersistenceAdapter implements PersistenceAdapter {
|
|
|
440
444
|
* Generate a single mock item based on field schemas.
|
|
441
445
|
*/
|
|
442
446
|
private generateMockItem;
|
|
447
|
+
/** Max nesting depth for recursive array/object schemas (e.g. a Comment
|
|
448
|
+
* entity whose `replies: [Comment]` field references itself). Without
|
|
449
|
+
* this guard, generateArrayValue → generateObjectValue → generateArray…
|
|
450
|
+
* recurses until stack overflow on every recursive type. Three levels
|
|
451
|
+
* is enough to render a useful thread depth (parent → reply → sub-reply)
|
|
452
|
+
* in catalog/preview without blowing the fixture. */
|
|
453
|
+
private static MAX_NESTED_DEPTH;
|
|
443
454
|
/**
|
|
444
455
|
* Generate a mock value for a field based on its schema.
|
|
445
456
|
*/
|
|
446
457
|
private generateFieldValue;
|
|
458
|
+
/**
|
|
459
|
+
* Generate 3–5 elements for an array field. When `items` describes an
|
|
460
|
+
* object shape (the common case for `tiles: [KpiTile]`-style declarations),
|
|
461
|
+
* each element is recursively mock-generated against `items.properties`.
|
|
462
|
+
* When `items` describes a scalar, each element uses the scalar generator
|
|
463
|
+
* for that type. When `items` is missing (legacy `[object] = []` declarations
|
|
464
|
+
* with no element schema), falls back to an empty array — the historical
|
|
465
|
+
* behavior.
|
|
466
|
+
*/
|
|
467
|
+
private generateArrayValue;
|
|
468
|
+
/**
|
|
469
|
+
* Generate a single object value with each declared property populated
|
|
470
|
+
* by faker. Walks `properties` and recursively delegates to
|
|
471
|
+
* `generateFieldValue` per property so nested objects-of-arrays-of-objects
|
|
472
|
+
* compose correctly.
|
|
473
|
+
*/
|
|
474
|
+
private generateObjectValue;
|
|
447
475
|
/**
|
|
448
476
|
* Generate a string value based on the field's declared schema metadata.
|
|
449
477
|
* Reads `values` (enum) first, then `format` (email/url/phone/uuid/date/
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EffectExecutor, createContextFromBindings } from './chunk-
|
|
2
|
-
export { EffectExecutor, EventBus, HANDLER_MANIFEST, InMemoryPersistence, MockPersistenceAdapter, StateMachineManager, buildEmitsFromTraits, collectDeclaredConfigDefaults, containsBindings, createContextFromBindings, createInitialTraitState, createMinimalContext, createMockPersistence, createTestExecutor, createUnifiedLoader, extractBindings, findInitialState, findTransition, formatPayloadValidationError, getIsolatedCollectionName, getNamespacedEvent, interpolateProps, interpolateValue, isBrowser, isElectron, isNamespacedEvent, isNode, normalizeEventKey, parseNamespacedEvent, preprocessSchema, processEvent, validateEventPayload, validatePayloadShapes } from './chunk-
|
|
1
|
+
import { EffectExecutor, createContextFromBindings } from './chunk-L3FDWEQL.js';
|
|
2
|
+
export { EffectExecutor, EventBus, HANDLER_MANIFEST, InMemoryPersistence, MockPersistenceAdapter, StateMachineManager, buildEmitsFromTraits, collectDeclaredConfigDefaults, containsBindings, createContextFromBindings, createInitialTraitState, createMinimalContext, createMockPersistence, createTestExecutor, createUnifiedLoader, extractBindings, findInitialState, findTransition, formatPayloadValidationError, getIsolatedCollectionName, getNamespacedEvent, interpolateProps, interpolateValue, isBrowser, isElectron, isNamespacedEvent, isNode, normalizeEventKey, parseNamespacedEvent, preprocessSchema, processEvent, validateEventPayload, validatePayloadShapes } from './chunk-L3FDWEQL.js';
|
|
3
3
|
import { __export } from './chunk-PZ5AY32C.js';
|
|
4
4
|
import { createLogger } from '@almadar/logger';
|
|
5
5
|
import { evaluate } from '@almadar/evaluator';
|