@extrahorizon/exh-cli 1.12.0-dev-135-55b05fe → 1.12.0-dev-136-7979670
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.
|
@@ -1,21 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.handler = exports.builder = exports.desc = exports.command = void 0;
|
|
4
|
-
const exh_1 = require("../../../exh");
|
|
5
4
|
const util_1 = require("../../../helpers/util");
|
|
5
|
+
const schemaRepository = require("../../../repositories/schemas");
|
|
6
6
|
exports.command = 'list';
|
|
7
7
|
exports.desc = 'List all schemas';
|
|
8
8
|
const builder = (yargs) => (0, util_1.epilogue)(yargs);
|
|
9
9
|
exports.builder = builder;
|
|
10
10
|
const handler = async function list({ isTTY }) {
|
|
11
|
-
const
|
|
12
|
-
if (
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
const schemas = await schemaRepository.fetchAll();
|
|
12
|
+
if (schemas.length < 1) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
if (isTTY) {
|
|
16
|
+
console.table(schemas.map(schema => ({
|
|
17
|
+
Id: schema.id,
|
|
18
|
+
Name: schema.name,
|
|
19
|
+
Description: schema.description || '<none>',
|
|
20
|
+
})));
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
schemas.forEach(schema => console.log([schema.id, schema.name].join(',')));
|
|
19
24
|
}
|
|
20
25
|
};
|
|
21
26
|
exports.handler = handler;
|
|
@@ -1,28 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.handler = exports.builder = exports.desc = exports.command = void 0;
|
|
4
|
-
const exh_1 = require("../../exh");
|
|
5
4
|
const util_1 = require("../../helpers/util");
|
|
5
|
+
const functionRepository = require("../../repositories/functions");
|
|
6
6
|
exports.command = 'list';
|
|
7
7
|
exports.desc = 'List all tasks';
|
|
8
8
|
const builder = (yargs) => (0, util_1.epilogue)(yargs);
|
|
9
9
|
exports.builder = builder;
|
|
10
10
|
const handler = async function list({ isTTY }) {
|
|
11
|
-
let
|
|
11
|
+
let functions;
|
|
12
12
|
try {
|
|
13
|
-
|
|
13
|
+
functions = await functionRepository.find();
|
|
14
14
|
}
|
|
15
15
|
catch (err) {
|
|
16
16
|
console.log(err);
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
|
-
if (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
if (functions.length < 1) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (isTTY) {
|
|
23
|
+
console.table(functions.map((c) => ({
|
|
24
|
+
Name: c.name,
|
|
25
|
+
Description: c.description || '<none>',
|
|
26
|
+
'Last updated': c.updateTimestamp.toISOString(),
|
|
27
|
+
})));
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
functions.forEach((f) => (console.log(f.name)));
|
|
26
31
|
}
|
|
27
32
|
};
|
|
28
33
|
exports.handler = handler;
|
|
@@ -17,6 +17,7 @@ export interface Transition {
|
|
|
17
17
|
export declare function remove(schemaId: ObjectId): Promise<import("@extrahorizon/javascript-sdk").AffectedRecords>;
|
|
18
18
|
export declare function disable(schemaId: ObjectId): Promise<import("@extrahorizon/javascript-sdk").AffectedRecords>;
|
|
19
19
|
export declare function fetchSchemaByName(name: string): Promise<import("@extrahorizon/javascript-sdk").Schema>;
|
|
20
|
+
export declare function fetchAll(): Promise<import("@extrahorizon/javascript-sdk").Schema[]>;
|
|
20
21
|
export declare function createSchema(name: string, description: string): Promise<import("@extrahorizon/javascript-sdk").Schema>;
|
|
21
22
|
export declare function updateSchema(id: string, data: any): Promise<import("@extrahorizon/javascript-sdk").AffectedRecords>;
|
|
22
23
|
export declare function createProperty(id: string, data: {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deleteIndex = exports.createIndex = exports.deleteTransition = exports.updateTransition = exports.createTransition = exports.updateCreationTransition = exports.deleteStatus = exports.updateStatus = exports.createStatus = exports.deleteProperty = exports.updateProperty = exports.createProperty = exports.updateSchema = exports.createSchema = exports.fetchSchemaByName = exports.disable = exports.remove = void 0;
|
|
3
|
+
exports.deleteIndex = exports.createIndex = exports.deleteTransition = exports.updateTransition = exports.createTransition = exports.updateCreationTransition = exports.deleteStatus = exports.updateStatus = exports.createStatus = exports.deleteProperty = exports.updateProperty = exports.createProperty = exports.updateSchema = exports.createSchema = exports.fetchAll = exports.fetchSchemaByName = exports.disable = exports.remove = void 0;
|
|
4
|
+
const javascript_sdk_1 = require("@extrahorizon/javascript-sdk");
|
|
4
5
|
const exh_1 = require("../exh");
|
|
5
6
|
async function remove(schemaId) {
|
|
6
7
|
return await (0, exh_1.getSdk)().data.schemas.remove(schemaId);
|
|
@@ -14,6 +15,11 @@ async function fetchSchemaByName(name) {
|
|
|
14
15
|
return await (0, exh_1.getSdk)().data.schemas.findByName(name);
|
|
15
16
|
}
|
|
16
17
|
exports.fetchSchemaByName = fetchSchemaByName;
|
|
18
|
+
async function fetchAll() {
|
|
19
|
+
const rql = (0, javascript_sdk_1.rqlBuilder)().select(['id', 'name', 'description']).build();
|
|
20
|
+
return await (0, exh_1.getSdk)().data.schemas.findAll({ rql });
|
|
21
|
+
}
|
|
22
|
+
exports.fetchAll = fetchAll;
|
|
17
23
|
async function createSchema(name, description) {
|
|
18
24
|
return await (0, exh_1.getSdk)().data.schemas.create({
|
|
19
25
|
name,
|