@intecoag/inteco-cli 0.5.1 → 1.0.0

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.
@@ -0,0 +1,31 @@
1
+ name: Publish Package Inteco CLI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ permissions:
9
+ id-token: write # Required for OIDC
10
+ contents: write # To create releases
11
+
12
+ jobs:
13
+ publish:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - name: Checkout
17
+ uses: actions/checkout@v4
18
+ with:
19
+ fetch-depth: 0
20
+ - name: Setup Node.js
21
+ uses: actions/setup-node@v4
22
+ with:
23
+ node-version: "lts/*"
24
+ - name: Install dependencies
25
+ run: npm clean-install
26
+ - name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
27
+ run: npm audit signatures
28
+ - name: Release
29
+ env:
30
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31
+ run: npx semantic-release
package/README.md CHANGED
@@ -1,3 +1,3 @@
1
- CLI mit diversen Funktionen für die Arbeit in der Inteco und mit dem WEGAS
2
-
3
- Weitere Informationen: https://inteco.atlassian.net/wiki/x/BYBuAw
1
+ CLI mit diversen Funktionen für die Arbeit in der Inteco und mit dem WEGAS
2
+
3
+ Weitere Informationen: https://inteco.atlassian.net/wiki/x/BYBuAw
package/package.json CHANGED
@@ -1,35 +1,44 @@
1
- {
2
- "name": "@intecoag/inteco-cli",
3
- "version": "0.5.1",
4
- "description": "CLI-Tools for Inteco",
5
- "main": "src/index.js",
6
- "type": "module",
7
- "scripts": {
8
- "start": "node src/index.js"
9
- },
10
- "author": "ah1",
11
- "license": "ISC",
12
- "dependencies": {
13
- "7zip-bin": "^5.2.0",
14
- "adb-ts": "^2.1.2",
15
- "application-config": "^2.0.0",
16
- "chalk": "^5.0.1",
17
- "cli-meow-help": "^3.1.0",
18
- "cli-table3": "^0.6.5",
19
- "csv-parser": "^3.0.0",
20
- "fuzzysort": "^3.1.0",
21
- "graphql": "^16.6.0",
22
- "meow": "^10.1.5",
23
- "mysql-await": "^2.1.8",
24
- "n-readlines": "^1.0.1",
25
- "node-7z": "^3.0.0",
26
- "ora": "^6.1.0",
27
- "prompts": "^2.4.2",
28
- "properties-parser": "^0.3.1",
29
- "readline": "^1.3.0",
30
- "yaml": "^1.10.2"
31
- },
32
- "bin": {
33
- "inteco": "src/index.js"
34
- }
35
- }
1
+ {
2
+ "name": "@intecoag/inteco-cli",
3
+ "version": "1.0.0",
4
+ "description": "CLI-Tools for Inteco",
5
+ "main": "src/index.js",
6
+ "type": "module",
7
+ "scripts": {
8
+ "start": "node src/index.js"
9
+ },
10
+ "author": "ah1",
11
+ "license": "ISC",
12
+ "repository": "https://github.com/intecoag/IntecoCLI",
13
+ "dependencies": {
14
+ "7zip-bin": "^5.2.0",
15
+ "adb-ts": "^2.1.2",
16
+ "application-config": "^2.0.0",
17
+ "chalk": "^5.0.1",
18
+ "cli-meow-help": "^3.1.0",
19
+ "cli-table3": "^0.6.5",
20
+ "csv-parser": "^3.0.0",
21
+ "fuzzysort": "^3.1.0",
22
+ "graphql": "^16.6.0",
23
+ "meow": "^10.1.5",
24
+ "mysql-await": "^2.1.8",
25
+ "n-readlines": "^1.0.1",
26
+ "node-7z": "^3.0.0",
27
+ "ora": "^6.1.0",
28
+ "prompts": "^2.4.2",
29
+ "properties-parser": "^0.3.1",
30
+ "readline": "^1.3.0",
31
+ "yaml": "^1.10.2"
32
+ },
33
+ "bin": {
34
+ "inteco": "src/index.js"
35
+ },
36
+ "devDependencies": {
37
+ "semantic-release": "^25.0.2"
38
+ },
39
+ "release": {
40
+ "branches": [
41
+ "main"
42
+ ]
43
+ }
44
+ }
package/src/index.js CHANGED
@@ -1,85 +1,85 @@
1
- #!/usr/bin/env node
2
- import cliMeowHelp from 'cli-meow-help';
3
- import meow from 'meow';
4
- import adb_bridge from './modules/adbBridge.js';
5
- import adb_intent from './modules/adbIntentSender.js';
6
- import dumpTableToCSV from './modules/dumpTableToCSV.js';
7
- import importDB from './modules/importDB.js';
8
- import rewrite from './modules/rewriteConfig.js';
9
- import writeCLIConfig from './modules/setCLIConfig.js';
10
- import t003Rewrite from './modules/t003Rewrite.js';
11
- import graphqlSchemaExport from './modules/graphqlSchemaExport.js';
12
- import csvMerge from './modules/csvMerger.js';
13
- import {dumpDBMand, dumpDB } from './modules/dumpDB.js';
14
- import deleteDBMand from './modules/deleteDB.js';
15
-
16
- import commands from "./ressources/cmds.json" with {type: 'json'};
17
- import packageJson from "../package.json" with {type: 'json'}
18
- import extdSearch from './modules/extdSearch.js';
19
- import syncConfig from './modules/syncConfig.js';
20
- import bundleProduct from './modules/bundleProduct.js';
21
-
22
- const helpText = cliMeowHelp({
23
- name: `inteco`,
24
- desc: "Version: "+packageJson.version,
25
- commands
26
- });
27
-
28
- const cli = meow(helpText, {
29
- importMeta: import.meta,
30
- });
31
-
32
- switch (cli.input[0]) {
33
- case "config_rewrite":
34
- rewrite(cli)
35
- break;
36
- case "import_db":
37
- importDB(cli)
38
- break;
39
- case "download_db":
40
- downloadDB(cli)
41
- break;
42
- case "t003_rewrite":
43
- t003Rewrite(cli)
44
- break;
45
- case "adb_bridge":
46
- adb_bridge()
47
- break;
48
- case "adb_intent":
49
- adb_intent()
50
- break;
51
- case "set_cli_config":
52
- writeCLIConfig()
53
- break;
54
- case "dump_table_to_csv":
55
- dumpTableToCSV()
56
- break;
57
- case "csv_merge":
58
- csvMerge();
59
- break;
60
- case "graphql_schema_export":
61
- graphqlSchemaExport();
62
- break;
63
- case "dump_db_mand":
64
- dumpDBMand(cli);
65
- break;
66
- case "dump_db":
67
- dumpDB(cli);
68
- break;
69
- case "delete_db_mand":
70
- deleteDBMand();
71
- break;
72
- case "extd_search":
73
- extdSearch();
74
- break;
75
- case "sync_config":
76
- syncConfig();
77
- break;
78
- case "bundle_product":
79
- bundleProduct(cli);
80
- break;
81
- default:
82
- cli.showHelp()
83
- break;
84
- }
85
-
1
+ #!/usr/bin/env node
2
+ import cliMeowHelp from 'cli-meow-help';
3
+ import meow from 'meow';
4
+ import adb_bridge from './modules/adbBridge.js';
5
+ import adb_intent from './modules/adbIntentSender.js';
6
+ import dumpTableToCSV from './modules/dumpTableToCSV.js';
7
+ import importDB from './modules/importDB.js';
8
+ import rewrite from './modules/rewriteConfig.js';
9
+ import writeCLIConfig from './modules/setCLIConfig.js';
10
+ import t003Rewrite from './modules/t003Rewrite.js';
11
+ import graphqlSchemaExport from './modules/graphqlSchemaExport.js';
12
+ import csvMerge from './modules/csvMerger.js';
13
+ import {dumpDBMand, dumpDB } from './modules/dumpDB.js';
14
+ import deleteDBMand from './modules/deleteDB.js';
15
+
16
+ import commands from "./ressources/cmds.json" with {type: 'json'};
17
+ import packageJson from "../package.json" with {type: 'json'}
18
+ import extdSearch from './modules/extdSearch.js';
19
+ import syncConfig from './modules/syncConfig.js';
20
+ import bundleProduct from './modules/bundleProduct.js';
21
+
22
+ const helpText = cliMeowHelp({
23
+ name: `inteco`,
24
+ desc: "Version: "+packageJson.version,
25
+ commands
26
+ });
27
+
28
+ const cli = meow(helpText, {
29
+ importMeta: import.meta,
30
+ });
31
+
32
+ switch (cli.input[0]) {
33
+ case "config_rewrite":
34
+ rewrite(cli)
35
+ break;
36
+ case "import_db":
37
+ importDB(cli)
38
+ break;
39
+ case "download_db":
40
+ downloadDB(cli)
41
+ break;
42
+ case "t003_rewrite":
43
+ t003Rewrite(cli)
44
+ break;
45
+ case "adb_bridge":
46
+ adb_bridge()
47
+ break;
48
+ case "adb_intent":
49
+ adb_intent()
50
+ break;
51
+ case "set_cli_config":
52
+ writeCLIConfig()
53
+ break;
54
+ case "dump_table_to_csv":
55
+ dumpTableToCSV()
56
+ break;
57
+ case "csv_merge":
58
+ csvMerge();
59
+ break;
60
+ case "graphql_schema_export":
61
+ graphqlSchemaExport();
62
+ break;
63
+ case "dump_db_mand":
64
+ dumpDBMand(cli);
65
+ break;
66
+ case "dump_db":
67
+ dumpDB(cli);
68
+ break;
69
+ case "delete_db_mand":
70
+ deleteDBMand();
71
+ break;
72
+ case "extd_search":
73
+ extdSearch();
74
+ break;
75
+ case "sync_config":
76
+ syncConfig();
77
+ break;
78
+ case "bundle_product":
79
+ bundleProduct(cli);
80
+ break;
81
+ default:
82
+ cli.showHelp()
83
+ break;
84
+ }
85
+
@@ -1,52 +1,52 @@
1
- import adb from "adb-ts";
2
- import chalk from "chalk";
3
- import prompts from "prompts";
4
- import { Config } from "../utils/config/config.js";
5
-
6
-
7
- export default async function adb_bridge(cli){
8
-
9
- console.log()
10
-
11
- const config = await Config.getConfig();
12
-
13
- const adbClient = new adb.AdbClient({host: "127.0.0.1"})
14
-
15
- adbClient.listDevices()
16
- .then(async (devices) => {
17
- let success = true;
18
- const result = await prompts([
19
- {
20
- // Ordnerauswahl von vorhandenen Ordner in configIndividual
21
- type: 'autocomplete',
22
- name: 'device',
23
- message: 'Device?',
24
- choices: devices.map(dev => {return {title: dev.id+" ("+dev.model+")", value:dev}})
25
- },
26
- {
27
- // Ordnerauswahl von vorhandenen Ordner in configIndividual
28
- type: 'number',
29
- name: 'port',
30
- initial: "3000",
31
- message: 'Port?'
32
- }
33
- ],{
34
- onCancel: () => {
35
- console.log()
36
- console.log(chalk.red("Cancelled ADB Bridge!"))
37
- console.log()
38
- success = false
39
- }
40
- })
41
-
42
- if(success){
43
- await adbClient.reverse(result.device.id, "tcp:"+result.port, "tcp:"+result.port)
44
- console.log()
45
- console.log(chalk.green("ADB bridged!"))
46
- console.log()
47
- }
48
- });
49
-
50
-
51
-
1
+ import adb from "adb-ts";
2
+ import chalk from "chalk";
3
+ import prompts from "prompts";
4
+ import { Config } from "../utils/config/config.js";
5
+
6
+
7
+ export default async function adb_bridge(cli){
8
+
9
+ console.log()
10
+
11
+ const config = await Config.getConfig();
12
+
13
+ const adbClient = new adb.AdbClient({host: "127.0.0.1"})
14
+
15
+ adbClient.listDevices()
16
+ .then(async (devices) => {
17
+ let success = true;
18
+ const result = await prompts([
19
+ {
20
+ // Ordnerauswahl von vorhandenen Ordner in configIndividual
21
+ type: 'autocomplete',
22
+ name: 'device',
23
+ message: 'Device?',
24
+ choices: devices.map(dev => {return {title: dev.id+" ("+dev.model+")", value:dev}})
25
+ },
26
+ {
27
+ // Ordnerauswahl von vorhandenen Ordner in configIndividual
28
+ type: 'number',
29
+ name: 'port',
30
+ initial: "3000",
31
+ message: 'Port?'
32
+ }
33
+ ],{
34
+ onCancel: () => {
35
+ console.log()
36
+ console.log(chalk.red("Cancelled ADB Bridge!"))
37
+ console.log()
38
+ success = false
39
+ }
40
+ })
41
+
42
+ if(success){
43
+ await adbClient.reverse(result.device.id, "tcp:"+result.port, "tcp:"+result.port)
44
+ console.log()
45
+ console.log(chalk.green("ADB bridged!"))
46
+ console.log()
47
+ }
48
+ });
49
+
50
+
51
+
52
52
  }
@@ -1,82 +1,82 @@
1
- import adb from "adb-ts";
2
- import chalk from "chalk";
3
- import prompts from "prompts";
4
- import { Config } from "../utils/config/config.js";
5
-
6
-
7
- export default async function adb_intent(cli){
8
-
9
- console.log()
10
-
11
- const config = await Config.getConfig();
12
-
13
-
14
-
15
- const adbClient = new adb.AdbClient({host: "127.0.0.1"})
16
-
17
- adbClient.listDevices()
18
- .then(async (devices) => {
19
- let success = true;
20
- const result = await prompts([
21
- {
22
- // Ordnerauswahl von vorhandenen Ordner in configIndividual
23
- type: 'autocomplete',
24
- name: 'device',
25
- message: 'Device?',
26
- choices: devices.map(dev => {return {title: dev.id+" ("+dev.model+")", value:dev}})
27
- },
28
- {
29
- // Ordnerauswahl von vorhandenen Ordner in configIndividual
30
- type: 'autocomplete',
31
- name: 'action',
32
- message: 'Action?',
33
- choices: [
34
- {
35
- "title":"BARCODE_DATA",
36
- "value": "ch.inteco.orderprep.action.BARCODE_DATA"
37
- },
38
- ]
39
- },
40
- {
41
- // Ordnerauswahl von vorhandenen Ordner in configIndividual
42
- type: 'text',
43
- name: 'data',
44
- message: 'Data?',
45
- initial:"1"
46
- },
47
- {
48
- // Ordnerauswahl von vorhandenen Ordner in configIndividual
49
- type: 'autocomplete',
50
- name: 'codeId',
51
- message: 'Code-Typ?',
52
- choices: [
53
- {
54
- "title":"QR-Code",
55
- "value": "s"
56
- },
57
- {
58
- "title":"EAN13",
59
- "value": "d"
60
- }
61
- ]
62
- }
63
- ],{
64
- onCancel: () => {
65
- console.log()
66
- console.log(chalk.red("Cancelled ADB Intent!"))
67
- console.log()
68
- success = false
69
- }
70
- })
71
-
72
- if(success){
73
- await adbClient.shell(result.device.id, "am broadcast -a "+result.action+" --ei version 1 --es codeId "+result.codeId+" --es data "+result.data)
74
- console.log()
75
- console.log(chalk.green("Intent sent!"))
76
- console.log()
77
- }
78
- });
79
-
80
-
81
-
1
+ import adb from "adb-ts";
2
+ import chalk from "chalk";
3
+ import prompts from "prompts";
4
+ import { Config } from "../utils/config/config.js";
5
+
6
+
7
+ export default async function adb_intent(cli){
8
+
9
+ console.log()
10
+
11
+ const config = await Config.getConfig();
12
+
13
+
14
+
15
+ const adbClient = new adb.AdbClient({host: "127.0.0.1"})
16
+
17
+ adbClient.listDevices()
18
+ .then(async (devices) => {
19
+ let success = true;
20
+ const result = await prompts([
21
+ {
22
+ // Ordnerauswahl von vorhandenen Ordner in configIndividual
23
+ type: 'autocomplete',
24
+ name: 'device',
25
+ message: 'Device?',
26
+ choices: devices.map(dev => {return {title: dev.id+" ("+dev.model+")", value:dev}})
27
+ },
28
+ {
29
+ // Ordnerauswahl von vorhandenen Ordner in configIndividual
30
+ type: 'autocomplete',
31
+ name: 'action',
32
+ message: 'Action?',
33
+ choices: [
34
+ {
35
+ "title":"BARCODE_DATA",
36
+ "value": "ch.inteco.orderprep.action.BARCODE_DATA"
37
+ },
38
+ ]
39
+ },
40
+ {
41
+ // Ordnerauswahl von vorhandenen Ordner in configIndividual
42
+ type: 'text',
43
+ name: 'data',
44
+ message: 'Data?',
45
+ initial:"1"
46
+ },
47
+ {
48
+ // Ordnerauswahl von vorhandenen Ordner in configIndividual
49
+ type: 'autocomplete',
50
+ name: 'codeId',
51
+ message: 'Code-Typ?',
52
+ choices: [
53
+ {
54
+ "title":"QR-Code",
55
+ "value": "s"
56
+ },
57
+ {
58
+ "title":"EAN13",
59
+ "value": "d"
60
+ }
61
+ ]
62
+ }
63
+ ],{
64
+ onCancel: () => {
65
+ console.log()
66
+ console.log(chalk.red("Cancelled ADB Intent!"))
67
+ console.log()
68
+ success = false
69
+ }
70
+ })
71
+
72
+ if(success){
73
+ await adbClient.shell(result.device.id, "am broadcast -a "+result.action+" --ei version 1 --es codeId "+result.codeId+" --es data "+result.data)
74
+ console.log()
75
+ console.log(chalk.green("Intent sent!"))
76
+ console.log()
77
+ }
78
+ });
79
+
80
+
81
+
82
82
  }