@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.
Files changed (45) hide show
  1. package/README.md +6 -4
  2. package/dist/bin/cli.js +0 -15
  3. package/dist/bin/cli.js.map +1 -1
  4. package/dist/bin/commands/get-env.d.ts +16 -0
  5. package/dist/bin/commands/get-env.d.ts.map +1 -0
  6. package/dist/bin/commands/get-env.js +210 -0
  7. package/dist/bin/commands/get-env.js.map +1 -0
  8. package/dist/bin/commands/infer-quilt-config.d.ts +3 -2
  9. package/dist/bin/commands/infer-quilt-config.d.ts.map +1 -1
  10. package/dist/bin/commands/infer-quilt-config.js +39 -65
  11. package/dist/bin/commands/infer-quilt-config.js.map +1 -1
  12. package/dist/bin/commands/setup-wizard.d.ts.map +1 -1
  13. package/dist/bin/commands/setup-wizard.js +105 -110
  14. package/dist/bin/commands/setup-wizard.js.map +1 -1
  15. package/dist/bin/commands/sync-secrets.d.ts +6 -3
  16. package/dist/bin/commands/sync-secrets.d.ts.map +1 -1
  17. package/dist/bin/commands/sync-secrets.js +14 -6
  18. package/dist/bin/commands/sync-secrets.js.map +1 -1
  19. package/dist/lib/interfaces/config-storage.d.ts +80 -0
  20. package/dist/lib/interfaces/config-storage.d.ts.map +1 -0
  21. package/dist/lib/interfaces/config-storage.js +9 -0
  22. package/dist/lib/interfaces/config-storage.js.map +1 -0
  23. package/dist/lib/utils/stack-inference.d.ts +28 -0
  24. package/dist/lib/utils/stack-inference.d.ts.map +1 -1
  25. package/dist/lib/utils/stack-inference.js +61 -0
  26. package/dist/lib/utils/stack-inference.js.map +1 -1
  27. package/dist/lib/xdg-base.d.ts +306 -0
  28. package/dist/lib/xdg-base.d.ts.map +1 -0
  29. package/dist/lib/xdg-base.js +440 -0
  30. package/dist/lib/xdg-base.js.map +1 -0
  31. package/dist/lib/xdg-config.d.ts +54 -187
  32. package/dist/lib/xdg-config.d.ts.map +1 -1
  33. package/dist/lib/xdg-config.js +83 -342
  34. package/dist/lib/xdg-config.js.map +1 -1
  35. package/dist/package.json +4 -3
  36. package/dist/scripts/list-quilt-stacks.d.ts +14 -0
  37. package/dist/scripts/list-quilt-stacks.d.ts.map +1 -0
  38. package/dist/scripts/list-quilt-stacks.js +96 -0
  39. package/dist/scripts/list-quilt-stacks.js.map +1 -0
  40. package/env.template +79 -0
  41. package/package.json +4 -3
  42. package/dist/bin/commands/config-show.d.ts +0 -14
  43. package/dist/bin/commands/config-show.d.ts.map +0 -1
  44. package/dist/bin/commands/config-show.js +0 -24
  45. package/dist/bin/commands/config-show.js.map +0 -1
@@ -0,0 +1,440 @@
1
+ "use strict";
2
+ /**
3
+ * XDG Base Abstract Class (v0.7.0)
4
+ *
5
+ * Abstract base class containing all shared business logic for configuration management.
6
+ * Concrete implementations (XDGConfig, XDGTest) provide storage primitives.
7
+ *
8
+ * This separation allows:
9
+ * - Shared validation, inheritance, and error handling logic in one place
10
+ * - Multiple storage backends (filesystem, in-memory) with identical behavior
11
+ * - Better test coverage by exercising business logic through both implementations
12
+ *
13
+ * @module xdg-base
14
+ * @version 0.7.0
15
+ */
16
+ var __importDefault = (this && this.__importDefault) || function (mod) {
17
+ return (mod && mod.__esModule) ? mod : { "default": mod };
18
+ };
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.XDGBase = void 0;
21
+ const ajv_1 = __importDefault(require("ajv"));
22
+ const ajv_formats_1 = __importDefault(require("ajv-formats"));
23
+ const lodash_merge_1 = __importDefault(require("lodash.merge"));
24
+ const config_1 = require("./types/config");
25
+ /**
26
+ * Abstract base class for XDG configuration management
27
+ *
28
+ * Implements IConfigStorage interface with all business logic.
29
+ * Subclasses must implement abstract storage primitives for their specific storage mechanism.
30
+ *
31
+ * @abstract
32
+ * @example
33
+ * ```typescript
34
+ * // Filesystem implementation
35
+ * class XDGConfig extends XDGBase {
36
+ * protected readProfileRaw(profile: string): ProfileConfig {
37
+ * const data = readFileSync(this.getProfilePath(profile), "utf-8");
38
+ * return JSON.parse(data);
39
+ * }
40
+ * // ... other primitives
41
+ * }
42
+ *
43
+ * // In-memory implementation
44
+ * class XDGTest extends XDGBase {
45
+ * private profiles = new Map<string, ProfileConfig>();
46
+ * protected readProfileRaw(profile: string): ProfileConfig {
47
+ * const config = this.profiles.get(profile);
48
+ * if (!config) throw new Error(`Profile not found: ${profile}`);
49
+ * return config;
50
+ * }
51
+ * // ... other primitives
52
+ * }
53
+ * ```
54
+ */
55
+ class XDGBase {
56
+ // ====================================================================
57
+ // Configuration Management (Public API with Business Logic)
58
+ // ====================================================================
59
+ /**
60
+ * Reads configuration for a profile with validation
61
+ *
62
+ * @param profile - Profile name (e.g., "default", "dev", "prod")
63
+ * @returns Validated configuration object
64
+ * @throws {Error} If profile not found or configuration is invalid
65
+ *
66
+ * @example
67
+ * ```typescript
68
+ * const config = storage.readProfile("default");
69
+ * console.log(config.benchling.tenant);
70
+ * ```
71
+ */
72
+ readProfile(profile) {
73
+ if (!this.profileExistsRaw(profile)) {
74
+ throw new Error(this.buildProfileNotFoundError(profile));
75
+ }
76
+ let config;
77
+ try {
78
+ config = this.readProfileRaw(profile);
79
+ }
80
+ catch (error) {
81
+ throw new Error(`Failed to read profile "${profile}": ${error.message}`);
82
+ }
83
+ // Validate schema
84
+ const validation = this.validateProfile(config);
85
+ if (!validation.isValid) {
86
+ throw new Error(`Invalid configuration for profile "${profile}":\n${validation.errors.join("\n")}`);
87
+ }
88
+ return config;
89
+ }
90
+ /**
91
+ * Writes configuration for a profile with validation
92
+ *
93
+ * Creates the profile if it doesn't exist.
94
+ *
95
+ * @param profile - Profile name
96
+ * @param config - Configuration object to write
97
+ * @throws {Error} If validation fails or write operation fails
98
+ *
99
+ * @example
100
+ * ```typescript
101
+ * storage.writeProfile("default", {
102
+ * quilt: { ... },
103
+ * benchling: { ... },
104
+ * packages: { ... },
105
+ * deployment: { ... },
106
+ * _metadata: {
107
+ * version: "0.7.0",
108
+ * createdAt: new Date().toISOString(),
109
+ * updatedAt: new Date().toISOString(),
110
+ * source: "wizard"
111
+ * }
112
+ * });
113
+ * ```
114
+ */
115
+ writeProfile(profile, config) {
116
+ // Validate configuration before writing
117
+ const validation = this.validateProfile(config);
118
+ if (!validation.isValid) {
119
+ throw new Error(`Invalid configuration:\n${validation.errors.join("\n")}`);
120
+ }
121
+ try {
122
+ this.writeProfileRaw(profile, config);
123
+ }
124
+ catch (error) {
125
+ throw new Error(`Failed to write profile "${profile}": ${error.message}`);
126
+ }
127
+ }
128
+ /**
129
+ * Deletes a profile and all its data
130
+ *
131
+ * WARNING: This is a destructive operation!
132
+ * Cannot delete the "default" profile.
133
+ *
134
+ * @param profile - Profile name to delete
135
+ * @throws {Error} If attempting to delete default profile or if deletion fails
136
+ *
137
+ * @example
138
+ * ```typescript
139
+ * storage.deleteProfile("dev");
140
+ * ```
141
+ */
142
+ deleteProfile(profile) {
143
+ if (profile === "default") {
144
+ throw new Error("Cannot delete the default profile");
145
+ }
146
+ if (!this.profileExistsRaw(profile)) {
147
+ throw new Error(`Profile does not exist: ${profile}`);
148
+ }
149
+ try {
150
+ this.deleteProfileRaw(profile);
151
+ }
152
+ catch (error) {
153
+ throw new Error(`Failed to delete profile "${profile}": ${error.message}`);
154
+ }
155
+ }
156
+ /**
157
+ * Lists all available profiles
158
+ *
159
+ * @returns Array of profile names
160
+ *
161
+ * @example
162
+ * ```typescript
163
+ * const profiles = storage.listProfiles();
164
+ * console.log(profiles); // ["default", "dev", "prod"]
165
+ * ```
166
+ */
167
+ listProfiles() {
168
+ return this.listProfilesRaw();
169
+ }
170
+ /**
171
+ * Checks if a profile exists
172
+ *
173
+ * @param profile - Profile name to check
174
+ * @returns True if profile exists and has valid configuration, false otherwise
175
+ *
176
+ * @example
177
+ * ```typescript
178
+ * if (storage.profileExists("dev")) {
179
+ * const config = storage.readProfile("dev");
180
+ * }
181
+ * ```
182
+ */
183
+ profileExists(profile) {
184
+ return this.profileExistsRaw(profile);
185
+ }
186
+ // ====================================================================
187
+ // Deployment Tracking (Public API with Business Logic)
188
+ // ====================================================================
189
+ /**
190
+ * Gets deployment history for a profile with validation
191
+ *
192
+ * Returns empty history if deployments don't exist.
193
+ *
194
+ * @param profile - Profile name
195
+ * @returns Deployment history with active deployments and full history
196
+ *
197
+ * @example
198
+ * ```typescript
199
+ * const deployments = storage.getDeployments("default");
200
+ * console.log(deployments.active["prod"]); // Active prod deployment
201
+ * console.log(deployments.history[0]); // Most recent deployment
202
+ * ```
203
+ */
204
+ getDeployments(profile) {
205
+ let deployments;
206
+ try {
207
+ deployments = this.readDeploymentsRaw(profile);
208
+ }
209
+ catch (error) {
210
+ throw new Error(`Failed to read deployments for profile "${profile}": ${error.message}`);
211
+ }
212
+ // Return empty history if none exists
213
+ if (!deployments) {
214
+ return {
215
+ active: {},
216
+ history: [],
217
+ };
218
+ }
219
+ // Validate schema
220
+ const ajv = new ajv_1.default();
221
+ (0, ajv_formats_1.default)(ajv);
222
+ const validate = ajv.compile(config_1.DeploymentHistorySchema);
223
+ const valid = validate(deployments);
224
+ if (!valid) {
225
+ const errors = validate.errors?.map((err) => `${err.instancePath} ${err.message}`).join(", ");
226
+ throw new Error(`Invalid deployment history schema for profile "${profile}": ${errors}`);
227
+ }
228
+ return deployments;
229
+ }
230
+ /**
231
+ * Records a new deployment for a profile
232
+ *
233
+ * Adds deployment to history and updates active deployment for the stage.
234
+ * Creates deployment history if it doesn't exist.
235
+ *
236
+ * @param profile - Profile name
237
+ * @param deployment - Deployment record to add
238
+ *
239
+ * @example
240
+ * ```typescript
241
+ * storage.recordDeployment("default", {
242
+ * stage: "prod",
243
+ * timestamp: new Date().toISOString(),
244
+ * imageTag: "0.7.0",
245
+ * endpoint: "https://abc123.execute-api.us-east-1.amazonaws.com/prod",
246
+ * stackName: "BenchlingWebhookStack",
247
+ * region: "us-east-1",
248
+ * deployedBy: "ernest@example.com",
249
+ * commit: "abc123f"
250
+ * });
251
+ * ```
252
+ */
253
+ recordDeployment(profile, deployment) {
254
+ // Load existing deployments or create new
255
+ let deployments;
256
+ try {
257
+ deployments = this.getDeployments(profile);
258
+ }
259
+ catch {
260
+ // If getDeployments fails, start with empty history
261
+ deployments = {
262
+ active: {},
263
+ history: [],
264
+ };
265
+ }
266
+ // Add to history (newest first)
267
+ deployments.history.unshift(deployment);
268
+ // Update active deployment for this stage
269
+ deployments.active[deployment.stage] = deployment;
270
+ // Write deployments
271
+ try {
272
+ this.writeDeploymentsRaw(profile, deployments);
273
+ }
274
+ catch (error) {
275
+ throw new Error(`Failed to record deployment for profile "${profile}": ${error.message}`);
276
+ }
277
+ }
278
+ /**
279
+ * Gets the active deployment for a specific stage
280
+ *
281
+ * @param profile - Profile name
282
+ * @param stage - Stage name (e.g., "dev", "prod")
283
+ * @returns Active deployment record for the stage, or null if none exists
284
+ *
285
+ * @example
286
+ * ```typescript
287
+ * const prodDeployment = storage.getActiveDeployment("default", "prod");
288
+ * if (prodDeployment) {
289
+ * console.log("Prod endpoint:", prodDeployment.endpoint);
290
+ * }
291
+ * ```
292
+ */
293
+ getActiveDeployment(profile, stage) {
294
+ try {
295
+ const deployments = this.getDeployments(profile);
296
+ return deployments.active[stage] || null;
297
+ }
298
+ catch {
299
+ return null;
300
+ }
301
+ }
302
+ // ====================================================================
303
+ // Profile Inheritance (Business Logic)
304
+ // ====================================================================
305
+ /**
306
+ * Reads profile configuration with inheritance support
307
+ *
308
+ * If the profile has an `_inherits` field, loads the base profile first
309
+ * and deep merges the current profile on top.
310
+ *
311
+ * Detects and prevents circular inheritance chains.
312
+ *
313
+ * @param profile - Profile name to read
314
+ * @param baseProfile - Optional explicit base profile (overrides `_inherits`)
315
+ * @returns Merged configuration with inheritance applied
316
+ * @throws {Error} If circular inheritance is detected
317
+ *
318
+ * @example
319
+ * ```typescript
320
+ * // dev/config.json has "_inherits": "default"
321
+ * const devConfig = storage.readProfileWithInheritance("dev");
322
+ * // Returns default config deep-merged with dev overrides
323
+ * ```
324
+ */
325
+ readProfileWithInheritance(profile, baseProfile) {
326
+ const visited = new Set();
327
+ return this.readProfileWithInheritanceInternal(profile, baseProfile, visited);
328
+ }
329
+ /**
330
+ * Internal recursive implementation of profile inheritance
331
+ *
332
+ * @param profile - Current profile name
333
+ * @param explicitBase - Explicitly specified base profile
334
+ * @param visited - Set of visited profiles (for circular detection)
335
+ * @returns Merged configuration
336
+ * @throws {Error} If circular inheritance is detected
337
+ */
338
+ readProfileWithInheritanceInternal(profile, explicitBase, visited) {
339
+ // Detect circular inheritance
340
+ if (visited.has(profile)) {
341
+ const chain = Array.from(visited).join(" -> ");
342
+ throw new Error(`Circular inheritance detected: ${chain} -> ${profile}`);
343
+ }
344
+ visited.add(profile);
345
+ // Read current profile
346
+ const config = this.readProfile(profile);
347
+ // Determine base profile
348
+ const baseProfileName = explicitBase || config._inherits;
349
+ // No inheritance - return as-is
350
+ if (!baseProfileName) {
351
+ return config;
352
+ }
353
+ // Load base profile with inheritance
354
+ const baseConfig = this.readProfileWithInheritanceInternal(baseProfileName, undefined, visited);
355
+ // Deep merge: base config first, then current profile overrides
356
+ const merged = this.deepMergeConfigs(baseConfig, config);
357
+ // Remove _inherits from final result (it's already applied)
358
+ delete merged._inherits;
359
+ return merged;
360
+ }
361
+ /**
362
+ * Deep merges two profile configurations
363
+ *
364
+ * Nested objects are merged recursively.
365
+ * Arrays are replaced (not concatenated).
366
+ * Current config takes precedence over base config.
367
+ *
368
+ * @param base - Base configuration
369
+ * @param current - Current configuration (takes precedence)
370
+ * @returns Merged configuration
371
+ */
372
+ deepMergeConfigs(base, current) {
373
+ return (0, lodash_merge_1.default)({}, base, current);
374
+ }
375
+ // ====================================================================
376
+ // Validation (Business Logic)
377
+ // ====================================================================
378
+ /**
379
+ * Validates a profile configuration against the schema
380
+ *
381
+ * @param config - Configuration object to validate
382
+ * @returns Validation result with errors and warnings
383
+ *
384
+ * @example
385
+ * ```typescript
386
+ * const validation = storage.validateProfile(config);
387
+ * if (!validation.isValid) {
388
+ * console.error("Validation errors:", validation.errors);
389
+ * }
390
+ * ```
391
+ */
392
+ validateProfile(config) {
393
+ const ajv = new ajv_1.default({ allErrors: true, strict: false });
394
+ (0, ajv_formats_1.default)(ajv);
395
+ const validate = ajv.compile(config_1.ProfileConfigSchema);
396
+ const valid = validate(config);
397
+ if (valid) {
398
+ return {
399
+ isValid: true,
400
+ errors: [],
401
+ warnings: [],
402
+ };
403
+ }
404
+ const errors = validate.errors?.map((err) => {
405
+ const path = err.instancePath || "(root)";
406
+ return `${path}: ${err.message}`;
407
+ }) || [];
408
+ return {
409
+ isValid: false,
410
+ errors,
411
+ warnings: [],
412
+ };
413
+ }
414
+ // ====================================================================
415
+ // Error Messages (Business Logic)
416
+ // ====================================================================
417
+ /**
418
+ * Builds a helpful error message when a profile is not found
419
+ *
420
+ * Subclasses can override this to add storage-specific detection
421
+ * (e.g., legacy file detection for filesystem storage).
422
+ *
423
+ * @param profile - Profile name that was not found
424
+ * @returns Formatted error message
425
+ */
426
+ buildProfileNotFoundError(profile) {
427
+ return `
428
+ Profile not found: ${profile}
429
+
430
+ No configuration found for profile: ${profile}
431
+
432
+ Run setup wizard to create configuration:
433
+ npx @quiltdata/benchling-webhook@latest setup
434
+
435
+ Available profiles: ${this.listProfiles().join(", ") || "(none)"}
436
+ `.trim();
437
+ }
438
+ }
439
+ exports.XDGBase = XDGBase;
440
+ //# sourceMappingURL=xdg-base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xdg-base.js","sourceRoot":"","sources":["../../lib/xdg-base.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;;;;AAEH,8CAAsB;AACtB,8DAAqC;AACrC,gEAAiC;AACjC,2CAOwB;AAGxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAsB,OAAO;IAgEzB,uEAAuE;IACvE,4DAA4D;IAC5D,uEAAuE;IAEvE;;;;;;;;;;;;OAYG;IACI,WAAW,CAAC,OAAe;QAC9B,IAAI,CAAC,IAAI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