@hyperscale0/udl 1.0.251 → 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/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 -12
- 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/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 -1
- 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),
|
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
|
),
|