agent-relay 6.0.2 → 6.0.4
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 +10 -3
- package/dist/index.cjs +2024 -962
- package/dist/src/cli/commands/cloud.d.ts.map +1 -1
- package/dist/src/cli/commands/cloud.js +17 -144
- package/dist/src/cli/commands/cloud.js.map +1 -1
- package/dist/src/cli/commands/setup.d.ts +2 -39
- package/dist/src/cli/commands/setup.d.ts.map +1 -1
- package/dist/src/cli/commands/setup.js +4 -333
- package/dist/src/cli/commands/setup.js.map +1 -1
- package/dist/src/cli/lib/auth-ssh.d.ts +2 -33
- package/dist/src/cli/lib/auth-ssh.d.ts.map +1 -1
- package/dist/src/cli/lib/auth-ssh.js +3 -39
- package/dist/src/cli/lib/auth-ssh.js.map +1 -1
- package/dist/src/cli/lib/ssh-interactive.d.ts +4 -66
- package/dist/src/cli/lib/ssh-interactive.d.ts.map +1 -1
- package/dist/src/cli/lib/ssh-interactive.js +4 -436
- package/dist/src/cli/lib/ssh-interactive.js.map +1 -1
- package/node_modules/@relaycast/sdk/node_modules/zod/README.md +1 -1
- package/node_modules/@relaycast/sdk/node_modules/zod/locales/package.json +2 -1
- package/node_modules/@relaycast/sdk/node_modules/zod/mini/package.json +2 -1
- package/node_modules/@relaycast/sdk/node_modules/zod/package.json +1 -1
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v3/tests/all-errors.test.ts +3 -3
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v3/tests/object.test.ts +5 -5
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v3/tests/partials.test.ts +3 -3
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/errors.ts +2 -2
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/external.ts +1 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/from-json-schema.ts +39 -23
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/parse.ts +6 -6
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/schemas.ts +389 -148
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/catch.test.ts +4 -2
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/codec.test.ts +142 -1
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/continuability.test.ts +1 -1
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/datetime.test.ts +1 -1
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/default.test.ts +44 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +197 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +31 -1
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +214 -2
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +161 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/function.test.ts +6 -6
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/global-config.test.ts +39 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/index.test.ts +2 -2
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +46 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +29 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +24 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/number.test.ts +55 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/object.test.ts +83 -6
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/optional.test.ts +114 -4
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/partial.test.ts +28 -2
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/prefault.test.ts +1 -1
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/record.test.ts +85 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +49 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/refine.test.ts +63 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/string.test.ts +50 -1
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +4 -4
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +128 -14
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/transform.test.ts +17 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/tuple.test.ts +315 -2
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/classic/tests/union.test.ts +54 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/core/api.ts +25 -2
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/core/checks.ts +1 -1
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/core/core.ts +17 -2
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/core/errors.ts +31 -24
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/core/json-schema-processors.ts +15 -17
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/core/parse.ts +7 -7
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/core/regexes.ts +8 -1
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/core/schemas.ts +218 -66
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/core/tests/locales/el.test.ts +215 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +72 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +163 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +22 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +58 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/core/to-json-schema.ts +9 -1
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/core/util.ts +52 -35
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/core/versions.ts +2 -2
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/locales/el.ts +121 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/locales/en.ts +4 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/locales/fr.ts +24 -8
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/locales/hr.ts +131 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/locales/index.ts +3 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/locales/it.ts +1 -1
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/locales/ka.ts +8 -8
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/locales/ro.ts +129 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/locales/uz.ts +1 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/mini/external.ts +1 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/mini/schemas.ts +55 -24
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/mini/tests/codec.test.ts +19 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/mini/tests/index.test.ts +27 -2
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/mini/tests/object.test.ts +9 -9
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +51 -1
- package/node_modules/@relaycast/sdk/node_modules/zod/src/v4/mini/tests/string.test.ts +5 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/v3/package.json +2 -1
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/classic/errors.js +2 -2
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/classic/external.d.cts +1 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/classic/external.d.ts +1 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/classic/from-json-schema.cjs +31 -16
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/classic/from-json-schema.js +31 -16
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/classic/package.json +2 -1
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/classic/schemas.cjs +346 -117
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/classic/schemas.d.cts +34 -12
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/classic/schemas.d.ts +34 -12
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/classic/schemas.js +345 -117
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/api.cjs +7 -2
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/api.d.cts +20 -1
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/api.d.ts +20 -1
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/api.js +7 -2
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/checks.d.cts +1 -1
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/checks.d.ts +1 -1
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/core.cjs +3 -1
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/core.js +4 -2
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/errors.cjs +26 -23
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/errors.d.cts +1 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/errors.d.ts +1 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/errors.js +26 -23
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/json-schema-processors.cjs +14 -19
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/json-schema-processors.js +14 -19
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/package.json +2 -1
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/parse.cjs +7 -7
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/parse.js +7 -7
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/regexes.cjs +9 -3
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/regexes.d.cts +6 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/regexes.d.ts +6 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/regexes.js +7 -1
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/schemas.cjs +196 -59
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/schemas.d.cts +21 -1
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/schemas.d.ts +21 -1
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/schemas.js +196 -59
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/to-json-schema.cjs +10 -1
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/to-json-schema.js +10 -1
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/util.cjs +54 -30
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/util.d.cts +1 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/util.d.ts +1 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/util.js +55 -32
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/versions.cjs +2 -2
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/versions.d.cts +1 -1
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/versions.d.ts +1 -1
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/core/versions.js +2 -2
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/el.cjs +136 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/el.d.cts +5 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/el.d.ts +4 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/el.js +109 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/en.cjs +4 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/en.js +4 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/fr.cjs +24 -7
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/fr.js +24 -7
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/hr.cjs +149 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/hr.d.cts +5 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/hr.d.ts +4 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/hr.js +122 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/index.cjs +8 -1
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/index.d.cts +3 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/index.d.ts +3 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/index.js +3 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/it.cjs +1 -1
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/it.js +1 -1
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/ka.cjs +8 -8
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/ka.js +8 -8
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/package.json +2 -1
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/ro.cjs +146 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/ro.d.cts +5 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/ro.d.ts +4 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/ro.js +119 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/uz.cjs +1 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/locales/uz.js +1 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/mini/external.d.cts +1 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/mini/external.d.ts +1 -0
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/mini/package.json +2 -1
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/mini/schemas.cjs +41 -4
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/mini/schemas.d.cts +27 -9
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/mini/schemas.d.ts +27 -9
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/mini/schemas.js +40 -4
- package/node_modules/@relaycast/sdk/node_modules/zod/v4/package.json +2 -1
- package/node_modules/@relaycast/sdk/node_modules/zod/v4-mini/package.json +2 -1
- package/package.json +10 -10
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import * as util from "../core/util.js";
|
|
2
|
+
const error = () => {
|
|
3
|
+
const Sizable = {
|
|
4
|
+
string: { unit: "caractere", verb: "să aibă" },
|
|
5
|
+
file: { unit: "octeți", verb: "să aibă" },
|
|
6
|
+
array: { unit: "elemente", verb: "să aibă" },
|
|
7
|
+
set: { unit: "elemente", verb: "să aibă" },
|
|
8
|
+
map: { unit: "intrări", verb: "să aibă" },
|
|
9
|
+
};
|
|
10
|
+
function getSizing(origin) {
|
|
11
|
+
return Sizable[origin] ?? null;
|
|
12
|
+
}
|
|
13
|
+
const FormatDictionary = {
|
|
14
|
+
regex: "intrare",
|
|
15
|
+
email: "adresă de email",
|
|
16
|
+
url: "URL",
|
|
17
|
+
emoji: "emoji",
|
|
18
|
+
uuid: "UUID",
|
|
19
|
+
uuidv4: "UUIDv4",
|
|
20
|
+
uuidv6: "UUIDv6",
|
|
21
|
+
nanoid: "nanoid",
|
|
22
|
+
guid: "GUID",
|
|
23
|
+
cuid: "cuid",
|
|
24
|
+
cuid2: "cuid2",
|
|
25
|
+
ulid: "ULID",
|
|
26
|
+
xid: "XID",
|
|
27
|
+
ksuid: "KSUID",
|
|
28
|
+
datetime: "dată și oră ISO",
|
|
29
|
+
date: "dată ISO",
|
|
30
|
+
time: "oră ISO",
|
|
31
|
+
duration: "durată ISO",
|
|
32
|
+
ipv4: "adresă IPv4",
|
|
33
|
+
ipv6: "adresă IPv6",
|
|
34
|
+
mac: "adresă MAC",
|
|
35
|
+
cidrv4: "interval IPv4",
|
|
36
|
+
cidrv6: "interval IPv6",
|
|
37
|
+
base64: "șir codat base64",
|
|
38
|
+
base64url: "șir codat base64url",
|
|
39
|
+
json_string: "șir JSON",
|
|
40
|
+
e164: "număr E.164",
|
|
41
|
+
jwt: "JWT",
|
|
42
|
+
template_literal: "intrare",
|
|
43
|
+
};
|
|
44
|
+
const TypeDictionary = {
|
|
45
|
+
nan: "NaN",
|
|
46
|
+
string: "șir",
|
|
47
|
+
number: "număr",
|
|
48
|
+
boolean: "boolean",
|
|
49
|
+
function: "funcție",
|
|
50
|
+
array: "matrice",
|
|
51
|
+
object: "obiect",
|
|
52
|
+
undefined: "nedefinit",
|
|
53
|
+
symbol: "simbol",
|
|
54
|
+
bigint: "număr mare",
|
|
55
|
+
void: "void",
|
|
56
|
+
never: "never",
|
|
57
|
+
map: "hartă",
|
|
58
|
+
set: "set",
|
|
59
|
+
};
|
|
60
|
+
return (issue) => {
|
|
61
|
+
switch (issue.code) {
|
|
62
|
+
case "invalid_type": {
|
|
63
|
+
const expected = TypeDictionary[issue.expected] ?? issue.expected;
|
|
64
|
+
const receivedType = util.parsedType(issue.input);
|
|
65
|
+
const received = TypeDictionary[receivedType] ?? receivedType;
|
|
66
|
+
return `Intrare invalidă: așteptat ${expected}, primit ${received}`;
|
|
67
|
+
}
|
|
68
|
+
case "invalid_value":
|
|
69
|
+
if (issue.values.length === 1)
|
|
70
|
+
return `Intrare invalidă: așteptat ${util.stringifyPrimitive(issue.values[0])}`;
|
|
71
|
+
return `Opțiune invalidă: așteptat una dintre ${util.joinValues(issue.values, "|")}`;
|
|
72
|
+
case "too_big": {
|
|
73
|
+
const adj = issue.inclusive ? "<=" : "<";
|
|
74
|
+
const sizing = getSizing(issue.origin);
|
|
75
|
+
if (sizing)
|
|
76
|
+
return `Prea mare: așteptat ca ${issue.origin ?? "valoarea"} ${sizing.verb} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elemente"}`;
|
|
77
|
+
return `Prea mare: așteptat ca ${issue.origin ?? "valoarea"} să fie ${adj}${issue.maximum.toString()}`;
|
|
78
|
+
}
|
|
79
|
+
case "too_small": {
|
|
80
|
+
const adj = issue.inclusive ? ">=" : ">";
|
|
81
|
+
const sizing = getSizing(issue.origin);
|
|
82
|
+
if (sizing) {
|
|
83
|
+
return `Prea mic: așteptat ca ${issue.origin} ${sizing.verb} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
|
84
|
+
}
|
|
85
|
+
return `Prea mic: așteptat ca ${issue.origin} să fie ${adj}${issue.minimum.toString()}`;
|
|
86
|
+
}
|
|
87
|
+
case "invalid_format": {
|
|
88
|
+
const _issue = issue;
|
|
89
|
+
if (_issue.format === "starts_with") {
|
|
90
|
+
return `Șir invalid: trebuie să înceapă cu "${_issue.prefix}"`;
|
|
91
|
+
}
|
|
92
|
+
if (_issue.format === "ends_with")
|
|
93
|
+
return `Șir invalid: trebuie să se termine cu "${_issue.suffix}"`;
|
|
94
|
+
if (_issue.format === "includes")
|
|
95
|
+
return `Șir invalid: trebuie să includă "${_issue.includes}"`;
|
|
96
|
+
if (_issue.format === "regex")
|
|
97
|
+
return `Șir invalid: trebuie să se potrivească cu modelul ${_issue.pattern}`;
|
|
98
|
+
return `Format invalid: ${FormatDictionary[_issue.format] ?? issue.format}`;
|
|
99
|
+
}
|
|
100
|
+
case "not_multiple_of":
|
|
101
|
+
return `Număr invalid: trebuie să fie multiplu de ${issue.divisor}`;
|
|
102
|
+
case "unrecognized_keys":
|
|
103
|
+
return `Chei nerecunoscute: ${util.joinValues(issue.keys, ", ")}`;
|
|
104
|
+
case "invalid_key":
|
|
105
|
+
return `Cheie invalidă în ${issue.origin}`;
|
|
106
|
+
case "invalid_union":
|
|
107
|
+
return "Intrare invalidă";
|
|
108
|
+
case "invalid_element":
|
|
109
|
+
return `Valoare invalidă în ${issue.origin}`;
|
|
110
|
+
default:
|
|
111
|
+
return `Intrare invalidă`;
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
export default function () {
|
|
116
|
+
return {
|
|
117
|
+
localeError: error(),
|
|
118
|
+
};
|
|
119
|
+
}
|
|
@@ -31,6 +31,7 @@ const error = () => {
|
|
|
31
31
|
file: { unit: "bayt", verb: "bo‘lishi kerak" },
|
|
32
32
|
array: { unit: "element", verb: "bo‘lishi kerak" },
|
|
33
33
|
set: { unit: "element", verb: "bo‘lishi kerak" },
|
|
34
|
+
map: { unit: "yozuv", verb: "bo‘lishi kerak" },
|
|
34
35
|
};
|
|
35
36
|
function getSizing(origin) {
|
|
36
37
|
return Sizable[origin] ?? null;
|
|
@@ -5,6 +5,7 @@ const error = () => {
|
|
|
5
5
|
file: { unit: "bayt", verb: "bo‘lishi kerak" },
|
|
6
6
|
array: { unit: "element", verb: "bo‘lishi kerak" },
|
|
7
7
|
set: { unit: "element", verb: "bo‘lishi kerak" },
|
|
8
|
+
map: { unit: "yozuv", verb: "bo‘lishi kerak" },
|
|
8
9
|
};
|
|
9
10
|
function getSizing(origin) {
|
|
10
11
|
return Sizable[origin] ?? null;
|
|
@@ -3,6 +3,7 @@ export * from "./parse.cjs";
|
|
|
3
3
|
export * from "./schemas.cjs";
|
|
4
4
|
export * from "./checks.cjs";
|
|
5
5
|
export type { infer, output, input } from "../core/index.cjs";
|
|
6
|
+
export type { JSONType } from "../core/util.cjs";
|
|
6
7
|
export { globalRegistry, registry, config, $output, $input, $brand, clone, regexes, treeifyError, prettifyError, formatError, flattenError, TimePrecision, util, NEVER, } from "../core/index.cjs";
|
|
7
8
|
export { toJSONSchema } from "../core/json-schema-processors.cjs";
|
|
8
9
|
export * as locales from "../locales/index.cjs";
|
|
@@ -3,6 +3,7 @@ export * from "./parse.js";
|
|
|
3
3
|
export * from "./schemas.js";
|
|
4
4
|
export * from "./checks.js";
|
|
5
5
|
export type { infer, output, input } from "../core/index.js";
|
|
6
|
+
export type { JSONType } from "../core/util.js";
|
|
6
7
|
export { globalRegistry, registry, config, $output, $input, $brand, clone, regexes, treeifyError, prettifyError, formatError, flattenError, TimePrecision, util, NEVER, } from "../core/index.js";
|
|
7
8
|
export { toJSONSchema } from "../core/json-schema-processors.js";
|
|
8
9
|
export * as locales from "../locales/index.js";
|
|
@@ -112,6 +112,7 @@ exports.catch = _catch;
|
|
|
112
112
|
exports.nan = nan;
|
|
113
113
|
exports.pipe = pipe;
|
|
114
114
|
exports.codec = codec;
|
|
115
|
+
exports.invertCodec = invertCodec;
|
|
115
116
|
exports.readonly = readonly;
|
|
116
117
|
exports.templateLiteral = templateLiteral;
|
|
117
118
|
exports.lazy = _lazy;
|
|
@@ -144,7 +145,11 @@ exports.ZodMiniType = core.$constructor("ZodMiniType", (inst, def) => {
|
|
|
144
145
|
...def,
|
|
145
146
|
checks: [
|
|
146
147
|
...(def.checks ?? []),
|
|
147
|
-
...checks.map((ch) => typeof ch === "function"
|
|
148
|
+
...checks.map((ch) => typeof ch === "function"
|
|
149
|
+
? {
|
|
150
|
+
_zod: { check: ch, def: { check: "custom" }, onattach: [] },
|
|
151
|
+
}
|
|
152
|
+
: ch),
|
|
148
153
|
],
|
|
149
154
|
}, { parent: true });
|
|
150
155
|
};
|
|
@@ -218,7 +223,7 @@ function url(params) {
|
|
|
218
223
|
// @__NO_SIDE_EFFECTS__
|
|
219
224
|
function httpUrl(params) {
|
|
220
225
|
return core._url(exports.ZodMiniURL, {
|
|
221
|
-
protocol:
|
|
226
|
+
protocol: core.regexes.httpProtocol,
|
|
222
227
|
hostname: core.regexes.domain,
|
|
223
228
|
...util.normalizeParams(params),
|
|
224
229
|
});
|
|
@@ -239,10 +244,22 @@ exports.ZodMiniNanoID = core.$constructor("ZodMiniNanoID", (inst, def) => {
|
|
|
239
244
|
function nanoid(params) {
|
|
240
245
|
return core._nanoid(exports.ZodMiniNanoID, params);
|
|
241
246
|
}
|
|
247
|
+
/**
|
|
248
|
+
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
249
|
+
* (timestamps embedded in the id). Use {@link ZodMiniCUID2} instead.
|
|
250
|
+
* See https://github.com/paralleldrive/cuid.
|
|
251
|
+
*/
|
|
242
252
|
exports.ZodMiniCUID = core.$constructor("ZodMiniCUID", (inst, def) => {
|
|
243
253
|
core.$ZodCUID.init(inst, def);
|
|
244
254
|
exports.ZodMiniStringFormat.init(inst, def);
|
|
245
255
|
});
|
|
256
|
+
/**
|
|
257
|
+
* Validates a CUID v1 string.
|
|
258
|
+
*
|
|
259
|
+
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
260
|
+
* (timestamps embedded in the id). Use {@link cuid2 | `z.cuid2()`} instead.
|
|
261
|
+
* See https://github.com/paralleldrive/cuid.
|
|
262
|
+
*/
|
|
246
263
|
// @__NO_SIDE_EFFECTS__
|
|
247
264
|
function cuid(params) {
|
|
248
265
|
return core._cuid(exports.ZodMiniCUID, params);
|
|
@@ -668,6 +685,15 @@ exports.ZodMiniRecord = core.$constructor("ZodMiniRecord", (inst, def) => {
|
|
|
668
685
|
});
|
|
669
686
|
// @__NO_SIDE_EFFECTS__
|
|
670
687
|
function record(keyType, valueType, params) {
|
|
688
|
+
// v3-compat: z.record(valueType, params?) — defaults keyType to z.string()
|
|
689
|
+
if (!valueType || !valueType._zod) {
|
|
690
|
+
return new exports.ZodMiniRecord({
|
|
691
|
+
type: "record",
|
|
692
|
+
keyType: string(),
|
|
693
|
+
valueType: keyType,
|
|
694
|
+
...util.normalizeParams(valueType),
|
|
695
|
+
});
|
|
696
|
+
}
|
|
671
697
|
return new exports.ZodMiniRecord({
|
|
672
698
|
type: "record",
|
|
673
699
|
keyType,
|
|
@@ -915,6 +941,17 @@ function codec(in_, out, params) {
|
|
|
915
941
|
reverseTransform: params.encode,
|
|
916
942
|
});
|
|
917
943
|
}
|
|
944
|
+
// @__NO_SIDE_EFFECTS__
|
|
945
|
+
function invertCodec(codec) {
|
|
946
|
+
const def = codec._zod.def;
|
|
947
|
+
return new exports.ZodMiniCodec({
|
|
948
|
+
type: "pipe",
|
|
949
|
+
in: def.out,
|
|
950
|
+
out: def.in,
|
|
951
|
+
transform: def.reverseTransform,
|
|
952
|
+
reverseTransform: def.transform,
|
|
953
|
+
});
|
|
954
|
+
}
|
|
918
955
|
exports.ZodMiniReadonly = core.$constructor("ZodMiniReadonly", (inst, def) => {
|
|
919
956
|
core.$ZodReadonly.init(inst, def);
|
|
920
957
|
exports.ZodMiniType.init(inst, def);
|
|
@@ -990,8 +1027,8 @@ function refine(fn, _params = {}) {
|
|
|
990
1027
|
}
|
|
991
1028
|
// superRefine
|
|
992
1029
|
// @__NO_SIDE_EFFECTS__
|
|
993
|
-
function superRefine(fn) {
|
|
994
|
-
return core._superRefine(fn);
|
|
1030
|
+
function superRefine(fn, params) {
|
|
1031
|
+
return core._superRefine(fn, params);
|
|
995
1032
|
}
|
|
996
1033
|
// Re-export describe and meta from core
|
|
997
1034
|
exports.describe = core.describe;
|
|
@@ -58,9 +58,26 @@ export interface ZodMiniNanoID extends _ZodMiniString<core.$ZodNanoIDInternals>
|
|
|
58
58
|
}
|
|
59
59
|
export declare const ZodMiniNanoID: core.$constructor<ZodMiniNanoID>;
|
|
60
60
|
export declare function nanoid(params?: string | core.$ZodNanoIDParams): ZodMiniNanoID;
|
|
61
|
+
/**
|
|
62
|
+
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
63
|
+
* (timestamps embedded in the id). Use {@link ZodMiniCUID2} instead.
|
|
64
|
+
* See https://github.com/paralleldrive/cuid.
|
|
65
|
+
*/
|
|
61
66
|
export interface ZodMiniCUID extends _ZodMiniString<core.$ZodCUIDInternals> {
|
|
62
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
70
|
+
* (timestamps embedded in the id). Use {@link ZodMiniCUID2} instead.
|
|
71
|
+
* See https://github.com/paralleldrive/cuid.
|
|
72
|
+
*/
|
|
63
73
|
export declare const ZodMiniCUID: core.$constructor<ZodMiniCUID>;
|
|
74
|
+
/**
|
|
75
|
+
* Validates a CUID v1 string.
|
|
76
|
+
*
|
|
77
|
+
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
78
|
+
* (timestamps embedded in the id). Use {@link cuid2 | `z.cuid2()`} instead.
|
|
79
|
+
* See https://github.com/paralleldrive/cuid.
|
|
80
|
+
*/
|
|
64
81
|
export declare function cuid(params?: string | core.$ZodCUIDParams): ZodMiniCUID;
|
|
65
82
|
export interface ZodMiniCUID2 extends _ZodMiniString<core.$ZodCUID2Internals> {
|
|
66
83
|
}
|
|
@@ -198,23 +215,23 @@ out Shape extends core.$ZodShape = core.$ZodShape, out Config extends core.$ZodO
|
|
|
198
215
|
shape: Shape;
|
|
199
216
|
}
|
|
200
217
|
export declare const ZodMiniObject: core.$constructor<ZodMiniObject>;
|
|
201
|
-
export declare function object<T extends core.$ZodLooseShape = Record<never, SomeType>>(shape?: T, params?: string | core.$ZodObjectParams): ZodMiniObject<T
|
|
202
|
-
export declare function strictObject<T extends core.$ZodLooseShape>(shape: T, params?: string | core.$ZodObjectParams): ZodMiniObject<T
|
|
203
|
-
export declare function looseObject<T extends core.$ZodLooseShape>(shape: T, params?: string | core.$ZodObjectParams): ZodMiniObject<T
|
|
204
|
-
export declare function extend<T extends ZodMiniObject, U extends core.$ZodLooseShape>(schema: T, shape: U): ZodMiniObject<util.Extend<T["shape"], U
|
|
218
|
+
export declare function object<T extends core.$ZodLooseShape = Record<never, SomeType>>(shape?: T, params?: string | core.$ZodObjectParams): ZodMiniObject<util.Writeable<T>, core.$strip>;
|
|
219
|
+
export declare function strictObject<T extends core.$ZodLooseShape>(shape: T, params?: string | core.$ZodObjectParams): ZodMiniObject<util.Writeable<T>, core.$strict>;
|
|
220
|
+
export declare function looseObject<T extends core.$ZodLooseShape>(shape: T, params?: string | core.$ZodObjectParams): ZodMiniObject<util.Writeable<T>, core.$loose>;
|
|
221
|
+
export declare function extend<T extends ZodMiniObject, U extends core.$ZodLooseShape>(schema: T, shape: U): ZodMiniObject<util.Extend<T["shape"], util.Writeable<U>>, T["_zod"]["config"]>;
|
|
205
222
|
export type SafeExtendShape<Base extends core.$ZodShape, Ext extends core.$ZodLooseShape> = {
|
|
206
223
|
[K in keyof Ext]: K extends keyof Base ? core.output<Ext[K]> extends core.output<Base[K]> ? core.input<Ext[K]> extends core.input<Base[K]> ? Ext[K] : never : never : Ext[K];
|
|
207
224
|
};
|
|
208
|
-
export declare function safeExtend<T extends ZodMiniObject, U extends core.$ZodLooseShape>(schema: T, shape: SafeExtendShape<T["shape"], U>): ZodMiniObject<util.Extend<T["shape"], U
|
|
225
|
+
export declare function safeExtend<T extends ZodMiniObject, U extends core.$ZodLooseShape>(schema: T, shape: SafeExtendShape<T["shape"], U>): ZodMiniObject<util.Extend<T["shape"], util.Writeable<U>>, T["_zod"]["config"]>;
|
|
209
226
|
/** @deprecated Identical to `z.extend(A, B)` */
|
|
210
227
|
export declare function merge<T extends ZodMiniObject, U extends ZodMiniObject>(a: T, b: U): ZodMiniObject<util.Extend<T["shape"], U["shape"]>, T["_zod"]["config"]>;
|
|
211
228
|
export declare function pick<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M & Record<Exclude<keyof M, keyof T["shape"]>, never>): ZodMiniObject<util.Flatten<Pick<T["shape"], keyof T["shape"] & keyof M>>, T["_zod"]["config"]>;
|
|
212
229
|
export declare function omit<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M & Record<Exclude<keyof M, keyof T["shape"]>, never>): ZodMiniObject<util.Flatten<Omit<T["shape"], keyof M>>, T["_zod"]["config"]>;
|
|
213
230
|
export declare function partial<T extends ZodMiniObject>(schema: T): ZodMiniObject<{
|
|
214
|
-
[k in keyof T["shape"]]: ZodMiniOptional<T["shape"][k]>;
|
|
231
|
+
-readonly [k in keyof T["shape"]]: ZodMiniOptional<T["shape"][k]>;
|
|
215
232
|
}, T["_zod"]["config"]>;
|
|
216
233
|
export declare function partial<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M & Record<Exclude<keyof M, keyof T["shape"]>, never>): ZodMiniObject<{
|
|
217
|
-
[k in keyof T["shape"]]: k extends keyof M ? ZodMiniOptional<T["shape"][k]> : T["shape"][k];
|
|
234
|
+
-readonly [k in keyof T["shape"]]: k extends keyof M ? ZodMiniOptional<T["shape"][k]> : T["shape"][k];
|
|
218
235
|
}, T["_zod"]["config"]>;
|
|
219
236
|
export type RequiredInterfaceShape<Shape extends core.$ZodLooseShape, Keys extends PropertyKey = keyof Shape> = util.Identity<{
|
|
220
237
|
[k in keyof Shape as k extends Keys ? k : never]: ZodMiniNonOptional<Shape[k]>;
|
|
@@ -222,7 +239,7 @@ export type RequiredInterfaceShape<Shape extends core.$ZodLooseShape, Keys exten
|
|
|
222
239
|
[k in keyof Shape as k extends Keys ? never : k]: Shape[k];
|
|
223
240
|
}>;
|
|
224
241
|
export declare function required<T extends ZodMiniObject>(schema: T): ZodMiniObject<{
|
|
225
|
-
[k in keyof T["shape"]]: ZodMiniNonOptional<T["shape"][k]>;
|
|
242
|
+
-readonly [k in keyof T["shape"]]: ZodMiniNonOptional<T["shape"][k]>;
|
|
226
243
|
}, T["_zod"]["config"]>;
|
|
227
244
|
export declare function required<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M & Record<Exclude<keyof M, keyof T["shape"]>, never>): ZodMiniObject<util.Extend<T["shape"], {
|
|
228
245
|
[k in keyof M & keyof T["shape"]]: ZodMiniNonOptional<T["shape"][k]>;
|
|
@@ -347,6 +364,7 @@ export declare function codec<const A extends SomeType, B extends core.SomeType
|
|
|
347
364
|
decode: (value: core.output<A>, payload: core.ParsePayload<core.output<A>>) => core.util.MaybeAsync<core.input<B>>;
|
|
348
365
|
encode: (value: core.input<B>, payload: core.ParsePayload<core.input<B>>) => core.util.MaybeAsync<core.output<A>>;
|
|
349
366
|
}): ZodMiniCodec<A, B>;
|
|
367
|
+
export declare function invertCodec<A extends SomeType, B extends SomeType>(codec: ZodMiniCodec<A, B>): ZodMiniCodec<B, A>;
|
|
350
368
|
export interface ZodMiniReadonly<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodReadonlyInternals<T>> {
|
|
351
369
|
}
|
|
352
370
|
export declare const ZodMiniReadonly: core.$constructor<ZodMiniReadonly>;
|
|
@@ -370,7 +388,7 @@ export declare const ZodMiniCustom: core.$constructor<ZodMiniCustom>;
|
|
|
370
388
|
export declare function check<O = unknown>(fn: core.CheckFn<O>, params?: string | core.$ZodCustomParams): core.$ZodCheck<O>;
|
|
371
389
|
export declare function custom<O = unknown, I = O>(fn?: (data: O) => unknown, _params?: string | core.$ZodCustomParams | undefined): ZodMiniCustom<O, I>;
|
|
372
390
|
export declare function refine<T>(fn: (arg: NoInfer<T>) => util.MaybeAsync<unknown>, _params?: string | core.$ZodCustomParams): core.$ZodCheck<T>;
|
|
373
|
-
export declare function superRefine<T>(fn: (arg: T, payload: core.$RefinementCtx<T>) => void | Promise<void
|
|
391
|
+
export declare function superRefine<T>(fn: (arg: T, payload: core.$RefinementCtx<T>) => void | Promise<void>, params?: core.$ZodSuperRefineParams): core.$ZodCheck<T>;
|
|
374
392
|
export declare const describe: typeof core.describe;
|
|
375
393
|
export declare const meta: typeof core.meta;
|
|
376
394
|
declare abstract class Class {
|
|
@@ -58,9 +58,26 @@ export interface ZodMiniNanoID extends _ZodMiniString<core.$ZodNanoIDInternals>
|
|
|
58
58
|
}
|
|
59
59
|
export declare const ZodMiniNanoID: core.$constructor<ZodMiniNanoID>;
|
|
60
60
|
export declare function nanoid(params?: string | core.$ZodNanoIDParams): ZodMiniNanoID;
|
|
61
|
+
/**
|
|
62
|
+
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
63
|
+
* (timestamps embedded in the id). Use {@link ZodMiniCUID2} instead.
|
|
64
|
+
* See https://github.com/paralleldrive/cuid.
|
|
65
|
+
*/
|
|
61
66
|
export interface ZodMiniCUID extends _ZodMiniString<core.$ZodCUIDInternals> {
|
|
62
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
70
|
+
* (timestamps embedded in the id). Use {@link ZodMiniCUID2} instead.
|
|
71
|
+
* See https://github.com/paralleldrive/cuid.
|
|
72
|
+
*/
|
|
63
73
|
export declare const ZodMiniCUID: core.$constructor<ZodMiniCUID>;
|
|
74
|
+
/**
|
|
75
|
+
* Validates a CUID v1 string.
|
|
76
|
+
*
|
|
77
|
+
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
78
|
+
* (timestamps embedded in the id). Use {@link cuid2 | `z.cuid2()`} instead.
|
|
79
|
+
* See https://github.com/paralleldrive/cuid.
|
|
80
|
+
*/
|
|
64
81
|
export declare function cuid(params?: string | core.$ZodCUIDParams): ZodMiniCUID;
|
|
65
82
|
export interface ZodMiniCUID2 extends _ZodMiniString<core.$ZodCUID2Internals> {
|
|
66
83
|
}
|
|
@@ -198,23 +215,23 @@ out Shape extends core.$ZodShape = core.$ZodShape, out Config extends core.$ZodO
|
|
|
198
215
|
shape: Shape;
|
|
199
216
|
}
|
|
200
217
|
export declare const ZodMiniObject: core.$constructor<ZodMiniObject>;
|
|
201
|
-
export declare function object<T extends core.$ZodLooseShape = Record<never, SomeType>>(shape?: T, params?: string | core.$ZodObjectParams): ZodMiniObject<T
|
|
202
|
-
export declare function strictObject<T extends core.$ZodLooseShape>(shape: T, params?: string | core.$ZodObjectParams): ZodMiniObject<T
|
|
203
|
-
export declare function looseObject<T extends core.$ZodLooseShape>(shape: T, params?: string | core.$ZodObjectParams): ZodMiniObject<T
|
|
204
|
-
export declare function extend<T extends ZodMiniObject, U extends core.$ZodLooseShape>(schema: T, shape: U): ZodMiniObject<util.Extend<T["shape"], U
|
|
218
|
+
export declare function object<T extends core.$ZodLooseShape = Record<never, SomeType>>(shape?: T, params?: string | core.$ZodObjectParams): ZodMiniObject<util.Writeable<T>, core.$strip>;
|
|
219
|
+
export declare function strictObject<T extends core.$ZodLooseShape>(shape: T, params?: string | core.$ZodObjectParams): ZodMiniObject<util.Writeable<T>, core.$strict>;
|
|
220
|
+
export declare function looseObject<T extends core.$ZodLooseShape>(shape: T, params?: string | core.$ZodObjectParams): ZodMiniObject<util.Writeable<T>, core.$loose>;
|
|
221
|
+
export declare function extend<T extends ZodMiniObject, U extends core.$ZodLooseShape>(schema: T, shape: U): ZodMiniObject<util.Extend<T["shape"], util.Writeable<U>>, T["_zod"]["config"]>;
|
|
205
222
|
export type SafeExtendShape<Base extends core.$ZodShape, Ext extends core.$ZodLooseShape> = {
|
|
206
223
|
[K in keyof Ext]: K extends keyof Base ? core.output<Ext[K]> extends core.output<Base[K]> ? core.input<Ext[K]> extends core.input<Base[K]> ? Ext[K] : never : never : Ext[K];
|
|
207
224
|
};
|
|
208
|
-
export declare function safeExtend<T extends ZodMiniObject, U extends core.$ZodLooseShape>(schema: T, shape: SafeExtendShape<T["shape"], U>): ZodMiniObject<util.Extend<T["shape"], U
|
|
225
|
+
export declare function safeExtend<T extends ZodMiniObject, U extends core.$ZodLooseShape>(schema: T, shape: SafeExtendShape<T["shape"], U>): ZodMiniObject<util.Extend<T["shape"], util.Writeable<U>>, T["_zod"]["config"]>;
|
|
209
226
|
/** @deprecated Identical to `z.extend(A, B)` */
|
|
210
227
|
export declare function merge<T extends ZodMiniObject, U extends ZodMiniObject>(a: T, b: U): ZodMiniObject<util.Extend<T["shape"], U["shape"]>, T["_zod"]["config"]>;
|
|
211
228
|
export declare function pick<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M & Record<Exclude<keyof M, keyof T["shape"]>, never>): ZodMiniObject<util.Flatten<Pick<T["shape"], keyof T["shape"] & keyof M>>, T["_zod"]["config"]>;
|
|
212
229
|
export declare function omit<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M & Record<Exclude<keyof M, keyof T["shape"]>, never>): ZodMiniObject<util.Flatten<Omit<T["shape"], keyof M>>, T["_zod"]["config"]>;
|
|
213
230
|
export declare function partial<T extends ZodMiniObject>(schema: T): ZodMiniObject<{
|
|
214
|
-
[k in keyof T["shape"]]: ZodMiniOptional<T["shape"][k]>;
|
|
231
|
+
-readonly [k in keyof T["shape"]]: ZodMiniOptional<T["shape"][k]>;
|
|
215
232
|
}, T["_zod"]["config"]>;
|
|
216
233
|
export declare function partial<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M & Record<Exclude<keyof M, keyof T["shape"]>, never>): ZodMiniObject<{
|
|
217
|
-
[k in keyof T["shape"]]: k extends keyof M ? ZodMiniOptional<T["shape"][k]> : T["shape"][k];
|
|
234
|
+
-readonly [k in keyof T["shape"]]: k extends keyof M ? ZodMiniOptional<T["shape"][k]> : T["shape"][k];
|
|
218
235
|
}, T["_zod"]["config"]>;
|
|
219
236
|
export type RequiredInterfaceShape<Shape extends core.$ZodLooseShape, Keys extends PropertyKey = keyof Shape> = util.Identity<{
|
|
220
237
|
[k in keyof Shape as k extends Keys ? k : never]: ZodMiniNonOptional<Shape[k]>;
|
|
@@ -222,7 +239,7 @@ export type RequiredInterfaceShape<Shape extends core.$ZodLooseShape, Keys exten
|
|
|
222
239
|
[k in keyof Shape as k extends Keys ? never : k]: Shape[k];
|
|
223
240
|
}>;
|
|
224
241
|
export declare function required<T extends ZodMiniObject>(schema: T): ZodMiniObject<{
|
|
225
|
-
[k in keyof T["shape"]]: ZodMiniNonOptional<T["shape"][k]>;
|
|
242
|
+
-readonly [k in keyof T["shape"]]: ZodMiniNonOptional<T["shape"][k]>;
|
|
226
243
|
}, T["_zod"]["config"]>;
|
|
227
244
|
export declare function required<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M & Record<Exclude<keyof M, keyof T["shape"]>, never>): ZodMiniObject<util.Extend<T["shape"], {
|
|
228
245
|
[k in keyof M & keyof T["shape"]]: ZodMiniNonOptional<T["shape"][k]>;
|
|
@@ -347,6 +364,7 @@ export declare function codec<const A extends SomeType, B extends core.SomeType
|
|
|
347
364
|
decode: (value: core.output<A>, payload: core.ParsePayload<core.output<A>>) => core.util.MaybeAsync<core.input<B>>;
|
|
348
365
|
encode: (value: core.input<B>, payload: core.ParsePayload<core.input<B>>) => core.util.MaybeAsync<core.output<A>>;
|
|
349
366
|
}): ZodMiniCodec<A, B>;
|
|
367
|
+
export declare function invertCodec<A extends SomeType, B extends SomeType>(codec: ZodMiniCodec<A, B>): ZodMiniCodec<B, A>;
|
|
350
368
|
export interface ZodMiniReadonly<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodReadonlyInternals<T>> {
|
|
351
369
|
}
|
|
352
370
|
export declare const ZodMiniReadonly: core.$constructor<ZodMiniReadonly>;
|
|
@@ -370,7 +388,7 @@ export declare const ZodMiniCustom: core.$constructor<ZodMiniCustom>;
|
|
|
370
388
|
export declare function check<O = unknown>(fn: core.CheckFn<O>, params?: string | core.$ZodCustomParams): core.$ZodCheck<O>;
|
|
371
389
|
export declare function custom<O = unknown, I = O>(fn?: (data: O) => unknown, _params?: string | core.$ZodCustomParams | undefined): ZodMiniCustom<O, I>;
|
|
372
390
|
export declare function refine<T>(fn: (arg: NoInfer<T>) => util.MaybeAsync<unknown>, _params?: string | core.$ZodCustomParams): core.$ZodCheck<T>;
|
|
373
|
-
export declare function superRefine<T>(fn: (arg: T, payload: core.$RefinementCtx<T>) => void | Promise<void
|
|
391
|
+
export declare function superRefine<T>(fn: (arg: T, payload: core.$RefinementCtx<T>) => void | Promise<void>, params?: core.$ZodSuperRefineParams): core.$ZodCheck<T>;
|
|
374
392
|
export declare const describe: typeof core.describe;
|
|
375
393
|
export declare const meta: typeof core.meta;
|
|
376
394
|
declare abstract class Class {
|
|
@@ -16,7 +16,11 @@ export const ZodMiniType = /*@__PURE__*/ core.$constructor("ZodMiniType", (inst,
|
|
|
16
16
|
...def,
|
|
17
17
|
checks: [
|
|
18
18
|
...(def.checks ?? []),
|
|
19
|
-
...checks.map((ch) => typeof ch === "function"
|
|
19
|
+
...checks.map((ch) => typeof ch === "function"
|
|
20
|
+
? {
|
|
21
|
+
_zod: { check: ch, def: { check: "custom" }, onattach: [] },
|
|
22
|
+
}
|
|
23
|
+
: ch),
|
|
20
24
|
],
|
|
21
25
|
}, { parent: true });
|
|
22
26
|
};
|
|
@@ -90,7 +94,7 @@ export function url(params) {
|
|
|
90
94
|
// @__NO_SIDE_EFFECTS__
|
|
91
95
|
export function httpUrl(params) {
|
|
92
96
|
return core._url(ZodMiniURL, {
|
|
93
|
-
protocol:
|
|
97
|
+
protocol: core.regexes.httpProtocol,
|
|
94
98
|
hostname: core.regexes.domain,
|
|
95
99
|
...util.normalizeParams(params),
|
|
96
100
|
});
|
|
@@ -111,10 +115,22 @@ export const ZodMiniNanoID = /*@__PURE__*/ core.$constructor("ZodMiniNanoID", (i
|
|
|
111
115
|
export function nanoid(params) {
|
|
112
116
|
return core._nanoid(ZodMiniNanoID, params);
|
|
113
117
|
}
|
|
118
|
+
/**
|
|
119
|
+
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
120
|
+
* (timestamps embedded in the id). Use {@link ZodMiniCUID2} instead.
|
|
121
|
+
* See https://github.com/paralleldrive/cuid.
|
|
122
|
+
*/
|
|
114
123
|
export const ZodMiniCUID = /*@__PURE__*/ core.$constructor("ZodMiniCUID", (inst, def) => {
|
|
115
124
|
core.$ZodCUID.init(inst, def);
|
|
116
125
|
ZodMiniStringFormat.init(inst, def);
|
|
117
126
|
});
|
|
127
|
+
/**
|
|
128
|
+
* Validates a CUID v1 string.
|
|
129
|
+
*
|
|
130
|
+
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
131
|
+
* (timestamps embedded in the id). Use {@link cuid2 | `z.cuid2()`} instead.
|
|
132
|
+
* See https://github.com/paralleldrive/cuid.
|
|
133
|
+
*/
|
|
118
134
|
// @__NO_SIDE_EFFECTS__
|
|
119
135
|
export function cuid(params) {
|
|
120
136
|
return core._cuid(ZodMiniCUID, params);
|
|
@@ -543,6 +559,15 @@ export const ZodMiniRecord = /*@__PURE__*/ core.$constructor("ZodMiniRecord", (i
|
|
|
543
559
|
});
|
|
544
560
|
// @__NO_SIDE_EFFECTS__
|
|
545
561
|
export function record(keyType, valueType, params) {
|
|
562
|
+
// v3-compat: z.record(valueType, params?) — defaults keyType to z.string()
|
|
563
|
+
if (!valueType || !valueType._zod) {
|
|
564
|
+
return new ZodMiniRecord({
|
|
565
|
+
type: "record",
|
|
566
|
+
keyType: string(),
|
|
567
|
+
valueType: keyType,
|
|
568
|
+
...util.normalizeParams(valueType),
|
|
569
|
+
});
|
|
570
|
+
}
|
|
546
571
|
return new ZodMiniRecord({
|
|
547
572
|
type: "record",
|
|
548
573
|
keyType,
|
|
@@ -792,6 +817,17 @@ export function codec(in_, out, params) {
|
|
|
792
817
|
reverseTransform: params.encode,
|
|
793
818
|
});
|
|
794
819
|
}
|
|
820
|
+
// @__NO_SIDE_EFFECTS__
|
|
821
|
+
export function invertCodec(codec) {
|
|
822
|
+
const def = codec._zod.def;
|
|
823
|
+
return new ZodMiniCodec({
|
|
824
|
+
type: "pipe",
|
|
825
|
+
in: def.out,
|
|
826
|
+
out: def.in,
|
|
827
|
+
transform: def.reverseTransform,
|
|
828
|
+
reverseTransform: def.transform,
|
|
829
|
+
});
|
|
830
|
+
}
|
|
795
831
|
export const ZodMiniReadonly = /*@__PURE__*/ core.$constructor("ZodMiniReadonly", (inst, def) => {
|
|
796
832
|
core.$ZodReadonly.init(inst, def);
|
|
797
833
|
ZodMiniType.init(inst, def);
|
|
@@ -868,8 +904,8 @@ export function refine(fn, _params = {}) {
|
|
|
868
904
|
}
|
|
869
905
|
// superRefine
|
|
870
906
|
// @__NO_SIDE_EFFECTS__
|
|
871
|
-
export function superRefine(fn) {
|
|
872
|
-
return core._superRefine(fn);
|
|
907
|
+
export function superRefine(fn, params) {
|
|
908
|
+
return core._superRefine(fn, params);
|
|
873
909
|
}
|
|
874
910
|
// Re-export describe and meta from core
|
|
875
911
|
export const describe = core.describe;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-relay",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.4",
|
|
4
4
|
"description": "Real-time agent-to-agent communication system",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
],
|
|
107
107
|
"packages/shared/cli-registry.yaml": [
|
|
108
108
|
"npm run codegen:models",
|
|
109
|
-
"git add packages/config/src/cli-registry.generated.ts packages/sdk-py/agent_relay/models.py
|
|
109
|
+
"git add packages/config/src/cli-registry.generated.ts packages/sdk-py/src/agent_relay/models.py"
|
|
110
110
|
]
|
|
111
111
|
},
|
|
112
112
|
"keywords": [
|
|
@@ -130,14 +130,14 @@
|
|
|
130
130
|
},
|
|
131
131
|
"homepage": "https://github.com/AgentWorkforce/relay#readme",
|
|
132
132
|
"dependencies": {
|
|
133
|
-
"@agent-relay/cloud": "6.0.
|
|
134
|
-
"@agent-relay/config": "6.0.
|
|
135
|
-
"@agent-relay/hooks": "6.0.
|
|
136
|
-
"@agent-relay/sdk": "6.0.
|
|
137
|
-
"@agent-relay/telemetry": "6.0.
|
|
138
|
-
"@agent-relay/trajectory": "6.0.
|
|
139
|
-
"@agent-relay/user-directory": "6.0.
|
|
140
|
-
"@agent-relay/utils": "6.0.
|
|
133
|
+
"@agent-relay/cloud": "6.0.4",
|
|
134
|
+
"@agent-relay/config": "6.0.4",
|
|
135
|
+
"@agent-relay/hooks": "6.0.4",
|
|
136
|
+
"@agent-relay/sdk": "6.0.4",
|
|
137
|
+
"@agent-relay/telemetry": "6.0.4",
|
|
138
|
+
"@agent-relay/trajectory": "6.0.4",
|
|
139
|
+
"@agent-relay/user-directory": "6.0.4",
|
|
140
|
+
"@agent-relay/utils": "6.0.4",
|
|
141
141
|
"@aws-sdk/client-s3": "3.1020.0",
|
|
142
142
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
143
143
|
"@relayauth/core": "^0.1.2",
|