@intecoag/inteco-cli 0.5.1 → 1.1.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.
- package/.github/workflows/publish.yml +32 -0
- package/.husky/commit-msg +1 -0
- package/README.md +3 -3
- package/commitlint.config.mjs +4 -0
- package/package.json +49 -35
- package/src/index.js +95 -85
- package/src/modules/adbBridge.js +51 -51
- package/src/modules/adbIntentSender.js +81 -81
- package/src/modules/bundleProduct.js +160 -160
- package/src/modules/csvMerger.js +117 -117
- package/src/modules/deleteDB.js +83 -83
- package/src/modules/dumpDB.js +215 -215
- package/src/modules/dumpTableToCSV.js +153 -153
- package/src/modules/extdSearch.js +226 -226
- package/src/modules/graphqlSchemaExport.js +60 -60
- package/src/modules/importDB.js +120 -120
- package/src/modules/rewriteConfig.js +78 -78
- package/src/modules/setCLIConfig.js +32 -32
- package/src/modules/syncConfig.js +264 -264
- package/src/modules/t003Rewrite.js +63 -63
- package/src/ressources/cmds.json +46 -46
- package/src/utils/config/config.js +70 -70
- package/src/utils/config/default.json +8 -8
- package/src/utils/db/DB.js +53 -53
- package/src/utils/fs/FS.js +87 -87
|
@@ -0,0 +1,32 @@
|
|
|
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
|
|
32
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
npx --no-install commitlint --edit "$1"
|
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,49 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@intecoag/inteco-cli",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "CLI-Tools for Inteco",
|
|
5
|
-
"main": "src/index.js",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"start": "node src/index.js"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
}
|
|
35
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@intecoag/inteco-cli",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "CLI-Tools for Inteco",
|
|
5
|
+
"main": "src/index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"start": "node src/index.js",
|
|
9
|
+
"prepare": "husky"
|
|
10
|
+
},
|
|
11
|
+
"author": "ah1",
|
|
12
|
+
"license": "ISC",
|
|
13
|
+
"repository": "https://github.com/intecoag/IntecoCLI",
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"7zip-bin": "^5.2.0",
|
|
16
|
+
"adb-ts": "^2.1.2",
|
|
17
|
+
"application-config": "^2.0.0",
|
|
18
|
+
"chalk": "^5.0.1",
|
|
19
|
+
"cli-meow-help": "^3.1.0",
|
|
20
|
+
"cli-table3": "^0.6.5",
|
|
21
|
+
"csv-parser": "^3.0.0",
|
|
22
|
+
"fuzzysort": "^3.1.0",
|
|
23
|
+
"graphql": "^16.6.0",
|
|
24
|
+
"meow": "^10.1.5",
|
|
25
|
+
"mysql-await": "^2.1.8",
|
|
26
|
+
"n-readlines": "^1.0.1",
|
|
27
|
+
"node-7z": "^3.0.0",
|
|
28
|
+
"ora": "^6.1.0",
|
|
29
|
+
"prompts": "^2.4.2",
|
|
30
|
+
"properties-parser": "^0.3.1",
|
|
31
|
+
"readline": "^1.3.0",
|
|
32
|
+
"update-notifier": "^7.3.1",
|
|
33
|
+
"yaml": "^1.10.2"
|
|
34
|
+
},
|
|
35
|
+
"bin": {
|
|
36
|
+
"inteco": "src/index.js"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@commitlint/cli": "^20.2.0",
|
|
40
|
+
"@commitlint/config-conventional": "^20.2.0",
|
|
41
|
+
"husky": "^9.1.7",
|
|
42
|
+
"semantic-release": "^25.0.2"
|
|
43
|
+
},
|
|
44
|
+
"release": {
|
|
45
|
+
"branches": [
|
|
46
|
+
"main"
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
}
|
package/src/index.js
CHANGED
|
@@ -1,85 +1,95 @@
|
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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
|
+
import updateNotifier from 'update-notifier';
|
|
23
|
+
|
|
24
|
+
updateNotifier({
|
|
25
|
+
pkg: {
|
|
26
|
+
name: packageJson.name,
|
|
27
|
+
version: packageJson.version
|
|
28
|
+
},
|
|
29
|
+
updateCheckInterval: 0}).notify();
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
const helpText = cliMeowHelp({
|
|
33
|
+
name: `inteco`,
|
|
34
|
+
desc: "Version: "+packageJson.version,
|
|
35
|
+
commands
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const cli = meow(helpText, {
|
|
39
|
+
importMeta: import.meta,
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
switch (cli.input[0]) {
|
|
43
|
+
case "config_rewrite":
|
|
44
|
+
rewrite(cli)
|
|
45
|
+
break;
|
|
46
|
+
case "import_db":
|
|
47
|
+
importDB(cli)
|
|
48
|
+
break;
|
|
49
|
+
case "download_db":
|
|
50
|
+
downloadDB(cli)
|
|
51
|
+
break;
|
|
52
|
+
case "t003_rewrite":
|
|
53
|
+
t003Rewrite(cli)
|
|
54
|
+
break;
|
|
55
|
+
case "adb_bridge":
|
|
56
|
+
adb_bridge()
|
|
57
|
+
break;
|
|
58
|
+
case "adb_intent":
|
|
59
|
+
adb_intent()
|
|
60
|
+
break;
|
|
61
|
+
case "set_cli_config":
|
|
62
|
+
writeCLIConfig()
|
|
63
|
+
break;
|
|
64
|
+
case "dump_table_to_csv":
|
|
65
|
+
dumpTableToCSV()
|
|
66
|
+
break;
|
|
67
|
+
case "csv_merge":
|
|
68
|
+
csvMerge();
|
|
69
|
+
break;
|
|
70
|
+
case "graphql_schema_export":
|
|
71
|
+
graphqlSchemaExport();
|
|
72
|
+
break;
|
|
73
|
+
case "dump_db_mand":
|
|
74
|
+
dumpDBMand(cli);
|
|
75
|
+
break;
|
|
76
|
+
case "dump_db":
|
|
77
|
+
dumpDB(cli);
|
|
78
|
+
break;
|
|
79
|
+
case "delete_db_mand":
|
|
80
|
+
deleteDBMand();
|
|
81
|
+
break;
|
|
82
|
+
case "extd_search":
|
|
83
|
+
extdSearch();
|
|
84
|
+
break;
|
|
85
|
+
case "sync_config":
|
|
86
|
+
syncConfig();
|
|
87
|
+
break;
|
|
88
|
+
case "bundle_product":
|
|
89
|
+
bundleProduct(cli);
|
|
90
|
+
break;
|
|
91
|
+
default:
|
|
92
|
+
cli.showHelp()
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
|
package/src/modules/adbBridge.js
CHANGED
|
@@ -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
|
}
|