@intecoag/inteco-cli 1.11.8 → 1.12.0-beta.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/README.md +13 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +158 -0
- package/dist/index.js.map +1 -0
- package/dist/modules/adbBridge.d.ts +2 -0
- package/dist/modules/adbBridge.d.ts.map +1 -0
- package/dist/modules/adbBridge.js +40 -0
- package/dist/modules/adbBridge.js.map +1 -0
- package/dist/modules/adbBridge.test.d.ts +2 -0
- package/dist/modules/adbBridge.test.d.ts.map +1 -0
- package/dist/modules/adbBridge.test.js +39 -0
- package/dist/modules/adbBridge.test.js.map +1 -0
- package/dist/modules/adbIntentSender.d.ts +2 -0
- package/dist/modules/adbIntentSender.d.ts.map +1 -0
- package/dist/modules/adbIntentSender.js +67 -0
- package/dist/modules/adbIntentSender.js.map +1 -0
- package/dist/modules/adbIntentSender.test.d.ts +2 -0
- package/dist/modules/adbIntentSender.test.d.ts.map +1 -0
- package/dist/modules/adbIntentSender.test.js +48 -0
- package/dist/modules/adbIntentSender.test.js.map +1 -0
- package/dist/modules/azureSync.d.ts +16 -0
- package/dist/modules/azureSync.d.ts.map +1 -0
- package/{src → dist}/modules/azureSync.js +55 -136
- package/dist/modules/azureSync.js.map +1 -0
- package/dist/modules/azureSync.test.d.ts +2 -0
- package/dist/modules/azureSync.test.d.ts.map +1 -0
- package/dist/modules/azureSync.test.js +69 -0
- package/dist/modules/azureSync.test.js.map +1 -0
- package/dist/modules/bundleProduct.d.ts +2 -0
- package/dist/modules/bundleProduct.d.ts.map +1 -0
- package/{src → dist}/modules/bundleProduct.js +41 -80
- package/dist/modules/bundleProduct.js.map +1 -0
- package/dist/modules/bundleProduct.test.d.ts +2 -0
- package/dist/modules/bundleProduct.test.d.ts.map +1 -0
- package/dist/modules/bundleProduct.test.js +75 -0
- package/dist/modules/bundleProduct.test.js.map +1 -0
- package/dist/modules/changelog.d.ts +3 -0
- package/dist/modules/changelog.d.ts.map +1 -0
- package/dist/modules/changelog.js +45 -0
- package/dist/modules/changelog.js.map +1 -0
- package/dist/modules/changelog.test.d.ts +2 -0
- package/dist/modules/changelog.test.d.ts.map +1 -0
- package/dist/modules/changelog.test.js +33 -0
- package/dist/modules/changelog.test.js.map +1 -0
- package/dist/modules/configMutation.d.ts +5 -0
- package/dist/modules/configMutation.d.ts.map +1 -0
- package/{src → dist}/modules/configMutation.js +57 -104
- package/dist/modules/configMutation.js.map +1 -0
- package/dist/modules/configMutation.test.d.ts +2 -0
- package/dist/modules/configMutation.test.d.ts.map +1 -0
- package/dist/modules/configMutation.test.js +28 -0
- package/dist/modules/configMutation.test.js.map +1 -0
- package/dist/modules/csvMerger.d.ts +2 -0
- package/dist/modules/csvMerger.d.ts.map +1 -0
- package/dist/modules/csvMerger.js +104 -0
- package/dist/modules/csvMerger.js.map +1 -0
- package/dist/modules/csvMerger.test.d.ts +2 -0
- package/dist/modules/csvMerger.test.d.ts.map +1 -0
- package/dist/modules/csvMerger.test.js +76 -0
- package/dist/modules/csvMerger.test.js.map +1 -0
- package/dist/modules/deleteDB.d.ts +2 -0
- package/dist/modules/deleteDB.d.ts.map +1 -0
- package/dist/modules/deleteDB.js +75 -0
- package/dist/modules/deleteDB.js.map +1 -0
- package/dist/modules/deleteDB.test.d.ts +2 -0
- package/dist/modules/deleteDB.test.d.ts.map +1 -0
- package/dist/modules/deleteDB.test.js +78 -0
- package/dist/modules/deleteDB.test.js.map +1 -0
- package/dist/modules/dumpDB.d.ts +3 -0
- package/dist/modules/dumpDB.d.ts.map +1 -0
- package/{src → dist}/modules/dumpDB.js +64 -89
- package/dist/modules/dumpDB.js.map +1 -0
- package/dist/modules/dumpDB.test.d.ts +2 -0
- package/dist/modules/dumpDB.test.d.ts.map +1 -0
- package/dist/modules/dumpDB.test.js +104 -0
- package/dist/modules/dumpDB.test.js.map +1 -0
- package/dist/modules/dumpTableToCSV.d.ts +4 -0
- package/dist/modules/dumpTableToCSV.d.ts.map +1 -0
- package/dist/modules/dumpTableToCSV.js +135 -0
- package/dist/modules/dumpTableToCSV.js.map +1 -0
- package/dist/modules/dumpTableToCSV.test.d.ts +2 -0
- package/dist/modules/dumpTableToCSV.test.d.ts.map +1 -0
- package/dist/modules/dumpTableToCSV.test.js +15 -0
- package/dist/modules/dumpTableToCSV.test.js.map +1 -0
- package/dist/modules/extdSearch.d.ts +2 -0
- package/dist/modules/extdSearch.d.ts.map +1 -0
- package/{src → dist}/modules/extdSearch.js +60 -60
- package/dist/modules/extdSearch.js.map +1 -0
- package/dist/modules/extdSearch.test.d.ts +2 -0
- package/dist/modules/extdSearch.test.d.ts.map +1 -0
- package/dist/modules/extdSearch.test.js +114 -0
- package/dist/modules/extdSearch.test.js.map +1 -0
- package/dist/modules/githubDeploymentKey.d.ts +3 -0
- package/dist/modules/githubDeploymentKey.d.ts.map +1 -0
- package/dist/modules/githubDeploymentKey.js +241 -0
- package/dist/modules/githubDeploymentKey.js.map +1 -0
- package/dist/modules/githubDeploymentKey.test.d.ts +2 -0
- package/dist/modules/githubDeploymentKey.test.d.ts.map +1 -0
- package/dist/modules/githubDeploymentKey.test.js +50 -0
- package/dist/modules/githubDeploymentKey.test.js.map +1 -0
- package/dist/modules/githubDeploymentKeysList.d.ts +6 -0
- package/dist/modules/githubDeploymentKeysList.d.ts.map +1 -0
- package/dist/modules/githubDeploymentKeysList.js +185 -0
- package/dist/modules/githubDeploymentKeysList.js.map +1 -0
- package/dist/modules/githubDeploymentKeysList.test.d.ts +2 -0
- package/dist/modules/githubDeploymentKeysList.test.d.ts.map +1 -0
- package/dist/modules/githubDeploymentKeysList.test.js +70 -0
- package/dist/modules/githubDeploymentKeysList.test.js.map +1 -0
- package/dist/modules/githubSecurityAdvisories.d.ts +3 -0
- package/dist/modules/githubSecurityAdvisories.d.ts.map +1 -0
- package/dist/modules/githubSecurityAdvisories.js +145 -0
- package/dist/modules/githubSecurityAdvisories.js.map +1 -0
- package/dist/modules/githubSecurityAdvisories.test.d.ts +2 -0
- package/dist/modules/githubSecurityAdvisories.test.d.ts.map +1 -0
- package/dist/modules/githubSecurityAdvisories.test.js +67 -0
- package/dist/modules/githubSecurityAdvisories.test.js.map +1 -0
- package/dist/modules/graphqlSchemaExport.d.ts +2 -0
- package/dist/modules/graphqlSchemaExport.d.ts.map +1 -0
- package/dist/modules/graphqlSchemaExport.js +59 -0
- package/dist/modules/graphqlSchemaExport.js.map +1 -0
- package/dist/modules/graphqlSchemaExport.test.d.ts +2 -0
- package/dist/modules/graphqlSchemaExport.test.d.ts.map +1 -0
- package/dist/modules/graphqlSchemaExport.test.js +61 -0
- package/dist/modules/graphqlSchemaExport.test.js.map +1 -0
- package/dist/modules/importDB.d.ts +2 -0
- package/dist/modules/importDB.d.ts.map +1 -0
- package/{src → dist}/modules/importDB.js +48 -66
- package/dist/modules/importDB.js.map +1 -0
- package/dist/modules/importDB.test.d.ts +2 -0
- package/dist/modules/importDB.test.d.ts.map +1 -0
- package/dist/modules/importDB.test.js +65 -0
- package/dist/modules/importDB.test.js.map +1 -0
- package/dist/modules/rewriteConfig.d.ts +3 -0
- package/dist/modules/rewriteConfig.d.ts.map +1 -0
- package/dist/modules/rewriteConfig.js +75 -0
- package/dist/modules/rewriteConfig.js.map +1 -0
- package/dist/modules/rewriteConfig.test.d.ts +2 -0
- package/dist/modules/rewriteConfig.test.d.ts.map +1 -0
- package/dist/modules/rewriteConfig.test.js +62 -0
- package/dist/modules/rewriteConfig.test.js.map +1 -0
- package/dist/modules/setCLIConfig.d.ts +2 -0
- package/dist/modules/setCLIConfig.d.ts.map +1 -0
- package/dist/modules/setCLIConfig.js +29 -0
- package/dist/modules/setCLIConfig.js.map +1 -0
- package/dist/modules/setCLIConfig.test.d.ts +2 -0
- package/dist/modules/setCLIConfig.test.d.ts.map +1 -0
- package/dist/modules/setCLIConfig.test.js +40 -0
- package/dist/modules/setCLIConfig.test.js.map +1 -0
- package/dist/modules/syncConfig.d.ts +4 -0
- package/dist/modules/syncConfig.d.ts.map +1 -0
- package/{src → dist}/modules/syncConfig.js +76 -129
- package/dist/modules/syncConfig.js.map +1 -0
- package/dist/modules/syncConfig.test.d.ts +2 -0
- package/dist/modules/syncConfig.test.d.ts.map +1 -0
- package/dist/modules/syncConfig.test.js +71 -0
- package/dist/modules/syncConfig.test.js.map +1 -0
- package/dist/modules/t003Rewrite.d.ts +2 -0
- package/dist/modules/t003Rewrite.d.ts.map +1 -0
- package/dist/modules/t003Rewrite.js +53 -0
- package/dist/modules/t003Rewrite.js.map +1 -0
- package/dist/modules/t003Rewrite.test.d.ts +2 -0
- package/dist/modules/t003Rewrite.test.d.ts.map +1 -0
- package/dist/modules/t003Rewrite.test.js +43 -0
- package/dist/modules/t003Rewrite.test.js.map +1 -0
- package/dist/modules/t009Search.d.ts +2 -0
- package/dist/modules/t009Search.d.ts.map +1 -0
- package/dist/modules/t009Search.js +30 -0
- package/dist/modules/t009Search.js.map +1 -0
- package/dist/modules/t009Search.test.d.ts +2 -0
- package/dist/modules/t009Search.test.d.ts.map +1 -0
- package/dist/modules/t009Search.test.js +83 -0
- package/dist/modules/t009Search.test.js.map +1 -0
- package/{src → dist}/ressources/cmds.json +3 -0
- package/dist/utils/azure/azure.d.ts +24 -0
- package/dist/utils/azure/azure.d.ts.map +1 -0
- package/{src → dist}/utils/azure/azure.js +14 -21
- package/dist/utils/azure/azure.js.map +1 -0
- package/dist/utils/azure/azure.test.d.ts +2 -0
- package/dist/utils/azure/azure.test.d.ts.map +1 -0
- package/dist/utils/azure/azure.test.js +98 -0
- package/dist/utils/azure/azure.test.js.map +1 -0
- package/dist/utils/config/config.d.ts +27 -0
- package/dist/utils/config/config.d.ts.map +1 -0
- package/dist/utils/config/config.js +74 -0
- package/dist/utils/config/config.js.map +1 -0
- package/dist/utils/config/config.test.d.ts +2 -0
- package/dist/utils/config/config.test.d.ts.map +1 -0
- package/dist/utils/config/config.test.js +64 -0
- package/dist/utils/config/config.test.js.map +1 -0
- package/dist/utils/db/DB.d.ts +14 -0
- package/dist/utils/db/DB.d.ts.map +1 -0
- package/dist/utils/db/DB.js +61 -0
- package/dist/utils/db/DB.js.map +1 -0
- package/dist/utils/db/DB.test.d.ts +2 -0
- package/dist/utils/db/DB.test.d.ts.map +1 -0
- package/dist/utils/db/DB.test.js +73 -0
- package/dist/utils/db/DB.test.js.map +1 -0
- package/dist/utils/fs/FS.d.ts +15 -0
- package/dist/utils/fs/FS.d.ts.map +1 -0
- package/{src → dist}/utils/fs/FS.js +31 -45
- package/dist/utils/fs/FS.js.map +1 -0
- package/dist/utils/fs/FS.test.d.ts +2 -0
- package/dist/utils/fs/FS.test.d.ts.map +1 -0
- package/dist/utils/fs/FS.test.js +124 -0
- package/dist/utils/fs/FS.test.js.map +1 -0
- package/dist/utils/github/github.d.ts +29 -0
- package/dist/utils/github/github.d.ts.map +1 -0
- package/dist/utils/github/github.js +96 -0
- package/dist/utils/github/github.js.map +1 -0
- package/dist/utils/github/github.test.d.ts +2 -0
- package/dist/utils/github/github.test.d.ts.map +1 -0
- package/dist/utils/github/github.test.js +83 -0
- package/dist/utils/github/github.test.js.map +1 -0
- package/dist/utils/shell/DatabaseShell.d.ts +77 -0
- package/dist/utils/shell/DatabaseShell.d.ts.map +1 -0
- package/{src → dist}/utils/shell/DatabaseShell.js +73 -87
- package/dist/utils/shell/DatabaseShell.js.map +1 -0
- package/dist/utils/shell/DatabaseShell.test.d.ts +2 -0
- package/dist/utils/shell/DatabaseShell.test.d.ts.map +1 -0
- package/dist/utils/shell/DatabaseShell.test.js +78 -0
- package/dist/utils/shell/DatabaseShell.test.js.map +1 -0
- package/dist/utils/shell/DatabaseShellBuilder.d.ts +67 -0
- package/dist/utils/shell/DatabaseShellBuilder.d.ts.map +1 -0
- package/{src → dist}/utils/shell/DatabaseShellBuilder.js +50 -59
- package/dist/utils/shell/DatabaseShellBuilder.js.map +1 -0
- package/dist/utils/shell/DatabaseShellBuilder.test.d.ts +2 -0
- package/dist/utils/shell/DatabaseShellBuilder.test.d.ts.map +1 -0
- package/dist/utils/shell/DatabaseShellBuilder.test.js +55 -0
- package/dist/utils/shell/DatabaseShellBuilder.test.js.map +1 -0
- package/dist/utils/shell/Shell.d.ts +30 -0
- package/dist/utils/shell/Shell.d.ts.map +1 -0
- package/{src → dist}/utils/shell/Shell.js +14 -19
- package/dist/utils/shell/Shell.js.map +1 -0
- package/dist/utils/shell/Shell.test.d.ts +2 -0
- package/dist/utils/shell/Shell.test.d.ts.map +1 -0
- package/dist/utils/shell/Shell.test.js +65 -0
- package/dist/utils/shell/Shell.test.js.map +1 -0
- package/dist/utils/shell/ShellBuilder.d.ts +60 -0
- package/dist/utils/shell/ShellBuilder.d.ts.map +1 -0
- package/{src → dist}/utils/shell/ShellBuilder.js +23 -44
- package/dist/utils/shell/ShellBuilder.js.map +1 -0
- package/dist/utils/shell/ShellBuilder.test.d.ts +2 -0
- package/dist/utils/shell/ShellBuilder.test.d.ts.map +1 -0
- package/dist/utils/shell/ShellBuilder.test.js +39 -0
- package/dist/utils/shell/ShellBuilder.test.js.map +1 -0
- package/package.json +39 -11
- package/.github/dependabot.yml +0 -28
- package/.github/workflows/publish.yml +0 -31
- package/.husky/commit-msg +0 -1
- package/.vscode/settings.json +0 -6
- package/commitlint.config.mjs +0 -4
- package/src/index.js +0 -130
- package/src/modules/adbBridge.js +0 -52
- package/src/modules/adbIntentSender.js +0 -82
- package/src/modules/changelog.js +0 -60
- package/src/modules/csvMerger.js +0 -118
- package/src/modules/deleteDB.js +0 -84
- package/src/modules/dumpTableToCSV.js +0 -154
- package/src/modules/githubDeploymentKey.js +0 -265
- package/src/modules/githubDeploymentKeysList.js +0 -199
- package/src/modules/githubSecurityAdvisories.js +0 -162
- package/src/modules/graphqlSchemaExport.js +0 -61
- package/src/modules/rewriteConfig.js +0 -93
- package/src/modules/setCLIConfig.js +0 -33
- package/src/modules/t003Rewrite.js +0 -64
- package/src/modules/t009Search.js +0 -34
- package/src/utils/config/config.js +0 -70
- package/src/utils/db/DB.js +0 -54
- package/src/utils/github/github.js +0 -102
- /package/{src → dist}/ressources/wegas_p.ico +0 -0
- /package/{src → dist}/utils/config/default.json +0 -0
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import prompts from "prompts";
|
|
2
|
-
import os from 'os';
|
|
3
|
-
import { createEditor } from "properties-parser";
|
|
4
|
-
import { writeFileSync, readFileSync, readdirSync } from "fs";
|
|
5
|
-
import YAML from 'yaml'
|
|
6
|
-
import chalk from "chalk";
|
|
7
|
-
import { Config } from "../utils/config/config.js";
|
|
8
|
-
import { DB } from "../utils/db/DB.js";
|
|
9
|
-
import path from "path";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
async function configRewrite(cli) {
|
|
14
|
-
console.log()
|
|
15
|
-
|
|
16
|
-
const homedir = os.homedir();
|
|
17
|
-
|
|
18
|
-
const config = await Config.getConfig();
|
|
19
|
-
|
|
20
|
-
const databaseNames = await DB.getDatabaseNames();
|
|
21
|
-
|
|
22
|
-
const configDirectories = readdirSync(config.configIndividualPath, { withFileTypes: true }).filter(dirent => dirent.isDirectory()).map(dirent => { return { title: dirent.name } })
|
|
23
|
-
|
|
24
|
-
let success = true;
|
|
25
|
-
|
|
26
|
-
const responses = await prompts([{
|
|
27
|
-
// DB-Auswahl von DB
|
|
28
|
-
type: 'autocomplete',
|
|
29
|
-
name: 'dbName',
|
|
30
|
-
message: 'DB-Name?',
|
|
31
|
-
choices: databaseNames.map(name => { return { title: name.name } })
|
|
32
|
-
}, {
|
|
33
|
-
// Ordnerauswahl von vorhandenen Ordner in configIndividual
|
|
34
|
-
type: 'autocomplete',
|
|
35
|
-
name: 'configName',
|
|
36
|
-
message: 'ConfigIndividual-Name?',
|
|
37
|
-
choices: configDirectories
|
|
38
|
-
}, {
|
|
39
|
-
type: 'number',
|
|
40
|
-
name: 'mnr',
|
|
41
|
-
message: 'Mandant?',
|
|
42
|
-
initial: '1'
|
|
43
|
-
}, {
|
|
44
|
-
type: 'autocomplete',
|
|
45
|
-
name: 'language',
|
|
46
|
-
message: 'Sprache?',
|
|
47
|
-
choices: [
|
|
48
|
-
{ title: '<Nicht Verändern>', value: '?' },
|
|
49
|
-
{ title: 'Deutsch', value: 'd' },
|
|
50
|
-
{ title: 'Französisch', value: 'f' },
|
|
51
|
-
{ title: 'Italienisch', value: 'i' }
|
|
52
|
-
]
|
|
53
|
-
}], {
|
|
54
|
-
onCancel: () => {
|
|
55
|
-
console.log()
|
|
56
|
-
console.log(chalk.red("Cancelled Rewrite!"))
|
|
57
|
-
console.log()
|
|
58
|
-
success = false
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
if (success) {
|
|
63
|
-
// Rewrite jwegas.properties
|
|
64
|
-
const editorJwegasProperties = createEditor(homedir + path.sep+"jwegas.properties")
|
|
65
|
-
editorJwegasProperties.set("user.mandant", responses.mnr.toString());
|
|
66
|
-
editorJwegasProperties.save();
|
|
67
|
-
|
|
68
|
-
// Rewrite wegas.properties
|
|
69
|
-
const editorWegasProperties = createEditor(config.configIndividualPath + path.sep+"wegas.properties")
|
|
70
|
-
editorWegasProperties.set("db.database", responses.dbName);
|
|
71
|
-
|
|
72
|
-
if(responses.language != '?') {
|
|
73
|
-
editorWegasProperties.set("language", responses.language)
|
|
74
|
-
}
|
|
75
|
-
editorWegasProperties.save();
|
|
76
|
-
|
|
77
|
-
// Rewrite path.yaml
|
|
78
|
-
const content = readFileSync(config.configIndividualPath +path.sep+"path.yaml", "utf-8");
|
|
79
|
-
|
|
80
|
-
const doc = YAML.parseDocument(content)
|
|
81
|
-
|
|
82
|
-
doc.set("pathIndividual", config.configIndividualPathWrite + "\\\\" + responses.configName + "\\\\")
|
|
83
|
-
|
|
84
|
-
writeFileSync(config.configIndividualPath +path.sep+"path.yaml", doc.toString());
|
|
85
|
-
|
|
86
|
-
console.log()
|
|
87
|
-
console.log(chalk.green("Config-Rewrite successful!"))
|
|
88
|
-
console.log()
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export default configRewrite;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import prompts from "prompts";
|
|
2
|
-
import { Config } from "../utils/config/config.js";
|
|
3
|
-
import chalk from "chalk";
|
|
4
|
-
|
|
5
|
-
export default async function writeCLIConfig(){
|
|
6
|
-
console.log()
|
|
7
|
-
|
|
8
|
-
let data = await Config.getConfig();
|
|
9
|
-
|
|
10
|
-
let keys = Object.keys(data);
|
|
11
|
-
let success = true;
|
|
12
|
-
|
|
13
|
-
const responses = await prompts(keys.map(key => {
|
|
14
|
-
return {
|
|
15
|
-
// Ordnerauswahl von vorhandenen Ordner in configIndividual
|
|
16
|
-
type: 'text',
|
|
17
|
-
name: key,
|
|
18
|
-
message: key+":",
|
|
19
|
-
initial: data[key]
|
|
20
|
-
}
|
|
21
|
-
}), {
|
|
22
|
-
onCancel: () => {
|
|
23
|
-
console.log()
|
|
24
|
-
console.log(chalk.red("Cancelled Config!"))
|
|
25
|
-
console.log()
|
|
26
|
-
success = false
|
|
27
|
-
}
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
if(success){
|
|
31
|
-
Config.setConfig(responses)
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import chalk from "chalk";
|
|
2
|
-
import prompts from "prompts";
|
|
3
|
-
import { Config } from "../utils/config/config.js";
|
|
4
|
-
import { DB } from "../utils/db/DB.js";
|
|
5
|
-
|
|
6
|
-
export default async function t003Rewrite(cli) {
|
|
7
|
-
console.log()
|
|
8
|
-
|
|
9
|
-
const config = await Config.getConfig();
|
|
10
|
-
|
|
11
|
-
const databaseNames = await DB.getDatabaseNames();
|
|
12
|
-
|
|
13
|
-
let success = true;
|
|
14
|
-
|
|
15
|
-
const responseDB = await prompts([{
|
|
16
|
-
// DB-Auswahl von DB
|
|
17
|
-
type: 'autocomplete',
|
|
18
|
-
name: 'dbName',
|
|
19
|
-
message: 'DB-Name?',
|
|
20
|
-
choices: databaseNames.map(name => { return { title: name.name } })
|
|
21
|
-
}, {
|
|
22
|
-
type: 'number',
|
|
23
|
-
name: 'mnr',
|
|
24
|
-
message: 'Mandant?',
|
|
25
|
-
initial: '1'
|
|
26
|
-
}], {
|
|
27
|
-
onCancel: () => {
|
|
28
|
-
console.log()
|
|
29
|
-
console.log(chalk.red("Cancelled Rewrite!"))
|
|
30
|
-
console.log()
|
|
31
|
-
success = false
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
if (success) {
|
|
36
|
-
|
|
37
|
-
const users = await DB.executeQueryOnDB("SELECT t003_pw FROM t003 WHERE t003_mnr = " + responseDB.mnr, responseDB.dbName);
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const responses = await prompts([{
|
|
41
|
-
// Ordnerauswahl von vorhandenen Ordner in configIndividual
|
|
42
|
-
type: 'autocomplete',
|
|
43
|
-
name: 'username',
|
|
44
|
-
message: 'Username?',
|
|
45
|
-
choices: users.map(entry => { return ({ title: entry.t003_pw }) })
|
|
46
|
-
}], {
|
|
47
|
-
onCancel: () => {
|
|
48
|
-
console.log()
|
|
49
|
-
console.log(chalk.red("Cancelled Rewrite!"))
|
|
50
|
-
console.log()
|
|
51
|
-
success = false
|
|
52
|
-
}
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
if (success) {
|
|
56
|
-
console.log()
|
|
57
|
-
|
|
58
|
-
await DB.executeQueryOnDB("UPDATE t003 SET t003_pw = '"+config.wegasUsername+"' WHERE t003_mnr = "+responseDB.mnr+" AND t003_pw = '"+responses.username+"'", responseDB.dbName);
|
|
59
|
-
|
|
60
|
-
console.log(chalk.green("T003 rewritten!"))
|
|
61
|
-
console.log()
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { DatabaseShellBuilder, TableConfig } from "../utils/shell/DatabaseShellBuilder.js";
|
|
2
|
-
|
|
3
|
-
export default async function t009Search() {
|
|
4
|
-
|
|
5
|
-
const overviewConfig = new TableConfig()
|
|
6
|
-
.withName("Overview")
|
|
7
|
-
.withShortcut(":ow")
|
|
8
|
-
.withSearchKeys(["mnr", "grp_pw", "lnr", "pgm", "flag", "bez", "bez_f", "bez_i"])
|
|
9
|
-
.withThreshold(0.7)
|
|
10
|
-
.withHeader(["MNR", "Mitarbeitergruppe", "Zeilennummer", "Programm-Name", "Typ (P=Programm, S=Shell)", "Bezeichnung", "Bezeichnung franz.", "Bezeichnung ital."])
|
|
11
|
-
.withFormatter(p => [p.mnr, p.grp_pw, p.lnr, p.pgm, p.flag, p.bez, p.bez_f, p.bez_i]);
|
|
12
|
-
|
|
13
|
-
const builder = new DatabaseShellBuilder();
|
|
14
|
-
builder
|
|
15
|
-
.withEditTools(
|
|
16
|
-
[
|
|
17
|
-
{ title: 'MNR', column: 'mnr', default: '1' },
|
|
18
|
-
{ title: 'Mitarbeitergruppe', column: 'grp_pw', default: '' },
|
|
19
|
-
{ title: 'Zeilennummer', column: 'lnr', default: null },
|
|
20
|
-
{ title: 'Programm-Name', column: 'pgm', default: null },
|
|
21
|
-
{ title: 'Typ', column: 'flag', default: 'P' },
|
|
22
|
-
{ title: 'Bezeichnung', column: 'bez', default: null },
|
|
23
|
-
{ title: 'Bezeichnung franz.', column: 'bez_f', default: null },
|
|
24
|
-
{ title: 'Bezeichnung ital.', column: 'bez_i', default: null },
|
|
25
|
-
],
|
|
26
|
-
["mnr", "pgm"],
|
|
27
|
-
["mnr", "lnr", "pgm", "bez"],
|
|
28
|
-
["grp_pw", "flag", "bez_f", "bez_i"])
|
|
29
|
-
.withConfig(overviewConfig)
|
|
30
|
-
.withTables("T009", ["t009"]);
|
|
31
|
-
|
|
32
|
-
const shell = builder.build();
|
|
33
|
-
await shell.run();
|
|
34
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import cfg from "application-config"
|
|
2
|
-
import defaultCFG from './default.json' with {type: 'json'};
|
|
3
|
-
|
|
4
|
-
export class Config{
|
|
5
|
-
static config = cfg("inteco_cli");
|
|
6
|
-
static configData;
|
|
7
|
-
|
|
8
|
-
static async initConfig(){
|
|
9
|
-
if(this.configData == null){
|
|
10
|
-
this.configData = await this.config.read();
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
if(Object.keys(this.configData).length === 0){
|
|
14
|
-
// Default Configuration
|
|
15
|
-
this.configData = defaultCFG
|
|
16
|
-
this.config.write(defaultCFG)
|
|
17
|
-
}else{
|
|
18
|
-
let data = this.configData;
|
|
19
|
-
let hasChange = false;
|
|
20
|
-
Object.keys(defaultCFG).forEach(key => {
|
|
21
|
-
// Write new config-entries if not present
|
|
22
|
-
if(!Object.keys(this.configData).includes(key)){
|
|
23
|
-
data[key] = defaultCFG[key];
|
|
24
|
-
hasChange = true;
|
|
25
|
-
}
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
Object.keys(this.configData).forEach(key => {
|
|
29
|
-
if(!Object.keys(defaultCFG).includes(key)){
|
|
30
|
-
delete data[key]
|
|
31
|
-
hasChange = true;
|
|
32
|
-
}
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
if(hasChange){
|
|
36
|
-
this.configData = data;
|
|
37
|
-
this.config.write(data);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
static async getConfig(){
|
|
43
|
-
await this.initConfig()
|
|
44
|
-
|
|
45
|
-
return this.configData
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
static async getConfigPath(){
|
|
49
|
-
await this.initConfig();
|
|
50
|
-
return this.config.filePath;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
static async setConfigField(field, value){
|
|
54
|
-
await this.initConfig();
|
|
55
|
-
|
|
56
|
-
let data = this.configData;
|
|
57
|
-
|
|
58
|
-
data[field] = value;
|
|
59
|
-
|
|
60
|
-
this.configData = data;
|
|
61
|
-
this.config.write(data);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
static async setConfig(data){
|
|
65
|
-
this.configData = data;
|
|
66
|
-
this.config.write(data);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
package/src/utils/db/DB.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import mysql from "mysql-await"
|
|
2
|
-
import { Config } from "../config/config.js";
|
|
3
|
-
|
|
4
|
-
export class DB{
|
|
5
|
-
static connection;
|
|
6
|
-
|
|
7
|
-
static async connect(db){
|
|
8
|
-
const config = await Config.getConfig();
|
|
9
|
-
|
|
10
|
-
this.connection = mysql.createConnection({
|
|
11
|
-
host:config.dbURL,
|
|
12
|
-
user:config.dbUser,
|
|
13
|
-
password:config.dbPassword,
|
|
14
|
-
database: db!=null?db:""
|
|
15
|
-
})
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
static async executeQuery(query){
|
|
19
|
-
await this.connect(null)
|
|
20
|
-
|
|
21
|
-
let results = await this.connection.awaitQuery(query)
|
|
22
|
-
|
|
23
|
-
this.connection.end();
|
|
24
|
-
|
|
25
|
-
return results
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
static async executeQueryOnDB(query, db){
|
|
29
|
-
await this.connect(db)
|
|
30
|
-
|
|
31
|
-
let results = await this.connection.awaitQuery(query)
|
|
32
|
-
|
|
33
|
-
this.connection.end();
|
|
34
|
-
|
|
35
|
-
return results
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
static async getDatabaseNames(){
|
|
39
|
-
await this.connect(null)
|
|
40
|
-
|
|
41
|
-
let results = await this.connection.awaitQuery("SHOW DATABASES")
|
|
42
|
-
|
|
43
|
-
this.connection.end();
|
|
44
|
-
|
|
45
|
-
results = results.filter((val) => {
|
|
46
|
-
if(val.Database == "sys" || val.Database == "information_schema" || val.Database == "mysql" || val.Database == "performance_schema"){
|
|
47
|
-
return false;
|
|
48
|
-
}
|
|
49
|
-
return true
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
return results.map(result => {return {"name":result.Database}})
|
|
53
|
-
}
|
|
54
|
-
}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
import { execSync } from 'child_process';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Get GitHub authentication token from environment or GitHub CLI
|
|
6
|
-
* @returns {Promise<{token: string, authMethod: string}>} Token and authentication method
|
|
7
|
-
* @throws {Error} If no authentication method is available
|
|
8
|
-
*/
|
|
9
|
-
export async function getGithubToken() {
|
|
10
|
-
let token = null;
|
|
11
|
-
let authMethod = null;
|
|
12
|
-
|
|
13
|
-
// 1. Try GITHUB_TOKEN environment variable
|
|
14
|
-
if (process.env.GITHUB_TOKEN) {
|
|
15
|
-
token = process.env.GITHUB_TOKEN;
|
|
16
|
-
authMethod = 'GITHUB_TOKEN (environment variable)';
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// 2. Try GitHub CLI authentication if available
|
|
20
|
-
if (!token) {
|
|
21
|
-
try {
|
|
22
|
-
token = execSync('gh auth token', { encoding: 'utf-8' }).trim();
|
|
23
|
-
authMethod = 'GitHub CLI';
|
|
24
|
-
} catch (error) {
|
|
25
|
-
// GitHub CLI not available or not authenticated
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// 3. If no token found, prompt user to authenticate
|
|
30
|
-
if (!token) {
|
|
31
|
-
console.log(chalk.yellow('No GitHub authentication found. Please authenticate with GitHub CLI:'));
|
|
32
|
-
console.log(chalk.gray(' Run: gh auth login'));
|
|
33
|
-
console.log();
|
|
34
|
-
throw new Error('GitHub authentication required. Please run "gh auth login" or set GITHUB_TOKEN environment variable.');
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return { token, authMethod };
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Make a GitHub API fetch request with proper headers and error handling
|
|
42
|
-
* @param {string} url - GitHub API endpoint URL
|
|
43
|
-
* @param {string} token - GitHub authentication token
|
|
44
|
-
* @returns {Promise<Response>} Fetch response
|
|
45
|
-
* @throws {Error} If fetch fails or returns error status
|
|
46
|
-
*/
|
|
47
|
-
export async function fetchGithubAPI(url, token) {
|
|
48
|
-
const res = await fetch(url, {
|
|
49
|
-
headers: {
|
|
50
|
-
'Authorization': `Bearer ${token}`,
|
|
51
|
-
'Accept': 'application/vnd.github+json',
|
|
52
|
-
'X-GitHub-Api-Version': '2022-11-28',
|
|
53
|
-
'User-Agent': 'inteco-cli'
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
if (!res.ok) {
|
|
58
|
-
if (res.status === 404) {
|
|
59
|
-
throw new Error(`404: Resource not found`);
|
|
60
|
-
}
|
|
61
|
-
if (res.status === 401) {
|
|
62
|
-
throw new Error('401: GitHub authentication failed');
|
|
63
|
-
}
|
|
64
|
-
if (res.status === 403) {
|
|
65
|
-
throw new Error('403: Access forbidden (Dependabot alerts may not be enabled)');
|
|
66
|
-
}
|
|
67
|
-
throw new Error(`${res.status}: GitHub API request failed: ${res.statusText}`);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
return res;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Fetch all items from a paginated GitHub API endpoint
|
|
75
|
-
* @param {string} baseUrl - Base GitHub API endpoint URL (without pagination params)
|
|
76
|
-
* @param {string} token - GitHub authentication token
|
|
77
|
-
* @param {number} page - Current page (default: 1)
|
|
78
|
-
* @param {Array} allItems - Accumulated items (default: [])
|
|
79
|
-
* @returns {Promise<Array>} All items from all pages
|
|
80
|
-
*/
|
|
81
|
-
export async function fetchPaginatedGithubAPI(baseUrl, token, page = 1, allItems = []) {
|
|
82
|
-
const url = `${baseUrl}${baseUrl.includes('?') ? '&' : '?'}page=${page}&per_page=100`;
|
|
83
|
-
|
|
84
|
-
try {
|
|
85
|
-
const res = await fetchGithubAPI(url, token);
|
|
86
|
-
const items = await res.json();
|
|
87
|
-
|
|
88
|
-
if (items.length === 0) {
|
|
89
|
-
return allItems;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// Recursively fetch all pages
|
|
93
|
-
return fetchPaginatedGithubAPI(baseUrl, token, page + 1, [...allItems, ...items]);
|
|
94
|
-
} catch (error) {
|
|
95
|
-
if (page === 1) {
|
|
96
|
-
// Only throw on first page - error getting initial data
|
|
97
|
-
throw error;
|
|
98
|
-
}
|
|
99
|
-
// On subsequent pages, return what we have so far
|
|
100
|
-
return allItems;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
File without changes
|
|
File without changes
|