@extrahorizon/exh-cli 1.10.0-dev-107-31b7fb4 → 1.10.0-dev-111-f2a13ab
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/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
# Extra Horizon CLI changelog
|
|
2
2
|
|
|
3
3
|
### v1.10.0
|
|
4
|
+
* Introduced `exh data schemas init` to create a new schema file with a basic structure
|
|
5
|
+
* Added autocomplete support and inline documentation for `task-config.json`
|
|
6
|
+
* Via `"$schema": "https://swagger.extrahorizon.com/cli/1.10.0/config-json-schemas/TaskConfig.json"`
|
|
7
|
+
* Automatically added when using `exh tasks create-repo`
|
|
4
8
|
* You no longer need to be logged in to run `exh completion`
|
|
9
|
+
* Updated the `archiver` package to resolve some deprecations
|
|
10
|
+
* Removed the dependency on `joi` and `uuid`
|
|
5
11
|
|
|
6
12
|
### v1.9.1
|
|
7
13
|
* Updated the ExH SDK to `8.7.1` to fix a security warning from `form-data`
|
|
@@ -29,7 +29,7 @@ const handler = async function init({ name, path }) {
|
|
|
29
29
|
exports.handler = handler;
|
|
30
30
|
function createSchema(name) {
|
|
31
31
|
return {
|
|
32
|
-
$schema:
|
|
32
|
+
$schema: (0, util_1.getSwaggerDocumentationUrl)('config-json-schemas/Schema.json'),
|
|
33
33
|
name,
|
|
34
34
|
description: `The ${name} schema`,
|
|
35
35
|
createMode: 'allUsers',
|
|
@@ -34,7 +34,7 @@ async function changePackageFile(name) {
|
|
|
34
34
|
}
|
|
35
35
|
try {
|
|
36
36
|
const taskConfig = JSON.parse((await (0, promises_1.readFile)(`${name}/task-config.json`)).toString());
|
|
37
|
-
taskConfig.$schema =
|
|
37
|
+
taskConfig.$schema = (0, util_1.getSwaggerDocumentationUrl)('config-json-schemas/TaskConfig.json');
|
|
38
38
|
taskConfig.name = name;
|
|
39
39
|
taskConfig.description = `${name} task`;
|
|
40
40
|
await (0, promises_1.writeFile)(`${name}/task-config.json`, JSON.stringify(taskConfig, null, 4));
|
package/build/helpers/util.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ import * as yargs from 'yargs';
|
|
|
2
2
|
export declare function epilogue(y: yargs.Argv): yargs.Argv;
|
|
3
3
|
export declare function asyncExec(cmd: string): Promise<string>;
|
|
4
4
|
export declare function loadAndAssertCredentials(): void;
|
|
5
|
-
export declare function
|
|
5
|
+
export declare function getSwaggerDocumentationUrl(subPath: string): string;
|
|
6
6
|
export declare function getAjvErrorStrings(errors: any[]): string[];
|
package/build/helpers/util.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getAjvErrorStrings = exports.
|
|
3
|
+
exports.getAjvErrorStrings = exports.getSwaggerDocumentationUrl = exports.loadAndAssertCredentials = exports.asyncExec = exports.epilogue = void 0;
|
|
4
4
|
const child_process_1 = require("child_process");
|
|
5
5
|
const fs = require("fs");
|
|
6
6
|
const path = require("path");
|
|
@@ -66,12 +66,20 @@ function loadAndAssertCredentials() {
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
exports.loadAndAssertCredentials = loadAndAssertCredentials;
|
|
69
|
-
function
|
|
69
|
+
function getSwaggerDocumentationUrl(subPath) {
|
|
70
70
|
const packageJsonPath = path.join(__dirname, '../../package.json');
|
|
71
71
|
const packageJsonString = fs.readFileSync(packageJsonPath, 'utf-8');
|
|
72
|
-
|
|
72
|
+
const packageVersion = JSON.parse(packageJsonString).version;
|
|
73
|
+
if (packageVersion.match(/^\d+\.\d+\.\d+$/)) {
|
|
74
|
+
return `https://swagger.extrahorizon.com/cli/${packageVersion}/${subPath}`;
|
|
75
|
+
}
|
|
76
|
+
if (packageVersion.match(/^\d+\.\d+\.\d+-.*$/)) {
|
|
77
|
+
const versionParts = packageVersion.split('-');
|
|
78
|
+
return `https://swagger.extrahorizon.com/cli/${versionParts[0]}-dev/${subPath}`;
|
|
79
|
+
}
|
|
80
|
+
throw new Error(`Unknown CLI version format: ${packageVersion}`);
|
|
73
81
|
}
|
|
74
|
-
exports.
|
|
82
|
+
exports.getSwaggerDocumentationUrl = getSwaggerDocumentationUrl;
|
|
75
83
|
function getAjvErrorStrings(errors) {
|
|
76
84
|
return errors.map(error => {
|
|
77
85
|
let message = '';
|