@almadar/runtime 6.7.0 → 6.8.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/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;
|
|
@@ -444,6 +448,23 @@ declare class MockPersistenceAdapter implements PersistenceAdapter {
|
|
|
444
448
|
* Generate a mock value for a field based on its schema.
|
|
445
449
|
*/
|
|
446
450
|
private generateFieldValue;
|
|
451
|
+
/**
|
|
452
|
+
* Generate 3–5 elements for an array field. When `items` describes an
|
|
453
|
+
* object shape (the common case for `tiles: [KpiTile]`-style declarations),
|
|
454
|
+
* each element is recursively mock-generated against `items.properties`.
|
|
455
|
+
* When `items` describes a scalar, each element uses the scalar generator
|
|
456
|
+
* for that type. When `items` is missing (legacy `[object] = []` declarations
|
|
457
|
+
* with no element schema), falls back to an empty array — the historical
|
|
458
|
+
* behavior.
|
|
459
|
+
*/
|
|
460
|
+
private generateArrayValue;
|
|
461
|
+
/**
|
|
462
|
+
* Generate a single object value with each declared property populated
|
|
463
|
+
* by faker. Walks `properties` and recursively delegates to
|
|
464
|
+
* `generateFieldValue` per property so nested objects-of-arrays-of-objects
|
|
465
|
+
* compose correctly.
|
|
466
|
+
*/
|
|
467
|
+
private generateObjectValue;
|
|
447
468
|
/**
|
|
448
469
|
* Generate a string value based on the field's declared schema metadata.
|
|
449
470
|
* 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-WOXI5KCA.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-WOXI5KCA.js';
|
|
3
3
|
import { __export } from './chunk-PZ5AY32C.js';
|
|
4
4
|
import { createLogger } from '@almadar/logger';
|
|
5
5
|
import { evaluate } from '@almadar/evaluator';
|