@octaviaflow/flow-rules 0.13.1 → 0.14.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/actions/http-request/config.d.ts +2 -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 +18 -310
- package/dist/index.d.ts +0 -1
- package/dist/index.js +18 -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
package/dist/index.js
CHANGED
|
@@ -24,30 +24,16 @@ var ActionType;
|
|
|
24
24
|
ActionType["Schedule"] = "schedule";
|
|
25
25
|
ActionType["Webhook"] = "webhook";
|
|
26
26
|
ActionType["Manual"] = "manual";
|
|
27
|
-
ActionType["DataChange"] = "data_change";
|
|
28
27
|
ActionType["Event"] = "event";
|
|
29
|
-
ActionType["Read"] = "read";
|
|
30
28
|
ActionType["Write"] = "write";
|
|
31
|
-
ActionType["Update"] = "update";
|
|
32
|
-
ActionType["Delete"] = "delete";
|
|
33
29
|
ActionType["Query"] = "query";
|
|
34
30
|
ActionType["HTTPRequest"] = "http_request";
|
|
35
|
-
ActionType["GraphQLQuery"] = "graphql_query";
|
|
36
31
|
ActionType["Condition"] = "condition";
|
|
37
32
|
ActionType["ForEach"] = "for_each";
|
|
38
33
|
ActionType["Group"] = "group";
|
|
39
|
-
ActionType["Format"] = "format";
|
|
40
34
|
ActionType["AIAgent"] = "ai_agent";
|
|
41
|
-
ActionType["Embedding"] = "embedding";
|
|
42
|
-
ActionType["VectorSearch"] = "vector_search";
|
|
43
|
-
ActionType["ImageGeneration"] = "image_generation";
|
|
44
|
-
ActionType["ImageAnalysis"] = "image_analysis";
|
|
45
|
-
ActionType["SpeechToText"] = "speech_to_text";
|
|
46
|
-
ActionType["TextToSpeech"] = "text_to_speech";
|
|
47
35
|
ActionType["Transform"] = "transform";
|
|
48
36
|
ActionType["Aggregate"] = "aggregate";
|
|
49
|
-
ActionType["FileOperation"] = "file_operation";
|
|
50
|
-
ActionType["FileAction"] = "file_action";
|
|
51
37
|
ActionType["CsvAction"] = "csv_action";
|
|
52
38
|
ActionType["JsonAction"] = "json_action";
|
|
53
39
|
ActionType["XmlAction"] = "xml_action";
|
|
@@ -65,12 +51,8 @@ var ActionType;
|
|
|
65
51
|
ActionType["GoogleChat"] = "google_chat";
|
|
66
52
|
ActionType["WebhookCall"] = "webhook_call";
|
|
67
53
|
ActionType["Delay"] = "delay";
|
|
68
|
-
ActionType["Wait"] = "wait";
|
|
69
54
|
ActionType["Console"] = "console";
|
|
70
55
|
ActionType["Debug"] = "debug";
|
|
71
|
-
ActionType["Error"] = "error";
|
|
72
|
-
ActionType["CustomCode"] = "custom_code";
|
|
73
|
-
ActionType["CustomAction"] = "custom_action";
|
|
74
56
|
ActionType["IdpExtract"] = "idp_extract";
|
|
75
57
|
})(ActionType ||= {});
|
|
76
58
|
var ActionStatus;
|
|
@@ -2423,48 +2405,6 @@ var debugDefinition = {
|
|
|
2423
2405
|
testable: false
|
|
2424
2406
|
};
|
|
2425
2407
|
|
|
2426
|
-
// src/catalog/utility/error/index.ts
|
|
2427
|
-
var errorDefinition = {
|
|
2428
|
-
id: "error",
|
|
2429
|
-
name: "Error",
|
|
2430
|
-
description: "Throw an error to stop workflow execution",
|
|
2431
|
-
category: "utility" /* Utility */,
|
|
2432
|
-
type: "error" /* Error */,
|
|
2433
|
-
tags: ["utility", "error", "control", "built-in"],
|
|
2434
|
-
status: "stable" /* Stable */,
|
|
2435
|
-
icon: "ErrorFilled",
|
|
2436
|
-
color: "#da3742",
|
|
2437
|
-
inputSchema: {
|
|
2438
|
-
fields: [
|
|
2439
|
-
{
|
|
2440
|
-
key: "message",
|
|
2441
|
-
label: "Error Message",
|
|
2442
|
-
type: "string" /* String */,
|
|
2443
|
-
description: "Error message to throw",
|
|
2444
|
-
validation: { required: true }
|
|
2445
|
-
},
|
|
2446
|
-
{
|
|
2447
|
-
key: "code",
|
|
2448
|
-
label: "Error Code",
|
|
2449
|
-
type: "string" /* String */,
|
|
2450
|
-
description: "Error code",
|
|
2451
|
-
validation: { required: false }
|
|
2452
|
-
}
|
|
2453
|
-
]
|
|
2454
|
-
},
|
|
2455
|
-
outputSchema: {
|
|
2456
|
-
type: "void",
|
|
2457
|
-
properties: [],
|
|
2458
|
-
sampleOutput: null
|
|
2459
|
-
},
|
|
2460
|
-
version: "1.0.0",
|
|
2461
|
-
createdAt: "2025-01-01T00:00:00Z",
|
|
2462
|
-
updatedAt: "2025-12-15T00:00:00Z",
|
|
2463
|
-
createdBy: "system",
|
|
2464
|
-
isOfficial: true,
|
|
2465
|
-
testable: true
|
|
2466
|
-
};
|
|
2467
|
-
|
|
2468
2408
|
// src/catalog/utility/variables/index.ts
|
|
2469
2409
|
var variablesDefinition = {
|
|
2470
2410
|
id: "variables",
|
|
@@ -2490,77 +2430,6 @@ var variablesDefinition = {
|
|
|
2490
2430
|
testable: false
|
|
2491
2431
|
};
|
|
2492
2432
|
|
|
2493
|
-
// src/catalog/api/graphql-query/index.ts
|
|
2494
|
-
var graphqlQueryDefinition = {
|
|
2495
|
-
id: "graphql_query",
|
|
2496
|
-
name: "GraphQL Query",
|
|
2497
|
-
description: "Execute GraphQL queries against GraphQL endpoints",
|
|
2498
|
-
category: "api" /* API */,
|
|
2499
|
-
type: "graphql_query" /* GraphQLQuery */,
|
|
2500
|
-
tags: ["api", "graphql", "query", "built-in"],
|
|
2501
|
-
status: "stable" /* Stable */,
|
|
2502
|
-
icon: "GraphQL",
|
|
2503
|
-
color: "#0043ce",
|
|
2504
|
-
inputSchema: {
|
|
2505
|
-
fields: [
|
|
2506
|
-
{
|
|
2507
|
-
key: "endpoint",
|
|
2508
|
-
label: "GraphQL Endpoint",
|
|
2509
|
-
type: "url" /* URL */,
|
|
2510
|
-
description: "GraphQL endpoint URL",
|
|
2511
|
-
validation: { required: true }
|
|
2512
|
-
},
|
|
2513
|
-
{
|
|
2514
|
-
key: "query",
|
|
2515
|
-
label: "Query",
|
|
2516
|
-
type: "code" /* Code */,
|
|
2517
|
-
description: "GraphQL query",
|
|
2518
|
-
language: "json",
|
|
2519
|
-
validation: { required: true }
|
|
2520
|
-
},
|
|
2521
|
-
{
|
|
2522
|
-
key: "variables",
|
|
2523
|
-
label: "Variables",
|
|
2524
|
-
type: "json" /* JSON */,
|
|
2525
|
-
description: "Query variables",
|
|
2526
|
-
validation: { required: false }
|
|
2527
|
-
},
|
|
2528
|
-
{
|
|
2529
|
-
key: "headers",
|
|
2530
|
-
label: "Headers",
|
|
2531
|
-
type: "json" /* JSON */,
|
|
2532
|
-
description: "HTTP headers",
|
|
2533
|
-
validation: { required: false }
|
|
2534
|
-
}
|
|
2535
|
-
]
|
|
2536
|
-
},
|
|
2537
|
-
outputSchema: {
|
|
2538
|
-
type: "object",
|
|
2539
|
-
properties: [
|
|
2540
|
-
{
|
|
2541
|
-
key: "data",
|
|
2542
|
-
type: "json" /* JSON */,
|
|
2543
|
-
description: "Query result data"
|
|
2544
|
-
},
|
|
2545
|
-
{
|
|
2546
|
-
key: "errors",
|
|
2547
|
-
type: "array" /* Array */,
|
|
2548
|
-
description: "GraphQL errors"
|
|
2549
|
-
}
|
|
2550
|
-
],
|
|
2551
|
-
sampleOutput: {
|
|
2552
|
-
data: { user: { id: "1", name: "John" } },
|
|
2553
|
-
errors: []
|
|
2554
|
-
}
|
|
2555
|
-
},
|
|
2556
|
-
version: "1.0.0",
|
|
2557
|
-
createdAt: "2025-01-01T00:00:00Z",
|
|
2558
|
-
updatedAt: "2025-12-15T00:00:00Z",
|
|
2559
|
-
createdBy: "system",
|
|
2560
|
-
isOfficial: true,
|
|
2561
|
-
testable: true
|
|
2562
|
-
};
|
|
2563
|
-
|
|
2564
2433
|
// src/catalog/ai/ai-agent/index.ts
|
|
2565
2434
|
var aiAgentDefinition = {
|
|
2566
2435
|
id: "ai_agent",
|
|
@@ -2718,8 +2587,6 @@ var actionsRegistry = {
|
|
|
2718
2587
|
for_each: forEachDefinition,
|
|
2719
2588
|
group: groupDefinition
|
|
2720
2589
|
},
|
|
2721
|
-
["transform" /* Transform */]: {},
|
|
2722
|
-
["database" /* Database */]: {},
|
|
2723
2590
|
["storage" /* Storage */]: {
|
|
2724
2591
|
csv_action: csvActionDefinition,
|
|
2725
2592
|
json_action: jsonActionDefinition,
|
|
@@ -2744,8 +2611,6 @@ var actionsRegistry = {
|
|
|
2744
2611
|
variables: variablesDefinition,
|
|
2745
2612
|
debug: debugDefinition
|
|
2746
2613
|
},
|
|
2747
|
-
["ecommerce" /* Ecommerce */]: {},
|
|
2748
|
-
["api" /* API */]: {},
|
|
2749
2614
|
["ai" /* AI */]: {
|
|
2750
2615
|
ai_agent: aiAgentDefinition,
|
|
2751
2616
|
idp_extract: idpExtractDefinition
|
|
@@ -3701,7 +3566,7 @@ var TRANSFORM_OPERATIONS = [
|
|
|
3701
3566
|
{ id: "delete", label: "Delete" }
|
|
3702
3567
|
];
|
|
3703
3568
|
var TRANSFORM_OPERATION_IDS = TRANSFORM_OPERATIONS.map((o) => o.id);
|
|
3704
|
-
var DATABASE_CONNECTOR_IDS = new Set(["mongodb", "postgresql", "mysql", "
|
|
3569
|
+
var DATABASE_CONNECTOR_IDS = new Set(["mongodb", "postgresql", "mysql", "google_sheets"]);
|
|
3705
3570
|
var TransformConfig = {
|
|
3706
3571
|
defaults: {
|
|
3707
3572
|
name: "Transform",
|
|
@@ -3734,7 +3599,7 @@ var TransformConfig = {
|
|
|
3734
3599
|
database: {
|
|
3735
3600
|
type: "text",
|
|
3736
3601
|
required: false,
|
|
3737
|
-
description: "Database name for MongoDB / PostgreSQL / MySQL
|
|
3602
|
+
description: "Database name for MongoDB / PostgreSQL / MySQL; the spreadsheet id for Google Sheets"
|
|
3738
3603
|
},
|
|
3739
3604
|
objectName: {
|
|
3740
3605
|
type: "select",
|
|
@@ -4379,7 +4244,8 @@ var EVENT_CAPABLE_CONNECTOR_IDS = new Set([
|
|
|
4379
4244
|
"hubspot",
|
|
4380
4245
|
"salesforce",
|
|
4381
4246
|
"google_sheets",
|
|
4382
|
-
"whatsapp"
|
|
4247
|
+
"whatsapp",
|
|
4248
|
+
"dropbox"
|
|
4383
4249
|
]);
|
|
4384
4250
|
var QBO_ENTITIES = [
|
|
4385
4251
|
{ entity: "Invoice", supportedOperations: ["Create", "Update", "Delete", "Void", "Emailed"] },
|
|
@@ -4432,13 +4298,17 @@ var GOOGLE_SHEETS_ENTITIES = [
|
|
|
4432
4298
|
var WHATSAPP_ENTITIES = [
|
|
4433
4299
|
{ entity: "Message", supportedOperations: ["Received"] }
|
|
4434
4300
|
];
|
|
4301
|
+
var DROPBOX_ENTITIES = [
|
|
4302
|
+
{ entity: "File", supportedOperations: ["Create", "Update", "Delete"] }
|
|
4303
|
+
];
|
|
4435
4304
|
var CONNECTOR_EVENT_ENTITIES = {
|
|
4436
4305
|
quickbooks_online: QBO_ENTITIES,
|
|
4437
4306
|
salesforce: SALESFORCE_ENTITIES,
|
|
4438
4307
|
hubspot: HUBSPOT_ENTITIES,
|
|
4439
4308
|
shopify: SHOPIFY_ENTITIES,
|
|
4440
4309
|
google_sheets: GOOGLE_SHEETS_ENTITIES,
|
|
4441
|
-
whatsapp: WHATSAPP_ENTITIES
|
|
4310
|
+
whatsapp: WHATSAPP_ENTITIES,
|
|
4311
|
+
dropbox: DROPBOX_ENTITIES
|
|
4442
4312
|
};
|
|
4443
4313
|
function getEntitiesForConnector(connectorId) {
|
|
4444
4314
|
return CONNECTOR_EVENT_ENTITIES[connectorId] ?? [];
|
|
@@ -4508,6 +4378,7 @@ var ConnectorTriggerConfig = {
|
|
|
4508
4378
|
sheetFileLabel: { type: "string", required: false, description: "Google Sheets: spreadsheet name" },
|
|
4509
4379
|
sheetName: { type: "string", required: false, description: "Google Sheets: tab name" },
|
|
4510
4380
|
sheetKeyColumn: { type: "string", required: false, description: "Google Sheets: row key column" },
|
|
4381
|
+
folderPath: { type: "string", required: false, description: "Dropbox: folder watched, recursively, e.g. /Invoices (empty = the whole Dropbox)" },
|
|
4511
4382
|
description: { type: "string", required: false, description: "Added to the trigger output when set" }
|
|
4512
4383
|
},
|
|
4513
4384
|
validate: (config) => {
|
|
@@ -4669,50 +4540,6 @@ var ExcelActionConfig = {
|
|
|
4669
4540
|
merge: (userConfig) => ({ ...ExcelActionConfig.defaults, ...userConfig }),
|
|
4670
4541
|
getLabel: (config) => `Excel: ${config.operation || "parse"}`
|
|
4671
4542
|
};
|
|
4672
|
-
// src/catalog/storage/file-action/config.ts
|
|
4673
|
-
var FILE_ACTION_MODES = ["parse", "generate", "convert", "edit"];
|
|
4674
|
-
var FILE_ACTION_SOURCES = ["inline", "s3", "url", "previous_step", "upload"];
|
|
4675
|
-
var FILE_ACTION_FORMATS = ["auto", "csv", "tsv", "json", "jsonl", "xml", "excel"];
|
|
4676
|
-
var FILE_ACTION_OUTPUT_FORMATS = ["csv", "json", "excel", "xml", "tsv"];
|
|
4677
|
-
var FileActionConfig = {
|
|
4678
|
-
defaults: {
|
|
4679
|
-
mode: "parse",
|
|
4680
|
-
source: "inline",
|
|
4681
|
-
format: "auto"
|
|
4682
|
-
},
|
|
4683
|
-
schema: {
|
|
4684
|
-
...FILE_EDIT_SCHEMA,
|
|
4685
|
-
mode: { type: "select", required: true, options: FILE_ACTION_MODES, description: "parse, generate, convert or edit" },
|
|
4686
|
-
operation: { type: "select", required: false, options: FILE_ACTION_MODES, description: "Alias of mode; read first when both are set" },
|
|
4687
|
-
source: { type: "select", required: false, options: FILE_ACTION_SOURCES, description: "Where the file comes from (inline by default)" },
|
|
4688
|
-
format: { type: "select", required: false, options: FILE_ACTION_FORMATS, description: "File format; auto-detected from the name, then the content" },
|
|
4689
|
-
inlineContent: { type: "text", required: false, description: 'source "inline": the text (base64 for Excel)' },
|
|
4690
|
-
content: { type: "text", required: false, description: "Alias of inlineContent" },
|
|
4691
|
-
outputFormat: { type: "select", required: false, options: FILE_ACTION_OUTPUT_FORMATS, description: "generate / convert: format to write" },
|
|
4692
|
-
outputFileName: { type: "string", required: false, description: "generate / convert: name of the produced file" },
|
|
4693
|
-
fileName: { type: "string", required: false, description: "Name used to detect the format" },
|
|
4694
|
-
encoding: { type: "string", required: false },
|
|
4695
|
-
delimiter: { type: "string", required: false, description: "CSV / TSV delimiter" },
|
|
4696
|
-
headerRow: { type: "number", required: false, min: 1 },
|
|
4697
|
-
rowElement: { type: "string", required: false, description: "XML element that holds one record" },
|
|
4698
|
-
sheetName: { type: "string", required: false, description: "Excel sheet to read" },
|
|
4699
|
-
includeHeader: { type: "boolean", required: false },
|
|
4700
|
-
options: { type: "json", required: false, description: "Parser options read ahead of the top-level keys" }
|
|
4701
|
-
},
|
|
4702
|
-
validate: (config) => {
|
|
4703
|
-
const errors = [];
|
|
4704
|
-
const mode = config.operation || config.mode;
|
|
4705
|
-
if (mode !== undefined && mode !== "" && !FILE_ACTION_MODES.includes(mode)) {
|
|
4706
|
-
errors.push(`Unknown mode "${mode}" — use parse, generate, convert or edit`);
|
|
4707
|
-
}
|
|
4708
|
-
if (config.source === "upload")
|
|
4709
|
-
errors.push('source "upload" is not supported at run time');
|
|
4710
|
-
errors.push(...fileEditErrors({ ...config, operation: mode, source: undefined }));
|
|
4711
|
-
return { valid: errors.length === 0, errors };
|
|
4712
|
-
},
|
|
4713
|
-
merge: (userConfig) => ({ ...FileActionConfig.defaults, ...userConfig }),
|
|
4714
|
-
getLabel: (config) => `File: ${config.operation || config.mode || "parse"}`
|
|
4715
|
-
};
|
|
4716
4543
|
// src/catalog/storage/storage-action/config.ts
|
|
4717
4544
|
var FIXED_SCHEMA = {
|
|
4718
4545
|
connector: { type: "connection", required: true, description: "Storage connector instance; its provider decides the operations" },
|
|
@@ -5390,6 +5217,13 @@ var DelayConfig = {
|
|
|
5390
5217
|
};
|
|
5391
5218
|
|
|
5392
5219
|
// src/catalog/actions/http-request/config.ts
|
|
5220
|
+
function urlCheckedAtRunTime(url, connectionId) {
|
|
5221
|
+
const u = url.trim();
|
|
5222
|
+
if (u.startsWith("{{"))
|
|
5223
|
+
return true;
|
|
5224
|
+
const hasScheme = /^[a-z][a-z0-9+.-]*:/i.test(u);
|
|
5225
|
+
return !!connectionId && !hasScheme;
|
|
5226
|
+
}
|
|
5393
5227
|
var HTTPRequestConfig = {
|
|
5394
5228
|
defaults: {
|
|
5395
5229
|
apiType: "rest",
|
|
@@ -5467,7 +5301,7 @@ var HTTPRequestConfig = {
|
|
|
5467
5301
|
}
|
|
5468
5302
|
if (!config.url) {
|
|
5469
5303
|
errors.push("URL is required");
|
|
5470
|
-
} else if (typeof config.url === "string") {
|
|
5304
|
+
} else if (typeof config.url === "string" && !urlCheckedAtRunTime(config.url, config.connectionId)) {
|
|
5471
5305
|
try {
|
|
5472
5306
|
new URL(config.url);
|
|
5473
5307
|
} catch {
|
|
@@ -5496,36 +5330,6 @@ var HTTPRequestConfig = {
|
|
|
5496
5330
|
}
|
|
5497
5331
|
};
|
|
5498
5332
|
|
|
5499
|
-
// src/catalog/api/graphql-query/config.ts
|
|
5500
|
-
var GraphQLQueryConfig = {
|
|
5501
|
-
defaults: {
|
|
5502
|
-
endpoint: "",
|
|
5503
|
-
query: "",
|
|
5504
|
-
variables: {},
|
|
5505
|
-
headers: {}
|
|
5506
|
-
},
|
|
5507
|
-
schema: {
|
|
5508
|
-
endpoint: { type: "url", required: true },
|
|
5509
|
-
query: { type: "code", required: true },
|
|
5510
|
-
variables: { type: "json", required: false },
|
|
5511
|
-
headers: { type: "json", required: false }
|
|
5512
|
-
},
|
|
5513
|
-
validate: (config) => {
|
|
5514
|
-
const errors = [];
|
|
5515
|
-
if (!config.endpoint)
|
|
5516
|
-
errors.push("Endpoint is required");
|
|
5517
|
-
if (!config.query)
|
|
5518
|
-
errors.push("Query is required");
|
|
5519
|
-
return { valid: errors.length === 0, errors };
|
|
5520
|
-
},
|
|
5521
|
-
merge: (userConfig) => {
|
|
5522
|
-
return { ...GraphQLQueryConfig.defaults, ...userConfig };
|
|
5523
|
-
},
|
|
5524
|
-
getLabel: (config) => {
|
|
5525
|
-
return `GraphQL: ${config.endpoint}`;
|
|
5526
|
-
}
|
|
5527
|
-
};
|
|
5528
|
-
|
|
5529
5333
|
// src/catalog/communication/google-chat/config.ts
|
|
5530
5334
|
var GoogleChatConfig = {
|
|
5531
5335
|
defaults: { connection: "", space: "", spaceName: "", text: "", threadKey: "" },
|
|
@@ -5681,68 +5485,6 @@ var WhatsappSendConfig = {
|
|
|
5681
5485
|
getLabel: (config) => config.mode === "text" ? `WhatsApp to ${config.to || "—"}` : `WhatsApp template "${config.templateName || "—"}" to ${config.to || "—"}`
|
|
5682
5486
|
};
|
|
5683
5487
|
|
|
5684
|
-
// src/catalog/storage/file-operation/config.ts
|
|
5685
|
-
var FileOperationConfig = {
|
|
5686
|
-
defaults: {
|
|
5687
|
-
connection: "",
|
|
5688
|
-
operation: "upload",
|
|
5689
|
-
sourcePath: "",
|
|
5690
|
-
destinationPath: "",
|
|
5691
|
-
fileContent: "",
|
|
5692
|
-
options: {}
|
|
5693
|
-
},
|
|
5694
|
-
schema: {
|
|
5695
|
-
connection: { type: "connection", required: true },
|
|
5696
|
-
operation: { type: "select", required: true, options: ["upload", "download", "delete", "list", "copy", "move", "exists"] },
|
|
5697
|
-
sourcePath: { type: "string", required: false },
|
|
5698
|
-
destinationPath: { type: "string", required: true },
|
|
5699
|
-
fileContent: { type: "string", required: false },
|
|
5700
|
-
options: { type: "json", required: false }
|
|
5701
|
-
},
|
|
5702
|
-
validate: (config) => {
|
|
5703
|
-
const errors = [];
|
|
5704
|
-
if (!config.connection)
|
|
5705
|
-
errors.push("Storage connection is required");
|
|
5706
|
-
if (!config.operation)
|
|
5707
|
-
errors.push("Operation is required");
|
|
5708
|
-
if (!config.destinationPath)
|
|
5709
|
-
errors.push("Destination path is required");
|
|
5710
|
-
if (config.operation === "upload" || config.operation === "copy" || config.operation === "move") {
|
|
5711
|
-
if (!config.sourcePath) {
|
|
5712
|
-
errors.push("Source path is required for upload/copy/move operations");
|
|
5713
|
-
}
|
|
5714
|
-
}
|
|
5715
|
-
return { valid: errors.length === 0, errors };
|
|
5716
|
-
},
|
|
5717
|
-
merge: (userConfig) => {
|
|
5718
|
-
return { ...FileOperationConfig.defaults, ...userConfig };
|
|
5719
|
-
},
|
|
5720
|
-
getLabel: (config) => {
|
|
5721
|
-
return `${config.operation.toUpperCase()}: ${config.destinationPath}`;
|
|
5722
|
-
}
|
|
5723
|
-
};
|
|
5724
|
-
|
|
5725
|
-
// src/catalog/transforms/format/config.ts
|
|
5726
|
-
var FormatConfig = {
|
|
5727
|
-
defaults: { input: "", format: "json" },
|
|
5728
|
-
schema: {
|
|
5729
|
-
input: { type: "expression", required: true },
|
|
5730
|
-
format: { type: "select", required: true, options: ["json", "csv", "xml", "yaml"] }
|
|
5731
|
-
},
|
|
5732
|
-
validate: (config) => {
|
|
5733
|
-
const errors = [];
|
|
5734
|
-
if (!config.input)
|
|
5735
|
-
errors.push("Input required");
|
|
5736
|
-
if (!config.format)
|
|
5737
|
-
errors.push("Format required");
|
|
5738
|
-
return { valid: errors.length === 0, errors };
|
|
5739
|
-
},
|
|
5740
|
-
merge: (userConfig) => {
|
|
5741
|
-
return { ...FormatConfig.defaults, ...userConfig };
|
|
5742
|
-
},
|
|
5743
|
-
getLabel: (config) => `Format as ${config.format.toUpperCase()}`
|
|
5744
|
-
};
|
|
5745
|
-
|
|
5746
5488
|
// src/catalog/triggers/schedule-trigger/config.ts
|
|
5747
5489
|
var ScheduleTriggerConfig = {
|
|
5748
5490
|
defaults: {
|
|
@@ -5810,37 +5552,12 @@ var WebhookTriggerConfig = {
|
|
|
5810
5552
|
}
|
|
5811
5553
|
};
|
|
5812
5554
|
|
|
5813
|
-
// src/catalog/utility/error/config.ts
|
|
5814
|
-
var ErrorConfig = {
|
|
5815
|
-
defaults: {
|
|
5816
|
-
message: "",
|
|
5817
|
-
code: undefined
|
|
5818
|
-
},
|
|
5819
|
-
schema: {
|
|
5820
|
-
message: { type: "string", required: true },
|
|
5821
|
-
code: { type: "string", required: false }
|
|
5822
|
-
},
|
|
5823
|
-
validate: (config) => {
|
|
5824
|
-
const errors = [];
|
|
5825
|
-
if (!config.message)
|
|
5826
|
-
errors.push("Error message is required");
|
|
5827
|
-
return { valid: errors.length === 0, errors };
|
|
5828
|
-
},
|
|
5829
|
-
merge: (userConfig) => {
|
|
5830
|
-
return { ...ErrorConfig.defaults, ...userConfig };
|
|
5831
|
-
},
|
|
5832
|
-
getLabel: (config) => {
|
|
5833
|
-
return `Error: ${config.message}`;
|
|
5834
|
-
}
|
|
5835
|
-
};
|
|
5836
|
-
|
|
5837
5555
|
// src/rules/configContracts.ts
|
|
5838
5556
|
var asValidator = (fn) => (config) => fn(config);
|
|
5839
5557
|
var CONFIG_CONTRACTS = {
|
|
5840
5558
|
console_log: { schema: ConsoleLogConfig.schema, validate: asValidator(ConsoleLogConfig.validate) },
|
|
5841
5559
|
delay: { schema: DelayConfig.schema, validate: asValidator(DelayConfig.validate) },
|
|
5842
5560
|
http_request: { schema: HTTPRequestConfig.schema, validate: asValidator(HTTPRequestConfig.validate) },
|
|
5843
|
-
graphql_query: { schema: GraphQLQueryConfig.schema, validate: asValidator(GraphQLQueryConfig.validate) },
|
|
5844
5561
|
email: { schema: EmailConfig.schema, validate: asValidator(EmailConfig.validate) },
|
|
5845
5562
|
google_chat: { schema: GoogleChatConfig.schema, validate: asValidator(GoogleChatConfig.validate) },
|
|
5846
5563
|
slack_message: { schema: SlackMessageConfig.schema, validate: asValidator(SlackMessageConfig.validate) },
|
|
@@ -5859,13 +5576,10 @@ var CONFIG_CONTRACTS = {
|
|
|
5859
5576
|
aggregate: { schema: AggregateConfig.schema, validate: asValidator(AggregateConfig.validate) },
|
|
5860
5577
|
condition: { schema: ConditionConfig.schema, validate: asValidator(ConditionConfig.validate) },
|
|
5861
5578
|
for_each: { schema: ForEachConfig.schema, validate: asValidator(ForEachConfig.validate) },
|
|
5862
|
-
file_operation: { schema: FileOperationConfig.schema, validate: asValidator(FileOperationConfig.validate) },
|
|
5863
|
-
format: { schema: FormatConfig.schema, validate: asValidator(FormatConfig.validate) },
|
|
5864
5579
|
manual_trigger: { schema: ManualTriggerConfig.schema, validate: asValidator(ManualTriggerConfig.validate) },
|
|
5865
5580
|
schedule_trigger: { schema: ScheduleTriggerConfig.schema, validate: asValidator(ScheduleTriggerConfig.validate) },
|
|
5866
5581
|
webhook_trigger: { schema: WebhookTriggerConfig.schema, validate: asValidator(WebhookTriggerConfig.validate) },
|
|
5867
5582
|
debug: { schema: DebugConfig.schema, validate: asValidator(DebugConfig.validate) },
|
|
5868
|
-
error: { schema: ErrorConfig.schema, validate: asValidator(ErrorConfig.validate) },
|
|
5869
5583
|
variables: { schema: VariablesConfig.schema, validate: asValidator(VariablesConfig.validate) },
|
|
5870
5584
|
ai_agent: { schema: AiAgentConfig.schema, validate: asValidator(AiAgentConfig.validate) },
|
|
5871
5585
|
idp_extract: { schema: IdpExtractConfig.schema, validate: asValidator(IdpExtractConfig.validate) },
|
|
@@ -5875,7 +5589,6 @@ var CONFIG_CONTRACTS = {
|
|
|
5875
5589
|
json_action: { schema: JsonActionConfig.schema, validate: asValidator(JsonActionConfig.validate) },
|
|
5876
5590
|
xml_action: { schema: XmlActionConfig.schema, validate: asValidator(XmlActionConfig.validate) },
|
|
5877
5591
|
excel_action: { schema: ExcelActionConfig.schema, validate: asValidator(ExcelActionConfig.validate) },
|
|
5878
|
-
file_action: { schema: FileActionConfig.schema, validate: asValidator(FileActionConfig.validate) },
|
|
5879
5592
|
storage_action: { schema: StorageActionConfig.schema, validate: asValidator(StorageActionConfig.validate) },
|
|
5880
5593
|
s3_action: { schema: S3ActionConfig.schema, validate: asValidator(S3ActionConfig.validate) },
|
|
5881
5594
|
ftp_action: { schema: FtpActionConfig.schema, validate: asValidator(FtpActionConfig.validate) },
|
|
@@ -6230,10 +5943,6 @@ export {
|
|
|
6230
5943
|
EdgeType,
|
|
6231
5944
|
EmailConfig,
|
|
6232
5945
|
ExcelActionConfig,
|
|
6233
|
-
FILE_ACTION_FORMATS,
|
|
6234
|
-
FILE_ACTION_MODES,
|
|
6235
|
-
FILE_ACTION_OUTPUT_FORMATS,
|
|
6236
|
-
FILE_ACTION_SOURCES,
|
|
6237
5946
|
FILE_EDIT_DESTINATIONS,
|
|
6238
5947
|
FILE_EDIT_MATCH_OPS,
|
|
6239
5948
|
FILE_EDIT_OPERATIONS,
|
|
@@ -6242,7 +5951,6 @@ export {
|
|
|
6242
5951
|
FILE_FORMAT_OPERATIONS,
|
|
6243
5952
|
FTP_OPERATIONS,
|
|
6244
5953
|
FieldType,
|
|
6245
|
-
FileActionConfig,
|
|
6246
5954
|
ForEachConfig,
|
|
6247
5955
|
FtpActionConfig,
|
|
6248
5956
|
GOOGLE_DRIVE_OPERATIONS,
|
|
@@ -73,7 +73,9 @@ export interface ConfigContract {
|
|
|
73
73
|
* Every action in the catalog, keyed by action id — since 0.11.0 all
|
|
74
74
|
* definitions carry one (the last fifteen: group, ai_agent, idp_extract,
|
|
75
75
|
* connector_trigger, the five file-format actions and the six storage
|
|
76
|
-
* actions; 0.13.0 added `aggregate
|
|
76
|
+
* actions; 0.13.0 added `aggregate`). 0.14.0 dropped the five that had a
|
|
77
|
+
* definition on disk but were never offered (graphql_query, format, error,
|
|
78
|
+
* file_operation, file_action) — 33 now, one per registered action. `contractFor` is undefined only for an id the catalog does not
|
|
77
79
|
* know, and then consumers fall back to `inputSchema` alone. A new action is
|
|
78
80
|
* a `config.ts` plus one line here; the drift test covers it from then on.
|
|
79
81
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octaviaflow/flow-rules",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "The flow action catalog and the rules engine behind Flow Doctor — one definition of what a step accepts and what makes a flow valid, shared by the editor and the server",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -1,36 +0,0 @@
|
|
|
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
|
-
};
|