@almadar/core 10.94.0 → 10.95.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/builders.js +1 -0
- package/dist/builders.js.map +1 -1
- package/dist/{effect-D73ryQpY.d.ts → effect-Bw8T4qh5.d.ts} +7 -0
- package/dist/{entityAccess-B0rGIlYJ.d.ts → entityAccess-DfoXs9mc.d.ts} +2 -2
- package/dist/factory/index.d.ts +4 -4
- package/dist/factory/index.js +1 -0
- package/dist/factory/index.js.map +1 -1
- package/dist/factory-runtime/index.d.ts +3 -3
- package/dist/factory-runtime/index.js +1 -0
- package/dist/factory-runtime/index.js.map +1 -1
- package/dist/i18n/index.js +6 -0
- package/dist/i18n/index.js.map +1 -1
- package/dist/{index-0pglUbYf.d.ts → index-CN16-h3i.d.ts} +4 -4
- package/dist/index.d.ts +10 -10
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/mock/index.d.ts +4 -4
- package/dist/mock/index.js +12 -0
- package/dist/mock/index.js.map +1 -1
- package/dist/patterns/index.d.ts +2 -2
- package/dist/{schema-BRVT0vy-.d.ts → schema-DPpES4qj.d.ts} +2 -2
- package/dist/{trait-ZaXauUvA.d.ts → trait-DXXRrRMP.d.ts} +1 -1
- package/dist/types/index.d.ts +5 -5
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -1
- package/dist/{types-CzEvY9lF.d.ts → types-BMaTUGyk.d.ts} +2 -2
- package/package.json +1 -1
package/dist/mock/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { O as OrbitalEntity, a as EntityPersistence, E as EntityField, F as FieldValue, g as EntityRow } from '../effect-
|
|
2
|
-
import { a as OrbitalDefinition, O as OrbitalSchema } from '../schema-
|
|
1
|
+
import { O as OrbitalEntity, a as EntityPersistence, E as EntityField, F as FieldValue, g as EntityRow } from '../effect-Bw8T4qh5.js';
|
|
2
|
+
import { a as OrbitalDefinition, O as OrbitalSchema } from '../schema-DPpES4qj.js';
|
|
3
3
|
import { S as SExpr } from '../expression-WfTp2arD.js';
|
|
4
|
-
export { E as EntityAccessPolicies, e as entityAccessPolicies, a as entityAccessPoliciesByStoreKey, b as entityAccessTable } from '../entityAccess-
|
|
4
|
+
export { E as EntityAccessPolicies, e as entityAccessPolicies, a as entityAccessPoliciesByStoreKey, b as entityAccessTable } from '../entityAccess-DfoXs9mc.js';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import '../json-D8gmyK3l.js';
|
|
7
|
-
import '../trait-
|
|
7
|
+
import '../trait-DXXRrRMP.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Lightweight seeded pseudo-random generator for mock data.
|
package/dist/mock/index.js
CHANGED
|
@@ -566,6 +566,7 @@ var EntityFieldSchema = z.lazy(() => {
|
|
|
566
566
|
intrinsic: z.boolean().optional(),
|
|
567
567
|
description: z.string().optional(),
|
|
568
568
|
synonyms: z.string().optional(),
|
|
569
|
+
mock: z.string().optional(),
|
|
569
570
|
mergedFrom: z.string().optional()
|
|
570
571
|
};
|
|
571
572
|
function scalarVariant(t) {
|
|
@@ -937,6 +938,13 @@ function isDeclaredDefaultHonored(field) {
|
|
|
937
938
|
function sampleRowCount(entity, requested) {
|
|
938
939
|
return entity.persistence === "runtime" ? 1 : requested;
|
|
939
940
|
}
|
|
941
|
+
function mockFieldValue(declared, index) {
|
|
942
|
+
const candidates = declared.split(",").map((s) => s.trim()).filter((s) => s.length > 0);
|
|
943
|
+
if (candidates.length > 1) {
|
|
944
|
+
return candidates[(index - 1) % candidates.length];
|
|
945
|
+
}
|
|
946
|
+
return `${declared.trim()}-${index}`;
|
|
947
|
+
}
|
|
940
948
|
function sampleText(field, ctx) {
|
|
941
949
|
const fieldName = field.name ?? "field";
|
|
942
950
|
if (IMAGE_FIELD_NAMES.has(fieldName.toLowerCase())) {
|
|
@@ -1012,6 +1020,10 @@ function sampleFieldValue(field, ctx) {
|
|
|
1012
1020
|
const ordinal = isRuntime ? 1 : ctx.index;
|
|
1013
1021
|
return values[(ordinal - 1) % values.length];
|
|
1014
1022
|
}
|
|
1023
|
+
if (field.mock !== void 0) {
|
|
1024
|
+
const ordinal = isRuntime ? 1 : ctx.index;
|
|
1025
|
+
return mockFieldValue(field.mock, ordinal);
|
|
1026
|
+
}
|
|
1015
1027
|
switch (field.type) {
|
|
1016
1028
|
case "string":
|
|
1017
1029
|
return sampleText(field, ctx);
|