@hyperscale0/udl 1.0.248 → 1.0.256
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/README.md +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/money.d.ts +5 -0
- package/dist/money.d.ts.map +1 -0
- package/dist/money.js +5 -0
- package/dist/money.js.map +1 -0
- package/dist/object-semantics-schema.d.ts +12 -12
- package/dist/reporting.d.ts +8 -8
- package/dist/reporting.d.ts.map +1 -1
- package/dist/reporting.js +3 -2
- package/dist/reporting.js.map +1 -1
- package/dist/schema.d.ts +12 -16
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +2 -1
- package/dist/schema.js.map +1 -1
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +5 -1
- package/dist/validation.js.map +1 -1
- package/package.json +2 -2
- package/spec/README.md +7 -2
- package/spec/udl.schema.json +301 -300
- package/src/index.ts +1 -0
- package/src/money.ts +5 -0
- package/src/reporting.ts +3 -2
- package/src/schema.ts +2 -5
- package/src/validation.ts +7 -1
package/src/index.ts
CHANGED
package/src/money.ts
ADDED
package/src/reporting.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
+
import { currencySchema } from "./money.js";
|
|
2
3
|
|
|
3
4
|
const name = z
|
|
4
5
|
.string()
|
|
@@ -12,7 +13,7 @@ const integer = z.number().int().safe();
|
|
|
12
13
|
export const reportTypeSchema = z.discriminatedUnion("kind", [
|
|
13
14
|
z.strictObject({
|
|
14
15
|
kind: z.literal("money"),
|
|
15
|
-
currency:
|
|
16
|
+
currency: currencySchema,
|
|
16
17
|
}),
|
|
17
18
|
z.strictObject({ kind: z.enum(["text", "integer", "boolean", "date"]) }),
|
|
18
19
|
]);
|
|
@@ -94,7 +95,7 @@ export const reportDefinitionSchema = z.strictObject({
|
|
|
94
95
|
scope: z.strictObject({
|
|
95
96
|
kind: z.enum(["product", "company"]),
|
|
96
97
|
classification: z.enum(["internal", "personal", "restricted"]),
|
|
97
|
-
currency:
|
|
98
|
+
currency: currencySchema,
|
|
98
99
|
}),
|
|
99
100
|
datasets: z
|
|
100
101
|
.array(
|
package/src/schema.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
+
import { currencySchema } from "./money.js";
|
|
2
3
|
import { reportDefinitionSchema } from "./reporting.js";
|
|
3
4
|
import { writeJson } from "./json.js";
|
|
4
5
|
|
|
@@ -553,7 +554,7 @@ export const udlDocumentSchema = z.strictObject({
|
|
|
553
554
|
version: integer.positive(),
|
|
554
555
|
product: name,
|
|
555
556
|
title: text,
|
|
556
|
-
currency:
|
|
557
|
+
currency: currencySchema,
|
|
557
558
|
parties: z.record(name, udlPartySchema),
|
|
558
559
|
objects: z.array(udlObjectKindSchema).max(256),
|
|
559
560
|
instruments: z.array(udlInstrumentSchema).max(256),
|
|
@@ -563,14 +564,10 @@ export type UdlFamily = z.infer<typeof udlFamilySchema>;
|
|
|
563
564
|
export type UdlDocument = z.infer<typeof udlDocumentSchema>;
|
|
564
565
|
export type UdlInstrument = z.infer<typeof udlInstrumentSchema>;
|
|
565
566
|
export type UdlField = z.infer<typeof udlFieldSchema>;
|
|
566
|
-
export type UdlParty = z.infer<typeof udlPartySchema>;
|
|
567
567
|
export type UdlValue = z.infer<typeof udlValueSchema>;
|
|
568
568
|
export type UdlCalculation = z.infer<typeof udlCalculationSchema>;
|
|
569
569
|
export type UdlRequirement = z.infer<typeof udlRequirementSchema>;
|
|
570
570
|
export type UdlAction = z.infer<typeof udlActionSchema>;
|
|
571
|
-
export type UdlMove = z.infer<typeof udlMoveSchema>;
|
|
572
|
-
export type UdlLifecycle = z.infer<typeof udlLifecycleSchema>;
|
|
573
|
-
export type UdlKernelOperation = z.infer<typeof udlKernelOperationSchema>;
|
|
574
571
|
|
|
575
572
|
export type UdlSelection = z.infer<typeof selection>;
|
|
576
573
|
|
package/src/validation.ts
CHANGED
|
@@ -1101,7 +1101,13 @@ export function validateUdl(value: unknown): UdlValidationResult {
|
|
|
1101
1101
|
dependencies.set(
|
|
1102
1102
|
c.target,
|
|
1103
1103
|
operands.flatMap((v) =>
|
|
1104
|
-
"field" in v &&
|
|
1104
|
+
"field" in v &&
|
|
1105
|
+
v.field.startsWith("self.") &&
|
|
1106
|
+
!(
|
|
1107
|
+
act &&
|
|
1108
|
+
v.field === `self.${c.target}` &&
|
|
1109
|
+
!inst.calculate.some((node) => node.target === c.target)
|
|
1110
|
+
)
|
|
1105
1111
|
? [v.field.slice(5)]
|
|
1106
1112
|
: [],
|
|
1107
1113
|
),
|