@e-n-v/env 0.0.2 → 0.0.5

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 (99) hide show
  1. package/README.md +43 -24
  2. package/dist/BooleanMap-B2eIP3tZ.d.cts +32 -0
  3. package/dist/BooleanMap-DmFnCA-O.d.ts +32 -0
  4. package/dist/EnvChannel-LMIRYvT1.d.cts +16 -0
  5. package/dist/EnvChannel-w27PEm7x.d.ts +16 -0
  6. package/dist/EnvChannelOptions-BPkWDrmr.d.cts +108 -0
  7. package/dist/EnvChannelOptions-CRwDLWjd.d.ts +108 -0
  8. package/dist/EnvModel-CrGclUpJ.d.cts +134 -0
  9. package/dist/EnvModel-D8rt0EJ6.d.ts +134 -0
  10. package/dist/EnvSource-BVnmdHku.cjs +420 -0
  11. package/dist/EnvSource-DA3ZGlES.js +400 -0
  12. package/dist/ProcessEnvChannel-D465c-dp.d.cts +97 -0
  13. package/dist/ProcessEnvChannel-Do4-yiLI.d.ts +97 -0
  14. package/dist/StringEnvVarSchema-B8MT7htU.d.ts +64 -0
  15. package/dist/StringEnvVarSchema-BF6C0nyT.d.cts +64 -0
  16. package/dist/channels.cjs +8 -0
  17. package/dist/channels.d.cts +20 -0
  18. package/dist/channels.d.ts +20 -0
  19. package/dist/channels.js +4 -0
  20. package/dist/chunk-pbleEpgJ.cjs +44 -0
  21. package/dist/cli.cjs +16 -10
  22. package/dist/cli.js +7 -2
  23. package/dist/coerce-DNIuYAx4.js +11028 -0
  24. package/dist/coerce-b7UVodS9.cjs +12365 -0
  25. package/dist/core.cjs +68 -0
  26. package/dist/core.d.cts +6 -0
  27. package/dist/core.d.ts +6 -0
  28. package/dist/core.js +40 -0
  29. package/dist/custom-Bt_wnxIu.js +114 -0
  30. package/dist/custom-D_Rqjm09.cjs +168 -0
  31. package/dist/files.cjs +18 -0
  32. package/dist/files.d.cts +38 -0
  33. package/dist/files.d.ts +38 -0
  34. package/dist/files.js +13 -0
  35. package/dist/index-D8pslhp4.d.cts +170 -0
  36. package/dist/index-Dq_0aeAL.d.ts +170 -0
  37. package/dist/model-Dic8IJsf.d.ts +29 -0
  38. package/dist/model-ft0WhSSS.d.cts +29 -0
  39. package/dist/model.cjs +14 -0
  40. package/dist/model.d.cts +35 -0
  41. package/dist/model.d.ts +35 -0
  42. package/dist/model.js +9 -0
  43. package/dist/parse-BT1QSa5e.d.cts +28 -0
  44. package/dist/parse-DwtLpVhC.d.ts +28 -0
  45. package/dist/parse.cjs +17 -0
  46. package/dist/parse.d.cts +52 -0
  47. package/dist/parse.d.ts +52 -0
  48. package/dist/parse.js +10 -0
  49. package/dist/prompt-C5WudV9x.d.cts +74 -0
  50. package/dist/prompt-yKdccbtZ.d.ts +74 -0
  51. package/dist/prompt.cjs +24 -0
  52. package/dist/prompt.d.cts +17 -0
  53. package/dist/prompt.d.ts +17 -0
  54. package/dist/prompt.js +12 -0
  55. package/dist/redis-CJOpRPjc.js +395 -0
  56. package/dist/redis-EcC7TX3K.cjs +611 -0
  57. package/dist/resolveChannel-CjAuxy3p.cjs +257 -0
  58. package/dist/resolveChannel-v9BDsw-M.js +224 -0
  59. package/dist/root.cjs +36 -0
  60. package/dist/root.d.cts +21 -0
  61. package/dist/root.d.ts +21 -0
  62. package/dist/root.js +21 -0
  63. package/dist/schema-DH4GiW9A.d.cts +18 -0
  64. package/dist/schema-jN4EtvEP.d.ts +18 -0
  65. package/dist/schemas/zod.cjs +629 -0
  66. package/dist/schemas/zod.d.cts +239 -0
  67. package/dist/schemas/zod.d.ts +239 -0
  68. package/dist/schemas/zod.js +550 -0
  69. package/dist/schemas.cjs +133 -0
  70. package/dist/schemas.d.cts +3 -0
  71. package/dist/schemas.d.ts +3 -0
  72. package/dist/schemas.js +6 -0
  73. package/dist/src-B7FG1rak.js +638 -0
  74. package/dist/src-BBwjK5SK.js +127 -0
  75. package/dist/src-CLTURaoo.js +311 -0
  76. package/dist/src-CVdUqK3q.js +850 -0
  77. package/dist/src-Cjo2XA4n.cjs +138 -0
  78. package/dist/{src-oetJm-nZ.cjs → src-DWYoqPX1.cjs} +31 -1964
  79. package/dist/src-DZmpNGrQ.cjs +1411 -0
  80. package/dist/{src-RlCvrI0s.js → src-Dtv7TlJx.js} +14 -1726
  81. package/dist/src-XjL5cyPG.cjs +873 -0
  82. package/dist/src-meUnCASg.cjs +413 -0
  83. package/dist/validate-BxA3a-ns.d.cts +203 -0
  84. package/dist/validate-CyxrRacF.d.ts +203 -0
  85. package/dist/vars-BNVI6k89.d.ts +21 -0
  86. package/dist/vars-CYOaskkK.cjs +27 -0
  87. package/dist/vars-CptZRPX5.d.cts +21 -0
  88. package/dist/vars-DOW0LiiN.js +22 -0
  89. package/dist/vars.cjs +138 -0
  90. package/dist/vars.d.cts +7 -0
  91. package/dist/vars.d.ts +7 -0
  92. package/dist/vars.js +9 -0
  93. package/package.json +58 -9
  94. package/assets/demo.gif +0 -0
  95. package/assets/env-logo.png +0 -0
  96. package/dist/bundle.cjs +0 -1290
  97. package/dist/bundle.d.cts +0 -1057
  98. package/dist/bundle.d.ts +0 -1055
  99. package/dist/bundle.js +0 -1244
package/dist/bundle.js DELETED
@@ -1,1244 +0,0 @@
1
- import { t as __export } from "./chunk-Bp6m_JJh.js";
2
- import { A as set, C as EnvVarSchemaBase, D as DotEnvChannel, E as DotEnvXChannel, O as DefaultEnvChannel, S as stringProcessor, T as ProcessEnvChannel, _ as BooleanEnvVarSchema, a as resolveSchema, b as numberProcessor, c as booleanPreprocessor, d as preprocessors, f as stringPreprocessor, g as EnumEnvVarSchema, h as NumberEnvVarSchema, i as EnvModel, j as get, k as EnvSource, l as enumPreprocessor, m as StringEnvVarSchema, n as defaults_exports, o as resolveSchemas, p as isEnvVarSchema, r as define, s as resolvePreprocessor, t as prompt, u as numberPreprocessor, v as booleanProcessor, w as resolveChannel, x as processors, y as enumProcessor } from "./src-RlCvrI0s.js";
3
- import { z } from "zod";
4
-
5
- //#region ../files/src/source.ts
6
- function source(filePath) {
7
- return new EnvSource(filePath);
8
- }
9
-
10
- //#endregion
11
- //#region ../core/src/schema.ts
12
- const schema = {
13
- string: (input = {}) => new StringEnvVarSchema(input),
14
- number: (input = {}) => new NumberEnvVarSchema(input),
15
- boolean: (input = {}) => new BooleanEnvVarSchema(input),
16
- enum: (input) => new EnumEnvVarSchema(input)
17
- };
18
- const s = schema;
19
-
20
- //#endregion
21
- //#region ../parse/src/errors/EnvParseError.ts
22
- /**
23
- * Error thrown when parsing environment variables fails.
24
- * Collects all issues so callers can inspect them without relying on subclasses.
25
- */
26
- var EnvParseError = class EnvParseError extends Error {
27
- issues;
28
- partial;
29
- constructor(params) {
30
- const { issues, partial } = params;
31
- super(EnvParseError.formatMessage(issues));
32
- this.name = "EnvParseError";
33
- this.issues = Object.freeze([...issues]);
34
- this.partial = partial ?? {};
35
- }
36
- /** Number of issues encountered while parsing. */
37
- get issueCount() {
38
- return this.issues.length;
39
- }
40
- /** Keys that were missing but required. */
41
- get missing() {
42
- return this.issues.filter((issue) => issue.type === "missing").map((issue) => issue.key);
43
- }
44
- /** Keys that were present but invalid. */
45
- get invalid() {
46
- return this.issues.filter((issue) => issue.type === "invalid").map((issue) => issue.key);
47
- }
48
- /**
49
- * Get all issue messages as a numbered list for easy logging.
50
- */
51
- formatIssues() {
52
- return this.issues.map((issue, index) => `${index + 1}. ${issue.message}`).join("\n");
53
- }
54
- static formatMessage(issues) {
55
- if (issues.length === 0) return "Environment validation failed with no details.";
56
- return [`Environment validation failed with ${issues.length} issue${issues.length === 1 ? "" : "s"}:`, ...issues.map((issue) => {
57
- if (issue.type === "missing") return `- ${issue.key}: ${issue.message}`;
58
- return `- ${issue.key}: ${issue.message}`;
59
- })].join("\n");
60
- }
61
- };
62
-
63
- //#endregion
64
- //#region ../parse/src/parse.ts
65
- /**
66
- * Parse and validate environment variables from a source object
67
- * Does NOT mutate process.env
68
- */
69
- function parse(source$1, modelOrOptions) {
70
- let resolvedSchemas;
71
- let preprocessConfig;
72
- if (modelOrOptions instanceof EnvModel) {
73
- const model = modelOrOptions;
74
- resolvedSchemas = model.schemas;
75
- preprocessConfig = model.preprocess;
76
- } else {
77
- const options = modelOrOptions;
78
- resolvedSchemas = resolveSchemas(options.schemas);
79
- const config = options.preprocess;
80
- if (config === false) preprocessConfig = {
81
- string: false,
82
- number: false,
83
- boolean: false,
84
- enum: false
85
- };
86
- else if (config === true || config === void 0) preprocessConfig = {};
87
- else preprocessConfig = { ...config };
88
- }
89
- const result = {};
90
- const issues = [];
91
- for (const [key, schema$1] of Object.entries(resolvedSchemas)) {
92
- const rawValue = source$1[key];
93
- if (rawValue === void 0 || rawValue.trim() === "") {
94
- if (schema$1.default !== void 0) {
95
- result[key] = schema$1.default;
96
- continue;
97
- }
98
- if (schema$1.required) {
99
- issues.push({
100
- type: "missing",
101
- key,
102
- message: `Required environment variable "${key}" is missing`
103
- });
104
- result[key] = void 0;
105
- continue;
106
- }
107
- result[key] = void 0;
108
- continue;
109
- }
110
- const preprocessor = resolvePreprocessor(schema$1.type, preprocessConfig);
111
- const preprocessedValue = preprocessor ? preprocessor(rawValue) : rawValue;
112
- const stringValue = typeof preprocessedValue === "string" ? preprocessedValue : String(preprocessedValue);
113
- try {
114
- const processedValue = schema$1.process(stringValue);
115
- if (processedValue === void 0) if (schema$1.default !== void 0) result[key] = schema$1.default;
116
- else if (schema$1.required) {
117
- issues.push({
118
- type: "missing",
119
- key,
120
- message: `Required environment variable "${key}" is missing`
121
- });
122
- result[key] = void 0;
123
- } else result[key] = void 0;
124
- else result[key] = processedValue;
125
- } catch (error) {
126
- const message = `Environment variable "${key}" validation failed: ${error instanceof Error ? error.message : String(error)}`;
127
- issues.push({
128
- type: "invalid",
129
- key,
130
- value: rawValue,
131
- message
132
- });
133
- result[key] = void 0;
134
- }
135
- }
136
- if (issues.length > 0) throw new EnvParseError({
137
- issues,
138
- partial: { ...result }
139
- });
140
- return result;
141
- }
142
-
143
- //#endregion
144
- //#region ../schemas/src/helpers/createZodProcesor.ts
145
- /**
146
- * Creates a process function from a Zod schema for use with EnvVarSchema constructors.
147
- *
148
- * This helper is specifically for the @e-n-v/schemas package to create process functions
149
- * that can be passed to StringEnvVarSchema, NumberEnvVarSchema, etc. constructors.
150
- *
151
- * The schema itself defines the validation and type conversion logic. For environment
152
- * variables that need coercion from strings, use z.coerce.number() or z.coerce.boolean().
153
- *
154
- * @param schema - The Zod schema to convert
155
- * @returns A process function that can be used in EnvVarSchema constructors
156
- *
157
- * @example
158
- * ```typescript
159
- * // String validation
160
- * new StringEnvVarSchema({
161
- * process: createZodProcessor(z.string().email()),
162
- * description: "Email address",
163
- * });
164
- *
165
- * // Number with coercion
166
- * new NumberEnvVarSchema({
167
- * process: createZodProcessor(z.coerce.number().min(0)),
168
- * description: "Port number",
169
- * });
170
- *
171
- * // Boolean with coercion
172
- * new BooleanEnvVarSchema({
173
- * process: createZodProcessor(z.coerce.boolean()),
174
- * description: "Feature flag",
175
- * });
176
- * ```
177
- */
178
- function createZodProcessor(schema$1) {
179
- return (value) => {
180
- const result = z.safeParse(schema$1, value);
181
- if (result.success) return result.data;
182
- throw new Error(result.error.issues.map((issue) => issue.message).join("; "));
183
- };
184
- }
185
-
186
- //#endregion
187
- //#region ../schemas/src/shared/messages.ts
188
- const COMMON_MESSAGES = { MUST_BE_VALID_URL: "Must be a valid URL" };
189
-
190
- //#endregion
191
- //#region ../schemas/src/shared/apiService.ts
192
- const descriptions$4 = {
193
- apiKey: "API key for external service",
194
- jwtSecret: "JWT secret key for token signing",
195
- jwtAccessTokenExpiresIn: "JWT access token expiration (e.g., '15m', '1h', '1d')",
196
- jwtRefreshTokenExpiresIn: "JWT refresh token expiration (e.g., '7d', '30d')",
197
- apiBaseUrl: "Base URL for API service",
198
- serviceUrl: "Service URL",
199
- webhookUrl: "Webhook URL for receiving callbacks",
200
- encryptionKey: "Encryption key for data encryption",
201
- sessionSecret: "Session secret for cookie signing",
202
- corsOrigin: "CORS allowed origins (comma-separated URLs or '*')",
203
- rateLimitRpm: "Rate limit: requests per minute",
204
- rateLimitWindow: "Rate limit window size in minutes",
205
- apiTimeout: "API request timeout (milliseconds)",
206
- maxFileSize: "Maximum file upload size (bytes)",
207
- logLevel: "Application log level",
208
- nodeEnv: "Node.js environment",
209
- port: "Server port number",
210
- host: "Server host address"
211
- };
212
- const messages$4 = {
213
- apiKeyMin: "API key must be at least 8 characters long",
214
- jwtSecretMin: "JWT secret must be at least 32 characters long for security",
215
- jwtDurationFormat: "Must be in format like '15m', '1h', '7d'",
216
- mustBeValidUrl: COMMON_MESSAGES.MUST_BE_VALID_URL,
217
- httpProtocolRequired: "Must start with http:// or https://",
218
- httpsProtocolRequired: "Webhook URLs should use HTTPS for security",
219
- encryptionKeyMin: "Encryption key must be at least 32 characters long",
220
- sessionSecretMin: "Session secret must be at least 32 characters long for security",
221
- corsOriginInvalid: "Must be '*' or comma-separated valid URLs",
222
- rateLimitRpmInt: "Rate limit must be an integer",
223
- rateLimitRpmMin: "Rate limit must be at least 1",
224
- rateLimitRpmMax: "Rate limit should not exceed 10,000",
225
- rateLimitWindowInt: "Rate limit window must be an integer",
226
- rateLimitWindowMin: "Rate limit window must be at least 1 minute",
227
- rateLimitWindowMax: "Rate limit window should not exceed 60 minutes",
228
- apiTimeoutInt: "Timeout must be an integer",
229
- apiTimeoutMin: "Timeout must be at least 1 second",
230
- apiTimeoutMax: "Timeout should not exceed 5 minutes",
231
- maxFileSizeInt: "File size must be an integer",
232
- maxFileSizeMin: "File size must be at least 1KB",
233
- maxFileSizeMax: "File size should not exceed 1GB",
234
- portInt: "Port must be an integer",
235
- portMin: "Port must be >= 1024 (avoid reserved ports)",
236
- portMax: "Port must be <= 65535"
237
- };
238
- const constraints$4 = {
239
- apiKeyMinLength: 8,
240
- jwtSecretMinLength: 32,
241
- encryptionKeyMinLength: 32,
242
- sessionSecretMinLength: 32,
243
- rateLimitRpmMin: 1,
244
- rateLimitRpmMax: 1e4,
245
- rateLimitWindowMin: 1,
246
- rateLimitWindowMax: 60,
247
- apiTimeoutMin: 1e3,
248
- apiTimeoutMax: 3e5,
249
- maxFileSizeMin: 1024,
250
- maxFileSizeMax: 1073741824,
251
- portMin: 1024,
252
- portMax: 65535
253
- };
254
- const defaults$2 = {
255
- jwtAccessTokenExpiresIn: "15m",
256
- jwtRefreshTokenExpiresIn: "7d",
257
- rateLimitRpm: 60,
258
- rateLimitWindow: 1,
259
- apiTimeout: 3e4,
260
- maxFileSize: 10485760,
261
- logLevel: "info",
262
- nodeEnv: "development",
263
- port: 3e3,
264
- host: "localhost"
265
- };
266
- const enumOptions = {
267
- logLevel: [
268
- "error",
269
- "warn",
270
- "info",
271
- "debug",
272
- "trace"
273
- ],
274
- nodeEnv: [
275
- "development",
276
- "production",
277
- "test",
278
- "staging"
279
- ]
280
- };
281
- const patterns$3 = {
282
- jwtTokenDuration: /^\d+[smhd]$/,
283
- httpProtocol: /^https?:\/\//,
284
- httpsProtocol: /^https:\/\//
285
- };
286
-
287
- //#endregion
288
- //#region ../schemas/src/plain/api.ts
289
- const apiKey = (input = {}) => new StringEnvVarSchema({
290
- description: descriptions$4.apiKey,
291
- process: createZodProcessor(z.string().min(constraints$4.apiKeyMinLength, { message: messages$4.apiKeyMin })),
292
- ...input
293
- });
294
- const apiBaseUrl = (input = {}) => new StringEnvVarSchema({
295
- description: descriptions$4.apiBaseUrl,
296
- process: createZodProcessor(z.string().url({ message: "Must be a valid URL" }).refine((url) => patterns$3.httpProtocol.test(url), { message: messages$4.httpProtocolRequired })),
297
- ...input
298
- });
299
- const apiTimeout = (input = {}) => new NumberEnvVarSchema({
300
- description: descriptions$4.apiTimeout,
301
- default: defaults$2.apiTimeout,
302
- process: createZodProcessor(z.coerce.number().int({ message: messages$4.apiTimeoutInt }).min(constraints$4.apiTimeoutMin, { message: messages$4.apiTimeoutMin }).max(constraints$4.apiTimeoutMax, { message: messages$4.apiTimeoutMax })),
303
- ...input
304
- });
305
- const API_KEY = apiKey();
306
- const API_BASE_URL = apiBaseUrl();
307
- const API_TIMEOUT = apiTimeout();
308
-
309
- //#endregion
310
- //#region ../schemas/src/shared/infrastructure.ts
311
- const descriptions$1 = {
312
- azureStorageConnectionString: "Azure Storage Account connection string",
313
- azureStorageAccountName: "Azure Storage Account name",
314
- azureStorageAccountKey: "Azure Storage Account key",
315
- azureServiceBusConnectionString: "Azure Service Bus connection string",
316
- azureEventHubConnectionString: "Azure Event Hub connection string",
317
- awsSqsQueueUrl: "AWS SQS queue URL",
318
- awsRegion: "AWS region",
319
- awsAccessKeyId: "AWS access key ID",
320
- awsSecretAccessKey: "AWS secret access key",
321
- awsS3BucketName: "AWS S3 bucket name",
322
- elasticsearchUrl: "Elasticsearch/OpenSearch URL",
323
- elasticsearchUsername: "Elasticsearch username",
324
- elasticsearchPassword: "Elasticsearch password",
325
- rabbitmqUrl: "RabbitMQ connection URL",
326
- kafkaBrokers: "Kafka broker list (comma-separated host:port)",
327
- kafkaClientId: "Kafka client ID",
328
- memcachedServers: "Memcached servers (comma-separated host:port)",
329
- dockerRegistryUrl: "Docker registry URL",
330
- dockerRegistryUsername: "Docker registry username",
331
- dockerRegistryPassword: "Docker registry password or access token",
332
- kubernetesNamespace: "Kubernetes namespace",
333
- kubernetesServiceAccount: "Kubernetes service account",
334
- prometheusPort: "Prometheus metrics port",
335
- jaegerEndpoint: "Jaeger tracing endpoint URL",
336
- newRelicLicenseKey: "New Relic license key",
337
- datadogApiKey: "Datadog API key",
338
- sentryDsn: "Sentry DSN for error tracking"
339
- };
340
- const messages$1 = {
341
- azureStorageConnectionStringFormat: "Must be a valid Azure Storage connection string",
342
- azureStorageAccountNameFormat: "Storage account name must be 3-24 characters, lowercase letters and numbers only",
343
- azureStorageAccountKeyRequired: "Storage account key is required",
344
- azureServiceBusConnectionStringFormat: "Must be a valid Azure Service Bus connection string",
345
- azureEventHubConnectionStringFormat: "Must be a valid Azure Event Hub connection string",
346
- awsSqsQueueUrlFormat: "Must be a valid AWS SQS queue URL",
347
- awsRegionFormat: "Must be a valid AWS region format (e.g., us-east-1)",
348
- awsAccessKeyIdMin: "AWS access key ID must be at least 16 characters",
349
- awsAccessKeyIdMax: "AWS access key ID must be less than 128 characters",
350
- awsSecretAccessKeyRequired: "AWS secret access key is required",
351
- awsS3BucketNameFormat: "S3 bucket names must be 3-63 characters, lowercase letters, numbers, and hyphens only",
352
- elasticsearchUrlFormat: COMMON_MESSAGES.MUST_BE_VALID_URL,
353
- elasticsearchUrlProtocol: "Must start with http:// or https://",
354
- rabbitmqUrlFormat: "Must be a valid RabbitMQ URL (amqp:// or amqps://...)",
355
- hostPortListFormat: "Must be comma-separated list of host:port (e.g., localhost:9092,broker2:9092)",
356
- kafkaClientIdRequired: "Kafka client ID is required",
357
- dockerRegistryUrlFormat: COMMON_MESSAGES.MUST_BE_VALID_URL,
358
- kubernetesNameFormat: "Must be a valid Kubernetes namespace name",
359
- kubernetesServiceAccountFormat: "Must be a valid Kubernetes service account name",
360
- prometheusPortInt: "Port must be an integer",
361
- prometheusPortMin: "Port must be >= 1024",
362
- prometheusPortMax: "Port must be <= 65535",
363
- jaegerEndpointFormat: COMMON_MESSAGES.MUST_BE_VALID_URL,
364
- newRelicLicenseKeyLength: "New Relic license key must be exactly 40 characters",
365
- datadogApiKeyLength: "Datadog API key must be exactly 32 characters",
366
- sentryDsnFormat: "Must be a valid Sentry DSN format"
367
- };
368
- const defaults$3 = {
369
- kubernetesNamespace: "default",
370
- prometheusPort: 9090
371
- };
372
- const constraints$3 = {
373
- awsAccessKeyIdMin: 16,
374
- awsAccessKeyIdMax: 128,
375
- prometheusPortMin: 1024,
376
- prometheusPortMax: 65535,
377
- newRelicLicenseKeyLength: 40,
378
- datadogApiKeyLength: 32
379
- };
380
- const patterns$1 = {
381
- awsRegion: /^[a-z]{2}-[a-z]+-\d{1}$/,
382
- awsS3BucketName: /^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$/,
383
- awsSqsQueueUrl: /^https:\/\/sqs\.[^.]+\.amazonaws\.com\/\d+\/[^/]+$/,
384
- azureStorageConnectionString: /^DefaultEndpointsProtocol=https;AccountName=[^;]+;AccountKey=[^;]+;EndpointSuffix=.+$/,
385
- azureStorageAccountName: /^[a-z0-9]{3,24}$/,
386
- azureServiceBusConnectionString: /^Endpoint=sb:\/\/[^;]+;SharedAccessKeyName=[^;]+;SharedAccessKey=.+$/,
387
- azureEventHubConnectionString: /^Endpoint=sb:\/\/[^;]+;SharedAccessKeyName=[^;]+;SharedAccessKey=.+$/,
388
- hostPortList: /^[a-zA-Z0-9.-]+:\d+(,[a-zA-Z0-9.-]+:\d+)*$/,
389
- rabbitmqUrl: /^amqps?:\/\/(?:[^:@/]+(?::[^@/]*)?@)?[^:/]+(?::\d+)?(?:\/.*)?$/,
390
- kubernetesName: /^[a-z0-9]([-a-z0-9]*[a-z0-9])?$/,
391
- sentryDsn: /^https:\/\/[a-f0-9]+@[a-f0-9]+\.ingest\.sentry\.io\/\d+$/
392
- };
393
-
394
- //#endregion
395
- //#region ../schemas/src/plain/aws.ts
396
- const awsAccessKeyId = (input = {}) => new StringEnvVarSchema({
397
- description: descriptions$1.awsAccessKeyId,
398
- process: createZodProcessor(z.string().min(constraints$3.awsAccessKeyIdMin, { message: messages$1.awsAccessKeyIdMin }).max(constraints$3.awsAccessKeyIdMax, { message: messages$1.awsAccessKeyIdMax })),
399
- secret: true,
400
- ...input
401
- });
402
- const awsSecretAccessKey = (input = {}) => new StringEnvVarSchema({
403
- description: descriptions$1.awsSecretAccessKey,
404
- process: createZodProcessor(z.string().min(1, { message: messages$1.awsSecretAccessKeyRequired })),
405
- secret: true,
406
- ...input
407
- });
408
- const awsRegion = (input = {}) => new StringEnvVarSchema({
409
- description: descriptions$1.awsRegion,
410
- process: createZodProcessor(z.string().regex(patterns$1.awsRegion, { message: messages$1.awsRegionFormat })),
411
- ...input
412
- });
413
- const awsS3BucketName = (input = {}) => new StringEnvVarSchema({
414
- description: descriptions$1.awsS3BucketName,
415
- process: createZodProcessor(z.string().regex(patterns$1.awsS3BucketName, { message: messages$1.awsS3BucketNameFormat })),
416
- ...input
417
- });
418
- const awsSqsQueueUrl = (input = {}) => new StringEnvVarSchema({
419
- description: descriptions$1.awsSqsQueueUrl,
420
- process: createZodProcessor(z.string().regex(patterns$1.awsSqsQueueUrl, { message: messages$1.awsSqsQueueUrlFormat })),
421
- ...input
422
- });
423
- const AWS_ACCESS_KEY_ID = awsAccessKeyId();
424
- const AWS_SECRET_ACCESS_KEY = awsSecretAccessKey();
425
- const AWS_REGION = awsRegion();
426
- const AWS_S3_BUCKET_NAME = awsS3BucketName();
427
- const AWS_SQS_QUEUE_URL = awsSqsQueueUrl();
428
- const aws = {
429
- AWS_ACCESS_KEY_ID,
430
- AWS_SECRET_ACCESS_KEY,
431
- AWS_REGION,
432
- AWS_S3_BUCKET_NAME,
433
- AWS_SQS_QUEUE_URL
434
- };
435
-
436
- //#endregion
437
- //#region ../schemas/src/plain/azure.ts
438
- const azureStorageConnectionString = (input = {}) => new StringEnvVarSchema({
439
- description: descriptions$1.azureStorageConnectionString,
440
- process: createZodProcessor(z.string().regex(patterns$1.azureStorageConnectionString, { message: messages$1.azureStorageConnectionStringFormat })),
441
- secret: true,
442
- ...input
443
- });
444
- const azureStorageAccountName = (input = {}) => new StringEnvVarSchema({
445
- description: descriptions$1.azureStorageAccountName,
446
- process: createZodProcessor(z.string().regex(patterns$1.azureStorageAccountName, { message: messages$1.azureStorageAccountNameFormat })),
447
- ...input
448
- });
449
- const azureStorageAccountKey = (input = {}) => new StringEnvVarSchema({
450
- description: descriptions$1.azureStorageAccountKey,
451
- process: createZodProcessor(z.string().min(1, { message: messages$1.azureStorageAccountKeyRequired })),
452
- secret: true,
453
- ...input
454
- });
455
- const azureServiceBusConnectionString = (input = {}) => new StringEnvVarSchema({
456
- description: descriptions$1.azureServiceBusConnectionString,
457
- process: createZodProcessor(z.string().regex(patterns$1.azureServiceBusConnectionString, { message: messages$1.azureServiceBusConnectionStringFormat })),
458
- secret: true,
459
- ...input
460
- });
461
- const azureEventHubConnectionString = (input = {}) => new StringEnvVarSchema({
462
- description: descriptions$1.azureEventHubConnectionString,
463
- process: createZodProcessor(z.string().regex(patterns$1.azureEventHubConnectionString, { message: messages$1.azureEventHubConnectionStringFormat })),
464
- secret: true,
465
- ...input
466
- });
467
- const AZURE_STORAGE_CONNECTION_STRING = azureStorageConnectionString();
468
- const AZURE_STORAGE_ACCOUNT_NAME = azureStorageAccountName();
469
- const AZURE_STORAGE_ACCOUNT_KEY = azureStorageAccountKey();
470
- const AZURE_SERVICE_BUS_CONNECTION_STRING = azureServiceBusConnectionString();
471
- const AZURE_EVENT_HUB_CONNECTION_STRING = azureEventHubConnectionString();
472
- const azure = {
473
- AZURE_STORAGE_CONNECTION_STRING,
474
- AZURE_STORAGE_ACCOUNT_NAME,
475
- AZURE_STORAGE_ACCOUNT_KEY,
476
- AZURE_SERVICE_BUS_CONNECTION_STRING,
477
- AZURE_EVENT_HUB_CONNECTION_STRING
478
- };
479
-
480
- //#endregion
481
- //#region ../schemas/src/plain/common.ts
482
- const port = (input = {}) => new NumberEnvVarSchema({
483
- description: descriptions$4.port,
484
- default: defaults$2.port,
485
- process: createZodProcessor(z.coerce.number().int({ message: messages$4.portInt }).min(constraints$4.portMin, { message: messages$4.portMin }).max(constraints$4.portMax, { message: messages$4.portMax })),
486
- ...input
487
- });
488
- const PORT = port();
489
-
490
- //#endregion
491
- //#region ../schemas/src/plain/cors.ts
492
- const corsOrigin = (input = {}) => new StringEnvVarSchema({
493
- description: descriptions$4.corsOrigin,
494
- process: createZodProcessor(z.string().refine((val) => {
495
- if (val === "*") return true;
496
- return val.split(",").map((origin) => origin.trim()).every((origin) => {
497
- try {
498
- new URL(origin);
499
- return true;
500
- } catch {
501
- return false;
502
- }
503
- });
504
- }, { message: messages$4.corsOriginInvalid })),
505
- ...input
506
- });
507
- const CORS_ORIGIN = corsOrigin();
508
- const cors = { CORS_ORIGIN };
509
-
510
- //#endregion
511
- //#region ../schemas/src/shared/database.ts
512
- const descriptions$5 = {
513
- databaseUrl: "Database connection string",
514
- databaseUrlPostgresql: "PostgreSQL database connection string",
515
- databaseUrlMysql: "MySQL database connection string",
516
- databaseUrlMongodb: "MongoDB connection string",
517
- databaseUrlSqlserver: "Microsoft SQL Server connection string",
518
- redisUrl: "Redis connection string",
519
- databaseHost: "Database host address",
520
- databasePort: "Database port number",
521
- databaseName: "Database name",
522
- databaseUsername: "Database username",
523
- databasePassword: "Database password",
524
- databaseSchema: "Database schema name",
525
- databasePoolSize: "Database connection pool size",
526
- databaseTimeout: "Database connection timeout (milliseconds)",
527
- databaseSsl: "Enable SSL connection to database"
528
- };
529
- const messages$5 = {
530
- databaseUrlPostgresqlFormat: "Must be a valid PostgreSQL connection string (postgresql://...)",
531
- databaseUrlMysqlFormat: "Must be a valid MySQL connection string (mysql://...)",
532
- databaseUrlMongodbFormat: "Must be a valid MongoDB connection string (mongodb:// or mongodb+srv://...)",
533
- databaseUrlSqlserverFormat: "Must be a valid SQL Server connection string (sqlserver://... or Server=...;Database=...;...)",
534
- redisUrlFormat: "Must be a valid Redis connection string (redis:// or rediss://...)",
535
- genericDatabaseUrlFormat: "Must be a valid database connection string with supported protocol",
536
- databaseHostRequired: "Database host is required",
537
- databasePortInt: "Port must be an integer",
538
- databasePortMin: "Port must be greater than 0",
539
- databasePortMax: "Port must be less than 65536",
540
- databaseNameRequired: "Database name is required",
541
- databaseNameFormat: "Database name must contain only letters, numbers, underscores, and hyphens",
542
- databaseUsernameRequired: "Database username is required",
543
- databasePasswordRequired: "Database password is required",
544
- databaseSchemaFormat: "Schema name must contain only letters, numbers, and underscores",
545
- databasePoolSizeInt: "Pool size must be an integer",
546
- databasePoolSizeMin: "Pool size must be at least 1",
547
- databasePoolSizeMax: "Pool size should not exceed 100",
548
- databaseTimeoutInt: "Timeout must be an integer",
549
- databaseTimeoutMin: "Timeout must be at least 1 second",
550
- databaseTimeoutMax: "Timeout should not exceed 5 minutes"
551
- };
552
- const defaults$4 = {
553
- databasePoolSize: 10,
554
- databaseTimeout: 3e4,
555
- databaseSsl: true
556
- };
557
- const constraints$5 = {
558
- databasePortMin: 1,
559
- databasePortMax: 65535,
560
- databasePoolSizeMin: 1,
561
- databasePoolSizeMax: 100,
562
- databaseTimeoutMin: 1e3,
563
- databaseTimeoutMax: 3e5
564
- };
565
- const patterns$4 = {
566
- postgresUrl: /^postgresql:\/\/(?:[^:@/]+(?::[^@/]*)?@)?[^:/]+(?::\d+)?(?:\/[^?]*)?(?:\?.*)?$/,
567
- mysqlUrl: /^mysql:\/\/(?:[^:@/]+(?::[^@/]*)?@)?[^:/]+(?::\d+)?(?:\/[^?]*)?(?:\?.*)?$/,
568
- mongodbUrl: /^mongodb(?:\+srv)?:\/\/(?:[^:@/]+(?::[^@/]*)?@)?[^:/,]+(?::\d+)?(?:,[^:/,]+(?::\d+)?)*(?:\/[^?]*)?(?:\?.*)?$/,
569
- sqlserverUrlPrefix: /^sqlserver:\/\//,
570
- sqlserverServer: /Server=.+/,
571
- sqlserverDatabase: /Database=.+/,
572
- sqlserverInitialCatalog: /Initial Catalog=.+/,
573
- redisUrl: /^rediss?:\/\/(?:[^:@/]+(?::[^@/]*)?@)?[^:/]+(?::\d+)?(?:\/\d+)?(?:\?.*)?$/,
574
- genericDatabaseUrl: /^(postgresql|mysql|mongodb|mongodb\+srv|sqlserver|sqlite|oracle|redshift):\/\/.+/,
575
- databaseName: /^[a-zA-Z0-9_-]+$/,
576
- databaseSchema: /^[a-zA-Z0-9_]+$/
577
- };
578
-
579
- //#endregion
580
- //#region ../schemas/src/plain/database.ts
581
- const databaseUrl = (input = {}) => new StringEnvVarSchema({
582
- description: descriptions$5.databaseUrl,
583
- process: createZodProcessor(z.string().regex(patterns$4.genericDatabaseUrl, { message: messages$5.genericDatabaseUrlFormat })),
584
- secret: true,
585
- ...input
586
- });
587
- const databaseHost = (input = {}) => new StringEnvVarSchema({
588
- description: descriptions$5.databaseHost,
589
- process: createZodProcessor(z.string().min(1, { message: messages$5.databaseHostRequired })),
590
- ...input
591
- });
592
- const databasePort = (input = {}) => new NumberEnvVarSchema({
593
- description: descriptions$5.databasePort,
594
- process: createZodProcessor(z.coerce.number().int({ message: messages$5.databasePortInt }).min(constraints$5.databasePortMin, { message: messages$5.databasePortMin }).max(constraints$5.databasePortMax, { message: messages$5.databasePortMax })),
595
- ...input
596
- });
597
- const databaseName = (input = {}) => new StringEnvVarSchema({
598
- description: descriptions$5.databaseName,
599
- process: createZodProcessor(z.string().min(1, { message: messages$5.databaseNameRequired })),
600
- ...input
601
- });
602
- const databaseUsername = (input = {}) => new StringEnvVarSchema({
603
- description: descriptions$5.databaseUsername,
604
- process: createZodProcessor(z.string().min(1, { message: messages$5.databaseUsernameRequired })),
605
- ...input
606
- });
607
- const databasePassword = (input = {}) => new StringEnvVarSchema({
608
- description: descriptions$5.databasePassword,
609
- process: createZodProcessor(z.string().min(1, { message: messages$5.databasePasswordRequired })),
610
- secret: true,
611
- ...input
612
- });
613
- const databaseSchema = (input = {}) => new StringEnvVarSchema({
614
- description: descriptions$5.databaseSchema,
615
- process: createZodProcessor(z.string()),
616
- required: false,
617
- ...input
618
- });
619
- const databasePoolSize = (input = {}) => new NumberEnvVarSchema({
620
- description: descriptions$5.databasePoolSize,
621
- default: defaults$4.databasePoolSize,
622
- process: createZodProcessor(z.coerce.number().int({ message: messages$5.databasePoolSizeInt }).min(constraints$5.databasePoolSizeMin, { message: messages$5.databasePoolSizeMin }).max(constraints$5.databasePoolSizeMax, { message: messages$5.databasePoolSizeMax })),
623
- ...input
624
- });
625
- const databaseTimeout = (input = {}) => new NumberEnvVarSchema({
626
- description: descriptions$5.databaseTimeout,
627
- default: defaults$4.databaseTimeout,
628
- process: createZodProcessor(z.coerce.number().int({ message: messages$5.databaseTimeoutInt }).min(constraints$5.databaseTimeoutMin, { message: messages$5.databaseTimeoutMin }).max(constraints$5.databaseTimeoutMax, { message: messages$5.databaseTimeoutMax })),
629
- ...input
630
- });
631
- const databaseSsl = (input = {}) => new BooleanEnvVarSchema({
632
- description: descriptions$5.databaseSsl,
633
- default: defaults$4.databaseSsl,
634
- ...input
635
- });
636
- const DATABASE_URL = databaseUrl();
637
- const DATABASE_HOST = databaseHost();
638
- const DATABASE_PORT = databasePort();
639
- const DATABASE_NAME = databaseName();
640
- const DATABASE_USERNAME = databaseUsername();
641
- const DATABASE_PASSWORD = databasePassword();
642
- const DATABASE_SCHEMA = databaseSchema();
643
- const DATABASE_POOL_SIZE = databasePoolSize();
644
- const DATABASE_TIMEOUT = databaseTimeout();
645
- const DATABASE_SSL = databaseSsl();
646
-
647
- //#endregion
648
- //#region ../schemas/src/plain/docker.ts
649
- const dockerRegistryUrl = (input = {}) => new StringEnvVarSchema({
650
- description: descriptions$1.dockerRegistryUrl,
651
- process: createZodProcessor(z.string().url({ message: messages$1.dockerRegistryUrlFormat })),
652
- ...input
653
- });
654
- const dockerRegistryUsername = (input = {}) => new StringEnvVarSchema({
655
- description: descriptions$1.dockerRegistryUsername,
656
- process: createZodProcessor(z.string()),
657
- required: false,
658
- ...input
659
- });
660
- const dockerRegistryPassword = (input = {}) => new StringEnvVarSchema({
661
- description: descriptions$1.dockerRegistryPassword,
662
- process: createZodProcessor(z.string()),
663
- secret: true,
664
- required: false,
665
- ...input
666
- });
667
- const DOCKER_REGISTRY_URL = dockerRegistryUrl();
668
- const DOCKER_REGISTRY_USERNAME = dockerRegistryUsername();
669
- const DOCKER_REGISTRY_PASSWORD = dockerRegistryPassword();
670
- const docker = {
671
- DOCKER_REGISTRY_URL,
672
- DOCKER_REGISTRY_USERNAME,
673
- DOCKER_REGISTRY_PASSWORD
674
- };
675
-
676
- //#endregion
677
- //#region ../schemas/src/plain/elasticsearch.ts
678
- const elasticsearchUrl = (input = {}) => new StringEnvVarSchema({
679
- description: descriptions$1.elasticsearchUrl,
680
- process: createZodProcessor(z.string().url({ message: messages$1.elasticsearchUrlFormat }).regex(patterns$3.httpProtocol, { message: messages$1.elasticsearchUrlProtocol })),
681
- ...input
682
- });
683
- const elasticsearchUsername = (input = {}) => new StringEnvVarSchema({
684
- description: descriptions$1.elasticsearchUsername,
685
- process: createZodProcessor(z.string()),
686
- required: false,
687
- ...input
688
- });
689
- const elasticsearchPassword = (input = {}) => new StringEnvVarSchema({
690
- description: descriptions$1.elasticsearchPassword,
691
- process: createZodProcessor(z.string()),
692
- secret: true,
693
- required: false,
694
- ...input
695
- });
696
- const ELASTICSEARCH_URL = elasticsearchUrl();
697
- const ELASTICSEARCH_USERNAME = elasticsearchUsername();
698
- const ELASTICSEARCH_PASSWORD = elasticsearchPassword();
699
- const elasticsearch = {
700
- ELASTICSEARCH_URL,
701
- ELASTICSEARCH_USERNAME,
702
- ELASTICSEARCH_PASSWORD
703
- };
704
-
705
- //#endregion
706
- //#region ../schemas/src/plain/host.ts
707
- const host = (input = {}) => new StringEnvVarSchema({
708
- description: descriptions$4.host,
709
- default: defaults$2.host,
710
- process: createZodProcessor(z.string()),
711
- ...input
712
- });
713
- const HOST = host();
714
- const hostSchema = { HOST };
715
-
716
- //#endregion
717
- //#region ../schemas/src/plain/jwt.ts
718
- const jwtSecret = (input = {}) => new StringEnvVarSchema({
719
- description: descriptions$4.jwtSecret,
720
- process: createZodProcessor(z.string().min(constraints$4.jwtSecretMinLength, { message: messages$4.jwtSecretMin })),
721
- secret: true,
722
- ...input
723
- });
724
- const jwtAccessTokenExpiresIn = (input = {}) => new StringEnvVarSchema({
725
- description: descriptions$4.jwtAccessTokenExpiresIn,
726
- default: defaults$2.jwtAccessTokenExpiresIn,
727
- process: createZodProcessor(z.string().regex(patterns$3.jwtTokenDuration, { message: messages$4.jwtDurationFormat })),
728
- ...input
729
- });
730
- const jwtRefreshTokenExpiresIn = (input = {}) => new StringEnvVarSchema({
731
- description: descriptions$4.jwtRefreshTokenExpiresIn,
732
- default: defaults$2.jwtRefreshTokenExpiresIn,
733
- process: createZodProcessor(z.string().regex(patterns$3.jwtTokenDuration, { message: messages$4.jwtDurationFormat })),
734
- ...input
735
- });
736
- const JWT_SECRET = jwtSecret();
737
- const JWT_ACCESS_TOKEN_EXPIRES_IN = jwtAccessTokenExpiresIn();
738
- const JWT_REFRESH_TOKEN_EXPIRES_IN = jwtRefreshTokenExpiresIn();
739
- const jwt = {
740
- JWT_SECRET,
741
- JWT_ACCESS_TOKEN_EXPIRES_IN,
742
- JWT_REFRESH_TOKEN_EXPIRES_IN
743
- };
744
-
745
- //#endregion
746
- //#region ../schemas/src/plain/kafka.ts
747
- const kafkaBrokers = (input = {}) => new StringEnvVarSchema({
748
- description: descriptions$1.kafkaBrokers,
749
- process: createZodProcessor(z.string().regex(patterns$1.hostPortList, { message: messages$1.hostPortListFormat })),
750
- ...input
751
- });
752
- const kafkaClientId = (input = {}) => new StringEnvVarSchema({
753
- description: descriptions$1.kafkaClientId,
754
- process: createZodProcessor(z.string().min(1, { message: messages$1.kafkaClientIdRequired })),
755
- ...input
756
- });
757
- const KAFKA_BROKERS = kafkaBrokers();
758
- const KAFKA_CLIENT_ID = kafkaClientId();
759
- const kafka = {
760
- KAFKA_BROKERS,
761
- KAFKA_CLIENT_ID
762
- };
763
-
764
- //#endregion
765
- //#region ../schemas/src/plain/logLevel.ts
766
- const logLevel = (input = {}) => new StringEnvVarSchema({
767
- description: descriptions$4.logLevel,
768
- default: defaults$2.logLevel,
769
- process: createZodProcessor(z.enum([...enumOptions.logLevel])),
770
- ...input
771
- });
772
- const LOG_LEVEL = logLevel();
773
- const logLevelSchema = { LOG_LEVEL };
774
-
775
- //#endregion
776
- //#region ../schemas/src/plain/monitoring.ts
777
- const newRelicLicenseKey = (input = {}) => new StringEnvVarSchema({
778
- description: descriptions$1.newRelicLicenseKey,
779
- process: createZodProcessor(z.string().length(constraints$3.newRelicLicenseKeyLength, { message: messages$1.newRelicLicenseKeyLength })),
780
- secret: true,
781
- required: false,
782
- ...input
783
- });
784
- const sentryDsn = (input = {}) => new StringEnvVarSchema({
785
- description: descriptions$1.sentryDsn,
786
- process: createZodProcessor(z.string().regex(patterns$1.sentryDsn, { message: messages$1.sentryDsnFormat })),
787
- secret: true,
788
- required: false,
789
- ...input
790
- });
791
- const jaegerEndpoint = (input = {}) => new StringEnvVarSchema({
792
- description: descriptions$1.jaegerEndpoint,
793
- process: createZodProcessor(z.string().url({ message: messages$1.jaegerEndpointFormat })),
794
- required: false,
795
- ...input
796
- });
797
- const prometheusPort = (input = {}) => new NumberEnvVarSchema({
798
- description: descriptions$1.prometheusPort,
799
- default: defaults$3.prometheusPort,
800
- process: createZodProcessor(z.coerce.number().int({ message: messages$1.prometheusPortInt }).min(constraints$3.prometheusPortMin, { message: messages$1.prometheusPortMin }).max(constraints$3.prometheusPortMax, { message: messages$1.prometheusPortMax })),
801
- ...input
802
- });
803
- const datadogApiKey = (input = {}) => new StringEnvVarSchema({
804
- description: descriptions$1.datadogApiKey,
805
- process: createZodProcessor(z.string().length(constraints$3.datadogApiKeyLength, { message: messages$1.datadogApiKeyLength })),
806
- secret: true,
807
- required: false,
808
- ...input
809
- });
810
- const NEW_RELIC_LICENSE_KEY = newRelicLicenseKey();
811
- const SENTRY_DSN = sentryDsn();
812
- const JAEGER_ENDPOINT = jaegerEndpoint();
813
- const PROMETHEUS_PORT = prometheusPort();
814
- const DATADOG_API_KEY = datadogApiKey();
815
- const monitoring = {
816
- NEW_RELIC_LICENSE_KEY,
817
- SENTRY_DSN,
818
- JAEGER_ENDPOINT,
819
- PROMETHEUS_PORT,
820
- DATADOG_API_KEY
821
- };
822
-
823
- //#endregion
824
- //#region ../schemas/src/plain/node.ts
825
- const nodeEnv = (input = {}) => new EnumEnvVarSchema({
826
- values: [...enumOptions.nodeEnv],
827
- description: descriptions$4.nodeEnv,
828
- default: defaults$2.nodeEnv,
829
- process: createZodProcessor(z.enum([...enumOptions.nodeEnv])),
830
- ...input
831
- });
832
- const NODE_ENV = nodeEnv();
833
- const node = { NODE_ENV };
834
-
835
- //#endregion
836
- //#region ../schemas/src/shared/oauth.ts
837
- const descriptions$3 = {
838
- clientId: "The OAuth client ID",
839
- clientSecret: "OAuth client secret",
840
- redirectUri: "OAuth redirect URI",
841
- scope: "OAuth scope (space-separated)"
842
- };
843
- const messages$3 = {
844
- clientIdRequired: "OAuth client ID is required",
845
- clientSecretMinLength: "OAuth client secret must be at least 8 characters long",
846
- redirectUriInvalid: COMMON_MESSAGES.MUST_BE_VALID_URL,
847
- scopeRequired: "OAuth scope is required"
848
- };
849
- const constraints$2 = {
850
- clientIdMinLength: 1,
851
- clientSecretMinLength: 8,
852
- scopeMinLength: 1
853
- };
854
-
855
- //#endregion
856
- //#region ../schemas/src/plain/oauth.ts
857
- const oauthClientId = (input = {}) => new StringEnvVarSchema({
858
- description: descriptions$3.clientId,
859
- process: createZodProcessor(z.string().min(constraints$2.clientIdMinLength, { message: messages$3.clientIdRequired })),
860
- secret: true,
861
- ...input
862
- });
863
- const oauthClientSecret = (input = {}) => new StringEnvVarSchema({
864
- description: descriptions$3.clientSecret,
865
- process: createZodProcessor(z.string().min(constraints$2.clientSecretMinLength, { message: messages$3.clientSecretMinLength })),
866
- secret: true,
867
- ...input
868
- });
869
- const oauthRedirectUri = (input = {}) => new StringEnvVarSchema({
870
- description: descriptions$3.redirectUri,
871
- process: createZodProcessor(z.string().url({ message: messages$3.redirectUriInvalid })),
872
- ...input
873
- });
874
- const oauthScope = (input = {}) => new StringEnvVarSchema({
875
- description: descriptions$3.scope,
876
- process: createZodProcessor(z.string().min(constraints$2.scopeMinLength, { message: messages$3.scopeRequired })),
877
- ...input
878
- });
879
- const OAUTH_CLIENT_ID = oauthClientId();
880
- const OAUTH_CLIENT_SECRET = oauthClientSecret();
881
- const OAUTH_REDIRECT_URI = oauthRedirectUri();
882
- const OAUTH_SCOPE = oauthScope();
883
- const oauth = {
884
- OAUTH_CLIENT_ID,
885
- OAUTH_CLIENT_SECRET,
886
- OAUTH_REDIRECT_URI,
887
- OAUTH_SCOPE
888
- };
889
-
890
- //#endregion
891
- //#region ../schemas/src/shared/openai.ts
892
- const descriptions$2 = {
893
- apiKey: "OpenAI API key for authenticating requests",
894
- organizationId: "OpenAI organization identifier (org-...)",
895
- projectId: "OpenAI project identifier (proj_...)",
896
- baseUrl: "Custom base URL for OpenAI-compatible API endpoints",
897
- model: "Default OpenAI model identifier to use for requests",
898
- timeout: "Request timeout in seconds for OpenAI API calls"
899
- };
900
- const messages$2 = {
901
- apiKeyMinLength: "OpenAI API key must be at least 40 characters",
902
- apiKeyFormat: "OpenAI API key must start with 'sk-' and contain only letters and numbers",
903
- organizationFormat: "OpenAI organization ID must start with 'org-'",
904
- projectFormat: "OpenAI project ID must start with 'proj_'",
905
- baseUrlInvalid: "OpenAI base URL must be a valid URL",
906
- baseUrlProtocol: "OpenAI base URL must use https://",
907
- modelRequired: "OpenAI model identifier cannot be empty",
908
- timeoutInteger: "OpenAI timeout must be an integer value",
909
- timeoutMin: "OpenAI timeout must be at least 1 second",
910
- timeoutMax: "OpenAI timeout must be 600 seconds or less"
911
- };
912
- const constraints$1 = {
913
- apiKeyMinLength: 40,
914
- timeoutMin: 1,
915
- timeoutMax: 600
916
- };
917
- const defaults$1 = { timeout: 30 };
918
- const patterns$2 = {
919
- apiKey: /^sk-[A-Za-z0-9]{20,}$/,
920
- organizationId: /^org-[A-Za-z0-9_-]{8,}$/,
921
- projectId: /^proj_[A-Za-z0-9_-]{8,}$/
922
- };
923
-
924
- //#endregion
925
- //#region ../schemas/src/plain/openai.ts
926
- const openaiApiKey = (input = {}) => new StringEnvVarSchema({
927
- description: descriptions$2.apiKey,
928
- process: createZodProcessor(z.string().min(constraints$1.apiKeyMinLength, { message: messages$2.apiKeyMinLength }).regex(patterns$2.apiKey, { message: messages$2.apiKeyFormat })),
929
- secret: true,
930
- ...input
931
- });
932
- const openaiOrganizationId = (input = {}) => new StringEnvVarSchema({
933
- description: descriptions$2.organizationId,
934
- process: createZodProcessor(z.string().regex(patterns$2.organizationId, { message: messages$2.organizationFormat })),
935
- required: false,
936
- ...input
937
- });
938
- const openaiProjectId = (input = {}) => new StringEnvVarSchema({
939
- description: descriptions$2.projectId,
940
- process: createZodProcessor(z.string().regex(patterns$2.projectId, { message: messages$2.projectFormat })),
941
- required: false,
942
- ...input
943
- });
944
- const openaiBaseUrl = (input = {}) => new StringEnvVarSchema({
945
- description: descriptions$2.baseUrl,
946
- process: createZodProcessor(z.string().url({ message: messages$2.baseUrlInvalid }).refine((value) => value.startsWith("https://"), { message: messages$2.baseUrlProtocol })),
947
- required: false,
948
- ...input
949
- });
950
- const openaiModel = (input = {}) => new StringEnvVarSchema({
951
- description: descriptions$2.model,
952
- process: createZodProcessor(z.string().min(1, { message: messages$2.modelRequired })),
953
- required: false,
954
- ...input
955
- });
956
- const openaiTimeout = (input = {}) => new NumberEnvVarSchema({
957
- description: descriptions$2.timeout,
958
- default: defaults$1.timeout,
959
- process: createZodProcessor(z.coerce.number().int({ message: messages$2.timeoutInteger }).min(constraints$1.timeoutMin, { message: messages$2.timeoutMin }).max(constraints$1.timeoutMax, { message: messages$2.timeoutMax })),
960
- ...input
961
- });
962
- const OPENAI_API_KEY = openaiApiKey();
963
- const OPENAI_ORGANIZATION_ID = openaiOrganizationId();
964
- const OPENAI_PROJECT_ID = openaiProjectId();
965
- const OPENAI_BASE_URL = openaiBaseUrl();
966
- const OPENAI_MODEL = openaiModel();
967
- const OPENAI_TIMEOUT = openaiTimeout();
968
- const openai = {
969
- OPENAI_API_KEY,
970
- OPENAI_ORGANIZATION_ID,
971
- OPENAI_PROJECT_ID,
972
- OPENAI_BASE_URL,
973
- OPENAI_MODEL,
974
- OPENAI_TIMEOUT
975
- };
976
-
977
- //#endregion
978
- //#region ../schemas/src/plain/rabbitmq.ts
979
- const rabbitmqUrl = (input = {}) => new StringEnvVarSchema({
980
- description: descriptions$1.rabbitmqUrl,
981
- process: createZodProcessor(z.string().regex(patterns$1.rabbitmqUrl, { message: messages$1.rabbitmqUrlFormat })),
982
- secret: true,
983
- ...input
984
- });
985
- const RABBITMQ_URL = rabbitmqUrl();
986
- const rabbitmq = { RABBITMQ_URL };
987
-
988
- //#endregion
989
- //#region ../schemas/src/shared/redis.ts
990
- const descriptions = {
991
- url: "Redis connection string (redis:// or rediss://)",
992
- host: "Redis server host name or IP address",
993
- port: "Redis server port number",
994
- username: "Redis username for ACL authentication",
995
- password: "Redis password or access token",
996
- db: "Redis logical database index (0-15)",
997
- tls: "Enable TLS for connections to Redis",
998
- tlsCaCertPath: "Path to CA certificate file for Redis TLS validation"
999
- };
1000
- const messages = {
1001
- urlFormat: "Redis URL must start with redis:// or rediss://",
1002
- hostRequired: "Redis host is required",
1003
- hostFormat: "Redis host may contain letters, numbers, dots, and hyphens",
1004
- portInteger: "Redis port must be an integer",
1005
- portMin: "Redis port must be at least 1",
1006
- portMax: "Redis port must be 65535 or less",
1007
- dbInteger: "Redis database index must be an integer",
1008
- dbRange: "Redis database index must be between 0 and 15",
1009
- usernameRequired: "Redis username cannot be empty",
1010
- passwordRequired: "Redis password cannot be empty",
1011
- tlsCaCertPathRequired: "Redis TLS CA certificate path cannot be empty"
1012
- };
1013
- const defaults = {
1014
- port: 6379,
1015
- db: 0,
1016
- tls: false
1017
- };
1018
- const constraints = {
1019
- portMin: 1,
1020
- portMax: 65535,
1021
- dbMin: 0,
1022
- dbMax: 15
1023
- };
1024
- const patterns = {
1025
- url: /^rediss?:\/\/(?:[^:@/\s]+(?::[^@/\s]*)?@)?[^:/\s]+(?::\d+)?(?:\/\d+)?(?:\?.*)?$/,
1026
- host: /^[a-zA-Z0-9.-]+$/
1027
- };
1028
-
1029
- //#endregion
1030
- //#region ../schemas/src/plain/redis.ts
1031
- const redisUrl = (input = {}) => new StringEnvVarSchema({
1032
- description: descriptions.url,
1033
- process: createZodProcessor(z.string().regex(patterns.url, { message: messages.urlFormat })),
1034
- ...input
1035
- });
1036
- const redisHost = (input = {}) => new StringEnvVarSchema({
1037
- description: descriptions.host,
1038
- process: createZodProcessor(z.string().min(1, { message: messages.hostRequired }).regex(patterns.host, { message: messages.hostFormat })),
1039
- required: false,
1040
- ...input
1041
- });
1042
- const redisPort = (input = {}) => new NumberEnvVarSchema({
1043
- description: descriptions.port,
1044
- default: defaults.port,
1045
- process: createZodProcessor(z.coerce.number().int({ message: messages.portInteger }).min(constraints.portMin, { message: messages.portMin }).max(constraints.portMax, { message: messages.portMax })),
1046
- ...input
1047
- });
1048
- const redisPassword = (input = {}) => new StringEnvVarSchema({
1049
- description: descriptions.password,
1050
- process: createZodProcessor(z.string().min(1, { message: messages.passwordRequired })),
1051
- secret: true,
1052
- required: false,
1053
- ...input
1054
- });
1055
- const redisUsername = (input = {}) => new StringEnvVarSchema({
1056
- description: descriptions.username,
1057
- process: createZodProcessor(z.string().min(1, { message: messages.usernameRequired })),
1058
- required: false,
1059
- ...input
1060
- });
1061
- const redisDb = (input = {}) => new NumberEnvVarSchema({
1062
- description: descriptions.db,
1063
- default: defaults.db,
1064
- process: createZodProcessor(z.coerce.number().int({ message: messages.dbInteger }).min(constraints.dbMin, { message: messages.dbRange }).max(constraints.dbMax, { message: messages.dbRange })),
1065
- ...input
1066
- });
1067
- const redisTls = (input = {}) => new BooleanEnvVarSchema({
1068
- description: descriptions.tls,
1069
- default: defaults.tls,
1070
- ...input
1071
- });
1072
- const redisTlsCaCertPath = (input = {}) => new StringEnvVarSchema({
1073
- description: descriptions.tlsCaCertPath,
1074
- process: createZodProcessor(z.string().min(1, { message: messages.tlsCaCertPathRequired })),
1075
- required: false,
1076
- ...input
1077
- });
1078
- const REDIS_URL = redisUrl();
1079
- const REDIS_HOST = redisHost();
1080
- const REDIS_PORT = redisPort();
1081
- const REDIS_PASSWORD = redisPassword();
1082
- const REDIS_USERNAME = redisUsername();
1083
- const REDIS_DB = redisDb();
1084
- const REDIS_TLS = redisTls();
1085
- const REDIS_TLS_CA_CERT_PATH = redisTlsCaCertPath();
1086
- const redis = {
1087
- REDIS_URL,
1088
- REDIS_HOST,
1089
- REDIS_PORT,
1090
- REDIS_PASSWORD,
1091
- REDIS_USERNAME,
1092
- REDIS_DB,
1093
- REDIS_TLS,
1094
- REDIS_TLS_CA_CERT_PATH
1095
- };
1096
-
1097
- //#endregion
1098
- //#region ../schemas/src/index.ts
1099
- var src_exports = /* @__PURE__ */ __export({
1100
- API_BASE_URL: () => API_BASE_URL,
1101
- API_KEY: () => API_KEY,
1102
- API_TIMEOUT: () => API_TIMEOUT,
1103
- AWS_ACCESS_KEY_ID: () => AWS_ACCESS_KEY_ID,
1104
- AWS_REGION: () => AWS_REGION,
1105
- AWS_S3_BUCKET_NAME: () => AWS_S3_BUCKET_NAME,
1106
- AWS_SECRET_ACCESS_KEY: () => AWS_SECRET_ACCESS_KEY,
1107
- AWS_SQS_QUEUE_URL: () => AWS_SQS_QUEUE_URL,
1108
- AZURE_EVENT_HUB_CONNECTION_STRING: () => AZURE_EVENT_HUB_CONNECTION_STRING,
1109
- AZURE_SERVICE_BUS_CONNECTION_STRING: () => AZURE_SERVICE_BUS_CONNECTION_STRING,
1110
- AZURE_STORAGE_ACCOUNT_KEY: () => AZURE_STORAGE_ACCOUNT_KEY,
1111
- AZURE_STORAGE_ACCOUNT_NAME: () => AZURE_STORAGE_ACCOUNT_NAME,
1112
- AZURE_STORAGE_CONNECTION_STRING: () => AZURE_STORAGE_CONNECTION_STRING,
1113
- CORS_ORIGIN: () => CORS_ORIGIN,
1114
- DATABASE_HOST: () => DATABASE_HOST,
1115
- DATABASE_NAME: () => DATABASE_NAME,
1116
- DATABASE_PASSWORD: () => DATABASE_PASSWORD,
1117
- DATABASE_POOL_SIZE: () => DATABASE_POOL_SIZE,
1118
- DATABASE_PORT: () => DATABASE_PORT,
1119
- DATABASE_SCHEMA: () => DATABASE_SCHEMA,
1120
- DATABASE_SSL: () => DATABASE_SSL,
1121
- DATABASE_TIMEOUT: () => DATABASE_TIMEOUT,
1122
- DATABASE_URL: () => DATABASE_URL,
1123
- DATABASE_USERNAME: () => DATABASE_USERNAME,
1124
- DATADOG_API_KEY: () => DATADOG_API_KEY,
1125
- DOCKER_REGISTRY_PASSWORD: () => DOCKER_REGISTRY_PASSWORD,
1126
- DOCKER_REGISTRY_URL: () => DOCKER_REGISTRY_URL,
1127
- DOCKER_REGISTRY_USERNAME: () => DOCKER_REGISTRY_USERNAME,
1128
- ELASTICSEARCH_PASSWORD: () => ELASTICSEARCH_PASSWORD,
1129
- ELASTICSEARCH_URL: () => ELASTICSEARCH_URL,
1130
- ELASTICSEARCH_USERNAME: () => ELASTICSEARCH_USERNAME,
1131
- HOST: () => HOST,
1132
- JAEGER_ENDPOINT: () => JAEGER_ENDPOINT,
1133
- JWT_ACCESS_TOKEN_EXPIRES_IN: () => JWT_ACCESS_TOKEN_EXPIRES_IN,
1134
- JWT_REFRESH_TOKEN_EXPIRES_IN: () => JWT_REFRESH_TOKEN_EXPIRES_IN,
1135
- JWT_SECRET: () => JWT_SECRET,
1136
- KAFKA_BROKERS: () => KAFKA_BROKERS,
1137
- KAFKA_CLIENT_ID: () => KAFKA_CLIENT_ID,
1138
- LOG_LEVEL: () => LOG_LEVEL,
1139
- NEW_RELIC_LICENSE_KEY: () => NEW_RELIC_LICENSE_KEY,
1140
- NODE_ENV: () => NODE_ENV,
1141
- OAUTH_CLIENT_ID: () => OAUTH_CLIENT_ID,
1142
- OAUTH_CLIENT_SECRET: () => OAUTH_CLIENT_SECRET,
1143
- OAUTH_REDIRECT_URI: () => OAUTH_REDIRECT_URI,
1144
- OAUTH_SCOPE: () => OAUTH_SCOPE,
1145
- OPENAI_API_KEY: () => OPENAI_API_KEY,
1146
- OPENAI_BASE_URL: () => OPENAI_BASE_URL,
1147
- OPENAI_MODEL: () => OPENAI_MODEL,
1148
- OPENAI_ORGANIZATION_ID: () => OPENAI_ORGANIZATION_ID,
1149
- OPENAI_PROJECT_ID: () => OPENAI_PROJECT_ID,
1150
- OPENAI_TIMEOUT: () => OPENAI_TIMEOUT,
1151
- PORT: () => PORT,
1152
- PROMETHEUS_PORT: () => PROMETHEUS_PORT,
1153
- RABBITMQ_URL: () => RABBITMQ_URL,
1154
- REDIS_DB: () => REDIS_DB,
1155
- REDIS_HOST: () => REDIS_HOST,
1156
- REDIS_PASSWORD: () => REDIS_PASSWORD,
1157
- REDIS_PORT: () => REDIS_PORT,
1158
- REDIS_TLS: () => REDIS_TLS,
1159
- REDIS_TLS_CA_CERT_PATH: () => REDIS_TLS_CA_CERT_PATH,
1160
- REDIS_URL: () => REDIS_URL,
1161
- REDIS_USERNAME: () => REDIS_USERNAME,
1162
- SENTRY_DSN: () => SENTRY_DSN,
1163
- apiBaseUrl: () => apiBaseUrl,
1164
- apiKey: () => apiKey,
1165
- apiTimeout: () => apiTimeout,
1166
- aws: () => aws,
1167
- awsAccessKeyId: () => awsAccessKeyId,
1168
- awsRegion: () => awsRegion,
1169
- awsS3BucketName: () => awsS3BucketName,
1170
- awsSecretAccessKey: () => awsSecretAccessKey,
1171
- awsSqsQueueUrl: () => awsSqsQueueUrl,
1172
- azure: () => azure,
1173
- azureEventHubConnectionString: () => azureEventHubConnectionString,
1174
- azureServiceBusConnectionString: () => azureServiceBusConnectionString,
1175
- azureStorageAccountKey: () => azureStorageAccountKey,
1176
- azureStorageAccountName: () => azureStorageAccountName,
1177
- azureStorageConnectionString: () => azureStorageConnectionString,
1178
- cors: () => cors,
1179
- corsOrigin: () => corsOrigin,
1180
- databaseHost: () => databaseHost,
1181
- databaseName: () => databaseName,
1182
- databasePassword: () => databasePassword,
1183
- databasePoolSize: () => databasePoolSize,
1184
- databasePort: () => databasePort,
1185
- databaseSchema: () => databaseSchema,
1186
- databaseSsl: () => databaseSsl,
1187
- databaseTimeout: () => databaseTimeout,
1188
- databaseUrl: () => databaseUrl,
1189
- databaseUsername: () => databaseUsername,
1190
- datadogApiKey: () => datadogApiKey,
1191
- docker: () => docker,
1192
- dockerRegistryPassword: () => dockerRegistryPassword,
1193
- dockerRegistryUrl: () => dockerRegistryUrl,
1194
- dockerRegistryUsername: () => dockerRegistryUsername,
1195
- elasticsearch: () => elasticsearch,
1196
- elasticsearchPassword: () => elasticsearchPassword,
1197
- elasticsearchUrl: () => elasticsearchUrl,
1198
- elasticsearchUsername: () => elasticsearchUsername,
1199
- host: () => host,
1200
- hostSchema: () => hostSchema,
1201
- jaegerEndpoint: () => jaegerEndpoint,
1202
- jwt: () => jwt,
1203
- jwtAccessTokenExpiresIn: () => jwtAccessTokenExpiresIn,
1204
- jwtRefreshTokenExpiresIn: () => jwtRefreshTokenExpiresIn,
1205
- jwtSecret: () => jwtSecret,
1206
- kafka: () => kafka,
1207
- kafkaBrokers: () => kafkaBrokers,
1208
- kafkaClientId: () => kafkaClientId,
1209
- logLevel: () => logLevel,
1210
- logLevelSchema: () => logLevelSchema,
1211
- monitoring: () => monitoring,
1212
- newRelicLicenseKey: () => newRelicLicenseKey,
1213
- node: () => node,
1214
- nodeEnv: () => nodeEnv,
1215
- oauth: () => oauth,
1216
- oauthClientId: () => oauthClientId,
1217
- oauthClientSecret: () => oauthClientSecret,
1218
- oauthRedirectUri: () => oauthRedirectUri,
1219
- oauthScope: () => oauthScope,
1220
- openai: () => openai,
1221
- openaiApiKey: () => openaiApiKey,
1222
- openaiBaseUrl: () => openaiBaseUrl,
1223
- openaiModel: () => openaiModel,
1224
- openaiOrganizationId: () => openaiOrganizationId,
1225
- openaiProjectId: () => openaiProjectId,
1226
- openaiTimeout: () => openaiTimeout,
1227
- port: () => port,
1228
- prometheusPort: () => prometheusPort,
1229
- rabbitmq: () => rabbitmq,
1230
- rabbitmqUrl: () => rabbitmqUrl,
1231
- redis: () => redis,
1232
- redisDb: () => redisDb,
1233
- redisHost: () => redisHost,
1234
- redisPassword: () => redisPassword,
1235
- redisPort: () => redisPort,
1236
- redisTls: () => redisTls,
1237
- redisTlsCaCertPath: () => redisTlsCaCertPath,
1238
- redisUrl: () => redisUrl,
1239
- redisUsername: () => redisUsername,
1240
- sentryDsn: () => sentryDsn
1241
- });
1242
-
1243
- //#endregion
1244
- export { BooleanEnvVarSchema, DefaultEnvChannel, DotEnvChannel, DotEnvXChannel, EnumEnvVarSchema, EnvModel, EnvParseError, EnvSource, EnvVarSchemaBase, NumberEnvVarSchema, ProcessEnvChannel, StringEnvVarSchema, booleanPreprocessor, booleanProcessor, defaults_exports as defaults, define, enumPreprocessor, enumProcessor, get, isEnvVarSchema, numberPreprocessor, numberProcessor, parse, preprocessors, processors, prompt, resolveChannel, resolvePreprocessor, resolveSchema, resolveSchemas, s, schema, src_exports as schemas, set, source, stringPreprocessor, stringProcessor };