@validex/core 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +583 -0
  3. package/dist/checks/index.cjs +51 -0
  4. package/dist/checks/index.d.cts +207 -0
  5. package/dist/checks/index.d.ts +207 -0
  6. package/dist/checks/index.js +51 -0
  7. package/dist/chunk-2OTGUKO7.cjs +26 -0
  8. package/dist/chunk-4HUGF4EZ.js +0 -0
  9. package/dist/chunk-5CYBSNNG.cjs +33 -0
  10. package/dist/chunk-5DOFRLSB.js +30 -0
  11. package/dist/chunk-64X6D23X.cjs +24 -0
  12. package/dist/chunk-6MGS4JWP.js +152 -0
  13. package/dist/chunk-AGJWIOFF.js +24 -0
  14. package/dist/chunk-BAFEYOPS.js +43 -0
  15. package/dist/chunk-BYMZTDYD.js +56 -0
  16. package/dist/chunk-D232V332.cjs +30 -0
  17. package/dist/chunk-FD77PZXB.js +9 -0
  18. package/dist/chunk-H3XHQLZF.cjs +43 -0
  19. package/dist/chunk-ISY3F7TI.cjs +239 -0
  20. package/dist/chunk-JEKRBIPN.cjs +1 -0
  21. package/dist/chunk-KTN4NQQL.js +33 -0
  22. package/dist/chunk-LSQNDPFQ.cjs +9 -0
  23. package/dist/chunk-NDLUDRZJ.js +24 -0
  24. package/dist/chunk-OCTLUBGT.cjs +24 -0
  25. package/dist/chunk-OFT3FQPJ.cjs +152 -0
  26. package/dist/chunk-OOFMB7K5.js +34 -0
  27. package/dist/chunk-OTPQTLPM.js +50 -0
  28. package/dist/chunk-P3FRVJ3U.cjs +50 -0
  29. package/dist/chunk-PFPNNQGJ.js +30 -0
  30. package/dist/chunk-PQ4TUE2Q.cjs +2688 -0
  31. package/dist/chunk-SMDC2EAD.js +26 -0
  32. package/dist/chunk-TB6J73U7.js +239 -0
  33. package/dist/chunk-TBVAKZA5.js +2688 -0
  34. package/dist/chunk-TSPTIW3V.cjs +34 -0
  35. package/dist/chunk-WE2OD5XD.cjs +30 -0
  36. package/dist/chunk-WKVMDEA3.js +26 -0
  37. package/dist/chunk-ZAUX2RGL.cjs +56 -0
  38. package/dist/chunk-ZWIO2MJX.cjs +26 -0
  39. package/dist/cli/index.cjs +120 -0
  40. package/dist/cli/index.d.cts +1 -0
  41. package/dist/cli/index.d.ts +1 -0
  42. package/dist/cli/index.js +120 -0
  43. package/dist/commonPasswords-3BYUBARZ.cjs +10 -0
  44. package/dist/commonPasswords-ZYOEI6PG.js +10 -0
  45. package/dist/countryCodes-EKJKVHR5.cjs +10 -0
  46. package/dist/countryCodes-RTJZVCLB.js +10 -0
  47. package/dist/countryCodes-VY56VZPT.cjs +255 -0
  48. package/dist/countryCodes-YRY75MQP.js +255 -0
  49. package/dist/creditCardPrefixes-EXMJZGE7.cjs +10 -0
  50. package/dist/creditCardPrefixes-EZK7T4IZ.js +10 -0
  51. package/dist/creditCardPrefixes-HKWKCHNU.cjs +48 -0
  52. package/dist/creditCardPrefixes-QP3S4ZAU.js +48 -0
  53. package/dist/currencyCodes-GU6W3HSN.cjs +171 -0
  54. package/dist/currencyCodes-P67AASLW.js +171 -0
  55. package/dist/currencyCodes-RMRLGDME.cjs +10 -0
  56. package/dist/currencyCodes-U6TSAWDR.js +10 -0
  57. package/dist/disposableDomains-DCXSV422.js +10 -0
  58. package/dist/disposableDomains-USU2JQSF.cjs +10 -0
  59. package/dist/ibanPatterns-2PM32RIY.cjs +85 -0
  60. package/dist/ibanPatterns-BSQUWKLY.js +85 -0
  61. package/dist/ibanPatterns-KTLY6TZY.cjs +10 -0
  62. package/dist/ibanPatterns-LJRPR7FV.js +10 -0
  63. package/dist/index-Cid7Ygr_.d.cts +950 -0
  64. package/dist/index-Cid7Ygr_.d.ts +950 -0
  65. package/dist/index.cjs +361 -0
  66. package/dist/index.d.cts +132 -0
  67. package/dist/index.d.ts +132 -0
  68. package/dist/index.js +361 -0
  69. package/dist/locales/en.cjs +10 -0
  70. package/dist/locales/en.d.cts +234 -0
  71. package/dist/locales/en.d.ts +234 -0
  72. package/dist/locales/en.js +10 -0
  73. package/dist/passwordsTier1-NAZLSHKW.cjs +105 -0
  74. package/dist/passwordsTier1-OYRMLOWD.js +105 -0
  75. package/dist/passwordsTier2-GYJTYGY6.cjs +906 -0
  76. package/dist/passwordsTier2-JAEO5AYY.js +906 -0
  77. package/dist/passwordsTier3-BAPUFHZM.cjs +9006 -0
  78. package/dist/passwordsTier3-E6WBK5OB.js +9006 -0
  79. package/dist/phoneDetection-AFSSD4IB.cjs +6 -0
  80. package/dist/phoneDetection-G23LZ6MU.js +6 -0
  81. package/dist/phoneParser-2RTXDB6H.js +10 -0
  82. package/dist/phoneParser-CGRP2OUN.cjs +10 -0
  83. package/dist/postalCodes-4EZVDT2N.cjs +10 -0
  84. package/dist/postalCodes-ZPAJB3P5.js +10 -0
  85. package/dist/reservedUsernames-3QPPKUXR.cjs +246 -0
  86. package/dist/reservedUsernames-GIK6NX3J.js +246 -0
  87. package/dist/reservedUsernames-QR4ONXSL.js +10 -0
  88. package/dist/reservedUsernames-W65FGT6A.cjs +10 -0
  89. package/dist/rules/index.cjs +66 -0
  90. package/dist/rules/index.d.cts +2 -0
  91. package/dist/rules/index.d.ts +2 -0
  92. package/dist/rules/index.js +66 -0
  93. package/dist/utilities/index.cjs +8 -0
  94. package/dist/utilities/index.d.cts +47 -0
  95. package/dist/utilities/index.d.ts +47 -0
  96. package/dist/utilities/index.js +8 -0
  97. package/dist/vatPatterns-BLRXHNCP.js +36 -0
  98. package/dist/vatPatterns-DNVZJPTW.js +10 -0
  99. package/dist/vatPatterns-NPN6SV2Y.cjs +36 -0
  100. package/dist/vatPatterns-RRHUTA3U.cjs +10 -0
  101. package/package.json +133 -0
package/dist/index.js ADDED
@@ -0,0 +1,361 @@
1
+ import {
2
+ BusinessName,
3
+ Color,
4
+ Country,
5
+ CreditCard,
6
+ Currency,
7
+ DateTime,
8
+ Email,
9
+ Iban,
10
+ IpAddress,
11
+ Jwt,
12
+ LicenseKey,
13
+ MacAddress,
14
+ Password,
15
+ PasswordConfirmation,
16
+ PersonName,
17
+ Phone,
18
+ PostalCode,
19
+ Slug,
20
+ Text,
21
+ Token,
22
+ Url,
23
+ Username,
24
+ Uuid,
25
+ VatNumber,
26
+ Website,
27
+ configure,
28
+ createRule,
29
+ fieldNameToLabel,
30
+ getConfig,
31
+ getConfig2,
32
+ getCrossField,
33
+ getErrorMessage,
34
+ getParams,
35
+ initAugmentation,
36
+ preloadData,
37
+ resetConfig,
38
+ setup
39
+ } from "./chunk-TBVAKZA5.js";
40
+ import "./chunk-OOFMB7K5.js";
41
+ import "./chunk-NDLUDRZJ.js";
42
+ import "./chunk-PFPNNQGJ.js";
43
+ import "./chunk-SMDC2EAD.js";
44
+ import "./chunk-KTN4NQQL.js";
45
+ import "./chunk-5DOFRLSB.js";
46
+ import "./chunk-OTPQTLPM.js";
47
+ import "./chunk-WKVMDEA3.js";
48
+ import "./chunk-BYMZTDYD.js";
49
+ import "./chunk-4HUGF4EZ.js";
50
+ import {
51
+ collapseWhitespace,
52
+ containsEmail,
53
+ containsHtml,
54
+ containsUrl,
55
+ emptyToUndefined,
56
+ hasDigits,
57
+ hasLowercase,
58
+ hasSpecial,
59
+ hasUppercase,
60
+ maxConsecutive,
61
+ maxWords,
62
+ minWords,
63
+ noSpaces,
64
+ onlyAlpha,
65
+ onlyAlphaSpaceHyphen,
66
+ onlyAlphanumeric,
67
+ onlyAlphanumericSpaceHyphen,
68
+ onlyNumeric,
69
+ stripHtml,
70
+ toSlug,
71
+ toTitleCase
72
+ } from "./chunk-6MGS4JWP.js";
73
+ import {
74
+ requiredWhen,
75
+ sameAs
76
+ } from "./chunk-BAFEYOPS.js";
77
+ import "./chunk-TB6J73U7.js";
78
+ import {
79
+ containsPhoneNumber
80
+ } from "./chunk-FD77PZXB.js";
81
+ import "./chunk-AGJWIOFF.js";
82
+
83
+ // src/core/validate.ts
84
+ import { z as z2 } from "zod";
85
+
86
+ // src/core/crossFieldResolver.ts
87
+ import { z } from "zod";
88
+ function deriveFieldLabel(fieldName, explicitLabel, prefix) {
89
+ if (explicitLabel !== void 0)
90
+ return explicitLabel;
91
+ const config = getConfig();
92
+ const fallback = config.label?.fallback ?? "derived";
93
+ let defaultLabel;
94
+ if (fallback === "none")
95
+ defaultLabel = "";
96
+ else if (fallback === "generic")
97
+ defaultLabel = "This field";
98
+ else
99
+ defaultLabel = fieldNameToLabel(fieldName);
100
+ if (config.label?.transform !== void 0) {
101
+ const path = [...prefix ?? [], fieldName];
102
+ return config.label.transform({ path, fieldName, defaultLabel });
103
+ }
104
+ return defaultLabel;
105
+ }
106
+ function resolveCrossFieldMessage(namespace, code, params) {
107
+ const config = getConfig();
108
+ const i18n = config.i18n;
109
+ const pfx = i18n.prefix ?? "validation";
110
+ const sep = i18n.separator ?? ".";
111
+ const key = [pfx, "messages", namespace, code].join(sep);
112
+ if (i18n.enabled && i18n.t !== void 0)
113
+ return i18n.t(key, params);
114
+ if (i18n.enabled)
115
+ return key;
116
+ return getErrorMessage(namespace, code, params);
117
+ }
118
+ function resolveSameAs(fieldName, sameAs2, shape, parsedData, meta, prefix) {
119
+ if (!(sameAs2 in shape)) {
120
+ throw new Error(
121
+ `validex: sameAs("${sameAs2}") on field "${fieldName}" \u2014 target field "${sameAs2}" does not exist in the schema`
122
+ );
123
+ }
124
+ const sourceValue = parsedData?.[fieldName];
125
+ const targetValue = parsedData?.[sameAs2];
126
+ if (sourceValue === targetValue)
127
+ return void 0;
128
+ const targetSchema = shape[sameAs2];
129
+ const targetMeta = targetSchema !== void 0 ? getCrossField(targetSchema) : void 0;
130
+ const label = deriveFieldLabel(fieldName, meta.label, prefix);
131
+ const targetLabel = deriveFieldLabel(sameAs2, targetMeta?.label, prefix);
132
+ return {
133
+ path: [...prefix, fieldName],
134
+ message: resolveCrossFieldMessage("confirmation", "mismatch", {
135
+ label,
136
+ targetLabel,
137
+ code: "mismatch",
138
+ namespace: "confirmation"
139
+ })
140
+ };
141
+ }
142
+ function resolveRequiredWhen(fieldName, targetName, parsedData, rawObj, fieldErrors, meta, prefix) {
143
+ const targetDotPath = [...prefix, targetName].join(".");
144
+ if (fieldErrors.has(targetDotPath))
145
+ return void 0;
146
+ const targetValue = parsedData?.[targetName];
147
+ if (targetValue === void 0 || targetValue === null || targetValue === "")
148
+ return void 0;
149
+ const rawValue = rawObj[fieldName];
150
+ if (rawValue !== void 0 && rawValue !== null && rawValue !== "")
151
+ return void 0;
152
+ const label = deriveFieldLabel(fieldName, meta.label, prefix);
153
+ return {
154
+ path: [...prefix, fieldName],
155
+ message: resolveCrossFieldMessage("base", "required", {
156
+ label,
157
+ code: "required",
158
+ namespace: "base"
159
+ })
160
+ };
161
+ }
162
+ function resolveFieldConstraint(fieldName, shape, parsedData, rawObj, fieldErrors, prefix) {
163
+ const fieldSchema = shape[fieldName];
164
+ if (fieldSchema === void 0)
165
+ return [];
166
+ const meta = getCrossField(fieldSchema);
167
+ if (meta === void 0)
168
+ return [];
169
+ const issues = [];
170
+ const dotPath = [...prefix, fieldName].join(".");
171
+ if (meta.sameAs !== void 0 && !fieldErrors.has(dotPath)) {
172
+ const issue = resolveSameAs(fieldName, meta.sameAs, shape, parsedData, meta, prefix);
173
+ if (issue !== void 0)
174
+ issues.push(issue);
175
+ }
176
+ if (meta.requiredWhen !== void 0) {
177
+ const issue = resolveRequiredWhen(fieldName, meta.requiredWhen, parsedData, rawObj, fieldErrors, meta, prefix);
178
+ if (issue !== void 0)
179
+ issues.push(issue);
180
+ }
181
+ return issues;
182
+ }
183
+ function resolveCrossFieldConstraints(schema, parsedData, fieldErrors, rawData, prefix = []) {
184
+ const shape = schema.shape;
185
+ const rawObj = typeof rawData === "object" && rawData !== null ? rawData : {};
186
+ const issues = [];
187
+ for (const fieldName of Object.keys(shape)) {
188
+ issues.push(...resolveFieldConstraint(fieldName, shape, parsedData, rawObj, fieldErrors, prefix));
189
+ }
190
+ for (const [fieldName, fieldSchema] of Object.entries(shape)) {
191
+ if (fieldSchema instanceof z.ZodObject) {
192
+ const nestedParsed = parsedData?.[fieldName];
193
+ issues.push(...resolveCrossFieldConstraints(
194
+ fieldSchema,
195
+ nestedParsed,
196
+ fieldErrors,
197
+ rawObj[fieldName],
198
+ [...prefix, fieldName]
199
+ ));
200
+ }
201
+ }
202
+ return issues;
203
+ }
204
+
205
+ // src/core/validate.ts
206
+ function buildDotPath(path) {
207
+ return path.map(String).join(".");
208
+ }
209
+ function buildNestedErrors(issues) {
210
+ const root = {};
211
+ for (const issue of issues) {
212
+ const { path, message } = issue;
213
+ if (path.length === 0)
214
+ continue;
215
+ let current = root;
216
+ for (let i = 0; i < path.length - 1; i++) {
217
+ const segment = String(path[i]);
218
+ if (current[segment] === void 0)
219
+ current[segment] = {};
220
+ current = current[segment];
221
+ }
222
+ const lastSegment = String(path.at(-1));
223
+ const existing = current[lastSegment];
224
+ if (Array.isArray(existing))
225
+ existing.push(message);
226
+ else
227
+ current[lastSegment] = [message];
228
+ }
229
+ return root;
230
+ }
231
+ function collectIssues(issues, errors, firstErrors) {
232
+ for (const issue of issues) {
233
+ const dotPath = buildDotPath(issue.path);
234
+ if (errors[dotPath] === void 0) {
235
+ errors[dotPath] = [];
236
+ firstErrors[dotPath] = issue.message;
237
+ }
238
+ errors[dotPath].push(issue.message);
239
+ }
240
+ }
241
+ async function validate(schema, data) {
242
+ initAugmentation();
243
+ const result = await schema.safeParseAsync(data);
244
+ if (result.success)
245
+ return handleSuccess(schema, result.data, data);
246
+ return handleFailure(schema, result.error, data);
247
+ }
248
+ function handleSuccess(schema, parsed, raw) {
249
+ if (schema instanceof z2.ZodObject) {
250
+ const crossIssues = resolveCrossFieldConstraints(schema, parsed, /* @__PURE__ */ new Set(), raw);
251
+ if (crossIssues.length > 0) {
252
+ const errors = {};
253
+ const firstErrors = {};
254
+ collectIssues(crossIssues, errors, firstErrors);
255
+ return { success: false, errors, firstErrors, nestedErrors: buildNestedErrors(crossIssues), issues: crossIssues };
256
+ }
257
+ }
258
+ return {
259
+ success: true,
260
+ data: parsed,
261
+ // SAFETY: Zod safeParseAsync returns inferred output type on success
262
+ errors: {},
263
+ firstErrors: {},
264
+ nestedErrors: {},
265
+ issues: []
266
+ };
267
+ }
268
+ function handleFailure(schema, error, raw) {
269
+ const rawIssues = error.issues;
270
+ const errors = {};
271
+ const firstErrors = {};
272
+ const fieldErrors = /* @__PURE__ */ new Set();
273
+ for (const issue of rawIssues) {
274
+ const dotPath = buildDotPath(issue.path);
275
+ fieldErrors.add(dotPath);
276
+ if (errors[dotPath] === void 0) {
277
+ errors[dotPath] = [];
278
+ firstErrors[dotPath] = issue.message;
279
+ }
280
+ errors[dotPath].push(issue.message);
281
+ }
282
+ if (schema instanceof z2.ZodObject) {
283
+ const rawObj = typeof raw === "object" && raw !== null ? raw : {};
284
+ const crossIssues = resolveCrossFieldConstraints(schema, rawObj, fieldErrors, raw);
285
+ collectIssues(crossIssues, errors, firstErrors);
286
+ if (crossIssues.length > 0) {
287
+ const allIssues = [...rawIssues, ...crossIssues];
288
+ return { success: false, errors, firstErrors, nestedErrors: buildNestedErrors(allIssues), issues: allIssues };
289
+ }
290
+ }
291
+ return {
292
+ success: false,
293
+ errors,
294
+ firstErrors,
295
+ nestedErrors: buildNestedErrors(rawIssues),
296
+ // SAFETY: issues escape hatch exposes raw Zod issues as ReadonlyArray<unknown> for consumers
297
+ issues: error.issues
298
+ };
299
+ }
300
+
301
+ // src/index.ts
302
+ initAugmentation();
303
+ export {
304
+ BusinessName,
305
+ Color,
306
+ Country,
307
+ CreditCard,
308
+ Currency,
309
+ DateTime,
310
+ Email,
311
+ Iban,
312
+ IpAddress,
313
+ Jwt,
314
+ LicenseKey,
315
+ MacAddress,
316
+ Password,
317
+ PasswordConfirmation,
318
+ PersonName,
319
+ Phone,
320
+ PostalCode,
321
+ Slug,
322
+ Text,
323
+ Token,
324
+ Url,
325
+ Username,
326
+ Uuid,
327
+ VatNumber,
328
+ Website,
329
+ collapseWhitespace,
330
+ configure,
331
+ containsEmail,
332
+ containsHtml,
333
+ containsPhoneNumber,
334
+ containsUrl,
335
+ createRule,
336
+ emptyToUndefined,
337
+ getConfig2 as getConfig,
338
+ getParams,
339
+ hasDigits,
340
+ hasLowercase,
341
+ hasSpecial,
342
+ hasUppercase,
343
+ maxConsecutive,
344
+ maxWords,
345
+ minWords,
346
+ noSpaces,
347
+ onlyAlpha,
348
+ onlyAlphaSpaceHyphen,
349
+ onlyAlphanumeric,
350
+ onlyAlphanumericSpaceHyphen,
351
+ onlyNumeric,
352
+ preloadData,
353
+ requiredWhen,
354
+ resetConfig,
355
+ sameAs,
356
+ setup,
357
+ stripHtml,
358
+ toSlug,
359
+ toTitleCase,
360
+ validate
361
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+ var _chunkISY3F7TIcjs = require('../chunk-ISY3F7TI.cjs');
6
+
7
+
8
+
9
+
10
+ exports.default = _chunkISY3F7TIcjs.en_default; exports.lang = _chunkISY3F7TIcjs.lang; exports.validation = _chunkISY3F7TIcjs.validation;
@@ -0,0 +1,234 @@
1
+ var lang = "en";
2
+ var validation = {
3
+ labels: {
4
+ email: "Email",
5
+ personName: "Name",
6
+ businessName: "Business Name",
7
+ password: "Password",
8
+ passwordConfirmation: "Password Confirmation",
9
+ phone: "Phone",
10
+ website: "Website",
11
+ url: "URL",
12
+ username: "Username",
13
+ slug: "Slug",
14
+ postalCode: "Postal Code",
15
+ licenseKey: "License Key",
16
+ uuid: "UUID",
17
+ jwt: "JWT",
18
+ dateTime: "Date/Time",
19
+ token: "Token",
20
+ text: "Text",
21
+ country: "Country",
22
+ currency: "Currency",
23
+ color: "Color",
24
+ creditCard: "Credit Card",
25
+ iban: "IBAN",
26
+ vatNumber: "VAT Number",
27
+ macAddress: "MAC Address",
28
+ ipAddress: "IP Address",
29
+ string: "Value"
30
+ },
31
+ messages: {
32
+ base: {
33
+ required: "{{label}} is required",
34
+ min: "{{label}} must be at least {{minimum}} characters",
35
+ max: "{{label}} must be at most {{maximum}} characters",
36
+ type: "{{label}} must be a {{expected}}",
37
+ format: "{{label}} is not valid"
38
+ },
39
+ email: {
40
+ invalid: "{{label}} is not a valid email address",
41
+ disposableBlocked: "{{label}} must not use a disposable email provider",
42
+ plusAliasBlocked: "{{label}} must not use plus aliases",
43
+ domainBlocked: "Email domain '{{domain}}' is not allowed",
44
+ domainNotAllowed: "Email domain '{{domain}}' is not in the allowed list",
45
+ subdomainNotAllowed: "Subdomain email addresses are not allowed",
46
+ custom: "{{label}} failed custom validation"
47
+ },
48
+ personName: {
49
+ invalid: "{{label}} is not a valid name",
50
+ maxWords: "{{label}} must have at most {{maximum}} words",
51
+ boundary: "{{label}} must start and end with a letter",
52
+ maxConsecutive: "{{label}} must not repeat the same character more than {{maximum}} times",
53
+ custom: "{{label}} failed custom validation"
54
+ },
55
+ businessName: {
56
+ invalid: "{{label}} is not a valid business name",
57
+ boundary: "{{label}} must start and end with an alphanumeric character",
58
+ maxConsecutive: "{{label}} must not repeat the same character more than {{maximum}} times",
59
+ custom: "{{label}} failed custom validation"
60
+ },
61
+ password: {
62
+ minUppercase: "{{label}} must have at least {{minimum}} uppercase characters",
63
+ minLowercase: "{{label}} must have at least {{minimum}} lowercase characters",
64
+ minDigits: "{{label}} must have at least {{minimum}} digits",
65
+ minSpecial: "{{label}} must have at least {{minimum}} special characters",
66
+ maxUppercase: "{{label}} must have at most {{maximum}} uppercase characters",
67
+ maxLowercase: "{{label}} must have at most {{maximum}} lowercase characters",
68
+ maxDigits: "{{label}} must have at most {{maximum}} digits",
69
+ maxSpecial: "{{label}} must have at most {{maximum}} special characters",
70
+ maxConsecutive: "{{label}} must not have more than {{maximum}} consecutive identical characters",
71
+ commonBlocked: "{{label}} is too common",
72
+ custom: "{{label}} failed custom validation"
73
+ },
74
+ confirmation: {
75
+ mismatch: "{{label}} must match {{targetLabel}}",
76
+ custom: "{{label}} failed custom validation"
77
+ },
78
+ phone: {
79
+ invalid: "{{label}} is not a valid phone number",
80
+ requireMobile: "{{label}} must be a mobile phone number",
81
+ countryCodeRequired: "{{label}} must include a country code prefix",
82
+ countryBlocked: "Phone numbers from '{{country}}' are not allowed",
83
+ countryNotAllowed: "Phone numbers from '{{country}}' are not in the allowed list",
84
+ custom: "{{label}} failed custom validation"
85
+ },
86
+ website: {
87
+ invalid: "{{label}} is not a valid website URL",
88
+ httpsRequired: "{{label}} must use HTTPS",
89
+ wwwRequired: "{{label}} must include www prefix",
90
+ pathNotAllowed: "{{label}} must not contain URL paths",
91
+ queryNotAllowed: "{{label}} must not contain query strings",
92
+ domainBlocked: "Domain '{{domain}}' is not allowed",
93
+ domainNotAllowed: "Domain '{{domain}}' is not in the allowed list",
94
+ subdomainNotAllowed: "Subdomain URLs are not allowed",
95
+ custom: "{{label}} failed custom validation"
96
+ },
97
+ url: {
98
+ invalid: "{{label}} is not a valid URL",
99
+ protocolNotAllowed: "Protocol '{{protocol}}' is not allowed",
100
+ tldRequired: "{{label}} must include a top-level domain",
101
+ queryNotAllowed: "{{label}} must not contain query strings",
102
+ authNotAllowed: "{{label}} must not contain credentials",
103
+ domainBlocked: "Domain '{{domain}}' is not allowed",
104
+ domainNotAllowed: "Domain '{{domain}}' is not in the allowed list",
105
+ custom: "{{label}} failed custom validation"
106
+ },
107
+ username: {
108
+ invalid: "{{label}} is not a valid username",
109
+ reservedBlocked: "The username '{{value}}' is reserved",
110
+ boundary: "{{label}} must start and end with an alphanumeric character",
111
+ maxConsecutive: "{{label}} must not repeat the same character more than {{maximum}} times",
112
+ custom: "{{label}} failed custom validation"
113
+ },
114
+ slug: {
115
+ invalid: "{{label}} is not a valid slug",
116
+ custom: "{{label}} failed custom validation"
117
+ },
118
+ postalCode: {
119
+ invalid: "{{label}} is not a valid postal code",
120
+ custom: "{{label}} failed custom validation"
121
+ },
122
+ licenseKey: {
123
+ invalid: "{{label}} is not a valid license key",
124
+ custom: "{{label}} failed custom validation"
125
+ },
126
+ uuid: {
127
+ invalid: "{{label}} is not a valid UUID",
128
+ custom: "{{label}} failed custom validation"
129
+ },
130
+ jwt: {
131
+ invalid: "{{label}} is not a valid JWT",
132
+ expiryRequired: "{{label}} must have an expiration claim",
133
+ expired: "{{label}} has expired",
134
+ notYetValid: "{{label}} is not yet valid",
135
+ missingClaim: "Required claim '{{claim}}' is missing",
136
+ algorithmNotAllowed: "Algorithm '{{algorithm}}' is not allowed",
137
+ custom: "{{label}} failed custom validation"
138
+ },
139
+ dateTime: {
140
+ invalid: "{{label}} is not a valid date",
141
+ tooEarly: "{{label}} must be after {{minimum}}",
142
+ tooLate: "{{label}} must be before {{maximum}}",
143
+ noFuture: "{{label}} must not be in the future",
144
+ noPast: "{{label}} must not be in the past",
145
+ custom: "{{label}} failed custom validation"
146
+ },
147
+ token: {
148
+ invalid: "{{label}} is not a valid {{type}} token",
149
+ custom: "{{label}} failed custom validation"
150
+ },
151
+ text: {
152
+ invalid: "{{label}} is not valid text",
153
+ noEmails: "{{label}} must not contain email addresses",
154
+ noUrls: "{{label}} must not contain URLs",
155
+ noPhoneNumbers: "{{label}} must not contain phone numbers",
156
+ noHtml: "{{label}} must not contain HTML",
157
+ minWords: "{{label}} must have at least {{minimum}} words",
158
+ maxWords: "{{label}} must have at most {{maximum}} words",
159
+ maxConsecutive: "{{label}} must not repeat the same character more than {{maximum}} times",
160
+ custom: "{{label}} failed custom validation"
161
+ },
162
+ country: {
163
+ invalid: "{{label}} is not a valid country code",
164
+ blocked: "Country '{{country}}' is not allowed",
165
+ notAllowed: "Country '{{country}}' is not in the allowed list",
166
+ custom: "{{label}} failed custom validation"
167
+ },
168
+ currency: {
169
+ invalid: "{{label}} is not a valid currency code",
170
+ blocked: "Currency '{{currency}}' is not allowed",
171
+ notAllowed: "Currency '{{currency}}' is not in the allowed list",
172
+ custom: "{{label}} failed custom validation"
173
+ },
174
+ color: {
175
+ invalid: "{{label}} is not a valid color",
176
+ custom: "{{label}} failed custom validation"
177
+ },
178
+ creditCard: {
179
+ invalid: "{{label}} is not a valid credit card number",
180
+ issuerNotAllowed: "Card issuer '{{issuer}}' is not in the allowed list",
181
+ issuerBlocked: "Card issuer '{{issuer}}' is not allowed",
182
+ custom: "{{label}} failed custom validation"
183
+ },
184
+ iban: {
185
+ invalid: "{{label}} is not a valid IBAN",
186
+ countryBlocked: "IBANs from '{{country}}' are not allowed",
187
+ countryNotAllowed: "IBANs from '{{country}}' are not in the allowed list",
188
+ custom: "{{label}} failed custom validation"
189
+ },
190
+ vatNumber: {
191
+ invalid: "{{label}} is not a valid VAT number",
192
+ custom: "{{label}} failed custom validation"
193
+ },
194
+ macAddress: {
195
+ invalid: "{{label}} is not a valid MAC address",
196
+ custom: "{{label}} failed custom validation"
197
+ },
198
+ ipAddress: {
199
+ invalid: "{{label}} is not a valid IP address",
200
+ privateNotAllowed: "{{label}} must not be a private IP address",
201
+ custom: "{{label}} failed custom validation"
202
+ },
203
+ string: {
204
+ minUppercase: "{{label}} must have at least {{minimum}} uppercase characters",
205
+ maxUppercase: "{{label}} must have at most {{maximum}} uppercase characters",
206
+ minLowercase: "{{label}} must have at least {{minimum}} lowercase characters",
207
+ maxLowercase: "{{label}} must have at most {{maximum}} lowercase characters",
208
+ minDigits: "{{label}} must have at least {{minimum}} digits",
209
+ maxDigits: "{{label}} must have at most {{maximum}} digits",
210
+ minSpecial: "{{label}} must have at least {{minimum}} special characters",
211
+ maxSpecial: "{{label}} must have at most {{maximum}} special characters",
212
+ noEmails: "{{label}} must not contain email addresses",
213
+ noUrls: "{{label}} must not contain URLs",
214
+ noPhoneNumbers: "{{label}} must not contain phone numbers",
215
+ noHtml: "{{label}} must not contain HTML",
216
+ noSpaces: "{{label}} must not contain spaces",
217
+ onlyAlpha: "{{label}} must contain only letters",
218
+ onlyNumeric: "{{label}} must contain only digits",
219
+ onlyAlphanumeric: "{{label}} must contain only letters and digits",
220
+ onlyAlphaSpaceHyphen: "{{label}} must contain only letters, spaces, and hyphens",
221
+ onlyAlphanumericSpaceHyphen: "{{label}} must contain only letters, digits, spaces, and hyphens",
222
+ minWords: "{{label}} must have at least {{minimum}} words",
223
+ maxWords: "{{label}} must have at most {{maximum}} words",
224
+ maxConsecutive: "{{label}} must not repeat the same character more than {{maximum}} times",
225
+ custom: "{{label}} failed custom validation"
226
+ }
227
+ }
228
+ };
229
+ var en = {
230
+ lang: lang,
231
+ validation: validation
232
+ };
233
+
234
+ export { en as default, lang, validation };