@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.
Files changed (159) hide show
  1. package/README.md +166 -5
  2. package/dist/bin/benchling-webhook.d.ts +2 -16
  3. package/dist/bin/benchling-webhook.d.ts.map +1 -1
  4. package/dist/bin/benchling-webhook.js +96 -158
  5. package/dist/bin/benchling-webhook.js.map +1 -1
  6. package/dist/bin/cli.js +96 -8
  7. package/dist/bin/cli.js.map +1 -1
  8. package/dist/bin/{config-profiles.d.ts → commands/config-profiles.d.ts} +10 -9
  9. package/dist/bin/commands/config-profiles.d.ts.map +1 -0
  10. package/dist/bin/{config-profiles.js → commands/config-profiles.js} +109 -102
  11. package/dist/bin/commands/config-profiles.js.map +1 -0
  12. package/dist/bin/commands/create-secret.d.ts.map +1 -0
  13. package/dist/bin/commands/create-secret.js.map +1 -0
  14. package/dist/bin/commands/deploy.d.ts +12 -1
  15. package/dist/bin/commands/deploy.d.ts.map +1 -1
  16. package/dist/bin/commands/deploy.js +116 -106
  17. package/dist/bin/commands/deploy.js.map +1 -1
  18. package/dist/bin/{get-env.d.ts → commands/get-env.d.ts} +1 -1
  19. package/dist/bin/commands/get-env.d.ts.map +1 -0
  20. package/dist/bin/{get-env.js → commands/get-env.js} +2 -2
  21. package/dist/bin/commands/get-env.js.map +1 -0
  22. package/dist/bin/commands/health-check.d.ts +47 -0
  23. package/dist/bin/commands/health-check.d.ts.map +1 -0
  24. package/dist/bin/commands/health-check.js +357 -0
  25. package/dist/bin/commands/health-check.js.map +1 -0
  26. package/dist/{scripts → bin/commands}/infer-quilt-config.d.ts +6 -15
  27. package/dist/bin/commands/infer-quilt-config.d.ts.map +1 -0
  28. package/dist/{scripts → bin/commands}/infer-quilt-config.js +37 -63
  29. package/dist/bin/commands/infer-quilt-config.js.map +1 -0
  30. package/dist/bin/commands/init.d.ts.map +1 -1
  31. package/dist/bin/commands/init.js +2 -32
  32. package/dist/bin/commands/init.js.map +1 -1
  33. package/dist/bin/commands/publish.d.ts.map +1 -0
  34. package/dist/bin/{publish.js → commands/publish.js} +2 -2
  35. package/dist/bin/commands/publish.js.map +1 -0
  36. package/dist/bin/commands/setup-profile.d.ts +29 -0
  37. package/dist/bin/commands/setup-profile.d.ts.map +1 -0
  38. package/dist/bin/commands/setup-profile.js +218 -0
  39. package/dist/bin/commands/setup-profile.js.map +1 -0
  40. package/dist/bin/commands/setup-wizard.d.ts +24 -11
  41. package/dist/bin/commands/setup-wizard.d.ts.map +1 -1
  42. package/dist/bin/commands/setup-wizard.js +607 -51
  43. package/dist/bin/commands/setup-wizard.js.map +1 -1
  44. package/dist/{scripts → bin/commands}/sync-secrets.d.ts +6 -1
  45. package/dist/bin/commands/sync-secrets.d.ts.map +1 -0
  46. package/dist/{scripts → bin/commands}/sync-secrets.js +159 -55
  47. package/dist/bin/commands/sync-secrets.js.map +1 -0
  48. package/dist/bin/commands/validate.d.ts.map +1 -1
  49. package/dist/bin/commands/validate.js +2 -12
  50. package/dist/bin/commands/validate.js.map +1 -1
  51. package/dist/lib/alb-api-gateway.d.ts +7 -1
  52. package/dist/lib/alb-api-gateway.d.ts.map +1 -1
  53. package/dist/lib/alb-api-gateway.js +9 -6
  54. package/dist/lib/alb-api-gateway.js.map +1 -1
  55. package/dist/lib/benchling-webhook-stack.d.ts +13 -12
  56. package/dist/lib/benchling-webhook-stack.d.ts.map +1 -1
  57. package/dist/lib/benchling-webhook-stack.js +44 -31
  58. package/dist/lib/benchling-webhook-stack.js.map +1 -1
  59. package/dist/lib/configuration-saver.d.ts +4 -24
  60. package/dist/lib/configuration-saver.d.ts.map +1 -1
  61. package/dist/lib/configuration-saver.js +14 -71
  62. package/dist/lib/configuration-saver.js.map +1 -1
  63. package/dist/lib/fargate-service.d.ts +11 -21
  64. package/dist/lib/fargate-service.d.ts.map +1 -1
  65. package/dist/lib/fargate-service.js +79 -176
  66. package/dist/lib/fargate-service.js.map +1 -1
  67. package/dist/lib/types/config.d.ts +538 -232
  68. package/dist/lib/types/config.d.ts.map +1 -1
  69. package/dist/lib/types/config.js +133 -3
  70. package/dist/lib/types/config.js.map +1 -1
  71. package/dist/lib/utils/config-loader.d.ts.map +1 -1
  72. package/dist/lib/utils/config-loader.js +3 -2
  73. package/dist/lib/utils/config-loader.js.map +1 -1
  74. package/dist/lib/utils/config-resolver.d.ts +2 -2
  75. package/dist/lib/utils/config-resolver.d.ts.map +1 -1
  76. package/dist/lib/utils/config-resolver.js +14 -7
  77. package/dist/lib/utils/config-resolver.js.map +1 -1
  78. package/dist/lib/utils/config.d.ts +1 -1
  79. package/dist/lib/utils/config.d.ts.map +1 -1
  80. package/dist/lib/utils/config.js +7 -3
  81. package/dist/lib/utils/config.js.map +1 -1
  82. package/dist/lib/utils/sqs.d.ts +13 -0
  83. package/dist/lib/utils/sqs.d.ts.map +1 -0
  84. package/dist/lib/utils/sqs.js +22 -0
  85. package/dist/lib/utils/sqs.js.map +1 -0
  86. package/dist/lib/utils/stack-inference.d.ts.map +1 -1
  87. package/dist/lib/utils/stack-inference.js +8 -6
  88. package/dist/lib/utils/stack-inference.js.map +1 -1
  89. package/dist/lib/xdg-config.d.ts +224 -106
  90. package/dist/lib/xdg-config.d.ts.map +1 -1
  91. package/dist/lib/xdg-config.js +454 -387
  92. package/dist/lib/xdg-config.js.map +1 -1
  93. package/dist/package.json +19 -14
  94. package/dist/scripts/check-logs.d.ts +12 -0
  95. package/dist/scripts/check-logs.d.ts.map +1 -0
  96. package/dist/{bin → scripts}/check-logs.js +65 -15
  97. package/dist/scripts/check-logs.js.map +1 -0
  98. package/dist/scripts/check-webhook-verification.d.ts +3 -0
  99. package/dist/scripts/check-webhook-verification.d.ts.map +1 -0
  100. package/dist/{bin/test-invalid-signature.js → scripts/check-webhook-verification.js} +1 -1
  101. package/dist/scripts/check-webhook-verification.js.map +1 -0
  102. package/dist/scripts/get-dev-version.d.ts +16 -0
  103. package/dist/scripts/get-dev-version.d.ts.map +1 -0
  104. package/dist/scripts/get-dev-version.js +57 -0
  105. package/dist/scripts/get-dev-version.js.map +1 -0
  106. package/dist/scripts/send-event.d.ts.map +1 -0
  107. package/dist/scripts/send-event.js.map +1 -0
  108. package/dist/{bin → scripts}/version.d.ts +3 -1
  109. package/dist/scripts/version.d.ts.map +1 -0
  110. package/dist/{bin → scripts}/version.js +95 -9
  111. package/dist/scripts/version.js.map +1 -0
  112. package/package.json +19 -14
  113. package/dist/bin/check-logs.d.ts +0 -7
  114. package/dist/bin/check-logs.d.ts.map +0 -1
  115. package/dist/bin/check-logs.js.map +0 -1
  116. package/dist/bin/config-profiles.d.ts.map +0 -1
  117. package/dist/bin/config-profiles.js.map +0 -1
  118. package/dist/bin/create-secret.d.ts.map +0 -1
  119. package/dist/bin/create-secret.js.map +0 -1
  120. package/dist/bin/dev-deploy.d.ts +0 -20
  121. package/dist/bin/dev-deploy.d.ts.map +0 -1
  122. package/dist/bin/dev-deploy.js +0 -289
  123. package/dist/bin/dev-deploy.js.map +0 -1
  124. package/dist/bin/get-env.d.ts.map +0 -1
  125. package/dist/bin/get-env.js.map +0 -1
  126. package/dist/bin/publish.d.ts.map +0 -1
  127. package/dist/bin/publish.js.map +0 -1
  128. package/dist/bin/release.d.ts +0 -11
  129. package/dist/bin/release.d.ts.map +0 -1
  130. package/dist/bin/release.js +0 -141
  131. package/dist/bin/release.js.map +0 -1
  132. package/dist/bin/send-event.d.ts.map +0 -1
  133. package/dist/bin/send-event.js.map +0 -1
  134. package/dist/bin/test-invalid-signature.d.ts +0 -3
  135. package/dist/bin/test-invalid-signature.d.ts.map +0 -1
  136. package/dist/bin/test-invalid-signature.js.map +0 -1
  137. package/dist/bin/version.d.ts.map +0 -1
  138. package/dist/bin/version.js.map +0 -1
  139. package/dist/lib/xdg-cli-wrapper.d.ts +0 -113
  140. package/dist/lib/xdg-cli-wrapper.d.ts.map +0 -1
  141. package/dist/lib/xdg-cli-wrapper.js +0 -289
  142. package/dist/lib/xdg-cli-wrapper.js.map +0 -1
  143. package/dist/scripts/config-health-check.d.ts +0 -84
  144. package/dist/scripts/config-health-check.d.ts.map +0 -1
  145. package/dist/scripts/config-health-check.js +0 -659
  146. package/dist/scripts/config-health-check.js.map +0 -1
  147. package/dist/scripts/infer-quilt-config.d.ts.map +0 -1
  148. package/dist/scripts/infer-quilt-config.js.map +0 -1
  149. package/dist/scripts/install-wizard.d.ts +0 -34
  150. package/dist/scripts/install-wizard.d.ts.map +0 -1
  151. package/dist/scripts/install-wizard.js +0 -719
  152. package/dist/scripts/install-wizard.js.map +0 -1
  153. package/dist/scripts/sync-secrets.d.ts.map +0 -1
  154. package/dist/scripts/sync-secrets.js.map +0 -1
  155. /package/dist/bin/{create-secret.d.ts → commands/create-secret.d.ts} +0 -0
  156. /package/dist/bin/{create-secret.js → commands/create-secret.js} +0 -0
  157. /package/dist/bin/{publish.d.ts → commands/publish.d.ts} +0 -0
  158. /package/dist/{bin → scripts}/send-event.d.ts +0 -0
  159. /package/dist/{bin → scripts}/send-event.js +0 -0
@@ -1,28 +1,57 @@
1
1
  /**
2
- * XDG Configuration Management
2
+ * XDG Configuration Management (v0.7.0 - BREAKING CHANGE)
3
3
  *
4
- * Provides XDG-compliant configuration file management for the Benchling Webhook system.
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
- * Supports multiple named profiles (e.g., "default", "dev", "prod") for flexible configuration management.
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 { ConfigType, ProfileName, XDGConfigPaths, ConfigSet, ConfigProfile } from "./types/config";
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
- * Manages XDG-compliant configuration files for the Benchling Webhook system.
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
- * @returns The default base directory path
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
- * Expands home directory in a path
73
+ * Ensures the base configuration directory exists
43
74
  *
44
- * @param path - Path potentially containing ~ for home directory
45
- * @returns Expanded absolute path
75
+ * @throws {Error} If directory creation fails
46
76
  */
47
- private static expandHomeDir;
77
+ private ensureBaseDirectoryExists;
48
78
  /**
49
- * Gets the configuration file paths
79
+ * Reads configuration for a profile
50
80
  *
51
- * @returns Object containing paths to all configuration files
52
- */
53
- static getPaths(): XDGConfigPaths;
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
- * @returns Object containing paths to all configuration files
85
+ * @example
86
+ * ```typescript
87
+ * const config = xdg.readProfile("default");
88
+ * console.log(config.benchling.tenant);
89
+ * ```
58
90
  */
59
- getPaths(): XDGConfigPaths;
91
+ readProfile(profile: string): ProfileConfig;
60
92
  /**
61
- * Ensures all required configuration directories exist
93
+ * Writes configuration for a profile
62
94
  *
63
- * Creates the base configuration directory and subdirectories if they don't exist.
95
+ * Creates the profile directory if it doesn't exist.
96
+ * Performs atomic write with automatic backup.
64
97
  *
65
- * @throws {Error} If directory creation fails
66
- */
67
- ensureDirectories(): void;
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
- * @param configType - Type of configuration to read
72
- * @returns Absolute path to the configuration file
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
- private getConfigPath;
118
+ writeProfile(profile: string, config: ProfileConfig): void;
75
119
  /**
76
- * Reads and parses a configuration file with schema validation
120
+ * Deletes a profile and all its files
77
121
  *
78
- * @param configType - Type of configuration to read ("user", "derived", or "deploy")
79
- * @returns Parsed configuration object
80
- * @throws {Error} If file not found, invalid JSON, or schema validation fails
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
- readConfig(configType: ConfigType): BaseConfig;
133
+ deleteProfile(profile: string): void;
83
134
  /**
84
- * Gets the backup file path for a configuration type
135
+ * Lists all available profiles
85
136
  *
86
- * @param configType - Type of configuration
87
- * @returns Backup file path
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
- getBackupPath(configType: ConfigType): string;
145
+ listProfiles(): string[];
90
146
  /**
91
- * Validates configuration against schema
147
+ * Checks if a profile exists
92
148
  *
93
- * @param config - Configuration object to validate
94
- * @throws {Error} If validation fails
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
- private validateConfigSchema;
159
+ profileExists(profile: string): boolean;
97
160
  /**
98
- * Writes a configuration file atomically with backup
161
+ * Gets deployment history for a profile
99
162
  *
100
- * Uses a temporary file and rename operation for atomic writes.
101
- * Creates a backup of the existing file before overwriting.
163
+ * Returns empty history if deployments.json doesn't exist.
102
164
  *
103
- * @param configType - Type of configuration to write ("user", "derived", or "deploy")
104
- * @param config - Configuration object to write
105
- * @throws {Error} If validation fails or write operation fails
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
- writeConfig(configType: ConfigType, config: BaseConfig): void;
175
+ getDeployments(profile: string): DeploymentHistory;
108
176
  /**
109
- * Merges multiple configuration sources with priority order
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
- * Merges configurations in priority order (user → derived → deploy),
112
- * where later configurations override earlier ones.
113
- * Uses deep merge to handle nested objects.
182
+ * @param profile - Profile name
183
+ * @param deployment - Deployment record to add
114
184
  *
115
- * @param configs - Configuration set to merge
116
- * @returns Merged configuration object
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
- mergeConfigs(configs: ConfigSet): BaseConfig;
199
+ recordDeployment(profile: string, deployment: DeploymentRecord): void;
119
200
  /**
120
- * Gets the profile directory path
201
+ * Gets the active deployment for a specific stage
121
202
  *
122
- * @param profileName - Profile name (defaults to "default")
123
- * @returns Profile directory path
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
- getProfileDir(profileName?: ProfileName): string;
215
+ getActiveDeployment(profile: string, stage: string): DeploymentRecord | null;
126
216
  /**
127
- * Gets configuration file paths for a specific profile
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 profileName - Profile name (defaults to "default")
130
- * @returns Configuration file paths for the profile
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
- getProfilePaths(profileName?: ProfileName): XDGConfigPaths;
236
+ readProfileWithInheritance(profile: string, baseProfile?: string): ProfileConfig;
133
237
  /**
134
- * Ensures profile directories exist
238
+ * Internal recursive implementation of profile inheritance
135
239
  *
136
- * @param profileName - Profile name (defaults to "default")
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
- ensureProfileDirectories(profileName?: ProfileName): void;
246
+ private readProfileWithInheritanceInternal;
139
247
  /**
140
- * Lists all available profiles
248
+ * Deep merges two profile configurations
141
249
  *
142
- * @returns Array of profile names
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
- listProfiles(): ProfileName[];
258
+ private deepMergeConfigs;
145
259
  /**
146
- * Checks if a profile exists
260
+ * Validates a profile configuration against the schema
147
261
  *
148
- * @param profileName - Profile name to check
149
- * @returns True if profile exists, false otherwise
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
- profileExists(profileName: ProfileName): boolean;
273
+ validateProfile(config: ProfileConfig): ValidationResult;
152
274
  /**
153
- * Reads configuration for a specific profile
275
+ * Gets the directory path for a profile
154
276
  *
155
- * @param configType - Type of configuration to read
156
- * @param profileName - Profile name (defaults to "default")
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
- readProfileConfig(configType: ConfigType, profileName?: ProfileName): BaseConfig;
280
+ private getProfileDir;
161
281
  /**
162
- * Writes configuration for a specific profile
282
+ * Gets the config.json path for a profile
163
283
  *
164
- * @param configType - Type of configuration to write
165
- * @param config - Configuration object to write
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
- writeProfileConfig(configType: ConfigType, config: BaseConfig, profileName?: ProfileName): void;
287
+ private getProfileConfigPath;
170
288
  /**
171
- * Loads a complete profile with all configuration files
289
+ * Gets the deployments.json path for a profile
172
290
  *
173
- * @param profileName - Profile name (defaults to "default")
174
- * @returns Complete profile configuration
291
+ * @param profile - Profile name
292
+ * @returns Absolute path to deployments.json
175
293
  */
176
- loadProfile(profileName?: ProfileName): ConfigProfile;
294
+ private getProfileDeploymentsPath;
177
295
  /**
178
- * Deletes a profile and all its configuration files
296
+ * Builds a helpful error message when a profile is not found
179
297
  *
180
- * WARNING: This is a destructive operation!
298
+ * Detects legacy v0.6.x configuration files and provides upgrade guidance.
181
299
  *
182
- * @param profileName - Profile name to delete
183
- * @throws {Error} If attempting to delete the default profile or if deletion fails
300
+ * @param profile - Profile name that was not found
301
+ * @returns Formatted error message
184
302
  */
185
- deleteProfile(profileName: ProfileName): void;
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;;;;;;;;;;;;GAYG;AAQH,OAAO,EAIH,UAAU,EACV,WAAW,EACX,cAAc,EACd,SAAS,EACT,aAAa,EAChB,MAAM,gBAAgB,CAAC;AAExB;;GAEG;AACH,MAAM,WAAW,UAAU;IACvB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;AAGD,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,SAAS,EAAE,CAAC;AAyDtD;;;;GAIG;AACH,qBAAa,SAAS;IAClB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IAEjC;;;;OAIG;gBACS,OAAO,CAAC,EAAE,MAAM;IAI5B;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAKzB;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,aAAa;IAK5B;;;;OAIG;WACW,QAAQ,IAAI,cAAc;IAWxC;;;;OAIG;IACI,QAAQ,IAAI,cAAc;IAQjC;;;;;;OAMG;IACI,iBAAiB,IAAI,IAAI;IAmBhC;;;;;OAKG;IACH,OAAO,CAAC,aAAa;IAcrB;;;;;;OAMG;IACI,UAAU,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU;IAqCrD;;;;;OAKG;IACI,aAAa,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM;IAKpD;;;;;OAKG;IACH,OAAO,CAAC,oBAAoB;IAW5B;;;;;;;;;OASG;IACI,WAAW,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI;IA8CpE;;;;;;;;;OASG;IACI,YAAY,CAAC,OAAO,EAAE,SAAS,GAAG,UAAU;IAyBnD;;;;;OAKG;IACI,aAAa,CAAC,WAAW,GAAE,WAAuB,GAAG,MAAM;IAOlE;;;;;OAKG;IACI,eAAe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