@quiltdata/benchling-webhook 0.7.4-20251107T053446Z → 0.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -4
- package/dist/bin/cli.js +0 -15
- package/dist/bin/cli.js.map +1 -1
- package/dist/bin/commands/get-env.d.ts +16 -0
- package/dist/bin/commands/get-env.d.ts.map +1 -0
- package/dist/bin/commands/get-env.js +210 -0
- package/dist/bin/commands/get-env.js.map +1 -0
- package/dist/bin/commands/infer-quilt-config.d.ts +3 -2
- package/dist/bin/commands/infer-quilt-config.d.ts.map +1 -1
- package/dist/bin/commands/infer-quilt-config.js +39 -65
- package/dist/bin/commands/infer-quilt-config.js.map +1 -1
- package/dist/bin/commands/setup-wizard.d.ts.map +1 -1
- package/dist/bin/commands/setup-wizard.js +105 -110
- package/dist/bin/commands/setup-wizard.js.map +1 -1
- package/dist/bin/commands/sync-secrets.d.ts +6 -3
- package/dist/bin/commands/sync-secrets.d.ts.map +1 -1
- package/dist/bin/commands/sync-secrets.js +14 -6
- package/dist/bin/commands/sync-secrets.js.map +1 -1
- package/dist/lib/interfaces/config-storage.d.ts +80 -0
- package/dist/lib/interfaces/config-storage.d.ts.map +1 -0
- package/dist/lib/interfaces/config-storage.js +9 -0
- package/dist/lib/interfaces/config-storage.js.map +1 -0
- package/dist/lib/utils/stack-inference.d.ts +28 -0
- package/dist/lib/utils/stack-inference.d.ts.map +1 -1
- package/dist/lib/utils/stack-inference.js +61 -0
- package/dist/lib/utils/stack-inference.js.map +1 -1
- package/dist/lib/xdg-base.d.ts +306 -0
- package/dist/lib/xdg-base.d.ts.map +1 -0
- package/dist/lib/xdg-base.js +440 -0
- package/dist/lib/xdg-base.js.map +1 -0
- package/dist/lib/xdg-config.d.ts +54 -187
- package/dist/lib/xdg-config.d.ts.map +1 -1
- package/dist/lib/xdg-config.js +83 -342
- package/dist/lib/xdg-config.js.map +1 -1
- package/dist/package.json +4 -3
- package/dist/scripts/list-quilt-stacks.d.ts +14 -0
- package/dist/scripts/list-quilt-stacks.d.ts.map +1 -0
- package/dist/scripts/list-quilt-stacks.js +96 -0
- package/dist/scripts/list-quilt-stacks.js.map +1 -0
- package/env.template +79 -0
- package/package.json +4 -3
- package/dist/bin/commands/config-show.d.ts +0 -14
- package/dist/bin/commands/config-show.d.ts.map +0 -1
- package/dist/bin/commands/config-show.js +0 -24
- package/dist/bin/commands/config-show.js.map +0 -1
package/dist/lib/xdg-config.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* XDG Configuration Management (v0.7.0 - BREAKING CHANGE)
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Filesystem implementation of XDGBase for XDG-compliant configuration management.
|
|
5
5
|
*
|
|
6
|
-
* This module provides
|
|
7
|
-
*
|
|
6
|
+
* This module provides filesystem-specific storage primitives for the Benchling Webhook system:
|
|
7
|
+
* - Filesystem-based profile storage in ~/.config/benchling-webhook/
|
|
8
|
+
* - Per-profile deployment tracking
|
|
9
|
+
* - Legacy configuration detection
|
|
10
|
+
* - Atomic writes with automatic backups
|
|
8
11
|
*
|
|
9
|
-
*
|
|
10
|
-
* - Per-profile deployment tracking (`deployments.json`)
|
|
11
|
-
* - Profile inheritance support with deep merging
|
|
12
|
-
* - Comprehensive validation and helpful error messages
|
|
12
|
+
* All business logic (validation, inheritance, deployment tracking) is handled by XDGBase.
|
|
13
13
|
*
|
|
14
14
|
* Directory Structure:
|
|
15
15
|
* ```
|
|
@@ -25,10 +25,12 @@
|
|
|
25
25
|
* @module xdg-config
|
|
26
26
|
* @version 0.7.0
|
|
27
27
|
*/
|
|
28
|
-
import { ProfileConfig, DeploymentHistory
|
|
28
|
+
import { ProfileConfig, DeploymentHistory } from "./types/config";
|
|
29
|
+
import { XDGBase } from "./xdg-base";
|
|
29
30
|
/**
|
|
30
31
|
* XDG Configuration Manager (v0.7.0)
|
|
31
32
|
*
|
|
33
|
+
* Filesystem-based implementation extending XDGBase.
|
|
32
34
|
* Manages profile-based configuration with deployment tracking.
|
|
33
35
|
* NO backward compatibility with v0.6.x configuration files.
|
|
34
36
|
*
|
|
@@ -53,7 +55,7 @@ import { ProfileConfig, DeploymentHistory, DeploymentRecord, ValidationResult }
|
|
|
53
55
|
* });
|
|
54
56
|
* ```
|
|
55
57
|
*/
|
|
56
|
-
export declare class XDGConfig {
|
|
58
|
+
export declare class XDGConfig extends XDGBase {
|
|
57
59
|
private readonly baseDir;
|
|
58
60
|
/**
|
|
59
61
|
* Creates a new XDG Configuration Manager
|
|
@@ -62,222 +64,81 @@ export declare class XDGConfig {
|
|
|
62
64
|
*/
|
|
63
65
|
constructor(baseDir?: string);
|
|
64
66
|
/**
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
* Respects XDG_CONFIG_HOME environment variable per XDG Base Directory spec.
|
|
67
|
+
* Reads raw profile configuration from filesystem without validation
|
|
68
68
|
*
|
|
69
|
-
* @
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Ensures the base configuration directory exists
|
|
74
|
-
*
|
|
75
|
-
* @throws {Error} If directory creation fails
|
|
76
|
-
*/
|
|
77
|
-
private ensureBaseDirectoryExists;
|
|
78
|
-
/**
|
|
79
|
-
* Reads configuration for a profile
|
|
80
|
-
*
|
|
81
|
-
* @param profile - Profile name (e.g., "default", "dev", "prod")
|
|
82
|
-
* @returns Parsed configuration object
|
|
83
|
-
* @throws {Error} If profile not found or configuration is invalid
|
|
84
|
-
*
|
|
85
|
-
* @example
|
|
86
|
-
* ```typescript
|
|
87
|
-
* const config = xdg.readProfile("default");
|
|
88
|
-
* console.log(config.benchling.tenant);
|
|
89
|
-
* ```
|
|
69
|
+
* @param profile - Profile name
|
|
70
|
+
* @returns Raw profile configuration
|
|
71
|
+
* @throws {Error} If profile cannot be read
|
|
90
72
|
*/
|
|
91
|
-
|
|
73
|
+
protected readProfileRaw(profile: string): ProfileConfig;
|
|
92
74
|
/**
|
|
93
|
-
* Writes configuration
|
|
75
|
+
* Writes raw profile configuration to filesystem without validation
|
|
94
76
|
*
|
|
95
77
|
* Creates the profile directory if it doesn't exist.
|
|
96
78
|
* Performs atomic write with automatic backup.
|
|
97
79
|
*
|
|
98
80
|
* @param profile - Profile name
|
|
99
|
-
* @param config - Configuration
|
|
100
|
-
* @throws {Error} If
|
|
101
|
-
*
|
|
102
|
-
* @example
|
|
103
|
-
* ```typescript
|
|
104
|
-
* xdg.writeProfile("default", {
|
|
105
|
-
* quilt: { ... },
|
|
106
|
-
* benchling: { ... },
|
|
107
|
-
* packages: { ... },
|
|
108
|
-
* deployment: { ... },
|
|
109
|
-
* _metadata: {
|
|
110
|
-
* version: "0.7.0",
|
|
111
|
-
* createdAt: new Date().toISOString(),
|
|
112
|
-
* updatedAt: new Date().toISOString(),
|
|
113
|
-
* source: "wizard"
|
|
114
|
-
* }
|
|
115
|
-
* });
|
|
116
|
-
* ```
|
|
81
|
+
* @param config - Configuration to write
|
|
82
|
+
* @throws {Error} If write fails
|
|
117
83
|
*/
|
|
118
|
-
|
|
84
|
+
protected writeProfileRaw(profile: string, config: ProfileConfig): void;
|
|
119
85
|
/**
|
|
120
|
-
* Deletes
|
|
121
|
-
*
|
|
122
|
-
* WARNING: This is a destructive operation!
|
|
123
|
-
* Cannot delete the "default" profile.
|
|
124
|
-
*
|
|
125
|
-
* @param profile - Profile name to delete
|
|
126
|
-
* @throws {Error} If attempting to delete default profile or if deletion fails
|
|
86
|
+
* Deletes profile and all associated data from filesystem
|
|
127
87
|
*
|
|
128
|
-
* @
|
|
129
|
-
*
|
|
130
|
-
* xdg.deleteProfile("dev");
|
|
131
|
-
* ```
|
|
88
|
+
* @param profile - Profile name
|
|
89
|
+
* @throws {Error} If deletion fails
|
|
132
90
|
*/
|
|
133
|
-
|
|
91
|
+
protected deleteProfileRaw(profile: string): void;
|
|
134
92
|
/**
|
|
135
|
-
* Lists all
|
|
93
|
+
* Lists all profile names from filesystem
|
|
136
94
|
*
|
|
137
95
|
* @returns Array of profile names
|
|
138
|
-
*
|
|
139
|
-
* @example
|
|
140
|
-
* ```typescript
|
|
141
|
-
* const profiles = xdg.listProfiles();
|
|
142
|
-
* console.log(profiles); // ["default", "dev", "prod"]
|
|
143
|
-
* ```
|
|
144
|
-
*/
|
|
145
|
-
listProfiles(): string[];
|
|
146
|
-
/**
|
|
147
|
-
* Checks if a profile exists
|
|
148
|
-
*
|
|
149
|
-
* @param profile - Profile name to check
|
|
150
|
-
* @returns True if profile exists and has valid config.json, false otherwise
|
|
151
|
-
*
|
|
152
|
-
* @example
|
|
153
|
-
* ```typescript
|
|
154
|
-
* if (xdg.profileExists("dev")) {
|
|
155
|
-
* const config = xdg.readProfile("dev");
|
|
156
|
-
* }
|
|
157
|
-
* ```
|
|
158
96
|
*/
|
|
159
|
-
|
|
97
|
+
protected listProfilesRaw(): string[];
|
|
160
98
|
/**
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
* Returns empty history if deployments.json doesn't exist.
|
|
99
|
+
* Checks if profile exists on filesystem
|
|
164
100
|
*
|
|
165
101
|
* @param profile - Profile name
|
|
166
|
-
* @returns
|
|
167
|
-
*
|
|
168
|
-
* @example
|
|
169
|
-
* ```typescript
|
|
170
|
-
* const deployments = xdg.getDeployments("default");
|
|
171
|
-
* console.log(deployments.active["prod"]); // Active prod deployment
|
|
172
|
-
* console.log(deployments.history[0]); // Most recent deployment
|
|
173
|
-
* ```
|
|
102
|
+
* @returns True if profile exists
|
|
174
103
|
*/
|
|
175
|
-
|
|
104
|
+
protected profileExistsRaw(profile: string): boolean;
|
|
176
105
|
/**
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
* Adds deployment to history and updates active deployment for the stage.
|
|
180
|
-
* Creates deployments.json if it doesn't exist.
|
|
106
|
+
* Reads raw deployment history from filesystem without validation
|
|
181
107
|
*
|
|
182
108
|
* @param profile - Profile name
|
|
183
|
-
* @
|
|
184
|
-
*
|
|
185
|
-
* @example
|
|
186
|
-
* ```typescript
|
|
187
|
-
* xdg.recordDeployment("default", {
|
|
188
|
-
* stage: "prod",
|
|
189
|
-
* timestamp: new Date().toISOString(),
|
|
190
|
-
* imageTag: "0.7.0",
|
|
191
|
-
* endpoint: "https://abc123.execute-api.us-east-1.amazonaws.com/prod",
|
|
192
|
-
* stackName: "BenchlingWebhookStack",
|
|
193
|
-
* region: "us-east-1",
|
|
194
|
-
* deployedBy: "ernest@example.com",
|
|
195
|
-
* commit: "abc123f"
|
|
196
|
-
* });
|
|
197
|
-
* ```
|
|
109
|
+
* @returns Deployment history or null if none exists
|
|
110
|
+
* @throws {Error} If read fails
|
|
198
111
|
*/
|
|
199
|
-
|
|
112
|
+
protected readDeploymentsRaw(profile: string): DeploymentHistory | null;
|
|
200
113
|
/**
|
|
201
|
-
*
|
|
114
|
+
* Writes raw deployment history to filesystem without validation
|
|
202
115
|
*
|
|
203
116
|
* @param profile - Profile name
|
|
204
|
-
* @param
|
|
205
|
-
* @
|
|
206
|
-
*
|
|
207
|
-
* @example
|
|
208
|
-
* ```typescript
|
|
209
|
-
* const prodDeployment = xdg.getActiveDeployment("default", "prod");
|
|
210
|
-
* if (prodDeployment) {
|
|
211
|
-
* console.log("Prod endpoint:", prodDeployment.endpoint);
|
|
212
|
-
* }
|
|
213
|
-
* ```
|
|
117
|
+
* @param history - Deployment history to write
|
|
118
|
+
* @throws {Error} If write fails
|
|
214
119
|
*/
|
|
215
|
-
|
|
120
|
+
protected writeDeploymentsRaw(profile: string, history: DeploymentHistory): void;
|
|
216
121
|
/**
|
|
217
|
-
*
|
|
218
|
-
*
|
|
219
|
-
* If the profile has an `_inherits` field, loads the base profile first
|
|
220
|
-
* and deep merges the current profile on top.
|
|
221
|
-
*
|
|
222
|
-
* Detects and prevents circular inheritance chains.
|
|
223
|
-
*
|
|
224
|
-
* @param profile - Profile name to read
|
|
225
|
-
* @param baseProfile - Optional explicit base profile (overrides `_inherits`)
|
|
226
|
-
* @returns Merged configuration with inheritance applied
|
|
227
|
-
* @throws {Error} If circular inheritance is detected
|
|
228
|
-
*
|
|
229
|
-
* @example
|
|
230
|
-
* ```typescript
|
|
231
|
-
* // dev/config.json has "_inherits": "default"
|
|
232
|
-
* const devConfig = xdg.readProfileWithInheritance("dev");
|
|
233
|
-
* // Returns default config deep-merged with dev overrides
|
|
234
|
-
* ```
|
|
235
|
-
*/
|
|
236
|
-
readProfileWithInheritance(profile: string, baseProfile?: string): ProfileConfig;
|
|
237
|
-
/**
|
|
238
|
-
* Internal recursive implementation of profile inheritance
|
|
239
|
-
*
|
|
240
|
-
* @param profile - Current profile name
|
|
241
|
-
* @param explicitBase - Explicitly specified base profile
|
|
242
|
-
* @param visited - Set of visited profiles (for circular detection)
|
|
243
|
-
* @returns Merged configuration
|
|
244
|
-
* @throws {Error} If circular inheritance is detected
|
|
245
|
-
*/
|
|
246
|
-
private readProfileWithInheritanceInternal;
|
|
247
|
-
/**
|
|
248
|
-
* Deep merges two profile configurations
|
|
122
|
+
* Gets the default XDG base directory
|
|
249
123
|
*
|
|
250
|
-
*
|
|
251
|
-
* Arrays are replaced (not concatenated).
|
|
252
|
-
* Current config takes precedence over base config.
|
|
124
|
+
* Respects XDG_CONFIG_HOME environment variable per XDG Base Directory spec.
|
|
253
125
|
*
|
|
254
|
-
* @
|
|
255
|
-
* @param current - Current configuration (takes precedence)
|
|
256
|
-
* @returns Merged configuration
|
|
126
|
+
* @returns The default base directory path (~/.config/benchling-webhook or $XDG_CONFIG_HOME/benchling-webhook)
|
|
257
127
|
*/
|
|
258
|
-
private
|
|
128
|
+
private getDefaultBaseDir;
|
|
259
129
|
/**
|
|
260
|
-
*
|
|
261
|
-
*
|
|
262
|
-
* @param config - Configuration object to validate
|
|
263
|
-
* @returns Validation result with errors and warnings
|
|
130
|
+
* Ensures the base configuration directory exists
|
|
264
131
|
*
|
|
265
|
-
* @
|
|
266
|
-
* ```typescript
|
|
267
|
-
* const validation = xdg.validateProfile(config);
|
|
268
|
-
* if (!validation.isValid) {
|
|
269
|
-
* console.error("Validation errors:", validation.errors);
|
|
270
|
-
* }
|
|
271
|
-
* ```
|
|
132
|
+
* @throws {Error} If directory creation fails
|
|
272
133
|
*/
|
|
273
|
-
|
|
134
|
+
private ensureBaseDirectoryExists;
|
|
274
135
|
/**
|
|
275
136
|
* Gets the directory path for a profile
|
|
276
137
|
*
|
|
277
138
|
* @param profile - Profile name
|
|
278
139
|
* @returns Absolute path to profile directory
|
|
279
140
|
*/
|
|
280
|
-
private
|
|
141
|
+
private getProfilePath;
|
|
281
142
|
/**
|
|
282
143
|
* Gets the config.json path for a profile
|
|
283
144
|
*
|
|
@@ -291,15 +152,21 @@ export declare class XDGConfig {
|
|
|
291
152
|
* @param profile - Profile name
|
|
292
153
|
* @returns Absolute path to deployments.json
|
|
293
154
|
*/
|
|
294
|
-
private
|
|
155
|
+
private getDeploymentsPath;
|
|
156
|
+
/**
|
|
157
|
+
* Detects legacy v0.6.x configuration files
|
|
158
|
+
*
|
|
159
|
+
* @returns True if legacy files are detected
|
|
160
|
+
*/
|
|
161
|
+
detectLegacyConfiguration(): boolean;
|
|
295
162
|
/**
|
|
296
163
|
* Builds a helpful error message when a profile is not found
|
|
297
164
|
*
|
|
298
|
-
*
|
|
165
|
+
* Overrides base class to add legacy configuration detection.
|
|
299
166
|
*
|
|
300
167
|
* @param profile - Profile name that was not found
|
|
301
168
|
* @returns Formatted error message
|
|
302
169
|
*/
|
|
303
|
-
|
|
170
|
+
protected buildProfileNotFoundError(profile: string): string;
|
|
304
171
|
}
|
|
305
172
|
//# sourceMappingURL=xdg-config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xdg-config.d.ts","sourceRoot":"","sources":["../../lib/xdg-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;
|
|
1
|
+
{"version":3,"file":"xdg-config.d.ts","sourceRoot":"","sources":["../../lib/xdg-config.ts"],"names":[],"mappings":"AAA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