@octaviaflow/flow-rules 0.13.2 → 0.15.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/catalog/general/transform/config.d.ts +21 -0
- package/dist/catalog/index.d.ts +1 -3
- package/dist/catalog/storage/fileEditContract.d.ts +4 -4
- package/dist/catalog/triggers/connector-trigger/config.d.ts +9 -1
- package/dist/catalog/types.d.ts +0 -18
- package/dist/index.cjs +30 -310
- package/dist/index.d.ts +1 -2
- package/dist/index.js +30 -310
- package/dist/rules/configContracts.d.ts +3 -1
- package/package.json +1 -1
- package/dist/catalog/api/graphql-query/config.d.ts +0 -36
- package/dist/catalog/api/graphql-query/index.d.ts +0 -7
- package/dist/catalog/storage/file-action/config.d.ts +0 -197
- package/dist/catalog/storage/file-action/index.d.ts +0 -2
- package/dist/catalog/storage/file-operation/config.d.ts +0 -49
- package/dist/catalog/storage/file-operation/index.d.ts +0 -8
- package/dist/catalog/transforms/format/config.d.ts +0 -24
- package/dist/catalog/transforms/format/index.d.ts +0 -5
- package/dist/catalog/utility/error/config.d.ts +0 -26
- package/dist/catalog/utility/error/index.d.ts +0 -7
|
@@ -24,6 +24,19 @@ export interface FieldMapping {
|
|
|
24
24
|
parentId?: string;
|
|
25
25
|
/** Nesting depth (0 = root) */
|
|
26
26
|
depth?: number;
|
|
27
|
+
/** With `groupBy`: this field goes into each line of the record's list, not the record (DEV-478). Root level only. */
|
|
28
|
+
lineField?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* One record per key (DEV-478): rows whose `key` resolves to the same value
|
|
32
|
+
* become one record (fields from the group's first row); the mappings marked
|
|
33
|
+
* `lineField` become a list of line objects under `into`, in row order.
|
|
34
|
+
*/
|
|
35
|
+
export interface TransformGroupBy {
|
|
36
|
+
/** Source expression of the key, written like a sourceField: `{{orders[].number}}`. */
|
|
37
|
+
key: string;
|
|
38
|
+
/** Target field holding the list of lines: `line_items` (Shopify), `Line` (QuickBooks), `order_line` (Odoo). */
|
|
39
|
+
into: string;
|
|
27
40
|
}
|
|
28
41
|
export type TransformMode = 'visual' | 'expression';
|
|
29
42
|
/**
|
|
@@ -65,6 +78,8 @@ export interface TransformConfigType {
|
|
|
65
78
|
/** Explicit upsert/update match field (legacy externalid/pkey). Empty =
|
|
66
79
|
* per-connector auto-detection (Mongo _id, SF Id, SQL primary key). */
|
|
67
80
|
upsertMatchKey?: string;
|
|
81
|
+
/** One record per key, with the `lineField` mappings collected into a list (DEV-478). */
|
|
82
|
+
groupBy?: TransformGroupBy;
|
|
68
83
|
/** Ordered column header names — the exact columns + header text written. */
|
|
69
84
|
sheetHeaders?: string[];
|
|
70
85
|
/** Create the target tab on first write if it doesn't exist (default true). */
|
|
@@ -117,6 +132,12 @@ export declare const TransformConfig: {
|
|
|
117
132
|
mappings: {
|
|
118
133
|
type: string;
|
|
119
134
|
required: boolean;
|
|
135
|
+
description: string;
|
|
136
|
+
};
|
|
137
|
+
groupBy: {
|
|
138
|
+
type: string;
|
|
139
|
+
required: boolean;
|
|
140
|
+
description: string;
|
|
120
141
|
};
|
|
121
142
|
expression: {
|
|
122
143
|
type: string;
|
package/dist/catalog/index.d.ts
CHANGED
|
@@ -33,9 +33,7 @@ import { teamsMessageDefinition } from './communication/teams-message';
|
|
|
33
33
|
import { googleChatDefinition } from './communication/google-chat';
|
|
34
34
|
import { webhookCallDefinition } from './communication/webhook-call';
|
|
35
35
|
import { debugDefinition } from './utility/debug';
|
|
36
|
-
import { errorDefinition } from './utility/error';
|
|
37
36
|
import { variablesDefinition } from './utility/variables';
|
|
38
|
-
import { graphqlQueryDefinition } from './api/graphql-query';
|
|
39
37
|
import { aiAgentDefinition } from './ai/ai-agent';
|
|
40
38
|
import { idpExtractDefinition } from './ai/idp-extract';
|
|
41
39
|
/**
|
|
@@ -55,4 +53,4 @@ export declare const getActionById: (id: string) => ActionDefinition | undefined
|
|
|
55
53
|
* Get actions by category
|
|
56
54
|
*/
|
|
57
55
|
export declare const getActionsByCategory: (category: ActionCategory) => ActionDefinition[];
|
|
58
|
-
export { csvActionDefinition, jsonActionDefinition, xmlActionDefinition, excelActionDefinition, s3ActionDefinition, ftpActionDefinition, googleDriveActionDefinition, dropboxActionDefinition, onedriveActionDefinition, manualTriggerDefinition, scheduleTriggerDefinition, webhookTriggerDefinition, httpRequestDefinition, consoleLogDefinition, delayDefinition, conditionDefinition, forEachDefinition, groupDefinition, queryDefinition, transformDefinition, aggregateDefinition, debugDefinition,
|
|
56
|
+
export { csvActionDefinition, jsonActionDefinition, xmlActionDefinition, excelActionDefinition, s3ActionDefinition, ftpActionDefinition, googleDriveActionDefinition, dropboxActionDefinition, onedriveActionDefinition, manualTriggerDefinition, scheduleTriggerDefinition, webhookTriggerDefinition, httpRequestDefinition, consoleLogDefinition, delayDefinition, conditionDefinition, forEachDefinition, groupDefinition, queryDefinition, transformDefinition, aggregateDefinition, debugDefinition, variablesDefinition, emailDefinition, slackMessageDefinition, whatsappSendDefinition, teamsMessageDefinition, googleChatDefinition, webhookCallDefinition, aiAgentDefinition, idpExtractDefinition, };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* What the file-format actions share.
|
|
3
3
|
*
|
|
4
|
-
* `csv_action`, `json_action`, `xml_action
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* `csv_action`, `json_action`, `xml_action` and `excel_action` are one panel
|
|
5
|
+
* family (CsvConfigPanel + FileEditControls in the editor) and one executor
|
|
6
|
+
* family (`doEditFile` in the Engine). The keys they share when `operation`
|
|
7
|
+
* is `edit` live here once, so four contracts cannot drift from
|
|
8
8
|
* each other the way `index.ts` and `config.ts` once did.
|
|
9
9
|
*
|
|
10
10
|
* Shapes are what the editor WRITES and the Engine READS today — not what
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
* `connectorId`, `connectorName`, `subscribed`, `eventCount` and `summary` are
|
|
9
9
|
* written by the panel (and by the Backend on an agent's behalf) so the canvas
|
|
10
10
|
* and `check_flow` can read the registration without a second lookup. The
|
|
11
|
-
* Google Sheets keys apply only when `connectorId` is `google_sheets
|
|
11
|
+
* Google Sheets keys apply only when `connectorId` is `google_sheets`, and
|
|
12
|
+
* `folderPath` only when it is `dropbox`.
|
|
12
13
|
*/
|
|
13
14
|
import { type ConnectorTriggerEvent } from './events';
|
|
14
15
|
export interface ConnectorTriggerConfigType {
|
|
@@ -34,6 +35,8 @@ export interface ConnectorTriggerConfigType {
|
|
|
34
35
|
sheetName?: string;
|
|
35
36
|
/** Google Sheets: the column that identifies a row, for change detection. */
|
|
36
37
|
sheetKeyColumn?: string;
|
|
38
|
+
/** Dropbox: the folder watched, recursively ('' or absent = the whole Dropbox). */
|
|
39
|
+
folderPath?: string;
|
|
37
40
|
/** Free text the Engine adds to the trigger's output when set. */
|
|
38
41
|
description?: string;
|
|
39
42
|
}
|
|
@@ -95,6 +98,11 @@ export declare const ConnectorTriggerConfig: {
|
|
|
95
98
|
required: boolean;
|
|
96
99
|
description: string;
|
|
97
100
|
};
|
|
101
|
+
folderPath: {
|
|
102
|
+
type: string;
|
|
103
|
+
required: boolean;
|
|
104
|
+
description: string;
|
|
105
|
+
};
|
|
98
106
|
description: {
|
|
99
107
|
type: string;
|
|
100
108
|
required: boolean;
|
package/dist/catalog/types.d.ts
CHANGED
|
@@ -26,30 +26,16 @@ export declare enum ActionType {
|
|
|
26
26
|
Schedule = "schedule",
|
|
27
27
|
Webhook = "webhook",
|
|
28
28
|
Manual = "manual",
|
|
29
|
-
DataChange = "data_change",
|
|
30
29
|
Event = "event",
|
|
31
|
-
Read = "read",
|
|
32
30
|
Write = "write",
|
|
33
|
-
Update = "update",
|
|
34
|
-
Delete = "delete",
|
|
35
31
|
Query = "query",
|
|
36
32
|
HTTPRequest = "http_request",
|
|
37
|
-
GraphQLQuery = "graphql_query",
|
|
38
33
|
Condition = "condition",
|
|
39
34
|
ForEach = "for_each",
|
|
40
35
|
Group = "group",
|
|
41
|
-
Format = "format",
|
|
42
36
|
AIAgent = "ai_agent",
|
|
43
|
-
Embedding = "embedding",
|
|
44
|
-
VectorSearch = "vector_search",
|
|
45
|
-
ImageGeneration = "image_generation",
|
|
46
|
-
ImageAnalysis = "image_analysis",
|
|
47
|
-
SpeechToText = "speech_to_text",
|
|
48
|
-
TextToSpeech = "text_to_speech",
|
|
49
37
|
Transform = "transform",
|
|
50
38
|
Aggregate = "aggregate",
|
|
51
|
-
FileOperation = "file_operation",
|
|
52
|
-
FileAction = "file_action",
|
|
53
39
|
CsvAction = "csv_action",
|
|
54
40
|
JsonAction = "json_action",
|
|
55
41
|
XmlAction = "xml_action",
|
|
@@ -67,12 +53,8 @@ export declare enum ActionType {
|
|
|
67
53
|
GoogleChat = "google_chat",
|
|
68
54
|
WebhookCall = "webhook_call",
|
|
69
55
|
Delay = "delay",
|
|
70
|
-
Wait = "wait",
|
|
71
56
|
Console = "console",
|
|
72
57
|
Debug = "debug",
|
|
73
|
-
Error = "error",
|
|
74
|
-
CustomCode = "custom_code",
|
|
75
|
-
CustomAction = "custom_action",
|
|
76
58
|
IdpExtract = "idp_extract"
|
|
77
59
|
}
|
|
78
60
|
export declare enum ActionStatus {
|
package/dist/index.cjs
CHANGED
|
@@ -61,10 +61,6 @@ __export(exports_src, {
|
|
|
61
61
|
EdgeType: () => EdgeType,
|
|
62
62
|
EmailConfig: () => EmailConfig,
|
|
63
63
|
ExcelActionConfig: () => ExcelActionConfig,
|
|
64
|
-
FILE_ACTION_FORMATS: () => FILE_ACTION_FORMATS,
|
|
65
|
-
FILE_ACTION_MODES: () => FILE_ACTION_MODES,
|
|
66
|
-
FILE_ACTION_OUTPUT_FORMATS: () => FILE_ACTION_OUTPUT_FORMATS,
|
|
67
|
-
FILE_ACTION_SOURCES: () => FILE_ACTION_SOURCES,
|
|
68
64
|
FILE_EDIT_DESTINATIONS: () => FILE_EDIT_DESTINATIONS,
|
|
69
65
|
FILE_EDIT_MATCH_OPS: () => FILE_EDIT_MATCH_OPS,
|
|
70
66
|
FILE_EDIT_OPERATIONS: () => FILE_EDIT_OPERATIONS,
|
|
@@ -73,7 +69,6 @@ __export(exports_src, {
|
|
|
73
69
|
FILE_FORMAT_OPERATIONS: () => FILE_FORMAT_OPERATIONS,
|
|
74
70
|
FTP_OPERATIONS: () => FTP_OPERATIONS,
|
|
75
71
|
FieldType: () => FieldType,
|
|
76
|
-
FileActionConfig: () => FileActionConfig,
|
|
77
72
|
ForEachConfig: () => ForEachConfig,
|
|
78
73
|
FtpActionConfig: () => FtpActionConfig,
|
|
79
74
|
GOOGLE_DRIVE_OPERATIONS: () => GOOGLE_DRIVE_OPERATIONS,
|
|
@@ -187,30 +182,16 @@ var ActionType;
|
|
|
187
182
|
ActionType["Schedule"] = "schedule";
|
|
188
183
|
ActionType["Webhook"] = "webhook";
|
|
189
184
|
ActionType["Manual"] = "manual";
|
|
190
|
-
ActionType["DataChange"] = "data_change";
|
|
191
185
|
ActionType["Event"] = "event";
|
|
192
|
-
ActionType["Read"] = "read";
|
|
193
186
|
ActionType["Write"] = "write";
|
|
194
|
-
ActionType["Update"] = "update";
|
|
195
|
-
ActionType["Delete"] = "delete";
|
|
196
187
|
ActionType["Query"] = "query";
|
|
197
188
|
ActionType["HTTPRequest"] = "http_request";
|
|
198
|
-
ActionType["GraphQLQuery"] = "graphql_query";
|
|
199
189
|
ActionType["Condition"] = "condition";
|
|
200
190
|
ActionType["ForEach"] = "for_each";
|
|
201
191
|
ActionType["Group"] = "group";
|
|
202
|
-
ActionType["Format"] = "format";
|
|
203
192
|
ActionType["AIAgent"] = "ai_agent";
|
|
204
|
-
ActionType["Embedding"] = "embedding";
|
|
205
|
-
ActionType["VectorSearch"] = "vector_search";
|
|
206
|
-
ActionType["ImageGeneration"] = "image_generation";
|
|
207
|
-
ActionType["ImageAnalysis"] = "image_analysis";
|
|
208
|
-
ActionType["SpeechToText"] = "speech_to_text";
|
|
209
|
-
ActionType["TextToSpeech"] = "text_to_speech";
|
|
210
193
|
ActionType["Transform"] = "transform";
|
|
211
194
|
ActionType["Aggregate"] = "aggregate";
|
|
212
|
-
ActionType["FileOperation"] = "file_operation";
|
|
213
|
-
ActionType["FileAction"] = "file_action";
|
|
214
195
|
ActionType["CsvAction"] = "csv_action";
|
|
215
196
|
ActionType["JsonAction"] = "json_action";
|
|
216
197
|
ActionType["XmlAction"] = "xml_action";
|
|
@@ -228,12 +209,8 @@ var ActionType;
|
|
|
228
209
|
ActionType["GoogleChat"] = "google_chat";
|
|
229
210
|
ActionType["WebhookCall"] = "webhook_call";
|
|
230
211
|
ActionType["Delay"] = "delay";
|
|
231
|
-
ActionType["Wait"] = "wait";
|
|
232
212
|
ActionType["Console"] = "console";
|
|
233
213
|
ActionType["Debug"] = "debug";
|
|
234
|
-
ActionType["Error"] = "error";
|
|
235
|
-
ActionType["CustomCode"] = "custom_code";
|
|
236
|
-
ActionType["CustomAction"] = "custom_action";
|
|
237
214
|
ActionType["IdpExtract"] = "idp_extract";
|
|
238
215
|
})(ActionType ||= {});
|
|
239
216
|
var ActionStatus;
|
|
@@ -2586,48 +2563,6 @@ var debugDefinition = {
|
|
|
2586
2563
|
testable: false
|
|
2587
2564
|
};
|
|
2588
2565
|
|
|
2589
|
-
// src/catalog/utility/error/index.ts
|
|
2590
|
-
var errorDefinition = {
|
|
2591
|
-
id: "error",
|
|
2592
|
-
name: "Error",
|
|
2593
|
-
description: "Throw an error to stop workflow execution",
|
|
2594
|
-
category: "utility" /* Utility */,
|
|
2595
|
-
type: "error" /* Error */,
|
|
2596
|
-
tags: ["utility", "error", "control", "built-in"],
|
|
2597
|
-
status: "stable" /* Stable */,
|
|
2598
|
-
icon: "ErrorFilled",
|
|
2599
|
-
color: "#da3742",
|
|
2600
|
-
inputSchema: {
|
|
2601
|
-
fields: [
|
|
2602
|
-
{
|
|
2603
|
-
key: "message",
|
|
2604
|
-
label: "Error Message",
|
|
2605
|
-
type: "string" /* String */,
|
|
2606
|
-
description: "Error message to throw",
|
|
2607
|
-
validation: { required: true }
|
|
2608
|
-
},
|
|
2609
|
-
{
|
|
2610
|
-
key: "code",
|
|
2611
|
-
label: "Error Code",
|
|
2612
|
-
type: "string" /* String */,
|
|
2613
|
-
description: "Error code",
|
|
2614
|
-
validation: { required: false }
|
|
2615
|
-
}
|
|
2616
|
-
]
|
|
2617
|
-
},
|
|
2618
|
-
outputSchema: {
|
|
2619
|
-
type: "void",
|
|
2620
|
-
properties: [],
|
|
2621
|
-
sampleOutput: null
|
|
2622
|
-
},
|
|
2623
|
-
version: "1.0.0",
|
|
2624
|
-
createdAt: "2025-01-01T00:00:00Z",
|
|
2625
|
-
updatedAt: "2025-12-15T00:00:00Z",
|
|
2626
|
-
createdBy: "system",
|
|
2627
|
-
isOfficial: true,
|
|
2628
|
-
testable: true
|
|
2629
|
-
};
|
|
2630
|
-
|
|
2631
2566
|
// src/catalog/utility/variables/index.ts
|
|
2632
2567
|
var variablesDefinition = {
|
|
2633
2568
|
id: "variables",
|
|
@@ -2653,77 +2588,6 @@ var variablesDefinition = {
|
|
|
2653
2588
|
testable: false
|
|
2654
2589
|
};
|
|
2655
2590
|
|
|
2656
|
-
// src/catalog/api/graphql-query/index.ts
|
|
2657
|
-
var graphqlQueryDefinition = {
|
|
2658
|
-
id: "graphql_query",
|
|
2659
|
-
name: "GraphQL Query",
|
|
2660
|
-
description: "Execute GraphQL queries against GraphQL endpoints",
|
|
2661
|
-
category: "api" /* API */,
|
|
2662
|
-
type: "graphql_query" /* GraphQLQuery */,
|
|
2663
|
-
tags: ["api", "graphql", "query", "built-in"],
|
|
2664
|
-
status: "stable" /* Stable */,
|
|
2665
|
-
icon: "GraphQL",
|
|
2666
|
-
color: "#0043ce",
|
|
2667
|
-
inputSchema: {
|
|
2668
|
-
fields: [
|
|
2669
|
-
{
|
|
2670
|
-
key: "endpoint",
|
|
2671
|
-
label: "GraphQL Endpoint",
|
|
2672
|
-
type: "url" /* URL */,
|
|
2673
|
-
description: "GraphQL endpoint URL",
|
|
2674
|
-
validation: { required: true }
|
|
2675
|
-
},
|
|
2676
|
-
{
|
|
2677
|
-
key: "query",
|
|
2678
|
-
label: "Query",
|
|
2679
|
-
type: "code" /* Code */,
|
|
2680
|
-
description: "GraphQL query",
|
|
2681
|
-
language: "json",
|
|
2682
|
-
validation: { required: true }
|
|
2683
|
-
},
|
|
2684
|
-
{
|
|
2685
|
-
key: "variables",
|
|
2686
|
-
label: "Variables",
|
|
2687
|
-
type: "json" /* JSON */,
|
|
2688
|
-
description: "Query variables",
|
|
2689
|
-
validation: { required: false }
|
|
2690
|
-
},
|
|
2691
|
-
{
|
|
2692
|
-
key: "headers",
|
|
2693
|
-
label: "Headers",
|
|
2694
|
-
type: "json" /* JSON */,
|
|
2695
|
-
description: "HTTP headers",
|
|
2696
|
-
validation: { required: false }
|
|
2697
|
-
}
|
|
2698
|
-
]
|
|
2699
|
-
},
|
|
2700
|
-
outputSchema: {
|
|
2701
|
-
type: "object",
|
|
2702
|
-
properties: [
|
|
2703
|
-
{
|
|
2704
|
-
key: "data",
|
|
2705
|
-
type: "json" /* JSON */,
|
|
2706
|
-
description: "Query result data"
|
|
2707
|
-
},
|
|
2708
|
-
{
|
|
2709
|
-
key: "errors",
|
|
2710
|
-
type: "array" /* Array */,
|
|
2711
|
-
description: "GraphQL errors"
|
|
2712
|
-
}
|
|
2713
|
-
],
|
|
2714
|
-
sampleOutput: {
|
|
2715
|
-
data: { user: { id: "1", name: "John" } },
|
|
2716
|
-
errors: []
|
|
2717
|
-
}
|
|
2718
|
-
},
|
|
2719
|
-
version: "1.0.0",
|
|
2720
|
-
createdAt: "2025-01-01T00:00:00Z",
|
|
2721
|
-
updatedAt: "2025-12-15T00:00:00Z",
|
|
2722
|
-
createdBy: "system",
|
|
2723
|
-
isOfficial: true,
|
|
2724
|
-
testable: true
|
|
2725
|
-
};
|
|
2726
|
-
|
|
2727
2591
|
// src/catalog/ai/ai-agent/index.ts
|
|
2728
2592
|
var aiAgentDefinition = {
|
|
2729
2593
|
id: "ai_agent",
|
|
@@ -2881,8 +2745,6 @@ var actionsRegistry = {
|
|
|
2881
2745
|
for_each: forEachDefinition,
|
|
2882
2746
|
group: groupDefinition
|
|
2883
2747
|
},
|
|
2884
|
-
["transform" /* Transform */]: {},
|
|
2885
|
-
["database" /* Database */]: {},
|
|
2886
2748
|
["storage" /* Storage */]: {
|
|
2887
2749
|
csv_action: csvActionDefinition,
|
|
2888
2750
|
json_action: jsonActionDefinition,
|
|
@@ -2907,8 +2769,6 @@ var actionsRegistry = {
|
|
|
2907
2769
|
variables: variablesDefinition,
|
|
2908
2770
|
debug: debugDefinition
|
|
2909
2771
|
},
|
|
2910
|
-
["ecommerce" /* Ecommerce */]: {},
|
|
2911
|
-
["api" /* API */]: {},
|
|
2912
2772
|
["ai" /* AI */]: {
|
|
2913
2773
|
ai_agent: aiAgentDefinition,
|
|
2914
2774
|
idp_extract: idpExtractDefinition
|
|
@@ -3864,7 +3724,7 @@ var TRANSFORM_OPERATIONS = [
|
|
|
3864
3724
|
{ id: "delete", label: "Delete" }
|
|
3865
3725
|
];
|
|
3866
3726
|
var TRANSFORM_OPERATION_IDS = TRANSFORM_OPERATIONS.map((o) => o.id);
|
|
3867
|
-
var DATABASE_CONNECTOR_IDS = new Set(["mongodb", "postgresql", "mysql", "
|
|
3727
|
+
var DATABASE_CONNECTOR_IDS = new Set(["mongodb", "postgresql", "mysql", "google_sheets"]);
|
|
3868
3728
|
var TransformConfig = {
|
|
3869
3729
|
defaults: {
|
|
3870
3730
|
name: "Transform",
|
|
@@ -3897,7 +3757,7 @@ var TransformConfig = {
|
|
|
3897
3757
|
database: {
|
|
3898
3758
|
type: "text",
|
|
3899
3759
|
required: false,
|
|
3900
|
-
description: "Database name for MongoDB / PostgreSQL / MySQL
|
|
3760
|
+
description: "Database name for MongoDB / PostgreSQL / MySQL; the spreadsheet id for Google Sheets"
|
|
3901
3761
|
},
|
|
3902
3762
|
objectName: {
|
|
3903
3763
|
type: "select",
|
|
@@ -3911,7 +3771,16 @@ var TransformConfig = {
|
|
|
3911
3771
|
options: TRANSFORM_MODES,
|
|
3912
3772
|
description: "How the mappings are authored: visual (the Field Mapper — the only mode the editor offers) or expression (legacy JavaScript). This is not the write mode; that is `operation`."
|
|
3913
3773
|
},
|
|
3914
|
-
mappings: {
|
|
3774
|
+
mappings: {
|
|
3775
|
+
type: "array",
|
|
3776
|
+
required: false,
|
|
3777
|
+
description: "Field mappings: [{ id, sourceField, targetField, targetType, transform? }]. sourceField is a token like {{orders[].email}}; " + "an index picks one list element ({{products[].variants[0].price}}). With groupBy, set lineField: true on the mappings that make each line."
|
|
3778
|
+
},
|
|
3779
|
+
groupBy: {
|
|
3780
|
+
type: "json",
|
|
3781
|
+
required: false,
|
|
3782
|
+
description: 'One record per key, with line items: { "key": "{{orders[].number}}", "into": "line_items" }. Rows whose key is the same become ONE record ' + "(its fields from the first row); mappings with lineField: true become a list of lines under `into` (Shopify line_items, QuickBooks Line, Odoo order_line). " + "Dotted line fields nest inside each line (SalesItemLineDetail.ItemRef.value)."
|
|
3783
|
+
},
|
|
3915
3784
|
expression: { type: "code", required: false }
|
|
3916
3785
|
},
|
|
3917
3786
|
generateName: (operation, connectorLabel, objectName) => {
|
|
@@ -3952,6 +3821,16 @@ var TransformConfig = {
|
|
|
3952
3821
|
});
|
|
3953
3822
|
}
|
|
3954
3823
|
}
|
|
3824
|
+
const groupBy = config.groupBy;
|
|
3825
|
+
if (groupBy && (groupBy.key || groupBy.into)) {
|
|
3826
|
+
if (!groupBy.key)
|
|
3827
|
+
errors.push("One record per key: choose the key field (groupBy.key)");
|
|
3828
|
+
if (!groupBy.into)
|
|
3829
|
+
errors.push("One record per key: name the field that holds the lines (groupBy.into)");
|
|
3830
|
+
if (groupBy.key && groupBy.into && !(config.mappings ?? []).some((m) => m.lineField)) {
|
|
3831
|
+
errors.push("One record per key: mark at least one mapping as a line field (lineField: true)");
|
|
3832
|
+
}
|
|
3833
|
+
}
|
|
3955
3834
|
return { valid: errors.length === 0, errors };
|
|
3956
3835
|
},
|
|
3957
3836
|
merge: (userConfig) => {
|
|
@@ -4542,7 +4421,8 @@ var EVENT_CAPABLE_CONNECTOR_IDS = new Set([
|
|
|
4542
4421
|
"hubspot",
|
|
4543
4422
|
"salesforce",
|
|
4544
4423
|
"google_sheets",
|
|
4545
|
-
"whatsapp"
|
|
4424
|
+
"whatsapp",
|
|
4425
|
+
"dropbox"
|
|
4546
4426
|
]);
|
|
4547
4427
|
var QBO_ENTITIES = [
|
|
4548
4428
|
{ entity: "Invoice", supportedOperations: ["Create", "Update", "Delete", "Void", "Emailed"] },
|
|
@@ -4595,13 +4475,17 @@ var GOOGLE_SHEETS_ENTITIES = [
|
|
|
4595
4475
|
var WHATSAPP_ENTITIES = [
|
|
4596
4476
|
{ entity: "Message", supportedOperations: ["Received"] }
|
|
4597
4477
|
];
|
|
4478
|
+
var DROPBOX_ENTITIES = [
|
|
4479
|
+
{ entity: "File", supportedOperations: ["Create", "Update", "Delete"] }
|
|
4480
|
+
];
|
|
4598
4481
|
var CONNECTOR_EVENT_ENTITIES = {
|
|
4599
4482
|
quickbooks_online: QBO_ENTITIES,
|
|
4600
4483
|
salesforce: SALESFORCE_ENTITIES,
|
|
4601
4484
|
hubspot: HUBSPOT_ENTITIES,
|
|
4602
4485
|
shopify: SHOPIFY_ENTITIES,
|
|
4603
4486
|
google_sheets: GOOGLE_SHEETS_ENTITIES,
|
|
4604
|
-
whatsapp: WHATSAPP_ENTITIES
|
|
4487
|
+
whatsapp: WHATSAPP_ENTITIES,
|
|
4488
|
+
dropbox: DROPBOX_ENTITIES
|
|
4605
4489
|
};
|
|
4606
4490
|
function getEntitiesForConnector(connectorId) {
|
|
4607
4491
|
return CONNECTOR_EVENT_ENTITIES[connectorId] ?? [];
|
|
@@ -4671,6 +4555,7 @@ var ConnectorTriggerConfig = {
|
|
|
4671
4555
|
sheetFileLabel: { type: "string", required: false, description: "Google Sheets: spreadsheet name" },
|
|
4672
4556
|
sheetName: { type: "string", required: false, description: "Google Sheets: tab name" },
|
|
4673
4557
|
sheetKeyColumn: { type: "string", required: false, description: "Google Sheets: row key column" },
|
|
4558
|
+
folderPath: { type: "string", required: false, description: "Dropbox: folder watched, recursively, e.g. /Invoices (empty = the whole Dropbox)" },
|
|
4674
4559
|
description: { type: "string", required: false, description: "Added to the trigger output when set" }
|
|
4675
4560
|
},
|
|
4676
4561
|
validate: (config) => {
|
|
@@ -4832,50 +4717,6 @@ var ExcelActionConfig = {
|
|
|
4832
4717
|
merge: (userConfig) => ({ ...ExcelActionConfig.defaults, ...userConfig }),
|
|
4833
4718
|
getLabel: (config) => `Excel: ${config.operation || "parse"}`
|
|
4834
4719
|
};
|
|
4835
|
-
// src/catalog/storage/file-action/config.ts
|
|
4836
|
-
var FILE_ACTION_MODES = ["parse", "generate", "convert", "edit"];
|
|
4837
|
-
var FILE_ACTION_SOURCES = ["inline", "s3", "url", "previous_step", "upload"];
|
|
4838
|
-
var FILE_ACTION_FORMATS = ["auto", "csv", "tsv", "json", "jsonl", "xml", "excel"];
|
|
4839
|
-
var FILE_ACTION_OUTPUT_FORMATS = ["csv", "json", "excel", "xml", "tsv"];
|
|
4840
|
-
var FileActionConfig = {
|
|
4841
|
-
defaults: {
|
|
4842
|
-
mode: "parse",
|
|
4843
|
-
source: "inline",
|
|
4844
|
-
format: "auto"
|
|
4845
|
-
},
|
|
4846
|
-
schema: {
|
|
4847
|
-
...FILE_EDIT_SCHEMA,
|
|
4848
|
-
mode: { type: "select", required: true, options: FILE_ACTION_MODES, description: "parse, generate, convert or edit" },
|
|
4849
|
-
operation: { type: "select", required: false, options: FILE_ACTION_MODES, description: "Alias of mode; read first when both are set" },
|
|
4850
|
-
source: { type: "select", required: false, options: FILE_ACTION_SOURCES, description: "Where the file comes from (inline by default)" },
|
|
4851
|
-
format: { type: "select", required: false, options: FILE_ACTION_FORMATS, description: "File format; auto-detected from the name, then the content" },
|
|
4852
|
-
inlineContent: { type: "text", required: false, description: 'source "inline": the text (base64 for Excel)' },
|
|
4853
|
-
content: { type: "text", required: false, description: "Alias of inlineContent" },
|
|
4854
|
-
outputFormat: { type: "select", required: false, options: FILE_ACTION_OUTPUT_FORMATS, description: "generate / convert: format to write" },
|
|
4855
|
-
outputFileName: { type: "string", required: false, description: "generate / convert: name of the produced file" },
|
|
4856
|
-
fileName: { type: "string", required: false, description: "Name used to detect the format" },
|
|
4857
|
-
encoding: { type: "string", required: false },
|
|
4858
|
-
delimiter: { type: "string", required: false, description: "CSV / TSV delimiter" },
|
|
4859
|
-
headerRow: { type: "number", required: false, min: 1 },
|
|
4860
|
-
rowElement: { type: "string", required: false, description: "XML element that holds one record" },
|
|
4861
|
-
sheetName: { type: "string", required: false, description: "Excel sheet to read" },
|
|
4862
|
-
includeHeader: { type: "boolean", required: false },
|
|
4863
|
-
options: { type: "json", required: false, description: "Parser options read ahead of the top-level keys" }
|
|
4864
|
-
},
|
|
4865
|
-
validate: (config) => {
|
|
4866
|
-
const errors = [];
|
|
4867
|
-
const mode = config.operation || config.mode;
|
|
4868
|
-
if (mode !== undefined && mode !== "" && !FILE_ACTION_MODES.includes(mode)) {
|
|
4869
|
-
errors.push(`Unknown mode "${mode}" — use parse, generate, convert or edit`);
|
|
4870
|
-
}
|
|
4871
|
-
if (config.source === "upload")
|
|
4872
|
-
errors.push('source "upload" is not supported at run time');
|
|
4873
|
-
errors.push(...fileEditErrors({ ...config, operation: mode, source: undefined }));
|
|
4874
|
-
return { valid: errors.length === 0, errors };
|
|
4875
|
-
},
|
|
4876
|
-
merge: (userConfig) => ({ ...FileActionConfig.defaults, ...userConfig }),
|
|
4877
|
-
getLabel: (config) => `File: ${config.operation || config.mode || "parse"}`
|
|
4878
|
-
};
|
|
4879
4720
|
// src/catalog/storage/storage-action/config.ts
|
|
4880
4721
|
var FIXED_SCHEMA = {
|
|
4881
4722
|
connector: { type: "connection", required: true, description: "Storage connector instance; its provider decides the operations" },
|
|
@@ -5666,36 +5507,6 @@ var HTTPRequestConfig = {
|
|
|
5666
5507
|
}
|
|
5667
5508
|
};
|
|
5668
5509
|
|
|
5669
|
-
// src/catalog/api/graphql-query/config.ts
|
|
5670
|
-
var GraphQLQueryConfig = {
|
|
5671
|
-
defaults: {
|
|
5672
|
-
endpoint: "",
|
|
5673
|
-
query: "",
|
|
5674
|
-
variables: {},
|
|
5675
|
-
headers: {}
|
|
5676
|
-
},
|
|
5677
|
-
schema: {
|
|
5678
|
-
endpoint: { type: "url", required: true },
|
|
5679
|
-
query: { type: "code", required: true },
|
|
5680
|
-
variables: { type: "json", required: false },
|
|
5681
|
-
headers: { type: "json", required: false }
|
|
5682
|
-
},
|
|
5683
|
-
validate: (config) => {
|
|
5684
|
-
const errors = [];
|
|
5685
|
-
if (!config.endpoint)
|
|
5686
|
-
errors.push("Endpoint is required");
|
|
5687
|
-
if (!config.query)
|
|
5688
|
-
errors.push("Query is required");
|
|
5689
|
-
return { valid: errors.length === 0, errors };
|
|
5690
|
-
},
|
|
5691
|
-
merge: (userConfig) => {
|
|
5692
|
-
return { ...GraphQLQueryConfig.defaults, ...userConfig };
|
|
5693
|
-
},
|
|
5694
|
-
getLabel: (config) => {
|
|
5695
|
-
return `GraphQL: ${config.endpoint}`;
|
|
5696
|
-
}
|
|
5697
|
-
};
|
|
5698
|
-
|
|
5699
5510
|
// src/catalog/communication/google-chat/config.ts
|
|
5700
5511
|
var GoogleChatConfig = {
|
|
5701
5512
|
defaults: { connection: "", space: "", spaceName: "", text: "", threadKey: "" },
|
|
@@ -5851,68 +5662,6 @@ var WhatsappSendConfig = {
|
|
|
5851
5662
|
getLabel: (config) => config.mode === "text" ? `WhatsApp to ${config.to || "—"}` : `WhatsApp template "${config.templateName || "—"}" to ${config.to || "—"}`
|
|
5852
5663
|
};
|
|
5853
5664
|
|
|
5854
|
-
// src/catalog/storage/file-operation/config.ts
|
|
5855
|
-
var FileOperationConfig = {
|
|
5856
|
-
defaults: {
|
|
5857
|
-
connection: "",
|
|
5858
|
-
operation: "upload",
|
|
5859
|
-
sourcePath: "",
|
|
5860
|
-
destinationPath: "",
|
|
5861
|
-
fileContent: "",
|
|
5862
|
-
options: {}
|
|
5863
|
-
},
|
|
5864
|
-
schema: {
|
|
5865
|
-
connection: { type: "connection", required: true },
|
|
5866
|
-
operation: { type: "select", required: true, options: ["upload", "download", "delete", "list", "copy", "move", "exists"] },
|
|
5867
|
-
sourcePath: { type: "string", required: false },
|
|
5868
|
-
destinationPath: { type: "string", required: true },
|
|
5869
|
-
fileContent: { type: "string", required: false },
|
|
5870
|
-
options: { type: "json", required: false }
|
|
5871
|
-
},
|
|
5872
|
-
validate: (config) => {
|
|
5873
|
-
const errors = [];
|
|
5874
|
-
if (!config.connection)
|
|
5875
|
-
errors.push("Storage connection is required");
|
|
5876
|
-
if (!config.operation)
|
|
5877
|
-
errors.push("Operation is required");
|
|
5878
|
-
if (!config.destinationPath)
|
|
5879
|
-
errors.push("Destination path is required");
|
|
5880
|
-
if (config.operation === "upload" || config.operation === "copy" || config.operation === "move") {
|
|
5881
|
-
if (!config.sourcePath) {
|
|
5882
|
-
errors.push("Source path is required for upload/copy/move operations");
|
|
5883
|
-
}
|
|
5884
|
-
}
|
|
5885
|
-
return { valid: errors.length === 0, errors };
|
|
5886
|
-
},
|
|
5887
|
-
merge: (userConfig) => {
|
|
5888
|
-
return { ...FileOperationConfig.defaults, ...userConfig };
|
|
5889
|
-
},
|
|
5890
|
-
getLabel: (config) => {
|
|
5891
|
-
return `${config.operation.toUpperCase()}: ${config.destinationPath}`;
|
|
5892
|
-
}
|
|
5893
|
-
};
|
|
5894
|
-
|
|
5895
|
-
// src/catalog/transforms/format/config.ts
|
|
5896
|
-
var FormatConfig = {
|
|
5897
|
-
defaults: { input: "", format: "json" },
|
|
5898
|
-
schema: {
|
|
5899
|
-
input: { type: "expression", required: true },
|
|
5900
|
-
format: { type: "select", required: true, options: ["json", "csv", "xml", "yaml"] }
|
|
5901
|
-
},
|
|
5902
|
-
validate: (config) => {
|
|
5903
|
-
const errors = [];
|
|
5904
|
-
if (!config.input)
|
|
5905
|
-
errors.push("Input required");
|
|
5906
|
-
if (!config.format)
|
|
5907
|
-
errors.push("Format required");
|
|
5908
|
-
return { valid: errors.length === 0, errors };
|
|
5909
|
-
},
|
|
5910
|
-
merge: (userConfig) => {
|
|
5911
|
-
return { ...FormatConfig.defaults, ...userConfig };
|
|
5912
|
-
},
|
|
5913
|
-
getLabel: (config) => `Format as ${config.format.toUpperCase()}`
|
|
5914
|
-
};
|
|
5915
|
-
|
|
5916
5665
|
// src/catalog/triggers/schedule-trigger/config.ts
|
|
5917
5666
|
var ScheduleTriggerConfig = {
|
|
5918
5667
|
defaults: {
|
|
@@ -5980,37 +5729,12 @@ var WebhookTriggerConfig = {
|
|
|
5980
5729
|
}
|
|
5981
5730
|
};
|
|
5982
5731
|
|
|
5983
|
-
// src/catalog/utility/error/config.ts
|
|
5984
|
-
var ErrorConfig = {
|
|
5985
|
-
defaults: {
|
|
5986
|
-
message: "",
|
|
5987
|
-
code: undefined
|
|
5988
|
-
},
|
|
5989
|
-
schema: {
|
|
5990
|
-
message: { type: "string", required: true },
|
|
5991
|
-
code: { type: "string", required: false }
|
|
5992
|
-
},
|
|
5993
|
-
validate: (config) => {
|
|
5994
|
-
const errors = [];
|
|
5995
|
-
if (!config.message)
|
|
5996
|
-
errors.push("Error message is required");
|
|
5997
|
-
return { valid: errors.length === 0, errors };
|
|
5998
|
-
},
|
|
5999
|
-
merge: (userConfig) => {
|
|
6000
|
-
return { ...ErrorConfig.defaults, ...userConfig };
|
|
6001
|
-
},
|
|
6002
|
-
getLabel: (config) => {
|
|
6003
|
-
return `Error: ${config.message}`;
|
|
6004
|
-
}
|
|
6005
|
-
};
|
|
6006
|
-
|
|
6007
5732
|
// src/rules/configContracts.ts
|
|
6008
5733
|
var asValidator = (fn) => (config) => fn(config);
|
|
6009
5734
|
var CONFIG_CONTRACTS = {
|
|
6010
5735
|
console_log: { schema: ConsoleLogConfig.schema, validate: asValidator(ConsoleLogConfig.validate) },
|
|
6011
5736
|
delay: { schema: DelayConfig.schema, validate: asValidator(DelayConfig.validate) },
|
|
6012
5737
|
http_request: { schema: HTTPRequestConfig.schema, validate: asValidator(HTTPRequestConfig.validate) },
|
|
6013
|
-
graphql_query: { schema: GraphQLQueryConfig.schema, validate: asValidator(GraphQLQueryConfig.validate) },
|
|
6014
5738
|
email: { schema: EmailConfig.schema, validate: asValidator(EmailConfig.validate) },
|
|
6015
5739
|
google_chat: { schema: GoogleChatConfig.schema, validate: asValidator(GoogleChatConfig.validate) },
|
|
6016
5740
|
slack_message: { schema: SlackMessageConfig.schema, validate: asValidator(SlackMessageConfig.validate) },
|
|
@@ -6029,13 +5753,10 @@ var CONFIG_CONTRACTS = {
|
|
|
6029
5753
|
aggregate: { schema: AggregateConfig.schema, validate: asValidator(AggregateConfig.validate) },
|
|
6030
5754
|
condition: { schema: ConditionConfig.schema, validate: asValidator(ConditionConfig.validate) },
|
|
6031
5755
|
for_each: { schema: ForEachConfig.schema, validate: asValidator(ForEachConfig.validate) },
|
|
6032
|
-
file_operation: { schema: FileOperationConfig.schema, validate: asValidator(FileOperationConfig.validate) },
|
|
6033
|
-
format: { schema: FormatConfig.schema, validate: asValidator(FormatConfig.validate) },
|
|
6034
5756
|
manual_trigger: { schema: ManualTriggerConfig.schema, validate: asValidator(ManualTriggerConfig.validate) },
|
|
6035
5757
|
schedule_trigger: { schema: ScheduleTriggerConfig.schema, validate: asValidator(ScheduleTriggerConfig.validate) },
|
|
6036
5758
|
webhook_trigger: { schema: WebhookTriggerConfig.schema, validate: asValidator(WebhookTriggerConfig.validate) },
|
|
6037
5759
|
debug: { schema: DebugConfig.schema, validate: asValidator(DebugConfig.validate) },
|
|
6038
|
-
error: { schema: ErrorConfig.schema, validate: asValidator(ErrorConfig.validate) },
|
|
6039
5760
|
variables: { schema: VariablesConfig.schema, validate: asValidator(VariablesConfig.validate) },
|
|
6040
5761
|
ai_agent: { schema: AiAgentConfig.schema, validate: asValidator(AiAgentConfig.validate) },
|
|
6041
5762
|
idp_extract: { schema: IdpExtractConfig.schema, validate: asValidator(IdpExtractConfig.validate) },
|
|
@@ -6045,7 +5766,6 @@ var CONFIG_CONTRACTS = {
|
|
|
6045
5766
|
json_action: { schema: JsonActionConfig.schema, validate: asValidator(JsonActionConfig.validate) },
|
|
6046
5767
|
xml_action: { schema: XmlActionConfig.schema, validate: asValidator(XmlActionConfig.validate) },
|
|
6047
5768
|
excel_action: { schema: ExcelActionConfig.schema, validate: asValidator(ExcelActionConfig.validate) },
|
|
6048
|
-
file_action: { schema: FileActionConfig.schema, validate: asValidator(FileActionConfig.validate) },
|
|
6049
5769
|
storage_action: { schema: StorageActionConfig.schema, validate: asValidator(StorageActionConfig.validate) },
|
|
6050
5770
|
s3_action: { schema: S3ActionConfig.schema, validate: asValidator(S3ActionConfig.validate) },
|
|
6051
5771
|
ftp_action: { schema: FtpActionConfig.schema, validate: asValidator(FtpActionConfig.validate) },
|