zenvx 0.2.1 → 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.
- package/README.md +11 -120
- package/dist/{chunk-3HCQKBTL.js → chunk-AUT6ZOMV.js} +6 -5
- package/dist/{chunk-R2XSSP2M.js → chunk-BPXBRFJ2.js} +9 -8
- package/dist/{chunk-ELPQSMQJ.js → chunk-LL4MFOXJ.js} +6 -5
- package/dist/core/define-env.cjs +38 -36
- package/dist/core/define-env.d.cts +2 -2
- package/dist/core/define-env.d.ts +2 -2
- package/dist/core/define-env.js +2 -2
- package/dist/core/parser.cjs +6 -5
- package/dist/core/parser.d.cts +5 -2
- package/dist/core/parser.d.ts +5 -2
- package/dist/core/parser.js +1 -1
- package/dist/core/types.d.cts +1 -1
- package/dist/core/types.d.ts +1 -1
- package/dist/index.cjs +40 -106
- package/dist/index.d.cts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +3 -7
- package/package.json +2 -23
- package/dist/adapters/next.cjs +0 -151
- package/dist/adapters/next.d.cts +0 -6
- package/dist/adapters/next.d.ts +0 -6
- package/dist/adapters/next.js +0 -32
- package/dist/adapters/node.cjs +0 -135
- package/dist/adapters/node.d.cts +0 -5
- package/dist/adapters/node.d.ts +0 -5
- package/dist/adapters/node.js +0 -17
- package/dist/adapters/vite.cjs +0 -135
- package/dist/adapters/vite.d.cts +0 -5
- package/dist/adapters/vite.d.ts +0 -5
- package/dist/adapters/vite.js +0 -16
- package/dist/chunk-E7OYVDFC.js +0 -67
- package/dist/core/tx.cjs +0 -91
- package/dist/core/tx.d.cts +0 -42
- package/dist/core/tx.d.ts +0 -42
- package/dist/core/tx.js +0 -6
package/dist/core/tx.cjs
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/core/tx.ts
|
|
21
|
-
var tx_exports = {};
|
|
22
|
-
__export(tx_exports, {
|
|
23
|
-
tx: () => tx
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(tx_exports);
|
|
26
|
-
var import_zod = require("zod");
|
|
27
|
-
var SEMVER_REGEX = /^\d+\.\d+\.\d+(-[0-9A-Za-z-.]+)?$/;
|
|
28
|
-
var tx = {
|
|
29
|
-
/**
|
|
30
|
-
* STRICT STRING:
|
|
31
|
-
* Rejects purely numeric strings (e.g. "12345").
|
|
32
|
-
* Good for API Keys.
|
|
33
|
-
*/
|
|
34
|
-
string: (message = "Value should be text, but looks like a number.") => import_zod.z.string().trim().regex(/^(?!\d+$).+$/, { error: message }).describe("Non-numeric string"),
|
|
35
|
-
/**
|
|
36
|
-
* SMART NUMBER:
|
|
37
|
-
* Automatically converts "3000" -> 3000.
|
|
38
|
-
* Fails if the value is not a valid number (e.g. "abc").
|
|
39
|
-
*/
|
|
40
|
-
number: (message = "Must be a number") => import_zod.z.coerce.number({ error: message }).finite().describe("Numeric value"),
|
|
41
|
-
/**
|
|
42
|
-
* PORT VALIDATOR:
|
|
43
|
-
* Coerces to number and ensures it is between 1 and 65535.
|
|
44
|
-
*/
|
|
45
|
-
port: (message = "Must be a valid port (1\u201365535)") => import_zod.z.coerce.number({ error: message }).int().min(1).max(65535).describe("TCP/UDP port number (1\u201365535)"),
|
|
46
|
-
/**
|
|
47
|
-
* SMART BOOLEAN:
|
|
48
|
-
* Handles "true", "TRUE", "1" -> true
|
|
49
|
-
* Handles "false", "FALSE", "0" -> false
|
|
50
|
-
* Throws error on anything else.
|
|
51
|
-
*/
|
|
52
|
-
bool: (message) => {
|
|
53
|
-
return import_zod.z.union([import_zod.z.string(), import_zod.z.boolean()]).transform((val, ctx) => {
|
|
54
|
-
if (typeof val === "boolean") return val;
|
|
55
|
-
const v = val.toLowerCase();
|
|
56
|
-
if (v === "true" || v === "1") return true;
|
|
57
|
-
if (v === "false" || v === "0") return false;
|
|
58
|
-
ctx.addIssue({
|
|
59
|
-
code: import_zod.z.ZodIssueCode.custom,
|
|
60
|
-
message: message || 'Must be a boolean ("true"/"false"/"1"/"0")'
|
|
61
|
-
});
|
|
62
|
-
return import_zod.z.NEVER;
|
|
63
|
-
});
|
|
64
|
-
},
|
|
65
|
-
/**
|
|
66
|
-
* URL:
|
|
67
|
-
* Strict URL checking.
|
|
68
|
-
*/
|
|
69
|
-
url: (message = "Must be a valid URL (e.g. https://...)") => import_zod.z.url({ error: message }).describe("A valid URL including protocol"),
|
|
70
|
-
email: (message = "Must be a valid email address") => import_zod.z.email({ error: message }).describe("A valid email address"),
|
|
71
|
-
positiveNumber: (message = "Must be > 0") => import_zod.z.coerce.number().gt(0, { error: message }).describe("A positive number"),
|
|
72
|
-
nonEmptyString: (message = "Cannot be empty") => import_zod.z.string().trim().min(1, { error: message }).describe("A non-empty string"),
|
|
73
|
-
semver: (message = "Must be valid semver") => import_zod.z.string().regex(SEMVER_REGEX, { error: message }).describe("Semantic version (x.y.z)"),
|
|
74
|
-
path: (message = "Must be a valid path") => import_zod.z.string().trim().min(1, { error: message }).describe("Filesystem path"),
|
|
75
|
-
enum: (values, message = `Must be one of: ${values.join(", ")}`) => import_zod.z.enum(values, { error: message }).describe(`One of: ${values.join(", ")}`),
|
|
76
|
-
json: (message = "Must be valid JSON") => import_zod.z.string().transform((val, ctx) => {
|
|
77
|
-
try {
|
|
78
|
-
return JSON.parse(val);
|
|
79
|
-
} catch {
|
|
80
|
-
ctx.addIssue({
|
|
81
|
-
code: "custom",
|
|
82
|
-
error: message
|
|
83
|
-
});
|
|
84
|
-
return import_zod.z.NEVER;
|
|
85
|
-
}
|
|
86
|
-
}).describe("JSON-encoded value")
|
|
87
|
-
};
|
|
88
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
89
|
-
0 && (module.exports = {
|
|
90
|
-
tx
|
|
91
|
-
});
|
package/dist/core/tx.d.cts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
declare const tx: {
|
|
4
|
-
/**
|
|
5
|
-
* STRICT STRING:
|
|
6
|
-
* Rejects purely numeric strings (e.g. "12345").
|
|
7
|
-
* Good for API Keys.
|
|
8
|
-
*/
|
|
9
|
-
string: (message?: string) => z.ZodString;
|
|
10
|
-
/**
|
|
11
|
-
* SMART NUMBER:
|
|
12
|
-
* Automatically converts "3000" -> 3000.
|
|
13
|
-
* Fails if the value is not a valid number (e.g. "abc").
|
|
14
|
-
*/
|
|
15
|
-
number: (message?: string) => z.ZodCoercedNumber<unknown>;
|
|
16
|
-
/**
|
|
17
|
-
* PORT VALIDATOR:
|
|
18
|
-
* Coerces to number and ensures it is between 1 and 65535.
|
|
19
|
-
*/
|
|
20
|
-
port: (message?: string) => z.ZodCoercedNumber<unknown>;
|
|
21
|
-
/**
|
|
22
|
-
* SMART BOOLEAN:
|
|
23
|
-
* Handles "true", "TRUE", "1" -> true
|
|
24
|
-
* Handles "false", "FALSE", "0" -> false
|
|
25
|
-
* Throws error on anything else.
|
|
26
|
-
*/
|
|
27
|
-
bool: (message?: string) => z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>, z.ZodTransform<boolean, string | boolean>>;
|
|
28
|
-
/**
|
|
29
|
-
* URL:
|
|
30
|
-
* Strict URL checking.
|
|
31
|
-
*/
|
|
32
|
-
url: (message?: string) => z.ZodURL;
|
|
33
|
-
email: (message?: string) => z.ZodEmail;
|
|
34
|
-
positiveNumber: (message?: string) => z.ZodCoercedNumber<unknown>;
|
|
35
|
-
nonEmptyString: (message?: string) => z.ZodString;
|
|
36
|
-
semver: (message?: string) => z.ZodString;
|
|
37
|
-
path: (message?: string) => z.ZodString;
|
|
38
|
-
enum: <T extends readonly [string, ...string[]]>(values: T, message?: string) => z.ZodEnum<{ [k_1 in T[number]]: k_1; } extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never>;
|
|
39
|
-
json: <T = unknown>(message?: string) => z.ZodPipe<z.ZodString, z.ZodTransform<Awaited<T>, string>>;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export { tx };
|
package/dist/core/tx.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
declare const tx: {
|
|
4
|
-
/**
|
|
5
|
-
* STRICT STRING:
|
|
6
|
-
* Rejects purely numeric strings (e.g. "12345").
|
|
7
|
-
* Good for API Keys.
|
|
8
|
-
*/
|
|
9
|
-
string: (message?: string) => z.ZodString;
|
|
10
|
-
/**
|
|
11
|
-
* SMART NUMBER:
|
|
12
|
-
* Automatically converts "3000" -> 3000.
|
|
13
|
-
* Fails if the value is not a valid number (e.g. "abc").
|
|
14
|
-
*/
|
|
15
|
-
number: (message?: string) => z.ZodCoercedNumber<unknown>;
|
|
16
|
-
/**
|
|
17
|
-
* PORT VALIDATOR:
|
|
18
|
-
* Coerces to number and ensures it is between 1 and 65535.
|
|
19
|
-
*/
|
|
20
|
-
port: (message?: string) => z.ZodCoercedNumber<unknown>;
|
|
21
|
-
/**
|
|
22
|
-
* SMART BOOLEAN:
|
|
23
|
-
* Handles "true", "TRUE", "1" -> true
|
|
24
|
-
* Handles "false", "FALSE", "0" -> false
|
|
25
|
-
* Throws error on anything else.
|
|
26
|
-
*/
|
|
27
|
-
bool: (message?: string) => z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>, z.ZodTransform<boolean, string | boolean>>;
|
|
28
|
-
/**
|
|
29
|
-
* URL:
|
|
30
|
-
* Strict URL checking.
|
|
31
|
-
*/
|
|
32
|
-
url: (message?: string) => z.ZodURL;
|
|
33
|
-
email: (message?: string) => z.ZodEmail;
|
|
34
|
-
positiveNumber: (message?: string) => z.ZodCoercedNumber<unknown>;
|
|
35
|
-
nonEmptyString: (message?: string) => z.ZodString;
|
|
36
|
-
semver: (message?: string) => z.ZodString;
|
|
37
|
-
path: (message?: string) => z.ZodString;
|
|
38
|
-
enum: <T extends readonly [string, ...string[]]>(values: T, message?: string) => z.ZodEnum<{ [k_1 in T[number]]: k_1; } extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never>;
|
|
39
|
-
json: <T = unknown>(message?: string) => z.ZodPipe<z.ZodString, z.ZodTransform<Awaited<T>, string>>;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export { tx };
|