@octaviaflow/flow-rules 0.1.0
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/README.md +96 -0
- package/dist/catalog/actions/console-log/config.d.ts +58 -0
- package/dist/catalog/actions/console-log/config.js +70 -0
- package/dist/catalog/actions/console-log/index.d.ts +7 -0
- package/dist/catalog/actions/console-log/index.js +89 -0
- package/dist/catalog/actions/delay/config.d.ts +50 -0
- package/dist/catalog/actions/delay/config.js +79 -0
- package/dist/catalog/actions/delay/index.d.ts +7 -0
- package/dist/catalog/actions/delay/index.js +71 -0
- package/dist/catalog/actions/delay/migrate.d.ts +18 -0
- package/dist/catalog/actions/delay/migrate.js +38 -0
- package/dist/catalog/actions/delay/types.d.ts +58 -0
- package/dist/catalog/actions/delay/types.js +17 -0
- package/dist/catalog/actions/http-request/config.d.ts +114 -0
- package/dist/catalog/actions/http-request/config.js +111 -0
- package/dist/catalog/actions/http-request/index.d.ts +7 -0
- package/dist/catalog/actions/http-request/index.js +223 -0
- package/dist/catalog/ai/ai-agent/index.d.ts +12 -0
- package/dist/catalog/ai/ai-agent/index.js +72 -0
- package/dist/catalog/ai/idp-extract/index.d.ts +18 -0
- package/dist/catalog/ai/idp-extract/index.js +90 -0
- package/dist/catalog/api/graphql-query/config.d.ts +36 -0
- package/dist/catalog/api/graphql-query/config.js +31 -0
- package/dist/catalog/api/graphql-query/index.d.ts +7 -0
- package/dist/catalog/api/graphql-query/index.js +75 -0
- package/dist/catalog/communication/email-send/config.d.ts +80 -0
- package/dist/catalog/communication/email-send/config.js +80 -0
- package/dist/catalog/communication/email-send/index.d.ts +11 -0
- package/dist/catalog/communication/email-send/index.js +152 -0
- package/dist/catalog/communication/google-chat/config.d.ts +45 -0
- package/dist/catalog/communication/google-chat/config.js +28 -0
- package/dist/catalog/communication/google-chat/index.d.ts +5 -0
- package/dist/catalog/communication/google-chat/index.js +36 -0
- package/dist/catalog/communication/slack-message/config.d.ts +47 -0
- package/dist/catalog/communication/slack-message/config.js +36 -0
- package/dist/catalog/communication/slack-message/index.d.ts +5 -0
- package/dist/catalog/communication/slack-message/index.js +37 -0
- package/dist/catalog/communication/teams-message/config.d.ts +48 -0
- package/dist/catalog/communication/teams-message/config.js +29 -0
- package/dist/catalog/communication/teams-message/index.d.ts +5 -0
- package/dist/catalog/communication/teams-message/index.js +39 -0
- package/dist/catalog/communication/webhook-call/config.d.ts +36 -0
- package/dist/catalog/communication/webhook-call/config.js +31 -0
- package/dist/catalog/communication/webhook-call/index.d.ts +5 -0
- package/dist/catalog/communication/webhook-call/index.js +43 -0
- package/dist/catalog/communication/whatsapp-send/config.d.ts +23 -0
- package/dist/catalog/communication/whatsapp-send/config.js +36 -0
- package/dist/catalog/communication/whatsapp-send/index.d.ts +15 -0
- package/dist/catalog/communication/whatsapp-send/index.js +57 -0
- package/dist/catalog/general/query/config.d.ts +36 -0
- package/dist/catalog/general/query/config.js +257 -0
- package/dist/catalog/general/query/index.d.ts +11 -0
- package/dist/catalog/general/query/index.js +271 -0
- package/dist/catalog/general/query/types.d.ts +205 -0
- package/dist/catalog/general/query/types.js +82 -0
- package/dist/catalog/general/transform/config.d.ts +117 -0
- package/dist/catalog/general/transform/config.js +95 -0
- package/dist/catalog/general/transform/index.d.ts +8 -0
- package/dist/catalog/general/transform/index.js +63 -0
- package/dist/catalog/index.d.ts +57 -0
- package/dist/catalog/index.js +168 -0
- package/dist/catalog/logic/condition/config.d.ts +54 -0
- package/dist/catalog/logic/condition/config.js +93 -0
- package/dist/catalog/logic/condition/index.d.ts +7 -0
- package/dist/catalog/logic/condition/index.js +64 -0
- package/dist/catalog/logic/for-each/config.d.ts +100 -0
- package/dist/catalog/logic/for-each/config.js +75 -0
- package/dist/catalog/logic/for-each/index.d.ts +7 -0
- package/dist/catalog/logic/for-each/index.js +92 -0
- package/dist/catalog/logic/for-each/pathOptions.d.ts +62 -0
- package/dist/catalog/logic/for-each/pathOptions.js +151 -0
- package/dist/catalog/logic/group/index.d.ts +15 -0
- package/dist/catalog/logic/group/index.js +46 -0
- package/dist/catalog/policies.d.ts +75 -0
- package/dist/catalog/policies.js +62 -0
- package/dist/catalog/storage/csv-action/index.d.ts +2 -0
- package/dist/catalog/storage/csv-action/index.js +38 -0
- package/dist/catalog/storage/dropbox-action/index.d.ts +2 -0
- package/dist/catalog/storage/dropbox-action/index.js +33 -0
- package/dist/catalog/storage/excel-action/index.d.ts +2 -0
- package/dist/catalog/storage/excel-action/index.js +32 -0
- package/dist/catalog/storage/file-action/index.d.ts +2 -0
- package/dist/catalog/storage/file-action/index.js +119 -0
- package/dist/catalog/storage/file-operation/config.d.ts +48 -0
- package/dist/catalog/storage/file-operation/config.js +45 -0
- package/dist/catalog/storage/file-operation/index.d.ts +8 -0
- package/dist/catalog/storage/file-operation/index.js +111 -0
- package/dist/catalog/storage/ftp-action/index.d.ts +2 -0
- package/dist/catalog/storage/ftp-action/index.js +33 -0
- package/dist/catalog/storage/google-drive-action/index.d.ts +2 -0
- package/dist/catalog/storage/google-drive-action/index.js +38 -0
- package/dist/catalog/storage/json-action/index.d.ts +2 -0
- package/dist/catalog/storage/json-action/index.js +31 -0
- package/dist/catalog/storage/onedrive-action/index.d.ts +2 -0
- package/dist/catalog/storage/onedrive-action/index.js +33 -0
- package/dist/catalog/storage/s3-action/index.d.ts +2 -0
- package/dist/catalog/storage/s3-action/index.js +36 -0
- package/dist/catalog/storage/storage-action/index.d.ts +13 -0
- package/dist/catalog/storage/storage-action/index.js +72 -0
- package/dist/catalog/storage/storageCapabilities.d.ts +57 -0
- package/dist/catalog/storage/storageCapabilities.js +207 -0
- package/dist/catalog/storage/xml-action/index.d.ts +2 -0
- package/dist/catalog/storage/xml-action/index.js +31 -0
- package/dist/catalog/transforms/format/config.d.ts +23 -0
- package/dist/catalog/transforms/format/config.js +19 -0
- package/dist/catalog/transforms/format/index.d.ts +5 -0
- package/dist/catalog/transforms/format/index.js +39 -0
- package/dist/catalog/triggers/connector-trigger/index.d.ts +7 -0
- package/dist/catalog/triggers/connector-trigger/index.js +72 -0
- package/dist/catalog/triggers/manual-trigger/config.d.ts +40 -0
- package/dist/catalog/triggers/manual-trigger/config.js +60 -0
- package/dist/catalog/triggers/manual-trigger/index.d.ts +10 -0
- package/dist/catalog/triggers/manual-trigger/index.js +74 -0
- package/dist/catalog/triggers/schedule-trigger/config.d.ts +42 -0
- package/dist/catalog/triggers/schedule-trigger/config.js +42 -0
- package/dist/catalog/triggers/schedule-trigger/index.d.ts +7 -0
- package/dist/catalog/triggers/schedule-trigger/index.js +102 -0
- package/dist/catalog/triggers/webhook-trigger/config.d.ts +31 -0
- package/dist/catalog/triggers/webhook-trigger/config.js +27 -0
- package/dist/catalog/triggers/webhook-trigger/index.d.ts +7 -0
- package/dist/catalog/triggers/webhook-trigger/index.js +89 -0
- package/dist/catalog/types.d.ts +360 -0
- package/dist/catalog/types.js +135 -0
- package/dist/catalog/utility/debug/config.d.ts +72 -0
- package/dist/catalog/utility/debug/config.js +90 -0
- package/dist/catalog/utility/debug/index.d.ts +11 -0
- package/dist/catalog/utility/debug/index.js +38 -0
- package/dist/catalog/utility/error/config.d.ts +26 -0
- package/dist/catalog/utility/error/config.js +25 -0
- package/dist/catalog/utility/error/index.d.ts +7 -0
- package/dist/catalog/utility/error/index.js +46 -0
- package/dist/catalog/utility/variables/config.d.ts +76 -0
- package/dist/catalog/utility/variables/config.js +70 -0
- package/dist/catalog/utility/variables/index.d.ts +13 -0
- package/dist/catalog/utility/variables/index.js +40 -0
- package/dist/catalog/workflow.d.ts +308 -0
- package/dist/catalog/workflow.js +25 -0
- package/dist/ids.d.ts +31 -0
- package/dist/ids.js +53 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.js +28 -0
- package/dist/rules/nodeConfigStatus.d.ts +33 -0
- package/dist/rules/nodeConfigStatus.js +217 -0
- package/dist/rules/workflowValidator.d.ts +53 -0
- package/dist/rules/workflowValidator.js +358 -0
- package/package.json +41 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GraphQL Query Configuration
|
|
3
|
+
*/
|
|
4
|
+
export const GraphQLQueryConfig = {
|
|
5
|
+
defaults: {
|
|
6
|
+
endpoint: '',
|
|
7
|
+
query: '',
|
|
8
|
+
variables: {},
|
|
9
|
+
headers: {},
|
|
10
|
+
},
|
|
11
|
+
schema: {
|
|
12
|
+
endpoint: { type: 'url', required: true },
|
|
13
|
+
query: { type: 'code', required: true },
|
|
14
|
+
variables: { type: 'json', required: false },
|
|
15
|
+
headers: { type: 'json', required: false },
|
|
16
|
+
},
|
|
17
|
+
validate: (config) => {
|
|
18
|
+
const errors = [];
|
|
19
|
+
if (!config.endpoint)
|
|
20
|
+
errors.push('Endpoint is required');
|
|
21
|
+
if (!config.query)
|
|
22
|
+
errors.push('Query is required');
|
|
23
|
+
return { valid: errors.length === 0, errors };
|
|
24
|
+
},
|
|
25
|
+
merge: (userConfig) => {
|
|
26
|
+
return { ...GraphQLQueryConfig.defaults, ...userConfig };
|
|
27
|
+
},
|
|
28
|
+
getLabel: (config) => {
|
|
29
|
+
return `GraphQL: ${config.endpoint}`;
|
|
30
|
+
},
|
|
31
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GraphQL Query Action
|
|
3
|
+
*
|
|
4
|
+
* Execute GraphQL queries against GraphQL endpoints
|
|
5
|
+
*/
|
|
6
|
+
import { ActionCategory, ActionType, ActionStatus, FieldType } from '../../types';
|
|
7
|
+
export const graphqlQueryDefinition = {
|
|
8
|
+
id: 'graphql_query',
|
|
9
|
+
name: 'GraphQL Query',
|
|
10
|
+
description: 'Execute GraphQL queries against GraphQL endpoints',
|
|
11
|
+
category: ActionCategory.API,
|
|
12
|
+
type: ActionType.GraphQLQuery,
|
|
13
|
+
tags: ['api', 'graphql', 'query', 'built-in'],
|
|
14
|
+
status: ActionStatus.Stable,
|
|
15
|
+
icon: 'GraphQL',
|
|
16
|
+
color: '#0043ce',
|
|
17
|
+
inputSchema: {
|
|
18
|
+
fields: [
|
|
19
|
+
{
|
|
20
|
+
key: 'endpoint',
|
|
21
|
+
label: 'GraphQL Endpoint',
|
|
22
|
+
type: FieldType.URL,
|
|
23
|
+
description: 'GraphQL endpoint URL',
|
|
24
|
+
validation: { required: true },
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
key: 'query',
|
|
28
|
+
label: 'Query',
|
|
29
|
+
type: FieldType.Code,
|
|
30
|
+
description: 'GraphQL query',
|
|
31
|
+
language: 'json',
|
|
32
|
+
validation: { required: true },
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
key: 'variables',
|
|
36
|
+
label: 'Variables',
|
|
37
|
+
type: FieldType.JSON,
|
|
38
|
+
description: 'Query variables',
|
|
39
|
+
validation: { required: false },
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
key: 'headers',
|
|
43
|
+
label: 'Headers',
|
|
44
|
+
type: FieldType.JSON,
|
|
45
|
+
description: 'HTTP headers',
|
|
46
|
+
validation: { required: false },
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
outputSchema: {
|
|
51
|
+
type: 'object',
|
|
52
|
+
properties: [
|
|
53
|
+
{
|
|
54
|
+
key: 'data',
|
|
55
|
+
type: FieldType.JSON,
|
|
56
|
+
description: 'Query result data',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
key: 'errors',
|
|
60
|
+
type: FieldType.Array,
|
|
61
|
+
description: 'GraphQL errors',
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
sampleOutput: {
|
|
65
|
+
data: { user: { id: '1', name: 'John' } },
|
|
66
|
+
errors: [],
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
version: '1.0.0',
|
|
70
|
+
createdAt: '2025-01-01T00:00:00Z',
|
|
71
|
+
updatedAt: '2025-12-15T00:00:00Z',
|
|
72
|
+
createdBy: 'system',
|
|
73
|
+
isOfficial: true,
|
|
74
|
+
testable: true,
|
|
75
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Email Configuration
|
|
3
|
+
*
|
|
4
|
+
* Only `send` runs today. The other operation values stay in the type so a
|
|
5
|
+
* step saved before DEV-349 still parses — but `validate` rejects them, so the
|
|
6
|
+
* editor shows an error instead of the Engine skipping the step silently.
|
|
7
|
+
*/
|
|
8
|
+
export interface EmailConfigType {
|
|
9
|
+
connection: string;
|
|
10
|
+
operation: 'send' | 'read' | 'search' | 'delete' | 'move' | 'mark_read';
|
|
11
|
+
to?: string;
|
|
12
|
+
cc?: string;
|
|
13
|
+
bcc?: string;
|
|
14
|
+
subject?: string;
|
|
15
|
+
body?: string;
|
|
16
|
+
isHtml?: boolean;
|
|
17
|
+
attachments?: string[];
|
|
18
|
+
folder?: string;
|
|
19
|
+
query?: string;
|
|
20
|
+
limit?: number;
|
|
21
|
+
}
|
|
22
|
+
export declare const EmailConfig: {
|
|
23
|
+
defaults: EmailConfigType;
|
|
24
|
+
schema: {
|
|
25
|
+
connection: {
|
|
26
|
+
type: string;
|
|
27
|
+
required: boolean;
|
|
28
|
+
};
|
|
29
|
+
operation: {
|
|
30
|
+
type: string;
|
|
31
|
+
required: boolean;
|
|
32
|
+
};
|
|
33
|
+
to: {
|
|
34
|
+
type: string;
|
|
35
|
+
required: boolean;
|
|
36
|
+
};
|
|
37
|
+
cc: {
|
|
38
|
+
type: string;
|
|
39
|
+
required: boolean;
|
|
40
|
+
};
|
|
41
|
+
bcc: {
|
|
42
|
+
type: string;
|
|
43
|
+
required: boolean;
|
|
44
|
+
};
|
|
45
|
+
subject: {
|
|
46
|
+
type: string;
|
|
47
|
+
required: boolean;
|
|
48
|
+
};
|
|
49
|
+
body: {
|
|
50
|
+
type: string;
|
|
51
|
+
required: boolean;
|
|
52
|
+
};
|
|
53
|
+
isHtml: {
|
|
54
|
+
type: string;
|
|
55
|
+
required: boolean;
|
|
56
|
+
};
|
|
57
|
+
attachments: {
|
|
58
|
+
type: string;
|
|
59
|
+
required: boolean;
|
|
60
|
+
};
|
|
61
|
+
folder: {
|
|
62
|
+
type: string;
|
|
63
|
+
required: boolean;
|
|
64
|
+
};
|
|
65
|
+
query: {
|
|
66
|
+
type: string;
|
|
67
|
+
required: boolean;
|
|
68
|
+
};
|
|
69
|
+
limit: {
|
|
70
|
+
type: string;
|
|
71
|
+
required: boolean;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
validate: (config: Partial<EmailConfigType>) => {
|
|
75
|
+
valid: boolean;
|
|
76
|
+
errors: string[];
|
|
77
|
+
};
|
|
78
|
+
merge: (userConfig: Partial<EmailConfigType>) => EmailConfigType;
|
|
79
|
+
getLabel: (config: EmailConfigType) => string;
|
|
80
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Email Configuration
|
|
3
|
+
*
|
|
4
|
+
* Only `send` runs today. The other operation values stay in the type so a
|
|
5
|
+
* step saved before DEV-349 still parses — but `validate` rejects them, so the
|
|
6
|
+
* editor shows an error instead of the Engine skipping the step silently.
|
|
7
|
+
*/
|
|
8
|
+
export const EmailConfig = {
|
|
9
|
+
defaults: {
|
|
10
|
+
connection: '',
|
|
11
|
+
operation: 'send',
|
|
12
|
+
to: '',
|
|
13
|
+
cc: '',
|
|
14
|
+
bcc: '',
|
|
15
|
+
subject: '',
|
|
16
|
+
body: '',
|
|
17
|
+
isHtml: false,
|
|
18
|
+
attachments: [],
|
|
19
|
+
folder: 'Inbox',
|
|
20
|
+
query: '',
|
|
21
|
+
limit: 10,
|
|
22
|
+
},
|
|
23
|
+
schema: {
|
|
24
|
+
connection: { type: 'connection', required: true },
|
|
25
|
+
operation: { type: 'select', required: true },
|
|
26
|
+
to: { type: 'string', required: false },
|
|
27
|
+
cc: { type: 'string', required: false },
|
|
28
|
+
bcc: { type: 'string', required: false },
|
|
29
|
+
subject: { type: 'string', required: false },
|
|
30
|
+
body: { type: 'string', required: false },
|
|
31
|
+
isHtml: { type: 'boolean', required: false },
|
|
32
|
+
attachments: { type: 'array', required: false },
|
|
33
|
+
folder: { type: 'string', required: false },
|
|
34
|
+
query: { type: 'string', required: false },
|
|
35
|
+
limit: { type: 'number', required: false },
|
|
36
|
+
},
|
|
37
|
+
validate: (config) => {
|
|
38
|
+
const errors = [];
|
|
39
|
+
if (!config.connection)
|
|
40
|
+
errors.push('Email service connection is required');
|
|
41
|
+
if (!config.operation)
|
|
42
|
+
errors.push('Operation is required');
|
|
43
|
+
// Validate operation-specific requirements
|
|
44
|
+
if (config.operation === 'send') {
|
|
45
|
+
if (!config.to)
|
|
46
|
+
errors.push('Recipient email is required for send operation');
|
|
47
|
+
if (!config.subject)
|
|
48
|
+
errors.push('Subject is required for send operation');
|
|
49
|
+
if (!config.body)
|
|
50
|
+
errors.push('Body is required for send operation');
|
|
51
|
+
}
|
|
52
|
+
else if (config.operation) {
|
|
53
|
+
// Read / Search / Delete / Move / Mark-as-read are not implemented by
|
|
54
|
+
// the Engine (DEV-349). Fail here so the step cannot be saved as valid.
|
|
55
|
+
errors.push('Only Send is available for the Email action right now');
|
|
56
|
+
}
|
|
57
|
+
return { valid: errors.length === 0, errors };
|
|
58
|
+
},
|
|
59
|
+
merge: (userConfig) => {
|
|
60
|
+
return { ...EmailConfig.defaults, ...userConfig };
|
|
61
|
+
},
|
|
62
|
+
getLabel: (config) => {
|
|
63
|
+
switch (config.operation) {
|
|
64
|
+
case 'send':
|
|
65
|
+
return `Email: Send to ${config.to}`;
|
|
66
|
+
case 'read':
|
|
67
|
+
return `Email: Read from ${config.folder}`;
|
|
68
|
+
case 'search':
|
|
69
|
+
return `Email: Search "${config.query}"`;
|
|
70
|
+
case 'delete':
|
|
71
|
+
return `Email: Delete from ${config.folder}`;
|
|
72
|
+
case 'move':
|
|
73
|
+
return `Email: Move to ${config.folder}`;
|
|
74
|
+
case 'mark_read':
|
|
75
|
+
return `Email: Mark as read`;
|
|
76
|
+
default:
|
|
77
|
+
return `Email: ${config.operation}`;
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Email Action
|
|
3
|
+
*
|
|
4
|
+
* Sends an email through a connected email service. Send is the only
|
|
5
|
+
* operation the Engine implements; the Read / Search / Delete / Move /
|
|
6
|
+
* Mark-as-read options were withdrawn from the catalogue until they run
|
|
7
|
+
* (DEV-349) — a step saved with one of them fails validation instead of
|
|
8
|
+
* silently succeeding.
|
|
9
|
+
*/
|
|
10
|
+
import { ActionDefinition } from '../../types';
|
|
11
|
+
export declare const emailDefinition: ActionDefinition;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Email Action
|
|
3
|
+
*
|
|
4
|
+
* Sends an email through a connected email service. Send is the only
|
|
5
|
+
* operation the Engine implements; the Read / Search / Delete / Move /
|
|
6
|
+
* Mark-as-read options were withdrawn from the catalogue until they run
|
|
7
|
+
* (DEV-349) — a step saved with one of them fails validation instead of
|
|
8
|
+
* silently succeeding.
|
|
9
|
+
*/
|
|
10
|
+
import { ActionCategory, ActionType, ActionStatus, FieldType } from '../../types';
|
|
11
|
+
export const emailDefinition = {
|
|
12
|
+
id: 'email',
|
|
13
|
+
name: 'Email',
|
|
14
|
+
description: 'Send an email through any connected email service provider',
|
|
15
|
+
category: ActionCategory.Communication,
|
|
16
|
+
type: ActionType.EmailSend,
|
|
17
|
+
tags: ['communication', 'email', 'smtp', 'sendgrid', 'ses', 'imap', 'pop3', 'built-in'],
|
|
18
|
+
status: ActionStatus.Stable,
|
|
19
|
+
icon: 'Email',
|
|
20
|
+
color: '#0043ce',
|
|
21
|
+
inputSchema: {
|
|
22
|
+
fields: [
|
|
23
|
+
{
|
|
24
|
+
key: 'connection',
|
|
25
|
+
label: 'Email Service',
|
|
26
|
+
type: FieldType.Connection,
|
|
27
|
+
description: 'Email service connection (SMTP, IMAP, SendGrid, AWS SES, etc.)',
|
|
28
|
+
validation: { required: true },
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
key: 'operation',
|
|
32
|
+
label: 'Operation',
|
|
33
|
+
type: FieldType.Select,
|
|
34
|
+
description: 'Email operation — Send is the only operation available today',
|
|
35
|
+
options: [
|
|
36
|
+
{ label: 'Send', value: 'send' },
|
|
37
|
+
],
|
|
38
|
+
defaultValue: 'send',
|
|
39
|
+
validation: { required: true },
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
key: 'to',
|
|
43
|
+
label: 'To',
|
|
44
|
+
type: FieldType.String,
|
|
45
|
+
description: 'Recipient email address(es), comma-separated (for send operation)',
|
|
46
|
+
validation: { required: false },
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
key: 'cc',
|
|
50
|
+
label: 'CC',
|
|
51
|
+
type: FieldType.String,
|
|
52
|
+
description: 'CC email address(es), comma-separated (for send operation)',
|
|
53
|
+
validation: { required: false },
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
key: 'bcc',
|
|
57
|
+
label: 'BCC',
|
|
58
|
+
type: FieldType.String,
|
|
59
|
+
description: 'BCC email address(es), comma-separated (for send operation)',
|
|
60
|
+
validation: { required: false },
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
key: 'subject',
|
|
64
|
+
label: 'Subject',
|
|
65
|
+
type: FieldType.String,
|
|
66
|
+
description: 'Email subject (for send operation)',
|
|
67
|
+
validation: { required: false },
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
key: 'body',
|
|
71
|
+
label: 'Body',
|
|
72
|
+
type: FieldType.String,
|
|
73
|
+
description: 'Email body content (for send operation)',
|
|
74
|
+
validation: { required: false },
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
key: 'isHtml',
|
|
78
|
+
label: 'Is HTML',
|
|
79
|
+
type: FieldType.Boolean,
|
|
80
|
+
description: 'Whether body is HTML content',
|
|
81
|
+
defaultValue: false,
|
|
82
|
+
validation: { required: false },
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
key: 'attachments',
|
|
86
|
+
label: 'Attachments',
|
|
87
|
+
type: FieldType.Array,
|
|
88
|
+
description: 'File attachments (URLs or file paths)',
|
|
89
|
+
validation: { required: false },
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
key: 'folder',
|
|
93
|
+
label: 'Folder',
|
|
94
|
+
type: FieldType.String,
|
|
95
|
+
description: 'Email folder (Inbox, Sent, Drafts, etc.)',
|
|
96
|
+
validation: { required: false },
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
key: 'query',
|
|
100
|
+
label: 'Search Query',
|
|
101
|
+
type: FieldType.String,
|
|
102
|
+
description: 'Search criteria (for search/read operations)',
|
|
103
|
+
validation: { required: false },
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
key: 'limit',
|
|
107
|
+
label: 'Limit',
|
|
108
|
+
type: FieldType.Number,
|
|
109
|
+
description: 'Maximum number of emails to retrieve',
|
|
110
|
+
defaultValue: 10,
|
|
111
|
+
validation: { required: false },
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
},
|
|
115
|
+
outputSchema: {
|
|
116
|
+
type: 'object',
|
|
117
|
+
properties: [
|
|
118
|
+
{
|
|
119
|
+
key: 'success',
|
|
120
|
+
type: FieldType.Boolean,
|
|
121
|
+
description: 'Whether operation was successful',
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
key: 'data',
|
|
125
|
+
type: FieldType.JSON,
|
|
126
|
+
description: 'Operation result data (emails, message ID, etc.)',
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
key: 'count',
|
|
130
|
+
type: FieldType.Number,
|
|
131
|
+
description: 'Number of emails affected/returned',
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
key: 'messageId',
|
|
135
|
+
type: FieldType.String,
|
|
136
|
+
description: 'Email message ID (for send operation)',
|
|
137
|
+
},
|
|
138
|
+
],
|
|
139
|
+
sampleOutput: {
|
|
140
|
+
success: true,
|
|
141
|
+
data: [{ id: 'email_123', from: 'sender@example.com', subject: 'Test' }],
|
|
142
|
+
count: 1,
|
|
143
|
+
messageId: 'msg_123456',
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
version: '1.0.0',
|
|
147
|
+
createdAt: '2025-01-01T00:00:00Z',
|
|
148
|
+
updatedAt: '2025-12-15T00:00:00Z',
|
|
149
|
+
createdBy: 'system',
|
|
150
|
+
isOfficial: true,
|
|
151
|
+
testable: true,
|
|
152
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Google Chat Configuration
|
|
3
|
+
*/
|
|
4
|
+
export interface GoogleChatConfigType {
|
|
5
|
+
connection: string;
|
|
6
|
+
/** Target space resource name, e.g. "spaces/AAAA". */
|
|
7
|
+
space?: string;
|
|
8
|
+
/** Human-readable space name (for logs/labels). */
|
|
9
|
+
spaceName?: string;
|
|
10
|
+
/** Canonical message body. */
|
|
11
|
+
text?: string;
|
|
12
|
+
/** Legacy alias for `text`. */
|
|
13
|
+
message?: string;
|
|
14
|
+
/** Reply into an existing thread by key (optional). */
|
|
15
|
+
threadKey?: string;
|
|
16
|
+
/** Google Chat Cards v2 array (advanced, optional). */
|
|
17
|
+
cardsV2?: unknown[];
|
|
18
|
+
}
|
|
19
|
+
export declare const GoogleChatConfig: {
|
|
20
|
+
defaults: GoogleChatConfigType;
|
|
21
|
+
schema: {
|
|
22
|
+
connection: {
|
|
23
|
+
type: string;
|
|
24
|
+
required: boolean;
|
|
25
|
+
};
|
|
26
|
+
space: {
|
|
27
|
+
type: string;
|
|
28
|
+
required: boolean;
|
|
29
|
+
};
|
|
30
|
+
text: {
|
|
31
|
+
type: string;
|
|
32
|
+
required: boolean;
|
|
33
|
+
};
|
|
34
|
+
threadKey: {
|
|
35
|
+
type: string;
|
|
36
|
+
required: boolean;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
validate: (config: Partial<GoogleChatConfigType>) => {
|
|
40
|
+
valid: boolean;
|
|
41
|
+
errors: string[];
|
|
42
|
+
};
|
|
43
|
+
merge: (userConfig: Partial<GoogleChatConfigType>) => GoogleChatConfigType;
|
|
44
|
+
getLabel: () => string;
|
|
45
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Google Chat Configuration
|
|
3
|
+
*/
|
|
4
|
+
export const GoogleChatConfig = {
|
|
5
|
+
defaults: { connection: '', space: '', spaceName: '', text: '', threadKey: '' },
|
|
6
|
+
schema: {
|
|
7
|
+
connection: { type: 'connection', required: true },
|
|
8
|
+
space: { type: 'string', required: true },
|
|
9
|
+
text: { type: 'string', required: false },
|
|
10
|
+
threadKey: { type: 'string', required: false },
|
|
11
|
+
},
|
|
12
|
+
validate: (config) => {
|
|
13
|
+
const errors = [];
|
|
14
|
+
if (!config.connection)
|
|
15
|
+
errors.push('Connect a Google Chat account');
|
|
16
|
+
if (!config.space)
|
|
17
|
+
errors.push('Pick a space');
|
|
18
|
+
// Text-only over OAuth (cards require app auth — see GoogleChatConfigPanel note).
|
|
19
|
+
if (!config.text && !config.message)
|
|
20
|
+
errors.push('Add a message');
|
|
21
|
+
return { valid: errors.length === 0, errors };
|
|
22
|
+
},
|
|
23
|
+
merge: (userConfig) => ({
|
|
24
|
+
...GoogleChatConfig.defaults,
|
|
25
|
+
...userConfig,
|
|
26
|
+
}),
|
|
27
|
+
getLabel: () => 'Google Chat',
|
|
28
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Google Chat Action
|
|
3
|
+
*/
|
|
4
|
+
import { ActionCategory, ActionType, ActionStatus, FieldType } from '../../types';
|
|
5
|
+
export const googleChatDefinition = {
|
|
6
|
+
id: 'google_chat',
|
|
7
|
+
name: 'Google Chat',
|
|
8
|
+
description: 'Post a message to a Google Chat space (OAuth 2.0 — pick any space you belong to)',
|
|
9
|
+
category: ActionCategory.Communication,
|
|
10
|
+
type: ActionType.GoogleChat,
|
|
11
|
+
tags: ['communication', 'google', 'chat', 'webhook', 'built-in'],
|
|
12
|
+
status: ActionStatus.Stable,
|
|
13
|
+
icon: 'brand:google_chat',
|
|
14
|
+
color: '#00AC47',
|
|
15
|
+
inputSchema: {
|
|
16
|
+
fields: [
|
|
17
|
+
{ key: 'connection', label: 'Google Chat Space', type: FieldType.Connection, validation: { required: true } },
|
|
18
|
+
{ key: 'text', label: 'Message', type: FieldType.String, validation: { required: true } },
|
|
19
|
+
{ key: 'threadKey', label: 'Thread Key', type: FieldType.String, validation: { required: false } },
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
outputSchema: {
|
|
23
|
+
type: 'object',
|
|
24
|
+
properties: [
|
|
25
|
+
{ key: 'ok', type: FieldType.Boolean, description: 'Whether the message was sent' },
|
|
26
|
+
{ key: 'name', type: FieldType.String, description: 'Created message resource name' },
|
|
27
|
+
],
|
|
28
|
+
sampleOutput: { ok: true, name: 'spaces/AAAA/messages/BBBB' },
|
|
29
|
+
},
|
|
30
|
+
version: '1.0.0',
|
|
31
|
+
createdAt: '2026-06-18T00:00:00Z',
|
|
32
|
+
updatedAt: '2026-06-18T00:00:00Z',
|
|
33
|
+
createdBy: 'system',
|
|
34
|
+
isOfficial: true,
|
|
35
|
+
testable: true,
|
|
36
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slack Message Configuration
|
|
3
|
+
*/
|
|
4
|
+
export interface SlackMessageConfigType {
|
|
5
|
+
connection: string;
|
|
6
|
+
/** 'channel' = post to a channel, 'user' = open a DM with a user. */
|
|
7
|
+
messageType?: 'channel' | 'user';
|
|
8
|
+
channel: string;
|
|
9
|
+
channelName?: string;
|
|
10
|
+
/** Canonical message body (the config panel stores it here). */
|
|
11
|
+
text?: string;
|
|
12
|
+
/** Legacy alias for `text`. */
|
|
13
|
+
message?: string;
|
|
14
|
+
/** Slack Block Kit JSON array, built via the visual builder. */
|
|
15
|
+
blocks?: unknown[];
|
|
16
|
+
}
|
|
17
|
+
export declare const SlackMessageConfig: {
|
|
18
|
+
defaults: SlackMessageConfigType;
|
|
19
|
+
schema: {
|
|
20
|
+
connection: {
|
|
21
|
+
type: string;
|
|
22
|
+
required: boolean;
|
|
23
|
+
};
|
|
24
|
+
messageType: {
|
|
25
|
+
type: string;
|
|
26
|
+
required: boolean;
|
|
27
|
+
};
|
|
28
|
+
channel: {
|
|
29
|
+
type: string;
|
|
30
|
+
required: boolean;
|
|
31
|
+
};
|
|
32
|
+
text: {
|
|
33
|
+
type: string;
|
|
34
|
+
required: boolean;
|
|
35
|
+
};
|
|
36
|
+
blocks: {
|
|
37
|
+
type: string;
|
|
38
|
+
required: boolean;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
validate: (config: Partial<SlackMessageConfigType>) => {
|
|
42
|
+
valid: boolean;
|
|
43
|
+
errors: string[];
|
|
44
|
+
};
|
|
45
|
+
merge: (userConfig: Partial<SlackMessageConfigType>) => SlackMessageConfigType;
|
|
46
|
+
getLabel: (config: SlackMessageConfigType) => string;
|
|
47
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slack Message Configuration
|
|
3
|
+
*/
|
|
4
|
+
export const SlackMessageConfig = {
|
|
5
|
+
defaults: { connection: '', messageType: 'channel', channel: '', channelName: '', text: '', blocks: undefined },
|
|
6
|
+
schema: {
|
|
7
|
+
connection: { type: 'connection', required: true },
|
|
8
|
+
messageType: { type: 'string', required: false },
|
|
9
|
+
channel: { type: 'string', required: true },
|
|
10
|
+
text: { type: 'string', required: false },
|
|
11
|
+
blocks: { type: 'json', required: false },
|
|
12
|
+
},
|
|
13
|
+
validate: (config) => {
|
|
14
|
+
const errors = [];
|
|
15
|
+
if (!config.connection)
|
|
16
|
+
errors.push('Slack workspace connection is required');
|
|
17
|
+
if (!config.channel)
|
|
18
|
+
errors.push(config.messageType === 'user' ? 'A user is required' : 'A channel is required');
|
|
19
|
+
const hasText = Boolean(config.text || config.message);
|
|
20
|
+
const hasBlocks = Array.isArray(config.blocks) && config.blocks.length > 0;
|
|
21
|
+
if (!hasText && !hasBlocks)
|
|
22
|
+
errors.push('Add a message or at least one block');
|
|
23
|
+
return { valid: errors.length === 0, errors };
|
|
24
|
+
},
|
|
25
|
+
merge: (userConfig) => {
|
|
26
|
+
return { ...SlackMessageConfig.defaults, ...userConfig };
|
|
27
|
+
},
|
|
28
|
+
getLabel: (config) => {
|
|
29
|
+
const prefix = config.messageType === 'user' ? '@' : '#';
|
|
30
|
+
return config.channelName
|
|
31
|
+
? `Slack: ${prefix}${config.channelName}`
|
|
32
|
+
: config.channel
|
|
33
|
+
? `Slack: ${config.channel}`
|
|
34
|
+
: 'Slack';
|
|
35
|
+
},
|
|
36
|
+
};
|