@octaviaflow/flow-rules 0.1.0 → 0.2.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/dist/index.d.ts +6 -0
- package/dist/index.js +3010 -28
- package/package.json +14 -5
- package/dist/catalog/actions/console-log/config.js +0 -70
- package/dist/catalog/actions/console-log/index.js +0 -89
- package/dist/catalog/actions/delay/config.js +0 -79
- package/dist/catalog/actions/delay/index.js +0 -71
- package/dist/catalog/actions/delay/migrate.js +0 -38
- package/dist/catalog/actions/delay/types.js +0 -17
- package/dist/catalog/actions/http-request/config.js +0 -111
- package/dist/catalog/actions/http-request/index.js +0 -223
- package/dist/catalog/ai/ai-agent/index.js +0 -72
- package/dist/catalog/ai/idp-extract/index.js +0 -90
- package/dist/catalog/api/graphql-query/config.js +0 -31
- package/dist/catalog/api/graphql-query/index.js +0 -75
- package/dist/catalog/communication/email-send/config.js +0 -80
- package/dist/catalog/communication/email-send/index.js +0 -152
- package/dist/catalog/communication/google-chat/config.js +0 -28
- package/dist/catalog/communication/google-chat/index.js +0 -36
- package/dist/catalog/communication/slack-message/config.js +0 -36
- package/dist/catalog/communication/slack-message/index.js +0 -37
- package/dist/catalog/communication/teams-message/config.js +0 -29
- package/dist/catalog/communication/teams-message/index.js +0 -39
- package/dist/catalog/communication/webhook-call/config.js +0 -31
- package/dist/catalog/communication/webhook-call/index.js +0 -43
- package/dist/catalog/communication/whatsapp-send/config.js +0 -36
- package/dist/catalog/communication/whatsapp-send/index.js +0 -57
- package/dist/catalog/general/query/config.js +0 -257
- package/dist/catalog/general/query/index.js +0 -271
- package/dist/catalog/general/query/types.js +0 -82
- package/dist/catalog/general/transform/config.js +0 -95
- package/dist/catalog/general/transform/index.js +0 -63
- package/dist/catalog/index.js +0 -168
- package/dist/catalog/logic/condition/config.js +0 -93
- package/dist/catalog/logic/condition/index.js +0 -64
- package/dist/catalog/logic/for-each/config.js +0 -75
- package/dist/catalog/logic/for-each/index.js +0 -92
- package/dist/catalog/logic/for-each/pathOptions.js +0 -151
- package/dist/catalog/logic/group/index.js +0 -46
- package/dist/catalog/policies.js +0 -62
- package/dist/catalog/storage/csv-action/index.js +0 -38
- package/dist/catalog/storage/dropbox-action/index.js +0 -33
- package/dist/catalog/storage/excel-action/index.js +0 -32
- package/dist/catalog/storage/file-action/index.js +0 -119
- package/dist/catalog/storage/file-operation/config.js +0 -45
- package/dist/catalog/storage/file-operation/index.js +0 -111
- package/dist/catalog/storage/ftp-action/index.js +0 -33
- package/dist/catalog/storage/google-drive-action/index.js +0 -38
- package/dist/catalog/storage/json-action/index.js +0 -31
- package/dist/catalog/storage/onedrive-action/index.js +0 -33
- package/dist/catalog/storage/s3-action/index.js +0 -36
- package/dist/catalog/storage/storage-action/index.js +0 -72
- package/dist/catalog/storage/storageCapabilities.js +0 -207
- package/dist/catalog/storage/xml-action/index.js +0 -31
- package/dist/catalog/transforms/format/config.js +0 -19
- package/dist/catalog/transforms/format/index.js +0 -39
- package/dist/catalog/triggers/connector-trigger/index.js +0 -72
- package/dist/catalog/triggers/manual-trigger/config.js +0 -60
- package/dist/catalog/triggers/manual-trigger/index.js +0 -74
- package/dist/catalog/triggers/schedule-trigger/config.js +0 -42
- package/dist/catalog/triggers/schedule-trigger/index.js +0 -102
- package/dist/catalog/triggers/webhook-trigger/config.js +0 -27
- package/dist/catalog/triggers/webhook-trigger/index.js +0 -89
- package/dist/catalog/types.js +0 -135
- package/dist/catalog/utility/debug/config.js +0 -90
- package/dist/catalog/utility/debug/index.js +0 -38
- package/dist/catalog/utility/error/config.js +0 -25
- package/dist/catalog/utility/error/index.js +0 -46
- package/dist/catalog/utility/variables/config.js +0 -70
- package/dist/catalog/utility/variables/index.js +0 -40
- package/dist/catalog/workflow.js +0 -25
- package/dist/ids.js +0 -53
- package/dist/rules/nodeConfigStatus.js +0 -217
- package/dist/rules/workflowValidator.js +0 -358
|
@@ -1,152 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Slack Message Action
|
|
3
|
-
*/
|
|
4
|
-
import { ActionCategory, ActionType, ActionStatus, FieldType } from '../../types';
|
|
5
|
-
export const slackMessageDefinition = {
|
|
6
|
-
id: 'slack_message',
|
|
7
|
-
name: 'Slack',
|
|
8
|
-
description: 'Send messages to Slack channels or users',
|
|
9
|
-
category: ActionCategory.Communication,
|
|
10
|
-
type: ActionType.SlackMessage,
|
|
11
|
-
tags: ['communication', 'slack', 'chat', 'built-in'],
|
|
12
|
-
status: ActionStatus.Stable,
|
|
13
|
-
icon: 'brand:slack',
|
|
14
|
-
color: '#4A154B',
|
|
15
|
-
inputSchema: {
|
|
16
|
-
fields: [
|
|
17
|
-
{ key: 'connection', label: 'Slack Workspace', type: FieldType.Connection, validation: { required: true } },
|
|
18
|
-
{ key: 'channel', label: 'Channel/User', type: FieldType.String, validation: { required: true } },
|
|
19
|
-
{ key: 'message', label: 'Message', type: FieldType.String, validation: { required: true } },
|
|
20
|
-
{ key: 'blocks', label: 'Blocks (JSON)', type: FieldType.JSON, validation: { required: false } },
|
|
21
|
-
],
|
|
22
|
-
},
|
|
23
|
-
outputSchema: {
|
|
24
|
-
type: 'object',
|
|
25
|
-
properties: [
|
|
26
|
-
{ key: 'success', type: FieldType.Boolean, description: 'Whether message was sent' },
|
|
27
|
-
{ key: 'timestamp', type: FieldType.String, description: 'Message timestamp' },
|
|
28
|
-
],
|
|
29
|
-
sampleOutput: { success: true, timestamp: '1234567890.123456' },
|
|
30
|
-
},
|
|
31
|
-
version: '1.0.0',
|
|
32
|
-
createdAt: '2025-01-01T00:00:00Z',
|
|
33
|
-
updatedAt: '2025-12-15T00:00:00Z',
|
|
34
|
-
createdBy: 'system',
|
|
35
|
-
isOfficial: true,
|
|
36
|
-
testable: true,
|
|
37
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Teams Message Configuration
|
|
3
|
-
*/
|
|
4
|
-
export const TeamsMessageConfig = {
|
|
5
|
-
defaults: { connection: '', teamId: '', teamName: '', channelId: '', channelName: '', title: '', message: '' },
|
|
6
|
-
schema: {
|
|
7
|
-
connection: { type: 'connection', required: true },
|
|
8
|
-
teamId: { type: 'string', required: true },
|
|
9
|
-
channelId: { type: 'string', required: true },
|
|
10
|
-
title: { type: 'string', required: false },
|
|
11
|
-
message: { type: 'string', required: true },
|
|
12
|
-
},
|
|
13
|
-
validate: (config) => {
|
|
14
|
-
const errors = [];
|
|
15
|
-
if (!config.connection)
|
|
16
|
-
errors.push('Connect a Microsoft Teams account');
|
|
17
|
-
if (!config.teamId)
|
|
18
|
-
errors.push('Pick a team');
|
|
19
|
-
if (!config.channelId)
|
|
20
|
-
errors.push('Pick a channel');
|
|
21
|
-
if (!config.message)
|
|
22
|
-
errors.push('Add a message');
|
|
23
|
-
return { valid: errors.length === 0, errors };
|
|
24
|
-
},
|
|
25
|
-
merge: (userConfig) => {
|
|
26
|
-
return { ...TeamsMessageConfig.defaults, ...userConfig };
|
|
27
|
-
},
|
|
28
|
-
getLabel: (config) => (config.channelName ? `Teams: #${config.channelName}` : 'Teams'),
|
|
29
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Teams Message Action
|
|
3
|
-
*/
|
|
4
|
-
import { ActionCategory, ActionType, ActionStatus, FieldType } from '../../types';
|
|
5
|
-
export const teamsMessageDefinition = {
|
|
6
|
-
id: 'teams_message',
|
|
7
|
-
name: 'Teams',
|
|
8
|
-
description: 'Post messages to Microsoft Teams channels via OAuth 2.0',
|
|
9
|
-
category: ActionCategory.Communication,
|
|
10
|
-
type: ActionType.TeamsMessage,
|
|
11
|
-
tags: ['communication', 'teams', 'microsoft', 'chat', 'built-in'],
|
|
12
|
-
status: ActionStatus.Stable,
|
|
13
|
-
icon: 'brand:teams',
|
|
14
|
-
color: '#4B53BC',
|
|
15
|
-
inputSchema: {
|
|
16
|
-
fields: [
|
|
17
|
-
{ key: 'connection', label: 'Teams Account', type: FieldType.Connection, validation: { required: true } },
|
|
18
|
-
{ key: 'teamId', label: 'Team', type: FieldType.String, validation: { required: true } },
|
|
19
|
-
{ key: 'channelId', label: 'Channel', type: FieldType.String, validation: { required: true } },
|
|
20
|
-
{ key: 'title', label: 'Subject', type: FieldType.String, validation: { required: false } },
|
|
21
|
-
{ key: 'message', label: 'Message', type: FieldType.String, validation: { required: true } },
|
|
22
|
-
],
|
|
23
|
-
},
|
|
24
|
-
outputSchema: {
|
|
25
|
-
type: 'object',
|
|
26
|
-
properties: [
|
|
27
|
-
{ key: 'ok', type: FieldType.Boolean, description: 'Whether the message was sent' },
|
|
28
|
-
{ key: 'id', type: FieldType.String, description: 'Sent message id' },
|
|
29
|
-
{ key: 'webUrl', type: FieldType.String, description: 'Deep link to the message' },
|
|
30
|
-
],
|
|
31
|
-
sampleOutput: { ok: true, id: '1700000000000', webUrl: 'https://teams.microsoft.com/l/message/...' },
|
|
32
|
-
},
|
|
33
|
-
version: '1.0.0',
|
|
34
|
-
createdAt: '2025-01-01T00:00:00Z',
|
|
35
|
-
updatedAt: '2025-12-15T00:00:00Z',
|
|
36
|
-
createdBy: 'system',
|
|
37
|
-
isOfficial: true,
|
|
38
|
-
testable: true,
|
|
39
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Webhook Call Configuration
|
|
3
|
-
*/
|
|
4
|
-
export const WebhookCallConfig = {
|
|
5
|
-
defaults: {
|
|
6
|
-
url: '',
|
|
7
|
-
method: 'POST',
|
|
8
|
-
payload: {},
|
|
9
|
-
headers: {},
|
|
10
|
-
},
|
|
11
|
-
schema: {
|
|
12
|
-
url: { type: 'url', required: true },
|
|
13
|
-
method: { type: 'select', required: true },
|
|
14
|
-
payload: { type: 'json', required: false },
|
|
15
|
-
headers: { type: 'json', required: false },
|
|
16
|
-
},
|
|
17
|
-
validate: (config) => {
|
|
18
|
-
const errors = [];
|
|
19
|
-
if (!config.url)
|
|
20
|
-
errors.push('Webhook URL is required');
|
|
21
|
-
if (!config.method)
|
|
22
|
-
errors.push('HTTP method is required');
|
|
23
|
-
return { valid: errors.length === 0, errors };
|
|
24
|
-
},
|
|
25
|
-
merge: (userConfig) => {
|
|
26
|
-
return { ...WebhookCallConfig.defaults, ...userConfig };
|
|
27
|
-
},
|
|
28
|
-
getLabel: (config) => {
|
|
29
|
-
return `${config.method}: ${config.url.substring(0, 40)}...`;
|
|
30
|
-
},
|
|
31
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Webhook Call Action
|
|
3
|
-
*/
|
|
4
|
-
import { ActionCategory, ActionType, ActionStatus, FieldType } from '../../types';
|
|
5
|
-
export const webhookCallDefinition = {
|
|
6
|
-
id: 'webhook_call',
|
|
7
|
-
name: 'Webhook Call',
|
|
8
|
-
description: 'Call external webhooks with custom payloads',
|
|
9
|
-
category: ActionCategory.Communication,
|
|
10
|
-
type: ActionType.WebhookCall,
|
|
11
|
-
tags: ['communication', 'webhook', 'http', 'built-in'],
|
|
12
|
-
status: ActionStatus.Stable,
|
|
13
|
-
icon: 'Webhook',
|
|
14
|
-
color: '#0043ce',
|
|
15
|
-
inputSchema: {
|
|
16
|
-
fields: [
|
|
17
|
-
{ key: 'url', label: 'Webhook URL', type: FieldType.URL, validation: { required: true } },
|
|
18
|
-
{ key: 'method', label: 'Method', type: FieldType.Select, options: [
|
|
19
|
-
{ label: 'POST', value: 'POST' },
|
|
20
|
-
{ label: 'PUT', value: 'PUT' },
|
|
21
|
-
{ label: 'PATCH', value: 'PATCH' },
|
|
22
|
-
{ label: 'GET', value: 'GET' },
|
|
23
|
-
], defaultValue: 'POST', validation: { required: true } },
|
|
24
|
-
{ key: 'payload', label: 'Payload', type: FieldType.JSON, validation: { required: false } },
|
|
25
|
-
{ key: 'headers', label: 'Headers', type: FieldType.JSON, validation: { required: false } },
|
|
26
|
-
],
|
|
27
|
-
},
|
|
28
|
-
outputSchema: {
|
|
29
|
-
type: 'object',
|
|
30
|
-
properties: [
|
|
31
|
-
{ key: 'statusCode', type: FieldType.Number, description: 'HTTP status code' },
|
|
32
|
-
{ key: 'response', type: FieldType.JSON, description: 'Response body' },
|
|
33
|
-
{ key: 'success', type: FieldType.Boolean, description: 'Whether call succeeded' },
|
|
34
|
-
],
|
|
35
|
-
sampleOutput: { statusCode: 200, response: {}, success: true },
|
|
36
|
-
},
|
|
37
|
-
version: '1.0.0',
|
|
38
|
-
createdAt: '2025-01-01T00:00:00Z',
|
|
39
|
-
updatedAt: '2025-12-15T00:00:00Z',
|
|
40
|
-
createdBy: 'system',
|
|
41
|
-
isOfficial: true,
|
|
42
|
-
testable: true,
|
|
43
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WhatsApp Send — config contract (DEV-285)
|
|
3
|
-
*/
|
|
4
|
-
export const WhatsappSendConfig = {
|
|
5
|
-
// Template is the default because it is the mode that always delivers;
|
|
6
|
-
// freeform silently depends on a 24-hour window the author can't see.
|
|
7
|
-
defaults: {
|
|
8
|
-
connection: '',
|
|
9
|
-
to: '',
|
|
10
|
-
mode: 'template',
|
|
11
|
-
templateLanguage: 'en_US',
|
|
12
|
-
templateVariables: [],
|
|
13
|
-
},
|
|
14
|
-
validate: (config) => {
|
|
15
|
-
const errors = [];
|
|
16
|
-
if (!config.connection)
|
|
17
|
-
errors.push('Select a WhatsApp connection');
|
|
18
|
-
if (!config.to?.trim())
|
|
19
|
-
errors.push('Recipient phone number is required');
|
|
20
|
-
if (config.mode === 'text') {
|
|
21
|
-
if (!config.text?.trim())
|
|
22
|
-
errors.push('Message text is required');
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
if (!config.templateName?.trim())
|
|
26
|
-
errors.push('Choose an approved template');
|
|
27
|
-
}
|
|
28
|
-
return { valid: errors.length === 0, errors };
|
|
29
|
-
},
|
|
30
|
-
merge: (userConfig) => {
|
|
31
|
-
return { ...WhatsappSendConfig.defaults, ...userConfig };
|
|
32
|
-
},
|
|
33
|
-
getLabel: (config) => config.mode === 'text'
|
|
34
|
-
? `WhatsApp to ${config.to || '—'}`
|
|
35
|
-
: `WhatsApp template "${config.templateName || '—'}" to ${config.to || '—'}`,
|
|
36
|
-
};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WhatsApp Send Action (DEV-285)
|
|
3
|
-
*
|
|
4
|
-
* Two modes, because WhatsApp has two genuinely different sends:
|
|
5
|
-
* template — the ONLY thing that delivers outside the 24-hour
|
|
6
|
-
* customer-service window. Meta charges by the template's
|
|
7
|
-
* CATEGORY (Marketing costs ~6× Utility), so the picker shows it.
|
|
8
|
-
* text — freeform; delivers only within 24 hours of the contact's last
|
|
9
|
-
* inbound message.
|
|
10
|
-
*
|
|
11
|
-
* A single "message" box would look like it works in testing and then fail
|
|
12
|
-
* the next day — which is why mode is an explicit, required choice.
|
|
13
|
-
*/
|
|
14
|
-
import { ActionCategory, ActionType, ActionStatus, FieldType } from '../../types';
|
|
15
|
-
export const whatsappSendDefinition = {
|
|
16
|
-
id: 'whatsapp_send',
|
|
17
|
-
name: 'WhatsApp',
|
|
18
|
-
description: 'Send a WhatsApp message — an approved template, or freeform text inside the 24-hour reply window',
|
|
19
|
-
category: ActionCategory.Communication,
|
|
20
|
-
type: ActionType.WhatsappSend,
|
|
21
|
-
tags: ['communication', 'whatsapp', 'messaging', 'template', 'built-in'],
|
|
22
|
-
status: ActionStatus.Beta,
|
|
23
|
-
icon: 'brand:whatsapp',
|
|
24
|
-
color: '#25D366',
|
|
25
|
-
inputSchema: {
|
|
26
|
-
fields: [
|
|
27
|
-
{ key: 'connection', label: 'WhatsApp Connection', type: FieldType.Connection, validation: { required: true } },
|
|
28
|
-
{ key: 'to', label: 'To (phone number)', type: FieldType.String, validation: { required: true } },
|
|
29
|
-
{ key: 'mode', label: 'Message Type', type: FieldType.Select, validation: { required: true } },
|
|
30
|
-
{ key: 'templateName', label: 'Template', type: FieldType.String, validation: { required: false } },
|
|
31
|
-
{ key: 'templateLanguage', label: 'Template Language', type: FieldType.String, validation: { required: false } },
|
|
32
|
-
{ key: 'templateVariables', label: 'Template Variables', type: FieldType.JSON, validation: { required: false } },
|
|
33
|
-
{ key: 'text', label: 'Message', type: FieldType.String, validation: { required: false } },
|
|
34
|
-
],
|
|
35
|
-
},
|
|
36
|
-
outputSchema: {
|
|
37
|
-
type: 'object',
|
|
38
|
-
properties: [
|
|
39
|
-
{ key: 'ok', type: FieldType.Boolean, description: 'Whether WhatsApp accepted the message' },
|
|
40
|
-
{ key: 'messageId', type: FieldType.String, description: 'WhatsApp message ID (wamid…)' },
|
|
41
|
-
{ key: 'waId', type: FieldType.String, description: "Recipient's resolved WhatsApp ID" },
|
|
42
|
-
{ key: 'mode', type: FieldType.String, description: 'template | text' },
|
|
43
|
-
],
|
|
44
|
-
sampleOutput: {
|
|
45
|
-
ok: true,
|
|
46
|
-
messageId: 'wamid.HBgMOTE4ODAyODg1MTQ1FQIAERgSN0YxN0E5RkQ5MEQ4RkE5QzFEAA==',
|
|
47
|
-
waId: '919876543210',
|
|
48
|
-
mode: 'template',
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
version: '1.0.0',
|
|
52
|
-
createdAt: '2026-07-30T00:00:00Z',
|
|
53
|
-
updatedAt: '2026-07-30T00:00:00Z',
|
|
54
|
-
createdBy: 'system',
|
|
55
|
-
isOfficial: true,
|
|
56
|
-
testable: true,
|
|
57
|
-
};
|