@beseif-solutions/prow-core 0.0.29 → 0.0.31
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/dist/index.d.ts +2 -1
- package/dist/index.js +3 -1
- package/dist/minified-utils/locales.d.ts +5 -4
- package/dist/minified-utils/protocol.d.ts +41 -0
- package/dist/minified-utils/protocol.js +110 -0
- package/package.json +1 -2
- package/src/index.ts +2 -1
- package/src/minified-utils/locales.ts +5 -4
- package/src/minified-utils/protocol.ts +162 -0
package/dist/index.d.ts
CHANGED
|
@@ -6,5 +6,6 @@ export { Action, actionOutputSchema, actionSchema, Event, eventSchema, Immediate
|
|
|
6
6
|
export { Provider, providerSchema } from './entities/provider';
|
|
7
7
|
export { Source } from './entities/source';
|
|
8
8
|
export { extract, Field, fieldSchema, fieldsSchema, SelectFieldChoice, validate, ValidationResult } from './minified-utils/fields';
|
|
9
|
-
export { i18n, localizeFields, localizeInputs, localizeOutputs, localizeProperties } from './minified-utils/locales';
|
|
9
|
+
export { i18n, localizeFields, localizeInputs, localizeOutputs, localizeProperties, LocalizedField, LocalizedProperties } from './minified-utils/locales';
|
|
10
10
|
export { Properties } from './minified-utils/properties';
|
|
11
|
+
export { Protocol } from './minified-utils/protocol';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Properties = exports.localizeProperties = exports.localizeOutputs = exports.localizeInputs = exports.localizeFields = exports.i18n = exports.validate = exports.fieldsSchema = exports.fieldSchema = exports.extract = exports.providerSchema = exports.triggerSchema = exports.triggerOutputSchema = exports.scheduledTriggerSchema = exports.immediateTriggerSchema = exports.eventSchema = exports.actionSchema = exports.actionOutputSchema = exports.staticCredentialsSchema = exports.sessionCredentialsSchema = exports.oauthCredentialsSchema = exports.credentialsSchema = exports.idSchema = exports.getCategories = exports.core = void 0;
|
|
3
|
+
exports.Protocol = exports.Properties = exports.localizeProperties = exports.localizeOutputs = exports.localizeInputs = exports.localizeFields = exports.i18n = exports.validate = exports.fieldsSchema = exports.fieldSchema = exports.extract = exports.providerSchema = exports.triggerSchema = exports.triggerOutputSchema = exports.scheduledTriggerSchema = exports.immediateTriggerSchema = exports.eventSchema = exports.actionSchema = exports.actionOutputSchema = exports.staticCredentialsSchema = exports.sessionCredentialsSchema = exports.oauthCredentialsSchema = exports.credentialsSchema = exports.idSchema = exports.getCategories = exports.core = void 0;
|
|
4
4
|
var core_1 = require("./core");
|
|
5
5
|
Object.defineProperty(exports, "core", { enumerable: true, get: function () { return core_1.core; } });
|
|
6
6
|
var category_1 = require("./entities/category");
|
|
@@ -35,3 +35,5 @@ Object.defineProperty(exports, "localizeOutputs", { enumerable: true, get: funct
|
|
|
35
35
|
Object.defineProperty(exports, "localizeProperties", { enumerable: true, get: function () { return locales_1.localizeProperties; } });
|
|
36
36
|
var properties_1 = require("./minified-utils/properties");
|
|
37
37
|
Object.defineProperty(exports, "Properties", { enumerable: true, get: function () { return properties_1.Properties; } });
|
|
38
|
+
var protocol_1 = require("./minified-utils/protocol");
|
|
39
|
+
Object.defineProperty(exports, "Protocol", { enumerable: true, get: function () { return protocol_1.Protocol; } });
|
|
@@ -3,11 +3,12 @@ import { Credentials, SessionCredentials, StaticCredentials } from '../entities/
|
|
|
3
3
|
import { Action, ConnectableEvent, Trigger } from '../entities/events';
|
|
4
4
|
import { Field } from './fields';
|
|
5
5
|
import { Provider } from '../entities/provider';
|
|
6
|
-
|
|
6
|
+
import { Source } from '../entities/source';
|
|
7
|
+
export type LocalizedField = {
|
|
7
8
|
label: string;
|
|
8
9
|
help: string;
|
|
9
10
|
};
|
|
10
|
-
type LocalizedProperties = {
|
|
11
|
+
export type LocalizedProperties = {
|
|
11
12
|
name: string;
|
|
12
13
|
description: string;
|
|
13
14
|
};
|
|
@@ -31,8 +32,8 @@ export declare const i18n: (options: FromCatalog | FromDirectory) => {
|
|
|
31
32
|
t: T;
|
|
32
33
|
i18n: I18n.I18n;
|
|
33
34
|
};
|
|
34
|
-
export declare const localizeFields: (t: ReturnType<typeof i18n>[`t`], element: Action | Trigger | StaticCredentials | SessionCredentials) => Field<LocalizedField>[];
|
|
35
|
-
export declare const localizeProperties: (t: ReturnType<typeof i18n>[`t`], element: Action | Trigger | Credentials | Provider) => LocalizedProperties;
|
|
35
|
+
export declare const localizeFields: (t: ReturnType<typeof i18n>[`t`], element: Action | Trigger | StaticCredentials | SessionCredentials | Source) => Field<LocalizedField>[];
|
|
36
|
+
export declare const localizeProperties: (t: ReturnType<typeof i18n>[`t`], element: Action | Trigger | Credentials | Provider | Source) => LocalizedProperties;
|
|
36
37
|
export declare const localizeInputs: (t: ReturnType<typeof i18n>[`t`], element: Action) => (ConnectableEvent & LocalizedProperties)[];
|
|
37
38
|
export declare const localizeOutputs: (t: ReturnType<typeof i18n>[`t`], element: Action | Trigger) => (ConnectableEvent & LocalizedProperties)[];
|
|
38
39
|
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Provider } from "../entities/provider";
|
|
2
|
+
export declare class Protocol {
|
|
3
|
+
private readonly provider;
|
|
4
|
+
constructor(provider: Provider);
|
|
5
|
+
evaluate: (req: Protocol.Command) => Promise<any>;
|
|
6
|
+
}
|
|
7
|
+
export declare namespace Protocol {
|
|
8
|
+
type Model = `action` | `trigger` | `credentials`;
|
|
9
|
+
type Invoke = {
|
|
10
|
+
command: `invoke`;
|
|
11
|
+
model: Protocol.Model;
|
|
12
|
+
id: string;
|
|
13
|
+
params: {
|
|
14
|
+
function: string;
|
|
15
|
+
configuration: Record<string, any>;
|
|
16
|
+
};
|
|
17
|
+
context: {
|
|
18
|
+
environment: Record<string, any>;
|
|
19
|
+
localization: {
|
|
20
|
+
locale: string;
|
|
21
|
+
catalog: Record<string, any>;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
type CredentialList = {
|
|
26
|
+
command: `list:credentials`;
|
|
27
|
+
};
|
|
28
|
+
type ActionList = {
|
|
29
|
+
command: `list:actions`;
|
|
30
|
+
};
|
|
31
|
+
type TriggerList = {
|
|
32
|
+
command: `list:triggers`;
|
|
33
|
+
};
|
|
34
|
+
type SourceList = {
|
|
35
|
+
command: `list:sources`;
|
|
36
|
+
};
|
|
37
|
+
type LocaleList = {
|
|
38
|
+
command: `list:locales`;
|
|
39
|
+
};
|
|
40
|
+
type Command = Invoke | CredentialList | ActionList | TriggerList | SourceList | LocaleList;
|
|
41
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Protocol = void 0;
|
|
7
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
+
const provider_1 = require("../entities/provider");
|
|
9
|
+
const locales_1 = require("./locales");
|
|
10
|
+
const core_1 = require("../core");
|
|
11
|
+
const joi_1 = __importDefault(require("joi"));
|
|
12
|
+
const invokeSchema = joi_1.default.object({
|
|
13
|
+
command: joi_1.default.string().valid(`invoke`).required(),
|
|
14
|
+
model: joi_1.default.string().valid(`action`, `trigger`, `credentials`).required(),
|
|
15
|
+
id: joi_1.default.string().required(),
|
|
16
|
+
params: joi_1.default.object({
|
|
17
|
+
function: joi_1.default.string().required(),
|
|
18
|
+
configuration: joi_1.default.object().required(),
|
|
19
|
+
}).required(),
|
|
20
|
+
context: joi_1.default.object({
|
|
21
|
+
environment: joi_1.default.object().required(),
|
|
22
|
+
localization: joi_1.default.object({
|
|
23
|
+
locale: joi_1.default.string().required(),
|
|
24
|
+
catalog: joi_1.default.object().required(),
|
|
25
|
+
}).required(),
|
|
26
|
+
}).required(),
|
|
27
|
+
}).required();
|
|
28
|
+
const credentialListSchema = joi_1.default.object({
|
|
29
|
+
command: joi_1.default.string().valid(`list:credentials`).required(),
|
|
30
|
+
}).required();
|
|
31
|
+
const actionListSchema = joi_1.default.object({
|
|
32
|
+
command: joi_1.default.string().valid(`list:actions`).required(),
|
|
33
|
+
}).required();
|
|
34
|
+
const triggerListSchema = joi_1.default.object({
|
|
35
|
+
command: joi_1.default.string().valid(`list:triggers`).required(),
|
|
36
|
+
}).required();
|
|
37
|
+
const sourceListSchema = joi_1.default.object({
|
|
38
|
+
command: joi_1.default.string().valid(`list:sources`).required(),
|
|
39
|
+
}).required();
|
|
40
|
+
const localeListSchema = joi_1.default.object({
|
|
41
|
+
command: joi_1.default.string().valid(`list:locales`).required(),
|
|
42
|
+
}).required();
|
|
43
|
+
const commandSchema = joi_1.default.alternatives(invokeSchema, credentialListSchema, actionListSchema, triggerListSchema, sourceListSchema, localeListSchema);
|
|
44
|
+
class Protocol {
|
|
45
|
+
constructor(provider) {
|
|
46
|
+
this.evaluate = async (req) => {
|
|
47
|
+
try {
|
|
48
|
+
const validation = commandSchema.validate(req);
|
|
49
|
+
if (validation.error) {
|
|
50
|
+
throw new Error(`Invalid request: ${validation.error.message}`);
|
|
51
|
+
}
|
|
52
|
+
let response;
|
|
53
|
+
switch (req.command) {
|
|
54
|
+
case `list:actions`:
|
|
55
|
+
response = Object.values(this.provider.actions || {});
|
|
56
|
+
break;
|
|
57
|
+
case `list:triggers`:
|
|
58
|
+
response = Object.values(this.provider.triggers || {});
|
|
59
|
+
break;
|
|
60
|
+
case `list:credentials`:
|
|
61
|
+
response = Object.values(this.provider.credentials || {});
|
|
62
|
+
break;
|
|
63
|
+
case `list:sources`:
|
|
64
|
+
response = Object.values(this.provider.sources || {});
|
|
65
|
+
break;
|
|
66
|
+
case `list:locales`:
|
|
67
|
+
const i18nInstance = (0, locales_1.i18n)({ directory: `node_modules/prow-hubspot-repository/locales` });
|
|
68
|
+
response = i18nInstance.i18n.getLocales().map((l) => {
|
|
69
|
+
i18nInstance.i18n.setLocale(l);
|
|
70
|
+
return {
|
|
71
|
+
code: l,
|
|
72
|
+
catalog: i18nInstance.i18n.getCatalog(),
|
|
73
|
+
};
|
|
74
|
+
});
|
|
75
|
+
break;
|
|
76
|
+
case `invoke`:
|
|
77
|
+
const mEvent = lodash_1.default.get(this.provider, `${req.model}s.${req.id}`);
|
|
78
|
+
if (!mEvent) {
|
|
79
|
+
return {
|
|
80
|
+
status: 404,
|
|
81
|
+
body: JSON.stringify({ error: `Could not find ${req.model} with ID ${req.id}` }),
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
const f = lodash_1.default.get(mEvent, req.params.function);
|
|
85
|
+
if (!f || typeof f !== `function`) {
|
|
86
|
+
throw new Error(`Invalid function ${req.params.function}`);
|
|
87
|
+
}
|
|
88
|
+
const invokeInstance = (0, core_1.core)({
|
|
89
|
+
env: req.context.environment,
|
|
90
|
+
localization: req.context.localization,
|
|
91
|
+
});
|
|
92
|
+
response = await f(invokeInstance, req.params.configuration);
|
|
93
|
+
break;
|
|
94
|
+
default:
|
|
95
|
+
throw new Error(`Invalid command`);
|
|
96
|
+
}
|
|
97
|
+
return response;
|
|
98
|
+
}
|
|
99
|
+
catch (e) {
|
|
100
|
+
throw e;
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
const providerValidation = (0, provider_1.providerSchema)().validate(provider);
|
|
104
|
+
if (providerValidation.error) {
|
|
105
|
+
throw new Error(`Invalid provider for protocol`);
|
|
106
|
+
}
|
|
107
|
+
this.provider = provider;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
exports.Protocol = Protocol;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beseif-solutions/prow-core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.31",
|
|
4
4
|
"description": "Prow core functionalities and classes",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
"author": "",
|
|
18
18
|
"license": "ISC",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@types/express": "^4.17.21",
|
|
21
20
|
"axios": "^1.7.7",
|
|
22
21
|
"dotenv": "^16.4.5",
|
|
23
22
|
"handlebars": "^4.7.8",
|
package/src/index.ts
CHANGED
|
@@ -6,5 +6,6 @@ export { Action, actionOutputSchema, actionSchema, Event, eventSchema, Immediate
|
|
|
6
6
|
export { Provider, providerSchema } from './entities/provider';
|
|
7
7
|
export { Source } from './entities/source';
|
|
8
8
|
export { extract, Field, fieldSchema, fieldsSchema, SelectFieldChoice, validate, ValidationResult } from './minified-utils/fields';
|
|
9
|
-
export { i18n, localizeFields, localizeInputs, localizeOutputs, localizeProperties } from './minified-utils/locales';
|
|
9
|
+
export { i18n, localizeFields, localizeInputs, localizeOutputs, localizeProperties, LocalizedField, LocalizedProperties } from './minified-utils/locales';
|
|
10
10
|
export { Properties } from './minified-utils/properties';
|
|
11
|
+
export { Protocol } from './minified-utils/protocol';
|
|
@@ -6,13 +6,14 @@ import { Credentials, SessionCredentials, StaticCredentials } from '../entities/
|
|
|
6
6
|
import { Action, ConnectableEvent, Trigger } from '../entities/events';
|
|
7
7
|
import { Field, SelectFieldChoice } from './fields';
|
|
8
8
|
import { Provider } from '../entities/provider';
|
|
9
|
+
import { Source } from '../entities/source';
|
|
9
10
|
|
|
10
|
-
type LocalizedField = {
|
|
11
|
+
export type LocalizedField = {
|
|
11
12
|
label: string,
|
|
12
13
|
help: string,
|
|
13
14
|
};
|
|
14
15
|
|
|
15
|
-
type LocalizedProperties = {
|
|
16
|
+
export type LocalizedProperties = {
|
|
16
17
|
name: string,
|
|
17
18
|
description: string,
|
|
18
19
|
};
|
|
@@ -139,7 +140,7 @@ const localizeField = (
|
|
|
139
140
|
|
|
140
141
|
export const localizeFields = (
|
|
141
142
|
t: ReturnType<typeof i18n>[`t`],
|
|
142
|
-
element: Action | Trigger | StaticCredentials | SessionCredentials,
|
|
143
|
+
element: Action | Trigger | StaticCredentials | SessionCredentials | Source,
|
|
143
144
|
): Field<LocalizedField>[] => {
|
|
144
145
|
const response: Field<LocalizedField>[] = [];
|
|
145
146
|
if (element[`fields`] && element[`fields`].length > 0) {
|
|
@@ -150,7 +151,7 @@ export const localizeFields = (
|
|
|
150
151
|
|
|
151
152
|
export const localizeProperties = (
|
|
152
153
|
t: ReturnType<typeof i18n>[`t`],
|
|
153
|
-
element: Action | Trigger | Credentials | Provider,
|
|
154
|
+
element: Action | Trigger | Credentials | Provider | Source,
|
|
154
155
|
): LocalizedProperties => ({
|
|
155
156
|
name: t(`${element.id}.name`, { fallback: true }),
|
|
156
157
|
description: t(`${element.id}.description`),
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import _ from "lodash";
|
|
2
|
+
import { Provider, providerSchema } from "../entities/provider";
|
|
3
|
+
import { i18n } from "./locales";
|
|
4
|
+
import { core } from "../core";
|
|
5
|
+
import Joi from "joi";
|
|
6
|
+
|
|
7
|
+
const invokeSchema = Joi.object({
|
|
8
|
+
command: Joi.string().valid(`invoke`).required(),
|
|
9
|
+
model: Joi.string().valid(`action`, `trigger`, `credentials`).required(),
|
|
10
|
+
id: Joi.string().required(),
|
|
11
|
+
params: Joi.object({
|
|
12
|
+
function: Joi.string().required(),
|
|
13
|
+
configuration: Joi.object().required(),
|
|
14
|
+
}).required(),
|
|
15
|
+
context: Joi.object({
|
|
16
|
+
environment: Joi.object().required(),
|
|
17
|
+
localization: Joi.object({
|
|
18
|
+
locale: Joi.string().required(),
|
|
19
|
+
catalog: Joi.object().required(),
|
|
20
|
+
}).required(),
|
|
21
|
+
}).required(),
|
|
22
|
+
}).required();
|
|
23
|
+
|
|
24
|
+
const credentialListSchema = Joi.object({
|
|
25
|
+
command: Joi.string().valid(`list:credentials`).required(),
|
|
26
|
+
}).required();
|
|
27
|
+
|
|
28
|
+
const actionListSchema = Joi.object({
|
|
29
|
+
command: Joi.string().valid(`list:actions`).required(),
|
|
30
|
+
}).required();
|
|
31
|
+
|
|
32
|
+
const triggerListSchema = Joi.object({
|
|
33
|
+
command: Joi.string().valid(`list:triggers`).required(),
|
|
34
|
+
}).required();
|
|
35
|
+
|
|
36
|
+
const sourceListSchema = Joi.object({
|
|
37
|
+
command: Joi.string().valid(`list:sources`).required(),
|
|
38
|
+
}).required();
|
|
39
|
+
|
|
40
|
+
const localeListSchema = Joi.object({
|
|
41
|
+
command: Joi.string().valid(`list:locales`).required(),
|
|
42
|
+
}).required();
|
|
43
|
+
|
|
44
|
+
const commandSchema = Joi.alternatives(
|
|
45
|
+
invokeSchema,
|
|
46
|
+
credentialListSchema,
|
|
47
|
+
actionListSchema,
|
|
48
|
+
triggerListSchema,
|
|
49
|
+
sourceListSchema,
|
|
50
|
+
localeListSchema,
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
export class Protocol {
|
|
54
|
+
|
|
55
|
+
private readonly provider: Provider;
|
|
56
|
+
|
|
57
|
+
constructor(provider: Provider) {
|
|
58
|
+
const providerValidation = providerSchema().validate(provider);
|
|
59
|
+
if (providerValidation.error) { throw new Error(`Invalid provider for protocol`); }
|
|
60
|
+
this.provider = provider;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public evaluate = async (req: Protocol.Command): Promise<any> => {
|
|
64
|
+
try {
|
|
65
|
+
const validation = commandSchema.validate(req);
|
|
66
|
+
if (validation.error) { throw new Error(`Invalid request: ${validation.error.message}`); }
|
|
67
|
+
|
|
68
|
+
let response: any;
|
|
69
|
+
switch (req.command) {
|
|
70
|
+
case `list:actions`:
|
|
71
|
+
response = Object.values(this.provider.actions || {});
|
|
72
|
+
break;
|
|
73
|
+
case `list:triggers`:
|
|
74
|
+
response = Object.values(this.provider.triggers || {});
|
|
75
|
+
break;
|
|
76
|
+
case `list:credentials`:
|
|
77
|
+
response = Object.values(this.provider.credentials || {});
|
|
78
|
+
break;
|
|
79
|
+
case `list:sources`:
|
|
80
|
+
response = Object.values(this.provider.sources || {});
|
|
81
|
+
break;
|
|
82
|
+
case `list:locales`:
|
|
83
|
+
const i18nInstance = i18n({ directory: `node_modules/prow-hubspot-repository/locales` });
|
|
84
|
+
response = i18nInstance.i18n.getLocales().map((l) => {
|
|
85
|
+
i18nInstance.i18n.setLocale(l);
|
|
86
|
+
return {
|
|
87
|
+
code: l,
|
|
88
|
+
catalog: i18nInstance.i18n.getCatalog(),
|
|
89
|
+
};
|
|
90
|
+
});
|
|
91
|
+
break;
|
|
92
|
+
case `invoke`:
|
|
93
|
+
const mEvent = _.get(this.provider, `${req.model}s.${req.id}`);
|
|
94
|
+
if (!mEvent) {
|
|
95
|
+
return {
|
|
96
|
+
status: 404,
|
|
97
|
+
body: JSON.stringify({ error: `Could not find ${req.model} with ID ${req.id}` }),
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const f = _.get(mEvent, req.params.function);
|
|
102
|
+
if (!f || typeof f !== `function`) { throw new Error(`Invalid function ${req.params.function}`); }
|
|
103
|
+
|
|
104
|
+
const invokeInstance = core({
|
|
105
|
+
env: req.context.environment,
|
|
106
|
+
localization: req.context.localization,
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
response = await f(invokeInstance, req.params.configuration);
|
|
110
|
+
break;
|
|
111
|
+
default:
|
|
112
|
+
throw new Error(`Invalid command`);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return response;
|
|
116
|
+
} catch (e) { throw e; }
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export namespace Protocol {
|
|
121
|
+
|
|
122
|
+
export type Model = `action` | `trigger` | `credentials`;
|
|
123
|
+
|
|
124
|
+
export type Invoke = {
|
|
125
|
+
command: `invoke`,
|
|
126
|
+
model: Protocol.Model,
|
|
127
|
+
id: string,
|
|
128
|
+
params: {
|
|
129
|
+
function: string,
|
|
130
|
+
configuration: Record<string, any>,
|
|
131
|
+
},
|
|
132
|
+
context: {
|
|
133
|
+
environment: Record<string, any>,
|
|
134
|
+
localization: {
|
|
135
|
+
locale: string,
|
|
136
|
+
catalog: Record<string, any>,
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export type CredentialList = {
|
|
142
|
+
command: `list:credentials`,
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
export type ActionList = {
|
|
146
|
+
command: `list:actions`,
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
export type TriggerList = {
|
|
150
|
+
command: `list:triggers`,
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
export type SourceList = {
|
|
154
|
+
command: `list:sources`,
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
export type LocaleList = {
|
|
158
|
+
command: `list:locales`,
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
export type Command = Invoke | CredentialList | ActionList | TriggerList | SourceList | LocaleList;
|
|
162
|
+
}
|