@extrahorizon/exh-cli 1.13.0-dev-173-4c24837 → 1.13.0-dev-174-348b2fa
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/build/repositories/functions.d.ts +6 -24
- package/build/repositories/functions.js +14 -13
- package/build/repositories/schemas.d.ts +14 -36
- package/build/repositories/schemas.js +12 -24
- package/build/services/tasks/taskConfig.d.ts +10 -17
- package/build/services/tasks/taskConfig.js +4 -9
- package/package.json +2 -2
|
@@ -1,24 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
runtime: string;
|
|
8
|
-
timeLimit?: number;
|
|
9
|
-
memoryLimit?: number;
|
|
10
|
-
environmentVariables?: Record<string, any>;
|
|
11
|
-
executionOptions?: {
|
|
12
|
-
permissionMode?: permissionModes;
|
|
13
|
-
defaultPriority?: number;
|
|
14
|
-
};
|
|
15
|
-
retryPolicy?: {
|
|
16
|
-
enabled: boolean;
|
|
17
|
-
errorsToRetry: string[];
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
export declare function find(): Promise<any>;
|
|
21
|
-
export declare function findByName(name: string): Promise<any>;
|
|
22
|
-
export declare function create(data: FunctionCreation): Promise<any>;
|
|
23
|
-
export declare function update(data: FunctionCreation): Promise<any>;
|
|
24
|
-
export declare function remove(name: string): Promise<any>;
|
|
1
|
+
import { FunctionCreation } from '@extrahorizon/javascript-sdk';
|
|
2
|
+
export declare function find(): Promise<import("@extrahorizon/javascript-sdk").FunctionBase[]>;
|
|
3
|
+
export declare function findByName(name: string): Promise<import("@extrahorizon/javascript-sdk").FunctionDetails>;
|
|
4
|
+
export declare function create(data: FunctionCreation): Promise<import("@extrahorizon/javascript-sdk").FunctionDetails>;
|
|
5
|
+
export declare function update(data: Partial<FunctionCreation>): Promise<import("@extrahorizon/javascript-sdk").AffectedRecords>;
|
|
6
|
+
export declare function remove(name: string): Promise<import("@extrahorizon/javascript-sdk").AffectedRecords>;
|
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.remove = exports.update = exports.create = exports.findByName = exports.find = void 0;
|
|
4
|
+
const javascript_sdk_1 = require("@extrahorizon/javascript-sdk");
|
|
4
5
|
const exh_1 = require("../exh");
|
|
5
6
|
async function find() {
|
|
6
|
-
const response = await (0, exh_1.getSdk)().
|
|
7
|
-
return response.data
|
|
7
|
+
const response = await (0, exh_1.getSdk)().tasks.functions.find();
|
|
8
|
+
return response.data;
|
|
8
9
|
}
|
|
9
10
|
exports.find = find;
|
|
10
11
|
async function findByName(name) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
try {
|
|
13
|
+
return await (0, exh_1.getSdk)().tasks.functions.getByName(name);
|
|
14
|
+
}
|
|
15
|
+
catch (e) {
|
|
16
|
+
if (e instanceof javascript_sdk_1.ResourceUnknownError) {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
throw e;
|
|
15
20
|
}
|
|
16
|
-
return response.data;
|
|
17
21
|
}
|
|
18
22
|
exports.findByName = findByName;
|
|
19
23
|
async function create(data) {
|
|
20
|
-
|
|
21
|
-
return response.data;
|
|
24
|
+
return (0, exh_1.getSdk)().tasks.functions.create(data);
|
|
22
25
|
}
|
|
23
26
|
exports.create = create;
|
|
24
27
|
async function update(data) {
|
|
25
|
-
|
|
26
|
-
return response.data;
|
|
28
|
+
return (0, exh_1.getSdk)().tasks.functions.update(data.name, data);
|
|
27
29
|
}
|
|
28
30
|
exports.update = update;
|
|
29
31
|
async function remove(name) {
|
|
30
|
-
|
|
31
|
-
return response.data;
|
|
32
|
+
return (0, exh_1.getSdk)().tasks.functions.remove(name);
|
|
32
33
|
}
|
|
33
34
|
exports.remove = remove;
|
|
@@ -1,19 +1,4 @@
|
|
|
1
|
-
import { ObjectId } from '@extrahorizon/javascript-sdk';
|
|
2
|
-
export interface Transition {
|
|
3
|
-
name: string;
|
|
4
|
-
type: string;
|
|
5
|
-
fromStatuses: string[];
|
|
6
|
-
toStatus: string;
|
|
7
|
-
conditions: {
|
|
8
|
-
type: string;
|
|
9
|
-
};
|
|
10
|
-
actions: {
|
|
11
|
-
type: string;
|
|
12
|
-
};
|
|
13
|
-
afterActions: {
|
|
14
|
-
type: string;
|
|
15
|
-
};
|
|
16
|
-
}
|
|
1
|
+
import { ObjectId, StatusData, CreationTransition, IndexInput, TransitionInput, TypeConfiguration } from '@extrahorizon/javascript-sdk';
|
|
17
2
|
export declare function remove(schemaId: ObjectId): Promise<import("@extrahorizon/javascript-sdk").AffectedRecords>;
|
|
18
3
|
export declare function disable(schemaId: ObjectId): Promise<import("@extrahorizon/javascript-sdk").AffectedRecords>;
|
|
19
4
|
export declare function fetchSchemaByName(name: string): Promise<import("@extrahorizon/javascript-sdk").Schema>;
|
|
@@ -22,23 +7,16 @@ export declare function createSchema(name: string, description: string): Promise
|
|
|
22
7
|
export declare function updateSchema(id: string, data: any): Promise<import("@extrahorizon/javascript-sdk").AffectedRecords>;
|
|
23
8
|
export declare function createProperty(id: string, data: {
|
|
24
9
|
name: string;
|
|
25
|
-
configuration:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
export declare function
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
export declare function
|
|
36
|
-
export declare function
|
|
37
|
-
export declare function
|
|
38
|
-
export declare function deleteStatus(id: string, name: string): Promise<any>;
|
|
39
|
-
export declare function updateCreationTransition(id: string, data: Transition): Promise<any>;
|
|
40
|
-
export declare function createTransition(id: string, data: Transition): Promise<any>;
|
|
41
|
-
export declare function updateTransition(schemaId: string, transitionId: string, data: Transition): Promise<any>;
|
|
42
|
-
export declare function deleteTransition(schemaId: string, transitionId: string): Promise<any>;
|
|
43
|
-
export declare function createIndex(schemaId: string, index: any): Promise<any>;
|
|
44
|
-
export declare function deleteIndex(schemaId: string, indexId: string): Promise<any>;
|
|
10
|
+
configuration: TypeConfiguration;
|
|
11
|
+
}): Promise<import("@extrahorizon/javascript-sdk").AffectedRecords>;
|
|
12
|
+
export declare function updateProperty(id: string, path: string, data: TypeConfiguration): Promise<import("@extrahorizon/javascript-sdk").AffectedRecords>;
|
|
13
|
+
export declare function deleteProperty(id: string, path: string): Promise<import("@extrahorizon/javascript-sdk").AffectedRecords>;
|
|
14
|
+
export declare function createStatus(id: string, name: string, data: StatusData): Promise<import("@extrahorizon/javascript-sdk").AffectedRecords>;
|
|
15
|
+
export declare function updateStatus(id: string, name: string, data: StatusData): Promise<import("@extrahorizon/javascript-sdk").AffectedRecords>;
|
|
16
|
+
export declare function deleteStatus(id: string, name: string): Promise<import("@extrahorizon/javascript-sdk").AffectedRecords>;
|
|
17
|
+
export declare function updateCreationTransition(id: string, data: CreationTransition): Promise<import("@extrahorizon/javascript-sdk").AffectedRecords>;
|
|
18
|
+
export declare function createTransition(id: string, data: TransitionInput): Promise<import("@extrahorizon/javascript-sdk").Transition>;
|
|
19
|
+
export declare function updateTransition(schemaId: string, transitionId: string, data: TransitionInput): Promise<import("@extrahorizon/javascript-sdk").AffectedRecords>;
|
|
20
|
+
export declare function deleteTransition(schemaId: string, transitionId: string): Promise<import("@extrahorizon/javascript-sdk").AffectedRecords>;
|
|
21
|
+
export declare function createIndex(schemaId: string, index: IndexInput): Promise<import("@extrahorizon/javascript-sdk").Index>;
|
|
22
|
+
export declare function deleteIndex(schemaId: string, indexId: string): Promise<import("@extrahorizon/javascript-sdk").AffectedRecords>;
|
|
@@ -32,62 +32,50 @@ async function updateSchema(id, data) {
|
|
|
32
32
|
}
|
|
33
33
|
exports.updateSchema = updateSchema;
|
|
34
34
|
async function createProperty(id, data) {
|
|
35
|
-
|
|
36
|
-
return response.data;
|
|
35
|
+
return await (0, exh_1.getSdk)().data.properties.create(id, data);
|
|
37
36
|
}
|
|
38
37
|
exports.createProperty = createProperty;
|
|
39
38
|
async function updateProperty(id, path, data) {
|
|
40
|
-
|
|
41
|
-
return response.data;
|
|
39
|
+
return await (0, exh_1.getSdk)().data.properties.update(id, path, data);
|
|
42
40
|
}
|
|
43
41
|
exports.updateProperty = updateProperty;
|
|
44
42
|
async function deleteProperty(id, path) {
|
|
45
|
-
|
|
46
|
-
return response.data;
|
|
43
|
+
return await (0, exh_1.getSdk)().data.properties.remove(id, path);
|
|
47
44
|
}
|
|
48
45
|
exports.deleteProperty = deleteProperty;
|
|
49
46
|
async function createStatus(id, name, data) {
|
|
50
|
-
|
|
51
|
-
return response.data;
|
|
47
|
+
return (0, exh_1.getSdk)().data.statuses.create(id, { name, data });
|
|
52
48
|
}
|
|
53
49
|
exports.createStatus = createStatus;
|
|
54
50
|
async function updateStatus(id, name, data) {
|
|
55
|
-
|
|
56
|
-
return response.data;
|
|
51
|
+
return (0, exh_1.getSdk)().data.statuses.update(id, name, data);
|
|
57
52
|
}
|
|
58
53
|
exports.updateStatus = updateStatus;
|
|
59
54
|
async function deleteStatus(id, name) {
|
|
60
|
-
|
|
61
|
-
return response.data;
|
|
55
|
+
return (0, exh_1.getSdk)().data.statuses.remove(id, name);
|
|
62
56
|
}
|
|
63
57
|
exports.deleteStatus = deleteStatus;
|
|
64
58
|
async function updateCreationTransition(id, data) {
|
|
65
|
-
|
|
66
|
-
return response.data;
|
|
59
|
+
return (0, exh_1.getSdk)().data.transitions.updateCreation(id, data);
|
|
67
60
|
}
|
|
68
61
|
exports.updateCreationTransition = updateCreationTransition;
|
|
69
62
|
async function createTransition(id, data) {
|
|
70
|
-
|
|
71
|
-
return response.data;
|
|
63
|
+
return (0, exh_1.getSdk)().data.transitions.create(id, data);
|
|
72
64
|
}
|
|
73
65
|
exports.createTransition = createTransition;
|
|
74
66
|
async function updateTransition(schemaId, transitionId, data) {
|
|
75
|
-
|
|
76
|
-
return response.data;
|
|
67
|
+
return (0, exh_1.getSdk)().data.transitions.update(schemaId, transitionId, data);
|
|
77
68
|
}
|
|
78
69
|
exports.updateTransition = updateTransition;
|
|
79
70
|
async function deleteTransition(schemaId, transitionId) {
|
|
80
|
-
|
|
81
|
-
return response.data;
|
|
71
|
+
return (0, exh_1.getSdk)().data.transitions.remove(schemaId, transitionId);
|
|
82
72
|
}
|
|
83
73
|
exports.deleteTransition = deleteTransition;
|
|
84
74
|
async function createIndex(schemaId, index) {
|
|
85
|
-
|
|
86
|
-
return response.data;
|
|
75
|
+
return (0, exh_1.getSdk)().data.indexes.create(schemaId, index);
|
|
87
76
|
}
|
|
88
77
|
exports.createIndex = createIndex;
|
|
89
78
|
async function deleteIndex(schemaId, indexId) {
|
|
90
|
-
|
|
91
|
-
return response.data;
|
|
79
|
+
return (0, exh_1.getSdk)().data.indexes.remove(indexId, schemaId);
|
|
92
80
|
}
|
|
93
81
|
exports.deleteIndex = deleteIndex;
|
|
@@ -1,29 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
permissionRequired = "permissionRequired",
|
|
3
|
-
allUsers = "allUsers",
|
|
4
|
-
public = "public"
|
|
5
|
-
}
|
|
1
|
+
import { FunctionCreation, FunctionPermissionMode } from '@extrahorizon/javascript-sdk';
|
|
6
2
|
export interface TaskConfig {
|
|
7
|
-
name?:
|
|
3
|
+
name?: FunctionCreation['name'];
|
|
8
4
|
path?: string;
|
|
9
|
-
entryPoint?:
|
|
10
|
-
runtime?:
|
|
11
|
-
description?:
|
|
12
|
-
timeLimit?:
|
|
13
|
-
memoryLimit?:
|
|
5
|
+
entryPoint?: FunctionCreation['entryPoint'];
|
|
6
|
+
runtime?: FunctionCreation['runtime'];
|
|
7
|
+
description?: FunctionCreation['description'];
|
|
8
|
+
timeLimit?: FunctionCreation['timeLimit'];
|
|
9
|
+
memoryLimit?: FunctionCreation['memoryLimit'];
|
|
14
10
|
environment?: Record<string, string>;
|
|
15
|
-
executionPermission?:
|
|
11
|
+
executionPermission?: FunctionPermissionMode;
|
|
16
12
|
defaultPriority?: number;
|
|
17
|
-
retryPolicy?:
|
|
18
|
-
enabled: boolean;
|
|
19
|
-
errorsToRetry: string[];
|
|
20
|
-
};
|
|
13
|
+
retryPolicy?: FunctionCreation['retryPolicy'];
|
|
21
14
|
executionCredentials?: {
|
|
22
15
|
email?: string;
|
|
23
16
|
permissions: string[];
|
|
24
17
|
};
|
|
25
18
|
}
|
|
26
|
-
export declare function assertExecutionPermission(mode: string): asserts mode is
|
|
19
|
+
export declare function assertExecutionPermission(mode: string): asserts mode is FunctionPermissionMode | undefined;
|
|
27
20
|
export declare function validateConfig(config: any): Promise<boolean>;
|
|
28
21
|
export declare function loadSingleConfigFile(path: string): Promise<TaskConfig>;
|
|
29
22
|
export declare function getValidatedConfigIterator({ path, name, code, entryPoint, runtime, description, timeLimit, memoryLimit, executionPermission, env, defaultPriority }: any): AsyncGenerator<TaskConfig>;
|
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getValidatedConfigIterator = exports.loadSingleConfigFile = exports.validateConfig = exports.assertExecutionPermission =
|
|
3
|
+
exports.getValidatedConfigIterator = exports.loadSingleConfigFile = exports.validateConfig = exports.assertExecutionPermission = void 0;
|
|
4
4
|
const assert_1 = require("assert");
|
|
5
5
|
const fs = require("fs/promises");
|
|
6
6
|
const ospath = require("path");
|
|
7
|
+
const javascript_sdk_1 = require("@extrahorizon/javascript-sdk");
|
|
7
8
|
const taskConfigSchema = require("../../config-json-schemas/TaskConfig.json");
|
|
8
9
|
const util_1 = require("../../helpers/util");
|
|
9
|
-
var permissionModes;
|
|
10
|
-
(function (permissionModes) {
|
|
11
|
-
permissionModes["permissionRequired"] = "permissionRequired";
|
|
12
|
-
permissionModes["allUsers"] = "allUsers";
|
|
13
|
-
permissionModes["public"] = "public";
|
|
14
|
-
})(permissionModes = exports.permissionModes || (exports.permissionModes = {}));
|
|
15
10
|
function assertExecutionPermission(mode) {
|
|
16
|
-
if (mode !== undefined && !Object.values(
|
|
17
|
-
throw new assert_1.AssertionError({ message: `executionPermission incorrect. Should be one of ${Object.values(
|
|
11
|
+
if (mode !== undefined && !Object.values(javascript_sdk_1.FunctionPermissionMode).includes(mode)) {
|
|
12
|
+
throw new assert_1.AssertionError({ message: `executionPermission incorrect. Should be one of ${Object.values(javascript_sdk_1.FunctionPermissionMode).join(',')}` });
|
|
18
13
|
}
|
|
19
14
|
}
|
|
20
15
|
exports.assertExecutionPermission = assertExecutionPermission;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@extrahorizon/exh-cli",
|
|
3
|
-
"version": "1.13.0-dev-
|
|
3
|
+
"version": "1.13.0-dev-174-348b2fa",
|
|
4
4
|
"main": "build/index.js",
|
|
5
5
|
"exports": "./build/index.js",
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"typescript": "4.5.5"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@extrahorizon/javascript-sdk": "8.9.1-dev-
|
|
44
|
+
"@extrahorizon/javascript-sdk": "8.9.1-dev-153-23dbf01",
|
|
45
45
|
"ajv": "8.18.0",
|
|
46
46
|
"archiver": "^7.0.1",
|
|
47
47
|
"chalk": "^4.0.0",
|