@hyperdrive.bot/cli 1.0.6 → 1.0.8

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 (97) hide show
  1. package/README.md +415 -67
  2. package/dist/commands/account/add.d.ts +6 -6
  3. package/dist/commands/account/list.d.ts +3 -0
  4. package/dist/commands/account/list.js +9 -2
  5. package/dist/commands/account/remove.d.ts +3 -3
  6. package/dist/commands/auth/login.d.ts +4 -4
  7. package/dist/commands/auth/login.js +1 -0
  8. package/dist/commands/ci/account/create.d.ts +7 -6
  9. package/dist/commands/ci/account/create.js +49 -3
  10. package/dist/commands/ci/account/delete.d.ts +3 -3
  11. package/dist/commands/ci/account/list.d.ts +2 -2
  12. package/dist/commands/config/get.d.ts +1 -1
  13. package/dist/commands/config/set.d.ts +2 -2
  14. package/dist/commands/deployment/create.d.ts +10 -10
  15. package/dist/commands/deployment/get.d.ts +4 -4
  16. package/dist/commands/deployment/launch.d.ts +6 -6
  17. package/dist/commands/deployment/list.d.ts +3 -3
  18. package/dist/commands/deployment/list.js +17 -17
  19. package/dist/commands/domain/switch.d.ts +1 -1
  20. package/dist/commands/example.d.ts +3 -3
  21. package/dist/commands/git/connect.d.ts +2 -2
  22. package/dist/commands/git/connect.js +1 -0
  23. package/dist/commands/git/disconnect.d.ts +3 -3
  24. package/dist/commands/git/list.d.ts +2 -2
  25. package/dist/commands/git/sync.d.ts +7 -7
  26. package/dist/commands/git/sync.js +24 -23
  27. package/dist/commands/init.d.ts +1 -0
  28. package/dist/commands/init.js +20 -19
  29. package/dist/commands/jira/connect.d.ts +2 -1
  30. package/dist/commands/jira/connect.js +17 -6
  31. package/dist/commands/jira/hook/add.d.ts +17 -0
  32. package/dist/commands/jira/hook/add.js +147 -0
  33. package/dist/commands/jira/hook/list.d.ts +14 -0
  34. package/dist/commands/jira/hook/list.js +105 -0
  35. package/dist/commands/jira/hook/remove.d.ts +15 -0
  36. package/dist/commands/jira/hook/remove.js +119 -0
  37. package/dist/commands/jira/hook/toggle.d.ts +15 -0
  38. package/dist/commands/jira/hook/toggle.js +136 -0
  39. package/dist/commands/jira/status.d.ts +1 -1
  40. package/dist/commands/module/analyze.d.ts +5 -5
  41. package/dist/commands/module/create.d.ts +17 -17
  42. package/dist/commands/module/create.js +9 -1
  43. package/dist/commands/module/destroy.d.ts +3 -3
  44. package/dist/commands/module/get.d.ts +2 -2
  45. package/dist/commands/module/link.d.ts +4 -4
  46. package/dist/commands/module/list.d.ts +1 -1
  47. package/dist/commands/module/list.js +12 -11
  48. package/dist/commands/module/reanalyze.d.ts +6 -6
  49. package/dist/commands/module/update.d.ts +19 -19
  50. package/dist/commands/parameter/add.d.ts +7 -7
  51. package/dist/commands/parameter/backfill.d.ts +4 -4
  52. package/dist/commands/parameter/backfill.js +4 -3
  53. package/dist/commands/parameter/clear.d.ts +6 -6
  54. package/dist/commands/parameter/list.d.ts +6 -6
  55. package/dist/commands/parameter/list.js +4 -3
  56. package/dist/commands/parameter/pull.d.ts +6 -6
  57. package/dist/commands/parameter/remove.d.ts +7 -7
  58. package/dist/commands/parameter/sync.d.ts +6 -6
  59. package/dist/commands/parameter/update.d.ts +7 -7
  60. package/dist/commands/project/init.d.ts +21 -0
  61. package/dist/commands/project/init.js +576 -0
  62. package/dist/commands/project/list.d.ts +10 -0
  63. package/dist/commands/project/list.js +119 -0
  64. package/dist/commands/project/status.d.ts +13 -0
  65. package/dist/commands/project/status.js +163 -0
  66. package/dist/commands/project/sync.d.ts +26 -0
  67. package/dist/commands/project/sync.js +388 -0
  68. package/dist/commands/stage/access.d.ts +15 -0
  69. package/dist/commands/stage/access.js +130 -0
  70. package/dist/commands/stage/create.d.ts +11 -11
  71. package/dist/commands/stage/list.d.ts +1 -1
  72. package/dist/commands/stage/list.js +21 -20
  73. package/dist/commands/stage/revoke.d.ts +18 -0
  74. package/dist/commands/stage/revoke.js +171 -0
  75. package/dist/commands/stage/share.d.ts +23 -0
  76. package/dist/commands/stage/share.js +292 -0
  77. package/dist/commands/test-api.d.ts +1 -1
  78. package/dist/services/auth-service.d.ts +15 -82
  79. package/dist/services/auth-service.js +24 -237
  80. package/dist/services/hyperdrive-sigv4.d.ts +162 -24
  81. package/dist/services/hyperdrive-sigv4.js +107 -193
  82. package/dist/services/tenant-service.d.ts +6 -0
  83. package/dist/services/tenant-service.js +13 -0
  84. package/dist/utils/account-flow.d.ts +2 -2
  85. package/dist/utils/account-flow.js +4 -4
  86. package/dist/utils/auth-flow.d.ts +1 -0
  87. package/dist/utils/auth-flow.js +2 -0
  88. package/dist/utils/git-flow.d.ts +1 -0
  89. package/dist/utils/git-flow.js +2 -2
  90. package/dist/utils/hook-flow.d.ts +21 -0
  91. package/dist/utils/hook-flow.js +154 -0
  92. package/dist/utils/jira-flow.d.ts +2 -2
  93. package/dist/utils/jira-flow.js +4 -4
  94. package/dist/utils/table.d.ts +17 -0
  95. package/dist/utils/table.js +41 -0
  96. package/oclif.manifest.json +844 -154
  97. package/package.json +59 -15
@@ -0,0 +1,119 @@
1
+ import { Args, Command, Flags } from '@oclif/core';
2
+ import chalk from 'chalk';
3
+ import ora from 'ora';
4
+ import { HyperdriveSigV4Service } from '../../../services/hyperdrive-sigv4.js';
5
+ import { promptConfirmDelete, promptSelectHook } from '../../../utils/hook-flow.js';
6
+ export default class HookRemove extends Command {
7
+ static args = {
8
+ project: Args.string({ description: 'Hyperdrive project ID or slug', required: true }),
9
+ };
10
+ static description = 'Remove a status transition hook from a Jira-linked project';
11
+ static examples = [
12
+ '<%= config.bin %> jira hook remove my-project',
13
+ '<%= config.bin %> jira hook remove my-project --hook-id hook-123',
14
+ '<%= config.bin %> jira hook remove my-project --hook-id hook-123 --json',
15
+ ];
16
+ static flags = {
17
+ domain: Flags.string({
18
+ char: 'd',
19
+ description: 'Hyperdrive tenant domain',
20
+ }),
21
+ 'hook-id': Flags.string({
22
+ description: 'Hook ID to remove (skips interactive selection)',
23
+ }),
24
+ json: Flags.boolean({
25
+ description: 'Output raw JSON',
26
+ }),
27
+ };
28
+ async run() {
29
+ const { args, flags } = await this.parse(HookRemove);
30
+ const isJson = flags.json;
31
+ const hookIdFlag = flags['hook-id'];
32
+ // Authenticate
33
+ let apiService;
34
+ const spinner = isJson ? null : ora('Checking authentication...').start();
35
+ try {
36
+ apiService = new HyperdriveSigV4Service(flags.domain);
37
+ spinner?.succeed('Authenticated');
38
+ }
39
+ catch (error) {
40
+ spinner?.fail('Not authenticated');
41
+ this.error(`${error.message}\n\n` +
42
+ `Please authenticate first with: ${chalk.cyan('hd auth login')}`);
43
+ }
44
+ let hookId;
45
+ if (hookIdFlag) {
46
+ hookId = hookIdFlag;
47
+ }
48
+ else {
49
+ if (isJson) {
50
+ this.error('Non-interactive mode requires --hook-id flag with --json');
51
+ }
52
+ // Fetch hooks for interactive selection
53
+ const fetchSpinner = ora('Fetching hooks...').start();
54
+ try {
55
+ const response = await apiService.hookList(args.project);
56
+ const hooks = response.hooks;
57
+ fetchSpinner.succeed(`Found ${hooks.length} hook${hooks.length === 1 ? '' : 's'}`);
58
+ if (hooks.length === 0) {
59
+ this.log('');
60
+ this.log(chalk.yellow('No hooks configured for this project'));
61
+ this.log('');
62
+ return;
63
+ }
64
+ this.log('');
65
+ const selectedHook = await promptSelectHook(hooks);
66
+ hookId = selectedHook.hookId;
67
+ const confirmed = await promptConfirmDelete(selectedHook);
68
+ if (!confirmed) {
69
+ this.log(chalk.dim('Cancelled'));
70
+ return;
71
+ }
72
+ }
73
+ catch (error) {
74
+ fetchSpinner.fail('Failed to fetch hooks');
75
+ this.handleApiError(error);
76
+ }
77
+ }
78
+ // Delete hook
79
+ const deleteSpinner = isJson ? null : ora('Deleting hook...').start();
80
+ try {
81
+ const result = await apiService.hookDelete(args.project, hookId);
82
+ deleteSpinner?.succeed('Hook deleted');
83
+ if (isJson) {
84
+ this.log(JSON.stringify({ hookId, ...result }, null, 2));
85
+ return;
86
+ }
87
+ this.log('');
88
+ this.log(chalk.green('✅ Hook deleted successfully'));
89
+ this.log('');
90
+ }
91
+ catch (error) {
92
+ deleteSpinner?.fail('Failed to delete hook');
93
+ this.handleApiError(error);
94
+ }
95
+ }
96
+ handleApiError(error) {
97
+ let errorMessage = error.message;
98
+ if (error.response) {
99
+ const status = error.response.status;
100
+ const data = error.response.data;
101
+ if (status === 401) {
102
+ errorMessage = 'Authentication failed — please run "hd auth login"';
103
+ }
104
+ else if (status === 403) {
105
+ errorMessage = 'Access denied — check your permissions';
106
+ }
107
+ else if (status === 404) {
108
+ errorMessage = 'Hook or project not found — verify the IDs';
109
+ }
110
+ else if (data?.error) {
111
+ errorMessage = data.error;
112
+ }
113
+ else if (data?.message) {
114
+ errorMessage = data.message;
115
+ }
116
+ }
117
+ this.error(errorMessage);
118
+ }
119
+ }
@@ -0,0 +1,15 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class HookToggle extends Command {
3
+ static args: {
4
+ project: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static description: string;
7
+ static examples: string[];
8
+ static flags: {
9
+ domain: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
+ 'hook-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
+ };
13
+ run(): Promise<void>;
14
+ private handleApiError;
15
+ }
@@ -0,0 +1,136 @@
1
+ import { Args, Command, Flags } from '@oclif/core';
2
+ import chalk from 'chalk';
3
+ import ora from 'ora';
4
+ import { HyperdriveSigV4Service } from '../../../services/hyperdrive-sigv4.js';
5
+ import { promptSelectHook } from '../../../utils/hook-flow.js';
6
+ export default class HookToggle extends Command {
7
+ static args = {
8
+ project: Args.string({ description: 'Hyperdrive project ID or slug', required: true }),
9
+ };
10
+ static description = 'Toggle the enabled state of a status transition hook';
11
+ static examples = [
12
+ '<%= config.bin %> jira hook toggle my-project',
13
+ '<%= config.bin %> jira hook toggle my-project --hook-id hook-123',
14
+ '<%= config.bin %> jira hook toggle my-project --hook-id hook-123 --json',
15
+ ];
16
+ static flags = {
17
+ domain: Flags.string({
18
+ char: 'd',
19
+ description: 'Hyperdrive tenant domain',
20
+ }),
21
+ 'hook-id': Flags.string({
22
+ description: 'Hook ID to toggle (skips interactive selection)',
23
+ }),
24
+ json: Flags.boolean({
25
+ description: 'Output raw JSON',
26
+ }),
27
+ };
28
+ async run() {
29
+ const { args, flags } = await this.parse(HookToggle);
30
+ const isJson = flags.json;
31
+ const hookIdFlag = flags['hook-id'];
32
+ // Authenticate
33
+ let apiService;
34
+ const spinner = isJson ? null : ora('Checking authentication...').start();
35
+ try {
36
+ apiService = new HyperdriveSigV4Service(flags.domain);
37
+ spinner?.succeed('Authenticated');
38
+ }
39
+ catch (error) {
40
+ spinner?.fail('Not authenticated');
41
+ this.error(`${error.message}\n\n` +
42
+ `Please authenticate first with: ${chalk.cyan('hd auth login')}`);
43
+ }
44
+ let hookId;
45
+ let currentEnabled;
46
+ if (hookIdFlag) {
47
+ hookId = hookIdFlag;
48
+ }
49
+ else {
50
+ if (isJson) {
51
+ this.error('Non-interactive mode requires --hook-id flag with --json');
52
+ }
53
+ // Fetch hooks for interactive selection
54
+ const fetchSpinner = ora('Fetching hooks...').start();
55
+ try {
56
+ const response = await apiService.hookList(args.project);
57
+ const hooks = response.hooks;
58
+ fetchSpinner.succeed(`Found ${hooks.length} hook${hooks.length === 1 ? '' : 's'}`);
59
+ if (hooks.length === 0) {
60
+ this.log('');
61
+ this.log(chalk.yellow('No hooks configured for this project'));
62
+ this.log('');
63
+ return;
64
+ }
65
+ this.log('');
66
+ const selectedHook = await promptSelectHook(hooks);
67
+ hookId = selectedHook.hookId;
68
+ currentEnabled = selectedHook.enabled;
69
+ }
70
+ catch (error) {
71
+ fetchSpinner.fail('Failed to fetch hooks');
72
+ this.handleApiError(error);
73
+ }
74
+ }
75
+ // Toggle hook
76
+ const toggleSpinner = isJson ? null : ora('Toggling hook...').start();
77
+ try {
78
+ // If we know current state from selection, flip it. Otherwise let the API fetch + toggle.
79
+ const newEnabled = currentEnabled !== undefined ? !currentEnabled : undefined;
80
+ // If we don't know the current state (non-interactive with --hook-id), fetch it first
81
+ let enabled;
82
+ if (newEnabled === undefined) {
83
+ const response = await apiService.hookList(args.project);
84
+ const hook = response.hooks.find(h => h.hookId === hookId);
85
+ if (!hook) {
86
+ toggleSpinner?.fail('Hook not found');
87
+ this.error(`Hook ${hookId} not found in project ${args.project}`);
88
+ }
89
+ enabled = !hook.enabled;
90
+ }
91
+ else {
92
+ enabled = newEnabled;
93
+ }
94
+ const updatedHook = await apiService.hookUpdate(args.project, hookId, { enabled });
95
+ toggleSpinner?.succeed('Hook toggled');
96
+ if (isJson) {
97
+ this.log(JSON.stringify(updatedHook, null, 2));
98
+ return;
99
+ }
100
+ this.log('');
101
+ this.log(chalk.green('✅ Hook updated'));
102
+ this.log(` Hook ID: ${chalk.cyan(updatedHook.hookId)}`);
103
+ this.log(` Trigger Status: ${chalk.cyan(updatedHook.triggerStatus)}`);
104
+ this.log(` Action Type: ${chalk.cyan(updatedHook.actionType)}`);
105
+ this.log(` Enabled: ${updatedHook.enabled ? chalk.green('enabled') : chalk.red('disabled')}`);
106
+ this.log('');
107
+ }
108
+ catch (error) {
109
+ toggleSpinner?.fail('Failed to toggle hook');
110
+ this.handleApiError(error);
111
+ }
112
+ }
113
+ handleApiError(error) {
114
+ let errorMessage = error.message;
115
+ if (error.response) {
116
+ const status = error.response.status;
117
+ const data = error.response.data;
118
+ if (status === 401) {
119
+ errorMessage = 'Authentication failed — please run "hd auth login"';
120
+ }
121
+ else if (status === 403) {
122
+ errorMessage = 'Access denied — check your permissions';
123
+ }
124
+ else if (status === 404) {
125
+ errorMessage = 'Hook or project not found — verify the IDs';
126
+ }
127
+ else if (data?.error) {
128
+ errorMessage = data.error;
129
+ }
130
+ else if (data?.message) {
131
+ errorMessage = data.message;
132
+ }
133
+ }
134
+ this.error(errorMessage);
135
+ }
136
+ }
@@ -3,7 +3,7 @@ export default class JiraStatus extends Command {
3
3
  static description: string;
4
4
  static examples: string[];
5
5
  static flags: {
6
- domain: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
6
+ domain: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
7
  };
8
8
  run(): Promise<void>;
9
9
  }
@@ -3,11 +3,11 @@ export default class ModuleAnalyze extends Command {
3
3
  static description: string;
4
4
  static examples: string[];
5
5
  static flags: {
6
- domain: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
7
- save: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
8
- slug: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
9
- verbose: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
10
- wait: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
6
+ domain: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
+ save: import("@oclif/core/interfaces").BooleanFlag<boolean>;
8
+ slug: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
9
+ verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
+ wait: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
11
  };
12
12
  run(): Promise<void>;
13
13
  /**
@@ -3,23 +3,23 @@ export default class ModuleCreate extends Command {
3
3
  static description: string;
4
4
  static examples: string[];
5
5
  static flags: {
6
- buildCommand: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
7
- buildDirectory: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
8
- buildFolder: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
9
- buildRuntime: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
10
- buildRuntimeVersion: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
11
- ciService: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
12
- defaultBranch: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
13
- domain: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
14
- framework: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
15
- installCommand: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
16
- name: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
17
- runCommand: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
18
- runtime: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
19
- runtimeVersion: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
20
- slug: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
21
- sourceDirectory: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
22
- sourceLocation: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
6
+ buildCommand: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
+ buildDirectory: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
+ buildFolder: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
+ buildRuntime: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
+ buildRuntimeVersion: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ ciService: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ defaultBranch: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
+ domain: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
+ framework: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
+ installCommand: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
+ name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
+ runCommand: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
+ runtime: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
19
+ runtimeVersion: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
20
+ slug: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
21
+ sourceDirectory: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
22
+ sourceLocation: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
23
23
  };
24
24
  run(): Promise<void>;
25
25
  /**
@@ -42,7 +42,7 @@ export default class ModuleCreate extends Command {
42
42
  }),
43
43
  framework: Flags.string({
44
44
  description: 'Framework used',
45
- options: ['express', 'fastify', 'koa', 'nextjs', 'react', 'vue', 'angular', 'svelte', 'flask', 'django', 'fastapi', 'gin', 'actix', 'spring', 'aspnet', 'rails', 'other'],
45
+ options: ['express', 'fastify', 'koa', 'nextjs', 'react', 'vue', 'angular', 'svelte', 'flask', 'django', 'fastapi', 'gin', 'actix', 'spring', 'aspnet', 'rails', 'serverless', 'serverless-express', 'serverless-nestjs', 'other'],
46
46
  }),
47
47
  installCommand: Flags.string({
48
48
  description: 'Install command',
@@ -155,6 +155,11 @@ export default class ModuleCreate extends Command {
155
155
  if (gitInfo) {
156
156
  cleanedData.gitProvider = gitInfo.provider;
157
157
  }
158
+ // Set deploymentStrategy for Serverless Framework projects
159
+ const framework = cleanedData.framework;
160
+ if (framework === 'serverless' || framework === 'serverless-express' || framework === 'serverless-nestjs') {
161
+ cleanedData.deploymentStrategy = 'serverless';
162
+ }
158
163
  const result = await service.moduleCreate(cleanedData);
159
164
  writeFileSync('.hyperdrive.json', JSON.stringify(result, null, 2), 'utf8');
160
165
  this.log(chalk.blue('✨ Project created successfully! Here are the details:'));
@@ -450,6 +455,9 @@ export default class ModuleCreate extends Command {
450
455
  if (!flags.framework) {
451
456
  prompts.push({
452
457
  choices: [
458
+ { name: 'Serverless Framework (sls deploy)', value: 'serverless' },
459
+ { name: 'Serverless + Express (serverless-http)', value: 'serverless-express' },
460
+ { name: 'Serverless + NestJS', value: 'serverless-nestjs' },
453
461
  { name: 'Express.js', value: 'express' },
454
462
  { name: 'Fastify', value: 'fastify' },
455
463
  { name: 'Koa', value: 'koa' },
@@ -3,9 +3,9 @@ export default class ModuleDestroy extends Command {
3
3
  static description: string;
4
4
  static examples: string[];
5
5
  static flags: {
6
- domain: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
7
- force: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
8
- slug: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
6
+ domain: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
+ force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
8
+ slug: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
9
9
  };
10
10
  run(): Promise<void>;
11
11
  }
@@ -3,8 +3,8 @@ export default class ModuleGet extends Command {
3
3
  static description: string;
4
4
  static examples: string[];
5
5
  static flags: {
6
- domain: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
7
- slug: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
6
+ domain: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
+ slug: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
8
8
  };
9
9
  run(): Promise<void>;
10
10
  }
@@ -3,10 +3,10 @@ export default class ModuleLink extends Command {
3
3
  static description: string;
4
4
  static examples: string[];
5
5
  static flags: {
6
- domain: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
7
- originSlug: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
8
- parameter: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string[], import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
9
- targetSlug: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
6
+ domain: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
+ originSlug: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
8
+ parameter: import("@oclif/core/interfaces").OptionFlag<string[], import("@oclif/core/interfaces").CustomOptions>;
9
+ targetSlug: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
10
  };
11
11
  confirmDeploymentBehavior(): Promise<any>;
12
12
  prompt(): Promise<void>;
@@ -3,7 +3,7 @@ export default class ModuleList extends Command {
3
3
  static description: string;
4
4
  static examples: string[];
5
5
  static flags: {
6
- domain: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
6
+ domain: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
7
  };
8
8
  run(): Promise<void>;
9
9
  }
@@ -1,6 +1,7 @@
1
- import { Command, Flags, ux } from '@oclif/core';
1
+ import { Command, Flags } from '@oclif/core';
2
2
  import chalk from 'chalk';
3
3
  import { HyperdriveSigV4Service } from '../../services/hyperdrive-sigv4.js';
4
+ import { printTable } from '../../utils/table.js';
4
5
  export default class ModuleList extends Command {
5
6
  static description = 'List all modules/projects';
6
7
  static examples = [
@@ -24,24 +25,24 @@ export default class ModuleList extends Command {
24
25
  }
25
26
  this.log(chalk.green(`✅ Found ${modules.length} module(s)\n`));
26
27
  // Display modules in a table
27
- ux.table(modules, {
28
- createdAt: {
29
- get: (row) => new Date(row.createdAt).toLocaleDateString(),
30
- header: 'Created',
31
- },
32
- framework: {
33
- header: 'Framework',
34
- },
28
+ printTable(modules, {
35
29
  name: {
36
30
  header: 'Name',
37
31
  minWidth: 20,
38
32
  },
39
33
  slug: {
40
- get: (row) => chalk.cyan(row.slug),
41
34
  header: 'Slug',
42
35
  minWidth: 15,
36
+ get: (row) => chalk.cyan(row.slug),
37
+ },
38
+ framework: {
39
+ header: 'Framework',
40
+ },
41
+ createdAt: {
42
+ header: 'Created',
43
+ get: (row) => new Date(row.createdAt).toLocaleDateString(),
43
44
  },
44
- });
45
+ }, (msg) => this.log(msg));
45
46
  }
46
47
  catch (error) {
47
48
  console.error('Error:', error);
@@ -3,12 +3,12 @@ export default class DockerfileReanalyze extends Command {
3
3
  static description: string;
4
4
  static examples: string[];
5
5
  static flags: {
6
- domain: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
7
- prompt: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
8
- save: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
9
- slug: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
10
- verbose: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
11
- wait: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
6
+ domain: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
+ prompt: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
8
+ save: import("@oclif/core/interfaces").BooleanFlag<boolean>;
9
+ slug: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
+ verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
+ wait: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
12
  };
13
13
  run(): Promise<void>;
14
14
  /**
@@ -3,25 +3,25 @@ export default class ModuleUpdate extends Command {
3
3
  static description: string;
4
4
  static examples: string[];
5
5
  static flags: {
6
- buildCommand: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
7
- buildDirectory: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
8
- buildFolder: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
9
- buildRuntime: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
10
- buildRuntimeVersion: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
11
- ciService: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
12
- defaultBranch: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
13
- deploymentStrategy: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
14
- domain: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
15
- framework: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
16
- installCommand: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
17
- name: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
18
- routeDiscovery: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
19
- runCommand: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
20
- runtime: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
21
- runtimeVersion: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
22
- slug: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
23
- sourceDirectory: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
24
- sourceLocation: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
6
+ buildCommand: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
+ buildDirectory: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
+ buildFolder: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
+ buildRuntime: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
+ buildRuntimeVersion: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ ciService: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ defaultBranch: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
+ deploymentStrategy: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
+ domain: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
+ framework: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
+ installCommand: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
+ name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
+ routeDiscovery: import("@oclif/core/interfaces").BooleanFlag<boolean>;
19
+ runCommand: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
20
+ runtime: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
21
+ runtimeVersion: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
22
+ slug: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
23
+ sourceDirectory: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
24
+ sourceLocation: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
25
25
  };
26
26
  run(): Promise<void>;
27
27
  }
@@ -3,13 +3,13 @@ export default class ParameterAdd extends Command {
3
3
  static description: string;
4
4
  static examples: string[];
5
5
  static flags: {
6
- accountId: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
7
- domain: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
8
- key: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
9
- moduleSlug: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
10
- specific: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
11
- stage: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
12
- value: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
6
+ accountId: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
7
+ domain: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
+ key: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
9
+ moduleSlug: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
+ specific: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
+ stage: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
12
+ value: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
13
13
  };
14
14
  run(): Promise<void>;
15
15
  }
@@ -3,10 +3,10 @@ export default class ParameterBackfill extends Command {
3
3
  static description: string;
4
4
  static examples: string[];
5
5
  static flags: {
6
- accountId: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
7
- domain: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
8
- 'dry-run': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
9
- 'no-dry-run': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
6
+ accountId: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
7
+ domain: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
+ 'dry-run': import("@oclif/core/interfaces").BooleanFlag<boolean>;
9
+ 'no-dry-run': import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
10
  };
11
11
  run(): Promise<void>;
12
12
  }
@@ -1,7 +1,8 @@
1
- import { Command, Flags, ux } from '@oclif/core';
1
+ import { Command, Flags } from '@oclif/core';
2
2
  import chalk from 'chalk';
3
3
  import inquirer from 'inquirer';
4
4
  import { HyperdriveSigV4Service } from '../../services/hyperdrive-sigv4.js';
5
+ import { printTable } from '../../utils/table.js';
5
6
  export default class ParameterBackfill extends Command {
6
7
  static description = 'Backfill existing SSM parameters to DynamoDB (one-time migration)';
7
8
  static examples = [
@@ -78,12 +79,12 @@ export default class ParameterBackfill extends Command {
78
79
  stage: p.stage,
79
80
  status: p.imported ? chalk.green('✓') : chalk.yellow('skipped'),
80
81
  }));
81
- ux.table(tableData, {
82
+ printTable(tableData, {
82
83
  key: { header: 'Key', minWidth: 30 },
83
84
  project: { header: 'Project', minWidth: 15 },
84
85
  stage: { header: 'Stage', minWidth: 10 },
85
86
  status: { header: 'Status', minWidth: 10 },
86
- });
87
+ }, (msg) => this.log(msg));
87
88
  if (result.parameters.length > 50) {
88
89
  this.log(chalk.gray(` ... and ${result.parameters.length - 50} more`));
89
90
  }