@e-n-v/env 0.0.5 → 0.0.8
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/{BooleanMap-DmFnCA-O.d.ts → BooleanMap-BPQuO3Ae.d.ts} +1 -3
- package/dist/{BooleanMap-B2eIP3tZ.d.cts → BooleanMap-CX_YrPCf.d.cts} +1 -3
- package/dist/EnvChannelOptions-BbKeuO-o.d.cts +366 -0
- package/dist/EnvChannelOptions-BbKeuO-o.d.ts +366 -0
- package/dist/{EnvSource-DA3ZGlES.js → EnvSource-WAGWqRVM.js} +6 -10
- package/dist/{EnvSource-BVnmdHku.cjs → EnvSource-s8F_M_6O.cjs} +21 -28
- package/dist/EnvVarSchema-CDZGmnex.cjs +15 -0
- package/dist/EnvVarSchema-Dr6q7jf6.js +10 -0
- package/dist/{ProcessEnvChannel-Do4-yiLI.d.ts → ProcessEnvChannel-CwhV7_EB.d.ts} +2 -4
- package/dist/{ProcessEnvChannel-D465c-dp.d.cts → ProcessEnvChannel-DWHPZePe.d.cts} +2 -4
- package/dist/{StringEnvVarSchema-B8MT7htU.d.ts → StringEnvVarSchema-D9Jr1Aws.d.cts} +5 -3
- package/dist/{StringEnvVarSchema-BF6C0nyT.d.cts → StringEnvVarSchema-D9Jr1Aws.d.ts} +5 -3
- package/dist/channels.cjs +3 -4
- package/dist/channels.d.cts +3 -4
- package/dist/channels.d.ts +3 -4
- package/dist/channels.js +2 -4
- package/dist/cli.cjs +10 -23
- package/dist/cli.d.cts +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +7 -13
- package/dist/core.cjs +13 -14
- package/dist/core.d.cts +147 -6
- package/dist/core.d.ts +147 -6
- package/dist/core.js +9 -11
- package/dist/{custom-Bt_wnxIu.js → custom-Bd-jLg80.js} +3 -12
- package/dist/{custom-D_Rqjm09.cjs → custom-Dyb9TnER.cjs} +48 -58
- package/dist/files.cjs +6 -6
- package/dist/files.d.cts +2 -2
- package/dist/files.d.ts +2 -2
- package/dist/files.js +2 -5
- package/dist/{parse-DwtLpVhC.d.ts → index-B2eNij2x.d.cts} +1 -2
- package/dist/{parse-BT1QSa5e.d.cts → index-BHTM8nxS.d.ts} +1 -2
- package/dist/{prompt-yKdccbtZ.d.ts → index-BKBW9Dxs.d.cts} +3 -4
- package/dist/{prompt-C5WudV9x.d.cts → index-CEyOIRdj.d.ts} +3 -4
- package/dist/{EnvModel-CrGclUpJ.d.cts → index-Cb0abjLf.d.ts} +59 -7
- package/dist/{EnvModel-D8rt0EJ6.d.ts → index-Cz3frUwZ.d.cts} +58 -6
- package/dist/index.cjs +33 -0
- package/dist/index.d.cts +19 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +15 -0
- package/dist/model.cjs +10 -11
- package/dist/model.d.cts +2 -35
- package/dist/model.d.ts +2 -35
- package/dist/model.js +2 -6
- package/dist/parse.cjs +14 -14
- package/dist/parse.d.cts +5 -8
- package/dist/parse.d.ts +5 -8
- package/dist/parse.js +4 -7
- package/dist/preprocessors-BKuIcZa1.d.ts +83 -0
- package/dist/preprocessors-DFVyF0c7.d.cts +83 -0
- package/dist/prompt.cjs +12 -15
- package/dist/prompt.d.cts +5 -10
- package/dist/prompt.d.ts +5 -10
- package/dist/prompt.js +3 -9
- package/dist/{redis-EcC7TX3K.cjs → redis-CyTF0SYT.cjs} +321 -253
- package/dist/{redis-CJOpRPjc.js → redis-D18f4ztf.js} +76 -37
- package/dist/{index-Dq_0aeAL.d.ts → redis-DsW-Vkwq.d.cts} +26 -6
- package/dist/{index-D8pslhp4.d.cts → redis-tRD4nAy_.d.ts} +26 -6
- package/dist/{resolveChannel-v9BDsw-M.js → resolveChannel-D1Fzl4TL.js} +59 -63
- package/dist/{resolveChannel-CjAuxy3p.cjs → resolveChannel-DxZNYdDe.cjs} +84 -92
- package/dist/{chunk-pbleEpgJ.cjs → rolldown-runtime-C0BPl7ul.cjs} +15 -16
- package/dist/{chunk-Bp6m_JJh.js → rolldown-runtime-D7D4PA-g.js} +4 -4
- package/dist/{schema-jN4EtvEP.d.ts → schema-B-JLVS42.d.ts} +1 -3
- package/dist/{schema-DH4GiW9A.d.cts → schema-B1i83alz.d.cts} +1 -3
- package/dist/schema-CtP5lpU1.js +11 -0
- package/dist/schema-D9nJKipf.cjs +22 -0
- package/dist/schemas/zod.cjs +112 -359
- package/dist/schemas/zod.d.cts +117 -87
- package/dist/schemas/zod.d.ts +117 -87
- package/dist/schemas/zod.js +116 -377
- package/dist/schemas.cjs +152 -133
- package/dist/schemas.d.cts +2 -3
- package/dist/schemas.d.ts +2 -3
- package/dist/schemas.js +2 -6
- package/dist/{src-Cjo2XA4n.cjs → src-5GYFbR9n.cjs} +21 -25
- package/dist/{src-BBwjK5SK.js → src-8rEOvFG5.js} +11 -15
- package/dist/{src-Dtv7TlJx.js → src-CdzAzdq-.js} +100 -114
- package/dist/{src-CLTURaoo.js → src-Cg49gGJb.js} +18 -44
- package/dist/{src-DWYoqPX1.cjs → src-CttkcdpE.cjs} +114 -133
- package/dist/{src-XjL5cyPG.cjs → src-D5KzIEH_.cjs} +130 -107
- package/dist/src-DB0Har0j.cjs +1632 -0
- package/dist/{src-CVdUqK3q.js → src-DWc-WWjX.js} +107 -86
- package/dist/{src-B7FG1rak.js → src-DvUBRBe3.js} +205 -116
- package/dist/{src-meUnCASg.cjs → src-TZx_e95f.cjs} +87 -132
- package/dist/{vars-BNVI6k89.d.ts → vars-DtzGL5Nc.d.cts} +1 -4
- package/dist/{vars-CptZRPX5.d.cts → vars-obKYxaSu.d.ts} +1 -4
- package/dist/vars.cjs +175 -138
- package/dist/vars.d.cts +3 -7
- package/dist/vars.d.ts +3 -7
- package/dist/vars.js +21 -9
- package/package.json +9 -8
- package/dist/EnvChannelOptions-BPkWDrmr.d.cts +0 -108
- package/dist/EnvChannelOptions-CRwDLWjd.d.ts +0 -108
- package/dist/coerce-DNIuYAx4.js +0 -11028
- package/dist/coerce-b7UVodS9.cjs +0 -12365
- package/dist/model-Dic8IJsf.d.ts +0 -29
- package/dist/model-ft0WhSSS.d.cts +0 -29
- package/dist/root.cjs +0 -36
- package/dist/root.d.cts +0 -21
- package/dist/root.d.ts +0 -21
- package/dist/root.js +0 -21
- package/dist/src-DZmpNGrQ.cjs +0 -1411
- package/dist/validate-BxA3a-ns.d.cts +0 -203
- package/dist/validate-CyxrRacF.d.ts +0 -203
- package/dist/vars-CYOaskkK.cjs +0 -27
- package/dist/vars-DOW0LiiN.js +0 -22
- /package/dist/{EnvChannel-LMIRYvT1.d.cts → EnvChannel-CfSwa_25.d.cts} +0 -0
- /package/dist/{EnvChannel-w27PEm7x.d.ts → EnvChannel-CfSwa_25.d.ts} +0 -0
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
import { URL } from "url";
|
|
2
|
+
//#region ../channels/src/channels/dotenv/DotEnvInstance.d.ts
|
|
3
|
+
interface DotEnvConfigOptions {
|
|
4
|
+
path?: string;
|
|
5
|
+
encoding?: string;
|
|
6
|
+
debug?: boolean;
|
|
7
|
+
override?: boolean;
|
|
8
|
+
[key: string]: unknown;
|
|
9
|
+
}
|
|
10
|
+
interface DotEnvConfigOutput {
|
|
11
|
+
parsed?: Record<string, string>;
|
|
12
|
+
error?: Error;
|
|
13
|
+
}
|
|
14
|
+
interface DotEnvParseOptions {
|
|
15
|
+
debug?: boolean;
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
}
|
|
18
|
+
interface DotEnvInstance {
|
|
19
|
+
parse(src: string | Buffer, options?: DotEnvParseOptions): Record<string, string | undefined>;
|
|
20
|
+
config?(options?: DotEnvConfigOptions): DotEnvConfigOutput;
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region ../channels/src/channels/dotenv/DotEnvChannelConfig.d.ts
|
|
24
|
+
interface DotEnvChannelConfig {
|
|
25
|
+
dotenv: DotEnvInstance;
|
|
26
|
+
path?: string;
|
|
27
|
+
get?: DotEnvConfigOptions & {
|
|
28
|
+
[key: string]: unknown;
|
|
29
|
+
};
|
|
30
|
+
parse?: DotEnvParseOptions & {
|
|
31
|
+
[key: string]: unknown;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region ../../node_modules/@dotenvx/dotenvx/src/lib/main.d.ts
|
|
36
|
+
interface DotenvParseOutput {
|
|
37
|
+
[name: string]: string;
|
|
38
|
+
}
|
|
39
|
+
interface DotenvConfigOptions {
|
|
40
|
+
/**
|
|
41
|
+
* Specify explicit env sources. When set, `path` and `convention` are ignored.
|
|
42
|
+
*
|
|
43
|
+
* @default undefined
|
|
44
|
+
* @example require('@dotenvx/dotenvx').config({ envs: [{ type: 'envFile', value: '.env' }] })
|
|
45
|
+
* @example require('@dotenvx/dotenvx').config({ envs: [{ type: 'env', value: 'HELLO=World', privateKeyName: 'DOTENV_PRIVATE_KEY' }] })
|
|
46
|
+
*/
|
|
47
|
+
envs?: DotenvConfigEnv[];
|
|
48
|
+
/**
|
|
49
|
+
* Specify a custom path if your file containing environment variables is located elsewhere.
|
|
50
|
+
* Can also be an array of strings, specifying multiple paths.
|
|
51
|
+
*
|
|
52
|
+
* @default require('path').resolve(process.cwd(), '.env')
|
|
53
|
+
* @example require('@dotenvx/dotenvx').config({ path: '/custom/path/to/.env' })
|
|
54
|
+
* @example require('@dotenvx/dotenvx').config({ path: ['/path/to/first.env', '/path/to/second.env'] })
|
|
55
|
+
*/
|
|
56
|
+
path?: string | string[] | URL;
|
|
57
|
+
/**
|
|
58
|
+
* Specify the encoding of your file containing environment variables.
|
|
59
|
+
*
|
|
60
|
+
* @default 'utf8'
|
|
61
|
+
* @example require('@dotenvx/dotenvx').config({ encoding: 'latin1' })
|
|
62
|
+
*/
|
|
63
|
+
encoding?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Override any environment variables that have already been set on your machine with values from your .env file.
|
|
66
|
+
* @default false
|
|
67
|
+
* @example require('@dotenvx/dotenvx').config({ overload: true })
|
|
68
|
+
* @alias overload
|
|
69
|
+
*/
|
|
70
|
+
overload?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* @default false
|
|
73
|
+
* @alias override
|
|
74
|
+
*/
|
|
75
|
+
override?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Throw immediately if an error is encountered - like a missing .env file.
|
|
78
|
+
* @default false
|
|
79
|
+
* @example require('@dotenvx/dotenvx').config({ strict: true })
|
|
80
|
+
*/
|
|
81
|
+
strict?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Suppress specific errors like MISSING_ENV_FILE. The error keys can be found
|
|
84
|
+
* in src/lib/helpers/errors.js
|
|
85
|
+
* @default []
|
|
86
|
+
* @example require('@dotenvx/dotenvx').config({ ignore: ['MISSING_ENV_FILE'] })
|
|
87
|
+
*/
|
|
88
|
+
ignore?: string[];
|
|
89
|
+
/**
|
|
90
|
+
* Specify an object to write your secrets to. Defaults to process.env environment variables.
|
|
91
|
+
*
|
|
92
|
+
* @default process.env
|
|
93
|
+
* @example const processEnv = {}; require('@dotenvx/dotenvx').config({ processEnv: processEnv })
|
|
94
|
+
*/
|
|
95
|
+
processEnv?: DotenvPopulateInput;
|
|
96
|
+
/**
|
|
97
|
+
* Mask resolved values, optionally setting the number of visible characters.
|
|
98
|
+
* @default false
|
|
99
|
+
* @example require('@dotenvx/dotenvx').config({ mask: true })
|
|
100
|
+
* @example require('@dotenvx/dotenvx').config({ mask: 0 })
|
|
101
|
+
*/
|
|
102
|
+
mask?: boolean | number;
|
|
103
|
+
/**
|
|
104
|
+
* Customize the path to your .env.keys file. This is useful with monorepos.
|
|
105
|
+
* @default []
|
|
106
|
+
* @example require('@dotenvx/dotenvx').config({ envKeysFile: '../../.env.keys'} })
|
|
107
|
+
*/
|
|
108
|
+
envKeysFile?: string;
|
|
109
|
+
/**
|
|
110
|
+
* Legacy option retained for compatibility.
|
|
111
|
+
*
|
|
112
|
+
* @default undefined
|
|
113
|
+
* @example require('@dotenvx/dotenvx').config({ DOTENV_KEY: 'dotenv://:key_1234…' })
|
|
114
|
+
*/
|
|
115
|
+
DOTENV_KEY?: string;
|
|
116
|
+
/**
|
|
117
|
+
* Load a .env convention (available conventions: 'nextjs, flow')
|
|
118
|
+
*/
|
|
119
|
+
convention?: string;
|
|
120
|
+
/**
|
|
121
|
+
* Turn on logging to help debug why certain keys or values are not being set as you expect.
|
|
122
|
+
*
|
|
123
|
+
* @default false
|
|
124
|
+
* @example require('@dotenvx/dotenvx').config({ debug: process.env.DEBUG })
|
|
125
|
+
*/
|
|
126
|
+
debug?: boolean;
|
|
127
|
+
verbose?: boolean;
|
|
128
|
+
quiet?: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Disable spinner output from child Dotenvx Armor commands.
|
|
131
|
+
*
|
|
132
|
+
* @default false
|
|
133
|
+
* @example require('@dotenvx/dotenvx').config({ noSpinner: true })
|
|
134
|
+
*/
|
|
135
|
+
noSpinner?: boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Set Armor token.
|
|
138
|
+
*
|
|
139
|
+
* @example require('@dotenvx/dotenvx').config({ token: process.env.DOTENVX_ARMOR_TOKEN })
|
|
140
|
+
*/
|
|
141
|
+
token?: string;
|
|
142
|
+
logLevel?: 'error' | 'warn' | 'success' | 'info' | 'help' | 'verbose' | 'debug';
|
|
143
|
+
/**
|
|
144
|
+
* Turn off Dotenvx Armor features.
|
|
145
|
+
*
|
|
146
|
+
* @default false
|
|
147
|
+
* @example require('@dotenvx/dotenvx').config({ noArmor: true })
|
|
148
|
+
*/
|
|
149
|
+
noArmor?: boolean;
|
|
150
|
+
/**
|
|
151
|
+
* Turn off OS secret store features.
|
|
152
|
+
*
|
|
153
|
+
* @default false
|
|
154
|
+
* @example require('@dotenvx/dotenvx').config({ noNative: true })
|
|
155
|
+
*/
|
|
156
|
+
noNative?: boolean;
|
|
157
|
+
/**
|
|
158
|
+
* Turn off 1Password secret reference resolution.
|
|
159
|
+
*
|
|
160
|
+
* @default false
|
|
161
|
+
* @example require('@dotenvx/dotenvx').config({ no1Password: true })
|
|
162
|
+
*/
|
|
163
|
+
no1Password?: boolean;
|
|
164
|
+
/**
|
|
165
|
+
* Turn off Bitwarden secret reference resolution.
|
|
166
|
+
*
|
|
167
|
+
* @default false
|
|
168
|
+
* @example require('@dotenvx/dotenvx').config({ noBitwarden: true })
|
|
169
|
+
*/
|
|
170
|
+
noBitwarden?: boolean;
|
|
171
|
+
}
|
|
172
|
+
type DotenvConfigEnv = DotenvConfigEnvFile | DotenvConfigEnvSrc;
|
|
173
|
+
interface DotenvConfigEnvFile {
|
|
174
|
+
type: 'envFile';
|
|
175
|
+
value: string | URL;
|
|
176
|
+
}
|
|
177
|
+
interface DotenvConfigEnvSrc {
|
|
178
|
+
type: 'env';
|
|
179
|
+
value: string | Buffer;
|
|
180
|
+
privateKeyName?: string;
|
|
181
|
+
}
|
|
182
|
+
interface DotenvConfigOutput {
|
|
183
|
+
error?: Error;
|
|
184
|
+
parsed?: DotenvParseOutput;
|
|
185
|
+
}
|
|
186
|
+
interface DotenvPopulateInput {
|
|
187
|
+
[name: string]: string;
|
|
188
|
+
}
|
|
189
|
+
interface SetOptions {
|
|
190
|
+
/**
|
|
191
|
+
* Specify a custom path if your file containing environment variables is located elsewhere.
|
|
192
|
+
* Can also be an array of strings, specifying multiple paths.
|
|
193
|
+
*
|
|
194
|
+
* @default require('path').resolve(process.cwd(), '.env')
|
|
195
|
+
* @example require('@dotenvx/dotenvx').set(key, value, { path: '/custom/path/to/.env' })
|
|
196
|
+
* @example require('@dotenvx/dotenvx').set(key, value, { path: ['/path/to/first.env', '/path/to/second.env'] })
|
|
197
|
+
*/
|
|
198
|
+
path?: string | string[] | URL;
|
|
199
|
+
/**
|
|
200
|
+
* Customize the path to your .env.keys file. This is useful with monorepos.
|
|
201
|
+
* @default []
|
|
202
|
+
* @example require('@dotenvx/dotenvx').config(key, value, { envKeysFile: '../../.env.keys'} })
|
|
203
|
+
*/
|
|
204
|
+
envKeysFile?: string;
|
|
205
|
+
/**
|
|
206
|
+
* Set a .env convention (available conventions: 'nextjs, flow')
|
|
207
|
+
*/
|
|
208
|
+
convention?: string;
|
|
209
|
+
/**
|
|
210
|
+
* Specify whether the variable has to be encrypted
|
|
211
|
+
* @default true
|
|
212
|
+
* @example require('@dotenvx/dotenvx').config(key, value, { encrypt: false } })
|
|
213
|
+
*/
|
|
214
|
+
encrypt?: boolean;
|
|
215
|
+
/**
|
|
216
|
+
* Turn off Dotenvx Armor features.
|
|
217
|
+
*
|
|
218
|
+
* @default false
|
|
219
|
+
* @example require('@dotenvx/dotenvx').set(key, value, { noArmor: true })
|
|
220
|
+
*/
|
|
221
|
+
noArmor?: boolean;
|
|
222
|
+
/**
|
|
223
|
+
* Turn off OS secret store features.
|
|
224
|
+
*
|
|
225
|
+
* @default false
|
|
226
|
+
* @example require('@dotenvx/dotenvx').set(key, value, { noNative: true })
|
|
227
|
+
*/
|
|
228
|
+
noNative?: boolean;
|
|
229
|
+
}
|
|
230
|
+
interface GetOptions {
|
|
231
|
+
/**
|
|
232
|
+
* Mask returned values, optionally setting the number of visible characters.
|
|
233
|
+
* @default false
|
|
234
|
+
* @example require('@dotenvx/dotenvx').get('KEY', { mask: true })
|
|
235
|
+
* @example require('@dotenvx/dotenvx').get('KEY', { mask: 0 })
|
|
236
|
+
*/
|
|
237
|
+
mask?: boolean | number;
|
|
238
|
+
/**
|
|
239
|
+
* Suppress specific errors like MISSING_ENV_FILE. The error keys can be found
|
|
240
|
+
* in src/lib/helpers/errors.js
|
|
241
|
+
* @default []
|
|
242
|
+
* @example require('@dotenvx/dotenvx').get('KEY', { ignore: ['MISSING_ENV_FILE'] })
|
|
243
|
+
*/
|
|
244
|
+
ignore?: string[];
|
|
245
|
+
/**
|
|
246
|
+
* Override any environment variables that have already been set on your machine with values from your .env file.
|
|
247
|
+
* @default false
|
|
248
|
+
* @example require('@dotenvx/dotenvx').get('KEY', { overload: true })
|
|
249
|
+
* @alias overload
|
|
250
|
+
*/
|
|
251
|
+
overload?: boolean;
|
|
252
|
+
/**
|
|
253
|
+
* Customize the path to your .env.keys file. This is useful with monorepos.
|
|
254
|
+
* @default []
|
|
255
|
+
* @example require('@dotenvx/dotenvx').get('KEY', { envKeysFile: '../../.env.keys'} })
|
|
256
|
+
*/
|
|
257
|
+
envKeysFile?: string;
|
|
258
|
+
/**
|
|
259
|
+
* Throw immediately if an error is encountered - like a missing .env file.
|
|
260
|
+
* @default false
|
|
261
|
+
* @example require('@dotenvx/dotenvx').get('KEY', { strict: true })
|
|
262
|
+
*/
|
|
263
|
+
strict?: boolean;
|
|
264
|
+
/**
|
|
265
|
+
* Turn off Dotenvx Armor features.
|
|
266
|
+
*
|
|
267
|
+
* @default false
|
|
268
|
+
* @example require('@dotenvx/dotenvx').get('KEY', { noArmor: true })
|
|
269
|
+
*/
|
|
270
|
+
noArmor?: boolean;
|
|
271
|
+
/**
|
|
272
|
+
* Turn off OS secret store features.
|
|
273
|
+
*
|
|
274
|
+
* @default false
|
|
275
|
+
* @example require('@dotenvx/dotenvx').get('KEY', { noNative: true })
|
|
276
|
+
*/
|
|
277
|
+
noNative?: boolean;
|
|
278
|
+
/**
|
|
279
|
+
* Turn off 1Password secret reference resolution.
|
|
280
|
+
*
|
|
281
|
+
* @default false
|
|
282
|
+
* @example require('@dotenvx/dotenvx').get('KEY', { no1Password: true })
|
|
283
|
+
*/
|
|
284
|
+
no1Password?: boolean;
|
|
285
|
+
/**
|
|
286
|
+
* Turn off Bitwarden secret reference resolution.
|
|
287
|
+
*
|
|
288
|
+
* @default false
|
|
289
|
+
* @example require('@dotenvx/dotenvx').get('KEY', { noBitwarden: true })
|
|
290
|
+
*/
|
|
291
|
+
noBitwarden?: boolean;
|
|
292
|
+
}
|
|
293
|
+
//#endregion
|
|
294
|
+
//#region ../channels/src/channels/dotenvx/DotEnvXInstance.d.ts
|
|
295
|
+
/**
|
|
296
|
+
* Minimal interface for dotenvx functionality used in ask-env.
|
|
297
|
+
*/
|
|
298
|
+
interface DotEnvXInstance {
|
|
299
|
+
get(key: string, options?: GetOptions): Promise<string>;
|
|
300
|
+
set(key: string, value: string, options?: SetOptions): Promise<unknown>;
|
|
301
|
+
config(options?: DotenvConfigOptions): DotenvConfigOutput;
|
|
302
|
+
}
|
|
303
|
+
//#endregion
|
|
304
|
+
//#region ../channels/src/channels/dotenvx/DotEnvXGetOptions.d.ts
|
|
305
|
+
/**
|
|
306
|
+
* Get options without envKeysFile since we manage that ourselves
|
|
307
|
+
*/
|
|
308
|
+
type DotEnvXGetOptions = Omit<GetOptions, "envKeysFile">;
|
|
309
|
+
//#endregion
|
|
310
|
+
//#region ../channels/src/channels/dotenvx/DotEnvXSetOptions.d.ts
|
|
311
|
+
/**
|
|
312
|
+
* Set options without envKeysFile since we manage that ourselves
|
|
313
|
+
*/
|
|
314
|
+
type DotEnvXSetOptions = Omit<SetOptions, "envKeysFile">;
|
|
315
|
+
//#endregion
|
|
316
|
+
//#region ../channels/src/channels/dotenvx/DotEnvXChannelConfig.d.ts
|
|
317
|
+
/**
|
|
318
|
+
* DotEnvX channel configuration
|
|
319
|
+
*/
|
|
320
|
+
interface DotEnvXChannelConfig {
|
|
321
|
+
dotenvx: DotEnvXInstance;
|
|
322
|
+
get?: DotEnvXGetOptions & {
|
|
323
|
+
[key: string]: unknown;
|
|
324
|
+
};
|
|
325
|
+
set?: DotEnvXSetOptions & {
|
|
326
|
+
[key: string]: unknown;
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
//#endregion
|
|
330
|
+
//#region ../channels/src/channels/default/DefaultChannelConfig.d.ts
|
|
331
|
+
/**
|
|
332
|
+
* Default channel configuration
|
|
333
|
+
*/
|
|
334
|
+
interface DefaultChannelConfig {
|
|
335
|
+
name: "default";
|
|
336
|
+
}
|
|
337
|
+
//#endregion
|
|
338
|
+
//#region ../channels/src/channels/processenv/ProcessEnvChannelConfig.d.ts
|
|
339
|
+
/**
|
|
340
|
+
* Configuration for ProcessEnv channel using name
|
|
341
|
+
*/
|
|
342
|
+
interface ProcessEnvChannelConfig {
|
|
343
|
+
name: "processenv";
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Configuration for ProcessEnv channel using process shorthand
|
|
347
|
+
*/
|
|
348
|
+
interface ProcessChannelConfig {
|
|
349
|
+
process: NodeJS.Process;
|
|
350
|
+
}
|
|
351
|
+
//#endregion
|
|
352
|
+
//#region ../channels/src/EnvChannelOptions.d.ts
|
|
353
|
+
/**
|
|
354
|
+
* Channel options can be:
|
|
355
|
+
* - undefined (uses default channel)
|
|
356
|
+
* - "default" string (uses default channel)
|
|
357
|
+
* - "processenv" string (uses process.env channel)
|
|
358
|
+
* - dotenvx instance (uses dotenvx with default options)
|
|
359
|
+
* - DotEnvXChannelConfig (uses dotenvx with custom options)
|
|
360
|
+
* - DefaultChannelConfig (uses default with custom options)
|
|
361
|
+
* - ProcessEnvChannelConfig (uses process.env with config options)
|
|
362
|
+
* - ProcessChannelConfig (uses process.env with { process } notation)
|
|
363
|
+
*/
|
|
364
|
+
type EnvChannelOptions = undefined | "default" | "processenv" | DotEnvChannelConfig | DotEnvXChannelConfig | DefaultChannelConfig | ProcessEnvChannelConfig | ProcessChannelConfig;
|
|
365
|
+
//#endregion
|
|
366
|
+
export { DotEnvXChannelConfig as a, DotEnvXInstance as c, DotEnvConfigOutput as d, DotEnvInstance as f, DefaultChannelConfig as i, DotEnvChannelConfig as l, ProcessChannelConfig as n, DotEnvXSetOptions as o, DotEnvParseOptions as p, ProcessEnvChannelConfig as r, DotEnvXGetOptions as s, EnvChannelOptions as t, DotEnvConfigOptions as u };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { mkdirSync, promises, readFileSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { dirname, resolve } from "node:path";
|
|
3
|
-
|
|
4
3
|
//#region ../files/src/utils.ts
|
|
5
4
|
function normalizeContent(content) {
|
|
6
5
|
return content.replace(/\r\n/g, "\n");
|
|
@@ -118,9 +117,7 @@ function parseDoubleQuotedValue(source) {
|
|
|
118
117
|
case "\\":
|
|
119
118
|
value += "\\";
|
|
120
119
|
break;
|
|
121
|
-
default:
|
|
122
|
-
value += char;
|
|
123
|
-
break;
|
|
120
|
+
default: value += char;
|
|
124
121
|
}
|
|
125
122
|
escaping = false;
|
|
126
123
|
continue;
|
|
@@ -163,7 +160,6 @@ function parseSingleQuotedValue(source) {
|
|
|
163
160
|
}
|
|
164
161
|
return null;
|
|
165
162
|
}
|
|
166
|
-
|
|
167
163
|
//#endregion
|
|
168
164
|
//#region ../files/src/get.ts
|
|
169
165
|
function get(content, arg) {
|
|
@@ -220,7 +216,6 @@ function iterateAssignments(lines, callback) {
|
|
|
220
216
|
i = parsed.startIndex - 1;
|
|
221
217
|
}
|
|
222
218
|
}
|
|
223
|
-
|
|
224
219
|
//#endregion
|
|
225
220
|
//#region ../files/src/set.ts
|
|
226
221
|
function set(content, arg, value) {
|
|
@@ -321,12 +316,14 @@ function buildAssignmentLines(key, value, style = {}) {
|
|
|
321
316
|
const trailing = style.trailing ?? "";
|
|
322
317
|
const segments = serializeValue(value).split("\n");
|
|
323
318
|
return segments.map((segment, index) => {
|
|
324
|
-
if (index === 0)
|
|
319
|
+
if (index === 0) {
|
|
320
|
+
const suffix = segments.length === 1 ? trailing : "";
|
|
321
|
+
return `${leading}${exportPrefix}${key}=${segment}${suffix}`;
|
|
322
|
+
}
|
|
325
323
|
if (index === segments.length - 1 && trailing && segments.length > 1) return `${segment}${trailing}`;
|
|
326
324
|
return segment;
|
|
327
325
|
});
|
|
328
326
|
}
|
|
329
|
-
|
|
330
327
|
//#endregion
|
|
331
328
|
//#region ../files/src/EnvSource.ts
|
|
332
329
|
var EnvSource = class {
|
|
@@ -395,6 +392,5 @@ var EnvSource = class {
|
|
|
395
392
|
}
|
|
396
393
|
}
|
|
397
394
|
};
|
|
398
|
-
|
|
399
395
|
//#endregion
|
|
400
|
-
export { set as n, get as r, EnvSource as t };
|
|
396
|
+
export { set as n, get as r, EnvSource as t };
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
const require_chunk = require('./chunk-pbleEpgJ.cjs');
|
|
2
1
|
let node_fs = require("node:fs");
|
|
3
|
-
node_fs = require_chunk.__toESM(node_fs);
|
|
4
2
|
let node_path = require("node:path");
|
|
5
|
-
node_path = require_chunk.__toESM(node_path);
|
|
6
|
-
|
|
7
3
|
//#region ../files/src/utils.ts
|
|
8
4
|
function normalizeContent(content) {
|
|
9
5
|
return content.replace(/\r\n/g, "\n");
|
|
@@ -121,9 +117,7 @@ function parseDoubleQuotedValue(source) {
|
|
|
121
117
|
case "\\":
|
|
122
118
|
value += "\\";
|
|
123
119
|
break;
|
|
124
|
-
default:
|
|
125
|
-
value += char;
|
|
126
|
-
break;
|
|
120
|
+
default: value += char;
|
|
127
121
|
}
|
|
128
122
|
escaping = false;
|
|
129
123
|
continue;
|
|
@@ -166,7 +160,6 @@ function parseSingleQuotedValue(source) {
|
|
|
166
160
|
}
|
|
167
161
|
return null;
|
|
168
162
|
}
|
|
169
|
-
|
|
170
163
|
//#endregion
|
|
171
164
|
//#region ../files/src/get.ts
|
|
172
165
|
function get(content, arg) {
|
|
@@ -223,7 +216,6 @@ function iterateAssignments(lines, callback) {
|
|
|
223
216
|
i = parsed.startIndex - 1;
|
|
224
217
|
}
|
|
225
218
|
}
|
|
226
|
-
|
|
227
219
|
//#endregion
|
|
228
220
|
//#region ../files/src/set.ts
|
|
229
221
|
function set(content, arg, value) {
|
|
@@ -324,12 +316,14 @@ function buildAssignmentLines(key, value, style = {}) {
|
|
|
324
316
|
const trailing = style.trailing ?? "";
|
|
325
317
|
const segments = serializeValue(value).split("\n");
|
|
326
318
|
return segments.map((segment, index) => {
|
|
327
|
-
if (index === 0)
|
|
319
|
+
if (index === 0) {
|
|
320
|
+
const suffix = segments.length === 1 ? trailing : "";
|
|
321
|
+
return `${leading}${exportPrefix}${key}=${segment}${suffix}`;
|
|
322
|
+
}
|
|
328
323
|
if (index === segments.length - 1 && trailing && segments.length > 1) return `${segment}${trailing}`;
|
|
329
324
|
return segment;
|
|
330
325
|
});
|
|
331
326
|
}
|
|
332
|
-
|
|
333
327
|
//#endregion
|
|
334
328
|
//#region ../files/src/EnvSource.ts
|
|
335
329
|
var EnvSource = class {
|
|
@@ -398,23 +392,22 @@ var EnvSource = class {
|
|
|
398
392
|
}
|
|
399
393
|
}
|
|
400
394
|
};
|
|
401
|
-
|
|
402
395
|
//#endregion
|
|
403
|
-
Object.defineProperty(exports,
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
396
|
+
Object.defineProperty(exports, "EnvSource", {
|
|
397
|
+
enumerable: true,
|
|
398
|
+
get: function() {
|
|
399
|
+
return EnvSource;
|
|
400
|
+
}
|
|
408
401
|
});
|
|
409
|
-
Object.defineProperty(exports,
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
402
|
+
Object.defineProperty(exports, "get", {
|
|
403
|
+
enumerable: true,
|
|
404
|
+
get: function() {
|
|
405
|
+
return get;
|
|
406
|
+
}
|
|
407
|
+
});
|
|
408
|
+
Object.defineProperty(exports, "set", {
|
|
409
|
+
enumerable: true,
|
|
410
|
+
get: function() {
|
|
411
|
+
return set;
|
|
412
|
+
}
|
|
414
413
|
});
|
|
415
|
-
Object.defineProperty(exports, 'set', {
|
|
416
|
-
enumerable: true,
|
|
417
|
-
get: function () {
|
|
418
|
-
return set;
|
|
419
|
-
}
|
|
420
|
-
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const require_src = require("./src-TZx_e95f.cjs");
|
|
2
|
+
//#region ../core/src/schemas/EnvVarSchema.ts
|
|
3
|
+
/**
|
|
4
|
+
* Type guard to check if a value is a EnvVarSchema instance
|
|
5
|
+
*/
|
|
6
|
+
function isEnvVarSchema(value) {
|
|
7
|
+
return value instanceof require_src.StringEnvVarSchema || value instanceof require_src.NumberEnvVarSchema || value instanceof require_src.BooleanEnvVarSchema || value instanceof require_src.EnumEnvVarSchema;
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
Object.defineProperty(exports, "isEnvVarSchema", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function() {
|
|
13
|
+
return isEnvVarSchema;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { a as EnumEnvVarSchema, i as NumberEnvVarSchema, o as BooleanEnvVarSchema, r as StringEnvVarSchema } from "./src-Cg49gGJb.js";
|
|
2
|
+
//#region ../core/src/schemas/EnvVarSchema.ts
|
|
3
|
+
/**
|
|
4
|
+
* Type guard to check if a value is a EnvVarSchema instance
|
|
5
|
+
*/
|
|
6
|
+
function isEnvVarSchema(value) {
|
|
7
|
+
return value instanceof StringEnvVarSchema || value instanceof NumberEnvVarSchema || value instanceof BooleanEnvVarSchema || value instanceof EnumEnvVarSchema;
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { isEnvVarSchema as t };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { c as DotEnvXInstance, o as DotEnvXSetOptions, s as DotEnvXGetOptions, t as EnvChannelOptions } from "./EnvChannelOptions-
|
|
2
|
-
import { t as EnvChannel } from "./EnvChannel-
|
|
3
|
-
|
|
1
|
+
import { c as DotEnvXInstance, o as DotEnvXSetOptions, s as DotEnvXGetOptions, t as EnvChannelOptions } from "./EnvChannelOptions-BbKeuO-o.js";
|
|
2
|
+
import { t as EnvChannel } from "./EnvChannel-CfSwa_25.js";
|
|
4
3
|
//#region ../channels/src/resolveChannel.d.ts
|
|
5
|
-
|
|
6
4
|
/**
|
|
7
5
|
* Resolve channel options into an EnvChannel instance
|
|
8
6
|
* @param options - The channel options to resolve
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { c as DotEnvXInstance, o as DotEnvXSetOptions, s as DotEnvXGetOptions, t as EnvChannelOptions } from "./EnvChannelOptions-
|
|
2
|
-
import { t as EnvChannel } from "./EnvChannel-
|
|
3
|
-
|
|
1
|
+
import { c as DotEnvXInstance, o as DotEnvXSetOptions, s as DotEnvXGetOptions, t as EnvChannelOptions } from "./EnvChannelOptions-BbKeuO-o.cjs";
|
|
2
|
+
import { t as EnvChannel } from "./EnvChannel-CfSwa_25.cjs";
|
|
4
3
|
//#region ../channels/src/resolveChannel.d.ts
|
|
5
|
-
|
|
6
4
|
/**
|
|
7
5
|
* Resolve channel options into an EnvChannel instance
|
|
8
6
|
* @param options - The channel options to resolve
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
//#region ../core/src/processing/types/Processor.d.ts
|
|
2
2
|
/**
|
|
3
|
-
* Processor function that transforms
|
|
3
|
+
* Processor function that transforms an input value to type T.
|
|
4
4
|
* Returns T if processing succeeds, undefined for empty/null values, throws descriptive errors for invalid values.
|
|
5
|
-
* Used by environment variable schemas to convert
|
|
5
|
+
* Used by environment variable schemas to convert values to their target types.
|
|
6
6
|
*/
|
|
7
|
-
type Processor<T> = (value:
|
|
7
|
+
type Processor<T> = (value: unknown) => T | undefined;
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region ../core/src/types/EnvVarType.d.ts
|
|
10
10
|
type EnvVarType = "string" | "number" | "boolean" | "enum";
|
|
@@ -15,6 +15,7 @@ interface EnvVarSchemaInput<T> {
|
|
|
15
15
|
required?: boolean;
|
|
16
16
|
default?: T;
|
|
17
17
|
description?: string;
|
|
18
|
+
link?: string;
|
|
18
19
|
}
|
|
19
20
|
//#endregion
|
|
20
21
|
//#region ../core/src/schemas/EnvVarSchemaBase.d.ts
|
|
@@ -23,6 +24,7 @@ declare abstract class EnvVarSchemaBase<T> {
|
|
|
23
24
|
readonly required: boolean;
|
|
24
25
|
readonly default?: T;
|
|
25
26
|
readonly description?: string;
|
|
27
|
+
readonly link?: string;
|
|
26
28
|
readonly process: Processor<T>;
|
|
27
29
|
constructor(input: EnvVarSchemaInput<T>);
|
|
28
30
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
//#region ../core/src/processing/types/Processor.d.ts
|
|
2
2
|
/**
|
|
3
|
-
* Processor function that transforms
|
|
3
|
+
* Processor function that transforms an input value to type T.
|
|
4
4
|
* Returns T if processing succeeds, undefined for empty/null values, throws descriptive errors for invalid values.
|
|
5
|
-
* Used by environment variable schemas to convert
|
|
5
|
+
* Used by environment variable schemas to convert values to their target types.
|
|
6
6
|
*/
|
|
7
|
-
type Processor<T> = (value:
|
|
7
|
+
type Processor<T> = (value: unknown) => T | undefined;
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region ../core/src/types/EnvVarType.d.ts
|
|
10
10
|
type EnvVarType = "string" | "number" | "boolean" | "enum";
|
|
@@ -15,6 +15,7 @@ interface EnvVarSchemaInput<T> {
|
|
|
15
15
|
required?: boolean;
|
|
16
16
|
default?: T;
|
|
17
17
|
description?: string;
|
|
18
|
+
link?: string;
|
|
18
19
|
}
|
|
19
20
|
//#endregion
|
|
20
21
|
//#region ../core/src/schemas/EnvVarSchemaBase.d.ts
|
|
@@ -23,6 +24,7 @@ declare abstract class EnvVarSchemaBase<T> {
|
|
|
23
24
|
readonly required: boolean;
|
|
24
25
|
readonly default?: T;
|
|
25
26
|
readonly description?: string;
|
|
27
|
+
readonly link?: string;
|
|
26
28
|
readonly process: Processor<T>;
|
|
27
29
|
constructor(input: EnvVarSchemaInput<T>);
|
|
28
30
|
}
|
package/dist/channels.cjs
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
const require_resolveChannel = require(
|
|
3
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_resolveChannel = require("./resolveChannel-DxZNYdDe.cjs");
|
|
4
3
|
exports.DefaultEnvChannel = require_resolveChannel.DefaultEnvChannel;
|
|
5
4
|
exports.DotEnvChannel = require_resolveChannel.DotEnvChannel;
|
|
6
5
|
exports.DotEnvXChannel = require_resolveChannel.DotEnvXChannel;
|
|
7
6
|
exports.ProcessEnvChannel = require_resolveChannel.ProcessEnvChannel;
|
|
8
|
-
exports.resolveChannel = require_resolveChannel.resolveChannel;
|
|
7
|
+
exports.resolveChannel = require_resolveChannel.resolveChannel;
|
package/dist/channels.d.cts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { a as DotEnvXChannelConfig, c as DotEnvXInstance, d as DotEnvConfigOutput, f as DotEnvInstance, i as DefaultChannelConfig, l as DotEnvChannelConfig, n as ProcessChannelConfig, o as DotEnvXSetOptions, p as DotEnvParseOptions, r as ProcessEnvChannelConfig, s as DotEnvXGetOptions, t as EnvChannelOptions, u as DotEnvConfigOptions } from "./EnvChannelOptions-
|
|
2
|
-
import { t as EnvChannel } from "./EnvChannel-
|
|
3
|
-
import { i as resolveChannel, n as DotEnvXChannel, r as DefaultEnvChannel, t as ProcessEnvChannel } from "./ProcessEnvChannel-
|
|
4
|
-
|
|
1
|
+
import { a as DotEnvXChannelConfig, c as DotEnvXInstance, d as DotEnvConfigOutput, f as DotEnvInstance, i as DefaultChannelConfig, l as DotEnvChannelConfig, n as ProcessChannelConfig, o as DotEnvXSetOptions, p as DotEnvParseOptions, r as ProcessEnvChannelConfig, s as DotEnvXGetOptions, t as EnvChannelOptions, u as DotEnvConfigOptions } from "./EnvChannelOptions-BbKeuO-o.cjs";
|
|
2
|
+
import { t as EnvChannel } from "./EnvChannel-CfSwa_25.cjs";
|
|
3
|
+
import { i as resolveChannel, n as DotEnvXChannel, r as DefaultEnvChannel, t as ProcessEnvChannel } from "./ProcessEnvChannel-DWHPZePe.cjs";
|
|
5
4
|
//#region ../channels/src/channels/dotenv/DotEnvChannel.d.ts
|
|
6
5
|
declare class DotEnvChannel implements EnvChannel {
|
|
7
6
|
private readonly dotenv;
|
package/dist/channels.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { a as DotEnvXChannelConfig, c as DotEnvXInstance, d as DotEnvConfigOutput, f as DotEnvInstance, i as DefaultChannelConfig, l as DotEnvChannelConfig, n as ProcessChannelConfig, o as DotEnvXSetOptions, p as DotEnvParseOptions, r as ProcessEnvChannelConfig, s as DotEnvXGetOptions, t as EnvChannelOptions, u as DotEnvConfigOptions } from "./EnvChannelOptions-
|
|
2
|
-
import { t as EnvChannel } from "./EnvChannel-
|
|
3
|
-
import { i as resolveChannel, n as DotEnvXChannel, r as DefaultEnvChannel, t as ProcessEnvChannel } from "./ProcessEnvChannel-
|
|
4
|
-
|
|
1
|
+
import { a as DotEnvXChannelConfig, c as DotEnvXInstance, d as DotEnvConfigOutput, f as DotEnvInstance, i as DefaultChannelConfig, l as DotEnvChannelConfig, n as ProcessChannelConfig, o as DotEnvXSetOptions, p as DotEnvParseOptions, r as ProcessEnvChannelConfig, s as DotEnvXGetOptions, t as EnvChannelOptions, u as DotEnvConfigOptions } from "./EnvChannelOptions-BbKeuO-o.js";
|
|
2
|
+
import { t as EnvChannel } from "./EnvChannel-CfSwa_25.js";
|
|
3
|
+
import { i as resolveChannel, n as DotEnvXChannel, r as DefaultEnvChannel, t as ProcessEnvChannel } from "./ProcessEnvChannel-CwhV7_EB.js";
|
|
5
4
|
//#region ../channels/src/channels/dotenv/DotEnvChannel.d.ts
|
|
6
5
|
declare class DotEnvChannel implements EnvChannel {
|
|
7
6
|
private readonly dotenv;
|
package/dist/channels.js
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export { DefaultEnvChannel, DotEnvChannel, DotEnvXChannel, ProcessEnvChannel, resolveChannel };
|
|
1
|
+
import { a as DefaultEnvChannel, i as DotEnvXChannel, n as DotEnvChannel, r as ProcessEnvChannel, t as resolveChannel } from "./resolveChannel-D1Fzl4TL.js";
|
|
2
|
+
export { DefaultEnvChannel, DotEnvChannel, DotEnvXChannel, ProcessEnvChannel, resolveChannel };
|