@hyperdrive.bot/cli 1.0.5 â 1.0.7
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.
- package/README.md +169 -63
- package/dist/commands/account/add.d.ts +6 -6
- package/dist/commands/account/remove.d.ts +3 -3
- package/dist/commands/auth/login.d.ts +4 -4
- package/dist/commands/auth/login.js +1 -0
- package/dist/commands/ci/account/create.d.ts +7 -6
- package/dist/commands/ci/account/create.js +49 -3
- package/dist/commands/ci/account/delete.d.ts +3 -3
- package/dist/commands/ci/account/list.d.ts +2 -2
- package/dist/commands/config/get.d.ts +1 -1
- package/dist/commands/config/set.d.ts +2 -2
- package/dist/commands/deployment/create.d.ts +10 -10
- package/dist/commands/deployment/get.d.ts +4 -4
- package/dist/commands/deployment/launch.d.ts +6 -6
- package/dist/commands/deployment/list.d.ts +3 -3
- package/dist/commands/deployment/list.js +17 -17
- package/dist/commands/domain/switch.d.ts +1 -1
- package/dist/commands/example.d.ts +3 -3
- package/dist/commands/git/connect.d.ts +2 -2
- package/dist/commands/git/disconnect.d.ts +3 -3
- package/dist/commands/git/list.d.ts +2 -2
- package/dist/commands/git/sync.d.ts +7 -7
- package/dist/commands/git/sync.js +24 -23
- package/dist/commands/jira/connect.d.ts +1 -1
- package/dist/commands/jira/status.d.ts +1 -1
- package/dist/commands/module/analyze.d.ts +5 -5
- package/dist/commands/module/create.d.ts +17 -17
- package/dist/commands/module/create.js +9 -1
- package/dist/commands/module/destroy.d.ts +3 -3
- package/dist/commands/module/get.d.ts +2 -2
- package/dist/commands/module/link.d.ts +4 -4
- package/dist/commands/module/list.d.ts +1 -1
- package/dist/commands/module/list.js +12 -11
- package/dist/commands/module/reanalyze.d.ts +6 -6
- package/dist/commands/module/update.d.ts +19 -19
- package/dist/commands/parameter/add.d.ts +7 -7
- package/dist/commands/parameter/backfill.d.ts +4 -4
- package/dist/commands/parameter/backfill.js +4 -3
- package/dist/commands/parameter/clear.d.ts +6 -6
- package/dist/commands/parameter/list.d.ts +6 -6
- package/dist/commands/parameter/list.js +4 -3
- package/dist/commands/parameter/pull.d.ts +6 -6
- package/dist/commands/parameter/remove.d.ts +7 -7
- package/dist/commands/parameter/sync.d.ts +6 -6
- package/dist/commands/parameter/update.d.ts +7 -7
- package/dist/commands/stage/access.d.ts +15 -0
- package/dist/commands/stage/access.js +130 -0
- package/dist/commands/stage/create.d.ts +11 -11
- package/dist/commands/stage/list.d.ts +1 -1
- package/dist/commands/stage/list.js +21 -20
- package/dist/commands/stage/revoke.d.ts +18 -0
- package/dist/commands/stage/revoke.js +171 -0
- package/dist/commands/stage/share.d.ts +23 -0
- package/dist/commands/stage/share.js +292 -0
- package/dist/commands/test-api.d.ts +1 -1
- package/dist/services/auth-service.d.ts +15 -82
- package/dist/services/auth-service.js +24 -237
- package/dist/services/hyperdrive-sigv4.d.ts +37 -24
- package/dist/services/hyperdrive-sigv4.js +62 -193
- package/dist/services/tenant-service.d.ts +6 -0
- package/dist/services/tenant-service.js +13 -0
- package/dist/utils/auth-flow.d.ts +1 -0
- package/dist/utils/auth-flow.js +2 -0
- package/dist/utils/table.d.ts +17 -0
- package/dist/utils/table.js +41 -0
- package/oclif.manifest.json +309 -81
- package/package.json +55 -15
|
@@ -3,10 +3,10 @@ export default class Login extends Command {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
|
-
ci: import("@oclif/core/
|
|
7
|
-
domain: import("@oclif/core/
|
|
8
|
-
port: import("@oclif/core/
|
|
9
|
-
tenant: import("@oclif/core/
|
|
6
|
+
ci: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
domain: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
port: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
tenant: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
10
|
};
|
|
11
11
|
run(): Promise<void>;
|
|
12
12
|
/**
|
|
@@ -123,6 +123,7 @@ export default class Login extends Command {
|
|
|
123
123
|
region: tenantConfig.region,
|
|
124
124
|
tenantDomain: tenantConfig.tenantDomain,
|
|
125
125
|
tenantId: tenantConfig.tenantId,
|
|
126
|
+
userGroupsApiUrl: tenantConfig.userGroupsApiUrl,
|
|
126
127
|
}, tenantConfig.tenantDomain);
|
|
127
128
|
spinner.succeed(chalk.green('Credentials saved!'));
|
|
128
129
|
this.log('');
|
|
@@ -3,14 +3,15 @@ export default class CIAccountCreate extends Command {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
|
-
description: import("@oclif/core/
|
|
7
|
-
domain: import("@oclif/core/
|
|
8
|
-
name: import("@oclif/core/
|
|
9
|
-
project: import("@oclif/core/
|
|
10
|
-
scope: import("@oclif/core/
|
|
11
|
-
stage: import("@oclif/core/
|
|
6
|
+
description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
domain: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
project: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
scope: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
stage: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
12
|
};
|
|
13
13
|
run(): Promise<void>;
|
|
14
14
|
private promptForName;
|
|
15
15
|
private promptForScopes;
|
|
16
|
+
private promptForStages;
|
|
16
17
|
}
|
|
@@ -42,7 +42,7 @@ export default class CIAccountCreate extends Command {
|
|
|
42
42
|
options: [...VALID_SCOPES],
|
|
43
43
|
}),
|
|
44
44
|
stage: Flags.string({
|
|
45
|
-
description: '
|
|
45
|
+
description: 'Stages to grant deployer access to (can be specified multiple times)',
|
|
46
46
|
multiple: true,
|
|
47
47
|
}),
|
|
48
48
|
};
|
|
@@ -52,6 +52,7 @@ export default class CIAccountCreate extends Command {
|
|
|
52
52
|
this.log(chalk.cyan('đ Create CI Service Account'));
|
|
53
53
|
this.log(chalk.cyan('ââââââââââââââââââââââââââââââââââââââââââââââââââââ'));
|
|
54
54
|
this.log('');
|
|
55
|
+
const service = new HyperdriveSigV4Service(flags.domain);
|
|
55
56
|
// Prompt for missing values
|
|
56
57
|
const name = flags.name || await this.promptForName();
|
|
57
58
|
const scopes = flags.scope && flags.scope.length > 0 ? flags.scope : await this.promptForScopes();
|
|
@@ -64,15 +65,19 @@ export default class CIAccountCreate extends Command {
|
|
|
64
65
|
this.error(`Invalid scope: ${scope}. Valid scopes: ${VALID_SCOPES.join(', ')}`);
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
|
-
|
|
68
|
+
// Prompt for stages if not provided
|
|
69
|
+
const stages = flags.stage && flags.stage.length > 0 ? flags.stage : await this.promptForStages(service);
|
|
68
70
|
this.log(chalk.blue(`\nđ Creating CI account "${name}"...`));
|
|
71
|
+
if (stages.length > 0) {
|
|
72
|
+
this.log(chalk.gray(` Will grant deployer access to: ${stages.join(', ')}`));
|
|
73
|
+
}
|
|
69
74
|
try {
|
|
70
75
|
const result = await service.ciAccountCreate({
|
|
71
76
|
description: flags.description,
|
|
72
77
|
name,
|
|
73
78
|
projectSlugs: flags.project,
|
|
74
79
|
scopes,
|
|
75
|
-
stages
|
|
80
|
+
stages,
|
|
76
81
|
});
|
|
77
82
|
this.log('');
|
|
78
83
|
this.log(chalk.green('ââââââââââââââââââââââââââââââââââââââââââââââââââââ'));
|
|
@@ -83,6 +88,9 @@ export default class CIAccountCreate extends Command {
|
|
|
83
88
|
this.log(chalk.gray(` âĸ ID: ${result.account.accountId}`));
|
|
84
89
|
this.log(chalk.gray(` âĸ Name: ${result.account.name}`));
|
|
85
90
|
this.log(chalk.gray(` âĸ Scopes: ${result.account.scopes.join(', ')}`));
|
|
91
|
+
if (stages.length > 0) {
|
|
92
|
+
this.log(chalk.gray(` âĸ Stage Access: ${stages.join(', ')} (deployer)`));
|
|
93
|
+
}
|
|
86
94
|
this.log('');
|
|
87
95
|
this.log(chalk.yellow('â ī¸ IMPORTANT: Save this token securely!'));
|
|
88
96
|
this.log(chalk.yellow(' It will NOT be shown again.'));
|
|
@@ -155,4 +163,42 @@ export default class CIAccountCreate extends Command {
|
|
|
155
163
|
}]);
|
|
156
164
|
return scopes;
|
|
157
165
|
}
|
|
166
|
+
async promptForStages(service) {
|
|
167
|
+
// First ask if they want to grant stage access now
|
|
168
|
+
const { grantNow } = await inquirer.prompt([{
|
|
169
|
+
default: true,
|
|
170
|
+
message: chalk.yellow('Grant deployer access to stages now?'),
|
|
171
|
+
name: 'grantNow',
|
|
172
|
+
type: 'confirm',
|
|
173
|
+
}]);
|
|
174
|
+
if (!grantNow) {
|
|
175
|
+
return [];
|
|
176
|
+
}
|
|
177
|
+
this.log(chalk.gray(' Fetching stages...'));
|
|
178
|
+
try {
|
|
179
|
+
const stagesData = await service.stageList();
|
|
180
|
+
if (!stagesData || stagesData.length === 0) {
|
|
181
|
+
this.log(chalk.yellow(' No stages found. You can grant access later with: hd stage share'));
|
|
182
|
+
return [];
|
|
183
|
+
}
|
|
184
|
+
const stageChoices = stagesData.map(s => ({
|
|
185
|
+
checked: !s.production, // Pre-select non-production stages
|
|
186
|
+
name: s.production
|
|
187
|
+
? `${s.name} ${chalk.red('(PROD)')}`
|
|
188
|
+
: `${s.name} ${chalk.blue('(dev)')}`,
|
|
189
|
+
value: s.slug || s.name,
|
|
190
|
+
}));
|
|
191
|
+
const { stages } = await inquirer.prompt([{
|
|
192
|
+
choices: stageChoices,
|
|
193
|
+
message: chalk.yellow('Select stages to grant deployer access:'),
|
|
194
|
+
name: 'stages',
|
|
195
|
+
type: 'checkbox',
|
|
196
|
+
}]);
|
|
197
|
+
return stages;
|
|
198
|
+
}
|
|
199
|
+
catch (error) {
|
|
200
|
+
this.log(chalk.yellow(' Could not fetch stages. You can grant access later with: hd stage share'));
|
|
201
|
+
return [];
|
|
202
|
+
}
|
|
203
|
+
}
|
|
158
204
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
2
|
export default class CIAccountDelete extends Command {
|
|
3
3
|
static args: {
|
|
4
|
-
accountId: import("@oclif/core/
|
|
4
|
+
accountId: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
5
5
|
};
|
|
6
6
|
static description: string;
|
|
7
7
|
static examples: string[];
|
|
8
8
|
static flags: {
|
|
9
|
-
domain: import("@oclif/core/
|
|
10
|
-
force: import("@oclif/core/
|
|
9
|
+
domain: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
11
|
};
|
|
12
12
|
run(): Promise<void>;
|
|
13
13
|
private selectAccount;
|
|
@@ -3,8 +3,8 @@ export default class CIAccountList extends Command {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
|
-
domain: import("@oclif/core/
|
|
7
|
-
json: import("@oclif/core/
|
|
6
|
+
domain: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
8
|
};
|
|
9
9
|
run(): Promise<void>;
|
|
10
10
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
2
|
export default class ConfigGet extends Command {
|
|
3
3
|
static args: {
|
|
4
|
-
key: import("@oclif/core/
|
|
4
|
+
key: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
5
|
};
|
|
6
6
|
static description: string;
|
|
7
7
|
static examples: string[];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
2
|
export default class ConfigSet extends Command {
|
|
3
3
|
static args: {
|
|
4
|
-
key: import("@oclif/core/
|
|
5
|
-
value: import("@oclif/core/
|
|
4
|
+
key: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
value: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
6
|
};
|
|
7
7
|
static description: string;
|
|
8
8
|
static examples: string[];
|
|
@@ -3,16 +3,16 @@ export default class DeploymentCreate extends Command {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
|
-
commit: import("@oclif/core/
|
|
7
|
-
debug: import("@oclif/core/
|
|
8
|
-
domain: import("@oclif/core/
|
|
9
|
-
launch: import("@oclif/core/
|
|
10
|
-
moduleSlug: import("@oclif/core/
|
|
11
|
-
name: import("@oclif/core/
|
|
12
|
-
noStream: import("@oclif/core/
|
|
13
|
-
regions: import("@oclif/core/
|
|
14
|
-
stage: import("@oclif/core/
|
|
15
|
-
verbose: import("@oclif/core/
|
|
6
|
+
commit: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
debug: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
domain: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
launch: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
moduleSlug: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
name: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
noStream: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
regions: import("@oclif/core/interfaces").OptionFlag<string[], import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
stage: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
16
16
|
};
|
|
17
17
|
run(): Promise<void>;
|
|
18
18
|
/**
|
|
@@ -3,10 +3,10 @@ export default class DeploymentGet extends Command {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
|
-
domain: import("@oclif/core/
|
|
7
|
-
moduleSlug: import("@oclif/core/
|
|
8
|
-
name: import("@oclif/core/
|
|
9
|
-
stage: import("@oclif/core/
|
|
6
|
+
domain: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
moduleSlug: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
name: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
stage: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
10
|
};
|
|
11
11
|
run(): Promise<void>;
|
|
12
12
|
private colorizeStatus;
|
|
@@ -3,12 +3,12 @@ export default class DeploymentLaunch extends Command {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
|
-
domain: import("@oclif/core/
|
|
7
|
-
force: import("@oclif/core/
|
|
8
|
-
moduleSlug: import("@oclif/core/
|
|
9
|
-
name: import("@oclif/core/
|
|
10
|
-
region: import("@oclif/core/
|
|
11
|
-
stage: import("@oclif/core/
|
|
6
|
+
domain: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
moduleSlug: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
name: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
region: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
stage: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
12
|
};
|
|
13
13
|
run(): Promise<void>;
|
|
14
14
|
private pollDeploymentStatus;
|
|
@@ -3,9 +3,9 @@ export default class DeploymentList extends Command {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
|
-
domain: import("@oclif/core/
|
|
7
|
-
moduleSlug: import("@oclif/core/
|
|
8
|
-
stage: import("@oclif/core/
|
|
6
|
+
domain: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
moduleSlug: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
stage: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
9
|
};
|
|
10
10
|
run(): Promise<void>;
|
|
11
11
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Command, Flags
|
|
1
|
+
import { Command, Flags } from '@oclif/core';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
import { existsSync, readFileSync } from 'node:fs';
|
|
4
4
|
import { HyperdriveSigV4Service } from '../../services/hyperdrive-sigv4.js';
|
|
5
|
+
import { printTable } from '../../utils/table.js';
|
|
5
6
|
export default class DeploymentList extends Command {
|
|
6
7
|
static description = 'List all deployments for a module and stage';
|
|
7
8
|
static examples = [
|
|
@@ -46,24 +47,12 @@ export default class DeploymentList extends Command {
|
|
|
46
47
|
}
|
|
47
48
|
this.log(chalk.green(`â
Found ${deployments.length} deployment(s)\n`));
|
|
48
49
|
// Display deployments in a table
|
|
49
|
-
|
|
50
|
-
commit: {
|
|
51
|
-
get: (row) => row.commit?.substring(0, 7) || 'N/A',
|
|
52
|
-
header: 'Commit',
|
|
53
|
-
},
|
|
54
|
-
createdAt: {
|
|
55
|
-
get: (row) => new Date(row.createdAt).toLocaleString(),
|
|
56
|
-
header: 'Created',
|
|
57
|
-
},
|
|
50
|
+
printTable(deployments, {
|
|
58
51
|
name: {
|
|
59
52
|
header: 'Name',
|
|
60
|
-
minWidth: 20,
|
|
61
|
-
},
|
|
62
|
-
regions: {
|
|
63
|
-
get: (row) => (row.regions || []).join(', '),
|
|
64
|
-
header: 'Regions',
|
|
65
53
|
},
|
|
66
54
|
status: {
|
|
55
|
+
header: 'Status',
|
|
67
56
|
get: (row) => {
|
|
68
57
|
const status = row.status || 'unknown';
|
|
69
58
|
switch (status) {
|
|
@@ -79,9 +68,20 @@ export default class DeploymentList extends Command {
|
|
|
79
68
|
return chalk.gray(status.toUpperCase());
|
|
80
69
|
}
|
|
81
70
|
},
|
|
82
|
-
header: 'Status',
|
|
83
71
|
},
|
|
84
|
-
|
|
72
|
+
commit: {
|
|
73
|
+
header: 'Commit',
|
|
74
|
+
get: (row) => row.commit?.substring(0, 7) || 'N/A',
|
|
75
|
+
},
|
|
76
|
+
regions: {
|
|
77
|
+
header: 'Regions',
|
|
78
|
+
get: (row) => (row.regions || []).join(', '),
|
|
79
|
+
},
|
|
80
|
+
createdAt: {
|
|
81
|
+
header: 'Created',
|
|
82
|
+
get: (row) => new Date(row.createdAt).toLocaleString(),
|
|
83
|
+
},
|
|
84
|
+
}, (msg) => this.log(msg));
|
|
85
85
|
}
|
|
86
86
|
catch (error) {
|
|
87
87
|
console.error('Error:', error);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
2
|
export default class DomainSwitch extends Command {
|
|
3
3
|
static args: {
|
|
4
|
-
domain: import("@oclif/core/
|
|
4
|
+
domain: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
5
|
};
|
|
6
6
|
static description: string;
|
|
7
7
|
static examples: string[];
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
2
|
export default class Example extends Command {
|
|
3
3
|
static args: {
|
|
4
|
-
file: import("@oclif/core/
|
|
4
|
+
file: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
5
5
|
};
|
|
6
6
|
static description: string;
|
|
7
7
|
static examples: string[];
|
|
8
8
|
static flags: {
|
|
9
|
-
force: import("@oclif/core/
|
|
10
|
-
name: import("@oclif/core/
|
|
9
|
+
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
11
|
};
|
|
12
12
|
run(): Promise<void>;
|
|
13
13
|
}
|
|
@@ -3,8 +3,8 @@ export default class GitConnect extends Command {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
|
-
domain: import("@oclif/core/
|
|
7
|
-
provider: import("@oclif/core/
|
|
6
|
+
domain: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
provider: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
8
|
};
|
|
9
9
|
run(): Promise<void>;
|
|
10
10
|
}
|
|
@@ -3,9 +3,9 @@ export default class GitDisconnect extends Command {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
|
-
domain: import("@oclif/core/
|
|
7
|
-
installationId: import("@oclif/core/
|
|
8
|
-
provider: import("@oclif/core/
|
|
6
|
+
domain: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
installationId: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
provider: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
9
|
};
|
|
10
10
|
run(): Promise<void>;
|
|
11
11
|
}
|
|
@@ -3,8 +3,8 @@ export default class GitList extends Command {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
|
-
domain: import("@oclif/core/
|
|
7
|
-
provider: import("@oclif/core/
|
|
6
|
+
domain: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
provider: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
8
|
};
|
|
9
9
|
run(): Promise<void>;
|
|
10
10
|
}
|
|
@@ -3,13 +3,13 @@ export default class Sync extends Command {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
|
-
all: import("@oclif/core/
|
|
7
|
-
branch: import("@oclif/core/
|
|
8
|
-
domain: import("@oclif/core/
|
|
9
|
-
'merge-strategy': import("@oclif/core/
|
|
10
|
-
remote: import("@oclif/core/
|
|
11
|
-
'source-branch': import("@oclif/core/
|
|
12
|
-
verbose: import("@oclif/core/
|
|
6
|
+
all: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
branch: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
domain: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
'merge-strategy': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
remote: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
'source-branch': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
13
|
};
|
|
14
14
|
run(): Promise<void>;
|
|
15
15
|
private displayConfiguration;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Command, Flags
|
|
1
|
+
import { Command, Flags } from '@oclif/core';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
import * as ora from 'ora';
|
|
4
4
|
import { GitService } from '../../services/git.js';
|
|
5
|
+
import { printTable, printHeader } from '../../utils/table.js';
|
|
5
6
|
export default class Sync extends Command {
|
|
6
7
|
static description = 'Sync specific branches or all open branches with a source branch (default: master)';
|
|
7
8
|
static examples = [
|
|
@@ -131,7 +132,7 @@ export default class Sync extends Command {
|
|
|
131
132
|
}
|
|
132
133
|
}
|
|
133
134
|
displayConfiguration(syncOptions) {
|
|
134
|
-
|
|
135
|
+
printHeader('đ§ Sync Configuration', (msg) => this.log(msg));
|
|
135
136
|
const configTable = {
|
|
136
137
|
'Merge Strategy': chalk.cyan(syncOptions.mergeStrategy),
|
|
137
138
|
'Mode': syncOptions.all
|
|
@@ -147,7 +148,7 @@ export default class Sync extends Command {
|
|
|
147
148
|
}
|
|
148
149
|
displayResults(results, duration) {
|
|
149
150
|
this.log(); // Empty line for spacing
|
|
150
|
-
|
|
151
|
+
printHeader('đ Sync Results', (msg) => this.log(msg));
|
|
151
152
|
// Count results by type
|
|
152
153
|
const successCount = results.filter(r => r.success).length;
|
|
153
154
|
const conflictCount = results.filter(r => r.conflicts).length;
|
|
@@ -160,9 +161,10 @@ export default class Sync extends Command {
|
|
|
160
161
|
{ metric: 'Errors', status: 'error', value: errorCount.toString() },
|
|
161
162
|
{ metric: 'Duration', status: 'info', value: duration }
|
|
162
163
|
];
|
|
163
|
-
|
|
164
|
+
printTable(summaryData, {
|
|
164
165
|
metric: { header: 'Metric' },
|
|
165
166
|
status: {
|
|
167
|
+
header: 'Status',
|
|
166
168
|
get: (row) => {
|
|
167
169
|
switch (row.status) {
|
|
168
170
|
case 'success': return chalk.green('â
');
|
|
@@ -171,13 +173,12 @@ export default class Sync extends Command {
|
|
|
171
173
|
default: return chalk.blue('âšī¸');
|
|
172
174
|
}
|
|
173
175
|
},
|
|
174
|
-
header: 'Status'
|
|
175
176
|
},
|
|
176
177
|
value: { header: 'Count' }
|
|
177
|
-
},
|
|
178
|
+
}, (msg) => this.log(msg));
|
|
178
179
|
if (results.length > 0) {
|
|
179
180
|
this.log(); // Empty line for spacing
|
|
180
|
-
|
|
181
|
+
printHeader('đ Branch Details', (msg) => this.log(msg));
|
|
181
182
|
// Convert results to proper table format
|
|
182
183
|
const tableData = results.map(result => ({
|
|
183
184
|
branch: result.branch,
|
|
@@ -186,45 +187,45 @@ export default class Sync extends Command {
|
|
|
186
187
|
success: result.success
|
|
187
188
|
}));
|
|
188
189
|
// Display detailed results
|
|
189
|
-
|
|
190
|
+
printTable(tableData, {
|
|
190
191
|
branch: {
|
|
192
|
+
header: 'Branch',
|
|
191
193
|
get: (row) => chalk.cyan(row.branch),
|
|
192
|
-
header: 'Branch'
|
|
193
194
|
},
|
|
194
|
-
|
|
195
|
+
status: {
|
|
196
|
+
header: 'Status',
|
|
195
197
|
get: (row) => {
|
|
196
198
|
if (row.success)
|
|
197
|
-
return chalk.
|
|
199
|
+
return chalk.green('â
Synced');
|
|
198
200
|
if (row.conflicts)
|
|
199
|
-
return chalk.yellow('
|
|
200
|
-
return chalk.red(
|
|
201
|
+
return chalk.yellow('â ī¸ Conflicts');
|
|
202
|
+
return chalk.red('â Failed');
|
|
201
203
|
},
|
|
202
|
-
header: 'Message'
|
|
203
204
|
},
|
|
204
|
-
|
|
205
|
+
message: {
|
|
206
|
+
header: 'Message',
|
|
205
207
|
get: (row) => {
|
|
206
208
|
if (row.success)
|
|
207
|
-
return chalk.
|
|
209
|
+
return chalk.gray('Successfully merged and pushed');
|
|
208
210
|
if (row.conflicts)
|
|
209
|
-
return chalk.yellow('
|
|
210
|
-
return chalk.red('
|
|
211
|
+
return chalk.yellow('Merge conflicts detected - manual resolution required');
|
|
212
|
+
return chalk.red(row.error || 'Unknown error');
|
|
211
213
|
},
|
|
212
|
-
header: 'Status'
|
|
213
214
|
}
|
|
214
|
-
},
|
|
215
|
+
}, (msg) => this.log(msg));
|
|
215
216
|
}
|
|
216
217
|
// Display actionable insights
|
|
217
218
|
this.log(); // Empty line for spacing
|
|
218
219
|
if (conflictCount > 0) {
|
|
219
|
-
|
|
220
|
+
this.warn(`${conflictCount} branch(es) have merge conflicts and need manual resolution`);
|
|
220
221
|
this.log(chalk.gray(' đĄ Tip: Resolve conflicts manually and push the changes'));
|
|
221
222
|
}
|
|
222
223
|
if (errorCount > 0) {
|
|
223
|
-
|
|
224
|
+
this.warn(`${errorCount} branch(es) failed to sync`);
|
|
224
225
|
this.log(chalk.gray(' đĄ Tip: Check branch permissions and network connectivity'));
|
|
225
226
|
}
|
|
226
227
|
if (successCount === results.length && results.length > 0) {
|
|
227
|
-
|
|
228
|
+
this.log(chalk.green('đ All branches synced successfully!'));
|
|
228
229
|
}
|
|
229
230
|
}
|
|
230
231
|
formatDuration(startTime) {
|
|
@@ -3,7 +3,7 @@ export default class JiraConnect extends Command {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
|
-
domain: import("@oclif/core/
|
|
6
|
+
domain: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
7
|
};
|
|
8
8
|
run(): Promise<void>;
|
|
9
9
|
}
|
|
@@ -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/
|
|
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/
|
|
7
|
-
save: import("@oclif/core/
|
|
8
|
-
slug: import("@oclif/core/
|
|
9
|
-
verbose: import("@oclif/core/
|
|
10
|
-
wait: import("@oclif/core/
|
|
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
|
/**
|