@squiz/dxp-cli-next 1.7.0-develop.2 → 1.7.0-develop.3

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/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import { Command } from 'commander';
2
- declare const authCommand: Command;
3
- export default authCommand;
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 authCommand = new commander_1.Command('td');
10
- authCommand
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
- exports.default = authCommand;
14
+ .addCommand(download_1.default)
15
+ .addCommand(setExternalIds_1.default);
16
+ exports.default = tdCommand;
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ declare const setExternalIdsCommand: Command;
3
+ export default setExternalIdsCommand;
@@ -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.7.0-develop.2",
3
+ "version": "1.7.0-develop.3",
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.30",
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",