@squiz/dxp-cli-next 5.12.1 → 5.13.0-develop.1
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/lib/auth/index.js +3 -4
- package/lib/auth/logout/logout.js +1 -1
- package/lib/datastore/simulator/add/add.js +1 -0
- package/lib/datastore/simulator/list/list.js +0 -2
- package/lib/datastore/simulator/pause/pause.js +0 -1
- package/lib/datastore/simulator/resume/resume.js +0 -1
- package/lib/datastore/simulator/upgrade/upgrade.js +2 -0
- package/package.json +1 -1
package/lib/auth/index.js
CHANGED
|
@@ -5,11 +5,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const commander_1 = require("commander");
|
|
7
7
|
const login_1 = __importDefault(require("./login/login"));
|
|
8
|
+
const logout_1 = __importDefault(require("./logout/logout"));
|
|
8
9
|
const authCommand = new commander_1.Command('auth');
|
|
9
10
|
authCommand
|
|
10
11
|
.description('Authenticate into the DXP-Next CLI')
|
|
11
|
-
.addCommand((0, login_1.default)())
|
|
12
|
-
|
|
13
|
-
// getting fixed in PLATFORM-940
|
|
14
|
-
// .addCommand(createLogoutCommand());
|
|
12
|
+
.addCommand((0, login_1.default)())
|
|
13
|
+
.addCommand((0, logout_1.default)());
|
|
15
14
|
exports.default = authCommand;
|
|
@@ -43,7 +43,7 @@ const createLogoutCommand = () => {
|
|
|
43
43
|
const logoutCommand = new commander_1.Command('logout')
|
|
44
44
|
.name('logout')
|
|
45
45
|
.description('Log out of the current session')
|
|
46
|
-
.addOption(new commander_1.Option('-f, --force', '
|
|
46
|
+
.addOption(new commander_1.Option('-f, --force', 'skip confirmation prompt'))
|
|
47
47
|
.action((options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
48
48
|
try {
|
|
49
49
|
yield handleLogoutRequest(options);
|
|
@@ -86,6 +86,7 @@ const createAddCommand = () => {
|
|
|
86
86
|
${utils_2.datastoreRepo}`);
|
|
87
87
|
}
|
|
88
88
|
catch (error) {
|
|
89
|
+
(0, utils_1.logDebug)(`ERROR: ${JSON.stringify(error)}`);
|
|
89
90
|
if (error.message.includes('already in use') === true) {
|
|
90
91
|
throw new Error('There is already a container running with this blueprint.');
|
|
91
92
|
}
|
|
@@ -27,7 +27,6 @@ const createListCommand = () => {
|
|
|
27
27
|
},
|
|
28
28
|
})
|
|
29
29
|
.action((options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
30
|
-
yield (0, utils_1.throwErrorIfNotLoggedIn)(listCommand);
|
|
31
30
|
console.log('');
|
|
32
31
|
const spinner = (0, ora_1.default)();
|
|
33
32
|
try {
|
|
@@ -74,7 +73,6 @@ const createListCommand = () => {
|
|
|
74
73
|
results = yield Promise.all(observableBatch.map((item) => (0, utils_2.executeCommand)(item)));
|
|
75
74
|
}
|
|
76
75
|
results.forEach((result) => {
|
|
77
|
-
console.log(result);
|
|
78
76
|
if (result !== '') {
|
|
79
77
|
const resultArray = JSON.parse(result);
|
|
80
78
|
console.log('');
|
|
@@ -28,7 +28,6 @@ const createPauseCommand = () => {
|
|
|
28
28
|
},
|
|
29
29
|
})
|
|
30
30
|
.action((options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
|
-
yield (0, utils_1.throwErrorIfNotLoggedIn)(pauseCommand);
|
|
32
31
|
console.log('');
|
|
33
32
|
if (options.blueprint !== undefined) {
|
|
34
33
|
const { fullPath, dirPath, yamlFile, containerName } = (0, utils_2.getSimulatorDetails)(options.blueprint);
|
|
@@ -28,7 +28,6 @@ const createResumeCommand = () => {
|
|
|
28
28
|
},
|
|
29
29
|
})
|
|
30
30
|
.action((options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
|
-
yield (0, utils_1.throwErrorIfNotLoggedIn)(resumeCommand);
|
|
32
31
|
console.log('');
|
|
33
32
|
if (options.blueprint !== undefined) {
|
|
34
33
|
const { fullPath, dirPath, yamlFile, containerName } = (0, utils_2.getSimulatorDetails)(options.blueprint);
|
|
@@ -77,6 +77,7 @@ function upgradeContainer(container, tempFolder, dockerDigest) {
|
|
|
77
77
|
yield (0, utils_2.executeCommand)(`docker exec -i ${containerName} bash -c "echo '${jsonData}' > /var/www/data/containerData.json"`);
|
|
78
78
|
}
|
|
79
79
|
catch (error) {
|
|
80
|
+
(0, utils_1.logDebug)(`ERROR: ${JSON.stringify(error)}`);
|
|
80
81
|
upgradeSpinner.fail(`Unable to upgrade simulator Container ID "${containerName}"`);
|
|
81
82
|
throw new Error(`Unable to upgrade simulator Container ID "${containerName}"`);
|
|
82
83
|
}
|
|
@@ -134,6 +135,7 @@ const createUpgradeCommand = () => {
|
|
|
134
135
|
yield (0, utils_2.executeCommand)(`docker pull ${utils_2.datastoreRepo}`);
|
|
135
136
|
}
|
|
136
137
|
catch (error) {
|
|
138
|
+
(0, utils_1.logDebug)(`ERROR: ${JSON.stringify(error)}`);
|
|
137
139
|
throw new Error('Sorry, could not download simulator image. Ask for help in our support forums.');
|
|
138
140
|
}
|
|
139
141
|
const mkdirTemp = yield (0, utils_2.executeCommand)('mktemp -d -t datastore-XXXXXXXXXX');
|