@extrahorizon/exh-cli 1.12.0-dev-131-de586fc → 1.12.0-dev-133-f596ee5
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/commands/data/schemas/delete.d.ts +1 -2
- package/build/commands/data/schemas/delete.js +3 -3
- package/build/commands/data/schemas/list.d.ts +1 -2
- package/build/commands/data/schemas/list.js +3 -2
- package/build/commands/data/schemas/sync.d.ts +3 -4
- package/build/commands/data/schemas/sync.js +7 -7
- package/build/commands/data/schemas/util/syncSchema.d.ts +2 -3
- package/build/commands/data/schemas/util/syncSchema.js +18 -19
- package/build/commands/dispatchers/sync.d.ts +1 -3
- package/build/commands/dispatchers/sync.js +2 -2
- package/build/commands/localizations/sync.d.ts +1 -3
- package/build/commands/localizations/sync.js +2 -2
- package/build/commands/sync.d.ts +1 -3
- package/build/commands/sync.js +6 -6
- package/build/commands/tasks/delete.d.ts +1 -2
- package/build/commands/tasks/delete.js +2 -2
- package/build/commands/tasks/list.d.ts +1 -2
- package/build/commands/tasks/list.js +3 -2
- package/build/commands/tasks/sync.d.ts +1 -2
- package/build/commands/tasks/sync.js +8 -8
- package/build/commands/tasks/util.d.ts +1 -2
- package/build/commands/tasks/util.js +18 -18
- package/build/commands/templates/delete.d.ts +1 -3
- package/build/commands/templates/delete.js +5 -4
- package/build/commands/templates/get.d.ts +1 -3
- package/build/commands/templates/get.js +3 -2
- package/build/commands/templates/list.d.ts +1 -3
- package/build/commands/templates/list.js +3 -2
- package/build/commands/templates/sync.d.ts +1 -2
- package/build/commands/templates/sync.js +2 -2
- package/build/commands/templates/util/templateService.d.ts +1 -2
- package/build/commands/templates/util/templateService.js +3 -2
- package/build/commands/whoami.d.ts +1 -4
- package/build/commands/whoami.js +3 -3
- package/build/exh.d.ts +1 -0
- package/build/exh.js +8 -1
- package/build/index.js +3 -3
- package/build/repositories/auth.d.ts +3 -4
- package/build/repositories/auth.js +7 -6
- package/build/repositories/dispatchers.d.ts +8 -8
- package/build/repositories/dispatchers.js +15 -14
- package/build/repositories/functions.d.ts +5 -6
- package/build/repositories/functions.js +11 -10
- package/build/repositories/localizations.d.ts +3 -3
- package/build/repositories/localizations.js +5 -4
- package/build/repositories/schemas.d.ts +18 -18
- package/build/repositories/schemas.js +35 -34
- package/build/repositories/user.d.ts +9 -9
- package/build/repositories/user.js +17 -16
- package/build/services/dispatchers.d.ts +1 -2
- package/build/services/dispatchers.js +18 -18
- package/build/services/localizations/index.d.ts +1 -2
- package/build/services/localizations/index.js +2 -2
- package/build/services/localizations/syncLocalizations.d.ts +1 -2
- package/build/services/localizations/syncLocalizations.js +3 -3
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.handler = exports.builder = exports.desc = exports.command = void 0;
|
|
4
4
|
const chalk = require("chalk");
|
|
5
|
+
const exh_1 = require("../../exh");
|
|
5
6
|
const util_1 = require("../../helpers/util");
|
|
6
7
|
exports.command = 'delete';
|
|
7
8
|
exports.desc = 'Delete a template';
|
|
@@ -21,20 +22,20 @@ const builder = (yargs) => (0, util_1.epilogue)(yargs).options({
|
|
|
21
22
|
return true;
|
|
22
23
|
});
|
|
23
24
|
exports.builder = builder;
|
|
24
|
-
const handler = async function list({
|
|
25
|
+
const handler = async function list({ name, id }) {
|
|
25
26
|
let template = null;
|
|
26
27
|
if (name) {
|
|
27
|
-
template = await
|
|
28
|
+
template = await (0, exh_1.getSdk)().templates.findByName(name);
|
|
28
29
|
}
|
|
29
30
|
if (id) {
|
|
30
|
-
template = await
|
|
31
|
+
template = await (0, exh_1.getSdk)().templates.findById(id);
|
|
31
32
|
}
|
|
32
33
|
if (!template) {
|
|
33
34
|
console.log(chalk.red('Template not found!'));
|
|
34
35
|
return;
|
|
35
36
|
}
|
|
36
37
|
try {
|
|
37
|
-
const { affectedRecords } = await
|
|
38
|
+
const { affectedRecords } = await (0, exh_1.getSdk)().templates.remove(template.id);
|
|
38
39
|
if (!affectedRecords) {
|
|
39
40
|
console.log(chalk.red('Failed to remove template', name));
|
|
40
41
|
return;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="yargs" />
|
|
2
|
-
import { OAuth1Client } from '@extrahorizon/javascript-sdk';
|
|
3
2
|
export declare const command = "get";
|
|
4
3
|
export declare const desc = "Fetch a template";
|
|
5
4
|
export declare const builder: (yargs: any) => import("yargs").Argv<import("yargs").Omit<{}, "id" | "name"> & import("yargs").InferredOptionTypes<{
|
|
@@ -12,8 +11,7 @@ export declare const builder: (yargs: any) => import("yargs").Argv<import("yargs
|
|
|
12
11
|
type: "string";
|
|
13
12
|
};
|
|
14
13
|
}>>;
|
|
15
|
-
export declare const handler: ({
|
|
16
|
-
sdk: OAuth1Client;
|
|
14
|
+
export declare const handler: ({ name, id }: {
|
|
17
15
|
name: string;
|
|
18
16
|
id: string;
|
|
19
17
|
}) => Promise<void>;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.handler = exports.builder = exports.desc = exports.command = void 0;
|
|
4
4
|
const chalk = require("chalk");
|
|
5
|
+
const exh_1 = require("../../exh");
|
|
5
6
|
const util_1 = require("../../helpers/util");
|
|
6
7
|
exports.command = 'get';
|
|
7
8
|
exports.desc = 'Fetch a template';
|
|
@@ -21,9 +22,9 @@ const builder = (yargs) => (0, util_1.epilogue)(yargs).options({
|
|
|
21
22
|
return true;
|
|
22
23
|
});
|
|
23
24
|
exports.builder = builder;
|
|
24
|
-
const handler = async function list({
|
|
25
|
+
const handler = async function list({ name, id }) {
|
|
25
26
|
try {
|
|
26
|
-
const template = name ? await
|
|
27
|
+
const template = name ? await (0, exh_1.getSdk)().templates.findByName(name) : await (0, exh_1.getSdk)().templates.findById(id);
|
|
27
28
|
if (!template) {
|
|
28
29
|
console.log(chalk.red('Failed to get template!'));
|
|
29
30
|
return;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
/// <reference types="yargs" />
|
|
2
|
-
import { OAuth1Client } from '@extrahorizon/javascript-sdk';
|
|
3
2
|
export declare const command = "list";
|
|
4
3
|
export declare const desc = "List all templates";
|
|
5
4
|
export declare const builder: (yargs: any) => import("yargs").Argv<{}>;
|
|
6
|
-
export declare const handler: ({
|
|
7
|
-
sdk: OAuth1Client;
|
|
5
|
+
export declare const handler: ({ isTTY }: {
|
|
8
6
|
isTTY: boolean;
|
|
9
7
|
}) => Promise<void>;
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.handler = exports.builder = exports.desc = exports.command = void 0;
|
|
4
4
|
const chalk = require("chalk");
|
|
5
|
+
const exh_1 = require("../../exh");
|
|
5
6
|
const util_1 = require("../../helpers/util");
|
|
6
7
|
exports.command = 'list';
|
|
7
8
|
exports.desc = 'List all templates';
|
|
8
9
|
const builder = (yargs) => (0, util_1.epilogue)(yargs);
|
|
9
10
|
exports.builder = builder;
|
|
10
|
-
const handler = async function list({
|
|
11
|
-
const templates = await
|
|
11
|
+
const handler = async function list({ isTTY }) {
|
|
12
|
+
const templates = await (0, exh_1.getSdk)().templates.findAll();
|
|
12
13
|
if (templates) {
|
|
13
14
|
if (!templates.length) {
|
|
14
15
|
console.log(chalk.red('No templates found'));
|
|
@@ -14,8 +14,7 @@ export declare const builder: (yargs: any) => import("yargs").Argv<import("yargs
|
|
|
14
14
|
type: "string";
|
|
15
15
|
};
|
|
16
16
|
}>>;
|
|
17
|
-
export declare const handler: ({
|
|
18
|
-
sdk: any;
|
|
17
|
+
export declare const handler: ({ path, template }: {
|
|
19
18
|
path: any;
|
|
20
19
|
template: any;
|
|
21
20
|
}) => Promise<void>;
|
|
@@ -35,8 +35,8 @@ const builder = (yargs) => (0, util_1.epilogue)(yargs).options({
|
|
|
35
35
|
return true;
|
|
36
36
|
});
|
|
37
37
|
exports.builder = builder;
|
|
38
|
-
const handler = async ({
|
|
39
|
-
const service = new templateService_1.TemplateService(
|
|
38
|
+
const handler = async ({ path, template }) => {
|
|
39
|
+
const service = new templateService_1.TemplateService();
|
|
40
40
|
if (path) {
|
|
41
41
|
await syncTargetDir(service, ospath.resolve(path || '.'));
|
|
42
42
|
return;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { OAuth1Client } from '@extrahorizon/javascript-sdk';
|
|
2
1
|
export declare class TemplateService {
|
|
3
2
|
private sdk;
|
|
4
|
-
constructor(
|
|
3
|
+
constructor();
|
|
5
4
|
byName(name: string): Promise<import("@extrahorizon/javascript-sdk").TemplateOut>;
|
|
6
5
|
update(name: string, data: any): Promise<import("@extrahorizon/javascript-sdk").TemplateOut>;
|
|
7
6
|
create(data: any): Promise<import("@extrahorizon/javascript-sdk").TemplateOut>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TemplateService = void 0;
|
|
4
|
+
const exh_1 = require("../../../exh");
|
|
4
5
|
class TemplateService {
|
|
5
|
-
constructor(
|
|
6
|
-
this.sdk =
|
|
6
|
+
constructor() {
|
|
7
|
+
this.sdk = (0, exh_1.getSdk)();
|
|
7
8
|
}
|
|
8
9
|
async byName(name) {
|
|
9
10
|
return this.sdk.templates.findByName(name);
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
/// <reference types="yargs" />
|
|
2
|
-
import type { OAuth1Client } from '@extrahorizon/javascript-sdk';
|
|
3
2
|
export declare const command = "whoami";
|
|
4
3
|
export declare const desc = "Shows the currently logged in user";
|
|
5
4
|
export declare const builder: (yargs: any) => import("yargs").Argv<{}>;
|
|
6
|
-
export declare const handler: (
|
|
7
|
-
sdk: OAuth1Client;
|
|
8
|
-
}) => Promise<void>;
|
|
5
|
+
export declare const handler: () => Promise<void>;
|
package/build/commands/whoami.js
CHANGED
|
@@ -7,14 +7,14 @@ exports.command = 'whoami';
|
|
|
7
7
|
exports.desc = 'Shows the currently logged in user';
|
|
8
8
|
const builder = (yargs) => (0, util_1.epilogue)(yargs);
|
|
9
9
|
exports.builder = builder;
|
|
10
|
-
const handler = async function list(
|
|
11
|
-
const host = authRepository.getHost(
|
|
10
|
+
const handler = async function list() {
|
|
11
|
+
const host = authRepository.getHost();
|
|
12
12
|
if (!host) {
|
|
13
13
|
console.log('No ExH cluster host was found in the configuration.');
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
16
16
|
console.log('You are targeting:', host);
|
|
17
|
-
const currentUser = await authRepository.fetchMe(
|
|
17
|
+
const currentUser = await authRepository.fetchMe();
|
|
18
18
|
console.log('You are logged in as:', currentUser.email);
|
|
19
19
|
};
|
|
20
20
|
exports.handler = handler;
|
package/build/exh.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { OAuth1Client } from '@extrahorizon/javascript-sdk';
|
|
2
2
|
export declare function sdkInitOnly(apiHost: string, consumerKey: string, consumerSecret: string): OAuth1Client;
|
|
3
3
|
export declare function sdkAuth(): Promise<OAuth1Client>;
|
|
4
|
+
export declare function getSdk(): OAuth1Client;
|
package/build/exh.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sdkAuth = exports.sdkInitOnly = void 0;
|
|
3
|
+
exports.getSdk = exports.sdkAuth = exports.sdkInitOnly = void 0;
|
|
4
4
|
const javascript_sdk_1 = require("@extrahorizon/javascript-sdk");
|
|
5
5
|
const util_1 = require("./helpers/util");
|
|
6
6
|
let sdk = null;
|
|
@@ -32,3 +32,10 @@ async function sdkAuth() {
|
|
|
32
32
|
return sdk;
|
|
33
33
|
}
|
|
34
34
|
exports.sdkAuth = sdkAuth;
|
|
35
|
+
function getSdk() {
|
|
36
|
+
if (!sdk) {
|
|
37
|
+
throw new Error('SDK not initialized. Please call sdkAuth() or sdkInitOnly() first.');
|
|
38
|
+
}
|
|
39
|
+
return sdk;
|
|
40
|
+
}
|
|
41
|
+
exports.getSdk = getSdk;
|
package/build/index.js
CHANGED
|
@@ -16,10 +16,10 @@ yargs((0, helpers_1.hideBin)(process.argv))
|
|
|
16
16
|
(0, lodash_1.isEqual)(argv._, ['completion']) ||
|
|
17
17
|
(0, lodash_1.isEqual)(argv._, ['generate_completion']) ||
|
|
18
18
|
process.env.NO_SDK) {
|
|
19
|
-
return {
|
|
19
|
+
return { isTTY };
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
return {
|
|
21
|
+
await (0, exh_1.sdkAuth)();
|
|
22
|
+
return { isTTY };
|
|
23
23
|
})
|
|
24
24
|
.commandDir('commands')
|
|
25
25
|
.scriptName('exh')
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function
|
|
3
|
-
export declare function
|
|
4
|
-
export declare function fetchMe(sdk: OAuth1Client): Promise<import("@extrahorizon/javascript-sdk").UserData>;
|
|
1
|
+
export declare function getHost(): string;
|
|
2
|
+
export declare function createOAuth1Tokens(email: string, password: string): Promise<any>;
|
|
3
|
+
export declare function fetchMe(): Promise<import("@extrahorizon/javascript-sdk").UserData>;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.fetchMe = exports.createOAuth1Tokens = exports.getHost = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const exh_1 = require("../exh");
|
|
5
|
+
function getHost() {
|
|
6
|
+
return (0, exh_1.getSdk)()?.raw?.defaults?.baseURL;
|
|
6
7
|
}
|
|
7
8
|
exports.getHost = getHost;
|
|
8
|
-
async function createOAuth1Tokens(
|
|
9
|
-
const response = await
|
|
9
|
+
async function createOAuth1Tokens(email, password) {
|
|
10
|
+
const response = await (0, exh_1.getSdk)().raw.post('/auth/v2/oauth1/tokens', { email, password });
|
|
10
11
|
return response.data;
|
|
11
12
|
}
|
|
12
13
|
exports.createOAuth1Tokens = createOAuth1Tokens;
|
|
13
|
-
async function fetchMe(
|
|
14
|
-
return await
|
|
14
|
+
async function fetchMe() {
|
|
15
|
+
return await (0, exh_1.getSdk)()?.users.me();
|
|
15
16
|
}
|
|
16
17
|
exports.fetchMe = fetchMe;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ActionCreation, ActionUpdate, DispatcherCreation, DispatcherUpdate,
|
|
2
|
-
export declare function create(
|
|
3
|
-
export declare function findAll(
|
|
4
|
-
export declare function update(
|
|
5
|
-
export declare function remove(
|
|
6
|
-
export declare function createAction(
|
|
7
|
-
export declare function updateAction(
|
|
8
|
-
export declare function removeAction(
|
|
1
|
+
import { ActionCreation, ActionUpdate, DispatcherCreation, DispatcherUpdate, ObjectId, RQLString } from '@extrahorizon/javascript-sdk';
|
|
2
|
+
export declare function create(data: DispatcherCreation): Promise<import("@extrahorizon/javascript-sdk").Dispatcher>;
|
|
3
|
+
export declare function findAll(rql?: RQLString): Promise<import("@extrahorizon/javascript-sdk").Dispatcher[]>;
|
|
4
|
+
export declare function update(dispatcherId: ObjectId, data: DispatcherUpdate): Promise<import("@extrahorizon/javascript-sdk").AffectedRecords>;
|
|
5
|
+
export declare function remove(dispatcherId: ObjectId): Promise<import("@extrahorizon/javascript-sdk").AffectedRecords>;
|
|
6
|
+
export declare function createAction(dispatcherId: ObjectId, data: ActionCreation): Promise<import("@extrahorizon/javascript-sdk").Action>;
|
|
7
|
+
export declare function updateAction(dispatcherId: ObjectId, actionId: ObjectId, data: ActionUpdate): Promise<import("@extrahorizon/javascript-sdk").AffectedRecords>;
|
|
8
|
+
export declare function removeAction(dispatcherId: ObjectId, actionId: ObjectId): Promise<import("@extrahorizon/javascript-sdk").AffectedRecords>;
|
|
@@ -1,31 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.removeAction = exports.updateAction = exports.createAction = exports.remove = exports.update = exports.findAll = exports.create = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const exh_1 = require("../exh");
|
|
5
|
+
async function create(data) {
|
|
6
|
+
return await (0, exh_1.getSdk)().dispatchers.create(data);
|
|
6
7
|
}
|
|
7
8
|
exports.create = create;
|
|
8
|
-
async function findAll(
|
|
9
|
-
return await
|
|
9
|
+
async function findAll(rql) {
|
|
10
|
+
return await (0, exh_1.getSdk)().dispatchers.findAll({ rql });
|
|
10
11
|
}
|
|
11
12
|
exports.findAll = findAll;
|
|
12
|
-
async function update(
|
|
13
|
-
return await
|
|
13
|
+
async function update(dispatcherId, data) {
|
|
14
|
+
return await (0, exh_1.getSdk)().dispatchers.update(dispatcherId, data);
|
|
14
15
|
}
|
|
15
16
|
exports.update = update;
|
|
16
|
-
async function remove(
|
|
17
|
-
return await
|
|
17
|
+
async function remove(dispatcherId) {
|
|
18
|
+
return await (0, exh_1.getSdk)().dispatchers.remove(dispatcherId);
|
|
18
19
|
}
|
|
19
20
|
exports.remove = remove;
|
|
20
|
-
async function createAction(
|
|
21
|
-
return await
|
|
21
|
+
async function createAction(dispatcherId, data) {
|
|
22
|
+
return await (0, exh_1.getSdk)().dispatchers.actions.create(dispatcherId, data);
|
|
22
23
|
}
|
|
23
24
|
exports.createAction = createAction;
|
|
24
|
-
async function updateAction(
|
|
25
|
-
return await
|
|
25
|
+
async function updateAction(dispatcherId, actionId, data) {
|
|
26
|
+
return await (0, exh_1.getSdk)().dispatchers.actions.update(dispatcherId, actionId, data);
|
|
26
27
|
}
|
|
27
28
|
exports.updateAction = updateAction;
|
|
28
|
-
async function removeAction(
|
|
29
|
-
return await
|
|
29
|
+
async function removeAction(dispatcherId, actionId) {
|
|
30
|
+
return await (0, exh_1.getSdk)().dispatchers.actions.remove(dispatcherId, actionId);
|
|
30
31
|
}
|
|
31
32
|
exports.removeAction = removeAction;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { OAuth1Client } from '@extrahorizon/javascript-sdk';
|
|
2
1
|
import { permissionModes } from '../commands/tasks/taskConfig';
|
|
3
2
|
export interface FunctionCreation {
|
|
4
3
|
name: string;
|
|
@@ -18,8 +17,8 @@ export interface FunctionCreation {
|
|
|
18
17
|
errorsToRetry: string[];
|
|
19
18
|
};
|
|
20
19
|
}
|
|
21
|
-
export declare function find(
|
|
22
|
-
export declare function findByName(
|
|
23
|
-
export declare function create(
|
|
24
|
-
export declare function update(
|
|
25
|
-
export declare function remove(
|
|
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,13 +1,14 @@
|
|
|
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
|
-
|
|
5
|
-
|
|
4
|
+
const exh_1 = require("../exh");
|
|
5
|
+
async function find() {
|
|
6
|
+
const response = await (0, exh_1.getSdk)().raw.get('/tasks/v1/functions');
|
|
6
7
|
return response.data.data;
|
|
7
8
|
}
|
|
8
9
|
exports.find = find;
|
|
9
|
-
async function findByName(
|
|
10
|
-
const response = await
|
|
10
|
+
async function findByName(name) {
|
|
11
|
+
const response = await (0, exh_1.getSdk)().raw.get(`/tasks/v1/functions/${name}`, { customResponseKeys: ['*'] })
|
|
11
12
|
.catch(e => e);
|
|
12
13
|
if (response.status === 404) {
|
|
13
14
|
return undefined;
|
|
@@ -15,18 +16,18 @@ async function findByName(sdk, name) {
|
|
|
15
16
|
return response.data;
|
|
16
17
|
}
|
|
17
18
|
exports.findByName = findByName;
|
|
18
|
-
async function create(
|
|
19
|
-
const response = await
|
|
19
|
+
async function create(data) {
|
|
20
|
+
const response = await (0, exh_1.getSdk)().raw.post('/tasks/v1/functions', data);
|
|
20
21
|
return response.data;
|
|
21
22
|
}
|
|
22
23
|
exports.create = create;
|
|
23
|
-
async function update(
|
|
24
|
-
const response = await
|
|
24
|
+
async function update(data) {
|
|
25
|
+
const response = await (0, exh_1.getSdk)().raw.put(`/tasks/v1/functions/${data.name}`, data);
|
|
25
26
|
return response.data;
|
|
26
27
|
}
|
|
27
28
|
exports.update = update;
|
|
28
|
-
async function remove(
|
|
29
|
-
const response = await
|
|
29
|
+
async function remove(name) {
|
|
30
|
+
const response = await (0, exh_1.getSdk)().raw.delete(`/tasks/v1/functions/${name}`);
|
|
30
31
|
return response.data;
|
|
31
32
|
}
|
|
32
33
|
exports.remove = remove;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Localization
|
|
2
|
-
export declare function create(
|
|
3
|
-
export declare function update(
|
|
1
|
+
import { Localization } from '@extrahorizon/javascript-sdk';
|
|
2
|
+
export declare function create(localizations: PartialLocalization[]): Promise<import("@extrahorizon/javascript-sdk").BulkCreationResponse>;
|
|
3
|
+
export declare function update(localizations: PartialLocalization[]): Promise<import("@extrahorizon/javascript-sdk").BulkUpdateResponse>;
|
|
4
4
|
export declare type PartialLocalization = Pick<Localization, 'key' | 'text'>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.update = exports.create = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const exh_1 = require("../exh");
|
|
5
|
+
async function create(localizations) {
|
|
6
|
+
return await (0, exh_1.getSdk)().localizations.create({ localizations });
|
|
6
7
|
}
|
|
7
8
|
exports.create = create;
|
|
8
|
-
async function update(
|
|
9
|
-
return await
|
|
9
|
+
async function update(localizations) {
|
|
10
|
+
return await (0, exh_1.getSdk)().localizations.update({ localizations });
|
|
10
11
|
}
|
|
11
12
|
exports.update = update;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ObjectId } from '@extrahorizon/javascript-sdk';
|
|
2
2
|
interface Transition {
|
|
3
3
|
name: string;
|
|
4
4
|
type: string;
|
|
@@ -14,31 +14,31 @@ interface Transition {
|
|
|
14
14
|
type: string;
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
export declare function remove(
|
|
18
|
-
export declare function disable(
|
|
19
|
-
export declare function fetchSchemaByName(
|
|
20
|
-
export declare function createSchema(
|
|
21
|
-
export declare function updateSchema(
|
|
22
|
-
export declare function createProperty(
|
|
17
|
+
export declare function remove(schemaId: ObjectId): Promise<import("@extrahorizon/javascript-sdk").AffectedRecords>;
|
|
18
|
+
export declare function disable(schemaId: ObjectId): Promise<import("@extrahorizon/javascript-sdk").AffectedRecords>;
|
|
19
|
+
export declare function fetchSchemaByName(name: string): Promise<import("@extrahorizon/javascript-sdk").Schema>;
|
|
20
|
+
export declare function createSchema(name: string, description: string): Promise<import("@extrahorizon/javascript-sdk").Schema>;
|
|
21
|
+
export declare function updateSchema(id: string, data: any): Promise<import("@extrahorizon/javascript-sdk").AffectedRecords>;
|
|
22
|
+
export declare function createProperty(id: string, data: {
|
|
23
23
|
name: string;
|
|
24
24
|
configuration: {
|
|
25
25
|
type: string;
|
|
26
26
|
};
|
|
27
27
|
}): Promise<any>;
|
|
28
|
-
export declare function updateProperty(
|
|
28
|
+
export declare function updateProperty(id: string, path: string, data: {
|
|
29
29
|
name: string;
|
|
30
30
|
configuration: {
|
|
31
31
|
type: string;
|
|
32
32
|
};
|
|
33
33
|
}): Promise<any>;
|
|
34
|
-
export declare function deleteProperty(
|
|
35
|
-
export declare function createStatus(
|
|
36
|
-
export declare function updateStatus(
|
|
37
|
-
export declare function deleteStatus(
|
|
38
|
-
export declare function updateCreationTransition(
|
|
39
|
-
export declare function createTransition(
|
|
40
|
-
export declare function updateTransition(
|
|
41
|
-
export declare function deleteTransition(
|
|
42
|
-
export declare function createIndex(
|
|
43
|
-
export declare function deleteIndex(
|
|
34
|
+
export declare function deleteProperty(id: string, path: string): Promise<any>;
|
|
35
|
+
export declare function createStatus(id: string, name: string, data: object): Promise<any>;
|
|
36
|
+
export declare function updateStatus(id: string, name: string, data: object): Promise<any>;
|
|
37
|
+
export declare function deleteStatus(id: string, name: string): Promise<any>;
|
|
38
|
+
export declare function updateCreationTransition(id: string, data: Transition): Promise<any>;
|
|
39
|
+
export declare function createTransition(id: string, data: Transition): Promise<any>;
|
|
40
|
+
export declare function updateTransition(schemaId: string, transitionId: string, data: Transition): Promise<any>;
|
|
41
|
+
export declare function deleteTransition(schemaId: string, transitionId: string): Promise<any>;
|
|
42
|
+
export declare function createIndex(schemaId: string, index: any): Promise<any>;
|
|
43
|
+
export declare function deleteIndex(schemaId: string, indexId: string): Promise<any>;
|
|
44
44
|
export {};
|
|
@@ -1,86 +1,87 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
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;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const exh_1 = require("../exh");
|
|
5
|
+
async function remove(schemaId) {
|
|
6
|
+
return await (0, exh_1.getSdk)().data.schemas.remove(schemaId);
|
|
6
7
|
}
|
|
7
8
|
exports.remove = remove;
|
|
8
|
-
async function disable(
|
|
9
|
-
return await
|
|
9
|
+
async function disable(schemaId) {
|
|
10
|
+
return await (0, exh_1.getSdk)().data.schemas.disable(schemaId);
|
|
10
11
|
}
|
|
11
12
|
exports.disable = disable;
|
|
12
|
-
async function fetchSchemaByName(
|
|
13
|
-
return await
|
|
13
|
+
async function fetchSchemaByName(name) {
|
|
14
|
+
return await (0, exh_1.getSdk)().data.schemas.findByName(name);
|
|
14
15
|
}
|
|
15
16
|
exports.fetchSchemaByName = fetchSchemaByName;
|
|
16
|
-
async function createSchema(
|
|
17
|
-
return await
|
|
17
|
+
async function createSchema(name, description) {
|
|
18
|
+
return await (0, exh_1.getSdk)().data.schemas.create({
|
|
18
19
|
name,
|
|
19
20
|
description,
|
|
20
21
|
});
|
|
21
22
|
}
|
|
22
23
|
exports.createSchema = createSchema;
|
|
23
|
-
async function updateSchema(
|
|
24
|
-
return await
|
|
24
|
+
async function updateSchema(id, data) {
|
|
25
|
+
return await (0, exh_1.getSdk)().data.schemas.update(id, data);
|
|
25
26
|
}
|
|
26
27
|
exports.updateSchema = updateSchema;
|
|
27
|
-
async function createProperty(
|
|
28
|
-
const response = await
|
|
28
|
+
async function createProperty(id, data) {
|
|
29
|
+
const response = await (0, exh_1.getSdk)().raw.post(`/data/v1/${id}/properties`, data);
|
|
29
30
|
return response.data;
|
|
30
31
|
}
|
|
31
32
|
exports.createProperty = createProperty;
|
|
32
|
-
async function updateProperty(
|
|
33
|
-
const response = await
|
|
33
|
+
async function updateProperty(id, path, data) {
|
|
34
|
+
const response = await (0, exh_1.getSdk)().raw.put(`/data/v1/${id}/properties/${path}`, data);
|
|
34
35
|
return response.data;
|
|
35
36
|
}
|
|
36
37
|
exports.updateProperty = updateProperty;
|
|
37
|
-
async function deleteProperty(
|
|
38
|
-
const response = await
|
|
38
|
+
async function deleteProperty(id, path) {
|
|
39
|
+
const response = await (0, exh_1.getSdk)().raw.delete(`/data/v1/${id}/properties/${path}`);
|
|
39
40
|
return response.data;
|
|
40
41
|
}
|
|
41
42
|
exports.deleteProperty = deleteProperty;
|
|
42
|
-
async function createStatus(
|
|
43
|
-
const response = await
|
|
43
|
+
async function createStatus(id, name, data) {
|
|
44
|
+
const response = await (0, exh_1.getSdk)().raw.post(`/data/v1/${id}/statuses`, { name, data });
|
|
44
45
|
return response.data;
|
|
45
46
|
}
|
|
46
47
|
exports.createStatus = createStatus;
|
|
47
|
-
async function updateStatus(
|
|
48
|
-
const response = await
|
|
48
|
+
async function updateStatus(id, name, data) {
|
|
49
|
+
const response = await (0, exh_1.getSdk)().raw.put(`/data/v1/${id}/statuses/${name}`, { data });
|
|
49
50
|
return response.data;
|
|
50
51
|
}
|
|
51
52
|
exports.updateStatus = updateStatus;
|
|
52
|
-
async function deleteStatus(
|
|
53
|
-
const response = await
|
|
53
|
+
async function deleteStatus(id, name) {
|
|
54
|
+
const response = await (0, exh_1.getSdk)().raw.delete(`/data/v1/${id}/statuses/${name}`);
|
|
54
55
|
return response.data;
|
|
55
56
|
}
|
|
56
57
|
exports.deleteStatus = deleteStatus;
|
|
57
|
-
async function updateCreationTransition(
|
|
58
|
-
const response = await
|
|
58
|
+
async function updateCreationTransition(id, data) {
|
|
59
|
+
const response = await (0, exh_1.getSdk)().raw.put(`/data/v1/${id}/creationTransition`, data);
|
|
59
60
|
return response.data;
|
|
60
61
|
}
|
|
61
62
|
exports.updateCreationTransition = updateCreationTransition;
|
|
62
|
-
async function createTransition(
|
|
63
|
-
const response = await
|
|
63
|
+
async function createTransition(id, data) {
|
|
64
|
+
const response = await (0, exh_1.getSdk)().raw.post(`/data/v1/${id}/transitions`, data);
|
|
64
65
|
return response.data;
|
|
65
66
|
}
|
|
66
67
|
exports.createTransition = createTransition;
|
|
67
|
-
async function updateTransition(
|
|
68
|
-
const response = await
|
|
68
|
+
async function updateTransition(schemaId, transitionId, data) {
|
|
69
|
+
const response = await (0, exh_1.getSdk)().raw.put(`/data/v1/${schemaId}/transitions/${transitionId}`, data);
|
|
69
70
|
return response.data;
|
|
70
71
|
}
|
|
71
72
|
exports.updateTransition = updateTransition;
|
|
72
|
-
async function deleteTransition(
|
|
73
|
-
const response = await
|
|
73
|
+
async function deleteTransition(schemaId, transitionId) {
|
|
74
|
+
const response = await (0, exh_1.getSdk)().raw.delete(`/data/v1/${schemaId}/transitions/${transitionId}`);
|
|
74
75
|
return response.data;
|
|
75
76
|
}
|
|
76
77
|
exports.deleteTransition = deleteTransition;
|
|
77
|
-
async function createIndex(
|
|
78
|
-
const response = await
|
|
78
|
+
async function createIndex(schemaId, index) {
|
|
79
|
+
const response = await (0, exh_1.getSdk)().raw.post(`/data/v1/${schemaId}/indexes`, index);
|
|
79
80
|
return response.data;
|
|
80
81
|
}
|
|
81
82
|
exports.createIndex = createIndex;
|
|
82
|
-
async function deleteIndex(
|
|
83
|
-
const response = await
|
|
83
|
+
async function deleteIndex(schemaId, indexId) {
|
|
84
|
+
const response = await (0, exh_1.getSdk)().raw.delete(`/data/v1/${schemaId}/indexes/${indexId}`);
|
|
84
85
|
return response.data;
|
|
85
86
|
}
|
|
86
87
|
exports.deleteIndex = deleteIndex;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function findUserByEmail(
|
|
3
|
-
export declare function isEmailAvailable(
|
|
4
|
-
export declare function createUser(
|
|
5
|
-
export declare function findGlobalRoleByName(
|
|
6
|
-
export declare function createGlobalRole(
|
|
7
|
-
export declare function addPermissionsToGlobalRole(
|
|
8
|
-
export declare function removePermissionsFromGlobalRole(
|
|
9
|
-
export declare function addGlobalRoleToUser(
|
|
1
|
+
import { RegisterUserData } from '@extrahorizon/javascript-sdk';
|
|
2
|
+
export declare function findUserByEmail(email: string): Promise<import("@extrahorizon/javascript-sdk").UserData>;
|
|
3
|
+
export declare function isEmailAvailable(email: string): Promise<boolean>;
|
|
4
|
+
export declare function createUser(data: RegisterUserData): Promise<import("@extrahorizon/javascript-sdk").UserData>;
|
|
5
|
+
export declare function findGlobalRoleByName(name: string): Promise<import("@extrahorizon/javascript-sdk").Role>;
|
|
6
|
+
export declare function createGlobalRole(name: string, description: string): Promise<import("@extrahorizon/javascript-sdk").Role>;
|
|
7
|
+
export declare function addPermissionsToGlobalRole(name: string, permissions: string[]): Promise<import("@extrahorizon/javascript-sdk").AffectedRecords>;
|
|
8
|
+
export declare function removePermissionsFromGlobalRole(name: string, permissions: string[]): Promise<import("@extrahorizon/javascript-sdk").AffectedRecords>;
|
|
9
|
+
export declare function addGlobalRoleToUser(userId: string, roleId: string): Promise<import("@extrahorizon/javascript-sdk").AffectedRecords>;
|