@corpdk/dal-core 2026.10.0-alpha.13 → 2026.10.0-alpha.16
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/guild-scalars.d.ts +1 -7
- package/dist/guild-scalars.js +1 -15
- package/dist/guild-scalars.js.map +1 -1
- package/dist/pg-bounds.d.ts +1 -12
- package/dist/pg-bounds.js +1 -12
- package/dist/pg-bounds.js.map +1 -1
- package/dist/pg-interval.d.ts +1 -4
- package/dist/pg-interval.js +1 -168
- package/dist/pg-interval.js.map +1 -1
- package/dist/scalar-zod.d.ts +1 -21
- package/dist/scalar-zod.js +1 -128
- package/dist/scalar-zod.js.map +1 -1
- package/dist/scalars.d.ts +1 -34
- package/dist/scalars.js +1 -348
- package/dist/scalars.js.map +1 -1
- package/package.json +3 -2
package/dist/guild-scalars.d.ts
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/** graphql-scalars@1.26 exports `GraphQLIP` / `GraphQLMAC` only — no CIDR scalar. */
|
|
3
|
-
export { GraphQLIP, GraphQLMAC };
|
|
4
|
-
export declare function guildParseIP(value: unknown): string;
|
|
5
|
-
export declare function guildSerializeIP(value: unknown): string;
|
|
6
|
-
export declare function guildParseMAC(value: unknown): string;
|
|
7
|
-
export declare function guildSerializeMAC(value: unknown): string;
|
|
1
|
+
export { GraphQLIP, GraphQLMAC, guildParseIP, guildParseMAC, guildSerializeIP, guildSerializeMAC, } from "@corpdk/scalar-zod";
|
package/dist/guild-scalars.js
CHANGED
|
@@ -1,16 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
/** graphql-scalars@1.26 exports `GraphQLIP` / `GraphQLMAC` only — no CIDR scalar. */
|
|
3
|
-
export { GraphQLIP, GraphQLMAC };
|
|
4
|
-
export function guildParseIP(value) {
|
|
5
|
-
return GraphQLIP.parseValue(value);
|
|
6
|
-
}
|
|
7
|
-
export function guildSerializeIP(value) {
|
|
8
|
-
return GraphQLIP.serialize(value);
|
|
9
|
-
}
|
|
10
|
-
export function guildParseMAC(value) {
|
|
11
|
-
return GraphQLMAC.parseValue(value);
|
|
12
|
-
}
|
|
13
|
-
export function guildSerializeMAC(value) {
|
|
14
|
-
return GraphQLMAC.serialize(value);
|
|
15
|
-
}
|
|
1
|
+
export { GraphQLIP, GraphQLMAC, guildParseIP, guildParseMAC, guildSerializeIP, guildSerializeMAC, } from "@corpdk/scalar-zod";
|
|
16
2
|
//# sourceMappingURL=guild-scalars.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guild-scalars.js","sourceRoot":"","sources":["../src/guild-scalars.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"guild-scalars.js","sourceRoot":"","sources":["../src/guild-scalars.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,UAAU,EACV,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC"}
|
package/dist/pg-bounds.d.ts
CHANGED
|
@@ -1,12 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const PG_SMALLINT_MIN = -32768;
|
|
3
|
-
export declare const PG_SMALLINT_MAX = 32767;
|
|
4
|
-
/** PostgreSQL `integer` range (32-bit signed). */
|
|
5
|
-
export declare const PG_INT32_MIN = -2147483648;
|
|
6
|
-
export declare const PG_INT32_MAX = 2147483647;
|
|
7
|
-
/** Signed 64-bit integer bounds (PG `bigint`, `interval` ms wire). */
|
|
8
|
-
export declare const PG_INT64_MIN: bigint;
|
|
9
|
-
export declare const PG_INT64_MAX: bigint;
|
|
10
|
-
/** IEEE 754 binary32 finite magnitude limit (PG `real`). */
|
|
11
|
-
export declare const PG_REAL_MAX = 3.4028235e+38;
|
|
12
|
-
export declare const PG_REAL_MIN: number;
|
|
1
|
+
export { PG_INT32_MAX, PG_INT32_MIN, PG_INT64_MAX, PG_INT64_MIN, PG_REAL_MAX, PG_REAL_MIN, PG_SMALLINT_MAX, PG_SMALLINT_MIN, } from "@corpdk/scalar-zod/pg";
|
package/dist/pg-bounds.js
CHANGED
|
@@ -1,13 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export const PG_SMALLINT_MIN = -32_768;
|
|
3
|
-
export const PG_SMALLINT_MAX = 32_767;
|
|
4
|
-
/** PostgreSQL `integer` range (32-bit signed). */
|
|
5
|
-
export const PG_INT32_MIN = -2_147_483_648;
|
|
6
|
-
export const PG_INT32_MAX = 2_147_483_647;
|
|
7
|
-
/** Signed 64-bit integer bounds (PG `bigint`, `interval` ms wire). */
|
|
8
|
-
export const PG_INT64_MIN = BigInt("-9223372036854775808");
|
|
9
|
-
export const PG_INT64_MAX = BigInt("9223372036854775807");
|
|
10
|
-
/** IEEE 754 binary32 finite magnitude limit (PG `real`). */
|
|
11
|
-
export const PG_REAL_MAX = 3.402_823_5e38;
|
|
12
|
-
export const PG_REAL_MIN = -PG_REAL_MAX;
|
|
1
|
+
export { PG_INT32_MAX, PG_INT32_MIN, PG_INT64_MAX, PG_INT64_MIN, PG_REAL_MAX, PG_REAL_MIN, PG_SMALLINT_MAX, PG_SMALLINT_MIN, } from "@corpdk/scalar-zod/pg";
|
|
13
2
|
//# sourceMappingURL=pg-bounds.js.map
|
package/dist/pg-bounds.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pg-bounds.js","sourceRoot":"","sources":["../src/pg-bounds.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"pg-bounds.js","sourceRoot":"","sources":["../src/pg-bounds.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,WAAW,EACX,eAAe,EACf,eAAe,GAChB,MAAM,uBAAuB,CAAC"}
|
package/dist/pg-interval.d.ts
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function pgIntervalTextToMs(text: string): string;
|
|
3
|
-
/** Convert validated IntervalMs wire string to a PostgreSQL interval literal for storage/filters. */
|
|
4
|
-
export declare function intervalMsToPgInterval(msWire: string): string;
|
|
1
|
+
export { intervalMsToPgInterval, pgIntervalTextToMs, } from "@corpdk/scalar-zod/pg";
|
package/dist/pg-interval.js
CHANGED
|
@@ -1,169 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
const MS_PER_SECOND = 1000n;
|
|
3
|
-
const MS_PER_MILLISECOND = 1n;
|
|
4
|
-
const MS_PER_MINUTE = 60n * MS_PER_SECOND;
|
|
5
|
-
const MS_PER_HOUR = 60n * MS_PER_MINUTE;
|
|
6
|
-
const MS_PER_DAY = 24n * MS_PER_HOUR;
|
|
7
|
-
// Fixed 30-day month; PG calendar `mon` fields are not equal to this ms literal in filters.
|
|
8
|
-
const MS_PER_MONTH = 30n * MS_PER_DAY;
|
|
9
|
-
// Fixed 365.25-day year; PG calendar `year` fields are not equal to this ms literal in filters.
|
|
10
|
-
const MS_PER_YEAR = 31557600000n;
|
|
11
|
-
const BACKEND_INTERVAL = new RegExp(String.raw `^(?:([+-]?\d+)\s+years?)?(?:\s*([+-]?\d+)\s+mons?)?(?:\s*([+-]?\d+)\s+days?)?(?:\s*([+-])?(\d*):(\d\d):(\d\d)(?:\.(\d{1,6}))?)?$`, "i");
|
|
12
|
-
const TIME_ONLY = /^([+-])?(\d+):(\d{2}):(\d{2})(?:\.(\d{1,6}))?$/;
|
|
13
|
-
const DAY_TIME = /^(\d+)\s+([+-])?(\d+):(\d{2}):(\d{2})(?:\.(\d{1,6}))?$/;
|
|
14
|
-
const VERBOSE_UNIT_MS = {
|
|
15
|
-
millisecond: MS_PER_MILLISECOND,
|
|
16
|
-
milliseconds: MS_PER_MILLISECOND,
|
|
17
|
-
ms: MS_PER_MILLISECOND,
|
|
18
|
-
second: MS_PER_SECOND,
|
|
19
|
-
seconds: MS_PER_SECOND,
|
|
20
|
-
sec: MS_PER_SECOND,
|
|
21
|
-
secs: MS_PER_SECOND,
|
|
22
|
-
s: MS_PER_SECOND,
|
|
23
|
-
minute: MS_PER_MINUTE,
|
|
24
|
-
minutes: MS_PER_MINUTE,
|
|
25
|
-
min: MS_PER_MINUTE,
|
|
26
|
-
mins: MS_PER_MINUTE,
|
|
27
|
-
hour: MS_PER_HOUR,
|
|
28
|
-
hours: MS_PER_HOUR,
|
|
29
|
-
hr: MS_PER_HOUR,
|
|
30
|
-
hrs: MS_PER_HOUR,
|
|
31
|
-
day: MS_PER_DAY,
|
|
32
|
-
days: MS_PER_DAY,
|
|
33
|
-
week: 7n * MS_PER_DAY,
|
|
34
|
-
weeks: 7n * MS_PER_DAY,
|
|
35
|
-
month: MS_PER_MONTH,
|
|
36
|
-
months: MS_PER_MONTH,
|
|
37
|
-
mon: MS_PER_MONTH,
|
|
38
|
-
mons: MS_PER_MONTH,
|
|
39
|
-
year: MS_PER_YEAR,
|
|
40
|
-
years: MS_PER_YEAR,
|
|
41
|
-
yr: MS_PER_YEAR,
|
|
42
|
-
yrs: MS_PER_YEAR,
|
|
43
|
-
};
|
|
44
|
-
function fractionToMs(fraction) {
|
|
45
|
-
return BigInt((fraction + "000").slice(0, 3));
|
|
46
|
-
}
|
|
47
|
-
function parseBackendInterval(text) {
|
|
48
|
-
const matches = BACKEND_INTERVAL.exec(text.trim());
|
|
49
|
-
if (!matches)
|
|
50
|
-
return null;
|
|
51
|
-
const [, years, months, days, timeSign, hours, minutes, seconds, fraction] = matches;
|
|
52
|
-
if (!years && !months && !days && hours === undefined)
|
|
53
|
-
return null;
|
|
54
|
-
let total = 0n;
|
|
55
|
-
if (years)
|
|
56
|
-
total += BigInt(Number.parseInt(years, 10)) * MS_PER_YEAR;
|
|
57
|
-
if (months)
|
|
58
|
-
total += BigInt(Number.parseInt(months, 10)) * MS_PER_MONTH;
|
|
59
|
-
if (days)
|
|
60
|
-
total += BigInt(Number.parseInt(days, 10)) * MS_PER_DAY;
|
|
61
|
-
if (hours !== undefined) {
|
|
62
|
-
const negativeTime = timeSign === "-";
|
|
63
|
-
let h = BigInt(Number.parseInt(hours || "0", 10));
|
|
64
|
-
let min = BigInt(Number.parseInt(minutes, 10));
|
|
65
|
-
let sec = BigInt(Number.parseInt(seconds, 10));
|
|
66
|
-
let ms = fraction ? fractionToMs(fraction) : 0n;
|
|
67
|
-
if (negativeTime) {
|
|
68
|
-
h = -h;
|
|
69
|
-
min = -min;
|
|
70
|
-
sec = -sec;
|
|
71
|
-
ms = -ms;
|
|
72
|
-
}
|
|
73
|
-
total += h * MS_PER_HOUR + min * MS_PER_MINUTE + sec * MS_PER_SECOND + ms;
|
|
74
|
-
}
|
|
75
|
-
return total;
|
|
76
|
-
}
|
|
77
|
-
function parseTimeOnly(text) {
|
|
78
|
-
const m = TIME_ONLY.exec(text.trim());
|
|
79
|
-
if (!m)
|
|
80
|
-
return null;
|
|
81
|
-
const [, sign, hours, minutes, seconds, fraction] = m;
|
|
82
|
-
const base = BigInt(hours) * MS_PER_HOUR +
|
|
83
|
-
BigInt(minutes) * MS_PER_MINUTE +
|
|
84
|
-
BigInt(seconds) * MS_PER_SECOND +
|
|
85
|
-
(fraction ? fractionToMs(fraction) : 0n);
|
|
86
|
-
return sign === "-" ? -base : base;
|
|
87
|
-
}
|
|
88
|
-
function parseDayTime(text) {
|
|
89
|
-
const m = DAY_TIME.exec(text.trim());
|
|
90
|
-
if (!m)
|
|
91
|
-
return null;
|
|
92
|
-
const [, days, sign, hours, minutes, seconds, fraction] = m;
|
|
93
|
-
const dayMs = BigInt(days) * MS_PER_DAY;
|
|
94
|
-
const timeMs = BigInt(hours) * MS_PER_HOUR +
|
|
95
|
-
BigInt(minutes) * MS_PER_MINUTE +
|
|
96
|
-
BigInt(seconds) * MS_PER_SECOND +
|
|
97
|
-
(fraction ? fractionToMs(fraction) : 0n);
|
|
98
|
-
return dayMs + (sign === "-" ? -timeMs : timeMs);
|
|
99
|
-
}
|
|
100
|
-
function parseAmountToMs(amount, unitMs) {
|
|
101
|
-
const sign = amount.startsWith("-") ? -1n : 1n;
|
|
102
|
-
const unsigned = amount.startsWith("-") || amount.startsWith("+") ? amount.slice(1) : amount;
|
|
103
|
-
if (unitMs === MS_PER_SECOND && unsigned.includes(".")) {
|
|
104
|
-
const [whole, frac = ""] = unsigned.split(".");
|
|
105
|
-
const wholeMs = BigInt(whole || "0") * MS_PER_SECOND;
|
|
106
|
-
return sign * (wholeMs + fractionToMs(frac));
|
|
107
|
-
}
|
|
108
|
-
if (unitMs === MS_PER_MILLISECOND && unsigned.includes(".")) {
|
|
109
|
-
const [whole, frac = ""] = unsigned.split(".");
|
|
110
|
-
const wholeMs = BigInt(whole || "0");
|
|
111
|
-
if (!frac)
|
|
112
|
-
return sign * wholeMs;
|
|
113
|
-
const fracMs = BigInt(frac) / 10n ** BigInt(frac.length);
|
|
114
|
-
return sign * (wholeMs + fracMs);
|
|
115
|
-
}
|
|
116
|
-
const numeric = BigInt(unsigned.split(".")[0] || "0");
|
|
117
|
-
return sign * numeric * unitMs;
|
|
118
|
-
}
|
|
119
|
-
function parseVerboseInterval(text) {
|
|
120
|
-
const trimmed = text.trim();
|
|
121
|
-
if (!trimmed || TIME_ONLY.test(trimmed) || DAY_TIME.test(trimmed))
|
|
122
|
-
return null;
|
|
123
|
-
const tokens = trimmed.split(/\s+/);
|
|
124
|
-
if (tokens.length < 2 || tokens.length % 2 !== 0)
|
|
125
|
-
return null;
|
|
126
|
-
let total = 0n;
|
|
127
|
-
for (let i = 0; i < tokens.length; i += 2) {
|
|
128
|
-
const amount = tokens[i];
|
|
129
|
-
const unitKey = tokens[i + 1].toLowerCase();
|
|
130
|
-
const unitMs = VERBOSE_UNIT_MS[unitKey];
|
|
131
|
-
if (unitMs === undefined) {
|
|
132
|
-
throw new TypeError("Invalid PostgreSQL interval");
|
|
133
|
-
}
|
|
134
|
-
total += parseAmountToMs(amount, unitMs);
|
|
135
|
-
}
|
|
136
|
-
return total;
|
|
137
|
-
}
|
|
138
|
-
function assertInt64Ms(ms) {
|
|
139
|
-
if (ms < PG_INT64_MIN || ms > PG_INT64_MAX) {
|
|
140
|
-
throw new TypeError("IntervalMs out of signed 64-bit range");
|
|
141
|
-
}
|
|
142
|
-
return ms.toString();
|
|
143
|
-
}
|
|
144
|
-
/** Convert PostgreSQL interval text to total milliseconds (PG epoch semantics). */
|
|
145
|
-
export function pgIntervalTextToMs(text) {
|
|
146
|
-
const backend = parseBackendInterval(text);
|
|
147
|
-
if (backend !== null)
|
|
148
|
-
return assertInt64Ms(backend);
|
|
149
|
-
const dayTime = parseDayTime(text);
|
|
150
|
-
if (dayTime !== null)
|
|
151
|
-
return assertInt64Ms(dayTime);
|
|
152
|
-
const timeOnly = parseTimeOnly(text);
|
|
153
|
-
if (timeOnly !== null)
|
|
154
|
-
return assertInt64Ms(timeOnly);
|
|
155
|
-
const verbose = parseVerboseInterval(text);
|
|
156
|
-
if (verbose !== null)
|
|
157
|
-
return assertInt64Ms(verbose);
|
|
158
|
-
throw new TypeError("Invalid PostgreSQL interval");
|
|
159
|
-
}
|
|
160
|
-
/** Convert validated IntervalMs wire string to a PostgreSQL interval literal for storage/filters. */
|
|
161
|
-
export function intervalMsToPgInterval(msWire) {
|
|
162
|
-
const ms = BigInt(msWire);
|
|
163
|
-
if (ms === 0n)
|
|
164
|
-
return "0";
|
|
165
|
-
const sign = ms < 0n ? "-" : "";
|
|
166
|
-
const abs = ms < 0n ? -ms : ms;
|
|
167
|
-
return `${sign}${abs.toString()} milliseconds`;
|
|
168
|
-
}
|
|
1
|
+
export { intervalMsToPgInterval, pgIntervalTextToMs, } from "@corpdk/scalar-zod/pg";
|
|
169
2
|
//# sourceMappingURL=pg-interval.js.map
|
package/dist/pg-interval.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pg-interval.js","sourceRoot":"","sources":["../src/pg-interval.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"pg-interval.js","sourceRoot":"","sources":["../src/pg-interval.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,uBAAuB,CAAC"}
|
package/dist/scalar-zod.d.ts
CHANGED
|
@@ -1,21 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/** Zod for GraphQL built-in Int mapped from PG `integer` (32-bit). */
|
|
3
|
-
export declare const zPgInt32: z.ZodNumber;
|
|
4
|
-
/** Zod for GraphQL built-in Float mapped from PG `real` (IEEE binary32). */
|
|
5
|
-
export declare const zPgReal: z.ZodNumber;
|
|
6
|
-
/** Zod validators aligned with dal-core GraphQL scalar parse rules (mutation/filter inputs). */
|
|
7
|
-
export declare const dalScalarZod: {
|
|
8
|
-
readonly DateTime: z.ZodString;
|
|
9
|
-
readonly Date: z.ZodString;
|
|
10
|
-
readonly TimeTz: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
|
|
11
|
-
readonly BigInt: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBigInt]>;
|
|
12
|
-
readonly Decimal: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
|
|
13
|
-
readonly IntervalMs: z.ZodType<string | number | bigint, unknown, z.core.$ZodTypeInternals<string | number | bigint, unknown>>;
|
|
14
|
-
readonly SmallInt: z.ZodNumber;
|
|
15
|
-
readonly Double: z.ZodNumber;
|
|
16
|
-
readonly InsensitiveString: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
|
|
17
|
-
readonly IP: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
|
|
18
|
-
readonly CIDR: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
|
|
19
|
-
readonly MAC: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
|
|
20
|
-
};
|
|
21
|
-
export type DalScalarZodName = keyof typeof dalScalarZod;
|
|
1
|
+
export { dalScalarZod, type DalScalarZodName, zPgInt32, zPgReal, } from "@corpdk/scalar-zod/pg";
|
package/dist/scalar-zod.js
CHANGED
|
@@ -1,129 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import { PG_INT32_MAX, PG_INT32_MIN, PG_INT64_MAX, PG_INT64_MIN, PG_REAL_MAX, PG_REAL_MIN, PG_SMALLINT_MAX, PG_SMALLINT_MIN, } from "./pg-bounds.js";
|
|
4
|
-
import { parseBigInt, parseCidr, parseCitext, parseDate, parseDateTime, parseDecimal, parseDouble, parseInet, parseIntervalMs, parseMacAddr, parseSmallInt, parseTimeTz, } from "./scalars.js";
|
|
5
|
-
function issueFromError(ctx, error) {
|
|
6
|
-
const message = error instanceof Error ? error.message : "Invalid scalar value";
|
|
7
|
-
ctx.addIssue({ code: "custom", message });
|
|
8
|
-
}
|
|
9
|
-
function wireStringSchema(parse) {
|
|
10
|
-
return z.string().superRefine((val, ctx) => {
|
|
11
|
-
try {
|
|
12
|
-
parse(val);
|
|
13
|
-
}
|
|
14
|
-
catch (error) {
|
|
15
|
-
issueFromError(ctx, error);
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
function parseBigIntCoerced(value) {
|
|
20
|
-
if (typeof value === "number" && !Number.isSafeInteger(value)) {
|
|
21
|
-
throw new TypeError("BigInt number input must be a safe integer; use a decimal string for larger values");
|
|
22
|
-
}
|
|
23
|
-
const validated = GraphQLBigInt.parseValue(value);
|
|
24
|
-
let decimal;
|
|
25
|
-
if (typeof validated === "bigint") {
|
|
26
|
-
decimal = validated.toString();
|
|
27
|
-
}
|
|
28
|
-
else if (typeof validated === "number") {
|
|
29
|
-
if (!Number.isSafeInteger(validated)) {
|
|
30
|
-
throw new TypeError("BigInt number input must be a safe integer; use a decimal string for larger values");
|
|
31
|
-
}
|
|
32
|
-
decimal = Math.trunc(validated).toString();
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
decimal = String(validated);
|
|
36
|
-
}
|
|
37
|
-
return parseBigInt(decimal);
|
|
38
|
-
}
|
|
39
|
-
function int64MsSchema() {
|
|
40
|
-
return z.union([z.string(), z.number().finite(), z.bigint()]).superRefine((val, ctx) => {
|
|
41
|
-
try {
|
|
42
|
-
const wire = parseIntervalMs(val);
|
|
43
|
-
const bi = BigInt(wire);
|
|
44
|
-
if (bi < PG_INT64_MIN || bi > PG_INT64_MAX) {
|
|
45
|
-
ctx.addIssue({ code: "custom", message: "IntervalMs out of signed 64-bit range" });
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
catch (error) {
|
|
49
|
-
issueFromError(ctx, error);
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
const zDateTime = z.string().superRefine((val, ctx) => {
|
|
54
|
-
try {
|
|
55
|
-
GraphQLDateTimeISO.parseValue(val);
|
|
56
|
-
parseDateTime(val);
|
|
57
|
-
}
|
|
58
|
-
catch (error) {
|
|
59
|
-
issueFromError(ctx, error);
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
const zDate = z.string().superRefine((val, ctx) => {
|
|
63
|
-
try {
|
|
64
|
-
GraphQLDate.parseValue(val);
|
|
65
|
-
parseDate(val);
|
|
66
|
-
}
|
|
67
|
-
catch (error) {
|
|
68
|
-
issueFromError(ctx, error);
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
const zBigInt = z.union([z.string(), z.number().finite(), z.bigint()]).superRefine((val, ctx) => {
|
|
72
|
-
try {
|
|
73
|
-
parseBigIntCoerced(val);
|
|
74
|
-
}
|
|
75
|
-
catch (error) {
|
|
76
|
-
issueFromError(ctx, error);
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
const zDecimal = wireStringSchema((v) => parseDecimal(v));
|
|
80
|
-
const zTimeTz = wireStringSchema((v) => parseTimeTz(v));
|
|
81
|
-
const zIntervalMs = int64MsSchema();
|
|
82
|
-
const zSmallInt = z.number().int().min(PG_SMALLINT_MIN).max(PG_SMALLINT_MAX).superRefine((val, ctx) => {
|
|
83
|
-
try {
|
|
84
|
-
parseSmallInt(val);
|
|
85
|
-
}
|
|
86
|
-
catch (error) {
|
|
87
|
-
issueFromError(ctx, error);
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
const zDouble = z.number().finite().superRefine((val, ctx) => {
|
|
91
|
-
try {
|
|
92
|
-
parseDouble(val);
|
|
93
|
-
}
|
|
94
|
-
catch (error) {
|
|
95
|
-
issueFromError(ctx, error);
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
const zInsensitiveString = wireStringSchema((v) => parseCitext(v));
|
|
99
|
-
const zIP = wireStringSchema((v) => parseInet(v));
|
|
100
|
-
const zCidr = wireStringSchema((v) => parseCidr(v));
|
|
101
|
-
const zMAC = wireStringSchema((v) => parseMacAddr(v));
|
|
102
|
-
/** Zod for GraphQL built-in Int mapped from PG `integer` (32-bit). */
|
|
103
|
-
export const zPgInt32 = z
|
|
104
|
-
.number()
|
|
105
|
-
.int()
|
|
106
|
-
.min(PG_INT32_MIN)
|
|
107
|
-
.max(PG_INT32_MAX);
|
|
108
|
-
/** Zod for GraphQL built-in Float mapped from PG `real` (IEEE binary32). */
|
|
109
|
-
export const zPgReal = z
|
|
110
|
-
.number()
|
|
111
|
-
.finite()
|
|
112
|
-
.min(PG_REAL_MIN)
|
|
113
|
-
.max(PG_REAL_MAX);
|
|
114
|
-
/** Zod validators aligned with dal-core GraphQL scalar parse rules (mutation/filter inputs). */
|
|
115
|
-
export const dalScalarZod = {
|
|
116
|
-
DateTime: zDateTime,
|
|
117
|
-
Date: zDate,
|
|
118
|
-
TimeTz: zTimeTz,
|
|
119
|
-
BigInt: zBigInt,
|
|
120
|
-
Decimal: zDecimal,
|
|
121
|
-
IntervalMs: zIntervalMs,
|
|
122
|
-
SmallInt: zSmallInt,
|
|
123
|
-
Double: zDouble,
|
|
124
|
-
InsensitiveString: zInsensitiveString,
|
|
125
|
-
IP: zIP,
|
|
126
|
-
CIDR: zCidr,
|
|
127
|
-
MAC: zMAC,
|
|
128
|
-
};
|
|
1
|
+
export { dalScalarZod, zPgInt32, zPgReal, } from "@corpdk/scalar-zod/pg";
|
|
129
2
|
//# sourceMappingURL=scalar-zod.js.map
|
package/dist/scalar-zod.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scalar-zod.js","sourceRoot":"","sources":["../src/scalar-zod.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"scalar-zod.js","sourceRoot":"","sources":["../src/scalar-zod.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAEZ,QAAQ,EACR,OAAO,GACR,MAAM,uBAAuB,CAAC"}
|
package/dist/scalars.d.ts
CHANGED
|
@@ -1,34 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
/** Serialize timestamptz Date to ISO-8601 UTC with milliseconds and Z suffix. */
|
|
3
|
-
export declare function serializeDateTime(value: Date | string | null | undefined): string | null;
|
|
4
|
-
/** Parse GraphQL DateTime wire value to Date (UTC). */
|
|
5
|
-
export declare function parseDateTime(value: unknown): Date;
|
|
6
|
-
export declare function serializeDate(value: Date | string | null | undefined): string | null;
|
|
7
|
-
export declare function parseDate(value: unknown): string;
|
|
8
|
-
export declare function serializeTimeTz(value: string | null | undefined): string | null;
|
|
9
|
-
export declare function parseTimeTz(value: unknown): string;
|
|
10
|
-
export declare function serializeBigInt(value: bigint | number | string | null | undefined): string | null;
|
|
11
|
-
export declare function parseBigInt(value: unknown): string;
|
|
12
|
-
export declare function serializeDecimal(value: string | number | null | undefined): string | null;
|
|
13
|
-
export declare function parseDecimal(value: unknown): string;
|
|
14
|
-
export declare function serializeIntervalMs(value: string | number | bigint | null | undefined): string | null;
|
|
15
|
-
/** Parse GraphQL IntervalMs wire value (milliseconds) to decimal ms string. */
|
|
16
|
-
export declare function parseIntervalMs(value: unknown): string;
|
|
17
|
-
export declare function serializeSmallInt(value: number | null | undefined): number | null;
|
|
18
|
-
export declare function parseSmallInt(value: unknown): number;
|
|
19
|
-
export declare function serializeDouble(value: number | null | undefined): number | null;
|
|
20
|
-
export declare function parseDouble(value: unknown): number;
|
|
21
|
-
export declare function parseReal(value: unknown): number;
|
|
22
|
-
export declare function serializeCitext(value: string | null | undefined): string | null;
|
|
23
|
-
export declare function parseCitext(value: unknown): string;
|
|
24
|
-
export declare function serializeInet(value: string | null | undefined): string | null;
|
|
25
|
-
/** PostgreSQL inet — validation via graphql-scalars `GraphQLIP`. */
|
|
26
|
-
export declare function parseInet(value: unknown): string;
|
|
27
|
-
export declare function serializeCidr(value: string | null | undefined): string | null;
|
|
28
|
-
export declare function parseCidr(value: unknown): string;
|
|
29
|
-
export declare function serializeMacAddr(value: string | null | undefined): string | null;
|
|
30
|
-
/** PostgreSQL macaddr — validation via graphql-scalars `GraphQLMAC` (colon, dash, or dot separators). */
|
|
31
|
-
export declare function parseMacAddr(value: unknown): string;
|
|
32
|
-
export declare function parsePgInt32(value: unknown): number;
|
|
33
|
-
/** Resolve actor id from context; never returns null — uses "system" fallback. */
|
|
34
|
-
export declare function resolveActorId(actorId: string | null | undefined): string;
|
|
1
|
+
export * from "@corpdk/scalar-zod";
|
package/dist/scalars.js
CHANGED
|
@@ -1,349 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { PG_INT64_MAX, PG_INT64_MIN, PG_INT32_MAX, PG_INT32_MIN, PG_REAL_MAX, PG_REAL_MIN, PG_SMALLINT_MAX, PG_SMALLINT_MIN, } from "./pg-bounds.js";
|
|
3
|
-
export { intervalMsToPgInterval, pgIntervalTextToMs } from "./pg-interval.js";
|
|
4
|
-
import { pgIntervalTextToMs } from "./pg-interval.js";
|
|
5
|
-
/** Serialize timestamptz Date to ISO-8601 UTC with milliseconds and Z suffix. */
|
|
6
|
-
export function serializeDateTime(value) {
|
|
7
|
-
if (value == null)
|
|
8
|
-
return null;
|
|
9
|
-
const d = value instanceof Date ? value : new Date(value);
|
|
10
|
-
return d.toISOString();
|
|
11
|
-
}
|
|
12
|
-
/** Parse GraphQL DateTime wire value to Date (UTC). */
|
|
13
|
-
export function parseDateTime(value) {
|
|
14
|
-
if (typeof value !== "string") {
|
|
15
|
-
throw new TypeError("DateTime must be an ISO-8601 string");
|
|
16
|
-
}
|
|
17
|
-
const d = new Date(value);
|
|
18
|
-
if (Number.isNaN(d.getTime())) {
|
|
19
|
-
throw new TypeError("Invalid DateTime");
|
|
20
|
-
}
|
|
21
|
-
return d;
|
|
22
|
-
}
|
|
23
|
-
const DATE_RE = /^\d{4}-\d{2}-\d{2}$/;
|
|
24
|
-
export function serializeDate(value) {
|
|
25
|
-
if (value == null)
|
|
26
|
-
return null;
|
|
27
|
-
if (typeof value === "string")
|
|
28
|
-
return value;
|
|
29
|
-
return value.toISOString().slice(0, 10);
|
|
30
|
-
}
|
|
31
|
-
export function parseDate(value) {
|
|
32
|
-
if (typeof value !== "string" || !DATE_RE.test(value)) {
|
|
33
|
-
throw new TypeError("Date must be YYYY-MM-DD");
|
|
34
|
-
}
|
|
35
|
-
const d = new Date(`${value}T00:00:00.000Z`);
|
|
36
|
-
if (Number.isNaN(d.getTime())) {
|
|
37
|
-
throw new TypeError("Invalid Date");
|
|
38
|
-
}
|
|
39
|
-
return value;
|
|
40
|
-
}
|
|
41
|
-
const TIME_TZ_RE = /^(\d{2}:\d{2}(?::\d{2}(?:\.\d{1,3})?)?)(Z|[+-]\d{2}:\d{2})$/;
|
|
42
|
-
export function serializeTimeTz(value) {
|
|
43
|
-
if (value == null)
|
|
44
|
-
return null;
|
|
45
|
-
return value;
|
|
46
|
-
}
|
|
47
|
-
export function parseTimeTz(value) {
|
|
48
|
-
if (typeof value !== "string" || !TIME_TZ_RE.test(value)) {
|
|
49
|
-
throw new TypeError("TimeTz must be ISO-8601 time with offset");
|
|
50
|
-
}
|
|
51
|
-
return value;
|
|
52
|
-
}
|
|
53
|
-
const BIGINT_RE = /^-?\d+$/;
|
|
54
|
-
const BIGINT_MIN = BigInt("-9223372036854775808");
|
|
55
|
-
const BIGINT_MAX = BigInt("9223372036854775807");
|
|
56
|
-
function serializeIntegralString(value) {
|
|
57
|
-
if (value == null)
|
|
58
|
-
return null;
|
|
59
|
-
if (typeof value === "bigint")
|
|
60
|
-
return value.toString();
|
|
61
|
-
if (typeof value === "number")
|
|
62
|
-
return Math.trunc(value).toString();
|
|
63
|
-
return value;
|
|
64
|
-
}
|
|
65
|
-
export function serializeBigInt(value) {
|
|
66
|
-
return serializeIntegralString(value);
|
|
67
|
-
}
|
|
68
|
-
export function parseBigInt(value) {
|
|
69
|
-
if (typeof value !== "string" || !BIGINT_RE.test(value)) {
|
|
70
|
-
throw new TypeError("BigInt must be a decimal integer string");
|
|
71
|
-
}
|
|
72
|
-
const bi = BigInt(value);
|
|
73
|
-
if (bi < BIGINT_MIN || bi > BIGINT_MAX) {
|
|
74
|
-
throw new TypeError("BigInt out of range");
|
|
75
|
-
}
|
|
76
|
-
return value;
|
|
77
|
-
}
|
|
78
|
-
const DECIMAL_RE = /^-?\d+(\.\d+)?$/;
|
|
79
|
-
export function serializeDecimal(value) {
|
|
80
|
-
if (value == null)
|
|
81
|
-
return null;
|
|
82
|
-
if (typeof value === "number")
|
|
83
|
-
return value.toString();
|
|
84
|
-
return value;
|
|
85
|
-
}
|
|
86
|
-
export function parseDecimal(value) {
|
|
87
|
-
if (typeof value !== "string" || !DECIMAL_RE.test(value)) {
|
|
88
|
-
throw new TypeError("Decimal must be a decimal string");
|
|
89
|
-
}
|
|
90
|
-
return value;
|
|
91
|
-
}
|
|
92
|
-
const INTERVAL_MS_RE = /^-?\d+$/;
|
|
93
|
-
export function serializeIntervalMs(value) {
|
|
94
|
-
if (value == null)
|
|
95
|
-
return null;
|
|
96
|
-
if (typeof value === "bigint")
|
|
97
|
-
return assertInt64WireDecimal(value.toString());
|
|
98
|
-
if (typeof value === "number") {
|
|
99
|
-
if (!Number.isSafeInteger(value)) {
|
|
100
|
-
throw new TypeError("IntervalMs number input must be a safe integer; use a decimal string for larger values");
|
|
101
|
-
}
|
|
102
|
-
return assertInt64WireDecimal(value.toString());
|
|
103
|
-
}
|
|
104
|
-
if (INTERVAL_MS_RE.test(value)) {
|
|
105
|
-
return assertInt64WireDecimal(value);
|
|
106
|
-
}
|
|
107
|
-
return pgIntervalTextToMs(value);
|
|
108
|
-
}
|
|
109
|
-
function assertInt64WireDecimal(decimal) {
|
|
110
|
-
const bi = BigInt(decimal);
|
|
111
|
-
if (bi < PG_INT64_MIN || bi > PG_INT64_MAX) {
|
|
112
|
-
throw new TypeError("Value out of signed 64-bit range");
|
|
113
|
-
}
|
|
114
|
-
return decimal;
|
|
115
|
-
}
|
|
116
|
-
/** Parse GraphQL IntervalMs wire value (milliseconds) to decimal ms string. */
|
|
117
|
-
export function parseIntervalMs(value) {
|
|
118
|
-
if (typeof value === "number" && Number.isFinite(value)) {
|
|
119
|
-
if (!Number.isSafeInteger(value)) {
|
|
120
|
-
throw new TypeError("IntervalMs number input must be a safe integer; use a decimal string for larger values");
|
|
121
|
-
}
|
|
122
|
-
return assertInt64WireDecimal(value.toString());
|
|
123
|
-
}
|
|
124
|
-
if (typeof value !== "string" || !INTERVAL_MS_RE.test(value)) {
|
|
125
|
-
throw new TypeError("IntervalMs must be a signed integer string of milliseconds");
|
|
126
|
-
}
|
|
127
|
-
return assertInt64WireDecimal(value);
|
|
128
|
-
}
|
|
129
|
-
function parseBoundedInt(value, min, max, label) {
|
|
130
|
-
if (typeof value !== "number" || !Number.isFinite(value) || !Number.isInteger(value)) {
|
|
131
|
-
throw new TypeError(`${label} must be a finite integer`);
|
|
132
|
-
}
|
|
133
|
-
if (value < min || value > max) {
|
|
134
|
-
throw new TypeError(`${label} out of range`);
|
|
135
|
-
}
|
|
136
|
-
return value;
|
|
137
|
-
}
|
|
138
|
-
export function serializeSmallInt(value) {
|
|
139
|
-
if (value == null)
|
|
140
|
-
return null;
|
|
141
|
-
return parseBoundedInt(value, PG_SMALLINT_MIN, PG_SMALLINT_MAX, "SmallInt");
|
|
142
|
-
}
|
|
143
|
-
export function parseSmallInt(value) {
|
|
144
|
-
return parseBoundedInt(value, PG_SMALLINT_MIN, PG_SMALLINT_MAX, "SmallInt");
|
|
145
|
-
}
|
|
146
|
-
export function serializeDouble(value) {
|
|
147
|
-
if (value == null)
|
|
148
|
-
return null;
|
|
149
|
-
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
150
|
-
throw new TypeError("Double must be a finite number");
|
|
151
|
-
}
|
|
152
|
-
return value;
|
|
153
|
-
}
|
|
154
|
-
export function parseDouble(value) {
|
|
155
|
-
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
156
|
-
throw new TypeError("Double must be a finite number");
|
|
157
|
-
}
|
|
158
|
-
return value;
|
|
159
|
-
}
|
|
160
|
-
export function parseReal(value) {
|
|
161
|
-
const n = parseDouble(value);
|
|
162
|
-
if (n < PG_REAL_MIN || n > PG_REAL_MAX) {
|
|
163
|
-
throw new TypeError("Real out of IEEE binary32 range");
|
|
164
|
-
}
|
|
165
|
-
return n;
|
|
166
|
-
}
|
|
167
|
-
export function serializeCitext(value) {
|
|
168
|
-
if (value == null)
|
|
169
|
-
return null;
|
|
170
|
-
if (typeof value !== "string") {
|
|
171
|
-
throw new TypeError("InsensitiveString must be a string");
|
|
172
|
-
}
|
|
173
|
-
return value;
|
|
174
|
-
}
|
|
175
|
-
export function parseCitext(value) {
|
|
176
|
-
if (typeof value !== "string") {
|
|
177
|
-
throw new TypeError("InsensitiveString must be a string");
|
|
178
|
-
}
|
|
179
|
-
return value;
|
|
180
|
-
}
|
|
181
|
-
export function serializeInet(value) {
|
|
182
|
-
if (value == null)
|
|
183
|
-
return null;
|
|
184
|
-
return guildSerializeIP(value);
|
|
185
|
-
}
|
|
186
|
-
/** PostgreSQL inet — validation via graphql-scalars `GraphQLIP`. */
|
|
187
|
-
export function parseInet(value) {
|
|
188
|
-
return guildParseIP(value);
|
|
189
|
-
}
|
|
190
|
-
export function serializeCidr(value) {
|
|
191
|
-
if (value == null)
|
|
192
|
-
return null;
|
|
193
|
-
return parseCidr(value);
|
|
194
|
-
}
|
|
195
|
-
/** PostgreSQL cidr — graphql-scalars has no CIDR scalar (v1.26); prefix + network-bit checks. */
|
|
196
|
-
const CIDR_IPV4_HOST_RE = /^(?:\d{1,3}\.){3}\d{1,3}$/;
|
|
197
|
-
function assertIpv4Octets(dotted) {
|
|
198
|
-
if (!CIDR_IPV4_HOST_RE.test(dotted)) {
|
|
199
|
-
throw new TypeError("CIDR must be valid CIDR notation");
|
|
200
|
-
}
|
|
201
|
-
for (const octet of dotted.split(".")) {
|
|
202
|
-
if (octet.length === 0 || !/^\d{1,3}$/.test(octet)) {
|
|
203
|
-
throw new TypeError("CIDR must be valid CIDR notation");
|
|
204
|
-
}
|
|
205
|
-
const n = Number(octet);
|
|
206
|
-
if (n > 255) {
|
|
207
|
-
throw new TypeError("CIDR must be valid CIDR notation");
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
function assertIpv4CidrHost(host) {
|
|
212
|
-
assertIpv4Octets(host);
|
|
213
|
-
}
|
|
214
|
-
function expandEmbeddedIpv4Groups(parts) {
|
|
215
|
-
const expanded = [];
|
|
216
|
-
for (const part of parts) {
|
|
217
|
-
if (part.includes(".")) {
|
|
218
|
-
assertIpv4Octets(part);
|
|
219
|
-
const octets = part.split(".").map(Number);
|
|
220
|
-
const hi = (octets[0] << 8) | octets[1];
|
|
221
|
-
const lo = (octets[2] << 8) | octets[3];
|
|
222
|
-
expanded.push(hi.toString(16), lo.toString(16));
|
|
223
|
-
}
|
|
224
|
-
else {
|
|
225
|
-
expanded.push(part);
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
return expanded;
|
|
229
|
-
}
|
|
230
|
-
function assertIpv4CidrNetwork(host, prefix) {
|
|
231
|
-
const parts = host.split(".").map(Number);
|
|
232
|
-
const addr = ((parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8) | parts[3]) >>> 0;
|
|
233
|
-
const hostBits = 32 - prefix;
|
|
234
|
-
if (hostBits <= 0) {
|
|
235
|
-
return;
|
|
236
|
-
}
|
|
237
|
-
if (hostBits >= 32) {
|
|
238
|
-
if (addr !== 0) {
|
|
239
|
-
throw new TypeError("CIDR must be valid CIDR notation");
|
|
240
|
-
}
|
|
241
|
-
return;
|
|
242
|
-
}
|
|
243
|
-
const hostMask = (1 << hostBits) - 1;
|
|
244
|
-
if ((addr & hostMask) !== 0) {
|
|
245
|
-
throw new TypeError("CIDR must be valid CIDR notation");
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
function assertIpv6CidrHost(host) {
|
|
249
|
-
try {
|
|
250
|
-
guildParseIP(host);
|
|
251
|
-
}
|
|
252
|
-
catch {
|
|
253
|
-
throw new TypeError("CIDR must be valid CIDR notation");
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
function ipv6HostToBigInt(host) {
|
|
257
|
-
const lowered = host.toLowerCase();
|
|
258
|
-
const doubleColon = lowered.indexOf("::");
|
|
259
|
-
let parts;
|
|
260
|
-
if (doubleColon >= 0) {
|
|
261
|
-
const before = lowered.slice(0, doubleColon);
|
|
262
|
-
const after = lowered.slice(doubleColon + 2);
|
|
263
|
-
const head = expandEmbeddedIpv4Groups(before ? before.split(":") : []);
|
|
264
|
-
const tail = expandEmbeddedIpv4Groups(after ? after.split(":") : []);
|
|
265
|
-
const missing = 8 - head.length - tail.length;
|
|
266
|
-
if (missing < 0) {
|
|
267
|
-
throw new TypeError("CIDR must be valid CIDR notation");
|
|
268
|
-
}
|
|
269
|
-
parts = [...head, ...Array(missing).fill("0"), ...tail];
|
|
270
|
-
}
|
|
271
|
-
else {
|
|
272
|
-
parts = expandEmbeddedIpv4Groups(lowered.split(":"));
|
|
273
|
-
if (parts.length !== 8) {
|
|
274
|
-
throw new TypeError("CIDR must be valid CIDR notation");
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
let addr = 0n;
|
|
278
|
-
for (const part of parts) {
|
|
279
|
-
if (part.length === 0 || part.length > 4 || !/^[0-9a-f]+$/i.test(part)) {
|
|
280
|
-
throw new TypeError("CIDR must be valid CIDR notation");
|
|
281
|
-
}
|
|
282
|
-
const group = BigInt(`0x${part}`);
|
|
283
|
-
if (group > 0xffffn) {
|
|
284
|
-
throw new TypeError("CIDR must be valid CIDR notation");
|
|
285
|
-
}
|
|
286
|
-
addr = (addr << 16n) | group;
|
|
287
|
-
}
|
|
288
|
-
return addr;
|
|
289
|
-
}
|
|
290
|
-
function assertIpv6CidrNetwork(host, prefix) {
|
|
291
|
-
const hostBits = 128 - prefix;
|
|
292
|
-
const addr = ipv6HostToBigInt(host);
|
|
293
|
-
if (hostBits <= 0) {
|
|
294
|
-
return;
|
|
295
|
-
}
|
|
296
|
-
if (hostBits >= 128) {
|
|
297
|
-
if (addr !== 0n) {
|
|
298
|
-
throw new TypeError("CIDR must be valid CIDR notation");
|
|
299
|
-
}
|
|
300
|
-
return;
|
|
301
|
-
}
|
|
302
|
-
const hostMask = (1n << BigInt(hostBits)) - 1n;
|
|
303
|
-
if ((addr & hostMask) !== 0n) {
|
|
304
|
-
throw new TypeError("CIDR must be valid CIDR notation");
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
export function parseCidr(value) {
|
|
308
|
-
if (typeof value !== "string") {
|
|
309
|
-
throw new TypeError("CIDR must be valid CIDR notation");
|
|
310
|
-
}
|
|
311
|
-
const slash = value.lastIndexOf("/");
|
|
312
|
-
if (slash <= 0 || slash === value.length - 1) {
|
|
313
|
-
throw new TypeError("CIDR must be valid CIDR notation");
|
|
314
|
-
}
|
|
315
|
-
const host = value.slice(0, slash);
|
|
316
|
-
const prefix = Number(value.slice(slash + 1));
|
|
317
|
-
if (CIDR_IPV4_HOST_RE.test(host)) {
|
|
318
|
-
assertIpv4CidrHost(host);
|
|
319
|
-
if (!Number.isInteger(prefix) || prefix < 0 || prefix > 32) {
|
|
320
|
-
throw new TypeError("CIDR must be valid CIDR notation");
|
|
321
|
-
}
|
|
322
|
-
assertIpv4CidrNetwork(host, prefix);
|
|
323
|
-
}
|
|
324
|
-
else {
|
|
325
|
-
assertIpv6CidrHost(host);
|
|
326
|
-
if (!Number.isInteger(prefix) || prefix < 0 || prefix > 128) {
|
|
327
|
-
throw new TypeError("CIDR must be valid CIDR notation");
|
|
328
|
-
}
|
|
329
|
-
assertIpv6CidrNetwork(host, prefix);
|
|
330
|
-
}
|
|
331
|
-
return value;
|
|
332
|
-
}
|
|
333
|
-
export function serializeMacAddr(value) {
|
|
334
|
-
if (value == null)
|
|
335
|
-
return null;
|
|
336
|
-
return guildSerializeMAC(value);
|
|
337
|
-
}
|
|
338
|
-
/** PostgreSQL macaddr — validation via graphql-scalars `GraphQLMAC` (colon, dash, or dot separators). */
|
|
339
|
-
export function parseMacAddr(value) {
|
|
340
|
-
return guildParseMAC(value);
|
|
341
|
-
}
|
|
342
|
-
export function parsePgInt32(value) {
|
|
343
|
-
return parseBoundedInt(value, PG_INT32_MIN, PG_INT32_MAX, "Int");
|
|
344
|
-
}
|
|
345
|
-
/** Resolve actor id from context; never returns null — uses "system" fallback. */
|
|
346
|
-
export function resolveActorId(actorId) {
|
|
347
|
-
return actorId?.trim() || "system";
|
|
348
|
-
}
|
|
1
|
+
export * from "@corpdk/scalar-zod";
|
|
349
2
|
//# sourceMappingURL=scalars.js.map
|
package/dist/scalars.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scalars.js","sourceRoot":"","sources":["../src/scalars.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACtG,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,WAAW,EACX,eAAe,EACf,eAAe,GAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,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AC;AAED,MAAM,UAAU,YAAY,CAAC,KAAc;IACzC,OAAO,eAAe,CAAC,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC;AACnE,CAAC;AAED,kFAAkF;AAClF,MAAM,UAAU,cAAc,CAAC,OAAkC;IAC/D,OAAO,OAAO,EAAE,IAAI,EAAE,IAAI,QAAQ,CAAC;AACrC,CAAC"}
|
|
1
|
+
{"version":3,"file":"scalars.js","sourceRoot":"","sources":["../src/scalars.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@corpdk/dal-core",
|
|
3
|
-
"version": "2026.10.0-alpha.
|
|
3
|
+
"version": "2026.10.0-alpha.16",
|
|
4
4
|
"description": "DAL shared types, filters, GraphQL scalars, and mutation error taxonomy",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
"drizzle-orm": "^0.45.2",
|
|
28
28
|
"graphql": "^16.13.2",
|
|
29
29
|
"graphql-scalars": "^1.26.0",
|
|
30
|
-
"zod": "^4.3.6"
|
|
30
|
+
"zod": "^4.3.6",
|
|
31
|
+
"@corpdk/scalar-zod": "2026.10.0-alpha.16"
|
|
31
32
|
},
|
|
32
33
|
"devDependencies": {
|
|
33
34
|
"@types/node": "^24.0.0",
|