@quiltdata/benchling-webhook 0.6.3-20251104T170954Z → 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 +117 -107
  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,252 +1,404 @@
1
1
  /**
2
- * Comprehensive Type Definitions for XDG Configuration System
2
+ * Type Definitions for v0.7.0 Configuration Architecture
3
3
  *
4
- * This module defines all TypeScript types and interfaces for the
5
- * XDG-compliant configuration management system.
4
+ * BREAKING CHANGE: Complete rewrite with NO backward compatibility.
5
+ * This module defines the new unified configuration system for multi-environment deployments.
6
6
  *
7
7
  * @module types/config
8
+ * @version 0.7.0
8
9
  */
9
10
  /**
10
11
  * Configuration profile identifier
11
12
  * Profiles allow multiple named configurations (e.g., "default", "dev", "prod")
13
+ *
14
+ * @example "default"
15
+ * @example "dev"
16
+ * @example "prod"
12
17
  */
13
18
  export type ProfileName = string;
14
19
  /**
15
- * Configuration type identifier
16
- */
17
- export type ConfigType = "user" | "derived" | "deploy" | "complete";
18
- /**
19
- * User Configuration
20
+ * Profile Configuration (Single Source of Truth)
21
+ *
22
+ * This is the primary configuration interface for v0.7.0, replacing the previous
23
+ * three-tier system (user/derived/deploy). All configuration is now unified in
24
+ * a single structured format.
20
25
  *
21
- * User-provided settings that define the core configuration.
22
- * This is the primary configuration file edited by users.
26
+ * @example
27
+ * ```json
28
+ * {
29
+ * "quilt": {
30
+ * "stackArn": "arn:aws:cloudformation:...",
31
+ * "catalog": "https://quilt.example.com",
32
+ * "bucket": "my-quilt-bucket",
33
+ * "database": "quilt_catalog",
34
+ * "queueUrl": "https://sqs.us-east-1.amazonaws.com/123456789012/quilt-queue",
35
+ * "region": "us-east-1"
36
+ * },
37
+ * "benchling": {
38
+ * "tenant": "my-tenant",
39
+ * "clientId": "client_123",
40
+ * "secretArn": "arn:aws:secretsmanager:...",
41
+ * "appDefinitionId": "app_456"
42
+ * },
43
+ * "packages": {
44
+ * "bucket": "benchling-packages",
45
+ * "prefix": "benchling",
46
+ * "metadataKey": "experiment_id"
47
+ * },
48
+ * "deployment": {
49
+ * "region": "us-east-1",
50
+ * "imageTag": "latest"
51
+ * },
52
+ * "_metadata": {
53
+ * "version": "0.7.0",
54
+ * "createdAt": "2025-11-04T10:00:00Z",
55
+ * "updatedAt": "2025-11-04T10:00:00Z",
56
+ * "source": "wizard"
57
+ * }
58
+ * }
59
+ * ```
23
60
  */
24
- export interface UserConfig {
61
+ export interface ProfileConfig {
25
62
  /**
26
- * Quilt catalog URL (e.g., "https://quilt.example.com")
63
+ * Quilt catalog and infrastructure configuration
27
64
  */
28
- quiltCatalog?: string;
65
+ quilt: QuiltConfig;
29
66
  /**
30
- * Quilt user bucket name for package storage
67
+ * Benchling tenant and OAuth configuration
31
68
  */
32
- quiltUserBucket?: string;
69
+ benchling: BenchlingConfig;
33
70
  /**
34
- * Quilt database (Athena/Glue) identifier
71
+ * Package storage and metadata configuration
35
72
  */
36
- quiltDatabase?: string;
73
+ packages: PackageConfig;
37
74
  /**
38
- * Quilt CloudFormation stack ARN
75
+ * AWS deployment configuration (CDK)
39
76
  */
40
- quiltStackArn?: string;
77
+ deployment: DeploymentConfig;
41
78
  /**
42
- * AWS region for Quilt resources
79
+ * Optional logging configuration
43
80
  */
44
- quiltRegion?: string;
81
+ logging?: LoggingConfig;
45
82
  /**
46
- * Benchling tenant identifier
83
+ * Optional security configuration (webhook verification, IP allowlist)
47
84
  */
48
- benchlingTenant?: string;
85
+ security?: SecurityConfig;
49
86
  /**
50
- * Benchling OAuth client ID
87
+ * Configuration metadata (provenance, versioning, timestamps)
51
88
  */
52
- benchlingClientId?: string;
89
+ _metadata: ConfigMetadata;
53
90
  /**
54
- * Benchling OAuth client secret (stored in Secrets Manager in production)
91
+ * Optional profile inheritance (for profile hierarchies)
92
+ *
93
+ * When present, this profile inherits configuration from the specified base profile.
94
+ * Values in this profile override inherited values via deep merge.
95
+ *
96
+ * @example "_inherits": "default"
55
97
  */
56
- benchlingClientSecret?: string;
98
+ _inherits?: string;
99
+ }
100
+ /**
101
+ * Quilt Catalog Configuration
102
+ *
103
+ * Configuration for Quilt data catalog integration, including CloudFormation stack
104
+ * and SQS queue for package creation.
105
+ */
106
+ export interface QuiltConfig {
57
107
  /**
58
- * Benchling app definition ID
108
+ * Quilt CloudFormation stack ARN
109
+ *
110
+ * @example "arn:aws:cloudformation:us-east-1:123456789012:stack/quilt-stack/..."
59
111
  */
60
- benchlingAppDefinitionId?: string;
112
+ stackArn: string;
61
113
  /**
62
- * S3 bucket for Benchling package storage
114
+ * Quilt catalog domain (without protocol)
115
+ *
116
+ * @example "quilt.example.com"
63
117
  */
64
- benchlingPkgBucket?: string;
118
+ catalog: string;
65
119
  /**
66
- * Benchling test entry ID (optional, for validation)
120
+ * Athena/Glue database name for catalog metadata
121
+ *
122
+ * @example "quilt_catalog"
67
123
  */
68
- benchlingTestEntry?: string;
124
+ database: string;
69
125
  /**
70
- * AWS Secrets Manager secret ARN for Benchling credentials
126
+ * SQS queue URL for package creation jobs
127
+ *
128
+ * @example "https://sqs.us-east-1.amazonaws.com/123456789012/quilt-package-queue"
71
129
  */
72
- benchlingSecretArn?: string;
130
+ queueUrl: string;
73
131
  /**
74
- * AWS account ID for CDK deployment
132
+ * AWS region for Quilt resources
133
+ *
134
+ * @example "us-east-1"
75
135
  */
76
- cdkAccount?: string;
136
+ region: string;
137
+ }
138
+ /**
139
+ * Benchling Configuration
140
+ *
141
+ * OAuth credentials and tenant information for Benchling API integration.
142
+ */
143
+ export interface BenchlingConfig {
77
144
  /**
78
- * AWS region for CDK deployment
145
+ * Benchling tenant identifier (subdomain)
146
+ *
147
+ * @example "my-company"
79
148
  */
80
- cdkRegion?: string;
149
+ tenant: string;
81
150
  /**
82
- * AWS profile to use for deployment operations
151
+ * OAuth client ID
152
+ *
153
+ * @example "client_abc123"
83
154
  */
84
- awsProfile?: string;
155
+ clientId: string;
85
156
  /**
86
- * SQS queue ARN for package creation
157
+ * OAuth client secret (optional, for local dev only)
158
+ *
159
+ * For production, use `secretArn` instead to reference AWS Secrets Manager.
160
+ *
161
+ * @example "secret_xyz789"
87
162
  */
88
- queueArn?: string;
163
+ clientSecret?: string;
89
164
  /**
90
- * S3 key prefix for Benchling packages
165
+ * AWS Secrets Manager ARN for OAuth credentials (production)
166
+ *
167
+ * @example "arn:aws:secretsmanager:us-east-1:123456789012:secret:benchling-..."
91
168
  */
92
- pkgPrefix?: string;
169
+ secretArn?: string;
93
170
  /**
94
- * Package metadata key (e.g., "experiment_id")
171
+ * Benchling app definition ID
172
+ *
173
+ * @example "app_def_456"
95
174
  */
96
- pkgKey?: string;
175
+ appDefinitionId: string;
97
176
  /**
98
- * Logging level (DEBUG, INFO, WARNING, ERROR)
177
+ * Test entry ID for validation (optional)
178
+ *
179
+ * @example "etr_abc123"
99
180
  */
100
- logLevel?: string;
181
+ testEntryId?: string;
182
+ }
183
+ /**
184
+ * Package Configuration
185
+ *
186
+ * S3 storage and metadata settings for Benchling packages.
187
+ */
188
+ export interface PackageConfig {
101
189
  /**
102
- * Comma-separated IP allowlist for webhook access
190
+ * S3 bucket for package storage
191
+ *
192
+ * @example "benchling-packages"
103
193
  */
104
- webhookAllowList?: string;
194
+ bucket: string;
105
195
  /**
106
- * Enable webhook signature verification
196
+ * S3 key prefix for packages
197
+ *
198
+ * @example "benchling"
199
+ * @default "benchling"
107
200
  */
108
- enableWebhookVerification?: string;
201
+ prefix: string;
109
202
  /**
110
- * Create ECR repository flag
203
+ * Metadata key for package organization
204
+ *
205
+ * @example "experiment_id"
206
+ * @default "experiment_id"
111
207
  */
112
- createEcrRepository?: string;
208
+ metadataKey: string;
209
+ }
210
+ /**
211
+ * Deployment Configuration
212
+ *
213
+ * AWS infrastructure settings for CDK deployment.
214
+ */
215
+ export interface DeploymentConfig {
113
216
  /**
114
- * ECR repository name
217
+ * AWS region for deployment
218
+ *
219
+ * @example "us-east-1"
115
220
  */
116
- ecrRepositoryName?: string;
221
+ region: string;
117
222
  /**
118
- * Docker image tag
223
+ * AWS account ID (optional, auto-detected if not provided)
224
+ *
225
+ * @example "123456789012"
119
226
  */
120
- imageTag?: string;
227
+ account?: string;
121
228
  /**
122
- * Configuration metadata (optional)
229
+ * ECR repository name (optional, default: "benchling-webhook")
230
+ *
231
+ * @example "my-custom-repo"
123
232
  */
124
- _metadata?: ConfigMetadata;
233
+ ecrRepository?: string;
234
+ /**
235
+ * Docker image tag
236
+ *
237
+ * @example "latest"
238
+ * @example "0.7.0"
239
+ * @default "latest"
240
+ */
241
+ imageTag?: string;
125
242
  }
126
243
  /**
127
- * Derived Configuration
244
+ * Logging Configuration
128
245
  *
129
- * Configuration values inferred from CLI tools (e.g., quilt3 config)
130
- * or computed from user configuration.
246
+ * Python logging level for Flask application.
131
247
  */
132
- export interface DerivedConfig extends UserConfig {
248
+ export interface LoggingConfig {
133
249
  /**
134
- * Catalog URL inferred from quilt3 CLI
250
+ * Python logging level
251
+ *
252
+ * @default "INFO"
135
253
  */
136
- catalogUrl?: string;
137
- /**
138
- * Metadata tracking inference source and timestamp
139
- */
140
- _metadata?: ConfigMetadata & {
141
- inferredAt?: string;
142
- inferredFrom?: string;
143
- };
254
+ level: "DEBUG" | "INFO" | "WARNING" | "ERROR";
144
255
  }
145
256
  /**
146
- * Deployment Configuration
257
+ * Security Configuration
147
258
  *
148
- * Configuration artifacts generated during deployment.
149
- * Contains deployment-specific values like webhook URLs and stack ARNs.
259
+ * Webhook security settings including IP allowlist and signature verification.
150
260
  */
151
- export interface DeploymentConfig extends DerivedConfig {
152
- /**
153
- * Deployed webhook endpoint URL
154
- */
155
- webhookEndpoint?: string;
156
- /**
157
- * Deployed webhook URL (alias for webhookEndpoint)
158
- */
159
- webhookUrl?: string;
160
- /**
161
- * CloudFormation stack ARN
162
- */
163
- stackArn?: string;
261
+ export interface SecurityConfig {
164
262
  /**
165
- * Deployment timestamp
263
+ * Comma-separated list of allowed IP addresses/CIDR blocks
264
+ *
265
+ * Empty string means no IP filtering.
266
+ *
267
+ * @example "192.168.1.0/24,10.0.0.0/8"
268
+ * @default ""
166
269
  */
167
- deploymentTimestamp?: string;
168
- /**
169
- * ISO timestamp of deployment
170
- */
171
- deployedAt?: string;
270
+ webhookAllowList?: string;
172
271
  /**
173
- * Metadata tracking deployment details
272
+ * Enable webhook signature verification
273
+ *
274
+ * @default true
174
275
  */
175
- _metadata?: ConfigMetadata & {
176
- deployedAt?: string;
177
- deployedBy?: string;
178
- stackName?: string;
179
- };
276
+ enableVerification?: boolean;
180
277
  }
181
278
  /**
182
279
  * Configuration Metadata
183
280
  *
184
- * Tracks configuration provenance, timestamps, and versioning.
281
+ * Provenance tracking for configuration files.
185
282
  */
186
283
  export interface ConfigMetadata {
187
284
  /**
188
- * ISO timestamp when configuration was saved
285
+ * Configuration schema version
286
+ *
287
+ * @example "0.7.0"
288
+ */
289
+ version: string;
290
+ /**
291
+ * ISO 8601 timestamp when configuration was created
292
+ *
293
+ * @example "2025-11-04T10:00:00Z"
189
294
  */
190
- savedAt?: string;
295
+ createdAt: string;
191
296
  /**
192
- * Source of configuration (e.g., "cli", "wizard", "manual")
297
+ * ISO 8601 timestamp when configuration was last updated
298
+ *
299
+ * @example "2025-11-04T15:30:00Z"
193
300
  */
194
- source?: string;
301
+ updatedAt: string;
195
302
  /**
196
- * Configuration version
303
+ * Source of configuration
304
+ *
305
+ * - "wizard": Created via interactive setup wizard
306
+ * - "manual": Hand-edited by user
307
+ * - "cli": Created via CLI command
197
308
  */
198
- version?: string;
309
+ source: "wizard" | "manual" | "cli";
199
310
  /**
200
- * Additional metadata fields
311
+ * Additional metadata fields (extensible)
201
312
  */
202
313
  [key: string]: string | undefined;
203
314
  }
204
315
  /**
205
- * Complete Configuration
316
+ * Deployment History
206
317
  *
207
- * Merged configuration from all sources (user + derived + deploy).
318
+ * Tracks all deployments for a profile, with active deployment pointers per stage.
208
319
  */
209
- export type CompleteConfig = DeploymentConfig;
210
- /**
211
- * Configuration Set
212
- *
213
- * Collection of configurations for merging operations.
214
- */
215
- export interface ConfigSet {
216
- user?: UserConfig;
217
- derived?: DerivedConfig;
218
- deploy?: DeploymentConfig;
320
+ export interface DeploymentHistory {
321
+ /**
322
+ * Active deployments by stage name
323
+ *
324
+ * Maps stage name (e.g., "dev", "prod") to the currently active deployment.
325
+ *
326
+ * @example
327
+ * ```json
328
+ * {
329
+ * "dev": { "stage": "dev", "endpoint": "https://...", "imageTag": "latest", ... },
330
+ * "prod": { "stage": "prod", "endpoint": "https://...", "imageTag": "0.7.0", ... }
331
+ * }
332
+ * ```
333
+ */
334
+ active: Record<string, DeploymentRecord>;
335
+ /**
336
+ * Complete deployment history (newest first)
337
+ *
338
+ * All past deployments for this profile, ordered by timestamp descending.
339
+ */
340
+ history: DeploymentRecord[];
219
341
  }
220
342
  /**
221
- * Configuration Profile
343
+ * Deployment Record
222
344
  *
223
- * Named configuration with metadata for profile management.
345
+ * A single deployment event with full metadata for debugging and rollback.
224
346
  */
225
- export interface ConfigProfile {
347
+ export interface DeploymentRecord {
226
348
  /**
227
- * Profile name (e.g., "default", "dev", "prod")
349
+ * API Gateway stage name
350
+ *
351
+ * @example "dev"
352
+ * @example "prod"
228
353
  */
229
- name: ProfileName;
354
+ stage: string;
230
355
  /**
231
- * User configuration for this profile
356
+ * ISO 8601 deployment timestamp
357
+ *
358
+ * @example "2025-11-04T10:30:00Z"
232
359
  */
233
- user?: UserConfig;
360
+ timestamp: string;
234
361
  /**
235
- * Derived configuration for this profile
362
+ * Docker image tag deployed
363
+ *
364
+ * @example "latest"
365
+ * @example "0.7.0"
236
366
  */
237
- derived?: DerivedConfig;
367
+ imageTag: string;
238
368
  /**
239
- * Deployment configuration for this profile
369
+ * Deployed webhook endpoint URL
370
+ *
371
+ * @example "https://abc123.execute-api.us-east-1.amazonaws.com/dev"
240
372
  */
241
- deploy?: DeploymentConfig;
373
+ endpoint: string;
242
374
  /**
243
- * Profile metadata
375
+ * CloudFormation stack name
376
+ *
377
+ * @example "BenchlingWebhookStack"
244
378
  */
245
- metadata?: {
246
- createdAt?: string;
247
- updatedAt?: string;
248
- description?: string;
249
- };
379
+ stackName: string;
380
+ /**
381
+ * AWS region
382
+ *
383
+ * @example "us-east-1"
384
+ */
385
+ region: string;
386
+ /**
387
+ * User who triggered deployment (optional)
388
+ *
389
+ * @example "ernest@example.com"
390
+ */
391
+ deployedBy?: string;
392
+ /**
393
+ * Git commit hash (optional)
394
+ *
395
+ * @example "abc123f"
396
+ */
397
+ commit?: string;
398
+ /**
399
+ * Additional metadata (extensible)
400
+ */
401
+ [key: string]: string | undefined;
250
402
  }
251
403
  /**
252
404
  * Configuration Validation Result
@@ -259,7 +411,7 @@ export interface ValidationResult {
259
411
  */
260
412
  isValid: boolean;
261
413
  /**
262
- * Validation errors (if any)
414
+ * Validation errors (fatal issues that prevent deployment)
263
415
  */
264
416
  errors: string[];
265
417
  /**
@@ -272,23 +424,31 @@ export interface ValidationResult {
272
424
  details?: Record<string, unknown>;
273
425
  }
274
426
  /**
275
- * XDG Configuration Paths
427
+ * Migration Report
276
428
  *
277
- * File paths for XDG-compliant configuration storage.
429
+ * Result of migrating from legacy configuration format.
278
430
  */
279
- export interface XDGConfigPaths {
431
+ export interface MigrationReport {
280
432
  /**
281
- * Path to user configuration file
433
+ * Whether migration completed successfully
282
434
  */
283
- userConfig: string;
435
+ success: boolean;
284
436
  /**
285
- * Path to derived configuration file
437
+ * Profiles that were successfully migrated
286
438
  */
287
- derivedConfig: string;
439
+ profilesMigrated: string[];
288
440
  /**
289
- * Path to deployment configuration file
441
+ * Migration errors
290
442
  */
291
- deployConfig: string;
443
+ errors: string[];
444
+ /**
445
+ * Migration warnings (non-fatal issues)
446
+ */
447
+ warnings?: string[];
448
+ /**
449
+ * Additional migration details
450
+ */
451
+ details?: Record<string, unknown>;
292
452
  }
293
453
  /**
294
454
  * Profile Management Options
@@ -308,91 +468,237 @@ export interface ProfileOptions {
308
468
  createIfMissing?: boolean;
309
469
  }
310
470
  /**
311
- * Configuration Read Options
312
- */
313
- export interface ConfigReadOptions {
314
- /**
315
- * Configuration type to read
316
- */
317
- type: ConfigType;
318
- /**
319
- * Profile name (defaults to "default")
320
- */
321
- profile?: ProfileName;
322
- /**
323
- * Throw error if file doesn't exist
324
- */
325
- throwIfMissing?: boolean;
326
- /**
327
- * Validate schema after reading
328
- */
329
- validate?: boolean;
330
- }
331
- /**
332
- * Configuration Write Options
333
- */
334
- export interface ConfigWriteOptions {
335
- /**
336
- * Configuration type to write
337
- */
338
- type: ConfigType;
339
- /**
340
- * Profile name (defaults to "default")
341
- */
342
- profile?: ProfileName;
343
- /**
344
- * Create backup before writing
345
- */
346
- backup?: boolean;
347
- /**
348
- * Validate schema before writing
349
- */
350
- validate?: boolean;
351
- /**
352
- * Add metadata to configuration
353
- */
354
- addMetadata?: boolean;
355
- }
356
- /**
357
- * AWS Profile Configuration
471
+ * JSON Schema for ProfileConfig validation
358
472
  *
359
- * Integration with AWS credentials and profiles.
473
+ * This schema can be used with ajv or other JSON Schema validators.
360
474
  */
361
- export interface AWSProfileConfig {
362
- /**
363
- * AWS profile name from ~/.aws/credentials
364
- */
365
- profileName: string;
366
- /**
367
- * AWS region
368
- */
369
- region?: string;
370
- /**
371
- * AWS account ID
372
- */
373
- accountId?: string;
374
- }
475
+ export declare const ProfileConfigSchema: {
476
+ readonly $schema: "http://json-schema.org/draft-07/schema#";
477
+ readonly title: "ProfileConfig";
478
+ readonly description: "Benchling Webhook Profile Configuration (v0.7.0)";
479
+ readonly type: "object";
480
+ readonly required: readonly ["quilt", "benchling", "packages", "deployment", "_metadata"];
481
+ readonly properties: {
482
+ readonly quilt: {
483
+ readonly type: "object";
484
+ readonly required: readonly ["stackArn", "catalog", "database", "queueUrl", "region"];
485
+ readonly properties: {
486
+ readonly stackArn: {
487
+ readonly type: "string";
488
+ readonly pattern: "^arn:aws:cloudformation:";
489
+ };
490
+ readonly catalog: {
491
+ readonly type: "string";
492
+ readonly minLength: 1;
493
+ };
494
+ readonly database: {
495
+ readonly type: "string";
496
+ readonly minLength: 1;
497
+ };
498
+ readonly queueUrl: {
499
+ readonly type: "string";
500
+ readonly pattern: "^https://sqs\\.[a-z0-9-]+\\.amazonaws\\.com/\\d{12}/.+";
501
+ };
502
+ readonly region: {
503
+ readonly type: "string";
504
+ readonly pattern: "^[a-z]{2}-[a-z]+-[0-9]$";
505
+ };
506
+ };
507
+ };
508
+ readonly benchling: {
509
+ readonly type: "object";
510
+ readonly required: readonly ["tenant", "clientId", "appDefinitionId"];
511
+ readonly properties: {
512
+ readonly tenant: {
513
+ readonly type: "string";
514
+ readonly minLength: 1;
515
+ };
516
+ readonly clientId: {
517
+ readonly type: "string";
518
+ readonly minLength: 1;
519
+ };
520
+ readonly clientSecret: {
521
+ readonly type: "string";
522
+ };
523
+ readonly secretArn: {
524
+ readonly type: "string";
525
+ readonly pattern: "^arn:aws:secretsmanager:";
526
+ };
527
+ readonly appDefinitionId: {
528
+ readonly type: "string";
529
+ readonly minLength: 1;
530
+ };
531
+ readonly testEntryId: {
532
+ readonly type: "string";
533
+ };
534
+ };
535
+ };
536
+ readonly packages: {
537
+ readonly type: "object";
538
+ readonly required: readonly ["bucket", "prefix", "metadataKey"];
539
+ readonly properties: {
540
+ readonly bucket: {
541
+ readonly type: "string";
542
+ readonly minLength: 3;
543
+ };
544
+ readonly prefix: {
545
+ readonly type: "string";
546
+ readonly minLength: 1;
547
+ };
548
+ readonly metadataKey: {
549
+ readonly type: "string";
550
+ readonly minLength: 1;
551
+ };
552
+ };
553
+ };
554
+ readonly deployment: {
555
+ readonly type: "object";
556
+ readonly required: readonly ["region"];
557
+ readonly properties: {
558
+ readonly region: {
559
+ readonly type: "string";
560
+ readonly pattern: "^[a-z]{2}-[a-z]+-[0-9]$";
561
+ };
562
+ readonly account: {
563
+ readonly type: "string";
564
+ readonly pattern: "^[0-9]{12}$";
565
+ };
566
+ readonly ecrRepository: {
567
+ readonly type: "string";
568
+ };
569
+ readonly imageTag: {
570
+ readonly type: "string";
571
+ };
572
+ };
573
+ };
574
+ readonly logging: {
575
+ readonly type: "object";
576
+ readonly properties: {
577
+ readonly level: {
578
+ readonly type: "string";
579
+ readonly enum: readonly ["DEBUG", "INFO", "WARNING", "ERROR"];
580
+ };
581
+ };
582
+ };
583
+ readonly security: {
584
+ readonly type: "object";
585
+ readonly properties: {
586
+ readonly webhookAllowList: {
587
+ readonly type: "string";
588
+ };
589
+ readonly enableVerification: {
590
+ readonly type: "boolean";
591
+ };
592
+ };
593
+ };
594
+ readonly _metadata: {
595
+ readonly type: "object";
596
+ readonly required: readonly ["version", "createdAt", "updatedAt", "source"];
597
+ readonly properties: {
598
+ readonly version: {
599
+ readonly type: "string";
600
+ };
601
+ readonly createdAt: {
602
+ readonly type: "string";
603
+ readonly format: "date-time";
604
+ };
605
+ readonly updatedAt: {
606
+ readonly type: "string";
607
+ readonly format: "date-time";
608
+ };
609
+ readonly source: {
610
+ readonly type: "string";
611
+ readonly enum: readonly ["wizard", "manual", "cli"];
612
+ };
613
+ };
614
+ };
615
+ readonly _inherits: {
616
+ readonly type: "string";
617
+ };
618
+ };
619
+ readonly additionalProperties: false;
620
+ };
375
621
  /**
376
- * Quilt CLI Configuration
377
- *
378
- * Configuration inferred from quilt3 CLI.
622
+ * JSON Schema for DeploymentHistory validation
379
623
  */
380
- export interface QuiltCLIConfig {
381
- /**
382
- * Catalog URL from quilt3 config
383
- */
384
- catalog?: string;
385
- /**
386
- * Default bucket from quilt3 config
387
- */
388
- defaultBucket?: string;
389
- /**
390
- * AWS region from quilt3 config
391
- */
392
- region?: string;
393
- /**
394
- * Registry URL from quilt3 config
395
- */
396
- registryUrl?: string;
397
- }
624
+ export declare const DeploymentHistorySchema: {
625
+ readonly $schema: "http://json-schema.org/draft-07/schema#";
626
+ readonly title: "DeploymentHistory";
627
+ readonly description: "Deployment tracking for a profile";
628
+ readonly type: "object";
629
+ readonly required: readonly ["active", "history"];
630
+ readonly properties: {
631
+ readonly active: {
632
+ readonly type: "object";
633
+ readonly additionalProperties: {
634
+ readonly type: "object";
635
+ readonly required: readonly ["stage", "timestamp", "imageTag", "endpoint", "stackName", "region"];
636
+ readonly properties: {
637
+ readonly stage: {
638
+ readonly type: "string";
639
+ };
640
+ readonly timestamp: {
641
+ readonly type: "string";
642
+ readonly format: "date-time";
643
+ };
644
+ readonly imageTag: {
645
+ readonly type: "string";
646
+ };
647
+ readonly endpoint: {
648
+ readonly type: "string";
649
+ readonly format: "uri";
650
+ };
651
+ readonly stackName: {
652
+ readonly type: "string";
653
+ };
654
+ readonly region: {
655
+ readonly type: "string";
656
+ };
657
+ readonly deployedBy: {
658
+ readonly type: "string";
659
+ };
660
+ readonly commit: {
661
+ readonly type: "string";
662
+ };
663
+ };
664
+ };
665
+ };
666
+ readonly history: {
667
+ readonly type: "array";
668
+ readonly items: {
669
+ readonly type: "object";
670
+ readonly required: readonly ["stage", "timestamp", "imageTag", "endpoint", "stackName", "region"];
671
+ readonly properties: {
672
+ readonly stage: {
673
+ readonly type: "string";
674
+ };
675
+ readonly timestamp: {
676
+ readonly type: "string";
677
+ readonly format: "date-time";
678
+ };
679
+ readonly imageTag: {
680
+ readonly type: "string";
681
+ };
682
+ readonly endpoint: {
683
+ readonly type: "string";
684
+ readonly format: "uri";
685
+ };
686
+ readonly stackName: {
687
+ readonly type: "string";
688
+ };
689
+ readonly region: {
690
+ readonly type: "string";
691
+ };
692
+ readonly deployedBy: {
693
+ readonly type: "string";
694
+ };
695
+ readonly commit: {
696
+ readonly type: "string";
697
+ };
698
+ };
699
+ };
700
+ };
701
+ };
702
+ readonly additionalProperties: false;
703
+ };
398
704
  //# sourceMappingURL=config.d.ts.map