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/pack.js
DELETED
|
@@ -1,95 +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.pack = pack;
|
|
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 _parseDependenciesArg = (arg) => {
|
|
18
|
-
if (arg) {
|
|
19
|
-
try {
|
|
20
|
-
return JSON.parse(arg);
|
|
21
|
-
}
|
|
22
|
-
catch (e) { }
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
const _parseSapEntriesArg = (arg) => {
|
|
26
|
-
if (arg) {
|
|
27
|
-
try {
|
|
28
|
-
return JSON.parse(arg);
|
|
29
|
-
}
|
|
30
|
-
catch (e) { }
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
const _parseReleaseTimeoutArg = (arg) => {
|
|
34
|
-
if (arg) {
|
|
35
|
-
try {
|
|
36
|
-
return parseInt(arg);
|
|
37
|
-
}
|
|
38
|
-
catch (e) { }
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
function pack(commandArgs) {
|
|
42
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
-
var outputPath = commandArgs.outputPath;
|
|
44
|
-
if (!outputPath) {
|
|
45
|
-
if (commandArgs.noPrompts) {
|
|
46
|
-
throw new Error(`Provide an output path for the file with option -o (--output). Run with option -h (--help) for more information.`);
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
outputPath = (yield trm_commons_1.Inquirer.prompt({
|
|
50
|
-
message: `Output path`,
|
|
51
|
-
name: 'outputPath',
|
|
52
|
-
type: `input`
|
|
53
|
-
})).outputPath;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
const registry = new trm_core_1.FileSystem(outputPath);
|
|
57
|
-
const packages = yield commons_1.CommandContext.getSystemPackages();
|
|
58
|
-
const result = yield (0, trm_core_1.publish)({
|
|
59
|
-
contextData: {
|
|
60
|
-
logTemporaryFolder: (0, utils_1.getTempFolder)(),
|
|
61
|
-
systemPackages: packages,
|
|
62
|
-
noInquirer: commandArgs.noPrompts
|
|
63
|
-
},
|
|
64
|
-
packageData: {
|
|
65
|
-
name: commandArgs.package,
|
|
66
|
-
version: commandArgs.version,
|
|
67
|
-
devclass: commandArgs.devclass,
|
|
68
|
-
manifest: {
|
|
69
|
-
authors: commandArgs.authors,
|
|
70
|
-
backwardsCompatible: commandArgs.backwardsCompatible,
|
|
71
|
-
description: commandArgs.description,
|
|
72
|
-
git: commandArgs.git,
|
|
73
|
-
keywords: commandArgs.keywords,
|
|
74
|
-
license: commandArgs.license,
|
|
75
|
-
website: commandArgs.website,
|
|
76
|
-
dependencies: _parseDependenciesArg(commandArgs.dependencies),
|
|
77
|
-
sapEntries: _parseSapEntriesArg(commandArgs.sapEntries)
|
|
78
|
-
},
|
|
79
|
-
registry
|
|
80
|
-
},
|
|
81
|
-
publishData: {
|
|
82
|
-
noLanguageTransport: commandArgs.noLanguageTransport,
|
|
83
|
-
noDependenciesDetection: commandArgs.noDependenciesDetection,
|
|
84
|
-
skipCustomizingTransports: commandArgs.skipCustomizingTransports,
|
|
85
|
-
customizingTransports: commandArgs.customizingTransports
|
|
86
|
-
},
|
|
87
|
-
systemData: {
|
|
88
|
-
releaseTimeout: _parseReleaseTimeoutArg(commandArgs.releaseTimeout),
|
|
89
|
-
transportTarget: commandArgs.transportTarget
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
const sOutput = `+ ${result.trmPackage.manifest.get().name} ${result.trmPackage.manifest.get().version} >> ${outputPath}`;
|
|
93
|
-
trm_commons_1.Logger.success(sOutput);
|
|
94
|
-
});
|
|
95
|
-
}
|
package/dist/commands/ping.d.ts
DELETED
package/dist/commands/ping.js
DELETED
|
@@ -1,21 +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.ping = ping;
|
|
13
|
-
const trm_core_1 = require("trm-core");
|
|
14
|
-
const trm_commons_1 = require("trm-commons");
|
|
15
|
-
function ping(commandArgs) {
|
|
16
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
-
trm_commons_1.Logger.loading(`Pinging trm-server on ${trm_core_1.SystemConnector.getDest()}...`);
|
|
18
|
-
const pingValue = yield trm_core_1.SystemConnector.ping();
|
|
19
|
-
trm_commons_1.Logger.info(pingValue);
|
|
20
|
-
});
|
|
21
|
-
}
|
package/dist/commands/publish.js
DELETED
|
@@ -1,128 +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.publish = publish;
|
|
46
|
-
const trm_core_1 = require("trm-core");
|
|
47
|
-
const fs = __importStar(require("fs"));
|
|
48
|
-
const utils_1 = require("../utils");
|
|
49
|
-
const commons_1 = require("./commons");
|
|
50
|
-
const trm_commons_1 = require("trm-commons");
|
|
51
|
-
const _parseDependenciesArg = (arg) => {
|
|
52
|
-
if (arg) {
|
|
53
|
-
try {
|
|
54
|
-
return JSON.parse(arg);
|
|
55
|
-
}
|
|
56
|
-
catch (e) { }
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
const _parseSapEntriesArg = (arg) => {
|
|
60
|
-
if (arg) {
|
|
61
|
-
try {
|
|
62
|
-
return JSON.parse(arg);
|
|
63
|
-
}
|
|
64
|
-
catch (e) { }
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
const _parseReadmeArg = (arg) => {
|
|
68
|
-
if (arg) {
|
|
69
|
-
try {
|
|
70
|
-
return fs.readFileSync(arg).toString();
|
|
71
|
-
}
|
|
72
|
-
catch (e) {
|
|
73
|
-
return arg;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
const _parseReleaseTimeoutArg = (arg) => {
|
|
78
|
-
if (arg) {
|
|
79
|
-
try {
|
|
80
|
-
return parseInt(arg);
|
|
81
|
-
}
|
|
82
|
-
catch (e) { }
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
function publish(commandArgs) {
|
|
86
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
87
|
-
const packages = yield commons_1.CommandContext.getSystemPackages();
|
|
88
|
-
const result = yield (0, trm_core_1.publish)({
|
|
89
|
-
contextData: {
|
|
90
|
-
logTemporaryFolder: (0, utils_1.getTempFolder)(),
|
|
91
|
-
systemPackages: packages,
|
|
92
|
-
noInquirer: commandArgs.noPrompts
|
|
93
|
-
},
|
|
94
|
-
packageData: {
|
|
95
|
-
name: commandArgs.package,
|
|
96
|
-
version: commandArgs.version,
|
|
97
|
-
devclass: commandArgs.devclass,
|
|
98
|
-
manifest: {
|
|
99
|
-
authors: commandArgs.authors,
|
|
100
|
-
backwardsCompatible: commandArgs.backwardsCompatible,
|
|
101
|
-
description: commandArgs.description,
|
|
102
|
-
git: commandArgs.git,
|
|
103
|
-
keywords: commandArgs.keywords,
|
|
104
|
-
license: commandArgs.license,
|
|
105
|
-
website: commandArgs.website,
|
|
106
|
-
dependencies: _parseDependenciesArg(commandArgs.dependencies),
|
|
107
|
-
sapEntries: _parseSapEntriesArg(commandArgs.sapEntries)
|
|
108
|
-
},
|
|
109
|
-
registry: commons_1.CommandContext.getRegistry()
|
|
110
|
-
},
|
|
111
|
-
publishData: {
|
|
112
|
-
private: commandArgs.private,
|
|
113
|
-
keepLatestReleaseManifestValues: commandArgs.keepLatestReleaseManifestValues,
|
|
114
|
-
noLanguageTransport: commandArgs.noLanguageTransport,
|
|
115
|
-
noDependenciesDetection: commandArgs.noDependenciesDetection,
|
|
116
|
-
skipCustomizingTransports: commandArgs.skipCustomizingTransports,
|
|
117
|
-
customizingTransports: commandArgs.customizingTransports,
|
|
118
|
-
readme: _parseReadmeArg(commandArgs.readme)
|
|
119
|
-
},
|
|
120
|
-
systemData: {
|
|
121
|
-
releaseTimeout: _parseReleaseTimeoutArg(commandArgs.releaseTimeout),
|
|
122
|
-
transportTarget: commandArgs.transportTarget
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
const sOutput = `+ ${result.trmPackage.manifest.get().name} v${result.trmPackage.manifest.get().version} on ${commons_1.CommandContext.getRegistry().name}`;
|
|
126
|
-
trm_commons_1.Logger.success(sOutput);
|
|
127
|
-
});
|
|
128
|
-
}
|
|
@@ -1,36 +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.removeRegistry = removeRegistry;
|
|
13
|
-
const trm_commons_1 = require("trm-commons");
|
|
14
|
-
const registryAlias_1 = require("../registryAlias");
|
|
15
|
-
function removeRegistry(commandArgs) {
|
|
16
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
-
const registryName = commandArgs.registryName.trim();
|
|
18
|
-
registryAlias_1.RegistryAlias.get(registryName);
|
|
19
|
-
const force = commandArgs.force;
|
|
20
|
-
const inq1 = yield trm_commons_1.Inquirer.prompt({
|
|
21
|
-
type: "confirm",
|
|
22
|
-
name: "removeRegistry",
|
|
23
|
-
message: `Do you really want to remove "${registryName}" registry?`,
|
|
24
|
-
default: false,
|
|
25
|
-
when: !force
|
|
26
|
-
});
|
|
27
|
-
const confirmRemove = inq1.removeRegistry !== undefined ? inq1.removeRegistry : force;
|
|
28
|
-
if (!confirmRemove) {
|
|
29
|
-
trm_commons_1.Logger.info(`Registry "${registryName}" was not removed.`);
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
registryAlias_1.RegistryAlias.delete(registryName);
|
|
33
|
-
trm_commons_1.Logger.success(`Registry removed.`);
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function selfUpdate(): Promise<void>;
|
|
@@ -1,77 +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.selfUpdate = selfUpdate;
|
|
16
|
-
const execa_1 = require("execa");
|
|
17
|
-
const node_os_1 = __importDefault(require("node:os"));
|
|
18
|
-
const trm_commons_1 = require("trm-commons");
|
|
19
|
-
function selfUpdate() {
|
|
20
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
-
const pm = detectPackageManager();
|
|
22
|
-
const target = `trm-client@latest`;
|
|
23
|
-
const command = pm === "pnpm"
|
|
24
|
-
? { bin: "pnpm", args: ["add", "-g", target] }
|
|
25
|
-
: pm === "yarn1"
|
|
26
|
-
? { bin: "yarn", args: ["global", "add", target] }
|
|
27
|
-
: { bin: "npm", args: ["install", "-g", target] };
|
|
28
|
-
try {
|
|
29
|
-
yield (0, execa_1.execa)(command.bin, command.args, { stdio: "inherit" });
|
|
30
|
-
trm_commons_1.Logger.success(`Client updated successfully.`);
|
|
31
|
-
}
|
|
32
|
-
catch (err) {
|
|
33
|
-
if (isPermsError(err)) {
|
|
34
|
-
trm_commons_1.Logger.error(formatPermsHelp(command.bin));
|
|
35
|
-
}
|
|
36
|
-
if (command.bin === "yarn" && looksLikeYarnBerry()) {
|
|
37
|
-
trm_commons_1.Logger.error(`\Detected Yarn ≥2 (Berry). It doesn't support reliable global installs.\n` +
|
|
38
|
-
` Try: npm install -g ${target}`);
|
|
39
|
-
}
|
|
40
|
-
throw err;
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
function detectPackageManager() {
|
|
45
|
-
var _a;
|
|
46
|
-
const ua = (_a = process.env.npm_config_user_agent) !== null && _a !== void 0 ? _a : "";
|
|
47
|
-
if (ua.includes("pnpm/"))
|
|
48
|
-
return "pnpm";
|
|
49
|
-
if (ua.includes("yarn/1."))
|
|
50
|
-
return "yarn1";
|
|
51
|
-
return "npm";
|
|
52
|
-
}
|
|
53
|
-
function looksLikeYarnBerry() {
|
|
54
|
-
var _a;
|
|
55
|
-
const ua = (_a = process.env.npm_config_user_agent) !== null && _a !== void 0 ? _a : "";
|
|
56
|
-
return ua.includes("yarn/") && !ua.includes("yarn/1.");
|
|
57
|
-
}
|
|
58
|
-
function isPermsError(err) {
|
|
59
|
-
const msg = String((err === null || err === void 0 ? void 0 : err.message) || err);
|
|
60
|
-
return ((err === null || err === void 0 ? void 0 : err.code) === "EACCES" ||
|
|
61
|
-
(err === null || err === void 0 ? void 0 : err.errno) === -13 ||
|
|
62
|
-
/EACCES|EPERM|permission denied/i.test(msg));
|
|
63
|
-
}
|
|
64
|
-
function formatPermsHelp(bin) {
|
|
65
|
-
const isUnix = node_os_1.default.platform() !== "win32";
|
|
66
|
-
return (`Permission error installing globally.\n` +
|
|
67
|
-
`Troubleshooting tips:\n` +
|
|
68
|
-
(isUnix
|
|
69
|
-
? ` • If you used a system Node, configure a user-level global prefix:\n` +
|
|
70
|
-
` mkdir -p ~/.npm-global && npm config set prefix ~/.npm-global\n` +
|
|
71
|
-
` export PATH="$HOME/.npm-global/bin:$PATH"\n` +
|
|
72
|
-
` (Then rerun: ${bin} …)\n` +
|
|
73
|
-
` • Prefer using a Node version manager (nvm/fnm/volta) to avoid sudo.\n` +
|
|
74
|
-
` • Avoid running global installs with sudo unless you know why.\n`
|
|
75
|
-
: ` • Run your shell as Administrator, or use a Node manager (nvs/volta).\n`) +
|
|
76
|
-
``);
|
|
77
|
-
}
|
|
@@ -1,32 +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.settings = settings;
|
|
13
|
-
const utils_1 = require("../utils");
|
|
14
|
-
const trm_commons_1 = require("trm-commons");
|
|
15
|
-
function settings(commandArgs) {
|
|
16
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
-
const setArgument = commandArgs.set;
|
|
18
|
-
if (setArgument) {
|
|
19
|
-
const aSplit = setArgument.split('=');
|
|
20
|
-
if (aSplit.length !== 2) {
|
|
21
|
-
throw new Error(`Invalid 'set' argument, must be in format KEY=VALUE.`);
|
|
22
|
-
}
|
|
23
|
-
const key = aSplit[0];
|
|
24
|
-
const value = aSplit[1];
|
|
25
|
-
utils_1.Context.getInstance().setSetting(key, value);
|
|
26
|
-
}
|
|
27
|
-
const settingsData = utils_1.Context.getInstance().getSettings();
|
|
28
|
-
Object.keys(settingsData).forEach(k => {
|
|
29
|
-
trm_commons_1.Logger.log(`${k}: ${settingsData[k]}`);
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
}
|
|
@@ -1,61 +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.unpublish = unpublish;
|
|
46
|
-
const semver = __importStar(require("semver"));
|
|
47
|
-
const commons_1 = require("./commons");
|
|
48
|
-
const trm_commons_1 = require("trm-commons");
|
|
49
|
-
function unpublish(commandArgs) {
|
|
50
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
51
|
-
const packageName = commandArgs.package;
|
|
52
|
-
const packageVersion = semver.clean(commandArgs.version || '');
|
|
53
|
-
const registry = commons_1.CommandContext.getRegistry();
|
|
54
|
-
if (!packageVersion) {
|
|
55
|
-
throw new Error(`Invalid version.`);
|
|
56
|
-
}
|
|
57
|
-
yield registry.unpublish(packageName, packageVersion);
|
|
58
|
-
const sOutput = `- ${packageName} ${packageVersion} on ${registry.name}`;
|
|
59
|
-
trm_commons_1.Logger.success(sOutput);
|
|
60
|
-
});
|
|
61
|
-
}
|
package/dist/commands/update.js
DELETED
|
@@ -1,20 +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.update = update;
|
|
13
|
-
const install_1 = require("./install");
|
|
14
|
-
function update(commandArgs) {
|
|
15
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
16
|
-
var installArguments = commandArgs;
|
|
17
|
-
installArguments.overwrite = true;
|
|
18
|
-
yield (0, install_1.install)(installArguments);
|
|
19
|
-
});
|
|
20
|
-
}
|
package/dist/commands/view.d.ts
DELETED