@hyperdrive.bot/cli 1.0.2

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 (127) hide show
  1. package/README.md +1598 -0
  2. package/bin/dev.cmd +3 -0
  3. package/bin/dev.js +3 -0
  4. package/bin/run.cmd +3 -0
  5. package/bin/run.js +5 -0
  6. package/dist/commands/account/add.d.ts +16 -0
  7. package/dist/commands/account/add.js +185 -0
  8. package/dist/commands/account/list.d.ts +6 -0
  9. package/dist/commands/account/list.js +37 -0
  10. package/dist/commands/account/remove.d.ts +11 -0
  11. package/dist/commands/account/remove.js +57 -0
  12. package/dist/commands/auth/login.d.ts +16 -0
  13. package/dist/commands/auth/login.js +178 -0
  14. package/dist/commands/auth/logout.d.ts +6 -0
  15. package/dist/commands/auth/logout.js +39 -0
  16. package/dist/commands/auth/refresh.d.ts +6 -0
  17. package/dist/commands/auth/refresh.js +66 -0
  18. package/dist/commands/auth/status.d.ts +6 -0
  19. package/dist/commands/auth/status.js +63 -0
  20. package/dist/commands/ci/account/create.d.ts +16 -0
  21. package/dist/commands/ci/account/create.js +158 -0
  22. package/dist/commands/ci/account/delete.d.ts +14 -0
  23. package/dist/commands/ci/account/delete.js +88 -0
  24. package/dist/commands/ci/account/list.d.ts +10 -0
  25. package/dist/commands/ci/account/list.js +65 -0
  26. package/dist/commands/config/get.d.ts +9 -0
  27. package/dist/commands/config/get.js +37 -0
  28. package/dist/commands/config/set.d.ts +10 -0
  29. package/dist/commands/config/set.js +48 -0
  30. package/dist/commands/config/show.d.ts +6 -0
  31. package/dist/commands/config/show.js +10 -0
  32. package/dist/commands/deployment/create.d.ts +30 -0
  33. package/dist/commands/deployment/create.js +188 -0
  34. package/dist/commands/deployment/get.d.ts +13 -0
  35. package/dist/commands/deployment/get.js +101 -0
  36. package/dist/commands/deployment/launch.d.ts +15 -0
  37. package/dist/commands/deployment/launch.js +105 -0
  38. package/dist/commands/deployment/list.d.ts +11 -0
  39. package/dist/commands/deployment/list.js +91 -0
  40. package/dist/commands/domain/current.d.ts +6 -0
  41. package/dist/commands/domain/current.js +18 -0
  42. package/dist/commands/domain/list.d.ts +6 -0
  43. package/dist/commands/domain/list.js +42 -0
  44. package/dist/commands/domain/switch.d.ts +9 -0
  45. package/dist/commands/domain/switch.js +40 -0
  46. package/dist/commands/example.d.ts +13 -0
  47. package/dist/commands/example.js +24 -0
  48. package/dist/commands/git/connect.d.ts +10 -0
  49. package/dist/commands/git/connect.js +56 -0
  50. package/dist/commands/git/disconnect.d.ts +11 -0
  51. package/dist/commands/git/disconnect.js +93 -0
  52. package/dist/commands/git/list.d.ts +10 -0
  53. package/dist/commands/git/list.js +53 -0
  54. package/dist/commands/git/sync.d.ts +18 -0
  55. package/dist/commands/git/sync.js +235 -0
  56. package/dist/commands/init.d.ts +188 -0
  57. package/dist/commands/init.js +817 -0
  58. package/dist/commands/jira/connect.d.ts +9 -0
  59. package/dist/commands/jira/connect.js +141 -0
  60. package/dist/commands/jira/status.d.ts +9 -0
  61. package/dist/commands/jira/status.js +118 -0
  62. package/dist/commands/module/analyze.d.ts +29 -0
  63. package/dist/commands/module/analyze.js +201 -0
  64. package/dist/commands/module/create.d.ts +42 -0
  65. package/dist/commands/module/create.js +498 -0
  66. package/dist/commands/module/destroy.d.ts +11 -0
  67. package/dist/commands/module/destroy.js +77 -0
  68. package/dist/commands/module/get.d.ts +10 -0
  69. package/dist/commands/module/get.js +43 -0
  70. package/dist/commands/module/link.d.ts +15 -0
  71. package/dist/commands/module/link.js +175 -0
  72. package/dist/commands/module/list.d.ts +9 -0
  73. package/dist/commands/module/list.js +51 -0
  74. package/dist/commands/module/reanalyze.d.ts +30 -0
  75. package/dist/commands/module/reanalyze.js +206 -0
  76. package/dist/commands/module/update.d.ts +27 -0
  77. package/dist/commands/module/update.js +102 -0
  78. package/dist/commands/parameter/add.d.ts +15 -0
  79. package/dist/commands/parameter/add.js +99 -0
  80. package/dist/commands/parameter/backfill.d.ts +12 -0
  81. package/dist/commands/parameter/backfill.js +113 -0
  82. package/dist/commands/parameter/clear.d.ts +14 -0
  83. package/dist/commands/parameter/clear.js +95 -0
  84. package/dist/commands/parameter/list.d.ts +14 -0
  85. package/dist/commands/parameter/list.js +92 -0
  86. package/dist/commands/parameter/pull.d.ts +14 -0
  87. package/dist/commands/parameter/pull.js +124 -0
  88. package/dist/commands/parameter/remove.d.ts +15 -0
  89. package/dist/commands/parameter/remove.js +90 -0
  90. package/dist/commands/parameter/sync.d.ts +14 -0
  91. package/dist/commands/parameter/sync.js +153 -0
  92. package/dist/commands/parameter/update.d.ts +15 -0
  93. package/dist/commands/parameter/update.js +100 -0
  94. package/dist/commands/stage/create.d.ts +28 -0
  95. package/dist/commands/stage/create.js +312 -0
  96. package/dist/commands/stage/list.d.ts +9 -0
  97. package/dist/commands/stage/list.js +63 -0
  98. package/dist/commands/test-api.d.ts +9 -0
  99. package/dist/commands/test-api.js +40 -0
  100. package/dist/index.d.ts +1 -0
  101. package/dist/index.js +1 -0
  102. package/dist/services/auth-service.d.ts +84 -0
  103. package/dist/services/auth-service.js +240 -0
  104. package/dist/services/git.d.ts +46 -0
  105. package/dist/services/git.js +409 -0
  106. package/dist/services/hyperdrive-sigv4.d.ts +449 -0
  107. package/dist/services/hyperdrive-sigv4.js +375 -0
  108. package/dist/services/hyperdrive.d.ts +87 -0
  109. package/dist/services/hyperdrive.js +108 -0
  110. package/dist/services/log-tailer.d.ts +95 -0
  111. package/dist/services/log-tailer.js +242 -0
  112. package/dist/services/tenant-service.d.ts +106 -0
  113. package/dist/services/tenant-service.js +332 -0
  114. package/dist/utils/account-flow.d.ts +74 -0
  115. package/dist/utils/account-flow.js +228 -0
  116. package/dist/utils/auth-flow.d.ts +146 -0
  117. package/dist/utils/auth-flow.js +477 -0
  118. package/dist/utils/git-flow.d.ts +72 -0
  119. package/dist/utils/git-flow.js +232 -0
  120. package/dist/utils/jira-flow.d.ts +71 -0
  121. package/dist/utils/jira-flow.js +120 -0
  122. package/dist/utils/summary-display.d.ts +59 -0
  123. package/dist/utils/summary-display.js +140 -0
  124. package/dist/utils/validation.d.ts +15 -0
  125. package/dist/utils/validation.js +32 -0
  126. package/oclif.manifest.json +2819 -0
  127. package/package.json +112 -0
@@ -0,0 +1,188 @@
1
+ import { Command, Config } from '@oclif/core';
2
+ import { AccountResult } from '../utils/account-flow.js';
3
+ import { AuthResult } from '../utils/auth-flow.js';
4
+ import { GitConnectResult } from '../utils/git-flow.js';
5
+ import { JiraConnectResult } from '../utils/jira-flow.js';
6
+ export type AuthFlowFunction = (options: {
7
+ logger?: (message: string) => void;
8
+ tenantDomain: string;
9
+ }) => Promise<AuthResult>;
10
+ export type AccountAddFunction = (options: {
11
+ tenantDomain: string;
12
+ }) => Promise<AccountResult>;
13
+ export type GitConnectFunction = (options: {
14
+ logger?: (message: string) => void;
15
+ provider: 'github' | 'gitlab';
16
+ }) => Promise<GitConnectResult>;
17
+ export type JiraConnectFunction = () => Promise<JiraConnectResult>;
18
+ /**
19
+ * Set a custom auth flow implementation (for testing)
20
+ */
21
+ export declare function setAuthFlowImpl(impl: AuthFlowFunction): void;
22
+ /**
23
+ * Reset auth flow to original implementation
24
+ */
25
+ export declare function resetAuthFlowImpl(): void;
26
+ /**
27
+ * Get the current auth flow implementation
28
+ */
29
+ export declare function getAuthFlowImpl(): AuthFlowFunction;
30
+ /**
31
+ * Set a custom account add flow implementation (for testing)
32
+ */
33
+ export declare function setAccountAddImpl(impl: AccountAddFunction): void;
34
+ /**
35
+ * Reset account add flow to original implementation
36
+ */
37
+ export declare function resetAccountAddImpl(): void;
38
+ /**
39
+ * Get the current account add flow implementation
40
+ */
41
+ export declare function getAccountAddImpl(): AccountAddFunction;
42
+ /**
43
+ * Set a custom git connect flow implementation (for testing)
44
+ */
45
+ export declare function setGitConnectImpl(impl: GitConnectFunction): void;
46
+ /**
47
+ * Reset git connect flow to original implementation
48
+ */
49
+ export declare function resetGitConnectImpl(): void;
50
+ /**
51
+ * Get the current git connect flow implementation
52
+ */
53
+ export declare function getGitConnectImpl(): GitConnectFunction;
54
+ /**
55
+ * Set a custom jira connect flow implementation (for testing)
56
+ */
57
+ export declare function setJiraConnectImpl(impl: JiraConnectFunction): void;
58
+ /**
59
+ * Reset jira connect flow to original implementation
60
+ */
61
+ export declare function resetJiraConnectImpl(): void;
62
+ /**
63
+ * Get the current jira connect flow implementation
64
+ */
65
+ export declare function getJiraConnectImpl(): JiraConnectFunction;
66
+ export default class Init extends Command {
67
+ static description: string;
68
+ static examples: string[];
69
+ private accountsSkipped;
70
+ private authSkipped;
71
+ private connectedAccounts;
72
+ private connectedGitProvider?;
73
+ private connectedJira?;
74
+ private gitSkipped;
75
+ private jiraSkipped;
76
+ private tenantService;
77
+ constructor(argv: string[], config: Config);
78
+ run(): Promise<void>;
79
+ /**
80
+ * Add AWS accounts step in the init wizard
81
+ *
82
+ * Implements:
83
+ * - Initial prompt to add an AWS account
84
+ * - Loop to add multiple accounts
85
+ * - Skip option with helpful message
86
+ * - Summary display of connected accounts
87
+ */
88
+ private addAwsAccounts;
89
+ /**
90
+ * Add a single AWS account with proper separation of concerns
91
+ *
92
+ * Architecture:
93
+ * 1. Prompt for account details (no spinner - user needs to see prompts)
94
+ * 2. Check for duplicate account ID
95
+ * 3. Register account with API (with spinner - actual work happening)
96
+ * 4. Handle role creation if needed
97
+ */
98
+ private addSingleAwsAccount;
99
+ /**
100
+ * Authenticate user using OAuth PKCE flow with retry logic
101
+ *
102
+ * Implements:
103
+ * - Spinner display during authentication
104
+ * - Retry logic (max 3 attempts)
105
+ * - Skip option after failed attempts
106
+ */
107
+ private authenticateUser;
108
+ /**
109
+ * Configure tenant domain - prompts for input or offers to keep existing
110
+ * Returns the configured domain for potential use in subsequent steps
111
+ */
112
+ private configureTenantDomain;
113
+ /**
114
+ * Connect Git provider step in the init wizard
115
+ *
116
+ * Implements:
117
+ * - Provider selection prompt (GitHub, GitLab, Skip)
118
+ * - OAuth flow execution with spinner
119
+ * - Retry logic on failure
120
+ * - Skip option with helpful message
121
+ */
122
+ private connectGitProvider;
123
+ /**
124
+ * Connect Jira integration step in the init wizard
125
+ *
126
+ * Implements:
127
+ * 1. Prompt to connect Jira (includes Skip option)
128
+ * 2. Prompt for Jira domain
129
+ * 3. Pre-register domain with API
130
+ * 4. Display marketplace URL for app installation
131
+ */
132
+ private connectJira;
133
+ /**
134
+ * Display summary of connected accounts
135
+ */
136
+ private displayAccountSummary;
137
+ /**
138
+ * Display welcome message with Hyperdrive branding and setup steps
139
+ */
140
+ private displayWelcome;
141
+ /**
142
+ * Execute Git OAuth flow with retry logic
143
+ *
144
+ * @param provider - Git provider to connect (github or gitlab)
145
+ * @param attemptCount - Current retry attempt (0-indexed)
146
+ */
147
+ private executeGitOAuthFlow;
148
+ /**
149
+ * Execute Jira connection with proper separation of concerns
150
+ *
151
+ * Architecture:
152
+ * 1. Prompt for Jira domain (no spinner - user needs to see prompt)
153
+ * 2. Register domain with API (with spinner - actual work happening)
154
+ * 3. Display marketplace URL and next steps
155
+ *
156
+ * @param attemptCount - Current retry attempt (0-indexed)
157
+ */
158
+ private executeJiraConnect;
159
+ /**
160
+ * Handle authentication skip - set flag and display warning
161
+ */
162
+ private handleAuthSkip;
163
+ /**
164
+ * Handle Git connection failure with retry option
165
+ *
166
+ * @param provider - Git provider to connect (github or gitlab)
167
+ * @param attemptCount - Current retry attempt (0-indexed)
168
+ */
169
+ private handleGitRetry;
170
+ /**
171
+ * Handle Jira connection failure with retry option
172
+ *
173
+ * @param attemptCount - Current retry attempt (0-indexed)
174
+ */
175
+ private handleJiraRetry;
176
+ /**
177
+ * Handle cross-account IAM role creation
178
+ */
179
+ private handleRoleCreation;
180
+ /**
181
+ * Prompt user to continue or exit the setup wizard
182
+ */
183
+ private promptContinue;
184
+ /**
185
+ * Display final setup summary using the summary-display utility
186
+ */
187
+ private showSummary;
188
+ }