@squiz/dxp-cli-next 5.1.0 → 5.2.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/lib/__tests__/integration/main.spec.js +0 -1
- package/lib/cmp/deploy.js +1 -0
- package/lib/dxp.js +4 -4
- package/package.json +1 -2
- package/lib/td/deploy.d.ts +0 -3
- package/lib/td/deploy.js +0 -49
- package/lib/td/download.d.ts +0 -3
- package/lib/td/download.js +0 -46
- package/lib/td/index.d.ts +0 -3
- package/lib/td/index.js +0 -18
- package/lib/td/setExternalIds.d.ts +0 -3
- package/lib/td/setExternalIds.js +0 -42
- package/lib/td/validate.d.ts +0 -3
- package/lib/td/validate.js +0 -35
|
@@ -19,7 +19,6 @@ describe('dxp', () => {
|
|
|
19
19
|
.match(/Commands\:(.*)/is)) === null || _a === void 0 ? void 0 : _a[1].split('\n').map(a => a.trim()).filter(a => !!a);
|
|
20
20
|
expect(commandsText).toEqual([
|
|
21
21
|
'auth Authenticate into the DXP CLI',
|
|
22
|
-
'td Template deployment commands',
|
|
23
22
|
'cmp Component Service Commands',
|
|
24
23
|
]);
|
|
25
24
|
});
|
package/lib/cmp/deploy.js
CHANGED
|
@@ -42,6 +42,7 @@ const deployCommand = new commander_1.Command()
|
|
|
42
42
|
return yield (0, component_cli_lib_1.uploadComponentFolder)(apiService.client, componentServiceUrl, source);
|
|
43
43
|
}
|
|
44
44
|
catch (error) {
|
|
45
|
+
// console.error(error);
|
|
45
46
|
if (error instanceof ApiService_1.InvalidLoginSessionError) {
|
|
46
47
|
deployCommand.error(cli_color_1.default.red('Login session expired. Please login again.'));
|
|
47
48
|
}
|
package/lib/dxp.js
CHANGED
|
@@ -12,7 +12,7 @@ validateNodeVersion();
|
|
|
12
12
|
isGlobal: true,
|
|
13
13
|
});
|
|
14
14
|
const auth_1 = __importDefault(require("./auth"));
|
|
15
|
-
|
|
15
|
+
// import tdCommand from './td';
|
|
16
16
|
const cmp_1 = __importDefault(require("./cmp"));
|
|
17
17
|
const program = new commander_1.default.Command();
|
|
18
18
|
const packageJson = require('../package.json');
|
|
@@ -22,9 +22,9 @@ program
|
|
|
22
22
|
.version(version)
|
|
23
23
|
.description('dxp commands')
|
|
24
24
|
.addCommand(auth_1.default);
|
|
25
|
-
if (process.env.FEATURE_TD_ACTIVE === 'true') {
|
|
26
|
-
|
|
27
|
-
}
|
|
25
|
+
// if (process.env.FEATURE_TD_ACTIVE === 'true') {
|
|
26
|
+
// program.addCommand(tdCommand);
|
|
27
|
+
// }
|
|
28
28
|
program
|
|
29
29
|
.addCommand(cmp_1.default)
|
|
30
30
|
.action(() => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@squiz/dxp-cli-next",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"url": "https://gitlab.squiz.net/developer-experience/dxp-cli-next"
|
|
6
6
|
},
|
|
@@ -40,7 +40,6 @@
|
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@squiz/component-cli-lib": "1.3.3",
|
|
43
|
-
"@squiz/deployment-service-lib": "1.1.5-alpha.85",
|
|
44
43
|
"axios": "1.1.3",
|
|
45
44
|
"cli-color": "2.0.3",
|
|
46
45
|
"commander": "9.4.0",
|
package/lib/td/deploy.d.ts
DELETED
package/lib/td/deploy.js
DELETED
|
@@ -1,49 +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
|
-
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 deployCommand = new commander_1.Command()
|
|
19
|
-
.name('deploy')
|
|
20
|
-
.argument('<source>', 'folder/file path containing the template files to deploy')
|
|
21
|
-
.argument('<destination>', 'asset id to deploy too')
|
|
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
|
-
.addOption(new commander_1.Option('-deploy, --template-deployment-url <string>', 'Required: Url for the template deployment api')
|
|
29
|
-
.env('DEPLOYMENT_INFO_API_URL')
|
|
30
|
-
.makeOptionMandatory(true))
|
|
31
|
-
.addOption(new commander_1.Option('-f, --force', 'Optional: Do a force deployment. This will attempt to bypass whatever validation it can').default(false, 'default is false'))
|
|
32
|
-
.addOption(new commander_1.Option('--no-watch', 'Optional: disabling polling for a result. The deployment ID will be returned and return.').default(true))
|
|
33
|
-
.addOption(new commander_1.Option('--dry-run', 'Optional: Perform validation on the local template and do not upload package').default(false))
|
|
34
|
-
.addOption(new commander_1.Option('--ignore-sort-order', 'Optional: Ignore the asset link sort order validation check').default(false, 'default is false'))
|
|
35
|
-
.action((source, destination, options, self) => __awaiter(void 0, void 0, void 0, function* () {
|
|
36
|
-
try {
|
|
37
|
-
return yield (0, deployment_service_lib_1.CliUpload)(options.matrixApiUrl, options.matrixApiKey, options.templateDeploymentUrl, source, destination, options.watch, options.force, options.dryRun, options.ignoreSortOrder);
|
|
38
|
-
}
|
|
39
|
-
catch (error) {
|
|
40
|
-
if (error.message) {
|
|
41
|
-
deployCommand.error(cli_color_1.default.red(error.message));
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
console.error(error);
|
|
45
|
-
deployCommand.error('An unknown error occurred');
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}));
|
|
49
|
-
exports.default = deployCommand;
|
package/lib/td/download.d.ts
DELETED
package/lib/td/download.js
DELETED
|
@@ -1,46 +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
|
-
const commander_1 = require("commander");
|
|
16
|
-
const cli_color_1 = __importDefault(require("cli-color"));
|
|
17
|
-
const deployment_service_lib_1 = require("@squiz/deployment-service-lib");
|
|
18
|
-
const downCommand = new commander_1.Command()
|
|
19
|
-
.name('download')
|
|
20
|
-
.argument('<destination>', 'folder to download the exported package to')
|
|
21
|
-
.argument('<root-asset-id>', 'root node asset ID to export')
|
|
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
|
-
.addOption(new commander_1.Option('-url, --template-deployment-url <string>', 'Required: Url for the template deployment api')
|
|
29
|
-
.env('DEPLOYMENT_INFO_API_URL')
|
|
30
|
-
.makeOptionMandatory(true))
|
|
31
|
-
.addOption(new commander_1.Option('-f, --force', 'Optional: Do a force download. This will attempt to bypass whatever validation it can').default(false, 'default is false'))
|
|
32
|
-
.action((source, destination, options, self) => __awaiter(void 0, void 0, void 0, function* () {
|
|
33
|
-
try {
|
|
34
|
-
return yield (0, deployment_service_lib_1.cliDownload)(options.matrixApiUrl, options.matrixApiKey, options.templateDeploymentUrl, source, destination, options.force);
|
|
35
|
-
}
|
|
36
|
-
catch (error) {
|
|
37
|
-
if (error.message) {
|
|
38
|
-
downCommand.error(cli_color_1.default.red(error.message));
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
console.error(error);
|
|
42
|
-
downCommand.error('An unknown error occurred');
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}));
|
|
46
|
-
exports.default = downCommand;
|
package/lib/td/index.d.ts
DELETED
package/lib/td/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const commander_1 = require("commander");
|
|
7
|
-
const deploy_1 = __importDefault(require("./deploy"));
|
|
8
|
-
const download_1 = __importDefault(require("./download"));
|
|
9
|
-
const setExternalIds_1 = __importDefault(require("./setExternalIds"));
|
|
10
|
-
const validate_1 = __importDefault(require("./validate"));
|
|
11
|
-
const tdCommand = new commander_1.Command('td');
|
|
12
|
-
tdCommand
|
|
13
|
-
.description('Template deployment commands')
|
|
14
|
-
.addCommand(deploy_1.default)
|
|
15
|
-
.addCommand(download_1.default)
|
|
16
|
-
.addCommand(setExternalIds_1.default)
|
|
17
|
-
.addCommand(validate_1.default);
|
|
18
|
-
exports.default = tdCommand;
|
package/lib/td/setExternalIds.js
DELETED
|
@@ -1,42 +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
|
-
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('set-external-ids')
|
|
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/lib/td/validate.d.ts
DELETED
package/lib/td/validate.js
DELETED
|
@@ -1,35 +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
|
-
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 validateCommand = new commander_1.Command()
|
|
19
|
-
.name('validate')
|
|
20
|
-
.argument('<source>', 'folder/file path containing the files to validate')
|
|
21
|
-
.action((source) => __awaiter(void 0, void 0, void 0, function* () {
|
|
22
|
-
try {
|
|
23
|
-
return yield (0, deployment_service_lib_1.cliValidate)(source);
|
|
24
|
-
}
|
|
25
|
-
catch (error) {
|
|
26
|
-
if (error.message) {
|
|
27
|
-
validateCommand.error(cli_color_1.default.red(error.message));
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
console.error(error);
|
|
31
|
-
validateCommand.error('An unknown error occurred');
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}));
|
|
35
|
-
exports.default = validateCommand;
|