@squiz/dxp-cli-next 1.4.1-develop.1 → 1.5.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.d.ts +2 -2
- package/lib/td/deploy.js +18 -4
- package/lib/td/download.d.ts +3 -0
- package/lib/td/download.js +30 -0
- package/lib/td/index.js +3 -1
- package/package.json +2 -1
package/lib/td/deploy.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
-
declare const
|
|
3
|
-
export default
|
|
2
|
+
declare const deployCommand: Command;
|
|
3
|
+
export default deployCommand;
|
package/lib/td/deploy.js
CHANGED
|
@@ -10,10 +10,24 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const commander_1 = require("commander");
|
|
13
|
-
|
|
13
|
+
const deployment_service_lib_1 = require("@squiz/deployment-service-lib");
|
|
14
|
+
const deployCommand = new commander_1.Command()
|
|
14
15
|
.name('deploy')
|
|
15
|
-
.argument('<source>', 'template
|
|
16
|
+
.argument('<source>', 'folder/file path containing the template files to deploy')
|
|
16
17
|
.argument('<destination>', 'asset id to deploy too')
|
|
17
|
-
.
|
|
18
|
-
|
|
18
|
+
.addOption(new commander_1.Option('-api, --matrix-api-url <string>', 'Required: Matrix asset management api url')
|
|
19
|
+
.env('MATRIX_ASSET_API_URL')
|
|
20
|
+
.makeOptionMandatory(true))
|
|
21
|
+
.addOption(new commander_1.Option('-key, --matrix-api-key <string>', 'Required: Matrix asset management api key')
|
|
22
|
+
.env('MATRIX_ASSET_API_KEY')
|
|
23
|
+
.makeOptionMandatory(true))
|
|
24
|
+
.addOption(new commander_1.Option('-deploy, --template-deployment-url <string>', 'Required: Url for the template deployment api')
|
|
25
|
+
.env('DEPLOYMENT_INFO_API_URL')
|
|
26
|
+
.makeOptionMandatory(true))
|
|
27
|
+
.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'))
|
|
28
|
+
.addOption(new commander_1.Option('--no-watch', 'Optional: disabling polling for a result. The deployment ID will be returned and return.').default(true))
|
|
29
|
+
.addOption(new commander_1.Option('--dry-run', 'Optional: Perform validation on the local template and do not upload package').default(false))
|
|
30
|
+
.action((source, destination, options, self) => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
|
+
return (0, deployment_service_lib_1.CliUpload)(options.matrixApiUrl, options.matrixApiKey, options.templateDeploymentUrl, source, destination, options.watch, options.force, options.dryRun);
|
|
19
32
|
}));
|
|
33
|
+
exports.default = deployCommand;
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
const commander_1 = require("commander");
|
|
13
|
+
const deployment_service_lib_1 = require("@squiz/deployment-service-lib");
|
|
14
|
+
const downCommand = new commander_1.Command()
|
|
15
|
+
.name('download')
|
|
16
|
+
.argument('<destination>', 'folder to download the exported package to')
|
|
17
|
+
.argument('<root-asset-id>', 'root node asset ID to export')
|
|
18
|
+
.addOption(new commander_1.Option('-api, --matrix-api-url <string>', 'Required: Matrix asset management api url')
|
|
19
|
+
.env('MATRIX_ASSET_API_URL')
|
|
20
|
+
.makeOptionMandatory(true))
|
|
21
|
+
.addOption(new commander_1.Option('-key, --matrix-api-key <string>', 'Required: Matrix asset management api key')
|
|
22
|
+
.env('MATRIX_ASSET_API_KEY')
|
|
23
|
+
.makeOptionMandatory(true))
|
|
24
|
+
.addOption(new commander_1.Option('-url, --template-deployment-url <string>', 'Required: Url for the template deployment api')
|
|
25
|
+
.env('DEPLOYMENT_INFO_API_URL')
|
|
26
|
+
.makeOptionMandatory(true))
|
|
27
|
+
.action((source, destination, options, self) => __awaiter(void 0, void 0, void 0, function* () {
|
|
28
|
+
return (0, deployment_service_lib_1.cliDownload)(options.matrixApiUrl, options.matrixApiKey, options.templateDeploymentUrl, source, destination);
|
|
29
|
+
}));
|
|
30
|
+
exports.default = downCommand;
|
package/lib/td/index.js
CHANGED
|
@@ -5,8 +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 deploy_1 = __importDefault(require("./deploy"));
|
|
8
|
+
const download_1 = __importDefault(require("./download"));
|
|
8
9
|
const authCommand = new commander_1.Command('td');
|
|
9
10
|
authCommand
|
|
10
11
|
.description('Template deployment commands')
|
|
11
|
-
.addCommand(deploy_1.default)
|
|
12
|
+
.addCommand(deploy_1.default)
|
|
13
|
+
.addCommand(download_1.default);
|
|
12
14
|
exports.default = authCommand;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@squiz/dxp-cli-next",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0-develop.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"url": "https://gitlab.squiz.net/developer-experience/dxp-cli-next"
|
|
6
6
|
},
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"codecov"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
+
"@squiz/deployment-service-lib": "^1.1.5-alpha.21",
|
|
42
43
|
"commander": "^9.0.0",
|
|
43
44
|
"update-notifier": "^5.1.0"
|
|
44
45
|
},
|