@konker.dev/config-o-tron 0.0.1
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/LICENSE +15 -0
- package/README.md +131 -0
- package/dist/api.d.ts +24 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +44 -0
- package/dist/api.js.map +1 -0
- package/dist/cli.d.ts +8 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +267 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/delete.d.ts +22 -0
- package/dist/commands/delete.d.ts.map +1 -0
- package/dist/commands/delete.js +105 -0
- package/dist/commands/delete.js.map +1 -0
- package/dist/commands/delete.test.d.ts +2 -0
- package/dist/commands/delete.test.d.ts.map +1 -0
- package/dist/commands/delete.test.js +165 -0
- package/dist/commands/delete.test.js.map +1 -0
- package/dist/commands/export.d.ts +31 -0
- package/dist/commands/export.d.ts.map +1 -0
- package/dist/commands/export.js +117 -0
- package/dist/commands/export.js.map +1 -0
- package/dist/commands/export.test.d.ts +2 -0
- package/dist/commands/export.test.d.ts.map +1 -0
- package/dist/commands/export.test.js +173 -0
- package/dist/commands/export.test.js.map +1 -0
- package/dist/commands/index.d.ts +10 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +10 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/list.d.ts +37 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +107 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/list.test.d.ts +2 -0
- package/dist/commands/list.test.d.ts.map +1 -0
- package/dist/commands/list.test.js +275 -0
- package/dist/commands/list.test.js.map +1 -0
- package/dist/commands/snapshot.d.ts +67 -0
- package/dist/commands/snapshot.d.ts.map +1 -0
- package/dist/commands/snapshot.js +261 -0
- package/dist/commands/snapshot.js.map +1 -0
- package/dist/commands/snapshot.test.d.ts +2 -0
- package/dist/commands/snapshot.test.d.ts.map +1 -0
- package/dist/commands/snapshot.test.js +527 -0
- package/dist/commands/snapshot.test.js.map +1 -0
- package/dist/commands/upsert.d.ts +33 -0
- package/dist/commands/upsert.d.ts.map +1 -0
- package/dist/commands/upsert.js +98 -0
- package/dist/commands/upsert.js.map +1 -0
- package/dist/commands/upsert.test.d.ts +2 -0
- package/dist/commands/upsert.test.d.ts.map +1 -0
- package/dist/commands/upsert.test.js +184 -0
- package/dist/commands/upsert.test.js.map +1 -0
- package/dist/commands/validate.d.ts +23 -0
- package/dist/commands/validate.d.ts.map +1 -0
- package/dist/commands/validate.js +138 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/commands/validate.test.d.ts +2 -0
- package/dist/commands/validate.test.d.ts.map +1 -0
- package/dist/commands/validate.test.js +210 -0
- package/dist/commands/validate.test.js.map +1 -0
- package/dist/config.d.ts +75 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +212 -0
- package/dist/config.js.map +1 -0
- package/dist/errors.d.ts +107 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +362 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/flatten.d.ts +84 -0
- package/dist/lib/flatten.d.ts.map +1 -0
- package/dist/lib/flatten.js +158 -0
- package/dist/lib/flatten.js.map +1 -0
- package/dist/lib/flatten.test.d.ts +2 -0
- package/dist/lib/flatten.test.d.ts.map +1 -0
- package/dist/lib/flatten.test.js +230 -0
- package/dist/lib/flatten.test.js.map +1 -0
- package/dist/lib/format.d.ts +41 -0
- package/dist/lib/format.d.ts.map +1 -0
- package/dist/lib/format.js +182 -0
- package/dist/lib/format.js.map +1 -0
- package/dist/lib/format.test.d.ts +2 -0
- package/dist/lib/format.test.d.ts.map +1 -0
- package/dist/lib/format.test.js +317 -0
- package/dist/lib/format.test.js.map +1 -0
- package/dist/lib/index.d.ts +8 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/index.js +8 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/merge.d.ts +42 -0
- package/dist/lib/merge.d.ts.map +1 -0
- package/dist/lib/merge.js +167 -0
- package/dist/lib/merge.js.map +1 -0
- package/dist/lib/merge.test.d.ts +2 -0
- package/dist/lib/merge.test.d.ts.map +1 -0
- package/dist/lib/merge.test.js +218 -0
- package/dist/lib/merge.test.js.map +1 -0
- package/dist/lib/redact.d.ts +29 -0
- package/dist/lib/redact.d.ts.map +1 -0
- package/dist/lib/redact.js +77 -0
- package/dist/lib/redact.js.map +1 -0
- package/dist/lib/redact.test.d.ts +2 -0
- package/dist/lib/redact.test.d.ts.map +1 -0
- package/dist/lib/redact.test.js +192 -0
- package/dist/lib/redact.test.js.map +1 -0
- package/dist/providers/AwsSsmProvider.d.ts +3 -0
- package/dist/providers/AwsSsmProvider.d.ts.map +1 -0
- package/dist/providers/AwsSsmProvider.js +230 -0
- package/dist/providers/AwsSsmProvider.js.map +1 -0
- package/dist/providers/AwsSsmProvider.test.d.ts +5 -0
- package/dist/providers/AwsSsmProvider.test.d.ts.map +1 -0
- package/dist/providers/AwsSsmProvider.test.js +200 -0
- package/dist/providers/AwsSsmProvider.test.js.map +1 -0
- package/dist/providers/MockProvider.d.ts +21 -0
- package/dist/providers/MockProvider.d.ts.map +1 -0
- package/dist/providers/MockProvider.js +118 -0
- package/dist/providers/MockProvider.js.map +1 -0
- package/dist/providers/MockProvider.test.d.ts +2 -0
- package/dist/providers/MockProvider.test.d.ts.map +1 -0
- package/dist/providers/MockProvider.test.js +166 -0
- package/dist/providers/MockProvider.test.js.map +1 -0
- package/dist/providers/Provider.d.ts +95 -0
- package/dist/providers/Provider.d.ts.map +1 -0
- package/dist/providers/Provider.js +49 -0
- package/dist/providers/Provider.js.map +1 -0
- package/dist/providers/Provider.test.d.ts +2 -0
- package/dist/providers/Provider.test.d.ts.map +1 -0
- package/dist/providers/Provider.test.js +136 -0
- package/dist/providers/Provider.test.js.map +1 -0
- package/dist/providers/guards.d.ts +13 -0
- package/dist/providers/guards.d.ts.map +1 -0
- package/dist/providers/guards.js +60 -0
- package/dist/providers/guards.js.map +1 -0
- package/dist/providers/guards.test.d.ts +2 -0
- package/dist/providers/guards.test.d.ts.map +1 -0
- package/dist/providers/guards.test.js +84 -0
- package/dist/providers/guards.test.js.map +1 -0
- package/dist/providers/index.d.ts +8 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js +8 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/providers/registry.d.ts +27 -0
- package/dist/providers/registry.d.ts.map +1 -0
- package/dist/providers/registry.js +50 -0
- package/dist/providers/registry.js.map +1 -0
- package/dist/providers/registry.test.d.ts +5 -0
- package/dist/providers/registry.test.d.ts.map +1 -0
- package/dist/providers/registry.test.js +89 -0
- package/dist/providers/registry.test.js.map +1 -0
- package/dist/schema/index.d.ts +8 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/index.js +8 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/schema/loader.d.ts +21 -0
- package/dist/schema/loader.d.ts.map +1 -0
- package/dist/schema/loader.js +68 -0
- package/dist/schema/loader.js.map +1 -0
- package/dist/schema/loader.test.d.ts +2 -0
- package/dist/schema/loader.test.d.ts.map +1 -0
- package/dist/schema/loader.test.js +111 -0
- package/dist/schema/loader.test.js.map +1 -0
- package/dist/schema/parser.d.ts +17 -0
- package/dist/schema/parser.d.ts.map +1 -0
- package/dist/schema/parser.js +55 -0
- package/dist/schema/parser.js.map +1 -0
- package/dist/schema/parser.test.d.ts +2 -0
- package/dist/schema/parser.test.d.ts.map +1 -0
- package/dist/schema/parser.test.js +62 -0
- package/dist/schema/parser.test.js.map +1 -0
- package/dist/schema/resolver.d.ts +16 -0
- package/dist/schema/resolver.d.ts.map +1 -0
- package/dist/schema/resolver.js +41 -0
- package/dist/schema/resolver.js.map +1 -0
- package/dist/schema/resolver.test.d.ts +2 -0
- package/dist/schema/resolver.test.d.ts.map +1 -0
- package/dist/schema/resolver.test.js +77 -0
- package/dist/schema/resolver.test.js.map +1 -0
- package/dist/schema/validator.d.ts +16 -0
- package/dist/schema/validator.d.ts.map +1 -0
- package/dist/schema/validator.js +21 -0
- package/dist/schema/validator.js.map +1 -0
- package/dist/schema/validator.test.d.ts +2 -0
- package/dist/schema/validator.test.d.ts.map +1 -0
- package/dist/schema/validator.test.js +40 -0
- package/dist/schema/validator.test.js.map +1 -0
- package/dist/test/fixtures/index.d.ts +39 -0
- package/dist/test/fixtures/index.d.ts.map +1 -0
- package/dist/test/fixtures/index.js +85 -0
- package/dist/test/fixtures/index.js.map +1 -0
- package/dist/test/fixtures/schema.basic.d.ts +16 -0
- package/dist/test/fixtures/schema.basic.d.ts.map +1 -0
- package/dist/test/fixtures/schema.basic.js +16 -0
- package/dist/test/fixtures/schema.basic.js.map +1 -0
- package/dist/test/fixtures/schema.basic.zod.d.ts +58 -0
- package/dist/test/fixtures/schema.basic.zod.d.ts.map +1 -0
- package/dist/test/fixtures/schema.basic.zod.js +16 -0
- package/dist/test/fixtures/schema.basic.zod.js.map +1 -0
- package/dist/validation/effect.d.ts +3 -0
- package/dist/validation/effect.d.ts.map +1 -0
- package/dist/validation/effect.js +368 -0
- package/dist/validation/effect.js.map +1 -0
- package/dist/validation/effect.test.d.ts +2 -0
- package/dist/validation/effect.test.d.ts.map +1 -0
- package/dist/validation/effect.test.js +137 -0
- package/dist/validation/effect.test.js.map +1 -0
- package/dist/validation/hash.d.ts +2 -0
- package/dist/validation/hash.d.ts.map +1 -0
- package/dist/validation/hash.js +27 -0
- package/dist/validation/hash.js.map +1 -0
- package/dist/validation/hash.test.d.ts +2 -0
- package/dist/validation/hash.test.d.ts.map +1 -0
- package/dist/validation/hash.test.js +25 -0
- package/dist/validation/hash.test.js.map +1 -0
- package/dist/validation/index.d.ts +7 -0
- package/dist/validation/index.d.ts.map +1 -0
- package/dist/validation/index.js +11 -0
- package/dist/validation/index.js.map +1 -0
- package/dist/validation/parse.d.ts +7 -0
- package/dist/validation/parse.d.ts.map +1 -0
- package/dist/validation/parse.js +44 -0
- package/dist/validation/parse.js.map +1 -0
- package/dist/validation/parse.test.d.ts +2 -0
- package/dist/validation/parse.test.d.ts.map +1 -0
- package/dist/validation/parse.test.js +47 -0
- package/dist/validation/parse.test.js.map +1 -0
- package/dist/validation/types.d.ts +33 -0
- package/dist/validation/types.d.ts.map +1 -0
- package/dist/validation/types.js +2 -0
- package/dist/validation/types.js.map +1 -0
- package/dist/validation/zod.d.ts +3 -0
- package/dist/validation/zod.d.ts.map +1 -0
- package/dist/validation/zod.js +326 -0
- package/dist/validation/zod.js.map +1 -0
- package/dist/validation/zod.test.d.ts +2 -0
- package/dist/validation/zod.test.d.ts.map +1 -0
- package/dist/validation/zod.test.js +161 -0
- package/dist/validation/zod.test.js.map +1 -0
- package/package.json +242 -0
package/dist/errors.js
ADDED
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ConfigOTron Error System
|
|
3
|
+
*
|
|
4
|
+
* Error codes and types as defined in the specification:
|
|
5
|
+
* - VAL (Validation): VAL001-VAL005
|
|
6
|
+
* - PROV (Provider): PROV001-PROV006
|
|
7
|
+
* - CLI (Command-line): CLI001-CLI003
|
|
8
|
+
* - SYS (System): SYS001-SYS003
|
|
9
|
+
*/
|
|
10
|
+
/* eslint-disable fp/no-class,fp/no-this */
|
|
11
|
+
import * as Data from 'effect/Data';
|
|
12
|
+
// --------------------------------------------------------------------------
|
|
13
|
+
// Exit Codes
|
|
14
|
+
// --------------------------------------------------------------------------
|
|
15
|
+
export const EXIT_SUCCESS = 0;
|
|
16
|
+
export const EXIT_VALIDATION_ERROR = 1;
|
|
17
|
+
export const EXIT_CONFIG_ERROR = 2;
|
|
18
|
+
export const EXIT_FILE_ERROR = 3;
|
|
19
|
+
export const EXIT_AUTH_ERROR = 4;
|
|
20
|
+
export const EXIT_SCHEMA_MISMATCH = 5;
|
|
21
|
+
// --------------------------------------------------------------------------
|
|
22
|
+
// Error Codes
|
|
23
|
+
// --------------------------------------------------------------------------
|
|
24
|
+
export const ErrorCode = {
|
|
25
|
+
// Validation Errors
|
|
26
|
+
VAL001: 'VAL001', // Invalid Type
|
|
27
|
+
VAL002: 'VAL002', // Format Violation
|
|
28
|
+
VAL003: 'VAL003', // Constraint Violation
|
|
29
|
+
VAL004: 'VAL004', // Key Not Found
|
|
30
|
+
VAL005: 'VAL005', // Null Not Allowed
|
|
31
|
+
// Provider Errors
|
|
32
|
+
PROV001: 'PROV001', // Connection Failed
|
|
33
|
+
PROV002: 'PROV002', // Authentication Failed
|
|
34
|
+
PROV003: 'PROV003', // Parameter Not Found
|
|
35
|
+
PROV004: 'PROV004', // Encryption Verification Failed (Warning)
|
|
36
|
+
PROV005: 'PROV005', // Write Permission Denied
|
|
37
|
+
PROV006: 'PROV006', // Provider Guard Mismatch
|
|
38
|
+
// CLI Errors
|
|
39
|
+
CLI001: 'CLI001', // Invalid Flag
|
|
40
|
+
CLI002: 'CLI002', // Missing Required Argument
|
|
41
|
+
CLI003: 'CLI003', // Conflicting Flags
|
|
42
|
+
// System Errors
|
|
43
|
+
SYS001: 'SYS001', // File Not Found
|
|
44
|
+
SYS002: 'SYS002', // Permission Denied
|
|
45
|
+
SYS003: 'SYS003', // Snapshot Schema Mismatch
|
|
46
|
+
};
|
|
47
|
+
// --------------------------------------------------------------------------
|
|
48
|
+
// Error Code to Exit Code Mapping
|
|
49
|
+
// --------------------------------------------------------------------------
|
|
50
|
+
export function errorCodeToExitCode(code) {
|
|
51
|
+
switch (code) {
|
|
52
|
+
case ErrorCode.CLI001:
|
|
53
|
+
case ErrorCode.CLI002:
|
|
54
|
+
case ErrorCode.CLI003:
|
|
55
|
+
return EXIT_CONFIG_ERROR;
|
|
56
|
+
case ErrorCode.SYS001:
|
|
57
|
+
case ErrorCode.SYS002:
|
|
58
|
+
return EXIT_FILE_ERROR;
|
|
59
|
+
case ErrorCode.PROV001:
|
|
60
|
+
case ErrorCode.PROV002:
|
|
61
|
+
case ErrorCode.PROV005:
|
|
62
|
+
return EXIT_AUTH_ERROR;
|
|
63
|
+
case ErrorCode.PROV006:
|
|
64
|
+
return EXIT_CONFIG_ERROR;
|
|
65
|
+
case ErrorCode.SYS003:
|
|
66
|
+
return EXIT_SCHEMA_MISMATCH;
|
|
67
|
+
default:
|
|
68
|
+
return EXIT_VALIDATION_ERROR;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
// --------------------------------------------------------------------------
|
|
72
|
+
// Error Classes using Effect's Data.TaggedError
|
|
73
|
+
// --------------------------------------------------------------------------
|
|
74
|
+
export class ConfigOTronError extends Data.TaggedError('ConfigOTronError') {
|
|
75
|
+
get exitCode() {
|
|
76
|
+
return errorCodeToExitCode(this.context.code);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
export class ValidationError extends Data.TaggedError('ValidationError') {
|
|
80
|
+
get exitCode() {
|
|
81
|
+
return errorCodeToExitCode(this.context.code);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
export class ProviderError extends Data.TaggedError('ProviderError') {
|
|
85
|
+
get exitCode() {
|
|
86
|
+
return errorCodeToExitCode(this.context.code);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
export class CLIError extends Data.TaggedError('CLIError') {
|
|
90
|
+
get exitCode() {
|
|
91
|
+
return errorCodeToExitCode(this.context.code);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
export class SystemError extends Data.TaggedError('SystemError') {
|
|
95
|
+
get exitCode() {
|
|
96
|
+
return errorCodeToExitCode(this.context.code);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
// --------------------------------------------------------------------------
|
|
100
|
+
// Error Factory Functions
|
|
101
|
+
// --------------------------------------------------------------------------
|
|
102
|
+
// Validation Errors
|
|
103
|
+
export function invalidTypeError(path, expected, received) {
|
|
104
|
+
return new ValidationError({
|
|
105
|
+
message: 'Value does not match expected type',
|
|
106
|
+
context: {
|
|
107
|
+
code: ErrorCode.VAL001,
|
|
108
|
+
path,
|
|
109
|
+
expected,
|
|
110
|
+
received,
|
|
111
|
+
problem: 'Value must be of the expected type',
|
|
112
|
+
remediation: `Provide a valid ${expected} value`,
|
|
113
|
+
},
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
export function formatViolationError(path, expected, received, example) {
|
|
117
|
+
return new ValidationError({
|
|
118
|
+
message: 'Value does not match required format',
|
|
119
|
+
context: {
|
|
120
|
+
code: ErrorCode.VAL002,
|
|
121
|
+
path,
|
|
122
|
+
expected,
|
|
123
|
+
received,
|
|
124
|
+
problem: `Value must be a valid ${expected}`,
|
|
125
|
+
remediation: `Provide a valid ${expected}`,
|
|
126
|
+
example,
|
|
127
|
+
},
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
export function constraintViolationError(path, expected, received, problem) {
|
|
131
|
+
return new ValidationError({
|
|
132
|
+
message: 'Value violates schema constraints',
|
|
133
|
+
context: {
|
|
134
|
+
code: ErrorCode.VAL003,
|
|
135
|
+
path,
|
|
136
|
+
expected,
|
|
137
|
+
received,
|
|
138
|
+
problem,
|
|
139
|
+
remediation: `Provide a value that satisfies the constraint: ${expected}`,
|
|
140
|
+
},
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
export function keyNotFoundError(path, availableKeys) {
|
|
144
|
+
return new ValidationError({
|
|
145
|
+
message: 'Key path does not exist in schema',
|
|
146
|
+
context: {
|
|
147
|
+
code: ErrorCode.VAL004,
|
|
148
|
+
path,
|
|
149
|
+
problem: `Key '${path}' not found in schema`,
|
|
150
|
+
remediation: 'Check schema for available keys',
|
|
151
|
+
availableKeys,
|
|
152
|
+
},
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
export function invalidKeyPathError(path, problem) {
|
|
156
|
+
return new ValidationError({
|
|
157
|
+
message: 'Invalid key path',
|
|
158
|
+
context: {
|
|
159
|
+
code: ErrorCode.VAL004,
|
|
160
|
+
path,
|
|
161
|
+
problem,
|
|
162
|
+
remediation: 'Use dot notation with segments matching ^[A-Za-z0-9_-]+$',
|
|
163
|
+
},
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
export function unknownKeysError(keys) {
|
|
167
|
+
const sample = keys[0] ?? '(unknown)';
|
|
168
|
+
return new ValidationError({
|
|
169
|
+
message: 'Unknown keys not allowed in strict mode',
|
|
170
|
+
context: {
|
|
171
|
+
code: ErrorCode.VAL004,
|
|
172
|
+
path: sample,
|
|
173
|
+
problem: `Unknown keys: ${keys.join(', ')}`,
|
|
174
|
+
remediation: 'Remove unknown keys or update the schema',
|
|
175
|
+
},
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
export function nullNotAllowedError(path, expected) {
|
|
179
|
+
return new ValidationError({
|
|
180
|
+
message: 'Null value not permitted for this key',
|
|
181
|
+
context: {
|
|
182
|
+
code: ErrorCode.VAL005,
|
|
183
|
+
path,
|
|
184
|
+
expected,
|
|
185
|
+
received: 'null',
|
|
186
|
+
problem: 'This field cannot be null',
|
|
187
|
+
remediation: 'Provide a non-null value or use Type.Union([Type.Null(), ...]) in schema',
|
|
188
|
+
},
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
// Provider Errors
|
|
192
|
+
export function connectionFailedError(provider, details) {
|
|
193
|
+
return new ProviderError({
|
|
194
|
+
message: 'Failed to connect to provider',
|
|
195
|
+
context: {
|
|
196
|
+
code: ErrorCode.PROV001,
|
|
197
|
+
problem: details ?? `Could not connect to ${provider}`,
|
|
198
|
+
remediation: 'Check network connectivity, verify AWS credentials, and ensure region is configured',
|
|
199
|
+
},
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
export function authenticationFailedError(provider, details) {
|
|
203
|
+
return new ProviderError({
|
|
204
|
+
message: 'Provider authentication failed',
|
|
205
|
+
context: {
|
|
206
|
+
code: ErrorCode.PROV002,
|
|
207
|
+
problem: details ?? `Authentication failed for ${provider}`,
|
|
208
|
+
remediation: 'For AWS: Check AWS_PROFILE, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY. Verify IAM permissions (ssm:GetParameters, ssm:PutParameter, ssm:DeleteParameter). Check region configuration.',
|
|
209
|
+
},
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
export function parameterNotFoundError(path, fullPath) {
|
|
213
|
+
return new ProviderError({
|
|
214
|
+
message: 'SSM parameter does not exist',
|
|
215
|
+
context: {
|
|
216
|
+
code: ErrorCode.PROV003,
|
|
217
|
+
path,
|
|
218
|
+
problem: `Parameter not found: ${fullPath}`,
|
|
219
|
+
remediation: 'Verify parameter path, check --env flag matches expected environment',
|
|
220
|
+
},
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
export function encryptionVerificationFailedError(path) {
|
|
224
|
+
return new ProviderError({
|
|
225
|
+
message: 'Parameter is not encrypted as SecureString',
|
|
226
|
+
context: {
|
|
227
|
+
code: ErrorCode.PROV004,
|
|
228
|
+
path,
|
|
229
|
+
problem: 'Parameter may not be encrypted',
|
|
230
|
+
remediation: 'Manually update parameter type in AWS SSM console, or use --skip-encryption-check (not recommended)',
|
|
231
|
+
},
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
export function writePermissionDeniedError(path, details) {
|
|
235
|
+
return new ProviderError({
|
|
236
|
+
message: 'Insufficient permissions to write parameter',
|
|
237
|
+
context: {
|
|
238
|
+
code: ErrorCode.PROV005,
|
|
239
|
+
path,
|
|
240
|
+
problem: details ?? 'Write permission denied',
|
|
241
|
+
remediation: 'Check IAM policy includes ssm:PutParameter action, verify resource ARN matches target parameter path',
|
|
242
|
+
},
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
export function providerGuardMismatchError(provider, details) {
|
|
246
|
+
return new ProviderError({
|
|
247
|
+
message: 'Provider guard check failed',
|
|
248
|
+
context: {
|
|
249
|
+
code: ErrorCode.PROV006,
|
|
250
|
+
problem: `Provider '${provider}': ${details}`,
|
|
251
|
+
remediation: 'Verify providerGuards configuration, or set CONFIG_O_TRON_IGNORE_PROVIDER_GUARDS=1 for emergency override',
|
|
252
|
+
},
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
// CLI Errors
|
|
256
|
+
export function invalidFlagError(flag) {
|
|
257
|
+
return new CLIError({
|
|
258
|
+
message: 'Unknown or invalid command-line flag',
|
|
259
|
+
context: {
|
|
260
|
+
code: ErrorCode.CLI001,
|
|
261
|
+
problem: `Unknown flag: ${flag}`,
|
|
262
|
+
remediation: 'Run config-o-tron <command> --help for available flags',
|
|
263
|
+
},
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
export function missingRequiredArgumentError(argument, command) {
|
|
267
|
+
return new CLIError({
|
|
268
|
+
message: 'Required argument not provided',
|
|
269
|
+
context: {
|
|
270
|
+
code: ErrorCode.CLI002,
|
|
271
|
+
problem: `Missing required argument: ${argument}`,
|
|
272
|
+
remediation: `Check command syntax: config-o-tron ${command} --help`,
|
|
273
|
+
},
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
export function conflictingFlagsError(flags) {
|
|
277
|
+
return new CLIError({
|
|
278
|
+
message: 'Incompatible flags used together',
|
|
279
|
+
context: {
|
|
280
|
+
code: ErrorCode.CLI003,
|
|
281
|
+
problem: `Conflicting flags: ${flags.join(', ')}`,
|
|
282
|
+
remediation: 'Use only one of the conflicting flags',
|
|
283
|
+
},
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
// System Errors
|
|
287
|
+
export function fileNotFoundError(path) {
|
|
288
|
+
return new SystemError({
|
|
289
|
+
message: 'Required file does not exist',
|
|
290
|
+
context: {
|
|
291
|
+
code: ErrorCode.SYS001,
|
|
292
|
+
path,
|
|
293
|
+
problem: `File not found: ${path}`,
|
|
294
|
+
remediation: 'Check file path is correct, verify file permissions (readable)',
|
|
295
|
+
},
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
export function permissionDeniedError(path, operation) {
|
|
299
|
+
return new SystemError({
|
|
300
|
+
message: 'Insufficient filesystem permissions',
|
|
301
|
+
context: {
|
|
302
|
+
code: ErrorCode.SYS002,
|
|
303
|
+
path,
|
|
304
|
+
problem: `Permission denied for ${operation}: ${path}`,
|
|
305
|
+
remediation: 'Check file/directory permissions',
|
|
306
|
+
},
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
export function snapshotSchemaMismatchError(expectedHash, actualHash) {
|
|
310
|
+
return new SystemError({
|
|
311
|
+
message: 'Snapshot schema hash does not match current schema',
|
|
312
|
+
context: {
|
|
313
|
+
code: ErrorCode.SYS003,
|
|
314
|
+
expected: expectedHash,
|
|
315
|
+
received: actualHash,
|
|
316
|
+
problem: 'Schema has changed since snapshot was created',
|
|
317
|
+
remediation: 'Review schema changes since snapshot was created, use --force-schema-mismatch to restore anyway (may cause validation errors), or regenerate snapshot with current schema',
|
|
318
|
+
},
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
export function formatError(error) {
|
|
322
|
+
const { context, message } = error;
|
|
323
|
+
const lines = [];
|
|
324
|
+
// Header
|
|
325
|
+
const errorType = error._tag.replace('Error', ' Error');
|
|
326
|
+
lines.push(`${errorType} [${context.code}]${context.path ? `: ${context.path}` : ''}`);
|
|
327
|
+
lines.push('');
|
|
328
|
+
// Message
|
|
329
|
+
lines.push(` Message: ${message}`);
|
|
330
|
+
// Details
|
|
331
|
+
if (context.expected) {
|
|
332
|
+
lines.push(` Expected: ${context.expected}`);
|
|
333
|
+
}
|
|
334
|
+
if (context.received) {
|
|
335
|
+
lines.push(` Received: ${context.received}`);
|
|
336
|
+
}
|
|
337
|
+
if (context.problem) {
|
|
338
|
+
lines.push(` Problem: ${context.problem}`);
|
|
339
|
+
}
|
|
340
|
+
if (context.location) {
|
|
341
|
+
lines.push(` Location: ${context.location}`);
|
|
342
|
+
}
|
|
343
|
+
lines.push('');
|
|
344
|
+
// Remediation
|
|
345
|
+
if (context.remediation) {
|
|
346
|
+
lines.push(` Remediation: ${context.remediation}`);
|
|
347
|
+
}
|
|
348
|
+
if (context.example) {
|
|
349
|
+
lines.push(` Example: ${context.example}`);
|
|
350
|
+
}
|
|
351
|
+
if (context.availableKeys && context.availableKeys.length > 0) {
|
|
352
|
+
lines.push(` Available keys:`);
|
|
353
|
+
for (const key of context.availableKeys.slice(0, 10)) {
|
|
354
|
+
lines.push(` - ${key}`);
|
|
355
|
+
}
|
|
356
|
+
if (context.availableKeys.length > 10) {
|
|
357
|
+
lines.push(` ... and ${context.availableKeys.length - 10} more`);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
return lines.join('\n');
|
|
361
|
+
}
|
|
362
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,2CAA2C;AAC3C,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;AAEpC,6EAA6E;AAC7E,aAAa;AACb,6EAA6E;AAC7E,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC;AAC9B,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC;AACvC,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC;AACnC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC;AACjC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC;AACjC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAUtC,6EAA6E;AAC7E,cAAc;AACd,6EAA6E;AAC7E,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,oBAAoB;IACpB,MAAM,EAAE,QAAQ,EAAE,eAAe;IACjC,MAAM,EAAE,QAAQ,EAAE,mBAAmB;IACrC,MAAM,EAAE,QAAQ,EAAE,uBAAuB;IACzC,MAAM,EAAE,QAAQ,EAAE,gBAAgB;IAClC,MAAM,EAAE,QAAQ,EAAE,mBAAmB;IAErC,kBAAkB;IAClB,OAAO,EAAE,SAAS,EAA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,IAAI,CAAC,EAAE,CAAC,CAAC;IAEf,cAAc;IACd,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;QACxB,KAAK,CAAC,IAAI,CAAC,kBAAkB,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IACtD,CAAC;IACD,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;QACpB,KAAK,CAAC,IAAI,CAAC,kBAAkB,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IAClD,CAAC;IACD,IAAI,OAAO,CAAC,aAAa,IAAI,OAAO,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9D,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAChC,KAAK,MAAM,GAAG,IAAI,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;YACrD,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC,CAAC;QAC7B,CAAC;QACD,IAAI,OAAO,CAAC,aAAa,CAAC,MAAM,GAAG,EAAE,EAAE,CAAC;YACtC,KAAK,CAAC,IAAI,CAAC,eAAe,OAAO,CAAC,aAAa,CAAC,MAAM,GAAG,EAAE,OAAO,CAAC,CAAC;QACtE,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ConfigOTron - Configuration and Secrets Management Tool
|
|
3
|
+
*
|
|
4
|
+
* Main entry point for programmatic export usage
|
|
5
|
+
*/
|
|
6
|
+
export * from './errors.js';
|
|
7
|
+
export type { ResolvedConfig } from './config.js';
|
|
8
|
+
export type { MergeConflict } from './lib/merge.js';
|
|
9
|
+
export { exportConfig, type ExportApiOptions, type ExportApiResult } from './api.js';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,aAAa,CAAC;AAC5B,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,aAAa,CAAC;AAG5B,OAAO,EAAE,YAAY,EAA+C,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Object Flattening/Unflattening Utilities
|
|
3
|
+
*
|
|
4
|
+
* Converts between nested objects and flat key-value maps
|
|
5
|
+
*/
|
|
6
|
+
export type FlatObject = Record<string, unknown>;
|
|
7
|
+
/**
|
|
8
|
+
* Flatten a nested object to dot-notation paths
|
|
9
|
+
*
|
|
10
|
+
* @param obj - The nested object to flatten
|
|
11
|
+
* @param prefix - Current path prefix (for recursion)
|
|
12
|
+
* @returns Flat object with dot-notation keys
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* flatten({ database: { url: "postgres://..." } })
|
|
16
|
+
* // Returns: { "database.url": "postgres://..." }
|
|
17
|
+
*/
|
|
18
|
+
export declare function flatten(obj: Record<string, unknown>, prefix?: string): FlatObject;
|
|
19
|
+
/**
|
|
20
|
+
* Unflatten a flat object with dot-notation paths to nested structure
|
|
21
|
+
*
|
|
22
|
+
* @param obj - The flat object to unflatten
|
|
23
|
+
* @returns Nested object
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* unflatten({ "database.url": "postgres://..." })
|
|
27
|
+
* // Returns: { database: { url: "postgres://..." } }
|
|
28
|
+
*/
|
|
29
|
+
export declare function unflatten(obj: FlatObject): Record<string, unknown>;
|
|
30
|
+
/**
|
|
31
|
+
* Convert camelCase to SCREAMING_SNAKE_CASE
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* camelToScreamingSnake("timeoutMs") // "TIMEOUT_MS"
|
|
35
|
+
* camelToScreamingSnake("enableBeta") // "ENABLE_BETA"
|
|
36
|
+
* camelToScreamingSnake("API") // "API"
|
|
37
|
+
*/
|
|
38
|
+
export declare function camelToScreamingSnake(str: string): string;
|
|
39
|
+
/**
|
|
40
|
+
* Convert a dot-notation path to an environment variable key
|
|
41
|
+
*
|
|
42
|
+
* @param path - Dot-notation path (e.g., "database.url")
|
|
43
|
+
* @param separator - Key separator (default: "_")
|
|
44
|
+
* @returns Environment variable key (e.g., "DATABASE_URL")
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* pathToEnvKey("database.url") // "DATABASE_URL"
|
|
48
|
+
* pathToEnvKey("api.timeoutMs") // "API_TIMEOUT_MS"
|
|
49
|
+
* pathToEnvKey("feature.enableBeta") // "FEATURE_ENABLE_BETA"
|
|
50
|
+
*/
|
|
51
|
+
export declare function pathToEnvKey(path: string, separator?: string): string;
|
|
52
|
+
/**
|
|
53
|
+
* Convert SCREAMING_SNAKE_CASE to camelCase
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* screamingSnakeToCamel("TIMEOUT_MS") // "timeoutMs"
|
|
57
|
+
* screamingSnakeToCamel("ENABLE_BETA") // "enableBeta"
|
|
58
|
+
*/
|
|
59
|
+
export declare function screamingSnakeToCamel(str: string): string;
|
|
60
|
+
/**
|
|
61
|
+
* Convert an environment variable key to a dot-notation path
|
|
62
|
+
*
|
|
63
|
+
* Note: This is a best-effort conversion. Some information is lost in the
|
|
64
|
+
* camelCase to SCREAMING_SNAKE_CASE conversion. For accurate mapping,
|
|
65
|
+
* use pathToEnvKey to generate env keys and match against schema paths.
|
|
66
|
+
*
|
|
67
|
+
* @param envKey - Environment variable key (e.g., "DATABASE_URL")
|
|
68
|
+
* @param separator - Key separator (default: "_")
|
|
69
|
+
* @returns Dot-notation path (e.g., "database.url")
|
|
70
|
+
*/
|
|
71
|
+
export declare function envKeyToPath(envKey: string, separator?: string): string;
|
|
72
|
+
/**
|
|
73
|
+
* Convert a nested object to a flat map with env-style keys
|
|
74
|
+
*
|
|
75
|
+
* @param obj - Nested object
|
|
76
|
+
* @param separator - Key separator (default: "_")
|
|
77
|
+
* @returns Flat object with SCREAMING_SNAKE_CASE keys
|
|
78
|
+
*/
|
|
79
|
+
export declare function toEnvMap(obj: Record<string, unknown>, separator?: string): Record<string, unknown>;
|
|
80
|
+
/**
|
|
81
|
+
* Get sorted keys from a flat object (case-insensitive sort)
|
|
82
|
+
*/
|
|
83
|
+
export declare function getSortedKeys(obj: FlatObject): ReadonlyArray<string>;
|
|
84
|
+
//# sourceMappingURL=flatten.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flatten.d.ts","sourceRoot":"","sources":["../../src/lib/flatten.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAMjD;;;;;;;;;;GAUG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,SAAK,GAAG,UAAU,CAmB7E;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAuBlE;AAMD;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAOzD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,SAAM,GAAG,MAAM,CAElE;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,SAAM,GAAG,MAAM,CAQpE;AAMD;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,SAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAU/F;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,CAEpE"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Object Flattening/Unflattening Utilities
|
|
3
|
+
*
|
|
4
|
+
* Converts between nested objects and flat key-value maps
|
|
5
|
+
*/
|
|
6
|
+
// --------------------------------------------------------------------------
|
|
7
|
+
// Flattening
|
|
8
|
+
// --------------------------------------------------------------------------
|
|
9
|
+
/**
|
|
10
|
+
* Flatten a nested object to dot-notation paths
|
|
11
|
+
*
|
|
12
|
+
* @param obj - The nested object to flatten
|
|
13
|
+
* @param prefix - Current path prefix (for recursion)
|
|
14
|
+
* @returns Flat object with dot-notation keys
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* flatten({ database: { url: "postgres://..." } })
|
|
18
|
+
* // Returns: { "database.url": "postgres://..." }
|
|
19
|
+
*/
|
|
20
|
+
export function flatten(obj, prefix = '') {
|
|
21
|
+
const result = {};
|
|
22
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
23
|
+
const path = prefix ? `${prefix}.${key}` : key;
|
|
24
|
+
if (value !== null && typeof value === 'object' && !Array.isArray(value)) {
|
|
25
|
+
// Recurse into nested objects
|
|
26
|
+
const nested = flatten(value, path);
|
|
27
|
+
for (const [nestedKey, nestedValue] of Object.entries(nested)) {
|
|
28
|
+
result[nestedKey] = nestedValue;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
// Leaf value (including arrays)
|
|
33
|
+
result[path] = value;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Unflatten a flat object with dot-notation paths to nested structure
|
|
40
|
+
*
|
|
41
|
+
* @param obj - The flat object to unflatten
|
|
42
|
+
* @returns Nested object
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* unflatten({ "database.url": "postgres://..." })
|
|
46
|
+
* // Returns: { database: { url: "postgres://..." } }
|
|
47
|
+
*/
|
|
48
|
+
export function unflatten(obj) {
|
|
49
|
+
const result = {};
|
|
50
|
+
for (const [path, value] of Object.entries(obj)) {
|
|
51
|
+
const segments = path.split('.');
|
|
52
|
+
let current = result;
|
|
53
|
+
for (let i = 0; i < segments.length; i++) {
|
|
54
|
+
const segment = segments[i];
|
|
55
|
+
const isLast = i === segments.length - 1;
|
|
56
|
+
if (isLast) {
|
|
57
|
+
current[segment] = value;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
if (!(segment in current) || typeof current[segment] !== 'object') {
|
|
61
|
+
current[segment] = {};
|
|
62
|
+
}
|
|
63
|
+
current = current[segment];
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return result;
|
|
68
|
+
}
|
|
69
|
+
// --------------------------------------------------------------------------
|
|
70
|
+
// Key Conversion
|
|
71
|
+
// --------------------------------------------------------------------------
|
|
72
|
+
/**
|
|
73
|
+
* Convert camelCase to SCREAMING_SNAKE_CASE
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* camelToScreamingSnake("timeoutMs") // "TIMEOUT_MS"
|
|
77
|
+
* camelToScreamingSnake("enableBeta") // "ENABLE_BETA"
|
|
78
|
+
* camelToScreamingSnake("API") // "API"
|
|
79
|
+
*/
|
|
80
|
+
export function camelToScreamingSnake(str) {
|
|
81
|
+
// Insert underscore before uppercase letters (except at start)
|
|
82
|
+
// Handle consecutive uppercase (e.g., "APIKey" -> "API_KEY")
|
|
83
|
+
return str
|
|
84
|
+
.replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')
|
|
85
|
+
.replace(/([a-z\d])([A-Z])/g, '$1_$2')
|
|
86
|
+
.toUpperCase();
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Convert a dot-notation path to an environment variable key
|
|
90
|
+
*
|
|
91
|
+
* @param path - Dot-notation path (e.g., "database.url")
|
|
92
|
+
* @param separator - Key separator (default: "_")
|
|
93
|
+
* @returns Environment variable key (e.g., "DATABASE_URL")
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* pathToEnvKey("database.url") // "DATABASE_URL"
|
|
97
|
+
* pathToEnvKey("api.timeoutMs") // "API_TIMEOUT_MS"
|
|
98
|
+
* pathToEnvKey("feature.enableBeta") // "FEATURE_ENABLE_BETA"
|
|
99
|
+
*/
|
|
100
|
+
export function pathToEnvKey(path, separator = '_') {
|
|
101
|
+
return path.split('.').map(camelToScreamingSnake).join(separator);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Convert SCREAMING_SNAKE_CASE to camelCase
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* screamingSnakeToCamel("TIMEOUT_MS") // "timeoutMs"
|
|
108
|
+
* screamingSnakeToCamel("ENABLE_BETA") // "enableBeta"
|
|
109
|
+
*/
|
|
110
|
+
export function screamingSnakeToCamel(str) {
|
|
111
|
+
return str.toLowerCase().replace(/_([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Convert an environment variable key to a dot-notation path
|
|
115
|
+
*
|
|
116
|
+
* Note: This is a best-effort conversion. Some information is lost in the
|
|
117
|
+
* camelCase to SCREAMING_SNAKE_CASE conversion. For accurate mapping,
|
|
118
|
+
* use pathToEnvKey to generate env keys and match against schema paths.
|
|
119
|
+
*
|
|
120
|
+
* @param envKey - Environment variable key (e.g., "DATABASE_URL")
|
|
121
|
+
* @param separator - Key separator (default: "_")
|
|
122
|
+
* @returns Dot-notation path (e.g., "database.url")
|
|
123
|
+
*/
|
|
124
|
+
export function envKeyToPath(envKey, separator = '_') {
|
|
125
|
+
// Split by separator (but be careful with consecutive underscores that were part of the word)
|
|
126
|
+
// This is imperfect - we recommend matching against schema instead
|
|
127
|
+
return envKey
|
|
128
|
+
.toLowerCase()
|
|
129
|
+
.split(separator)
|
|
130
|
+
.map((part, i) => (i === 0 ? part : part))
|
|
131
|
+
.join('.');
|
|
132
|
+
}
|
|
133
|
+
// --------------------------------------------------------------------------
|
|
134
|
+
// Batch Operations
|
|
135
|
+
// --------------------------------------------------------------------------
|
|
136
|
+
/**
|
|
137
|
+
* Convert a nested object to a flat map with env-style keys
|
|
138
|
+
*
|
|
139
|
+
* @param obj - Nested object
|
|
140
|
+
* @param separator - Key separator (default: "_")
|
|
141
|
+
* @returns Flat object with SCREAMING_SNAKE_CASE keys
|
|
142
|
+
*/
|
|
143
|
+
export function toEnvMap(obj, separator = '_') {
|
|
144
|
+
const flat = flatten(obj);
|
|
145
|
+
const result = {};
|
|
146
|
+
for (const [path, value] of Object.entries(flat)) {
|
|
147
|
+
const envKey = pathToEnvKey(path, separator);
|
|
148
|
+
result[envKey] = value;
|
|
149
|
+
}
|
|
150
|
+
return result;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Get sorted keys from a flat object (case-insensitive sort)
|
|
154
|
+
*/
|
|
155
|
+
export function getSortedKeys(obj) {
|
|
156
|
+
return Object.keys(obj).sort((a, b) => a.toLowerCase().localeCompare(b.toLowerCase()));
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=flatten.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flatten.js","sourceRoot":"","sources":["../../src/lib/flatten.ts"],"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