@hyperdrive.bot/cli 1.0.12 → 1.0.16

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 (157) hide show
  1. package/README.md +1495 -474
  2. package/dist/commands/deploy.d.ts +18 -0
  3. package/dist/commands/deploy.js +239 -0
  4. package/dist/commands/deployment/create.js +10 -2
  5. package/dist/commands/domain/{switch.d.ts → set-production.d.ts} +1 -1
  6. package/dist/commands/domain/set-production.js +27 -0
  7. package/dist/commands/git/list-open-prs.d.ts +12 -0
  8. package/dist/commands/git/list-open-prs.js +87 -0
  9. package/dist/commands/hook/add.d.ts +22 -0
  10. package/dist/commands/hook/add.js +299 -0
  11. package/dist/commands/hook/list.d.ts +11 -0
  12. package/dist/commands/hook/list.js +111 -0
  13. package/dist/commands/hook/logs.d.ts +13 -0
  14. package/dist/commands/hook/logs.js +124 -0
  15. package/dist/commands/hook/remove.d.ts +12 -0
  16. package/dist/commands/hook/remove.js +115 -0
  17. package/dist/commands/hook/toggle.d.ts +12 -0
  18. package/dist/commands/hook/toggle.js +125 -0
  19. package/dist/commands/init.d.ts +1 -1
  20. package/dist/commands/init.js +49 -9
  21. package/dist/commands/module/bindings.d.ts +14 -0
  22. package/dist/commands/module/bindings.js +125 -0
  23. package/dist/commands/module/create.d.ts +3 -0
  24. package/dist/commands/module/create.js +156 -78
  25. package/dist/commands/module/list.d.ts +1 -0
  26. package/dist/commands/module/list.js +22 -1
  27. package/dist/commands/module/sync.d.ts +29 -0
  28. package/dist/commands/module/sync.js +409 -0
  29. package/dist/commands/module/unlink.d.ts +11 -0
  30. package/dist/commands/module/unlink.js +77 -0
  31. package/dist/commands/module/update.d.ts +10 -0
  32. package/dist/commands/module/update.js +168 -5
  33. package/dist/commands/network/discover.d.ts +12 -0
  34. package/dist/commands/network/discover.js +210 -0
  35. package/dist/commands/network/get.d.ts +13 -0
  36. package/dist/commands/network/get.js +90 -0
  37. package/dist/commands/{auth/logout.d.ts → network/list.d.ts} +2 -9
  38. package/dist/commands/network/list.js +71 -0
  39. package/dist/commands/network/register.d.ts +16 -0
  40. package/dist/commands/network/register.js +144 -0
  41. package/dist/commands/parameter/sync.d.ts +13 -0
  42. package/dist/commands/parameter/sync.js +69 -1
  43. package/dist/commands/project/sync.d.ts +5 -11
  44. package/dist/commands/project/sync.js +12 -381
  45. package/dist/commands/seed.d.ts +93 -0
  46. package/dist/commands/seed.js +324 -0
  47. package/dist/commands/service/backup.d.ts +17 -0
  48. package/dist/commands/service/backup.js +156 -0
  49. package/dist/commands/service/backups.d.ts +14 -0
  50. package/dist/commands/service/backups.js +110 -0
  51. package/dist/commands/service/bind.d.ts +16 -0
  52. package/dist/commands/service/bind.js +106 -0
  53. package/dist/commands/service/bindings.d.ts +13 -0
  54. package/dist/commands/service/bindings.js +78 -0
  55. package/dist/commands/service/clone.d.ts +19 -0
  56. package/dist/commands/service/clone.js +153 -0
  57. package/dist/commands/service/create.d.ts +16 -0
  58. package/dist/commands/service/create.js +212 -0
  59. package/dist/commands/service/get.d.ts +13 -0
  60. package/dist/commands/service/get.js +97 -0
  61. package/dist/commands/service/list.d.ts +12 -0
  62. package/dist/commands/service/list.js +86 -0
  63. package/dist/commands/service/register.d.ts +21 -0
  64. package/dist/commands/service/register.js +215 -0
  65. package/dist/commands/service/restore.d.ts +19 -0
  66. package/dist/commands/service/restore.js +158 -0
  67. package/dist/commands/service/seed.d.ts +17 -0
  68. package/dist/commands/service/seed.js +173 -0
  69. package/dist/commands/service/templates.d.ts +10 -0
  70. package/dist/commands/service/templates.js +66 -0
  71. package/dist/commands/service/unbind.d.ts +15 -0
  72. package/dist/commands/service/unbind.js +74 -0
  73. package/dist/commands/stage/create.d.ts +23 -0
  74. package/dist/commands/stage/create.js +145 -6
  75. package/dist/commands/stage/delete.d.ts +11 -0
  76. package/dist/commands/stage/delete.js +85 -0
  77. package/dist/commands/stage/deploy.d.ts +34 -0
  78. package/dist/commands/stage/deploy.js +294 -0
  79. package/dist/commands/stage/ensure-branches.d.ts +23 -0
  80. package/dist/commands/stage/ensure-branches.js +101 -0
  81. package/dist/commands/stage/list.js +4 -0
  82. package/dist/commands/stage/status.d.ts +14 -0
  83. package/dist/commands/stage/status.js +100 -0
  84. package/dist/commands/{jira → tracker}/connect.js +32 -23
  85. package/dist/commands/tracker/hook/add.d.ts +25 -0
  86. package/dist/commands/tracker/hook/add.js +284 -0
  87. package/dist/commands/{jira → tracker}/hook/list.js +20 -11
  88. package/dist/commands/{jira/hook/add.d.ts → tracker/hook/logs.d.ts} +2 -3
  89. package/dist/commands/tracker/hook/logs.js +126 -0
  90. package/dist/commands/{jira → tracker}/hook/remove.js +9 -8
  91. package/dist/commands/{jira → tracker}/hook/toggle.js +14 -12
  92. package/dist/commands/tracker/project/init.d.ts +17 -0
  93. package/dist/commands/tracker/project/init.js +178 -0
  94. package/dist/commands/tracker/project/link-module.d.ts +17 -0
  95. package/dist/commands/tracker/project/link-module.js +287 -0
  96. package/dist/commands/tracker/project/list-modules.d.ts +11 -0
  97. package/dist/commands/tracker/project/list-modules.js +117 -0
  98. package/dist/commands/tracker/project/list.d.ts +10 -0
  99. package/dist/commands/tracker/project/list.js +90 -0
  100. package/dist/commands/tracker/project/status.d.ts +13 -0
  101. package/dist/commands/tracker/project/status.js +168 -0
  102. package/dist/commands/tracker/project/unlink-module.d.ts +13 -0
  103. package/dist/commands/tracker/project/unlink-module.js +251 -0
  104. package/dist/commands/{jira → tracker}/status.js +3 -3
  105. package/dist/lib/ensure-branches.d.ts +53 -0
  106. package/dist/lib/ensure-branches.js +149 -0
  107. package/dist/lib/git-providers/github.d.ts +16 -0
  108. package/dist/lib/git-providers/github.js +157 -0
  109. package/dist/lib/git-providers/gitlab.d.ts +16 -0
  110. package/dist/lib/git-providers/gitlab.js +148 -0
  111. package/dist/lib/git-providers/index.d.ts +67 -0
  112. package/dist/lib/git-providers/index.js +39 -0
  113. package/dist/lib/lambda-warmer.d.ts +106 -0
  114. package/dist/lib/lambda-warmer.js +189 -0
  115. package/dist/services/hyperdrive-sigv4.d.ts +360 -5
  116. package/dist/services/hyperdrive-sigv4.js +192 -24
  117. package/dist/utils/hook-flow.d.ts +60 -3
  118. package/dist/utils/hook-flow.js +437 -2
  119. package/dist/utils/hook-normalize.d.ts +6 -0
  120. package/dist/utils/hook-normalize.js +33 -0
  121. package/dist/utils/lifecycle-poller.d.ts +32 -0
  122. package/dist/utils/lifecycle-poller.js +72 -0
  123. package/dist/utils/retry.d.ts +43 -0
  124. package/dist/utils/retry.js +88 -0
  125. package/dist/utils/summary-display.js +1 -1
  126. package/dist/utils/tracker-project-flow.d.ts +84 -0
  127. package/dist/utils/tracker-project-flow.js +564 -0
  128. package/package.json +35 -7
  129. package/dist/commands/auth/login.d.ts +0 -16
  130. package/dist/commands/auth/login.js +0 -179
  131. package/dist/commands/auth/logout.js +0 -116
  132. package/dist/commands/auth/refresh.d.ts +0 -6
  133. package/dist/commands/auth/refresh.js +0 -66
  134. package/dist/commands/auth/status.d.ts +0 -6
  135. package/dist/commands/auth/status.js +0 -63
  136. package/dist/commands/config/get.d.ts +0 -9
  137. package/dist/commands/config/get.js +0 -37
  138. package/dist/commands/config/set.d.ts +0 -10
  139. package/dist/commands/config/set.js +0 -48
  140. package/dist/commands/config/show.d.ts +0 -6
  141. package/dist/commands/config/show.js +0 -10
  142. package/dist/commands/domain/current.d.ts +0 -6
  143. package/dist/commands/domain/current.js +0 -18
  144. package/dist/commands/domain/list.d.ts +0 -6
  145. package/dist/commands/domain/list.js +0 -42
  146. package/dist/commands/domain/switch.js +0 -40
  147. package/dist/commands/jira/hook/add.js +0 -147
  148. package/dist/services/tenant-service.d.ts +0 -127
  149. package/dist/services/tenant-service.js +0 -396
  150. package/dist/utils/auth-flow.d.ts +0 -147
  151. package/dist/utils/auth-flow.js +0 -479
  152. package/oclif.manifest.json +0 -3519
  153. /package/dist/commands/{jira → tracker}/connect.d.ts +0 -0
  154. /package/dist/commands/{jira → tracker}/hook/list.d.ts +0 -0
  155. /package/dist/commands/{jira → tracker}/hook/remove.d.ts +0 -0
  156. /package/dist/commands/{jira → tracker}/hook/toggle.d.ts +0 -0
  157. /package/dist/commands/{jira → tracker}/status.d.ts +0 -0
@@ -17,8 +17,15 @@ const CLI_VERSION = packageJson.version;
17
17
  /**
18
18
  * Hyperdrive API Service with AWS SigV4 authentication
19
19
  */
20
+ // API-137: parameter HTTP endpoints split out of the main hyperdrive APIGW
21
+ // into a dedicated `api-hyperdrive-parameter-live` APIGW (API-135 follow-up).
22
+ // Hardcoded fallback used until the auth bootstrap returns this entry in
23
+ // `additionalApiUrls['hyperdrive-parameter']`.
24
+ const HYPERDRIVE_PARAMETER_API_URL_LIVE = 'https://rtxiim14g6.execute-api.sa-east-1.amazonaws.com/live';
20
25
  export class HyperdriveSigV4Service extends SigV4ApiClient {
26
+ projectsApiUrl;
21
27
  userGroupsApiUrl;
28
+ parameterApiUrl;
22
29
  constructor(domain) {
23
30
  super({
24
31
  authConfig: HYPERDRIVE_AUTH_CONFIG,
@@ -28,8 +35,17 @@ export class HyperdriveSigV4Service extends SigV4ApiClient {
28
35
  apiUrlOverride: process.env.HYPERDRIVE_API_URL,
29
36
  regionOverride: process.env.HYPERDRIVE_AWS_REGION,
30
37
  });
31
- // Get user groups API URL from credentials (key matches bootstrap REST config name)
38
+ // Reunified: all endpoints served by the main hyperdrive API
39
+ this.projectsApiUrl = this.getAdditionalApiUrl('hyperdrive');
32
40
  this.userGroupsApiUrl = this.getAdditionalApiUrl('user-groups');
41
+ // Parameter sub-module APIGW (API-135). Prefer dynamic discovery; fall
42
+ // back to env override or hardcoded live URL until backend wires the
43
+ // discovery entry. Once `additionalApiUrls['hyperdrive-parameter']` is
44
+ // populated, the fallback becomes inert without touching this code.
45
+ this.parameterApiUrl =
46
+ this.getAdditionalApiUrl('hyperdrive-parameter') ??
47
+ process.env.HYPERDRIVE_PARAMETER_API_URL ??
48
+ HYPERDRIVE_PARAMETER_API_URL_LIVE;
33
49
  }
34
50
  // ============================================================================
35
51
  // AWS Account Methods
@@ -184,6 +200,15 @@ export class HyperdriveSigV4Service extends SigV4ApiClient {
184
200
  async deploymentList(params) {
185
201
  return this.makeSignedRequest('GET', `/deployments?projectSlug=${params.projectSlug}&stage=${params.stage}`);
186
202
  }
203
+ async deploymentCreateStatic(params) {
204
+ return this.makeSignedRequest('POST', '/deployments/static', params);
205
+ }
206
+ async deploymentFinalizeStatic(deploymentId, options) {
207
+ return this.makeSignedRequest('POST', `/deployments/${deploymentId}/finalize`, {
208
+ deploymentId,
209
+ ...(options?.spa !== undefined && { spa: options.spa }),
210
+ });
211
+ }
187
212
  // ============================================================================
188
213
  // Git Integration Methods
189
214
  // ============================================================================
@@ -213,16 +238,16 @@ export class HyperdriveSigV4Service extends SigV4ApiClient {
213
238
  // Hook Methods
214
239
  // ============================================================================
215
240
  async hookCreate(projectId, body) {
216
- return this.makeSignedRequest('POST', `/hyperdrive/projects/${encodeURIComponent(projectId)}/hooks`, body);
241
+ return this.makeSignedRequest('POST', `/hyperdrive/projects/${encodeURIComponent(projectId)}/hooks`, body, this.projectsApiUrl);
217
242
  }
218
243
  async hookCreateV2(projectId, body) {
219
- return this.makeSignedRequest('POST', `/hyperdrive/projects/${encodeURIComponent(projectId)}/hooks`, body);
244
+ return this.makeSignedRequest('POST', `/hyperdrive/projects/${encodeURIComponent(projectId)}/hooks`, body, this.projectsApiUrl);
220
245
  }
221
246
  async hookDelete(projectId, hookId) {
222
- return this.makeSignedRequest('DELETE', `/hyperdrive/projects/${encodeURIComponent(projectId)}/hooks/${encodeURIComponent(hookId)}`);
247
+ return this.makeSignedRequest('DELETE', `/hyperdrive/projects/${encodeURIComponent(projectId)}/hooks/${encodeURIComponent(hookId)}`, undefined, this.projectsApiUrl);
223
248
  }
224
249
  async hookList(projectId) {
225
- return this.makeSignedRequest('GET', `/hyperdrive/projects/${encodeURIComponent(projectId)}/hooks`);
250
+ return this.makeSignedRequest('GET', `/hyperdrive/projects/${encodeURIComponent(projectId)}/hooks`, undefined, this.projectsApiUrl);
226
251
  }
227
252
  async hookLogList(projectId, options) {
228
253
  const params = new URLSearchParams();
@@ -231,10 +256,37 @@ export class HyperdriveSigV4Service extends SigV4ApiClient {
231
256
  if (options?.status)
232
257
  params.set('status', options.status);
233
258
  const qs = params.toString() ? `?${params.toString()}` : '';
234
- return this.makeSignedRequest('GET', `/hyperdrive/projects/${encodeURIComponent(projectId)}/hook-logs${qs}`);
259
+ return this.makeSignedRequest('GET', `/hyperdrive/projects/${encodeURIComponent(projectId)}/hook-logs${qs}`, undefined, this.projectsApiUrl);
235
260
  }
236
261
  async hookUpdate(projectId, hookId, body) {
237
- return this.makeSignedRequest('PATCH', `/hyperdrive/projects/${encodeURIComponent(projectId)}/hooks/${encodeURIComponent(hookId)}`, body);
262
+ return this.makeSignedRequest('PATCH', `/hyperdrive/projects/${encodeURIComponent(projectId)}/hooks/${encodeURIComponent(hookId)}`, body, this.projectsApiUrl);
263
+ }
264
+ // ============================================================================
265
+ // Tenant Lifecycle Hook Methods
266
+ // ============================================================================
267
+ async tenantHookCreate(body) {
268
+ return this.makeSignedRequest('POST', '/hyperdrive/hooks', body, this.projectsApiUrl);
269
+ }
270
+ async tenantHookDelete(hookId) {
271
+ return this.makeSignedRequest('DELETE', `/hyperdrive/hooks/${encodeURIComponent(hookId)}`, undefined, this.projectsApiUrl);
272
+ }
273
+ async tenantHookGet(hookId) {
274
+ return this.makeSignedRequest('GET', `/hyperdrive/hooks/${encodeURIComponent(hookId)}`, undefined, this.projectsApiUrl);
275
+ }
276
+ async tenantHookList() {
277
+ return this.makeSignedRequest('GET', '/hyperdrive/hooks', undefined, this.projectsApiUrl);
278
+ }
279
+ async tenantHookLogList(options) {
280
+ const params = new URLSearchParams();
281
+ if (options?.limit)
282
+ params.set('limit', String(options.limit));
283
+ if (options?.status)
284
+ params.set('status', options.status);
285
+ const qs = params.toString() ? `?${params.toString()}` : '';
286
+ return this.makeSignedRequest('GET', `/hyperdrive/hooks/logs${qs}`, undefined, this.projectsApiUrl);
287
+ }
288
+ async tenantHookUpdate(hookId, body) {
289
+ return this.makeSignedRequest('PATCH', `/hyperdrive/hooks/${encodeURIComponent(hookId)}`, body, this.projectsApiUrl);
238
290
  }
239
291
  async projectGetJiraStatuses(projectId) {
240
292
  return this.makeSignedRequest('GET', `/hyperdrive/projects/${encodeURIComponent(projectId)}/jira/statuses`);
@@ -242,35 +294,94 @@ export class HyperdriveSigV4Service extends SigV4ApiClient {
242
294
  // ============================================================================
243
295
  // Jira Integration Methods
244
296
  // ============================================================================
297
+ async jiraListProjects() {
298
+ return this.makeSignedRequest('GET', '/hyperdrive/jira/projects', undefined, this.projectsApiUrl);
299
+ }
245
300
  async jiraGetProjectStatuses(jiraProjectKey) {
246
- return this.makeSignedRequest('GET', `/hyperdrive/jira/projects/${encodeURIComponent(jiraProjectKey)}/statuses`);
301
+ return this.makeSignedRequest('GET', `/hyperdrive/jira/projects/${encodeURIComponent(jiraProjectKey)}/statuses`, undefined, this.projectsApiUrl);
247
302
  }
248
303
  async jiraPreRegister(params) {
249
- return this.makeSignedRequest('POST', '/hyperdrive/jira/pre-register', params);
304
+ return this.makeSignedRequest('POST', '/hyperdrive/jira/pre-register', params, this.projectsApiUrl);
305
+ }
306
+ async jiraStatus() {
307
+ return this.makeSignedRequest('GET', '/hyperdrive/jira/status', undefined, this.projectsApiUrl);
308
+ }
309
+ // ============================================================================
310
+ // Tracker Project Methods
311
+ // ============================================================================
312
+ async trackerProjectCreate(data) {
313
+ return this.makeSignedRequest('POST', '/hyperdrive/tracker-projects', data, this.projectsApiUrl);
314
+ }
315
+ async trackerProjectDelete(trackerProjectId) {
316
+ return this.makeSignedRequest('DELETE', `/hyperdrive/tracker-projects/${encodeURIComponent(trackerProjectId)}`, undefined, this.projectsApiUrl);
317
+ }
318
+ async trackerProjectHookCreate(trackerProjectId, body) {
319
+ return this.makeSignedRequest('POST', `/hyperdrive/tracker-projects/${encodeURIComponent(trackerProjectId)}/hooks`, body, this.projectsApiUrl);
320
+ }
321
+ async trackerProjectHookCreateV2(trackerProjectId, body) {
322
+ return this.makeSignedRequest('POST', `/hyperdrive/tracker-projects/${encodeURIComponent(trackerProjectId)}/hooks`, body, this.projectsApiUrl);
323
+ }
324
+ async trackerProjectHookDelete(trackerProjectId, hookId) {
325
+ return this.makeSignedRequest('DELETE', `/hyperdrive/tracker-projects/${encodeURIComponent(trackerProjectId)}/hooks/${encodeURIComponent(hookId)}`, undefined, this.projectsApiUrl);
326
+ }
327
+ async trackerProjectHookList(trackerProjectId) {
328
+ return this.makeSignedRequest('GET', `/hyperdrive/tracker-projects/${encodeURIComponent(trackerProjectId)}/hooks`, undefined, this.projectsApiUrl);
329
+ }
330
+ async trackerProjectHookLogList(trackerProjectId, options) {
331
+ const params = new URLSearchParams();
332
+ if (options?.limit)
333
+ params.set('limit', String(options.limit));
334
+ if (options?.status)
335
+ params.set('status', options.status);
336
+ const qs = params.toString() ? `?${params.toString()}` : '';
337
+ return this.makeSignedRequest('GET', `/hyperdrive/tracker-projects/${encodeURIComponent(trackerProjectId)}/hook-logs${qs}`, undefined, this.projectsApiUrl);
338
+ }
339
+ async trackerProjectHookUpdate(trackerProjectId, hookId, body) {
340
+ return this.makeSignedRequest('PATCH', `/hyperdrive/tracker-projects/${encodeURIComponent(trackerProjectId)}/hooks/${encodeURIComponent(hookId)}`, body, this.projectsApiUrl);
341
+ }
342
+ async trackerProjectLinkModule(trackerProjectId, data) {
343
+ return this.makeSignedRequest('POST', `/hyperdrive/tracker-projects/${encodeURIComponent(trackerProjectId)}/modules`, data, this.projectsApiUrl);
344
+ }
345
+ async trackerProjectList() {
346
+ const response = await this.makeSignedRequest('GET', '/hyperdrive/tracker-projects', undefined, this.projectsApiUrl);
347
+ return Array.isArray(response) ? response : response.items;
348
+ }
349
+ async trackerProjectListModules(trackerProjectId) {
350
+ const response = await this.makeSignedRequest('GET', `/hyperdrive/tracker-projects/${encodeURIComponent(trackerProjectId)}/modules`, undefined, this.projectsApiUrl);
351
+ return response.items ?? [];
352
+ }
353
+ async trackerProjectUnlinkModule(trackerProjectId, moduleId) {
354
+ await this.makeSignedRequest('DELETE', `/hyperdrive/tracker-projects/${encodeURIComponent(trackerProjectId)}/modules/${encodeURIComponent(moduleId)}`, undefined, this.projectsApiUrl);
355
+ }
356
+ async trackerProjectGet(trackerProjectId) {
357
+ return this.makeSignedRequest('GET', `/hyperdrive/tracker-projects/${encodeURIComponent(trackerProjectId)}`, undefined, this.projectsApiUrl);
358
+ }
359
+ async trackerProjectGetContext(trackerProjectId) {
360
+ return this.makeSignedRequest('GET', `/hyperdrive/tracker-projects/${encodeURIComponent(trackerProjectId)}/context`, undefined, this.projectsApiUrl);
250
361
  }
251
362
  // ============================================================================
252
363
  // Hyperdrive Project Methods
253
364
  // ============================================================================
254
365
  async projectAddRepo(projectId, repo) {
255
- return this.makeSignedRequest('POST', `/hyperdrive/projects/${encodeURIComponent(projectId)}/repos`, repo);
366
+ return this.makeSignedRequest('POST', `/hyperdrive/projects/${encodeURIComponent(projectId)}/repos`, repo, this.projectsApiUrl);
256
367
  }
257
368
  async projectFindByJiraKey(jiraProjectKey) {
258
- return this.makeSignedRequest('GET', `/hyperdrive/projects/by-jira-key/${encodeURIComponent(jiraProjectKey)}`);
369
+ return this.makeSignedRequest('GET', `/hyperdrive/projects/by-jira-key/${encodeURIComponent(jiraProjectKey)}`, undefined, this.projectsApiUrl);
259
370
  }
260
371
  async projectGetJiraConfig(projectId) {
261
- return this.makeSignedRequest('GET', `/hyperdrive/projects/${encodeURIComponent(projectId)}/jira-config`);
372
+ return this.makeSignedRequest('GET', `/hyperdrive/projects/${encodeURIComponent(projectId)}/jira-config`, undefined, this.projectsApiUrl);
262
373
  }
263
374
  async projectListRepos(projectId) {
264
- return this.makeSignedRequest('GET', `/hyperdrive/projects/${encodeURIComponent(projectId)}/repos`);
375
+ return this.makeSignedRequest('GET', `/hyperdrive/projects/${encodeURIComponent(projectId)}/repos`, undefined, this.projectsApiUrl);
265
376
  }
266
377
  async projectSetJiraConfig(projectId, config) {
267
- return this.makeSignedRequest('PUT', `/hyperdrive/projects/${encodeURIComponent(projectId)}/jira-config`, config);
378
+ return this.makeSignedRequest('PUT', `/hyperdrive/projects/${encodeURIComponent(projectId)}/jira-config`, config, this.projectsApiUrl);
268
379
  }
269
380
  async projectUpdateRepo(projectId, repoId, updateData) {
270
- return this.makeSignedRequest('PATCH', `/hyperdrive/projects/${encodeURIComponent(projectId)}/repos/${encodeURIComponent(repoId)}`, updateData);
381
+ return this.makeSignedRequest('PATCH', `/hyperdrive/projects/${encodeURIComponent(projectId)}/repos/${encodeURIComponent(repoId)}`, updateData, this.projectsApiUrl);
271
382
  }
272
383
  async projectUpdateEntities(projectId, repoId, entities) {
273
- return this.makeSignedRequest('PUT', `/hyperdrive/projects/${encodeURIComponent(projectId)}/repos/${encodeURIComponent(repoId)}/entities`, entities);
384
+ return this.makeSignedRequest('PUT', `/hyperdrive/projects/${encodeURIComponent(projectId)}/repos/${encodeURIComponent(repoId)}/entities`, entities, this.projectsApiUrl);
274
385
  }
275
386
  // ============================================================================
276
387
  // Module Methods
@@ -304,12 +415,18 @@ export class HyperdriveSigV4Service extends SigV4ApiClient {
304
415
  async moduleLink(params) {
305
416
  return this.makeSignedRequest('POST', '/modules/link', params);
306
417
  }
418
+ async moduleUnlink(params) {
419
+ return this.makeSignedRequest('POST', '/modules/unlink', params);
420
+ }
307
421
  async moduleList() {
308
422
  return this.makeSignedRequest('GET', '/modules');
309
423
  }
310
424
  async moduleReanalyze(slug, userPrompt) {
311
425
  return this.makeSignedRequest('POST', `/modules/${slug}/reanalyze`, { userPrompt });
312
426
  }
427
+ async moduleUpdateContext(moduleSlug, data) {
428
+ return this.makeSignedRequest('PUT', `/modules/${encodeURIComponent(moduleSlug)}/context`, data);
429
+ }
313
430
  async moduleUpdate(params) {
314
431
  const { slug, ...updateData } = params;
315
432
  return this.makeSignedRequest('PUT', `/modules/${slug}`, updateData);
@@ -318,25 +435,25 @@ export class HyperdriveSigV4Service extends SigV4ApiClient {
318
435
  // Parameter Methods
319
436
  // ============================================================================
320
437
  async parameterAdd(params) {
321
- return this.makeSignedRequest('POST', '/parameters', params);
438
+ return this.makeSignedRequest('POST', '/parameters', params, this.parameterApiUrl);
322
439
  }
323
440
  async parameterBackfill(params) {
324
- return this.makeSignedRequest('POST', '/parameters/backfill', params);
441
+ return this.makeSignedRequest('POST', '/parameters/backfill', params, this.parameterApiUrl);
325
442
  }
326
443
  async parameterClear(params) {
327
- return this.makeSignedRequest('POST', '/parameters/clear', params);
444
+ return this.makeSignedRequest('POST', '/parameters/clear', params, this.parameterApiUrl);
328
445
  }
329
446
  async parameterList(params) {
330
- return this.makeSignedRequest('GET', `/parameters?accountId=${params.accountId}&projectSlug=${params.projectSlug}&specific=${params.specific}&stage=${params.stage}`);
447
+ return this.makeSignedRequest('GET', `/parameters?accountId=${params.accountId}&projectSlug=${params.projectSlug}&specific=${params.specific}&stage=${params.stage}`, undefined, this.parameterApiUrl);
331
448
  }
332
449
  async parameterRemove(params) {
333
- return this.makeSignedRequest('DELETE', `/parameters/${params.key}?accountId=${params.accountId}&projectSlug=${params.projectSlug}&specific=${params.specific}&stage=${params.stage}`);
450
+ return this.makeSignedRequest('DELETE', `/parameters/${params.key}?accountId=${params.accountId}&projectSlug=${params.projectSlug}&specific=${params.specific}&stage=${params.stage}`, undefined, this.parameterApiUrl);
334
451
  }
335
452
  async parameterSync(params) {
336
- return this.makeSignedRequest('POST', '/parameters/sync', params);
453
+ return this.makeSignedRequest('POST', '/parameters/sync', params, this.parameterApiUrl);
337
454
  }
338
455
  async parameterSyncStatus(params) {
339
- return this.makeSignedRequest('GET', `/parameters/sync/${params.taskId}`);
456
+ return this.makeSignedRequest('GET', `/parameters/sync/${params.taskId}`, undefined, this.parameterApiUrl);
340
457
  }
341
458
  async parameterUpdate(params) {
342
459
  return this.makeSignedRequest('PUT', `/parameters/${params.key}`, {
@@ -345,7 +462,7 @@ export class HyperdriveSigV4Service extends SigV4ApiClient {
345
462
  projectSlug: params.projectSlug,
346
463
  specific: params.specific,
347
464
  stage: params.stage
348
- });
465
+ }, this.parameterApiUrl);
349
466
  }
350
467
  // ============================================================================
351
468
  // Stage Methods
@@ -359,6 +476,19 @@ export class HyperdriveSigV4Service extends SigV4ApiClient {
359
476
  async stageList() {
360
477
  return this.makeSignedRequest('GET', '/stages');
361
478
  }
479
+ async stageGetDeployManifest(stageName) {
480
+ return this.makeSignedRequest('GET', `/stages/${stageName}/deploy-manifest`);
481
+ }
482
+ async stageDeploy(params) {
483
+ return this.makeSignedRequest('POST', `/stages/${params.stageName}/deploy`, {
484
+ mode: params.mode,
485
+ moduleSlug: params.moduleSlug
486
+ });
487
+ }
488
+ async stageDelete(stageName, force = false) {
489
+ const qs = force ? '?force=true' : '';
490
+ return this.makeSignedRequest('DELETE', `/stages/${stageName}${qs}`);
491
+ }
362
492
  // ============================================================================
363
493
  // Stage Access Methods
364
494
  // ============================================================================
@@ -391,7 +521,45 @@ export class HyperdriveSigV4Service extends SigV4ApiClient {
391
521
  const { data } = errorData;
392
522
  const inquirer = (await import('inquirer')).default;
393
523
  const open = (await import('open')).default;
524
+ const accounts = data.outdatedAccounts;
525
+ // Multi-account flow: show all outdated accounts with individual URLs
526
+ if (accounts && accounts.length > 1) {
527
+ console.error(`\n❌ ${accounts.length} AWS accounts have outdated cross-account roles\n`);
528
+ console.error(`Required version: ${data.requiredVersion}\n`);
529
+ for (const account of accounts) {
530
+ const label = account.name ? `${account.name} (${account.accountId})` : account.accountId;
531
+ console.error(` • ${label} — current: ${account.currentVersion || 'unknown'}`);
532
+ }
533
+ console.error('\nYou must update the CloudFormation stack in each AWS account listed above.');
534
+ console.error('Log into each account and run the stack update.\n');
535
+ const { openBrowser } = await inquirer.prompt([{
536
+ default: true,
537
+ message: `Open CloudFormation console for all ${accounts.length} accounts?`,
538
+ name: 'openBrowser',
539
+ type: 'confirm'
540
+ }]);
541
+ if (openBrowser) {
542
+ for (const account of accounts) {
543
+ const label = account.name ? `${account.name} (${account.accountId})` : account.accountId;
544
+ console.log(`\n Opening update page for ${label}...`);
545
+ await open(account.quickCreateUrl);
546
+ }
547
+ console.log('\n✓ Browser tabs opened. Update each stack, then retry your command.\n');
548
+ }
549
+ else {
550
+ console.error('\nUpdate URLs (copy and paste, log into each account):');
551
+ for (const account of accounts) {
552
+ const label = account.name ? `${account.name} (${account.accountId})` : account.accountId;
553
+ console.error(`\n ${label}:`);
554
+ console.error(` ${account.quickCreateUrl}`);
555
+ }
556
+ console.error('');
557
+ }
558
+ process.exit(1);
559
+ }
560
+ // Single-account flow (backward compatible)
394
561
  console.error('\n❌ Your cross-account IAM role needs an update\n');
562
+ console.error(`Account: ${data.accountId}`);
395
563
  console.error(`Current version: ${data.currentVersion || 'unknown'}`);
396
564
  console.error(`Required version: ${data.requiredVersion}\n`);
397
565
  console.error('Update steps:');
@@ -1,4 +1,14 @@
1
- import type { HookActionType, HookResponse } from '../services/hyperdrive-sigv4.js';
1
+ import inquirer from 'inquirer';
2
+ import type { HookActionCategory, HookActionType, HookResponse, HookTriggerEvent, HyperdriveLifecycleEvent, TenantHookResponse, TrackerHookResponseV2 } from '../services/hyperdrive-sigv4.js';
3
+ export declare const VALID_TRIGGER_EVENTS: HookTriggerEvent[];
4
+ export declare const ALL_ACTION_TYPES: HookActionType[];
5
+ export declare const VALID_LIFECYCLE_EVENTS: HyperdriveLifecycleEvent[];
6
+ export declare const LIFECYCLE_EVENT_GROUPS: (inquirer.Separator | {
7
+ name: string;
8
+ value: string;
9
+ })[];
10
+ export declare const LIFECYCLE_CONDITION_FIELDS: Record<string, string[]>;
11
+ export declare function getActionCategory(type: HookActionType): HookActionCategory;
2
12
  /**
3
13
  * Prompt user to select a trigger status from available Jira statuses
4
14
  */
@@ -11,11 +21,58 @@ export declare function promptActionType(): Promise<HookActionType>;
11
21
  * Prompt for action-specific configuration based on action type
12
22
  */
13
23
  export declare function promptActionConfig(actionType: HookActionType): Promise<Record<string, unknown>>;
24
+ /**
25
+ * Prompt user to select a trigger event type
26
+ */
27
+ export declare function promptTriggerEvent(): Promise<HookTriggerEvent>;
28
+ /**
29
+ * Prompt for event-specific trigger conditions
30
+ */
31
+ export declare function promptTriggerConditions(event: HookTriggerEvent): Promise<Record<string, string>>;
32
+ /**
33
+ * Prompt user to select an action type with category grouping
34
+ */
35
+ export declare function promptActionTypeV2(): Promise<{
36
+ category: HookActionCategory;
37
+ type: HookActionType;
38
+ }>;
39
+ /**
40
+ * Prompt for execution order
41
+ */
42
+ export declare function promptOrder(): Promise<number | undefined>;
14
43
  /**
15
44
  * Prompt user to select a hook from a list
16
45
  */
17
- export declare function promptSelectHook(hooks: HookResponse[]): Promise<HookResponse>;
46
+ export declare function promptSelectHook(hooks: Array<HookResponse | TenantHookResponse | TrackerHookResponseV2>): Promise<HookResponse | TenantHookResponse | TrackerHookResponseV2>;
18
47
  /**
19
48
  * Prompt user to confirm hook deletion
20
49
  */
21
- export declare function promptConfirmDelete(hook: HookResponse): Promise<boolean>;
50
+ export declare function promptConfirmDelete(hook: HookResponse | TenantHookResponse | TrackerHookResponseV2): Promise<boolean>;
51
+ /**
52
+ * Prompt user to choose between lifecycle event trigger and cron trigger
53
+ */
54
+ export declare function promptTriggerType(): Promise<'cron' | 'lifecycle'>;
55
+ /**
56
+ * Prompt user for a cron expression or rate expression
57
+ */
58
+ export declare function promptCronExpression(): Promise<string>;
59
+ /**
60
+ * Prompt user for an IANA timezone
61
+ */
62
+ export declare function promptCronTimezone(): Promise<string>;
63
+ /**
64
+ * Prompt user for the flexible time window (optional)
65
+ */
66
+ export declare function promptFlexibleWindow(): Promise<number | undefined>;
67
+ /**
68
+ * Prompt user to select a lifecycle event for tenant hooks
69
+ */
70
+ export declare function promptLifecycleEvent(): Promise<HyperdriveLifecycleEvent>;
71
+ /**
72
+ * Prompt for lifecycle event-specific conditions
73
+ *
74
+ * Extracts group prefix from the event (e.g., deploy.completed → deploy)
75
+ * and prompts for each field in LIFECYCLE_CONDITION_FIELDS[group].
76
+ * Returns only non-empty values.
77
+ */
78
+ export declare function promptLifecycleConditions(event: string): Promise<Record<string, string>>;