vh-dev-helper 1.0.0 → 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.
- package/dist/app.d.ts +8 -0
- package/dist/app.js +24 -0
- package/dist/app.js.map +1 -0
- package/dist/bin/index.js +6 -2
- package/dist/bin/index.js.map +1 -0
- package/dist/features/git/git.controller.d.ts +24 -0
- package/dist/features/git/git.controller.js +154 -0
- package/dist/features/git/git.controller.js.map +1 -0
- package/dist/features/git/git.route.d.ts +20 -0
- package/dist/features/git/git.route.js +132 -0
- package/dist/features/git/git.route.js.map +1 -0
- package/dist/features/git/git.service.d.ts +14 -0
- package/dist/features/git/git.service.js +342 -0
- package/dist/features/git/git.service.js.map +1 -0
- package/dist/features/logs/logs.route.d.ts +4 -0
- package/dist/features/logs/logs.route.js +50 -0
- package/dist/features/logs/logs.route.js.map +1 -0
- package/dist/features/logs/logs.service.d.ts +1 -0
- package/dist/features/logs/logs.service.js +3 -0
- package/dist/features/logs/logs.service.js.map +1 -0
- package/dist/features/logs/logs.socket.d.ts +16 -0
- package/dist/features/logs/logs.socket.js +133 -0
- package/dist/features/logs/logs.socket.js.map +1 -0
- package/dist/features/logs/logs.store.d.ts +1 -0
- package/dist/features/logs/logs.store.js +3 -0
- package/dist/features/logs/logs.store.js.map +1 -0
- package/dist/features/logs/logs.types.d.ts +1 -0
- package/dist/features/logs/logs.types.js +3 -0
- package/dist/features/logs/logs.types.js.map +1 -0
- package/dist/shared/config/config.d.ts +1 -0
- package/dist/shared/config/config.js +3 -0
- package/dist/shared/config/config.js.map +1 -0
- package/dist/shared/config/config.types.d.ts +1 -0
- package/dist/shared/config/config.types.js +3 -0
- package/dist/shared/config/config.types.js.map +1 -0
- package/dist/shared/config/defaults.d.ts +1 -0
- package/dist/shared/config/defaults.js +3 -0
- package/dist/shared/config/defaults.js.map +1 -0
- package/dist/shared/constants/env.constants.d.ts +1 -0
- package/dist/shared/constants/env.constants.js +3 -0
- package/dist/shared/constants/env.constants.js.map +1 -0
- package/dist/shared/errors/base.error.d.ts +1 -0
- package/dist/shared/errors/base.error.js +3 -0
- package/dist/shared/errors/base.error.js.map +1 -0
- package/dist/shared/errors/cli.error.d.ts +1 -0
- package/dist/shared/errors/cli.error.js +3 -0
- package/dist/shared/errors/cli.error.js.map +1 -0
- package/dist/shared/errors/runtine.error.d.ts +1 -0
- package/dist/shared/errors/runtine.error.js +3 -0
- package/dist/shared/errors/runtine.error.js.map +1 -0
- package/dist/shared/events/event-bus.d.ts +1 -0
- package/dist/shared/events/event-bus.js +3 -0
- package/dist/shared/events/event-bus.js.map +1 -0
- package/dist/shared/events/events.types.d.ts +1 -0
- package/dist/shared/events/events.types.js +3 -0
- package/dist/shared/events/events.types.js.map +1 -0
- package/dist/shared/helpers/gitParsers/parser.controller.d.ts +26 -0
- package/dist/shared/helpers/gitParsers/parser.controller.js +169 -0
- package/dist/shared/helpers/gitParsers/parser.controller.js.map +1 -0
- package/dist/shared/helpers/gitParsers/parser.services.d.ts +29 -0
- package/dist/shared/helpers/gitParsers/parser.services.js +368 -0
- package/dist/shared/helpers/gitParsers/parser.services.js.map +1 -0
- package/dist/shared/helpers/gitParsers/parser.types.d.ts +83 -0
- package/dist/shared/helpers/gitParsers/parser.types.js +22 -0
- package/dist/shared/helpers/gitParsers/parser.types.js.map +1 -0
- package/dist/shared/helpers/logger/logger.d.ts +1 -0
- package/dist/shared/helpers/logger/logger.js +3 -0
- package/dist/shared/helpers/logger/logger.js.map +1 -0
- package/dist/shared/helpers/logger/logger.types.d.ts +1 -0
- package/dist/shared/helpers/logger/logger.types.js +3 -0
- package/dist/shared/helpers/logger/logger.types.js.map +1 -0
- package/dist/shared/helpers/output/index.d.ts +19 -0
- package/dist/shared/helpers/output/index.js +78 -0
- package/dist/shared/helpers/output/index.js.map +1 -0
- package/dist/shared/helpers/prompt/prompt.d.ts +11 -0
- package/dist/shared/helpers/prompt/prompt.js +81 -0
- package/dist/shared/helpers/prompt/prompt.js.map +1 -0
- package/dist/shared/helpers/prompt/prompt.types.d.ts +40 -0
- package/dist/shared/helpers/prompt/prompt.types.js +3 -0
- package/dist/shared/helpers/prompt/prompt.types.js.map +1 -0
- package/dist/shared/helpers/shell/exec.d.ts +15 -0
- package/dist/shared/helpers/shell/exec.js +30 -0
- package/dist/shared/helpers/shell/exec.js.map +1 -0
- package/dist/shared/helpers/shell/spawn.d.ts +1 -0
- package/dist/shared/helpers/shell/spawn.js +3 -0
- package/dist/shared/helpers/shell/spawn.js.map +1 -0
- package/dist/shared/types/common.types.d.ts +1 -0
- package/dist/shared/types/common.types.js +3 -0
- package/dist/shared/types/common.types.js.map +1 -0
- package/dist/shared/ui/stepProgress/index.d.ts +19 -0
- package/dist/shared/ui/stepProgress/index.js +100 -0
- package/dist/shared/ui/stepProgress/index.js.map +1 -0
- package/dist/shared/ui/writer/index.d.ts +6 -0
- package/dist/shared/ui/writer/index.js +36 -0
- package/dist/shared/ui/writer/index.js.map +1 -0
- package/package.json +35 -23
- package/dist/src/commands/dashbaord/index.d.ts +0 -2
- package/dist/src/commands/dashbaord/index.js +0 -38
- package/dist/src/commands/dashbaord/project.command.d.ts +0 -2
- package/dist/src/commands/dashbaord/project.command.js +0 -17
- package/dist/src/commands/git/bg.command.d.ts +0 -2
- package/dist/src/commands/git/bg.command.js +0 -17
- package/dist/src/commands/git/cleanup.command.d.ts +0 -2
- package/dist/src/commands/git/cleanup.command.js +0 -12
- package/dist/src/commands/git/cp.command.d.ts +0 -2
- package/dist/src/commands/git/cp.command.js +0 -68
- package/dist/src/commands/git/del.command.d.ts +0 -2
- package/dist/src/commands/git/del.command.js +0 -19
- package/dist/src/commands/git/fetch.command.d.ts +0 -2
- package/dist/src/commands/git/fetch.command.js +0 -12
- package/dist/src/commands/git/final.command.d.ts +0 -2
- package/dist/src/commands/git/final.command.js +0 -23
- package/dist/src/commands/git/ga.command.d.ts +0 -2
- package/dist/src/commands/git/ga.command.js +0 -22
- package/dist/src/commands/git/gcm.command.d.ts +0 -2
- package/dist/src/commands/git/gcm.command.js +0 -23
- package/dist/src/commands/git/gco.command.d.ts +0 -2
- package/dist/src/commands/git/gco.command.js +0 -27
- package/dist/src/commands/git/gcob.command.d.ts +0 -2
- package/dist/src/commands/git/gcob.command.js +0 -23
- package/dist/src/commands/git/gph.command.d.ts +0 -2
- package/dist/src/commands/git/gph.command.js +0 -29
- package/dist/src/commands/git/gpho.command.d.ts +0 -2
- package/dist/src/commands/git/gpho.command.js +0 -20
- package/dist/src/commands/git/gpl.command.d.ts +0 -2
- package/dist/src/commands/git/gpl.command.js +0 -33
- package/dist/src/commands/git/gplo.command.d.ts +0 -2
- package/dist/src/commands/git/gplo.command.js +0 -20
- package/dist/src/commands/git/gpu.command.d.ts +0 -2
- package/dist/src/commands/git/gpu.command.js +0 -23
- package/dist/src/commands/git/gr.command.d.ts +0 -2
- package/dist/src/commands/git/gr.command.js +0 -20
- package/dist/src/commands/git/graph.command.d.ts +0 -2
- package/dist/src/commands/git/graph.command.js +0 -12
- package/dist/src/commands/git/gs.command.d.ts +0 -2
- package/dist/src/commands/git/gs.command.js +0 -23
- package/dist/src/commands/git/index.d.ts +0 -2
- package/dist/src/commands/git/index.js +0 -52
- package/dist/src/commands/git/init.command.d.ts +0 -2
- package/dist/src/commands/git/init.command.js +0 -12
- package/dist/src/commands/git/merge.command.d.ts +0 -2
- package/dist/src/commands/git/merge.command.js +0 -13
- package/dist/src/commands/git/sync.command.d.ts +0 -2
- package/dist/src/commands/git/sync.command.js +0 -12
- package/dist/src/commands/git/undo.command.d.ts +0 -2
- package/dist/src/commands/git/undo.command.js +0 -21
- package/dist/src/commands/git/untrack.command.d.ts +0 -2
- package/dist/src/commands/git/untrack.command.js +0 -27
- package/dist/src/commands/index.d.ts +0 -1
- package/dist/src/commands/index.js +0 -15
- package/dist/src/commands/network/discover.command.d.ts +0 -2
- package/dist/src/commands/network/discover.command.js +0 -24
- package/dist/src/commands/network/index.d.ts +0 -2
- package/dist/src/commands/network/index.js +0 -47
- package/dist/src/commands/network/inspect.command.d.ts +0 -2
- package/dist/src/commands/network/inspect.command.js +0 -34
- package/dist/src/commands/network/ports.command.d.ts +0 -2
- package/dist/src/commands/network/ports.command.js +0 -27
- package/dist/src/commands/network/ssl.command.d.ts +0 -2
- package/dist/src/commands/network/ssl.command.js +0 -32
- package/dist/src/commands/network/trace.command.d.ts +0 -2
- package/dist/src/commands/network/trace.command.js +0 -30
- package/dist/src/core/helper/command.helper.d.ts +0 -1
- package/dist/src/core/helper/command.helper.js +0 -28
- package/dist/src/core/helper/git.helper.d.ts +0 -2
- package/dist/src/core/helper/git.helper.js +0 -58
- package/dist/src/core/helper/prompts.helper.d.ts +0 -5
- package/dist/src/core/helper/prompts.helper.js +0 -83
- package/dist/src/core/shell/exec.d.ts +0 -1
- package/dist/src/core/shell/exec.js +0 -38
- package/dist/src/dashboards/collectors/project/project.collector.d.ts +0 -9
- package/dist/src/dashboards/collectors/project/project.collector.js +0 -29
- package/dist/src/dashboards/project/backend/server/dashboard.bootstrap.d.ts +0 -6
- package/dist/src/dashboards/project/backend/server/dashboard.bootstrap.js +0 -45
- package/dist/src/dashboards/project/backend/server/dashboard.server.d.ts +0 -6
- package/dist/src/dashboards/project/backend/server/dashboard.server.js +0 -25
- package/dist/src/dashboards/project/backend/server/websocket.server.d.ts +0 -8
- package/dist/src/dashboards/project/backend/server/websocket.server.js +0 -28
- package/dist/src/dashboards/project/backend/services/git.service.d.ts +0 -9
- package/dist/src/dashboards/project/backend/services/git.service.js +0 -18
- package/dist/src/dashboards/project/backend/services/metrics.service.d.ts +0 -7
- package/dist/src/dashboards/project/backend/services/metrics.service.js +0 -54
- package/dist/src/dashboards/project/backend/services/project.service.d.ts +0 -10
- package/dist/src/dashboards/project/backend/services/project.service.js +0 -19
- package/dist/src/dashboards/project/backend/services/system.service.d.ts +0 -15
- package/dist/src/dashboards/project/backend/services/system.service.js +0 -42
- package/dist/src/dashboards/project/backend/wrapper/process.wrapper.d.ts +0 -13
- package/dist/src/dashboards/project/backend/wrapper/process.wrapper.js +0 -56
- package/dist/src/services/git/git.service.d.ts +0 -37
- package/dist/src/services/git/git.service.js +0 -303
- package/dist/src/services/network/network.service.d.ts +0 -23
- package/dist/src/services/network/network.service.js +0 -524
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.grCommand = grCommand;
|
|
4
|
-
const git_service_1 = require("../../services/git/git.service");
|
|
5
|
-
function grCommand(program) {
|
|
6
|
-
program
|
|
7
|
-
.command("gr")
|
|
8
|
-
.argument("[file]", "File path")
|
|
9
|
-
.description("Restore file changes")
|
|
10
|
-
.addHelpText("after", `
|
|
11
|
-
Examples:
|
|
12
|
-
|
|
13
|
-
vh gr
|
|
14
|
-
|
|
15
|
-
vh gr src/index.ts
|
|
16
|
-
`)
|
|
17
|
-
.action(async (file) => {
|
|
18
|
-
await git_service_1.gitService.restore(file);
|
|
19
|
-
});
|
|
20
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.graphCommand = graphCommand;
|
|
4
|
-
const git_service_1 = require("../../services/git/git.service");
|
|
5
|
-
function graphCommand(program) {
|
|
6
|
-
program
|
|
7
|
-
.command("graph")
|
|
8
|
-
.description("Show git graph")
|
|
9
|
-
.action(async () => {
|
|
10
|
-
await git_service_1.gitService.graph();
|
|
11
|
-
});
|
|
12
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.gsCommand = gsCommand;
|
|
4
|
-
const git_service_1 = require("../../services/git/git.service");
|
|
5
|
-
function gsCommand(program) {
|
|
6
|
-
program
|
|
7
|
-
.command("gs")
|
|
8
|
-
.description("Show repository status")
|
|
9
|
-
.addHelpText("after", `
|
|
10
|
-
Examples:
|
|
11
|
-
|
|
12
|
-
vh gs
|
|
13
|
-
|
|
14
|
-
Shows:
|
|
15
|
-
|
|
16
|
-
modified files
|
|
17
|
-
staged files
|
|
18
|
-
branch status
|
|
19
|
-
`)
|
|
20
|
-
.action(async () => {
|
|
21
|
-
await git_service_1.gitService.status();
|
|
22
|
-
});
|
|
23
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.registerGitCommands = registerGitCommands;
|
|
4
|
-
const gpl_command_1 = require("./gpl.command");
|
|
5
|
-
const gph_command_1 = require("./gph.command");
|
|
6
|
-
const ga_command_1 = require("./ga.command");
|
|
7
|
-
const gcm_command_1 = require("./gcm.command");
|
|
8
|
-
const gs_command_1 = require("./gs.command");
|
|
9
|
-
const gco_command_1 = require("./gco.command");
|
|
10
|
-
const gcob_command_1 = require("./gcob.command");
|
|
11
|
-
const bg_command_1 = require("./bg.command");
|
|
12
|
-
const gr_command_1 = require("./gr.command");
|
|
13
|
-
const gpu_command_1 = require("./gpu.command");
|
|
14
|
-
const gpho_command_1 = require("./gpho.command");
|
|
15
|
-
const gplo_command_1 = require("./gplo.command");
|
|
16
|
-
const init_command_1 = require("./init.command");
|
|
17
|
-
const fetch_command_1 = require("./fetch.command");
|
|
18
|
-
const merge_command_1 = require("./merge.command");
|
|
19
|
-
const sync_command_1 = require("./sync.command");
|
|
20
|
-
const cleanup_command_1 = require("./cleanup.command");
|
|
21
|
-
const graph_command_1 = require("./graph.command");
|
|
22
|
-
const undo_command_1 = require("./undo.command");
|
|
23
|
-
const cp_command_1 = require("./cp.command");
|
|
24
|
-
const del_command_1 = require("./del.command");
|
|
25
|
-
const final_command_1 = require("./final.command");
|
|
26
|
-
const untrack_command_1 = require("./untrack.command");
|
|
27
|
-
function registerGitCommands(program) {
|
|
28
|
-
const git = program.command("git").description("Git utilities");
|
|
29
|
-
(0, gpl_command_1.gplCommand)(git);
|
|
30
|
-
(0, gph_command_1.gphCommand)(git);
|
|
31
|
-
(0, ga_command_1.gaCommand)(git);
|
|
32
|
-
(0, gcm_command_1.gcmCommand)(git);
|
|
33
|
-
(0, gs_command_1.gsCommand)(git);
|
|
34
|
-
(0, gco_command_1.gcoCommand)(git);
|
|
35
|
-
(0, gcob_command_1.gcobCommand)(git);
|
|
36
|
-
(0, bg_command_1.bgCommand)(git);
|
|
37
|
-
(0, gr_command_1.grCommand)(git);
|
|
38
|
-
(0, gpu_command_1.gpuCommand)(git);
|
|
39
|
-
(0, gpho_command_1.gphoCommand)(git);
|
|
40
|
-
(0, gplo_command_1.gploCommand)(git);
|
|
41
|
-
(0, init_command_1.initCommand)(git);
|
|
42
|
-
(0, fetch_command_1.fetchCommand)(git);
|
|
43
|
-
(0, merge_command_1.mergeCommand)(git);
|
|
44
|
-
(0, sync_command_1.syncCommand)(git);
|
|
45
|
-
(0, cleanup_command_1.cleanupCommand)(git);
|
|
46
|
-
(0, graph_command_1.graphCommand)(git);
|
|
47
|
-
(0, undo_command_1.undoCommand)(git);
|
|
48
|
-
(0, cp_command_1.cpCommand)(git);
|
|
49
|
-
(0, del_command_1.delCommand)(git);
|
|
50
|
-
(0, final_command_1.finalCommand)(git);
|
|
51
|
-
(0, untrack_command_1.untrackCommand)(git);
|
|
52
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.initCommand = initCommand;
|
|
4
|
-
const git_service_1 = require("../../services/git/git.service");
|
|
5
|
-
function initCommand(program) {
|
|
6
|
-
program
|
|
7
|
-
.command("init")
|
|
8
|
-
.description("Initialize repository")
|
|
9
|
-
.action(async () => {
|
|
10
|
-
await git_service_1.gitService.init();
|
|
11
|
-
});
|
|
12
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mergeCommand = mergeCommand;
|
|
4
|
-
const git_service_1 = require("../../services/git/git.service");
|
|
5
|
-
function mergeCommand(program) {
|
|
6
|
-
program
|
|
7
|
-
.command("merge")
|
|
8
|
-
.argument("<branch>")
|
|
9
|
-
.description("Merge branch")
|
|
10
|
-
.action(async (branch) => {
|
|
11
|
-
await git_service_1.gitService.merge(branch);
|
|
12
|
-
});
|
|
13
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.syncCommand = syncCommand;
|
|
4
|
-
const git_service_1 = require("../../services/git/git.service");
|
|
5
|
-
function syncCommand(program) {
|
|
6
|
-
program
|
|
7
|
-
.command("sync")
|
|
8
|
-
.description("Fetch and pull latest")
|
|
9
|
-
.action(async () => {
|
|
10
|
-
await git_service_1.gitService.sync();
|
|
11
|
-
});
|
|
12
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.undoCommand = undoCommand;
|
|
4
|
-
const git_service_1 = require("../../services/git/git.service");
|
|
5
|
-
function undoCommand(program) {
|
|
6
|
-
program
|
|
7
|
-
.command("undo")
|
|
8
|
-
.description("Advanced git reset")
|
|
9
|
-
.argument("[index]", "commits back", "1")
|
|
10
|
-
.option("--hard", "hard reset")
|
|
11
|
-
.option("--mixed", "mixed reset")
|
|
12
|
-
.option("--commit <hash>", "reset to commit")
|
|
13
|
-
.action(async (index, options) => {
|
|
14
|
-
await git_service_1.gitService.undo({
|
|
15
|
-
hard: options.hard,
|
|
16
|
-
mixed: options.mixed,
|
|
17
|
-
commit: options.commit,
|
|
18
|
-
index: Number(index),
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.untrackCommand = untrackCommand;
|
|
4
|
-
const git_service_1 = require("../../services/git/git.service");
|
|
5
|
-
const git_helper_1 = require("../../core/helper/git.helper");
|
|
6
|
-
const command_helper_1 = require("../../core/helper/command.helper");
|
|
7
|
-
function untrackCommand(program) {
|
|
8
|
-
program
|
|
9
|
-
.command("untrack")
|
|
10
|
-
.argument("[target]")
|
|
11
|
-
.description("Stop tracking file/folder")
|
|
12
|
-
.addHelpText("after", `
|
|
13
|
-
Examples:
|
|
14
|
-
|
|
15
|
-
vh git untrack
|
|
16
|
-
|
|
17
|
-
vh git untrack src/temp.ts
|
|
18
|
-
|
|
19
|
-
vh git untrack src/components
|
|
20
|
-
`)
|
|
21
|
-
.action((target) => (0, command_helper_1.safeCommand)(async () => {
|
|
22
|
-
if (!target) {
|
|
23
|
-
target = await (0, git_helper_1.pickTracked)();
|
|
24
|
-
}
|
|
25
|
-
await git_service_1.gitService.untrack(target);
|
|
26
|
-
}));
|
|
27
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function registerCommands(): void;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.registerCommands = registerCommands;
|
|
4
|
-
const commander_1 = require("commander");
|
|
5
|
-
const git_1 = require("./git");
|
|
6
|
-
const network_1 = require("./network");
|
|
7
|
-
const dashbaord_1 = require("./dashbaord");
|
|
8
|
-
function registerCommands() {
|
|
9
|
-
const program = new commander_1.Command();
|
|
10
|
-
program.name("vh");
|
|
11
|
-
(0, git_1.registerGitCommands)(program);
|
|
12
|
-
(0, network_1.registerNetworkCommands)(program);
|
|
13
|
-
(0, dashbaord_1.registerDashboardCommands)(program);
|
|
14
|
-
program.parse();
|
|
15
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.discoverCommand = discoverCommand;
|
|
4
|
-
const network_service_1 = require("../../services/network/network.service");
|
|
5
|
-
function discoverCommand(program) {
|
|
6
|
-
program
|
|
7
|
-
.command("discover")
|
|
8
|
-
.argument("<target>", "localhost / subnet / ip / domain")
|
|
9
|
-
.description("Discover hosts and network information")
|
|
10
|
-
.addHelpText("after", `
|
|
11
|
-
Examples:
|
|
12
|
-
|
|
13
|
-
vh net discover localhost
|
|
14
|
-
|
|
15
|
-
vh net discover 192.168.0.0/24
|
|
16
|
-
|
|
17
|
-
vh net discover 192.168.0.15
|
|
18
|
-
|
|
19
|
-
vh net discover gemlay.com
|
|
20
|
-
`)
|
|
21
|
-
.action(async (target) => {
|
|
22
|
-
await network_service_1.networkService.discover(target);
|
|
23
|
-
});
|
|
24
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.registerNetworkCommands = registerNetworkCommands;
|
|
4
|
-
const inspect_command_1 = require("./inspect.command");
|
|
5
|
-
const ssl_command_1 = require("./ssl.command");
|
|
6
|
-
const trace_command_1 = require("./trace.command");
|
|
7
|
-
const ports_command_1 = require("./ports.command");
|
|
8
|
-
const discover_command_1 = require("./discover.command");
|
|
9
|
-
function registerNetworkCommands(program) {
|
|
10
|
-
const net = program
|
|
11
|
-
.command("net")
|
|
12
|
-
.description("Network utilities")
|
|
13
|
-
.addHelpText("after", `
|
|
14
|
-
Examples:
|
|
15
|
-
|
|
16
|
-
vh net inspect google.com
|
|
17
|
-
|
|
18
|
-
vh net ssl google.com
|
|
19
|
-
|
|
20
|
-
vh net trace google.com
|
|
21
|
-
|
|
22
|
-
vh net ports google.com
|
|
23
|
-
|
|
24
|
-
vh net discover localhost
|
|
25
|
-
|
|
26
|
-
vh net discover 192.168.0.15
|
|
27
|
-
|
|
28
|
-
vh net discover gemlay.com
|
|
29
|
-
|
|
30
|
-
Available tools:
|
|
31
|
-
|
|
32
|
-
inspect DNS, redirects, timings, IP metadata
|
|
33
|
-
|
|
34
|
-
ssl SSL certificate inspection
|
|
35
|
-
|
|
36
|
-
trace Route hops, latency, path analysis
|
|
37
|
-
|
|
38
|
-
ports Scan ports and detect services
|
|
39
|
-
|
|
40
|
-
discover Discover hosts, devices, and target information
|
|
41
|
-
`);
|
|
42
|
-
(0, inspect_command_1.netInspectCommand)(net);
|
|
43
|
-
(0, ssl_command_1.sslCommand)(net);
|
|
44
|
-
(0, trace_command_1.traceCommand)(net);
|
|
45
|
-
(0, ports_command_1.portsCommand)(net);
|
|
46
|
-
(0, discover_command_1.discoverCommand)(net);
|
|
47
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.netInspectCommand = netInspectCommand;
|
|
4
|
-
const network_service_1 = require("../../services/network/network.service");
|
|
5
|
-
function netInspectCommand(program) {
|
|
6
|
-
program
|
|
7
|
-
.command("inspect")
|
|
8
|
-
.argument("<url>", "URL or domain to inspect")
|
|
9
|
-
.description("Inspect DNS, redirects, timings, and network info")
|
|
10
|
-
.addHelpText("after", `
|
|
11
|
-
Examples:
|
|
12
|
-
|
|
13
|
-
vh net inspect google.com
|
|
14
|
-
|
|
15
|
-
vh net inspect https://google.com
|
|
16
|
-
|
|
17
|
-
Shows:
|
|
18
|
-
|
|
19
|
-
DNS
|
|
20
|
-
|
|
21
|
-
redirect chain
|
|
22
|
-
|
|
23
|
-
latency
|
|
24
|
-
|
|
25
|
-
TLS timing
|
|
26
|
-
|
|
27
|
-
IP info
|
|
28
|
-
|
|
29
|
-
response metadata
|
|
30
|
-
`)
|
|
31
|
-
.action(async (url) => {
|
|
32
|
-
await network_service_1.networkService.inspect(url);
|
|
33
|
-
});
|
|
34
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.portsCommand = portsCommand;
|
|
4
|
-
const network_service_1 = require("../../services/network/network.service");
|
|
5
|
-
function portsCommand(program) {
|
|
6
|
-
program
|
|
7
|
-
.command("ports")
|
|
8
|
-
.argument("<host>", "Domain or IP")
|
|
9
|
-
.option("--extended", "Scan extended ports")
|
|
10
|
-
.option("--full", "Scan all ports")
|
|
11
|
-
.option("--ports <ports>", "Custom ports ex: 22,80,443")
|
|
12
|
-
.description("Scan network ports")
|
|
13
|
-
.addHelpText("after", `
|
|
14
|
-
Examples:
|
|
15
|
-
|
|
16
|
-
vh net ports google.com
|
|
17
|
-
|
|
18
|
-
vh net ports google.com --extended
|
|
19
|
-
|
|
20
|
-
vh net ports google.com --full
|
|
21
|
-
|
|
22
|
-
vh net ports google.com --ports 22,80,443
|
|
23
|
-
`)
|
|
24
|
-
.action(async (host, options) => {
|
|
25
|
-
await network_service_1.networkService.ports(host, options);
|
|
26
|
-
});
|
|
27
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sslCommand = sslCommand;
|
|
4
|
-
const network_service_1 = require("../../services/network/network.service");
|
|
5
|
-
function sslCommand(program) {
|
|
6
|
-
program
|
|
7
|
-
.command("ssl")
|
|
8
|
-
.argument("<domain>", "Domain name")
|
|
9
|
-
.description("Inspect SSL certificate details")
|
|
10
|
-
.addHelpText("after", `
|
|
11
|
-
Examples:
|
|
12
|
-
|
|
13
|
-
vh net ssl google.com
|
|
14
|
-
|
|
15
|
-
vh net ssl api.example.com
|
|
16
|
-
|
|
17
|
-
Shows:
|
|
18
|
-
|
|
19
|
-
issuer
|
|
20
|
-
|
|
21
|
-
expiry
|
|
22
|
-
|
|
23
|
-
TLS version
|
|
24
|
-
|
|
25
|
-
days remaining
|
|
26
|
-
|
|
27
|
-
SAN domains
|
|
28
|
-
`)
|
|
29
|
-
.action(async (domain) => {
|
|
30
|
-
await network_service_1.networkService.ssl(domain);
|
|
31
|
-
});
|
|
32
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.traceCommand = traceCommand;
|
|
4
|
-
const network_service_1 = require("../../services/network/network.service");
|
|
5
|
-
function traceCommand(program) {
|
|
6
|
-
program
|
|
7
|
-
.command("trace")
|
|
8
|
-
.argument("<host>", "Domain or IP")
|
|
9
|
-
.description("Trace network route to destination")
|
|
10
|
-
.addHelpText("after", `
|
|
11
|
-
Examples:
|
|
12
|
-
|
|
13
|
-
vh net trace google.com
|
|
14
|
-
|
|
15
|
-
vh net trace 8.8.8.8
|
|
16
|
-
|
|
17
|
-
Shows:
|
|
18
|
-
|
|
19
|
-
route hops
|
|
20
|
-
|
|
21
|
-
latency
|
|
22
|
-
|
|
23
|
-
packet path
|
|
24
|
-
|
|
25
|
-
routing failures
|
|
26
|
-
`)
|
|
27
|
-
.action(async (host) => {
|
|
28
|
-
await network_service_1.networkService.trace(host);
|
|
29
|
-
});
|
|
30
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function safeCommand(callback: () => Promise<void>): Promise<void>;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.safeCommand = safeCommand;
|
|
4
|
-
const prompts_helper_1 = require("./prompts.helper");
|
|
5
|
-
async function safeCommand(callback) {
|
|
6
|
-
try {
|
|
7
|
-
await callback();
|
|
8
|
-
}
|
|
9
|
-
catch (error) {
|
|
10
|
-
/*
|
|
11
|
-
* User cancelled manually
|
|
12
|
-
*/
|
|
13
|
-
if (error instanceof prompts_helper_1.UserCancelledError) {
|
|
14
|
-
console.log("\n❌ Operation cancelled");
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
/*
|
|
18
|
-
* Ctrl + C / SIGINT from inquirer
|
|
19
|
-
*/
|
|
20
|
-
if (error?.name === "ExitPromptError" ||
|
|
21
|
-
error?.message?.includes("SIGINT")) {
|
|
22
|
-
console.log("\n❌ Prompt closed");
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
console.error("\n❌ Error:", error);
|
|
26
|
-
process.exit(1);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pickBranch = pickBranch;
|
|
4
|
-
exports.pickTracked = pickTracked;
|
|
5
|
-
const prompts_1 = require("@inquirer/prompts");
|
|
6
|
-
const exec_1 = require("../shell/exec");
|
|
7
|
-
const prompts_helper_1 = require("./prompts.helper");
|
|
8
|
-
async function pickBranch() {
|
|
9
|
-
const branches = (await (0, exec_1.exec)("git branch --format='%(refname:short)'", true))
|
|
10
|
-
.split("\n")
|
|
11
|
-
.filter(Boolean)
|
|
12
|
-
.filter((value, index, arr) => arr.indexOf(value) === index)
|
|
13
|
-
.sort();
|
|
14
|
-
const branch = await (0, prompts_1.search)({
|
|
15
|
-
message: "Search branch",
|
|
16
|
-
source: async (input = "") => {
|
|
17
|
-
const query = input.toLowerCase();
|
|
18
|
-
return branches
|
|
19
|
-
.filter((branch) => branch.toLowerCase().includes(query))
|
|
20
|
-
.slice(0, 30)
|
|
21
|
-
.map((branch) => ({
|
|
22
|
-
name: branch,
|
|
23
|
-
value: branch,
|
|
24
|
-
}));
|
|
25
|
-
},
|
|
26
|
-
});
|
|
27
|
-
const accepted = await (0, prompts_1.confirm)({
|
|
28
|
-
message: `Use "${branch}" ?`,
|
|
29
|
-
default: true,
|
|
30
|
-
});
|
|
31
|
-
if (!accepted) {
|
|
32
|
-
throw new prompts_helper_1.UserCancelledError();
|
|
33
|
-
}
|
|
34
|
-
return branch;
|
|
35
|
-
}
|
|
36
|
-
async function pickTracked() {
|
|
37
|
-
const files = (await (0, exec_1.exec)("git ls-files", true))
|
|
38
|
-
.split("\n")
|
|
39
|
-
.filter(Boolean);
|
|
40
|
-
const selected = await (0, prompts_1.search)({
|
|
41
|
-
message: "Search tracked file/folder",
|
|
42
|
-
source: async (input = "") => files
|
|
43
|
-
.filter((item) => item.toLowerCase().includes(input.toLowerCase()))
|
|
44
|
-
.slice(0, 100)
|
|
45
|
-
.map((item) => ({
|
|
46
|
-
name: item,
|
|
47
|
-
value: item,
|
|
48
|
-
})),
|
|
49
|
-
});
|
|
50
|
-
const accepted = await (0, prompts_1.confirm)({
|
|
51
|
-
message: `Stop tracking "${selected}" ?`,
|
|
52
|
-
default: true,
|
|
53
|
-
});
|
|
54
|
-
if (!accepted) {
|
|
55
|
-
throw new prompts_helper_1.UserCancelledError();
|
|
56
|
-
}
|
|
57
|
-
return selected;
|
|
58
|
-
}
|