trm-client 6.1.1 → 7.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.
- package/LICENSE +20 -20
- package/README.md +65 -65
- package/changelog.txt +179 -165
- package/dist/command/AbstractCommand.d.ts +42 -0
- package/dist/command/AbstractCommand.js +418 -0
- package/dist/command/InquirerType.d.ts +3 -0
- package/dist/command/InquirerType.js +7 -0
- package/dist/{utils/executeCommand.d.ts → command/LoggerType.d.ts} +0 -4
- package/dist/command/LoggerType.js +11 -0
- package/dist/{utils/registerCommand.d.ts → command/RegisterCommandOpts.d.ts} +4 -3
- package/dist/command/implementations/Alias.d.ts +8 -0
- package/dist/command/implementations/Alias.js +172 -0
- package/dist/command/implementations/Compare.d.ts +7 -0
- package/dist/command/implementations/Compare.js +133 -0
- package/dist/command/implementations/Content.d.ts +5 -0
- package/dist/command/implementations/Content.js +195 -0
- package/dist/command/implementations/Deprecate.d.ts +5 -0
- package/dist/command/implementations/Deprecate.js +33 -0
- package/dist/command/implementations/DistTag.d.ts +5 -0
- package/dist/command/implementations/DistTag.js +48 -0
- package/dist/command/implementations/FindDependencies.d.ts +5 -0
- package/dist/command/implementations/FindDependencies.js +42 -0
- package/dist/command/implementations/Info.d.ts +11 -0
- package/dist/command/implementations/Info.js +245 -0
- package/dist/command/implementations/Install.d.ts +13 -0
- package/dist/command/implementations/Install.js +201 -0
- package/dist/command/implementations/List.d.ts +5 -0
- package/dist/command/implementations/List.js +116 -0
- package/dist/command/implementations/Lock.d.ts +5 -0
- package/dist/command/implementations/Lock.js +40 -0
- package/dist/command/implementations/Login.d.ts +5 -0
- package/dist/command/implementations/Login.js +66 -0
- package/dist/command/implementations/Logout.d.ts +5 -0
- package/dist/command/implementations/Logout.js +37 -0
- package/dist/command/implementations/Ping.d.ts +5 -0
- package/dist/{commands/findDependencies.js → command/implementations/Ping.js} +15 -16
- package/dist/command/implementations/Publish.d.ts +6 -0
- package/dist/command/implementations/Publish.js +145 -0
- package/dist/command/implementations/Registry.d.ts +5 -0
- package/dist/command/implementations/Registry.js +88 -0
- package/dist/command/implementations/Settings.d.ts +5 -0
- package/dist/command/implementations/Settings.js +42 -0
- package/dist/command/implementations/Unpublish.d.ts +5 -0
- package/dist/command/implementations/Unpublish.js +34 -0
- package/dist/command/implementations/View.d.ts +9 -0
- package/dist/command/implementations/View.js +237 -0
- package/dist/command/implementations/WhoAmI.d.ts +5 -0
- package/dist/command/implementations/WhoAmI.js +36 -0
- package/dist/command/implementations/index.d.ts +19 -0
- package/dist/command/implementations/index.js +35 -0
- package/dist/command/index.d.ts +4 -0
- package/dist/{commands/commons → command}/index.js +4 -2
- package/dist/{commands/arguments/ConnectArguments.d.ts → command/prompts/connect.d.ts} +2 -0
- package/dist/{commands → command}/prompts/connect.js +3 -3
- package/dist/command/prompts/createAlias.d.ts +1 -0
- package/dist/{commands → command/prompts}/createAlias.js +8 -8
- package/dist/command/prompts/deleteAlias.d.ts +1 -0
- package/dist/{commands → command/prompts}/deleteAlias.js +3 -4
- package/dist/command/prompts/index.d.ts +4 -0
- package/dist/{commands → command}/prompts/index.js +2 -0
- package/dist/index.js +34 -278
- package/dist/registryAlias/RegistryAlias.js +1 -1
- package/dist/systemAlias/SystemAlias.js +4 -4
- package/dist/utils/{Context.d.ts → GlobalContext.d.ts} +3 -3
- package/dist/utils/{Context.js → GlobalContext.js} +6 -6
- package/dist/utils/checkCliUpdate.d.ts +3 -2
- package/dist/utils/checkCliUpdate.js +3 -3
- package/dist/utils/getSapLogonConnections.js +3 -3
- package/dist/utils/index.d.ts +1 -4
- package/dist/utils/index.js +1 -4
- package/package.json +67 -65
- package/dist/commands/addRegistry.d.ts +0 -2
- package/dist/commands/addRegistry.js +0 -66
- package/dist/commands/alias.d.ts +0 -2
- package/dist/commands/alias.js +0 -156
- package/dist/commands/arguments/AddRegistryArguments.d.ts +0 -5
- package/dist/commands/arguments/AliasArguments.d.ts +0 -3
- package/dist/commands/arguments/AliasArguments.js +0 -2
- package/dist/commands/arguments/CheckArguments.d.ts +0 -4
- package/dist/commands/arguments/CheckArguments.js +0 -2
- package/dist/commands/arguments/CompareArguments.d.ts +0 -4
- package/dist/commands/arguments/CompareArguments.js +0 -2
- package/dist/commands/arguments/ConnectArguments.js +0 -2
- package/dist/commands/arguments/ContentArguments.d.ts +0 -6
- package/dist/commands/arguments/ContentArguments.js +0 -2
- package/dist/commands/arguments/CreateAliasArguments.d.ts +0 -3
- package/dist/commands/arguments/CreateAliasArguments.js +0 -2
- package/dist/commands/arguments/DeleteAliasArguments.d.ts +0 -3
- package/dist/commands/arguments/DeleteAliasArguments.js +0 -2
- package/dist/commands/arguments/FindDependenciesArguments.d.ts +0 -5
- package/dist/commands/arguments/FindDependenciesArguments.js +0 -2
- package/dist/commands/arguments/ImportArguments.d.ts +0 -19
- package/dist/commands/arguments/ImportArguments.js +0 -2
- package/dist/commands/arguments/InfoArguments.d.ts +0 -1
- package/dist/commands/arguments/InfoArguments.js +0 -2
- package/dist/commands/arguments/InstallArguments.d.ts +0 -20
- package/dist/commands/arguments/InstallArguments.js +0 -2
- package/dist/commands/arguments/ListArguments.d.ts +0 -3
- package/dist/commands/arguments/ListArguments.js +0 -2
- package/dist/commands/arguments/LockArguments.d.ts +0 -4
- package/dist/commands/arguments/LockArguments.js +0 -2
- package/dist/commands/arguments/LoginArguments.d.ts +0 -4
- package/dist/commands/arguments/LoginArguments.js +0 -2
- package/dist/commands/arguments/LogoutArguments.d.ts +0 -1
- package/dist/commands/arguments/LogoutArguments.js +0 -2
- package/dist/commands/arguments/PackArguments.d.ts +0 -22
- package/dist/commands/arguments/PackArguments.js +0 -2
- package/dist/commands/arguments/PingArguments.d.ts +0 -1
- package/dist/commands/arguments/PingArguments.js +0 -2
- package/dist/commands/arguments/PublishArguments.d.ts +0 -24
- package/dist/commands/arguments/PublishArguments.js +0 -2
- package/dist/commands/arguments/RemoveRegistryArguments.d.ts +0 -4
- package/dist/commands/arguments/RemoveRegistryArguments.js +0 -2
- package/dist/commands/arguments/SettingsArgument.d.ts +0 -3
- package/dist/commands/arguments/SettingsArgument.js +0 -2
- package/dist/commands/arguments/UnpublishArguments.d.ts +0 -4
- package/dist/commands/arguments/UnpublishArguments.js +0 -2
- package/dist/commands/arguments/UpdateArguments.d.ts +0 -2
- package/dist/commands/arguments/UpdateArguments.js +0 -2
- package/dist/commands/arguments/ViewArguments.d.ts +0 -3
- package/dist/commands/arguments/ViewArguments.js +0 -2
- package/dist/commands/arguments/WhoAmIArguments.d.ts +0 -1
- package/dist/commands/arguments/WhoAmIArguments.js +0 -2
- package/dist/commands/arguments/index.d.ts +0 -24
- package/dist/commands/arguments/index.js +0 -40
- package/dist/commands/check.d.ts +0 -2
- package/dist/commands/check.js +0 -87
- package/dist/commands/commons/CommandContext.d.ts +0 -9
- package/dist/commands/commons/CommandContext.js +0 -41
- package/dist/commands/commons/index.d.ts +0 -2
- package/dist/commands/commons/viewRegistryPackage.d.ts +0 -2
- package/dist/commands/commons/viewRegistryPackage.js +0 -48
- package/dist/commands/compare.d.ts +0 -2
- package/dist/commands/compare.js +0 -167
- package/dist/commands/content.d.ts +0 -2
- package/dist/commands/content.js +0 -182
- package/dist/commands/createAlias.d.ts +0 -2
- package/dist/commands/deleteAlias.d.ts +0 -2
- package/dist/commands/findDependencies.d.ts +0 -2
- package/dist/commands/import.d.ts +0 -2
- package/dist/commands/import.js +0 -84
- package/dist/commands/index.d.ts +0 -27
- package/dist/commands/index.js +0 -43
- package/dist/commands/info.d.ts +0 -2
- package/dist/commands/info.js +0 -233
- package/dist/commands/install.d.ts +0 -2
- package/dist/commands/install.js +0 -85
- package/dist/commands/list.d.ts +0 -2
- package/dist/commands/list.js +0 -70
- package/dist/commands/lock.d.ts +0 -2
- package/dist/commands/lock.js +0 -64
- package/dist/commands/login.d.ts +0 -2
- package/dist/commands/login.js +0 -59
- package/dist/commands/logout.d.ts +0 -2
- package/dist/commands/logout.js +0 -27
- package/dist/commands/pack.d.ts +0 -2
- package/dist/commands/pack.js +0 -95
- package/dist/commands/ping.d.ts +0 -2
- package/dist/commands/ping.js +0 -21
- package/dist/commands/prompts/connect.d.ts +0 -3
- package/dist/commands/prompts/index.d.ts +0 -2
- package/dist/commands/publish.d.ts +0 -2
- package/dist/commands/publish.js +0 -128
- package/dist/commands/removeRegistry.d.ts +0 -2
- package/dist/commands/removeRegistry.js +0 -36
- package/dist/commands/selfUpdate.d.ts +0 -1
- package/dist/commands/selfUpdate.js +0 -77
- package/dist/commands/settings.d.ts +0 -2
- package/dist/commands/settings.js +0 -32
- package/dist/commands/unpublish.d.ts +0 -2
- package/dist/commands/unpublish.js +0 -61
- package/dist/commands/update.d.ts +0 -2
- package/dist/commands/update.js +0 -20
- package/dist/commands/view.d.ts +0 -2
- package/dist/commands/view.js +0 -219
- package/dist/commands/whoami.d.ts +0 -2
- package/dist/commands/whoami.js +0 -34
- package/dist/utils/checkTrmDependencies.d.ts +0 -1
- package/dist/utils/checkTrmDependencies.js +0 -43
- package/dist/utils/executeCommand.js +0 -213
- package/dist/utils/registerCommand.js +0 -93
- /package/dist/{commands/arguments/AddRegistryArguments.js → command/RegisterCommandOpts.js} +0 -0
- /package/dist/{commands → command}/prompts/pickRegistry.d.ts +0 -0
- /package/dist/{commands → command}/prompts/pickRegistry.js +0 -0
package/dist/commands/check.js
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.check = check;
|
|
13
|
-
const trm_core_1 = require("trm-core");
|
|
14
|
-
const commons_1 = require("./commons");
|
|
15
|
-
const trm_commons_1 = require("trm-commons");
|
|
16
|
-
var systemPackages = [];
|
|
17
|
-
const _dependencies = (oPackage) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
-
trm_commons_1.Logger.loading(`Analyzing package dependencies...`);
|
|
19
|
-
const packages = yield commons_1.CommandContext.getSystemPackages();
|
|
20
|
-
yield (0, trm_core_1.checkPackageDependencies)({
|
|
21
|
-
contextData: {
|
|
22
|
-
systemPackages: packages
|
|
23
|
-
},
|
|
24
|
-
packageData: {
|
|
25
|
-
manifest: oPackage.manifest.get()
|
|
26
|
-
},
|
|
27
|
-
printOptions: {
|
|
28
|
-
dependencyStatus: true,
|
|
29
|
-
information: true
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
const _sapEntries = (oPackage) => __awaiter(void 0, void 0, void 0, function* () {
|
|
34
|
-
trm_commons_1.Logger.loading(`Analyzing package SAP Entries...`);
|
|
35
|
-
yield (0, trm_core_1.checkSapEntries)({
|
|
36
|
-
packageData: {
|
|
37
|
-
manifest: oPackage.manifest.get()
|
|
38
|
-
},
|
|
39
|
-
printOptions: {
|
|
40
|
-
entriesStatus: true,
|
|
41
|
-
information: true
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
function check(commandArgs) {
|
|
46
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
-
const packageName = commandArgs.package;
|
|
48
|
-
const analysisTypes = [{
|
|
49
|
-
name: `Dependencies only`,
|
|
50
|
-
value: `DEPENDENCIES`
|
|
51
|
-
}, {
|
|
52
|
-
name: `SAP Entries only`,
|
|
53
|
-
value: `SAPENTRIES`
|
|
54
|
-
}, {
|
|
55
|
-
name: `All`,
|
|
56
|
-
value: `ALL`
|
|
57
|
-
}];
|
|
58
|
-
var analysisType = commandArgs.analysisType;
|
|
59
|
-
if (!analysisType || !analysisTypes.map(o => o.value).includes(analysisType)) {
|
|
60
|
-
const inq1 = yield trm_commons_1.Inquirer.prompt({
|
|
61
|
-
message: `Analysis type`,
|
|
62
|
-
name: `analysisType`,
|
|
63
|
-
type: `list`,
|
|
64
|
-
choices: analysisTypes
|
|
65
|
-
});
|
|
66
|
-
analysisType = inq1.analysisType;
|
|
67
|
-
}
|
|
68
|
-
trm_commons_1.Logger.loading(`Searching package "${packageName}"...`);
|
|
69
|
-
systemPackages = yield commons_1.CommandContext.getSystemPackages();
|
|
70
|
-
const oPackage = systemPackages.find(o => o.compareName(packageName) && o.compareRegistry(commons_1.CommandContext.getRegistry()));
|
|
71
|
-
if (!oPackage) {
|
|
72
|
-
throw new Error(`Package "${packageName}" not found.`);
|
|
73
|
-
}
|
|
74
|
-
switch (analysisType) {
|
|
75
|
-
case `DEPENDENCIES`:
|
|
76
|
-
yield _dependencies(oPackage);
|
|
77
|
-
break;
|
|
78
|
-
case `SAPENTRIES`:
|
|
79
|
-
yield _sapEntries(oPackage);
|
|
80
|
-
break;
|
|
81
|
-
default:
|
|
82
|
-
yield _dependencies(oPackage);
|
|
83
|
-
yield _sapEntries(oPackage);
|
|
84
|
-
break;
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { AbstractRegistry, TrmPackage } from "trm-core";
|
|
2
|
-
export declare namespace CommandContext {
|
|
3
|
-
var registry: AbstractRegistry;
|
|
4
|
-
var hasRegistryAuthData: boolean;
|
|
5
|
-
var trmDependencies: TrmPackage[];
|
|
6
|
-
var missingTrmDependencies: (TrmPackage | string)[];
|
|
7
|
-
function getRegistry(): AbstractRegistry;
|
|
8
|
-
function getSystemPackages(): Promise<TrmPackage[]>;
|
|
9
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.CommandContext = void 0;
|
|
13
|
-
const trm_commons_1 = require("trm-commons");
|
|
14
|
-
const trm_core_1 = require("trm-core");
|
|
15
|
-
var CommandContext;
|
|
16
|
-
(function (CommandContext) {
|
|
17
|
-
var _systemPackages = undefined;
|
|
18
|
-
CommandContext.registry = undefined;
|
|
19
|
-
CommandContext.hasRegistryAuthData = false;
|
|
20
|
-
CommandContext.trmDependencies = [];
|
|
21
|
-
CommandContext.missingTrmDependencies = [];
|
|
22
|
-
function getRegistry() {
|
|
23
|
-
if (!CommandContext.registry) {
|
|
24
|
-
throw new Error('Registry not initialized.');
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
return CommandContext.registry;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
CommandContext.getRegistry = getRegistry;
|
|
31
|
-
function getSystemPackages() {
|
|
32
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
if (!this._systemPackages) {
|
|
34
|
-
trm_commons_1.Logger.loading(`Reading system packages...`);
|
|
35
|
-
this._systemPackages = yield trm_core_1.SystemConnector.getInstalledPackages(true, true, true);
|
|
36
|
-
}
|
|
37
|
-
return this._systemPackages;
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
CommandContext.getSystemPackages = getSystemPackages;
|
|
41
|
-
})(CommandContext || (exports.CommandContext = CommandContext = {}));
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.viewRegistryPackage = viewRegistryPackage;
|
|
16
|
-
const CommandContext_1 = require("./CommandContext");
|
|
17
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
18
|
-
const trm_commons_1 = require("trm-commons");
|
|
19
|
-
function viewRegistryPackage(packageName_1) {
|
|
20
|
-
return __awaiter(this, arguments, void 0, function* (packageName, print = true) {
|
|
21
|
-
trm_commons_1.Logger.loading(`Reading registry data...`);
|
|
22
|
-
var oRegistryView;
|
|
23
|
-
try {
|
|
24
|
-
oRegistryView = yield CommandContext_1.CommandContext.getRegistry().getPackage(packageName, 'latest');
|
|
25
|
-
}
|
|
26
|
-
catch (e) {
|
|
27
|
-
trm_commons_1.Logger.error(e, true);
|
|
28
|
-
oRegistryView = null;
|
|
29
|
-
}
|
|
30
|
-
if (print) {
|
|
31
|
-
if (!oRegistryView) {
|
|
32
|
-
trm_commons_1.Logger.warning(`${chalk_1.default.bold('WARNING')}: This package was not found on the registry.`);
|
|
33
|
-
trm_commons_1.Logger.warning(`${chalk_1.default.bold('WARNING')}: This package may have been deleted!`);
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
if (oRegistryView.deprecated) {
|
|
37
|
-
if (oRegistryView.deprecated_message) {
|
|
38
|
-
trm_commons_1.Logger.warning(`${chalk_1.default.bold('WARNING deprecate')}: ${oRegistryView.deprecated_message}`);
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
trm_commons_1.Logger.warning(`${chalk_1.default.bold('WARNING deprecate')}: v${oRegistryView.manifest.version} is deprecated`);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return oRegistryView;
|
|
47
|
-
});
|
|
48
|
-
}
|
package/dist/commands/compare.js
DELETED
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
-
exports.compare = compare;
|
|
46
|
-
const fs = __importStar(require("fs"));
|
|
47
|
-
const systemAlias_1 = require("../systemAlias");
|
|
48
|
-
const prompts_1 = require("./prompts");
|
|
49
|
-
const commons_1 = require("./commons");
|
|
50
|
-
const trm_core_1 = require("trm-core");
|
|
51
|
-
const trm_commons_1 = require("trm-commons");
|
|
52
|
-
const _promptConnections = (aConnections) => __awaiter(void 0, void 0, void 0, function* () {
|
|
53
|
-
if (aConnections.length > 0) {
|
|
54
|
-
trm_commons_1.Logger.info(`Compare systems: ${aConnections.map(o => o.getDest()).join(', ')}`);
|
|
55
|
-
}
|
|
56
|
-
var askConnection = true;
|
|
57
|
-
const inq1 = yield trm_commons_1.Inquirer.prompt([{
|
|
58
|
-
message: "Add another connection?",
|
|
59
|
-
name: "continue",
|
|
60
|
-
type: "confirm",
|
|
61
|
-
default: true,
|
|
62
|
-
when: aConnections.length > 0
|
|
63
|
-
}]);
|
|
64
|
-
askConnection = inq1.continue !== undefined ? inq1.continue : askConnection;
|
|
65
|
-
if (askConnection) {
|
|
66
|
-
const connectArgs = yield (0, prompts_1.connect)({}, false, false);
|
|
67
|
-
const systemConnector = connectArgs.getSystemConnector();
|
|
68
|
-
yield systemConnector.connect();
|
|
69
|
-
aConnections.push(systemConnector);
|
|
70
|
-
}
|
|
71
|
-
return {
|
|
72
|
-
continue: askConnection,
|
|
73
|
-
connections: aConnections
|
|
74
|
-
};
|
|
75
|
-
});
|
|
76
|
-
function compare(commandArgs) {
|
|
77
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
78
|
-
const packageName = commandArgs.package;
|
|
79
|
-
const registry = commons_1.CommandContext.getRegistry();
|
|
80
|
-
var inputConnections = commandArgs.connections;
|
|
81
|
-
var aConnections = [];
|
|
82
|
-
if (inputConnections) {
|
|
83
|
-
inputConnections = inputConnections.trim();
|
|
84
|
-
var sInputConnections;
|
|
85
|
-
var aInputConnections;
|
|
86
|
-
if (inputConnections[0] === '[') {
|
|
87
|
-
sInputConnections = inputConnections;
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
aInputConnections = fs.readFileSync(inputConnections);
|
|
91
|
-
}
|
|
92
|
-
try {
|
|
93
|
-
aInputConnections = JSON.parse(sInputConnections);
|
|
94
|
-
}
|
|
95
|
-
catch (e) {
|
|
96
|
-
throw new Error('Input connections: invalid JSON format.');
|
|
97
|
-
}
|
|
98
|
-
for (const sAlias of aInputConnections) {
|
|
99
|
-
const oAlias = systemAlias_1.SystemAlias.get(sAlias);
|
|
100
|
-
const oConnection = oAlias.getConnection();
|
|
101
|
-
aConnections.push(oConnection);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
if (aConnections.length === 0) {
|
|
105
|
-
var keepPrompt = true;
|
|
106
|
-
while (keepPrompt) {
|
|
107
|
-
const oPromptRes = yield _promptConnections(aConnections);
|
|
108
|
-
keepPrompt = oPromptRes.continue;
|
|
109
|
-
aConnections = oPromptRes.connections;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
trm_commons_1.Logger.info(`Compare systems: ${aConnections.map(o => o.getDest()).join(', ')}`);
|
|
113
|
-
const tableHead = [`System`, `Installed`, `Version`, `Devclass`, `Import transport`];
|
|
114
|
-
var tableData = [];
|
|
115
|
-
trm_commons_1.Logger.loading(`Reading registry data...`);
|
|
116
|
-
var oRegistryView;
|
|
117
|
-
try {
|
|
118
|
-
oRegistryView = yield (0, commons_1.viewRegistryPackage)(packageName, true);
|
|
119
|
-
}
|
|
120
|
-
catch (e) { }
|
|
121
|
-
trm_commons_1.Logger.loading(`Reading system data...`);
|
|
122
|
-
for (const oConnection of aConnections) {
|
|
123
|
-
trm_core_1.SystemConnector.systemConnector = oConnection;
|
|
124
|
-
const system = trm_core_1.SystemConnector.getDest() || '';
|
|
125
|
-
var installed;
|
|
126
|
-
var version;
|
|
127
|
-
var devclass;
|
|
128
|
-
var importTransport;
|
|
129
|
-
const aSystemPackages = yield trm_core_1.SystemConnector.getInstalledPackages(true);
|
|
130
|
-
const oSystemView = aSystemPackages.find(o => o.compareName(packageName) && o.compareRegistry(registry));
|
|
131
|
-
if (oSystemView && oSystemView.manifest) {
|
|
132
|
-
installed = 'Yes';
|
|
133
|
-
version = oSystemView.manifest.get().version || 'Unknown';
|
|
134
|
-
devclass = oSystemView.getDevclass() || 'Unknown';
|
|
135
|
-
if (oSystemView.manifest.getLinkedTransport()) {
|
|
136
|
-
importTransport = oSystemView.manifest.getLinkedTransport().trkorr;
|
|
137
|
-
}
|
|
138
|
-
else {
|
|
139
|
-
importTransport = 'Unknown';
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
else {
|
|
143
|
-
installed = 'No';
|
|
144
|
-
version = '';
|
|
145
|
-
devclass = '';
|
|
146
|
-
importTransport = '';
|
|
147
|
-
}
|
|
148
|
-
tableData.push([
|
|
149
|
-
system,
|
|
150
|
-
installed,
|
|
151
|
-
version,
|
|
152
|
-
devclass,
|
|
153
|
-
importTransport
|
|
154
|
-
]);
|
|
155
|
-
}
|
|
156
|
-
trm_commons_1.Logger.info(`Package name: ${packageName}`);
|
|
157
|
-
trm_commons_1.Logger.info(`Registry: ${registry.name}`);
|
|
158
|
-
try {
|
|
159
|
-
trm_commons_1.Logger.info(`Latest version: ${oRegistryView.latest}`);
|
|
160
|
-
}
|
|
161
|
-
catch (e) {
|
|
162
|
-
trm_commons_1.Logger.warning(`Latest version: Unknown`);
|
|
163
|
-
}
|
|
164
|
-
trm_commons_1.Logger.log(`\n`);
|
|
165
|
-
trm_commons_1.Logger.table(tableHead, tableData);
|
|
166
|
-
});
|
|
167
|
-
}
|
package/dist/commands/content.js
DELETED
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.content = content;
|
|
16
|
-
const commons_1 = require("./commons");
|
|
17
|
-
const utils_1 = require("../utils");
|
|
18
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
19
|
-
const trm_commons_1 = require("trm-commons");
|
|
20
|
-
function content(commandArgs) {
|
|
21
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
var transports = {};
|
|
23
|
-
var aNodes = [];
|
|
24
|
-
var iOtherEntries = 0;
|
|
25
|
-
trm_commons_1.Logger.loading(`Searching package "${commandArgs.package}"...`);
|
|
26
|
-
const data = yield commons_1.CommandContext.getRegistry().getPackage(commandArgs.package, commandArgs.version);
|
|
27
|
-
const artifact = yield commons_1.CommandContext.getRegistry().downloadArtifact(commandArgs.package, commandArgs.version);
|
|
28
|
-
trm_commons_1.Logger.loading(`Reading content...`);
|
|
29
|
-
const packageContent = yield artifact.getContent({
|
|
30
|
-
tempDirPath: (0, utils_1.getTempFolder)(),
|
|
31
|
-
r3transDirPath: commandArgs.r3transPath,
|
|
32
|
-
useDocker: utils_1.Context.getInstance().getSettings().r3transDocker,
|
|
33
|
-
dockerOptions: {
|
|
34
|
-
name: utils_1.Context.getInstance().getSettings().r3transDockerName
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
if (!commandArgs.all) {
|
|
38
|
-
transports.TADIR = packageContent.TADIR.trkorr;
|
|
39
|
-
aNodes.push({
|
|
40
|
-
tableName: 'TADIR',
|
|
41
|
-
content: packageContent.TADIR.content.TADIR
|
|
42
|
-
});
|
|
43
|
-
Object.keys(packageContent).forEach(type => {
|
|
44
|
-
if (type === 'TADIR') {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
Object.keys(packageContent[type].content).forEach(tableName => {
|
|
48
|
-
iOtherEntries += packageContent[type].content[tableName].length;
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
Object.keys(packageContent).forEach(type => {
|
|
54
|
-
transports[type] = packageContent[type].trkorr;
|
|
55
|
-
Object.keys(packageContent[type].content).forEach(tableName => {
|
|
56
|
-
var nodeIndex = aNodes.findIndex(o => o.tableName === tableName);
|
|
57
|
-
if (nodeIndex < 0) {
|
|
58
|
-
nodeIndex = (aNodes.push({
|
|
59
|
-
tableName,
|
|
60
|
-
content: []
|
|
61
|
-
})) - 1;
|
|
62
|
-
}
|
|
63
|
-
aNodes[nodeIndex].content = aNodes[nodeIndex].content.concat(packageContent[type].content[tableName].map(o => {
|
|
64
|
-
o.__isDevc = type === 'DEVC';
|
|
65
|
-
o.__isLang = type === 'LANG';
|
|
66
|
-
o.__isCust = type === 'CUST';
|
|
67
|
-
return o;
|
|
68
|
-
}));
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
var tree = {
|
|
73
|
-
text: `${chalk_1.default.bold(commandArgs.package)} v${data.manifest.version} content`,
|
|
74
|
-
children: []
|
|
75
|
-
};
|
|
76
|
-
aNodes.forEach(node => {
|
|
77
|
-
if (node.content.length > 0) {
|
|
78
|
-
var tableNode = {
|
|
79
|
-
text: `${chalk_1.default.bold(node.tableName)} (${node.content.length} record${node.content.length > 1 ? 's' : ''})`,
|
|
80
|
-
children: []
|
|
81
|
-
};
|
|
82
|
-
node.content.forEach(record => {
|
|
83
|
-
var sRecord = [];
|
|
84
|
-
Object.keys(record).filter(k => !k.startsWith('__')).forEach(field => {
|
|
85
|
-
var fieldValue = record[field];
|
|
86
|
-
if (field && fieldValue) {
|
|
87
|
-
if (node.tableName === 'TADIR') {
|
|
88
|
-
if (field === 'SRCSYSTEM') {
|
|
89
|
-
fieldValue = chalk_1.default.strikethrough(fieldValue);
|
|
90
|
-
}
|
|
91
|
-
else if (field === 'DEVCLASS') {
|
|
92
|
-
fieldValue = chalk_1.default.italic(fieldValue);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
sRecord.push(`${chalk_1.default.bold(field)}: ${fieldValue}`);
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
if (sRecord.length > 0) {
|
|
99
|
-
if (record.__isDevc) {
|
|
100
|
-
tableNode.children.push({
|
|
101
|
-
text: chalk_1.default.bgGrey(sRecord.join(', ')),
|
|
102
|
-
children: []
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
else if (record.__isLang) {
|
|
106
|
-
tableNode.children.push({
|
|
107
|
-
text: chalk_1.default.bgGreen(sRecord.join(', ')),
|
|
108
|
-
children: []
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
else if (record.__isCust) {
|
|
112
|
-
tableNode.children.push({
|
|
113
|
-
text: chalk_1.default.bgYellow(sRecord.join(', ')),
|
|
114
|
-
children: []
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
tableNode.children.push({
|
|
119
|
-
text: sRecord.join(', '),
|
|
120
|
-
children: []
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
tree.children.push(tableNode);
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
trm_commons_1.Logger.tree(tree);
|
|
129
|
-
var header = ['Namespace', 'ABAP Package', 'TRM Transport', 'Customizing', 'Translations'];
|
|
130
|
-
var row1 = [];
|
|
131
|
-
var row2 = [];
|
|
132
|
-
if (data.manifest.namespace) {
|
|
133
|
-
row1.push(`\u2714`);
|
|
134
|
-
row2.push(data.manifest.namespace.replicense);
|
|
135
|
-
}
|
|
136
|
-
else {
|
|
137
|
-
row1.push(`\u274C`);
|
|
138
|
-
row2.push(``);
|
|
139
|
-
}
|
|
140
|
-
if (Object.keys(packageContent).includes('DEVC')) {
|
|
141
|
-
row1.push(`\u2714 ${packageContent['DEVC'].trkorr}`);
|
|
142
|
-
row2.push(`${chalk_1.default.bgGrey('Highlight')}`);
|
|
143
|
-
}
|
|
144
|
-
else {
|
|
145
|
-
row1.push(`\u274C`);
|
|
146
|
-
row2.push(``);
|
|
147
|
-
}
|
|
148
|
-
if (Object.keys(packageContent).includes('TADIR')) {
|
|
149
|
-
row1.push(`\u2714 ${packageContent['TADIR'].trkorr}`);
|
|
150
|
-
row2.push(``);
|
|
151
|
-
}
|
|
152
|
-
else {
|
|
153
|
-
row1.push(`\u274C`);
|
|
154
|
-
row2.push(``);
|
|
155
|
-
}
|
|
156
|
-
if (Object.keys(packageContent).includes('CUST')) {
|
|
157
|
-
row1.push(`\u2714 ${packageContent['CUST'].trkorr}`);
|
|
158
|
-
row2.push(`${chalk_1.default.bgYellow('Highlight')}`);
|
|
159
|
-
}
|
|
160
|
-
else {
|
|
161
|
-
row1.push(`\u274C`);
|
|
162
|
-
row2.push(``);
|
|
163
|
-
}
|
|
164
|
-
if (Object.keys(packageContent).includes('LANG')) {
|
|
165
|
-
row1.push(`\u2714 ${packageContent['LANG'].trkorr}`);
|
|
166
|
-
row2.push(`${chalk_1.default.bgGreen('Highlight')}`);
|
|
167
|
-
}
|
|
168
|
-
else {
|
|
169
|
-
row1.push(`\u274C`);
|
|
170
|
-
row2.push(``);
|
|
171
|
-
}
|
|
172
|
-
if (row2.filter(s => s.length > 0).length > 0) {
|
|
173
|
-
trm_commons_1.Logger.table(header, [row1, row2]);
|
|
174
|
-
}
|
|
175
|
-
else {
|
|
176
|
-
trm_commons_1.Logger.table(header, [row1]);
|
|
177
|
-
}
|
|
178
|
-
if (iOtherEntries > 0) {
|
|
179
|
-
trm_commons_1.Logger.warning(`There are ${iOtherEntries} other records to show. Run with option --all in order to see them.`);
|
|
180
|
-
}
|
|
181
|
-
});
|
|
182
|
-
}
|
package/dist/commands/import.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports._import = _import;
|
|
13
|
-
const trm_core_1 = require("trm-core");
|
|
14
|
-
const utils_1 = require("../utils");
|
|
15
|
-
const commons_1 = require("./commons");
|
|
16
|
-
const trm_commons_1 = require("trm-commons");
|
|
17
|
-
const _parsePackageReplacementsArgument = (arg) => {
|
|
18
|
-
if (arg) {
|
|
19
|
-
try {
|
|
20
|
-
return JSON.parse(arg);
|
|
21
|
-
}
|
|
22
|
-
catch (e) { }
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
const _parseImportTimeoutArg = (arg) => {
|
|
26
|
-
if (arg) {
|
|
27
|
-
try {
|
|
28
|
-
return parseInt(arg);
|
|
29
|
-
}
|
|
30
|
-
catch (e) { }
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
function _import(commandArgs) {
|
|
34
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
-
const registry = new trm_core_1.FileSystem(commandArgs.file);
|
|
36
|
-
const packages = yield commons_1.CommandContext.getSystemPackages();
|
|
37
|
-
const result = yield (0, trm_core_1.install)({
|
|
38
|
-
contextData: {
|
|
39
|
-
r3transOptions: {
|
|
40
|
-
tempDirPath: (0, utils_1.getTempFolder)(),
|
|
41
|
-
r3transDirPath: commandArgs.r3transPath,
|
|
42
|
-
useDocker: utils_1.Context.getInstance().getSettings().r3transDocker,
|
|
43
|
-
dockerOptions: {
|
|
44
|
-
name: utils_1.Context.getInstance().getSettings().r3transDockerName
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
noInquirer: commandArgs.noPrompts,
|
|
48
|
-
systemPackages: packages,
|
|
49
|
-
noR3transInfo: false
|
|
50
|
-
},
|
|
51
|
-
packageData: {
|
|
52
|
-
name: 'dummy',
|
|
53
|
-
overwrite: commandArgs.overwrite,
|
|
54
|
-
registry
|
|
55
|
-
},
|
|
56
|
-
installData: {
|
|
57
|
-
checks: {
|
|
58
|
-
noDependencies: commandArgs.noDependencies,
|
|
59
|
-
noObjectTypes: commandArgs.noObjectTypes,
|
|
60
|
-
noSapEntries: commandArgs.noSapEntries
|
|
61
|
-
},
|
|
62
|
-
import: {
|
|
63
|
-
noLang: commandArgs.noLanguageTransport,
|
|
64
|
-
noCust: commandArgs.noCustomizingTransport,
|
|
65
|
-
timeout: _parseImportTimeoutArg(commandArgs.importTimeout)
|
|
66
|
-
},
|
|
67
|
-
installDevclass: {
|
|
68
|
-
keepOriginal: commandArgs.keepOriginalPackages,
|
|
69
|
-
transportLayer: commandArgs.transportLayer,
|
|
70
|
-
replacements: _parsePackageReplacementsArgument(commandArgs.packageReplacements)
|
|
71
|
-
},
|
|
72
|
-
installTransport: {
|
|
73
|
-
create: commandArgs.createInstallTransport,
|
|
74
|
-
targetSystem: commandArgs.installTransportTargetSys
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
var sOutput = `${result.manifest.name} v${result.manifest.version} installed`;
|
|
79
|
-
if (result.installTransport) {
|
|
80
|
-
sOutput += `, use ${result.installTransport.trkorr} transport in landscape`;
|
|
81
|
-
}
|
|
82
|
-
trm_commons_1.Logger.success(sOutput);
|
|
83
|
-
});
|
|
84
|
-
}
|