@quiltdata/benchling-webhook 0.6.3-20251104T182406Z → 0.7.1-20251106T100426Z
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 +166 -5
- package/dist/bin/benchling-webhook.d.ts +2 -16
- package/dist/bin/benchling-webhook.d.ts.map +1 -1
- package/dist/bin/benchling-webhook.js +96 -158
- package/dist/bin/benchling-webhook.js.map +1 -1
- package/dist/bin/cli.js +96 -8
- package/dist/bin/cli.js.map +1 -1
- package/dist/bin/{config-profiles.d.ts → commands/config-profiles.d.ts} +10 -9
- package/dist/bin/commands/config-profiles.d.ts.map +1 -0
- package/dist/bin/{config-profiles.js → commands/config-profiles.js} +109 -102
- package/dist/bin/commands/config-profiles.js.map +1 -0
- package/dist/bin/commands/create-secret.d.ts.map +1 -0
- package/dist/bin/commands/create-secret.js.map +1 -0
- package/dist/bin/commands/deploy.d.ts +12 -1
- package/dist/bin/commands/deploy.d.ts.map +1 -1
- package/dist/bin/commands/deploy.js +116 -106
- package/dist/bin/commands/deploy.js.map +1 -1
- package/dist/bin/{get-env.d.ts → commands/get-env.d.ts} +1 -1
- package/dist/bin/commands/get-env.d.ts.map +1 -0
- package/dist/bin/{get-env.js → commands/get-env.js} +2 -2
- package/dist/bin/commands/get-env.js.map +1 -0
- package/dist/bin/commands/health-check.d.ts +47 -0
- package/dist/bin/commands/health-check.d.ts.map +1 -0
- package/dist/bin/commands/health-check.js +357 -0
- package/dist/bin/commands/health-check.js.map +1 -0
- package/dist/{scripts → bin/commands}/infer-quilt-config.d.ts +6 -15
- package/dist/bin/commands/infer-quilt-config.d.ts.map +1 -0
- package/dist/{scripts → bin/commands}/infer-quilt-config.js +37 -63
- package/dist/bin/commands/infer-quilt-config.js.map +1 -0
- package/dist/bin/commands/init.d.ts.map +1 -1
- package/dist/bin/commands/init.js +2 -32
- package/dist/bin/commands/init.js.map +1 -1
- package/dist/bin/commands/publish.d.ts.map +1 -0
- package/dist/bin/{publish.js → commands/publish.js} +2 -2
- package/dist/bin/commands/publish.js.map +1 -0
- package/dist/bin/commands/setup-profile.d.ts +29 -0
- package/dist/bin/commands/setup-profile.d.ts.map +1 -0
- package/dist/bin/commands/setup-profile.js +218 -0
- package/dist/bin/commands/setup-profile.js.map +1 -0
- package/dist/bin/commands/setup-wizard.d.ts +24 -11
- package/dist/bin/commands/setup-wizard.d.ts.map +1 -1
- package/dist/bin/commands/setup-wizard.js +607 -51
- package/dist/bin/commands/setup-wizard.js.map +1 -1
- package/dist/{scripts → bin/commands}/sync-secrets.d.ts +6 -1
- package/dist/bin/commands/sync-secrets.d.ts.map +1 -0
- package/dist/{scripts → bin/commands}/sync-secrets.js +159 -55
- package/dist/bin/commands/sync-secrets.js.map +1 -0
- package/dist/bin/commands/validate.d.ts.map +1 -1
- package/dist/bin/commands/validate.js +2 -12
- package/dist/bin/commands/validate.js.map +1 -1
- package/dist/lib/alb-api-gateway.d.ts +7 -1
- package/dist/lib/alb-api-gateway.d.ts.map +1 -1
- package/dist/lib/alb-api-gateway.js +9 -6
- package/dist/lib/alb-api-gateway.js.map +1 -1
- package/dist/lib/benchling-webhook-stack.d.ts +13 -12
- package/dist/lib/benchling-webhook-stack.d.ts.map +1 -1
- package/dist/lib/benchling-webhook-stack.js +44 -31
- package/dist/lib/benchling-webhook-stack.js.map +1 -1
- package/dist/lib/configuration-saver.d.ts +4 -24
- package/dist/lib/configuration-saver.d.ts.map +1 -1
- package/dist/lib/configuration-saver.js +14 -71
- package/dist/lib/configuration-saver.js.map +1 -1
- package/dist/lib/fargate-service.d.ts +11 -21
- package/dist/lib/fargate-service.d.ts.map +1 -1
- package/dist/lib/fargate-service.js +79 -176
- package/dist/lib/fargate-service.js.map +1 -1
- package/dist/lib/types/config.d.ts +538 -232
- package/dist/lib/types/config.d.ts.map +1 -1
- package/dist/lib/types/config.js +133 -3
- package/dist/lib/types/config.js.map +1 -1
- package/dist/lib/utils/config-loader.d.ts.map +1 -1
- package/dist/lib/utils/config-loader.js +3 -2
- package/dist/lib/utils/config-loader.js.map +1 -1
- package/dist/lib/utils/config-resolver.d.ts +2 -2
- package/dist/lib/utils/config-resolver.d.ts.map +1 -1
- package/dist/lib/utils/config-resolver.js +14 -7
- package/dist/lib/utils/config-resolver.js.map +1 -1
- package/dist/lib/utils/config.d.ts +1 -1
- package/dist/lib/utils/config.d.ts.map +1 -1
- package/dist/lib/utils/config.js +7 -3
- package/dist/lib/utils/config.js.map +1 -1
- package/dist/lib/utils/sqs.d.ts +13 -0
- package/dist/lib/utils/sqs.d.ts.map +1 -0
- package/dist/lib/utils/sqs.js +22 -0
- package/dist/lib/utils/sqs.js.map +1 -0
- package/dist/lib/utils/stack-inference.d.ts.map +1 -1
- package/dist/lib/utils/stack-inference.js +8 -6
- package/dist/lib/utils/stack-inference.js.map +1 -1
- package/dist/lib/xdg-config.d.ts +224 -106
- package/dist/lib/xdg-config.d.ts.map +1 -1
- package/dist/lib/xdg-config.js +454 -387
- package/dist/lib/xdg-config.js.map +1 -1
- package/dist/package.json +19 -14
- package/dist/scripts/check-logs.d.ts +12 -0
- package/dist/scripts/check-logs.d.ts.map +1 -0
- package/dist/{bin → scripts}/check-logs.js +65 -15
- package/dist/scripts/check-logs.js.map +1 -0
- package/dist/scripts/check-webhook-verification.d.ts +3 -0
- package/dist/scripts/check-webhook-verification.d.ts.map +1 -0
- package/dist/{bin/test-invalid-signature.js → scripts/check-webhook-verification.js} +1 -1
- package/dist/scripts/check-webhook-verification.js.map +1 -0
- package/dist/scripts/get-dev-version.d.ts +16 -0
- package/dist/scripts/get-dev-version.d.ts.map +1 -0
- package/dist/scripts/get-dev-version.js +57 -0
- package/dist/scripts/get-dev-version.js.map +1 -0
- package/dist/scripts/send-event.d.ts.map +1 -0
- package/dist/scripts/send-event.js.map +1 -0
- package/dist/{bin → scripts}/version.d.ts +3 -1
- package/dist/scripts/version.d.ts.map +1 -0
- package/dist/{bin → scripts}/version.js +95 -9
- package/dist/scripts/version.js.map +1 -0
- package/package.json +19 -14
- package/dist/bin/check-logs.d.ts +0 -7
- package/dist/bin/check-logs.d.ts.map +0 -1
- package/dist/bin/check-logs.js.map +0 -1
- package/dist/bin/config-profiles.d.ts.map +0 -1
- package/dist/bin/config-profiles.js.map +0 -1
- package/dist/bin/create-secret.d.ts.map +0 -1
- package/dist/bin/create-secret.js.map +0 -1
- package/dist/bin/dev-deploy.d.ts +0 -20
- package/dist/bin/dev-deploy.d.ts.map +0 -1
- package/dist/bin/dev-deploy.js +0 -289
- package/dist/bin/dev-deploy.js.map +0 -1
- package/dist/bin/get-env.d.ts.map +0 -1
- package/dist/bin/get-env.js.map +0 -1
- package/dist/bin/publish.d.ts.map +0 -1
- package/dist/bin/publish.js.map +0 -1
- package/dist/bin/release.d.ts +0 -11
- package/dist/bin/release.d.ts.map +0 -1
- package/dist/bin/release.js +0 -141
- package/dist/bin/release.js.map +0 -1
- package/dist/bin/send-event.d.ts.map +0 -1
- package/dist/bin/send-event.js.map +0 -1
- package/dist/bin/test-invalid-signature.d.ts +0 -3
- package/dist/bin/test-invalid-signature.d.ts.map +0 -1
- package/dist/bin/test-invalid-signature.js.map +0 -1
- package/dist/bin/version.d.ts.map +0 -1
- package/dist/bin/version.js.map +0 -1
- package/dist/lib/xdg-cli-wrapper.d.ts +0 -113
- package/dist/lib/xdg-cli-wrapper.d.ts.map +0 -1
- package/dist/lib/xdg-cli-wrapper.js +0 -289
- package/dist/lib/xdg-cli-wrapper.js.map +0 -1
- package/dist/scripts/config-health-check.d.ts +0 -84
- package/dist/scripts/config-health-check.d.ts.map +0 -1
- package/dist/scripts/config-health-check.js +0 -659
- package/dist/scripts/config-health-check.js.map +0 -1
- package/dist/scripts/infer-quilt-config.d.ts.map +0 -1
- package/dist/scripts/infer-quilt-config.js.map +0 -1
- package/dist/scripts/install-wizard.d.ts +0 -34
- package/dist/scripts/install-wizard.d.ts.map +0 -1
- package/dist/scripts/install-wizard.js +0 -719
- package/dist/scripts/install-wizard.js.map +0 -1
- package/dist/scripts/sync-secrets.d.ts.map +0 -1
- package/dist/scripts/sync-secrets.js.map +0 -1
- /package/dist/bin/{create-secret.d.ts → commands/create-secret.d.ts} +0 -0
- /package/dist/bin/{create-secret.js → commands/create-secret.js} +0 -0
- /package/dist/bin/{publish.d.ts → commands/publish.d.ts} +0 -0
- /package/dist/{bin → scripts}/send-event.d.ts +0 -0
- /package/dist/{bin → scripts}/send-event.js +0 -0
package/dist/lib/xdg-config.d.ts
CHANGED
|
@@ -1,28 +1,57 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* XDG Configuration Management
|
|
2
|
+
* XDG Configuration Management (v0.7.0 - BREAKING CHANGE)
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* Implements a three-file configuration model:
|
|
6
|
-
* - User configuration: User-provided default settings
|
|
7
|
-
* - Derived configuration: CLI-inferred configuration
|
|
8
|
-
* - Deployment configuration: Deployment-specific artifacts
|
|
4
|
+
* Complete rewrite with NO backward compatibility with v0.6.x.
|
|
9
5
|
*
|
|
10
|
-
*
|
|
6
|
+
* This module provides XDG-compliant configuration management for the Benchling Webhook system
|
|
7
|
+
* with a simplified, profile-first architecture:
|
|
8
|
+
*
|
|
9
|
+
* - Single unified configuration file per profile (`config.json`)
|
|
10
|
+
* - Per-profile deployment tracking (`deployments.json`)
|
|
11
|
+
* - Profile inheritance support with deep merging
|
|
12
|
+
* - Comprehensive validation and helpful error messages
|
|
13
|
+
*
|
|
14
|
+
* Directory Structure:
|
|
15
|
+
* ```
|
|
16
|
+
* ~/.config/benchling-webhook/
|
|
17
|
+
* ├── default/
|
|
18
|
+
* │ ├── config.json # Profile configuration
|
|
19
|
+
* │ └── deployments.json # Deployment history
|
|
20
|
+
* └── dev/
|
|
21
|
+
* ├── config.json
|
|
22
|
+
* └── deployments.json
|
|
23
|
+
* ```
|
|
11
24
|
*
|
|
12
25
|
* @module xdg-config
|
|
26
|
+
* @version 0.7.0
|
|
13
27
|
*/
|
|
14
|
-
import {
|
|
15
|
-
/**
|
|
16
|
-
* Base configuration structure (for backward compatibility)
|
|
17
|
-
*/
|
|
18
|
-
export interface BaseConfig {
|
|
19
|
-
[key: string]: unknown;
|
|
20
|
-
}
|
|
21
|
-
export type { ConfigType, XDGConfigPaths, ConfigSet };
|
|
28
|
+
import { ProfileConfig, DeploymentHistory, DeploymentRecord, ValidationResult } from "./types/config";
|
|
22
29
|
/**
|
|
23
|
-
* XDG Configuration Manager
|
|
30
|
+
* XDG Configuration Manager (v0.7.0)
|
|
31
|
+
*
|
|
32
|
+
* Manages profile-based configuration with deployment tracking.
|
|
33
|
+
* NO backward compatibility with v0.6.x configuration files.
|
|
24
34
|
*
|
|
25
|
-
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```typescript
|
|
37
|
+
* const xdg = new XDGConfig();
|
|
38
|
+
*
|
|
39
|
+
* // Read profile configuration
|
|
40
|
+
* const config = xdg.readProfile("default");
|
|
41
|
+
*
|
|
42
|
+
* // Write profile configuration
|
|
43
|
+
* xdg.writeProfile("default", config);
|
|
44
|
+
*
|
|
45
|
+
* // Record deployment
|
|
46
|
+
* xdg.recordDeployment("default", {
|
|
47
|
+
* stage: "prod",
|
|
48
|
+
* timestamp: new Date().toISOString(),
|
|
49
|
+
* imageTag: "0.7.0",
|
|
50
|
+
* endpoint: "https://...",
|
|
51
|
+
* stackName: "BenchlingWebhookStack",
|
|
52
|
+
* region: "us-east-1"
|
|
53
|
+
* });
|
|
54
|
+
* ```
|
|
26
55
|
*/
|
|
27
56
|
export declare class XDGConfig {
|
|
28
57
|
private readonly baseDir;
|
|
@@ -35,153 +64,242 @@ export declare class XDGConfig {
|
|
|
35
64
|
/**
|
|
36
65
|
* Gets the default XDG base directory
|
|
37
66
|
*
|
|
38
|
-
*
|
|
67
|
+
* Respects XDG_CONFIG_HOME environment variable per XDG Base Directory spec.
|
|
68
|
+
*
|
|
69
|
+
* @returns The default base directory path (~/.config/benchling-webhook or $XDG_CONFIG_HOME/benchling-webhook)
|
|
39
70
|
*/
|
|
40
71
|
private getDefaultBaseDir;
|
|
41
72
|
/**
|
|
42
|
-
*
|
|
73
|
+
* Ensures the base configuration directory exists
|
|
43
74
|
*
|
|
44
|
-
* @
|
|
45
|
-
* @returns Expanded absolute path
|
|
75
|
+
* @throws {Error} If directory creation fails
|
|
46
76
|
*/
|
|
47
|
-
private
|
|
77
|
+
private ensureBaseDirectoryExists;
|
|
48
78
|
/**
|
|
49
|
-
*
|
|
79
|
+
* Reads configuration for a profile
|
|
50
80
|
*
|
|
51
|
-
* @
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Gets the configuration file paths for this instance
|
|
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
|
|
56
84
|
*
|
|
57
|
-
* @
|
|
85
|
+
* @example
|
|
86
|
+
* ```typescript
|
|
87
|
+
* const config = xdg.readProfile("default");
|
|
88
|
+
* console.log(config.benchling.tenant);
|
|
89
|
+
* ```
|
|
58
90
|
*/
|
|
59
|
-
|
|
91
|
+
readProfile(profile: string): ProfileConfig;
|
|
60
92
|
/**
|
|
61
|
-
*
|
|
93
|
+
* Writes configuration for a profile
|
|
62
94
|
*
|
|
63
|
-
* Creates the
|
|
95
|
+
* Creates the profile directory if it doesn't exist.
|
|
96
|
+
* Performs atomic write with automatic backup.
|
|
64
97
|
*
|
|
65
|
-
* @
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Gets the file path for a specific configuration type
|
|
98
|
+
* @param profile - Profile name
|
|
99
|
+
* @param config - Configuration object to write
|
|
100
|
+
* @throws {Error} If validation fails or write operation fails
|
|
70
101
|
*
|
|
71
|
-
* @
|
|
72
|
-
*
|
|
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
|
+
* ```
|
|
73
117
|
*/
|
|
74
|
-
|
|
118
|
+
writeProfile(profile: string, config: ProfileConfig): void;
|
|
75
119
|
/**
|
|
76
|
-
*
|
|
120
|
+
* Deletes a profile and all its files
|
|
77
121
|
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
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
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```typescript
|
|
130
|
+
* xdg.deleteProfile("dev");
|
|
131
|
+
* ```
|
|
81
132
|
*/
|
|
82
|
-
|
|
133
|
+
deleteProfile(profile: string): void;
|
|
83
134
|
/**
|
|
84
|
-
*
|
|
135
|
+
* Lists all available profiles
|
|
85
136
|
*
|
|
86
|
-
* @
|
|
87
|
-
*
|
|
137
|
+
* @returns Array of profile names
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* ```typescript
|
|
141
|
+
* const profiles = xdg.listProfiles();
|
|
142
|
+
* console.log(profiles); // ["default", "dev", "prod"]
|
|
143
|
+
* ```
|
|
88
144
|
*/
|
|
89
|
-
|
|
145
|
+
listProfiles(): string[];
|
|
90
146
|
/**
|
|
91
|
-
*
|
|
147
|
+
* Checks if a profile exists
|
|
92
148
|
*
|
|
93
|
-
* @param
|
|
94
|
-
* @
|
|
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
|
+
* ```
|
|
95
158
|
*/
|
|
96
|
-
|
|
159
|
+
profileExists(profile: string): boolean;
|
|
97
160
|
/**
|
|
98
|
-
*
|
|
161
|
+
* Gets deployment history for a profile
|
|
99
162
|
*
|
|
100
|
-
*
|
|
101
|
-
* Creates a backup of the existing file before overwriting.
|
|
163
|
+
* Returns empty history if deployments.json doesn't exist.
|
|
102
164
|
*
|
|
103
|
-
* @param
|
|
104
|
-
* @
|
|
105
|
-
*
|
|
165
|
+
* @param profile - Profile name
|
|
166
|
+
* @returns Deployment history with active deployments and full history
|
|
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
|
+
* ```
|
|
106
174
|
*/
|
|
107
|
-
|
|
175
|
+
getDeployments(profile: string): DeploymentHistory;
|
|
108
176
|
/**
|
|
109
|
-
*
|
|
177
|
+
* Records a new deployment for a profile
|
|
178
|
+
*
|
|
179
|
+
* Adds deployment to history and updates active deployment for the stage.
|
|
180
|
+
* Creates deployments.json if it doesn't exist.
|
|
110
181
|
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
* Uses deep merge to handle nested objects.
|
|
182
|
+
* @param profile - Profile name
|
|
183
|
+
* @param deployment - Deployment record to add
|
|
114
184
|
*
|
|
115
|
-
* @
|
|
116
|
-
*
|
|
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
|
+
* ```
|
|
117
198
|
*/
|
|
118
|
-
|
|
199
|
+
recordDeployment(profile: string, deployment: DeploymentRecord): void;
|
|
119
200
|
/**
|
|
120
|
-
* Gets the
|
|
201
|
+
* Gets the active deployment for a specific stage
|
|
121
202
|
*
|
|
122
|
-
* @param
|
|
123
|
-
* @
|
|
203
|
+
* @param profile - Profile name
|
|
204
|
+
* @param stage - Stage name (e.g., "dev", "prod")
|
|
205
|
+
* @returns Active deployment record for the stage, or null if none exists
|
|
206
|
+
*
|
|
207
|
+
* @example
|
|
208
|
+
* ```typescript
|
|
209
|
+
* const prodDeployment = xdg.getActiveDeployment("default", "prod");
|
|
210
|
+
* if (prodDeployment) {
|
|
211
|
+
* console.log("Prod endpoint:", prodDeployment.endpoint);
|
|
212
|
+
* }
|
|
213
|
+
* ```
|
|
124
214
|
*/
|
|
125
|
-
|
|
215
|
+
getActiveDeployment(profile: string, stage: string): DeploymentRecord | null;
|
|
126
216
|
/**
|
|
127
|
-
*
|
|
217
|
+
* Reads profile configuration with inheritance support
|
|
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.
|
|
128
223
|
*
|
|
129
|
-
* @param
|
|
130
|
-
* @
|
|
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
|
+
* ```
|
|
131
235
|
*/
|
|
132
|
-
|
|
236
|
+
readProfileWithInheritance(profile: string, baseProfile?: string): ProfileConfig;
|
|
133
237
|
/**
|
|
134
|
-
*
|
|
238
|
+
* Internal recursive implementation of profile inheritance
|
|
135
239
|
*
|
|
136
|
-
* @param
|
|
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
|
|
137
245
|
*/
|
|
138
|
-
|
|
246
|
+
private readProfileWithInheritanceInternal;
|
|
139
247
|
/**
|
|
140
|
-
*
|
|
248
|
+
* Deep merges two profile configurations
|
|
141
249
|
*
|
|
142
|
-
*
|
|
250
|
+
* Nested objects are merged recursively.
|
|
251
|
+
* Arrays are replaced (not concatenated).
|
|
252
|
+
* Current config takes precedence over base config.
|
|
253
|
+
*
|
|
254
|
+
* @param base - Base configuration
|
|
255
|
+
* @param current - Current configuration (takes precedence)
|
|
256
|
+
* @returns Merged configuration
|
|
143
257
|
*/
|
|
144
|
-
|
|
258
|
+
private deepMergeConfigs;
|
|
145
259
|
/**
|
|
146
|
-
*
|
|
260
|
+
* Validates a profile configuration against the schema
|
|
147
261
|
*
|
|
148
|
-
* @param
|
|
149
|
-
* @returns
|
|
262
|
+
* @param config - Configuration object to validate
|
|
263
|
+
* @returns Validation result with errors and warnings
|
|
264
|
+
*
|
|
265
|
+
* @example
|
|
266
|
+
* ```typescript
|
|
267
|
+
* const validation = xdg.validateProfile(config);
|
|
268
|
+
* if (!validation.isValid) {
|
|
269
|
+
* console.error("Validation errors:", validation.errors);
|
|
270
|
+
* }
|
|
271
|
+
* ```
|
|
150
272
|
*/
|
|
151
|
-
|
|
273
|
+
validateProfile(config: ProfileConfig): ValidationResult;
|
|
152
274
|
/**
|
|
153
|
-
*
|
|
275
|
+
* Gets the directory path for a profile
|
|
154
276
|
*
|
|
155
|
-
* @param
|
|
156
|
-
* @
|
|
157
|
-
* @returns Parsed configuration object
|
|
158
|
-
* @throws {Error} If file not found or validation fails
|
|
277
|
+
* @param profile - Profile name
|
|
278
|
+
* @returns Absolute path to profile directory
|
|
159
279
|
*/
|
|
160
|
-
|
|
280
|
+
private getProfileDir;
|
|
161
281
|
/**
|
|
162
|
-
*
|
|
282
|
+
* Gets the config.json path for a profile
|
|
163
283
|
*
|
|
164
|
-
* @param
|
|
165
|
-
* @
|
|
166
|
-
* @param profileName - Profile name (defaults to "default")
|
|
167
|
-
* @throws {Error} If validation fails or write operation fails
|
|
284
|
+
* @param profile - Profile name
|
|
285
|
+
* @returns Absolute path to config.json
|
|
168
286
|
*/
|
|
169
|
-
|
|
287
|
+
private getProfileConfigPath;
|
|
170
288
|
/**
|
|
171
|
-
*
|
|
289
|
+
* Gets the deployments.json path for a profile
|
|
172
290
|
*
|
|
173
|
-
* @param
|
|
174
|
-
* @returns
|
|
291
|
+
* @param profile - Profile name
|
|
292
|
+
* @returns Absolute path to deployments.json
|
|
175
293
|
*/
|
|
176
|
-
|
|
294
|
+
private getProfileDeploymentsPath;
|
|
177
295
|
/**
|
|
178
|
-
*
|
|
296
|
+
* Builds a helpful error message when a profile is not found
|
|
179
297
|
*
|
|
180
|
-
*
|
|
298
|
+
* Detects legacy v0.6.x configuration files and provides upgrade guidance.
|
|
181
299
|
*
|
|
182
|
-
* @param
|
|
183
|
-
* @
|
|
300
|
+
* @param profile - Profile name that was not found
|
|
301
|
+
* @returns Formatted error message
|
|
184
302
|
*/
|
|
185
|
-
|
|
303
|
+
private buildProfileNotFoundError;
|
|
186
304
|
}
|
|
187
305
|
//# 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
|
|
1
|
+
{"version":3,"file":"xdg-config.d.ts","sourceRoot":"","sources":["../../lib/xdg-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAQH,OAAO,EACH,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAGnB,MAAM,gBAAgB,CAAC;AAExB;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,SAAS;IAClB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IAEjC;;;;OAIG;gBACS,OAAO,CAAC,EAAE,MAAM;IAK5B;;;;;;OAMG;IACH,OAAO,CAAC,iBAAiB;IASzB;;;;OAIG;IACH,OAAO,CAAC,yBAAyB;IAUjC;;;;;;;;;;;;OAYG;IACI,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa;IA8BlD;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACI,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,IAAI;IAqDjE;;;;;;;;;;;;;OAaG;IACI,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAiB3C;;;;;;;;;;OAUG;IACI,YAAY,IAAI,MAAM,EAAE;IAgB/B;;;;;;;;;;;;OAYG;IACI,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAS9C;;;;;;;;;;;;;;OAcG;IACI,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB;IAsCzD;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACI,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,gBAAgB,GAAG,IAAI;IAiE5E;;;;;;;;;;;;;;OAcG;IACI,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI;IAanF;;;;;;;;;;;;;;;;;;;OAmBG;IACI,0BAA0B,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,aAAa;IAKvF;;;;;;;;OAQG;IACH,OAAO,CAAC,kCAAkC;IAoC1C;;;;;;;;;;OAUG;IACH,OAAO,CAAC,gBAAgB;IAQxB;;;;;;;;;;;;;OAaG;IACI,eAAe,CAAC,MAAM,EAAE,aAAa,GAAG,gBAAgB;IA8B/D;;;;;OAKG;IACH,OAAO,CAAC,aAAa;IAIrB;;;;;OAKG;IACH,OAAO,CAAC,oBAAoB;IAI5B;;;;;OAKG;IACH,OAAO,CAAC,yBAAyB;IAQjC;;;;;;;OAOG;IACH,OAAO,CAAC,yBAAyB;CAsCpC"}
|