trm-core 4.0.3 → 4.0.5

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.
@@ -33,8 +33,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
33
33
  };
34
34
  Object.defineProperty(exports, "__esModule", { value: true });
35
35
  exports.CliInquirer = void 0;
36
- const cliInquirer = __importStar(require("inquirer"));
37
36
  const logger_1 = require("../logger");
37
+ const cliInquirer = __importStar(require("@inquirer/prompts"));
38
38
  class CliInquirer {
39
39
  constructor() { }
40
40
  prompt(arg1) {
@@ -42,7 +42,39 @@ class CliInquirer {
42
42
  if (logger_1.Logger.logger instanceof logger_1.CliLogger || logger_1.Logger.logger instanceof logger_1.CliLogFileLogger) {
43
43
  logger_1.Logger.logger.forceStop();
44
44
  }
45
- return yield cliInquirer.default.prompt(arg1);
45
+ var aQuestions;
46
+ var hash = {};
47
+ if (!Array.isArray(arg1)) {
48
+ aQuestions = [arg1];
49
+ }
50
+ else {
51
+ aQuestions = arg1;
52
+ }
53
+ for (var question of aQuestions) {
54
+ if (question.type === 'list') {
55
+ question.type = 'select';
56
+ }
57
+ if (cliInquirer[question.type]) {
58
+ var prompt;
59
+ if (question.when === undefined) {
60
+ prompt = true;
61
+ }
62
+ else if (typeof (question.when) === 'boolean') {
63
+ prompt = question.when;
64
+ }
65
+ else {
66
+ prompt = yield question.when(hash);
67
+ }
68
+ if (prompt) {
69
+ const oResponse = yield cliInquirer[question.type](question);
70
+ hash[question.name] = oResponse;
71
+ }
72
+ }
73
+ else {
74
+ throw new Error(`Unknown CLI inquirer type "${question.type}".`);
75
+ }
76
+ }
77
+ return hash;
46
78
  });
47
79
  }
48
80
  }
@@ -130,7 +130,7 @@ class ServerSystemConnector {
130
130
  var aTrkorrStatusCheck;
131
131
  try {
132
132
  logger_1.Logger.log(`Checking ${sTrkorr} TMS import result`, true);
133
- aTrkorrStatusCheck = (yield this.readTable('TMSBUFFER', [{ fieldName: 'TRKORR' }, { fieldName: 'MAXRC' }], `SYSNAM EQ '${this.getDest()}' AND TRKORR EQ '${sTrkorr}' AND IMPSING NE 'X'`)).filter(o => parseInt(o.maxrc) <= 4);
133
+ aTrkorrStatusCheck = (yield this.readTable('TMSBUFFER', [{ fieldName: 'TRKORR' }, { fieldName: 'MAXRC' }], `SYSNAM EQ '${this.getDest()}' AND TRKORR EQ '${sTrkorr}' AND IMPSING NE 'X'`)).filter(o => parseInt(o.maxrc) > 0);
134
134
  }
135
135
  catch (e) {
136
136
  aTrkorrStatusCheck = [];
@@ -108,7 +108,6 @@ class TrmPackage {
108
108
  const readme = data.readme || '';
109
109
  logger_1.Logger.loading(`Publishing "${packageName}" ${packageVersion} to registry "${this.registry.name}"...`, false);
110
110
  yield this.registry.publishArtifact(packageName, packageVersion, artifact, readme);
111
- logger_1.Logger.success(`"${packageName}" ${packageVersion} published.`, false);
112
111
  this.manifest = new manifest_1.Manifest(trmManifest);
113
112
  return this;
114
113
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trm-core",
3
- "version": "4.0.3",
3
+ "version": "4.0.5",
4
4
  "description": "TRM (Transport Request Manager) Core",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -29,6 +29,7 @@
29
29
  "license": "MIT",
30
30
  "dependencies": {
31
31
  "@esm2cjs/normalize-url": "^8.0.0",
32
+ "@inquirer/prompts": "^5.1.1",
32
33
  "@simonegaffurini/sammarksworkflow": "^1.3.2-fork",
33
34
  "adm-zip": "^0.5.10",
34
35
  "axios": "^1.4.0",
@@ -38,7 +39,6 @@
38
39
  "email-validator": "^2.0.4",
39
40
  "express": "^4.18.2",
40
41
  "get-stack-trace": "^3.1.1",
41
- "inquirer": "^8.0.0",
42
42
  "loading-cli": "^1.1.0",
43
43
  "lodash": "^4.17.21",
44
44
  "node-r3trans": "^1.0.10",