@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,205 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build Query Action Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for the Build Query action supporting both visual builder and SQL editor modes
|
|
5
|
+
*/
|
|
6
|
+
export declare enum QueryMode {
|
|
7
|
+
Visual = "visual",
|
|
8
|
+
SQL = "sql"
|
|
9
|
+
}
|
|
10
|
+
export declare enum QueryType {
|
|
11
|
+
Select = "select",
|
|
12
|
+
Insert = "insert",
|
|
13
|
+
Update = "update",
|
|
14
|
+
Delete = "delete",
|
|
15
|
+
Custom = "custom"
|
|
16
|
+
}
|
|
17
|
+
export declare enum FilterOperator {
|
|
18
|
+
Equals = "equals",
|
|
19
|
+
NotEquals = "not_equals",
|
|
20
|
+
GreaterThan = "greater_than",
|
|
21
|
+
LessThan = "less_than",
|
|
22
|
+
GreaterThanOrEqual = "greater_than_or_equal",
|
|
23
|
+
LessThanOrEqual = "less_than_or_equal",
|
|
24
|
+
Contains = "contains",
|
|
25
|
+
NotContains = "not_contains",
|
|
26
|
+
StartsWith = "starts_with",
|
|
27
|
+
EndsWith = "ends_with",
|
|
28
|
+
In = "in",
|
|
29
|
+
NotIn = "not_in",
|
|
30
|
+
IsNull = "is_null",
|
|
31
|
+
IsNotNull = "is_not_null",
|
|
32
|
+
Between = "between"
|
|
33
|
+
}
|
|
34
|
+
export declare enum LogicalOperator {
|
|
35
|
+
And = "and",
|
|
36
|
+
Or = "or"
|
|
37
|
+
}
|
|
38
|
+
export declare enum SortDirection {
|
|
39
|
+
Ascending = "asc",
|
|
40
|
+
Descending = "desc"
|
|
41
|
+
}
|
|
42
|
+
export declare enum JoinType {
|
|
43
|
+
Inner = "inner",
|
|
44
|
+
Left = "left",
|
|
45
|
+
Right = "right",
|
|
46
|
+
Full = "full"
|
|
47
|
+
}
|
|
48
|
+
export declare enum AggregateFunction {
|
|
49
|
+
Count = "count",
|
|
50
|
+
Sum = "sum",
|
|
51
|
+
Average = "avg",
|
|
52
|
+
Min = "min",
|
|
53
|
+
Max = "max",
|
|
54
|
+
CountDistinct = "count_distinct"
|
|
55
|
+
}
|
|
56
|
+
export interface QueryField {
|
|
57
|
+
id: string;
|
|
58
|
+
table: string;
|
|
59
|
+
column: string;
|
|
60
|
+
alias?: string;
|
|
61
|
+
aggregate?: AggregateFunction;
|
|
62
|
+
}
|
|
63
|
+
export interface QueryFilter {
|
|
64
|
+
id: string;
|
|
65
|
+
field: string;
|
|
66
|
+
operator: FilterOperator;
|
|
67
|
+
value?: unknown;
|
|
68
|
+
values?: unknown[];
|
|
69
|
+
logicalOperator?: LogicalOperator;
|
|
70
|
+
}
|
|
71
|
+
export interface QueryFilterGroup {
|
|
72
|
+
id: string;
|
|
73
|
+
filters: (QueryFilter | QueryFilterGroup)[];
|
|
74
|
+
logicalOperator: LogicalOperator;
|
|
75
|
+
}
|
|
76
|
+
export interface QuerySort {
|
|
77
|
+
id: string;
|
|
78
|
+
field: string;
|
|
79
|
+
direction: SortDirection;
|
|
80
|
+
}
|
|
81
|
+
export interface QueryJoin {
|
|
82
|
+
id: string;
|
|
83
|
+
type: JoinType;
|
|
84
|
+
table: string;
|
|
85
|
+
leftField: string;
|
|
86
|
+
rightField: string;
|
|
87
|
+
}
|
|
88
|
+
export interface QueryGroupBy {
|
|
89
|
+
id: string;
|
|
90
|
+
field: string;
|
|
91
|
+
}
|
|
92
|
+
export interface VisualQueryConfig {
|
|
93
|
+
tables: string[];
|
|
94
|
+
fields: QueryField[];
|
|
95
|
+
filters?: QueryFilterGroup;
|
|
96
|
+
joins?: QueryJoin[];
|
|
97
|
+
groupBy?: QueryGroupBy[];
|
|
98
|
+
sort?: QuerySort[];
|
|
99
|
+
limit?: number;
|
|
100
|
+
offset?: number;
|
|
101
|
+
}
|
|
102
|
+
export interface SQLQueryConfig {
|
|
103
|
+
sql: string;
|
|
104
|
+
parameters?: Record<string, unknown>;
|
|
105
|
+
}
|
|
106
|
+
export interface TableSchema {
|
|
107
|
+
name: string;
|
|
108
|
+
schema?: string;
|
|
109
|
+
columns: ColumnSchema[];
|
|
110
|
+
primaryKey?: string[];
|
|
111
|
+
foreignKeys?: ForeignKeySchema[];
|
|
112
|
+
}
|
|
113
|
+
export interface ColumnSchema {
|
|
114
|
+
name: string;
|
|
115
|
+
type: string;
|
|
116
|
+
nullable: boolean;
|
|
117
|
+
defaultValue?: unknown;
|
|
118
|
+
isPrimaryKey?: boolean;
|
|
119
|
+
isForeignKey?: boolean;
|
|
120
|
+
description?: string;
|
|
121
|
+
children?: ColumnSchema[];
|
|
122
|
+
/**
|
|
123
|
+
* For array columns: the element type (e.g. `text`, `int4`, `jsonb`,
|
|
124
|
+
* `record`). The UI uses this to decide whether sampling the column
|
|
125
|
+
* would surface a richer per-item shape (jsonb / record / composite)
|
|
126
|
+
* or only a primitive leaf (text / int / uuid / etc).
|
|
127
|
+
*/
|
|
128
|
+
arrayElementType?: string;
|
|
129
|
+
}
|
|
130
|
+
export interface ForeignKeySchema {
|
|
131
|
+
column: string;
|
|
132
|
+
referencedTable: string;
|
|
133
|
+
referencedColumn: string;
|
|
134
|
+
}
|
|
135
|
+
export interface ConnectorSchema {
|
|
136
|
+
tables: TableSchema[];
|
|
137
|
+
views?: TableSchema[];
|
|
138
|
+
procedures?: string[];
|
|
139
|
+
functions?: string[];
|
|
140
|
+
}
|
|
141
|
+
export interface BuildQueryConfig {
|
|
142
|
+
connectorId: string;
|
|
143
|
+
mode: QueryMode;
|
|
144
|
+
queryType: QueryType;
|
|
145
|
+
visualConfig?: VisualQueryConfig;
|
|
146
|
+
sqlConfig?: SQLQueryConfig;
|
|
147
|
+
timeout?: number;
|
|
148
|
+
maxRows?: number;
|
|
149
|
+
}
|
|
150
|
+
export interface QueryExecutionResult {
|
|
151
|
+
success: boolean;
|
|
152
|
+
data?: unknown[];
|
|
153
|
+
rowCount?: number;
|
|
154
|
+
columns?: string[];
|
|
155
|
+
executionTime?: number;
|
|
156
|
+
error?: string;
|
|
157
|
+
sql?: string;
|
|
158
|
+
_outputSchema?: {
|
|
159
|
+
type?: string;
|
|
160
|
+
properties?: Record<string, unknown>;
|
|
161
|
+
[k: string]: unknown;
|
|
162
|
+
};
|
|
163
|
+
_outputSchemaHash?: string;
|
|
164
|
+
}
|
|
165
|
+
export interface QueryPreviewRequest {
|
|
166
|
+
connectorId: string;
|
|
167
|
+
config: BuildQueryConfig;
|
|
168
|
+
limit?: number;
|
|
169
|
+
}
|
|
170
|
+
export interface QueryPreviewResult {
|
|
171
|
+
success: boolean;
|
|
172
|
+
preview?: unknown[];
|
|
173
|
+
rowCount?: number;
|
|
174
|
+
columns?: string[];
|
|
175
|
+
generatedSQL?: string;
|
|
176
|
+
error?: string;
|
|
177
|
+
}
|
|
178
|
+
export declare enum ConnectorType {
|
|
179
|
+
Database = "database",
|
|
180
|
+
API = "api",
|
|
181
|
+
CRM = "crm",
|
|
182
|
+
Analytics = "analytics",
|
|
183
|
+
Storage = "storage",
|
|
184
|
+
FileStorage = "file_storage",
|
|
185
|
+
Communication = "communication",
|
|
186
|
+
Other = "other"
|
|
187
|
+
}
|
|
188
|
+
export interface QueryableConnector {
|
|
189
|
+
id: string;
|
|
190
|
+
name: string;
|
|
191
|
+
type: ConnectorType;
|
|
192
|
+
supportsSQL: boolean;
|
|
193
|
+
supportsVisualBuilder: boolean;
|
|
194
|
+
schema?: ConnectorSchema;
|
|
195
|
+
}
|
|
196
|
+
export interface QueryValidationError {
|
|
197
|
+
field: string;
|
|
198
|
+
message: string;
|
|
199
|
+
severity: 'error' | 'warning';
|
|
200
|
+
}
|
|
201
|
+
export interface QueryValidationResult {
|
|
202
|
+
valid: boolean;
|
|
203
|
+
errors: QueryValidationError[];
|
|
204
|
+
warnings: QueryValidationError[];
|
|
205
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build Query Action Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for the Build Query action supporting both visual builder and SQL editor modes
|
|
5
|
+
*/
|
|
6
|
+
// ============================================
|
|
7
|
+
// QUERY MODES
|
|
8
|
+
// ============================================
|
|
9
|
+
export var QueryMode;
|
|
10
|
+
(function (QueryMode) {
|
|
11
|
+
QueryMode["Visual"] = "visual";
|
|
12
|
+
QueryMode["SQL"] = "sql";
|
|
13
|
+
})(QueryMode || (QueryMode = {}));
|
|
14
|
+
export var QueryType;
|
|
15
|
+
(function (QueryType) {
|
|
16
|
+
QueryType["Select"] = "select";
|
|
17
|
+
QueryType["Insert"] = "insert";
|
|
18
|
+
QueryType["Update"] = "update";
|
|
19
|
+
QueryType["Delete"] = "delete";
|
|
20
|
+
QueryType["Custom"] = "custom";
|
|
21
|
+
})(QueryType || (QueryType = {}));
|
|
22
|
+
// ============================================
|
|
23
|
+
// VISUAL QUERY BUILDER TYPES
|
|
24
|
+
// ============================================
|
|
25
|
+
export var FilterOperator;
|
|
26
|
+
(function (FilterOperator) {
|
|
27
|
+
FilterOperator["Equals"] = "equals";
|
|
28
|
+
FilterOperator["NotEquals"] = "not_equals";
|
|
29
|
+
FilterOperator["GreaterThan"] = "greater_than";
|
|
30
|
+
FilterOperator["LessThan"] = "less_than";
|
|
31
|
+
FilterOperator["GreaterThanOrEqual"] = "greater_than_or_equal";
|
|
32
|
+
FilterOperator["LessThanOrEqual"] = "less_than_or_equal";
|
|
33
|
+
FilterOperator["Contains"] = "contains";
|
|
34
|
+
FilterOperator["NotContains"] = "not_contains";
|
|
35
|
+
FilterOperator["StartsWith"] = "starts_with";
|
|
36
|
+
FilterOperator["EndsWith"] = "ends_with";
|
|
37
|
+
FilterOperator["In"] = "in";
|
|
38
|
+
FilterOperator["NotIn"] = "not_in";
|
|
39
|
+
FilterOperator["IsNull"] = "is_null";
|
|
40
|
+
FilterOperator["IsNotNull"] = "is_not_null";
|
|
41
|
+
FilterOperator["Between"] = "between";
|
|
42
|
+
})(FilterOperator || (FilterOperator = {}));
|
|
43
|
+
export var LogicalOperator;
|
|
44
|
+
(function (LogicalOperator) {
|
|
45
|
+
LogicalOperator["And"] = "and";
|
|
46
|
+
LogicalOperator["Or"] = "or";
|
|
47
|
+
})(LogicalOperator || (LogicalOperator = {}));
|
|
48
|
+
export var SortDirection;
|
|
49
|
+
(function (SortDirection) {
|
|
50
|
+
SortDirection["Ascending"] = "asc";
|
|
51
|
+
SortDirection["Descending"] = "desc";
|
|
52
|
+
})(SortDirection || (SortDirection = {}));
|
|
53
|
+
export var JoinType;
|
|
54
|
+
(function (JoinType) {
|
|
55
|
+
JoinType["Inner"] = "inner";
|
|
56
|
+
JoinType["Left"] = "left";
|
|
57
|
+
JoinType["Right"] = "right";
|
|
58
|
+
JoinType["Full"] = "full";
|
|
59
|
+
})(JoinType || (JoinType = {}));
|
|
60
|
+
export var AggregateFunction;
|
|
61
|
+
(function (AggregateFunction) {
|
|
62
|
+
AggregateFunction["Count"] = "count";
|
|
63
|
+
AggregateFunction["Sum"] = "sum";
|
|
64
|
+
AggregateFunction["Average"] = "avg";
|
|
65
|
+
AggregateFunction["Min"] = "min";
|
|
66
|
+
AggregateFunction["Max"] = "max";
|
|
67
|
+
AggregateFunction["CountDistinct"] = "count_distinct";
|
|
68
|
+
})(AggregateFunction || (AggregateFunction = {}));
|
|
69
|
+
// ============================================
|
|
70
|
+
// CONNECTOR FILTERING
|
|
71
|
+
// ============================================
|
|
72
|
+
export var ConnectorType;
|
|
73
|
+
(function (ConnectorType) {
|
|
74
|
+
ConnectorType["Database"] = "database";
|
|
75
|
+
ConnectorType["API"] = "api";
|
|
76
|
+
ConnectorType["CRM"] = "crm";
|
|
77
|
+
ConnectorType["Analytics"] = "analytics";
|
|
78
|
+
ConnectorType["Storage"] = "storage";
|
|
79
|
+
ConnectorType["FileStorage"] = "file_storage";
|
|
80
|
+
ConnectorType["Communication"] = "communication";
|
|
81
|
+
ConnectorType["Other"] = "other";
|
|
82
|
+
})(ConnectorType || (ConnectorType = {}));
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transform Configuration
|
|
3
|
+
*
|
|
4
|
+
* Configuration for data transformation and field mapping between workflow steps.
|
|
5
|
+
* Supports visual field mapping (drag-and-drop) and expression-based transforms.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* A single field mapping from source (upstream data) to target (output field).
|
|
9
|
+
*/
|
|
10
|
+
export interface FieldMapping {
|
|
11
|
+
/** Unique ID for this mapping row */
|
|
12
|
+
id: string;
|
|
13
|
+
/** Dot-path to the source field, e.g. "rows[].firstName" */
|
|
14
|
+
sourceField: string;
|
|
15
|
+
/** Name of the output field, e.g. "name" */
|
|
16
|
+
targetField: string;
|
|
17
|
+
/** Expected type of the target field */
|
|
18
|
+
targetType: 'string' | 'number' | 'boolean' | 'date' | 'object' | 'array' | 'any';
|
|
19
|
+
/** Optional per-field transform expression, e.g. "concat(firstName, ' ', lastName)" */
|
|
20
|
+
transform?: string;
|
|
21
|
+
/** ID of the upstream node this source field comes from */
|
|
22
|
+
sourceNodeId?: string;
|
|
23
|
+
/** Parent mapping ID for nested fields (empty = root level) */
|
|
24
|
+
parentId?: string;
|
|
25
|
+
/** Nesting depth (0 = root) */
|
|
26
|
+
depth?: number;
|
|
27
|
+
}
|
|
28
|
+
export type TransformMode = 'visual' | 'expression';
|
|
29
|
+
/** Data operation the user wants to perform */
|
|
30
|
+
export type TransformOperation = 'upsert' | 'insert' | 'update' | 'delete';
|
|
31
|
+
export declare const TRANSFORM_OPERATIONS: {
|
|
32
|
+
id: TransformOperation;
|
|
33
|
+
label: string;
|
|
34
|
+
}[];
|
|
35
|
+
/** Database connector IDs that support the database dropdown */
|
|
36
|
+
export declare const DATABASE_CONNECTOR_IDS: Set<string>;
|
|
37
|
+
export interface TransformConfigType {
|
|
38
|
+
/** Auto-generated from operation + target + object selections */
|
|
39
|
+
name: string;
|
|
40
|
+
/** What operation to perform on the target: upsert, insert, update, delete */
|
|
41
|
+
operation: TransformOperation;
|
|
42
|
+
/** Connected app / connector ID (like Query's source selector) */
|
|
43
|
+
connectorId: string;
|
|
44
|
+
/** Optional database name — shown for all DB connectors (MongoDB, PostgreSQL, MySQL) */
|
|
45
|
+
database?: string;
|
|
46
|
+
/** Table / entity / object name from the selected connector */
|
|
47
|
+
objectName: string;
|
|
48
|
+
/** Transform mode: visual field mapper or JS expression */
|
|
49
|
+
mode: TransformMode;
|
|
50
|
+
/** Field mappings (used in visual mode) */
|
|
51
|
+
mappings: FieldMapping[];
|
|
52
|
+
/** JavaScript expression (used in expression mode) */
|
|
53
|
+
expression?: string;
|
|
54
|
+
/** Constant fallbacks keyed by target field name — applied when the mapped
|
|
55
|
+
* value is null/undefined/'' (legacy DBSync "default values" parity). */
|
|
56
|
+
fieldDefaults?: Record<string, unknown>;
|
|
57
|
+
/** Explicit upsert/update match field (legacy externalid/pkey). Empty =
|
|
58
|
+
* per-connector auto-detection (Mongo _id, SF Id, SQL primary key). */
|
|
59
|
+
upsertMatchKey?: string;
|
|
60
|
+
/** Ordered column header names — the exact columns + header text written. */
|
|
61
|
+
sheetHeaders?: string[];
|
|
62
|
+
/** Create the target tab on first write if it doesn't exist (default true). */
|
|
63
|
+
createTabIfMissing?: boolean;
|
|
64
|
+
/** Write the header row into a new/empty tab (default true). */
|
|
65
|
+
writeHeaderRow?: boolean;
|
|
66
|
+
/** Clear existing data rows before writing (update/upsert only; default false). */
|
|
67
|
+
clearBeforeWrite?: boolean;
|
|
68
|
+
/** Non-destructive custom layout: header not in row 1 / restricted columns. */
|
|
69
|
+
sheetCustomLayout?: boolean;
|
|
70
|
+
/** Header row number for custom layout (default 1). */
|
|
71
|
+
sheetHeaderRow?: number;
|
|
72
|
+
/** Column range for custom layout, e.g. "A:H". */
|
|
73
|
+
sheetColumns?: string;
|
|
74
|
+
}
|
|
75
|
+
export declare const TransformConfig: {
|
|
76
|
+
defaults: TransformConfigType;
|
|
77
|
+
schema: {
|
|
78
|
+
operation: {
|
|
79
|
+
type: string;
|
|
80
|
+
required: boolean;
|
|
81
|
+
};
|
|
82
|
+
connectorId: {
|
|
83
|
+
type: string;
|
|
84
|
+
required: boolean;
|
|
85
|
+
};
|
|
86
|
+
database: {
|
|
87
|
+
type: string;
|
|
88
|
+
required: boolean;
|
|
89
|
+
};
|
|
90
|
+
objectName: {
|
|
91
|
+
type: string;
|
|
92
|
+
required: boolean;
|
|
93
|
+
};
|
|
94
|
+
mode: {
|
|
95
|
+
type: string;
|
|
96
|
+
required: boolean;
|
|
97
|
+
};
|
|
98
|
+
mappings: {
|
|
99
|
+
type: string;
|
|
100
|
+
required: boolean;
|
|
101
|
+
};
|
|
102
|
+
expression: {
|
|
103
|
+
type: string;
|
|
104
|
+
required: boolean;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
/** Auto-generate a descriptive name from the 3 dropdown selections */
|
|
108
|
+
generateName: (operation: TransformOperation, connectorLabel: string, objectName: string) => string;
|
|
109
|
+
validate: (config: Partial<TransformConfigType>) => {
|
|
110
|
+
valid: boolean;
|
|
111
|
+
errors: string[];
|
|
112
|
+
};
|
|
113
|
+
merge: (userConfig: Partial<TransformConfigType>) => TransformConfigType;
|
|
114
|
+
getLabel: (config: TransformConfigType) => string;
|
|
115
|
+
/** Generate a unique ID for a new mapping row */
|
|
116
|
+
createMappingId: () => string;
|
|
117
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transform Configuration
|
|
3
|
+
*
|
|
4
|
+
* Configuration for data transformation and field mapping between workflow steps.
|
|
5
|
+
* Supports visual field mapping (drag-and-drop) and expression-based transforms.
|
|
6
|
+
*/
|
|
7
|
+
import { randomSuffix } from '../../../ids';
|
|
8
|
+
export const TRANSFORM_OPERATIONS = [
|
|
9
|
+
{ id: 'upsert', label: 'Upsert' },
|
|
10
|
+
{ id: 'insert', label: 'Insert' },
|
|
11
|
+
{ id: 'update', label: 'Update' },
|
|
12
|
+
{ id: 'delete', label: 'Delete' },
|
|
13
|
+
];
|
|
14
|
+
/** Database connector IDs that support the database dropdown */
|
|
15
|
+
export const DATABASE_CONNECTOR_IDS = new Set(['mongodb', 'postgresql', 'mysql', 'sqlite', 'google_sheets']);
|
|
16
|
+
export const TransformConfig = {
|
|
17
|
+
defaults: {
|
|
18
|
+
name: 'Transform',
|
|
19
|
+
operation: 'upsert',
|
|
20
|
+
connectorId: '',
|
|
21
|
+
database: '',
|
|
22
|
+
objectName: '',
|
|
23
|
+
mode: 'visual',
|
|
24
|
+
mappings: [],
|
|
25
|
+
expression: '',
|
|
26
|
+
fieldDefaults: {},
|
|
27
|
+
upsertMatchKey: '',
|
|
28
|
+
sheetHeaders: [],
|
|
29
|
+
createTabIfMissing: true,
|
|
30
|
+
writeHeaderRow: true,
|
|
31
|
+
clearBeforeWrite: false,
|
|
32
|
+
sheetCustomLayout: false,
|
|
33
|
+
sheetHeaderRow: 1,
|
|
34
|
+
sheetColumns: '',
|
|
35
|
+
},
|
|
36
|
+
schema: {
|
|
37
|
+
operation: { type: 'select', required: true },
|
|
38
|
+
connectorId: { type: 'connection', required: true },
|
|
39
|
+
database: { type: 'text', required: false },
|
|
40
|
+
objectName: { type: 'select', required: true },
|
|
41
|
+
mode: { type: 'select', required: true },
|
|
42
|
+
mappings: { type: 'array', required: false },
|
|
43
|
+
expression: { type: 'code', required: false },
|
|
44
|
+
},
|
|
45
|
+
/** Auto-generate a descriptive name from the 3 dropdown selections */
|
|
46
|
+
generateName: (operation, connectorLabel, objectName) => {
|
|
47
|
+
const opLabel = TRANSFORM_OPERATIONS.find(o => o.id === operation)?.label || 'Transform';
|
|
48
|
+
const target = connectorLabel || 'Target';
|
|
49
|
+
const obj = objectName || 'Object';
|
|
50
|
+
return `${opLabel} → ${target} · ${obj}`;
|
|
51
|
+
},
|
|
52
|
+
validate: (config) => {
|
|
53
|
+
const errors = [];
|
|
54
|
+
if (!config.operation) {
|
|
55
|
+
errors.push('Operation is required');
|
|
56
|
+
}
|
|
57
|
+
if (!config.connectorId) {
|
|
58
|
+
errors.push('Target connector is required');
|
|
59
|
+
}
|
|
60
|
+
if (!config.objectName) {
|
|
61
|
+
errors.push('Object (table) is required');
|
|
62
|
+
}
|
|
63
|
+
// The Visual Field Mapper is the only authoring mode. Legacy steps saved
|
|
64
|
+
// in the retired JavaScript-expression mode still execute (the engine keeps
|
|
65
|
+
// that path for back-compat), so don't flag them invalid for lacking mappings.
|
|
66
|
+
const isLegacyExpression = config.mode === 'expression' && !!config.expression?.trim();
|
|
67
|
+
if (!isLegacyExpression) {
|
|
68
|
+
if (!config.mappings || config.mappings.length === 0) {
|
|
69
|
+
errors.push('At least one field mapping is required');
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
config.mappings.forEach((mapping, index) => {
|
|
73
|
+
if (!mapping.sourceField) {
|
|
74
|
+
errors.push(`Mapping ${index + 1}: Source field is required`);
|
|
75
|
+
}
|
|
76
|
+
if (!mapping.targetField) {
|
|
77
|
+
errors.push(`Mapping ${index + 1}: Target field is required`);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return { valid: errors.length === 0, errors };
|
|
83
|
+
},
|
|
84
|
+
merge: (userConfig) => {
|
|
85
|
+
return { ...TransformConfig.defaults, ...userConfig };
|
|
86
|
+
},
|
|
87
|
+
getLabel: (config) => {
|
|
88
|
+
const count = config.mappings?.length ?? 0;
|
|
89
|
+
return `${config.name || 'Transform'} (${count} field${count !== 1 ? 's' : ''})`;
|
|
90
|
+
},
|
|
91
|
+
/** Generate a unique ID for a new mapping row */
|
|
92
|
+
createMappingId: () => {
|
|
93
|
+
return `map_${Date.now()}_${randomSuffix(5)}`;
|
|
94
|
+
},
|
|
95
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transform Action
|
|
3
|
+
*
|
|
4
|
+
* Data transformation action that maps and reshapes data between workflow steps
|
|
5
|
+
* using the visual field mapper (drag-and-drop from the upstream schema).
|
|
6
|
+
*/
|
|
7
|
+
import { ActionDefinition } from '../../types';
|
|
8
|
+
export declare const transformDefinition: ActionDefinition;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transform Action
|
|
3
|
+
*
|
|
4
|
+
* Data transformation action that maps and reshapes data between workflow steps
|
|
5
|
+
* using the visual field mapper (drag-and-drop from the upstream schema).
|
|
6
|
+
*/
|
|
7
|
+
import { ActionCategory, ActionType, ActionStatus, FieldType } from '../../types';
|
|
8
|
+
export const transformDefinition = {
|
|
9
|
+
id: 'transform',
|
|
10
|
+
name: 'Transform',
|
|
11
|
+
description: 'Map and transform data between workflow steps using the visual field mapper',
|
|
12
|
+
category: ActionCategory.Transform,
|
|
13
|
+
type: ActionType.Transform,
|
|
14
|
+
tags: ['transform', 'mapping', 'data', 'reshape', 'convert', 'built-in'],
|
|
15
|
+
status: ActionStatus.Stable,
|
|
16
|
+
icon: 'Transform',
|
|
17
|
+
color: '#0043ce',
|
|
18
|
+
inputSchema: {
|
|
19
|
+
fields: [
|
|
20
|
+
{
|
|
21
|
+
key: 'name',
|
|
22
|
+
label: 'Transform Name',
|
|
23
|
+
type: FieldType.String,
|
|
24
|
+
description: 'A descriptive name for this transform step',
|
|
25
|
+
defaultValue: 'Transform',
|
|
26
|
+
validation: { required: false },
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
key: 'mappings',
|
|
30
|
+
label: 'Field Mappings',
|
|
31
|
+
type: FieldType.Array,
|
|
32
|
+
description: 'Map source fields from upstream nodes to target output fields',
|
|
33
|
+
validation: { required: false },
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
outputSchema: {
|
|
38
|
+
type: 'object',
|
|
39
|
+
properties: [
|
|
40
|
+
{
|
|
41
|
+
key: 'result',
|
|
42
|
+
type: FieldType.JSON,
|
|
43
|
+
description: 'Transformed data output',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
key: 'mappedFieldCount',
|
|
47
|
+
type: FieldType.Number,
|
|
48
|
+
description: 'Number of fields that were mapped/transformed',
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
sampleOutput: {
|
|
52
|
+
result: { name: 'John Doe', email: 'john@example.com', age: 30 },
|
|
53
|
+
mappedFieldCount: 3,
|
|
54
|
+
},
|
|
55
|
+
dynamic: true,
|
|
56
|
+
},
|
|
57
|
+
version: '2.0.0',
|
|
58
|
+
createdAt: '2025-01-01T00:00:00Z',
|
|
59
|
+
updatedAt: '2026-02-13T00:00:00Z',
|
|
60
|
+
createdBy: 'system',
|
|
61
|
+
isOfficial: true,
|
|
62
|
+
testable: true,
|
|
63
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Actions Registry
|
|
3
|
+
*
|
|
4
|
+
* Central registry for all built-in actions
|
|
5
|
+
* Each action is self-contained with its own configuration, UI, and metadata
|
|
6
|
+
*/
|
|
7
|
+
import { ActionDefinition, ActionCategory } from './types';
|
|
8
|
+
import { manualTriggerDefinition } from './triggers/manual-trigger';
|
|
9
|
+
import { scheduleTriggerDefinition } from './triggers/schedule-trigger';
|
|
10
|
+
import { webhookTriggerDefinition } from './triggers/webhook-trigger';
|
|
11
|
+
import { httpRequestDefinition } from './actions/http-request';
|
|
12
|
+
import { consoleLogDefinition } from './actions/console-log';
|
|
13
|
+
import { delayDefinition } from './actions/delay';
|
|
14
|
+
import { conditionDefinition } from './logic/condition';
|
|
15
|
+
import { forEachDefinition } from './logic/for-each';
|
|
16
|
+
import { groupDefinition } from './logic/group';
|
|
17
|
+
import { queryDefinition } from './general/query';
|
|
18
|
+
import { transformDefinition } from './general/transform';
|
|
19
|
+
import { csvActionDefinition } from './storage/csv-action';
|
|
20
|
+
import { jsonActionDefinition } from './storage/json-action';
|
|
21
|
+
import { xmlActionDefinition } from './storage/xml-action';
|
|
22
|
+
import { excelActionDefinition } from './storage/excel-action';
|
|
23
|
+
import { s3ActionDefinition } from './storage/s3-action';
|
|
24
|
+
import { ftpActionDefinition } from './storage/ftp-action';
|
|
25
|
+
import { googleDriveActionDefinition } from './storage/google-drive-action';
|
|
26
|
+
import { dropboxActionDefinition } from './storage/dropbox-action';
|
|
27
|
+
import { onedriveActionDefinition } from './storage/onedrive-action';
|
|
28
|
+
import { emailDefinition } from './communication/email-send';
|
|
29
|
+
import { slackMessageDefinition } from './communication/slack-message';
|
|
30
|
+
import { whatsappSendDefinition } from './communication/whatsapp-send';
|
|
31
|
+
import { teamsMessageDefinition } from './communication/teams-message';
|
|
32
|
+
import { googleChatDefinition } from './communication/google-chat';
|
|
33
|
+
import { webhookCallDefinition } from './communication/webhook-call';
|
|
34
|
+
import { debugDefinition } from './utility/debug';
|
|
35
|
+
import { errorDefinition } from './utility/error';
|
|
36
|
+
import { variablesDefinition } from './utility/variables';
|
|
37
|
+
import { graphqlQueryDefinition } from './api/graphql-query';
|
|
38
|
+
import { aiAgentDefinition } from './ai/ai-agent';
|
|
39
|
+
import { idpExtractDefinition } from './ai/idp-extract';
|
|
40
|
+
/**
|
|
41
|
+
* Registry of all available actions
|
|
42
|
+
* Organized by category for easy lookup and management
|
|
43
|
+
*/
|
|
44
|
+
export declare const actionsRegistry: Record<string, Record<string, ActionDefinition>>;
|
|
45
|
+
/**
|
|
46
|
+
* Get all actions as a flat array
|
|
47
|
+
*/
|
|
48
|
+
export declare const getAllActions: () => ActionDefinition[];
|
|
49
|
+
/**
|
|
50
|
+
* Get action by ID
|
|
51
|
+
*/
|
|
52
|
+
export declare const getActionById: (id: string) => ActionDefinition | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Get actions by category
|
|
55
|
+
*/
|
|
56
|
+
export declare const getActionsByCategory: (category: ActionCategory) => ActionDefinition[];
|
|
57
|
+
export { csvActionDefinition, jsonActionDefinition, xmlActionDefinition, excelActionDefinition, s3ActionDefinition, ftpActionDefinition, googleDriveActionDefinition, dropboxActionDefinition, onedriveActionDefinition, manualTriggerDefinition, scheduleTriggerDefinition, webhookTriggerDefinition, httpRequestDefinition, consoleLogDefinition, delayDefinition, conditionDefinition, forEachDefinition, groupDefinition, queryDefinition, transformDefinition, debugDefinition, errorDefinition, variablesDefinition, graphqlQueryDefinition, emailDefinition, slackMessageDefinition, whatsappSendDefinition, teamsMessageDefinition, googleChatDefinition, webhookCallDefinition, aiAgentDefinition, idpExtractDefinition, };
|