@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,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP Request Configuration
|
|
3
|
+
*
|
|
4
|
+
* Defines the configuration structure and default values for the HTTP Request action
|
|
5
|
+
*/
|
|
6
|
+
export interface ApiKeyValue {
|
|
7
|
+
key: string;
|
|
8
|
+
value: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
enabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface ApiAuthConfig {
|
|
13
|
+
type: 'none' | 'basic' | 'bearer' | 'apikey' | 'oauth2';
|
|
14
|
+
username?: string;
|
|
15
|
+
password?: string;
|
|
16
|
+
token?: string;
|
|
17
|
+
apiKeyName?: string;
|
|
18
|
+
apiKeyValue?: string;
|
|
19
|
+
apiKeyLocation?: 'header' | 'query';
|
|
20
|
+
accessToken?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ApiRetryConfig {
|
|
23
|
+
maxAttempts?: number;
|
|
24
|
+
retryOn?: number[];
|
|
25
|
+
initialDelayMs?: number;
|
|
26
|
+
backoffFactor?: number;
|
|
27
|
+
maxDelayMs?: number;
|
|
28
|
+
}
|
|
29
|
+
export interface ApiPaginationConfig {
|
|
30
|
+
type: 'none' | 'offset' | 'cursor' | 'link_header' | 'next_url';
|
|
31
|
+
limitParam?: string;
|
|
32
|
+
limitValue?: number;
|
|
33
|
+
offsetParam?: string;
|
|
34
|
+
cursorResponsePath?: string;
|
|
35
|
+
cursorRequestParam?: string;
|
|
36
|
+
nextUrlResponsePath?: string;
|
|
37
|
+
maxPages?: number;
|
|
38
|
+
mergeKey?: string;
|
|
39
|
+
}
|
|
40
|
+
export type ResponseType = 'json' | 'text' | 'binary';
|
|
41
|
+
export interface HTTPRequestConfigType {
|
|
42
|
+
apiType?: 'rest' | 'graphql';
|
|
43
|
+
method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS';
|
|
44
|
+
baseUrl?: string;
|
|
45
|
+
url: string;
|
|
46
|
+
queryParams?: ApiKeyValue[];
|
|
47
|
+
headers?: ApiKeyValue[] | Record<string, string>;
|
|
48
|
+
bodyType?: 'none' | 'json' | 'raw' | 'form-data' | 'xml';
|
|
49
|
+
body?: unknown;
|
|
50
|
+
formData?: ApiKeyValue[];
|
|
51
|
+
graphqlQuery?: string;
|
|
52
|
+
graphqlVariables?: Record<string, unknown>;
|
|
53
|
+
auth?: ApiAuthConfig;
|
|
54
|
+
timeout?: number;
|
|
55
|
+
failOnError?: boolean;
|
|
56
|
+
followRedirects?: boolean;
|
|
57
|
+
retry?: ApiRetryConfig;
|
|
58
|
+
pagination?: ApiPaginationConfig;
|
|
59
|
+
extract?: Record<string, string>;
|
|
60
|
+
responseType?: ResponseType;
|
|
61
|
+
expectedContentTypes?: string[];
|
|
62
|
+
}
|
|
63
|
+
export declare const HTTPRequestConfig: {
|
|
64
|
+
/**
|
|
65
|
+
* Default configuration for HTTP Request
|
|
66
|
+
*/
|
|
67
|
+
defaults: HTTPRequestConfigType;
|
|
68
|
+
/**
|
|
69
|
+
* Configuration schema for validation
|
|
70
|
+
*/
|
|
71
|
+
schema: {
|
|
72
|
+
method: {
|
|
73
|
+
type: string;
|
|
74
|
+
required: boolean;
|
|
75
|
+
description: string;
|
|
76
|
+
};
|
|
77
|
+
url: {
|
|
78
|
+
type: string;
|
|
79
|
+
required: boolean;
|
|
80
|
+
description: string;
|
|
81
|
+
};
|
|
82
|
+
headers: {
|
|
83
|
+
type: string;
|
|
84
|
+
required: boolean;
|
|
85
|
+
description: string;
|
|
86
|
+
};
|
|
87
|
+
body: {
|
|
88
|
+
type: string;
|
|
89
|
+
required: boolean;
|
|
90
|
+
description: string;
|
|
91
|
+
};
|
|
92
|
+
timeout: {
|
|
93
|
+
type: string;
|
|
94
|
+
required: boolean;
|
|
95
|
+
description: string;
|
|
96
|
+
min: number;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Validate configuration
|
|
101
|
+
*/
|
|
102
|
+
validate: (config: Partial<HTTPRequestConfigType>) => {
|
|
103
|
+
valid: boolean;
|
|
104
|
+
errors: string[];
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* Merge user config with defaults
|
|
108
|
+
*/
|
|
109
|
+
merge: (userConfig: Partial<HTTPRequestConfigType>) => HTTPRequestConfigType;
|
|
110
|
+
/**
|
|
111
|
+
* Get display label for configuration
|
|
112
|
+
*/
|
|
113
|
+
getLabel: (config: HTTPRequestConfigType) => string;
|
|
114
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP Request Configuration
|
|
3
|
+
*
|
|
4
|
+
* Defines the configuration structure and default values for the HTTP Request action
|
|
5
|
+
*/
|
|
6
|
+
export const HTTPRequestConfig = {
|
|
7
|
+
/**
|
|
8
|
+
* Default configuration for HTTP Request
|
|
9
|
+
*/
|
|
10
|
+
defaults: {
|
|
11
|
+
apiType: 'rest',
|
|
12
|
+
method: 'GET',
|
|
13
|
+
url: '',
|
|
14
|
+
queryParams: [],
|
|
15
|
+
headers: [],
|
|
16
|
+
bodyType: 'json',
|
|
17
|
+
body: undefined,
|
|
18
|
+
formData: [],
|
|
19
|
+
graphqlQuery: '',
|
|
20
|
+
graphqlVariables: {},
|
|
21
|
+
auth: { type: 'none' },
|
|
22
|
+
timeout: 30000,
|
|
23
|
+
failOnError: true,
|
|
24
|
+
followRedirects: true,
|
|
25
|
+
retry: { maxAttempts: 1, retryOn: [429, 500, 502, 503, 504], initialDelayMs: 1000, backoffFactor: 2, maxDelayMs: 30000 },
|
|
26
|
+
pagination: { type: 'none' },
|
|
27
|
+
extract: {},
|
|
28
|
+
responseType: 'json',
|
|
29
|
+
expectedContentTypes: [],
|
|
30
|
+
},
|
|
31
|
+
/**
|
|
32
|
+
* Configuration schema for validation
|
|
33
|
+
*/
|
|
34
|
+
schema: {
|
|
35
|
+
method: {
|
|
36
|
+
type: 'select',
|
|
37
|
+
required: true,
|
|
38
|
+
description: 'HTTP method to use',
|
|
39
|
+
},
|
|
40
|
+
url: {
|
|
41
|
+
type: 'url',
|
|
42
|
+
required: true,
|
|
43
|
+
description: 'The URL to send the request to',
|
|
44
|
+
},
|
|
45
|
+
headers: {
|
|
46
|
+
type: 'json',
|
|
47
|
+
required: false,
|
|
48
|
+
description: 'HTTP headers to send with the request',
|
|
49
|
+
},
|
|
50
|
+
body: {
|
|
51
|
+
type: 'json',
|
|
52
|
+
required: false,
|
|
53
|
+
description: 'Request body (for POST, PUT, PATCH)',
|
|
54
|
+
},
|
|
55
|
+
timeout: {
|
|
56
|
+
type: 'number',
|
|
57
|
+
required: false,
|
|
58
|
+
description: 'Request timeout in milliseconds',
|
|
59
|
+
min: 1000,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
/**
|
|
63
|
+
* Validate configuration
|
|
64
|
+
*/
|
|
65
|
+
validate: (config) => {
|
|
66
|
+
const errors = [];
|
|
67
|
+
const apiType = config.apiType ?? 'rest';
|
|
68
|
+
if (apiType === 'rest' && !config.method) {
|
|
69
|
+
errors.push('Method is required');
|
|
70
|
+
}
|
|
71
|
+
if (apiType === 'graphql' && !config.graphqlQuery?.trim()) {
|
|
72
|
+
errors.push('GraphQL query is required');
|
|
73
|
+
}
|
|
74
|
+
if (!config.url) {
|
|
75
|
+
errors.push('URL is required');
|
|
76
|
+
}
|
|
77
|
+
else if (typeof config.url === 'string') {
|
|
78
|
+
try {
|
|
79
|
+
new URL(config.url);
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
errors.push('Invalid URL format');
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
if (config.timeout !== undefined && typeof config.timeout === 'number') {
|
|
86
|
+
if (config.timeout < 1000) {
|
|
87
|
+
errors.push('Timeout must be at least 1000ms');
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return {
|
|
91
|
+
valid: errors.length === 0,
|
|
92
|
+
errors,
|
|
93
|
+
};
|
|
94
|
+
},
|
|
95
|
+
/**
|
|
96
|
+
* Merge user config with defaults
|
|
97
|
+
*/
|
|
98
|
+
merge: (userConfig) => {
|
|
99
|
+
return {
|
|
100
|
+
...HTTPRequestConfig.defaults,
|
|
101
|
+
...userConfig,
|
|
102
|
+
};
|
|
103
|
+
},
|
|
104
|
+
/**
|
|
105
|
+
* Get display label for configuration
|
|
106
|
+
*/
|
|
107
|
+
getLabel: (config) => {
|
|
108
|
+
const type = config.apiType === 'graphql' ? 'GraphQL' : (config.method ?? 'GET');
|
|
109
|
+
return `${type} ${config.url}`;
|
|
110
|
+
},
|
|
111
|
+
};
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP Request Action
|
|
3
|
+
*
|
|
4
|
+
* Make HTTP requests to external APIs and services
|
|
5
|
+
*/
|
|
6
|
+
import { ActionCategory, ActionType, ActionStatus, FieldType } from '../../types';
|
|
7
|
+
export const httpRequestDefinition = {
|
|
8
|
+
id: 'http_request',
|
|
9
|
+
name: 'HTTP Request',
|
|
10
|
+
description: 'Make HTTP requests to external APIs and services',
|
|
11
|
+
category: ActionCategory.API,
|
|
12
|
+
type: ActionType.HTTPRequest,
|
|
13
|
+
tags: ['api', 'http', 'request', 'built-in'],
|
|
14
|
+
status: ActionStatus.Stable,
|
|
15
|
+
icon: 'CloudUpload',
|
|
16
|
+
color: '#0043ce',
|
|
17
|
+
inputSchema: {
|
|
18
|
+
fields: [
|
|
19
|
+
{
|
|
20
|
+
key: 'apiType',
|
|
21
|
+
label: 'API Type',
|
|
22
|
+
type: FieldType.Select,
|
|
23
|
+
description: 'Type of API request to make',
|
|
24
|
+
defaultValue: 'rest',
|
|
25
|
+
options: [
|
|
26
|
+
{ label: 'REST', value: 'rest' },
|
|
27
|
+
{ label: 'GraphQL', value: 'graphql' },
|
|
28
|
+
],
|
|
29
|
+
validation: { required: true },
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
key: 'method',
|
|
33
|
+
label: 'Method',
|
|
34
|
+
type: FieldType.Select,
|
|
35
|
+
description: 'HTTP method to use (REST only)',
|
|
36
|
+
defaultValue: 'GET',
|
|
37
|
+
options: [
|
|
38
|
+
{ label: 'GET', value: 'GET' },
|
|
39
|
+
{ label: 'POST', value: 'POST' },
|
|
40
|
+
{ label: 'PUT', value: 'PUT' },
|
|
41
|
+
{ label: 'PATCH', value: 'PATCH' },
|
|
42
|
+
{ label: 'DELETE', value: 'DELETE' },
|
|
43
|
+
{ label: 'HEAD', value: 'HEAD' },
|
|
44
|
+
{ label: 'OPTIONS', value: 'OPTIONS' },
|
|
45
|
+
],
|
|
46
|
+
validation: { required: false },
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
key: 'url',
|
|
50
|
+
label: 'URL',
|
|
51
|
+
type: FieldType.URL,
|
|
52
|
+
description: 'The URL to send the request to. Supports {{variable}} interpolation.',
|
|
53
|
+
placeholder: 'https://api.example.com/endpoint',
|
|
54
|
+
validation: { required: true },
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
key: 'headers',
|
|
58
|
+
label: 'Headers',
|
|
59
|
+
type: FieldType.JSON,
|
|
60
|
+
description: 'HTTP headers (JSON object or key-value array). Supports {{variable}} interpolation.',
|
|
61
|
+
defaultValue: {},
|
|
62
|
+
validation: { required: false },
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
key: 'body',
|
|
66
|
+
label: 'Request Body',
|
|
67
|
+
type: FieldType.JSON,
|
|
68
|
+
description: 'Request body for POST/PUT/PATCH. Supports {{variable}} interpolation.',
|
|
69
|
+
validation: { required: false },
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
key: 'graphqlQuery',
|
|
73
|
+
label: 'GraphQL Query',
|
|
74
|
+
type: FieldType.String,
|
|
75
|
+
description: 'GraphQL query or mutation string (GraphQL only)',
|
|
76
|
+
validation: { required: false },
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
key: 'graphqlVariables',
|
|
80
|
+
label: 'GraphQL Variables',
|
|
81
|
+
type: FieldType.JSON,
|
|
82
|
+
description: 'GraphQL variables object. Supports {{variable}} interpolation.',
|
|
83
|
+
defaultValue: {},
|
|
84
|
+
validation: { required: false },
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
key: 'auth',
|
|
88
|
+
label: 'Authentication',
|
|
89
|
+
type: FieldType.JSON,
|
|
90
|
+
description: 'Authentication config: { type: "none"|"basic"|"bearer"|"apikey", token?, username?, password?, apiKeyName?, apiKeyValue?, apiKeyLocation? }',
|
|
91
|
+
defaultValue: { type: 'none' },
|
|
92
|
+
validation: { required: false },
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
key: 'timeout',
|
|
96
|
+
label: 'Timeout (ms)',
|
|
97
|
+
type: FieldType.Number,
|
|
98
|
+
description: 'Request timeout in milliseconds',
|
|
99
|
+
defaultValue: 30000,
|
|
100
|
+
validation: { required: false, min: 1000 },
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
key: 'failOnError',
|
|
104
|
+
label: 'Fail on non-2xx',
|
|
105
|
+
type: FieldType.Boolean,
|
|
106
|
+
description: 'If true, step fails when response status is not 2xx. Default: true.',
|
|
107
|
+
defaultValue: true,
|
|
108
|
+
validation: { required: false },
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
key: 'responseType',
|
|
112
|
+
label: 'Response Type',
|
|
113
|
+
type: FieldType.Select,
|
|
114
|
+
description: 'How to parse the response body. JSON tries to parse as JSON; Text returns raw text; Binary returns Uint8Array bytes plus fileName/contentType/size.',
|
|
115
|
+
defaultValue: 'json',
|
|
116
|
+
options: [
|
|
117
|
+
{ label: 'JSON', value: 'json' },
|
|
118
|
+
{ label: 'Text', value: 'text' },
|
|
119
|
+
{ label: 'Binary', value: 'binary' },
|
|
120
|
+
],
|
|
121
|
+
validation: { required: false },
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
key: 'expectedContentTypes',
|
|
125
|
+
label: 'Expected Content-Types',
|
|
126
|
+
type: FieldType.JSON,
|
|
127
|
+
description: 'Optional array of content-type prefixes (e.g. ["application/pdf"]). Logs a warning if the response content-type does not start with any of these.',
|
|
128
|
+
defaultValue: [],
|
|
129
|
+
validation: { required: false },
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
},
|
|
133
|
+
outputSchema: {
|
|
134
|
+
type: 'object',
|
|
135
|
+
properties: [
|
|
136
|
+
{
|
|
137
|
+
key: 'status',
|
|
138
|
+
type: FieldType.Number,
|
|
139
|
+
description: 'HTTP status code',
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
key: 'statusText',
|
|
143
|
+
type: FieldType.String,
|
|
144
|
+
description: 'HTTP status text',
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
key: 'ok',
|
|
148
|
+
type: FieldType.Boolean,
|
|
149
|
+
description: 'True if status is 2xx',
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
key: 'headers',
|
|
153
|
+
type: FieldType.Object,
|
|
154
|
+
description: 'Response headers',
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
key: 'body',
|
|
158
|
+
type: FieldType.JSON,
|
|
159
|
+
description: 'Response body (parsed JSON or raw string)',
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
key: 'duration',
|
|
163
|
+
type: FieldType.Number,
|
|
164
|
+
description: 'Request duration in milliseconds',
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
key: 'graphqlErrors',
|
|
168
|
+
type: FieldType.JSON,
|
|
169
|
+
description: 'GraphQL errors array (GraphQL only, present when errors returned)',
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
key: 'pages',
|
|
173
|
+
type: FieldType.Number,
|
|
174
|
+
description: 'Number of pages fetched (pagination only)',
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
key: 'attempts',
|
|
178
|
+
type: FieldType.Number,
|
|
179
|
+
description: 'Total fetch attempts made (includes retries)',
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
key: 'extracted',
|
|
183
|
+
type: FieldType.Object,
|
|
184
|
+
description: 'Named fields extracted from response body via dot-notation paths',
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
key: 'fileName',
|
|
188
|
+
type: FieldType.String,
|
|
189
|
+
description: 'Derived file name (only present when Response Type is Binary). Sourced from Content-Disposition header or URL pathname.',
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
key: 'contentType',
|
|
193
|
+
type: FieldType.String,
|
|
194
|
+
description: 'Response content-type (only present when Response Type is Binary). Defaults to application/octet-stream when missing.',
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
key: 'size',
|
|
198
|
+
type: FieldType.Number,
|
|
199
|
+
description: 'Response body size in bytes (only present when Response Type is Binary).',
|
|
200
|
+
},
|
|
201
|
+
],
|
|
202
|
+
sampleOutput: {
|
|
203
|
+
status: 200,
|
|
204
|
+
statusText: 'OK',
|
|
205
|
+
ok: true,
|
|
206
|
+
headers: { 'content-type': 'application/json' },
|
|
207
|
+
body: { success: true, data: {} },
|
|
208
|
+
duration: 245,
|
|
209
|
+
attempts: 1,
|
|
210
|
+
extracted: {},
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
execution: {
|
|
214
|
+
timeout: 30000,
|
|
215
|
+
retryable: true,
|
|
216
|
+
},
|
|
217
|
+
version: '1.0.0',
|
|
218
|
+
createdAt: '2025-01-01T00:00:00Z',
|
|
219
|
+
updatedAt: '2025-12-15T00:00:00Z',
|
|
220
|
+
createdBy: 'system',
|
|
221
|
+
isOfficial: true,
|
|
222
|
+
testable: true,
|
|
223
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI Agent Workflow Action — definition (DEV-92, epic DEV-85).
|
|
3
|
+
*
|
|
4
|
+
* Picks a saved Agent (chat or etl) and runs it as a workflow step.
|
|
5
|
+
* Config: { agentId, input?, overrides? }.
|
|
6
|
+
*
|
|
7
|
+
* The actual configuration UI lives in `components/AIAgentActionPanel.tsx`.
|
|
8
|
+
*
|
|
9
|
+
* See:
|
|
10
|
+
*/
|
|
11
|
+
import { type ActionDefinition } from '../../types';
|
|
12
|
+
export declare const aiAgentDefinition: ActionDefinition;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI Agent Workflow Action — definition (DEV-92, epic DEV-85).
|
|
3
|
+
*
|
|
4
|
+
* Picks a saved Agent (chat or etl) and runs it as a workflow step.
|
|
5
|
+
* Config: { agentId, input?, overrides? }.
|
|
6
|
+
*
|
|
7
|
+
* The actual configuration UI lives in `components/AIAgentActionPanel.tsx`.
|
|
8
|
+
*
|
|
9
|
+
* See:
|
|
10
|
+
*/
|
|
11
|
+
import { ActionCategory, ActionStatus, ActionType, FieldType, } from '../../types';
|
|
12
|
+
export const aiAgentDefinition = {
|
|
13
|
+
id: 'ai_agent',
|
|
14
|
+
name: 'AI Agent',
|
|
15
|
+
description: 'Run a reusable AI agent. Pick a saved agent from /ai/agents; optionally override model, temperature, or instructions per step.',
|
|
16
|
+
category: ActionCategory.AI,
|
|
17
|
+
type: ActionType.AIAgent,
|
|
18
|
+
tags: ['ai', 'agent', 'chat', 'built-in'],
|
|
19
|
+
status: ActionStatus.Stable,
|
|
20
|
+
icon: 'Bot',
|
|
21
|
+
color: '#7c3aed',
|
|
22
|
+
// The configuration UI is a custom panel (see components/AIAgentActionPanel.tsx).
|
|
23
|
+
// Fields below are the storage shape — the panel reads/writes them via
|
|
24
|
+
// setConfig but does NOT auto-render from this schema. This list keeps
|
|
25
|
+
// the action introspectable for downstream tooling (workflow validators,
|
|
26
|
+
// versioning) without duplicating the panel.
|
|
27
|
+
inputSchema: {
|
|
28
|
+
fields: [
|
|
29
|
+
{
|
|
30
|
+
key: 'agentId',
|
|
31
|
+
label: 'Agent',
|
|
32
|
+
type: FieldType.String,
|
|
33
|
+
description: 'Saved Agent public id (e.g. agt_xxx).',
|
|
34
|
+
validation: { required: true },
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
key: 'input',
|
|
38
|
+
label: 'Input',
|
|
39
|
+
type: FieldType.String,
|
|
40
|
+
description: 'Chat agents: a string (template-supported via {{step.field}}). ETL agents: rows array. When blank, falls back to upstream step output.',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
key: 'overrides',
|
|
44
|
+
label: 'Overrides',
|
|
45
|
+
type: FieldType.JSON,
|
|
46
|
+
description: 'Optional per-step overrides of the agent\u2019s own settings: model, temperature, maxTokens, topP, instructions and instructionsMode.',
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
outputSchema: {
|
|
51
|
+
type: 'object',
|
|
52
|
+
properties: [
|
|
53
|
+
{ key: 'text', type: FieldType.String, description: 'Agent response text (chat agents)' },
|
|
54
|
+
{ key: 'rows', type: FieldType.JSON, description: 'Output rows (etl agents)' },
|
|
55
|
+
{ key: 'usage', type: FieldType.JSON, description: 'Token usage + cost: tokensIn, tokensOut, latencyMs, costUsd' },
|
|
56
|
+
{ key: 'model', type: FieldType.String, description: 'Model that produced the response' },
|
|
57
|
+
{ key: 'agentVersion', type: FieldType.Number, description: 'Version of the agent definition that ran' },
|
|
58
|
+
],
|
|
59
|
+
sampleOutput: {
|
|
60
|
+
text: 'Sure — happy to help. What would you like to know?',
|
|
61
|
+
usage: { tokensIn: 42, tokensOut: 18, latencyMs: 612, costUsd: 0.000041 },
|
|
62
|
+
model: 'gpt-4o-mini',
|
|
63
|
+
agentVersion: 3,
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
version: '1.0.0',
|
|
67
|
+
createdAt: '2026-05-27T00:00:00Z',
|
|
68
|
+
updatedAt: '2026-05-27T00:00:00Z',
|
|
69
|
+
createdBy: 'system',
|
|
70
|
+
isOfficial: true,
|
|
71
|
+
testable: true,
|
|
72
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IDP — Extract action.
|
|
3
|
+
*
|
|
4
|
+
* Workflow primitive that runs Intelligent Document Processing on files
|
|
5
|
+
* received from an upstream step (HTTP download, FTP get, query result,
|
|
6
|
+
* data stream from any connector that produces files).
|
|
7
|
+
*
|
|
8
|
+
* Engine resolves the configured LLM connector at execution time —
|
|
9
|
+
* same pattern as `_resolvedConnection` for HTTP steps — and calls
|
|
10
|
+
* the document-extraction service once per file. Results emit as one
|
|
11
|
+
* row per source file: { fileName, data, confidence, audit, error? }.
|
|
12
|
+
*
|
|
13
|
+
* The action does NOT take file uploads of its own. Wire an upstream
|
|
14
|
+
* step that emits files with `{ fileName, body | s3Key, contentType }`
|
|
15
|
+
* (HTTP binary response, FTP/Storage download, etc.) into this step.
|
|
16
|
+
*/
|
|
17
|
+
import { ActionDefinition } from '../../types';
|
|
18
|
+
export declare const idpExtractDefinition: ActionDefinition;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IDP — Extract action.
|
|
3
|
+
*
|
|
4
|
+
* Workflow primitive that runs Intelligent Document Processing on files
|
|
5
|
+
* received from an upstream step (HTTP download, FTP get, query result,
|
|
6
|
+
* data stream from any connector that produces files).
|
|
7
|
+
*
|
|
8
|
+
* Engine resolves the configured LLM connector at execution time —
|
|
9
|
+
* same pattern as `_resolvedConnection` for HTTP steps — and calls
|
|
10
|
+
* the document-extraction service once per file. Results emit as one
|
|
11
|
+
* row per source file: { fileName, data, confidence, audit, error? }.
|
|
12
|
+
*
|
|
13
|
+
* The action does NOT take file uploads of its own. Wire an upstream
|
|
14
|
+
* step that emits files with `{ fileName, body | s3Key, contentType }`
|
|
15
|
+
* (HTTP binary response, FTP/Storage download, etc.) into this step.
|
|
16
|
+
*/
|
|
17
|
+
import { ActionCategory, ActionType, ActionStatus, FieldType } from '../../types';
|
|
18
|
+
export const idpExtractDefinition = {
|
|
19
|
+
id: 'idp_extract',
|
|
20
|
+
name: 'IDP',
|
|
21
|
+
description: 'Extract structured data from documents received from an upstream step. Configure the model provider, model, and the JSON Schema to extract.',
|
|
22
|
+
category: ActionCategory.AI,
|
|
23
|
+
type: ActionType.IdpExtract,
|
|
24
|
+
tags: ['ai', 'idp', 'document', 'extract', 'built-in'],
|
|
25
|
+
status: ActionStatus.Stable,
|
|
26
|
+
icon: 'DocumentImport',
|
|
27
|
+
color: '#0F62FE',
|
|
28
|
+
inputSchema: {
|
|
29
|
+
fields: [
|
|
30
|
+
{
|
|
31
|
+
key: 'llmConnectorId',
|
|
32
|
+
label: 'Model provider (connector)',
|
|
33
|
+
type: FieldType.Select,
|
|
34
|
+
description: 'Connected AI provider (OpenAI, Anthropic, Gemini, …). Resolved at execution time.',
|
|
35
|
+
validation: { required: true },
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
key: 'model',
|
|
39
|
+
label: 'Model',
|
|
40
|
+
type: FieldType.Select,
|
|
41
|
+
description: 'LLM available on the selected provider (e.g. gpt-4o, claude-3.5-sonnet, gemini-2.0-flash). Vision-capable models recommended.',
|
|
42
|
+
validation: { required: true },
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
key: 'expectedSchema',
|
|
46
|
+
label: 'Output schema',
|
|
47
|
+
type: FieldType.JSON,
|
|
48
|
+
description: 'JSON Schema describing the fields to extract. The LLM is forced to emit JSON matching this shape.',
|
|
49
|
+
// NOT required (DEV-220 rules parity, PO decision 2026-07-16): the
|
|
50
|
+
// schema is either LLM-generated at run time or user-supplied — an
|
|
51
|
+
// empty value is a valid "let the LLM infer it" configuration, so
|
|
52
|
+
// the rules engine must not flag it.
|
|
53
|
+
validation: { required: false },
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
key: 'systemPromptOverride',
|
|
57
|
+
label: 'System prompt override',
|
|
58
|
+
type: FieldType.String,
|
|
59
|
+
description: 'Optional extra instructions appended to the extraction prompt.',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
key: 'strategy',
|
|
63
|
+
label: 'Strategy',
|
|
64
|
+
type: FieldType.Select,
|
|
65
|
+
description: 'vision-direct sends the file as an image to a vision LLM. auto picks based on PDF text content.',
|
|
66
|
+
defaultValue: 'vision-direct',
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
},
|
|
70
|
+
outputSchema: {
|
|
71
|
+
type: 'object',
|
|
72
|
+
properties: [
|
|
73
|
+
{ key: 'state', type: FieldType.String, description: 'Aggregate state — completed | partial-success | failed.' },
|
|
74
|
+
{
|
|
75
|
+
key: 'pages',
|
|
76
|
+
type: FieldType.Array,
|
|
77
|
+
description: 'One row per file received from upstream: { fileName, data, confidence, audit, error? }',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
key: 'totals',
|
|
81
|
+
type: FieldType.Object,
|
|
82
|
+
description: 'Summary { pages, completed, failed }',
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
},
|
|
86
|
+
version: '2.0.0',
|
|
87
|
+
createdAt: '2026-05-06T00:00:00Z',
|
|
88
|
+
updatedAt: '2026-05-10T00:00:00Z',
|
|
89
|
+
createdBy: 'system',
|
|
90
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GraphQL Query Configuration
|
|
3
|
+
*/
|
|
4
|
+
export interface GraphQLQueryConfigType {
|
|
5
|
+
endpoint: string;
|
|
6
|
+
query: string;
|
|
7
|
+
variables?: Record<string, unknown>;
|
|
8
|
+
headers?: Record<string, string>;
|
|
9
|
+
}
|
|
10
|
+
export declare const GraphQLQueryConfig: {
|
|
11
|
+
defaults: GraphQLQueryConfigType;
|
|
12
|
+
schema: {
|
|
13
|
+
endpoint: {
|
|
14
|
+
type: string;
|
|
15
|
+
required: boolean;
|
|
16
|
+
};
|
|
17
|
+
query: {
|
|
18
|
+
type: string;
|
|
19
|
+
required: boolean;
|
|
20
|
+
};
|
|
21
|
+
variables: {
|
|
22
|
+
type: string;
|
|
23
|
+
required: boolean;
|
|
24
|
+
};
|
|
25
|
+
headers: {
|
|
26
|
+
type: string;
|
|
27
|
+
required: boolean;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
validate: (config: Partial<GraphQLQueryConfigType>) => {
|
|
31
|
+
valid: boolean;
|
|
32
|
+
errors: string[];
|
|
33
|
+
};
|
|
34
|
+
merge: (userConfig: Partial<GraphQLQueryConfigType>) => GraphQLQueryConfigType;
|
|
35
|
+
getLabel: (config: GraphQLQueryConfigType) => string;
|
|
36
|
+
};
|