@squiz/dxp-cli-next 1.7.0 → 1.8.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/td/deploy.js +1 -1
- package/lib/td/download.js +1 -1
- package/lib/td/index.d.ts +2 -2
- package/lib/td/index.js +6 -4
- package/lib/td/setExternalIds.d.ts +3 -0
- package/lib/td/setExternalIds.js +42 -0
- package/package.json +3 -3
package/lib/td/deploy.js
CHANGED
|
@@ -33,7 +33,7 @@ const deployCommand = new commander_1.Command()
|
|
|
33
33
|
.addOption(new commander_1.Option('--dry-run', 'Optional: Perform validation on the local template and do not upload package').default(false))
|
|
34
34
|
.action((source, destination, options, self) => __awaiter(void 0, void 0, void 0, function* () {
|
|
35
35
|
try {
|
|
36
|
-
return (0, deployment_service_lib_1.CliUpload)(options.matrixApiUrl, options.matrixApiKey, options.templateDeploymentUrl, source, destination, options.watch, options.force, options.dryRun);
|
|
36
|
+
return yield (0, deployment_service_lib_1.CliUpload)(options.matrixApiUrl, options.matrixApiKey, options.templateDeploymentUrl, source, destination, options.watch, options.force, options.dryRun);
|
|
37
37
|
}
|
|
38
38
|
catch (error) {
|
|
39
39
|
if (error.message) {
|
package/lib/td/download.js
CHANGED
|
@@ -30,7 +30,7 @@ const downCommand = new commander_1.Command()
|
|
|
30
30
|
.makeOptionMandatory(true))
|
|
31
31
|
.action((source, destination, options, self) => __awaiter(void 0, void 0, void 0, function* () {
|
|
32
32
|
try {
|
|
33
|
-
return (0, deployment_service_lib_1.cliDownload)(options.matrixApiUrl, options.matrixApiKey, options.templateDeploymentUrl, source, destination);
|
|
33
|
+
return yield (0, deployment_service_lib_1.cliDownload)(options.matrixApiUrl, options.matrixApiKey, options.templateDeploymentUrl, source, destination);
|
|
34
34
|
}
|
|
35
35
|
catch (error) {
|
|
36
36
|
if (error.message) {
|
package/lib/td/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
-
declare const
|
|
3
|
-
export default
|
|
2
|
+
declare const tdCommand: Command;
|
|
3
|
+
export default tdCommand;
|
package/lib/td/index.js
CHANGED
|
@@ -6,9 +6,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const commander_1 = require("commander");
|
|
7
7
|
const deploy_1 = __importDefault(require("./deploy"));
|
|
8
8
|
const download_1 = __importDefault(require("./download"));
|
|
9
|
-
const
|
|
10
|
-
|
|
9
|
+
const setExternalIds_1 = __importDefault(require("./setExternalIds"));
|
|
10
|
+
const tdCommand = new commander_1.Command('td');
|
|
11
|
+
tdCommand
|
|
11
12
|
.description('Template deployment commands')
|
|
12
13
|
.addCommand(deploy_1.default)
|
|
13
|
-
.addCommand(download_1.default)
|
|
14
|
-
|
|
14
|
+
.addCommand(download_1.default)
|
|
15
|
+
.addCommand(setExternalIds_1.default);
|
|
16
|
+
exports.default = tdCommand;
|
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
const commander_1 = require("commander");
|
|
16
|
+
const deployment_service_lib_1 = require("@squiz/deployment-service-lib");
|
|
17
|
+
const cli_color_1 = __importDefault(require("cli-color"));
|
|
18
|
+
const setExternalIdsCommand = new commander_1.Command()
|
|
19
|
+
.name('setExternalIds')
|
|
20
|
+
.argument('<root-asset-id>', 'root asset ID to set external ids for')
|
|
21
|
+
.addOption(new commander_1.Option('-f, --force', 'Optional: Do a force reset. This will reset all the external ids for the given root asset id').default(false, 'default is false'))
|
|
22
|
+
.addOption(new commander_1.Option('-api, --matrix-api-url <string>', 'Required: Matrix asset management api url')
|
|
23
|
+
.env('MATRIX_ASSET_API_URL')
|
|
24
|
+
.makeOptionMandatory(true))
|
|
25
|
+
.addOption(new commander_1.Option('-key, --matrix-api-key <string>', 'Required: Matrix asset management api key')
|
|
26
|
+
.env('MATRIX_ASSET_API_KEY')
|
|
27
|
+
.makeOptionMandatory(true))
|
|
28
|
+
.action((rootAssetId, options, self) => __awaiter(void 0, void 0, void 0, function* () {
|
|
29
|
+
try {
|
|
30
|
+
return (0, deployment_service_lib_1.cliSetExternalIds)(options.matrixApiUrl, options.matrixApiKey, rootAssetId, options.force);
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
if (error.message) {
|
|
34
|
+
setExternalIdsCommand.error(cli_color_1.default.red(error.message));
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
console.error(error);
|
|
38
|
+
setExternalIdsCommand.error('An unknown error occurred');
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}));
|
|
42
|
+
exports.default = setExternalIdsCommand;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@squiz/dxp-cli-next",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0-develop.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"url": "https://gitlab.squiz.net/developer-experience/dxp-cli-next"
|
|
6
6
|
},
|
|
@@ -39,14 +39,14 @@
|
|
|
39
39
|
"codecov"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@squiz/deployment-service-lib": "^1.1.5-alpha.
|
|
42
|
+
"@squiz/deployment-service-lib": "^1.1.5-alpha.55",
|
|
43
43
|
"cli-color": "^2.0.1",
|
|
44
44
|
"commander": "^9.0.0",
|
|
45
45
|
"update-notifier": "^5.1.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@semantic-release/gitlab": "^7.0.4",
|
|
49
48
|
"@semantic-release/git": "^10.0.1",
|
|
49
|
+
"@semantic-release/gitlab": "^7.0.4",
|
|
50
50
|
"@semantic-release/npm": "^9.0.0",
|
|
51
51
|
"@types/cli-color": "^2.0.2",
|
|
52
52
|
"@types/jest": "^27.4.0",
|