@octaviaflow/flow-rules 0.9.0 → 0.11.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/ai/ai-agent/config.d.ts +68 -0
- package/dist/catalog/ai/idp-extract/config.d.ts +55 -0
- package/dist/catalog/logic/group/config.d.ts +21 -0
- package/dist/catalog/storage/csv-action/config.d.ts +136 -0
- package/dist/catalog/storage/dropbox-action/config.d.ts +85 -0
- package/dist/catalog/storage/excel-action/config.d.ts +127 -0
- package/dist/catalog/storage/file-action/config.d.ts +197 -0
- package/dist/catalog/storage/fileEditContract.d.ts +127 -0
- package/dist/catalog/storage/ftp-action/config.d.ts +85 -0
- package/dist/catalog/storage/google-drive-action/config.d.ts +135 -0
- package/dist/catalog/storage/json-action/config.d.ts +131 -0
- package/dist/catalog/storage/onedrive-action/config.d.ts +94 -0
- package/dist/catalog/storage/s3-action/config.d.ts +122 -0
- package/dist/catalog/storage/storage-action/config.d.ts +78 -0
- package/dist/catalog/storage/xml-action/config.d.ts +123 -0
- package/dist/catalog/triggers/connector-trigger/config.d.ts +110 -0
- package/dist/catalog/triggers/connector-trigger/events.d.ts +46 -0
- package/dist/index.cjs +730 -7
- package/dist/index.d.ts +17 -0
- package/dist/index.js +730 -7
- package/dist/rules/configContracts.d.ts +6 -7
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -441,7 +441,7 @@ var connectorTriggerDefinition = {
|
|
|
441
441
|
key: "events",
|
|
442
442
|
label: "Events",
|
|
443
443
|
type: "json" /* JSON */,
|
|
444
|
-
description:
|
|
444
|
+
description: 'Entity/operation pairs to subscribe to, as [{ "entity": "contact", "operations": ["Create", "Update"] }]. ' + "This is what registers the trigger — the platform derives the flow's connector subscription from it. " + "Entity and operation names are per connector (describe_action_type lists them); a name outside that list never fires.",
|
|
445
445
|
validation: { required: true }
|
|
446
446
|
}
|
|
447
447
|
]
|
|
@@ -1590,7 +1590,7 @@ var csvActionDefinition = {
|
|
|
1590
1590
|
color: "#198038",
|
|
1591
1591
|
inputSchema: {
|
|
1592
1592
|
fields: [
|
|
1593
|
-
{ key: "operation", label: "Operation", type: "select" /* Select */, options: [{ label: "Parse (CSV → Records)", value: "parse" }, { label: "Generate (Records → CSV)", value: "generate" }], defaultValue: "parse", validation: { required: true } },
|
|
1593
|
+
{ key: "operation", label: "Operation", type: "select" /* Select */, options: [{ label: "Parse (CSV → Records)", value: "parse" }, { label: "Generate (Records → CSV)", value: "generate" }, { label: "Edit existing file", value: "edit" }], defaultValue: "parse", validation: { required: true } },
|
|
1594
1594
|
{ key: "content", label: "CSV Content", type: "string" /* String */, description: "Paste CSV content or use FX token from upstream step" },
|
|
1595
1595
|
{ key: "delimiter", label: "Delimiter", type: "select" /* Select */, options: [{ label: "Comma (,)", value: "," }, { label: "Semicolon (;)", value: ";" }, { label: "Tab", value: "\t" }, { label: "Pipe (|)", value: "|" }], defaultValue: "," },
|
|
1596
1596
|
{ key: "headerRow", label: "Header Row", type: "number" /* Number */, description: "Row number containing column headers (default: 1)", defaultValue: 1 },
|
|
@@ -1629,7 +1629,7 @@ var jsonActionDefinition = {
|
|
|
1629
1629
|
color: "#f1c21b",
|
|
1630
1630
|
inputSchema: {
|
|
1631
1631
|
fields: [
|
|
1632
|
-
{ key: "operation", label: "Operation", type: "select" /* Select */, options: [{ label: "Parse (JSON → Records)", value: "parse" }, { label: "Generate (Records → JSON)", value: "generate" }], defaultValue: "parse", validation: { required: true } },
|
|
1632
|
+
{ key: "operation", label: "Operation", type: "select" /* Select */, options: [{ label: "Parse (JSON → Records)", value: "parse" }, { label: "Generate (Records → JSON)", value: "generate" }, { label: "Edit existing file", value: "edit" }], defaultValue: "parse", validation: { required: true } },
|
|
1633
1633
|
{ key: "format", label: "Format", type: "select" /* Select */, options: [{ label: "JSON (array)", value: "json" }, { label: "JSONL (one object per line)", value: "jsonl" }], defaultValue: "json" },
|
|
1634
1634
|
{ key: "content", label: "JSON Content", type: "string" /* String */, description: "Paste JSON content or use FX token from upstream step" },
|
|
1635
1635
|
{ key: "prettyPrint", label: "Pretty Print", type: "boolean" /* Boolean */, description: "Format output with indentation", defaultValue: true },
|
|
@@ -1666,7 +1666,7 @@ var xmlActionDefinition = {
|
|
|
1666
1666
|
color: "#e65100",
|
|
1667
1667
|
inputSchema: {
|
|
1668
1668
|
fields: [
|
|
1669
|
-
{ key: "operation", label: "Operation", type: "select" /* Select */, options: [{ label: "Parse (XML → Records)", value: "parse" }, { label: "Generate (Records → XML)", value: "generate" }], defaultValue: "parse", validation: { required: true } },
|
|
1669
|
+
{ key: "operation", label: "Operation", type: "select" /* Select */, options: [{ label: "Parse (XML → Records)", value: "parse" }, { label: "Generate (Records → XML)", value: "generate" }, { label: "Edit existing file", value: "edit" }], defaultValue: "parse", validation: { required: true } },
|
|
1670
1670
|
{ key: "content", label: "XML Content", type: "string" /* String */, description: "Paste XML or use FX token" },
|
|
1671
1671
|
{ key: "rootElement", label: "Root Element", type: "string" /* String */, description: "Root XML element name (for generate)", defaultValue: "data" },
|
|
1672
1672
|
{ key: "rowElement", label: "Row Element", type: "string" /* String */, description: "Element name per record (for generate)", defaultValue: "row" },
|
|
@@ -1703,7 +1703,7 @@ var excelActionDefinition = {
|
|
|
1703
1703
|
color: "#217346",
|
|
1704
1704
|
inputSchema: {
|
|
1705
1705
|
fields: [
|
|
1706
|
-
{ key: "operation", label: "Operation", type: "select" /* Select */, options: [{ label: "Parse (Excel → Records)", value: "parse" }, { label: "Generate (Records → Excel)", value: "generate" }], defaultValue: "parse", validation: { required: true } },
|
|
1706
|
+
{ key: "operation", label: "Operation", type: "select" /* Select */, options: [{ label: "Parse (Excel → Records)", value: "parse" }, { label: "Generate (Records → Excel)", value: "generate" }, { label: "Edit existing file", value: "edit" }], defaultValue: "parse", validation: { required: true } },
|
|
1707
1707
|
{ key: "content", label: "Excel File", type: "string" /* String */, description: "S3 key of uploaded Excel file or FX token from upstream" },
|
|
1708
1708
|
{ key: "sheetName", label: "Sheet Name", type: "string" /* String */, description: "Name of sheet to read (default: first sheet)" },
|
|
1709
1709
|
{ key: "headerRow", label: "Header Row", type: "number" /* Number */, description: "Row number containing headers", defaultValue: 1 },
|
|
@@ -1741,6 +1741,7 @@ var s3ActionDefinition = {
|
|
|
1741
1741
|
color: "#569A31",
|
|
1742
1742
|
inputSchema: {
|
|
1743
1743
|
fields: [
|
|
1744
|
+
{ key: "connector", label: "S3 Connection", type: "connection" /* Connection */, description: "Select a connected S3 account", validation: { required: true } },
|
|
1744
1745
|
{ key: "operation", label: "Operation", type: "select" /* Select */, options: [{ label: "List Files", value: "list" }, { label: "Upload File", value: "upload" }, { label: "Download File", value: "download" }, { label: "Delete File", value: "delete" }, { label: "Copy File", value: "copy" }, { label: "Move / Rename", value: "move" }, { label: "Get Signed URL", value: "presign" }], defaultValue: "download", validation: { required: true } },
|
|
1745
1746
|
{ key: "bucket", label: "Bucket Name", type: "string" /* String */, description: "S3 bucket name (defaults to the connector’s bucket)" },
|
|
1746
1747
|
{ key: "key", label: "Object Key (Path)", type: "string" /* String */, description: "S3 object key, e.g. data/reports/monthly.csv" },
|
|
@@ -1959,7 +1960,8 @@ var storageActionDefinition = {
|
|
|
1959
1960
|
{ label: "Get signed URL", value: "presign" },
|
|
1960
1961
|
{ label: "Share", value: "share" },
|
|
1961
1962
|
{ label: "Create folder", value: "create_folder" },
|
|
1962
|
-
{ label: "Transfer to another connector", value: "transfer" }
|
|
1963
|
+
{ label: "Transfer to another connector", value: "transfer" },
|
|
1964
|
+
{ label: "Sync folder to another connector", value: "sync" }
|
|
1963
1965
|
],
|
|
1964
1966
|
defaultValue: "download",
|
|
1965
1967
|
validation: { required: true }
|
|
@@ -3860,6 +3862,672 @@ function storageConfigKeys() {
|
|
|
3860
3862
|
}
|
|
3861
3863
|
return [...keys];
|
|
3862
3864
|
}
|
|
3865
|
+
// src/catalog/ai/ai-agent/config.ts
|
|
3866
|
+
var AiAgentConfig = {
|
|
3867
|
+
defaults: {
|
|
3868
|
+
agentId: ""
|
|
3869
|
+
},
|
|
3870
|
+
schema: {
|
|
3871
|
+
agentId: { type: "string", required: true, description: "Public id of a saved agent (agt_…)" },
|
|
3872
|
+
input: { type: "text", required: false, description: "The prompt; may reference upstream data with {{ods://…}} tokens. Empty uses the first upstream output." },
|
|
3873
|
+
overrides: { type: "object", required: false, description: "Per-step overrides: model, temperature, topP, maxTokens, reasoningEffort, verbosity, batchSize, instructions, instructionsMode, expectedSchema" }
|
|
3874
|
+
},
|
|
3875
|
+
validate: (config) => {
|
|
3876
|
+
const errors = [];
|
|
3877
|
+
if (!config.agentId || typeof config.agentId !== "string")
|
|
3878
|
+
errors.push("Select an agent");
|
|
3879
|
+
if (config.overrides !== undefined && (typeof config.overrides !== "object" || config.overrides === null || Array.isArray(config.overrides))) {
|
|
3880
|
+
errors.push("overrides must be an object");
|
|
3881
|
+
}
|
|
3882
|
+
return { valid: errors.length === 0, errors };
|
|
3883
|
+
},
|
|
3884
|
+
merge: (userConfig) => ({ ...AiAgentConfig.defaults, ...userConfig }),
|
|
3885
|
+
getLabel: (config) => config.agentId ? `Agent ${config.agentId}` : "AI Agent"
|
|
3886
|
+
};
|
|
3887
|
+
// src/catalog/ai/idp-extract/config.ts
|
|
3888
|
+
var IDP_EXTRACT_STRATEGIES = ["vision-direct", "auto"];
|
|
3889
|
+
var IdpExtractConfig = {
|
|
3890
|
+
defaults: {
|
|
3891
|
+
llmConnectorId: "",
|
|
3892
|
+
model: "",
|
|
3893
|
+
strategy: "vision-direct"
|
|
3894
|
+
},
|
|
3895
|
+
schema: {
|
|
3896
|
+
llmConnectorId: { type: "connection", required: true, description: "AI connector instance (its key and model run the extraction)" },
|
|
3897
|
+
model: { type: "string", required: true, description: "Model id offered by the connector" },
|
|
3898
|
+
expectedSchema: { type: "json", required: false, description: "JSON Schema of the fields to extract; empty extracts every field" },
|
|
3899
|
+
systemPromptOverride: { type: "text", required: false },
|
|
3900
|
+
strategy: { type: "select", required: false, options: IDP_EXTRACT_STRATEGIES }
|
|
3901
|
+
},
|
|
3902
|
+
validate: (config) => {
|
|
3903
|
+
const errors = [];
|
|
3904
|
+
if (!config.llmConnectorId)
|
|
3905
|
+
errors.push("Select an AI connection");
|
|
3906
|
+
if (!config.model)
|
|
3907
|
+
errors.push("Select a model");
|
|
3908
|
+
if (typeof config.expectedSchema === "string" && config.expectedSchema.trim() !== "") {
|
|
3909
|
+
try {
|
|
3910
|
+
JSON.parse(config.expectedSchema);
|
|
3911
|
+
} catch {
|
|
3912
|
+
errors.push("expectedSchema is not valid JSON");
|
|
3913
|
+
}
|
|
3914
|
+
}
|
|
3915
|
+
return { valid: errors.length === 0, errors };
|
|
3916
|
+
},
|
|
3917
|
+
merge: (userConfig) => ({ ...IdpExtractConfig.defaults, ...userConfig }),
|
|
3918
|
+
getLabel: (config) => config.model ? `IDP: ${config.model}` : "IDP Extract"
|
|
3919
|
+
};
|
|
3920
|
+
// src/catalog/logic/group/config.ts
|
|
3921
|
+
var GroupConfig = {
|
|
3922
|
+
defaults: {},
|
|
3923
|
+
schema: {},
|
|
3924
|
+
validate: (_config) => ({ valid: true, errors: [] }),
|
|
3925
|
+
merge: (_userConfig) => ({}),
|
|
3926
|
+
getLabel: () => "Group"
|
|
3927
|
+
};
|
|
3928
|
+
// src/catalog/triggers/connector-trigger/events.ts
|
|
3929
|
+
var EVENT_CAPABLE_CONNECTOR_IDS = new Set([
|
|
3930
|
+
"quickbooks_online",
|
|
3931
|
+
"shopify",
|
|
3932
|
+
"hubspot",
|
|
3933
|
+
"salesforce",
|
|
3934
|
+
"google_sheets",
|
|
3935
|
+
"whatsapp"
|
|
3936
|
+
]);
|
|
3937
|
+
var QBO_ENTITIES = [
|
|
3938
|
+
{ entity: "Invoice", supportedOperations: ["Create", "Update", "Delete", "Void", "Emailed"] },
|
|
3939
|
+
{ entity: "Customer", supportedOperations: ["Create", "Update", "Delete", "Merge"] },
|
|
3940
|
+
{ entity: "Payment", supportedOperations: ["Create", "Update", "Delete", "Void"] },
|
|
3941
|
+
{ entity: "Bill", supportedOperations: ["Create", "Update", "Delete", "Void"] },
|
|
3942
|
+
{ entity: "Estimate", supportedOperations: ["Create", "Update", "Delete"] },
|
|
3943
|
+
{ entity: "SalesReceipt", supportedOperations: ["Create", "Update", "Delete", "Void", "Emailed"] },
|
|
3944
|
+
{ entity: "CreditMemo", supportedOperations: ["Create", "Update", "Delete", "Void", "Emailed"] },
|
|
3945
|
+
{ entity: "Vendor", supportedOperations: ["Create", "Update", "Delete", "Merge"] },
|
|
3946
|
+
{ entity: "Item", supportedOperations: ["Create", "Update", "Delete"] },
|
|
3947
|
+
{ entity: "Account", supportedOperations: ["Create", "Update", "Delete", "Merge"] },
|
|
3948
|
+
{ entity: "JournalEntry", supportedOperations: ["Create", "Update", "Delete", "Void"] },
|
|
3949
|
+
{ entity: "PurchaseOrder", supportedOperations: ["Create", "Update", "Delete"] }
|
|
3950
|
+
];
|
|
3951
|
+
var SALESFORCE_ENTITIES = [
|
|
3952
|
+
{ entity: "Lead", supportedOperations: ["Create", "Update", "Delete", "Undelete"] },
|
|
3953
|
+
{ entity: "Account", supportedOperations: ["Create", "Update", "Delete", "Undelete"] },
|
|
3954
|
+
{ entity: "Contact", supportedOperations: ["Create", "Update", "Delete", "Undelete"] },
|
|
3955
|
+
{ entity: "Opportunity", supportedOperations: ["Create", "Update", "Delete", "Undelete"] },
|
|
3956
|
+
{ entity: "Case", supportedOperations: ["Create", "Update", "Delete", "Undelete"] }
|
|
3957
|
+
];
|
|
3958
|
+
var HUBSPOT_ENTITIES = [
|
|
3959
|
+
{ entity: "contact", supportedOperations: ["Create", "Update", "Delete", "Merge", "Restore", "AssociationChange"] },
|
|
3960
|
+
{ entity: "company", supportedOperations: ["Create", "Update", "Delete", "Merge", "Restore", "AssociationChange"] },
|
|
3961
|
+
{ entity: "deal", supportedOperations: ["Create", "Update", "Delete", "Merge", "Restore", "AssociationChange"] },
|
|
3962
|
+
{ entity: "ticket", supportedOperations: ["Create", "Update", "Delete", "Merge", "Restore", "AssociationChange"] },
|
|
3963
|
+
{ entity: "product", supportedOperations: ["Create", "Update", "Delete", "Restore"] },
|
|
3964
|
+
{ entity: "line_item", supportedOperations: ["Create", "Update", "Delete", "Restore"] },
|
|
3965
|
+
{ entity: "lead", supportedOperations: ["Create", "Update", "Delete", "Restore"] },
|
|
3966
|
+
{ entity: "quote", supportedOperations: ["Create", "Update", "Delete", "Restore"] },
|
|
3967
|
+
{ entity: "call", supportedOperations: ["Create", "Update", "Delete"] },
|
|
3968
|
+
{ entity: "email", supportedOperations: ["Create", "Update", "Delete"] },
|
|
3969
|
+
{ entity: "meeting_event", supportedOperations: ["Create", "Update", "Delete"] },
|
|
3970
|
+
{ entity: "task", supportedOperations: ["Create", "Update", "Delete"] },
|
|
3971
|
+
{ entity: "note", supportedOperations: ["Create", "Update", "Delete"] },
|
|
3972
|
+
{ entity: "order", supportedOperations: ["Create", "Update", "Delete"] },
|
|
3973
|
+
{ entity: "cart", supportedOperations: ["Create", "Update", "Delete"] },
|
|
3974
|
+
{ entity: "invoice", supportedOperations: ["Create", "Update", "Delete"] }
|
|
3975
|
+
];
|
|
3976
|
+
var SHOPIFY_ENTITIES = [
|
|
3977
|
+
{ entity: "Order", supportedOperations: ["Create", "Update", "Paid", "Fulfilled", "Cancelled"] },
|
|
3978
|
+
{ entity: "Product", supportedOperations: ["Create", "Update"] },
|
|
3979
|
+
{ entity: "Customer", supportedOperations: ["Create", "Update"] }
|
|
3980
|
+
];
|
|
3981
|
+
var GOOGLE_SHEETS_ENTITIES = [
|
|
3982
|
+
{ entity: "Row", supportedOperations: ["Create", "Update", "Delete"] },
|
|
3983
|
+
{ entity: "Sheet", supportedOperations: ["Create", "Update"] }
|
|
3984
|
+
];
|
|
3985
|
+
var WHATSAPP_ENTITIES = [
|
|
3986
|
+
{ entity: "Message", supportedOperations: ["Received"] }
|
|
3987
|
+
];
|
|
3988
|
+
var CONNECTOR_EVENT_ENTITIES = {
|
|
3989
|
+
quickbooks_online: QBO_ENTITIES,
|
|
3990
|
+
salesforce: SALESFORCE_ENTITIES,
|
|
3991
|
+
hubspot: HUBSPOT_ENTITIES,
|
|
3992
|
+
shopify: SHOPIFY_ENTITIES,
|
|
3993
|
+
google_sheets: GOOGLE_SHEETS_ENTITIES,
|
|
3994
|
+
whatsapp: WHATSAPP_ENTITIES
|
|
3995
|
+
};
|
|
3996
|
+
function getEntitiesForConnector(connectorId) {
|
|
3997
|
+
return CONNECTOR_EVENT_ENTITIES[connectorId] ?? [];
|
|
3998
|
+
}
|
|
3999
|
+
function isEventCapableConnector(connectorId) {
|
|
4000
|
+
return EVENT_CAPABLE_CONNECTOR_IDS.has(connectorId) && getEntitiesForConnector(connectorId).length > 0;
|
|
4001
|
+
}
|
|
4002
|
+
function summarizeConnectorTriggerEvents(connectorName, events) {
|
|
4003
|
+
const eventCount = events.reduce((acc, ev) => acc + ev.operations.length, 0);
|
|
4004
|
+
if (eventCount === 0)
|
|
4005
|
+
return connectorName;
|
|
4006
|
+
const noun = eventCount === 1 ? "event" : "events";
|
|
4007
|
+
return `${connectorName} · ${eventCount} ${noun}`;
|
|
4008
|
+
}
|
|
4009
|
+
function validateConnectorTriggerEvents(connectorId, events) {
|
|
4010
|
+
const entities = getEntitiesForConnector(connectorId);
|
|
4011
|
+
if (!isEventCapableConnector(connectorId)) {
|
|
4012
|
+
return `"${connectorId}" does not emit events a trigger can subscribe to. ` + `Event-capable connectors: ${[...EVENT_CAPABLE_CONNECTOR_IDS].join(", ")}.`;
|
|
4013
|
+
}
|
|
4014
|
+
if (!Array.isArray(events) || events.length === 0) {
|
|
4015
|
+
return 'events must be a non-empty array of { "entity": string, "operations": string[] }.';
|
|
4016
|
+
}
|
|
4017
|
+
const seen = new Set;
|
|
4018
|
+
for (const ev of events) {
|
|
4019
|
+
const entity = ev?.entity;
|
|
4020
|
+
const operations = ev?.operations;
|
|
4021
|
+
if (typeof entity !== "string" || !entity) {
|
|
4022
|
+
return 'Each event needs an "entity" (string).';
|
|
4023
|
+
}
|
|
4024
|
+
const known = entities.find((e) => e.entity === entity);
|
|
4025
|
+
if (!known) {
|
|
4026
|
+
const caseHit = entities.find((e) => e.entity.toLowerCase() === entity.toLowerCase());
|
|
4027
|
+
const hint = caseHit ? ` Did you mean "${caseHit.entity}"? Names are case-sensitive.` : "";
|
|
4028
|
+
return `Unknown entity "${entity}" for ${connectorId}.${hint} Entities: ${entities.map((e) => e.entity).join(", ")}.`;
|
|
4029
|
+
}
|
|
4030
|
+
if (seen.has(entity))
|
|
4031
|
+
return `Entity "${entity}" is listed twice — give it one entry with all its operations.`;
|
|
4032
|
+
seen.add(entity);
|
|
4033
|
+
if (!Array.isArray(operations) || operations.length === 0) {
|
|
4034
|
+
return `Event "${entity}" needs a non-empty "operations" array. Operations: ${known.supportedOperations.join(", ")}.`;
|
|
4035
|
+
}
|
|
4036
|
+
for (const op of operations) {
|
|
4037
|
+
if (typeof op !== "string" || !known.supportedOperations.includes(op)) {
|
|
4038
|
+
const caseHit = typeof op === "string" ? known.supportedOperations.find((o) => o.toLowerCase() === op.toLowerCase()) : undefined;
|
|
4039
|
+
const hint = caseHit ? ` Did you mean "${caseHit}"?` : "";
|
|
4040
|
+
return `Unknown operation "${String(op)}" for ${connectorId} ${entity}.${hint} Operations: ${known.supportedOperations.join(", ")}.`;
|
|
4041
|
+
}
|
|
4042
|
+
}
|
|
4043
|
+
}
|
|
4044
|
+
return null;
|
|
4045
|
+
}
|
|
4046
|
+
|
|
4047
|
+
// src/catalog/triggers/connector-trigger/config.ts
|
|
4048
|
+
var ConnectorTriggerConfig = {
|
|
4049
|
+
defaults: {
|
|
4050
|
+
connectorInstanceId: ""
|
|
4051
|
+
},
|
|
4052
|
+
schema: {
|
|
4053
|
+
connectorInstanceId: { type: "connection", required: true, description: "The connected app instance that emits the events" },
|
|
4054
|
+
events: { type: "array", required: true, description: "[{ entity, operations }] — exact names from the connector vocabulary; registers the trigger" },
|
|
4055
|
+
connectorId: { type: "string", required: false, description: "Connector type of the instance (hubspot, google_sheets, …)" },
|
|
4056
|
+
connectorName: { type: "string", required: false, description: "Display name of the instance" },
|
|
4057
|
+
subscribed: { type: "boolean", required: false, description: "Registration snapshot" },
|
|
4058
|
+
eventCount: { type: "number", required: false, description: "Registration snapshot" },
|
|
4059
|
+
summary: { type: "string", required: false, description: "Registration snapshot shown on the canvas" },
|
|
4060
|
+
sheetFileId: { type: "string", required: false, description: "Google Sheets: spreadsheet id" },
|
|
4061
|
+
sheetFileLabel: { type: "string", required: false, description: "Google Sheets: spreadsheet name" },
|
|
4062
|
+
sheetName: { type: "string", required: false, description: "Google Sheets: tab name" },
|
|
4063
|
+
sheetKeyColumn: { type: "string", required: false, description: "Google Sheets: row key column" },
|
|
4064
|
+
description: { type: "string", required: false, description: "Added to the trigger output when set" }
|
|
4065
|
+
},
|
|
4066
|
+
validate: (config) => {
|
|
4067
|
+
const errors = [];
|
|
4068
|
+
if (!config.connectorInstanceId)
|
|
4069
|
+
errors.push("Select a connected app");
|
|
4070
|
+
if (config.events !== undefined && !Array.isArray(config.events)) {
|
|
4071
|
+
errors.push("events must be an array of { entity, operations }");
|
|
4072
|
+
} else if (config.connectorId && Array.isArray(config.events) && config.events.length > 0) {
|
|
4073
|
+
const why = validateConnectorTriggerEvents(config.connectorId, config.events);
|
|
4074
|
+
if (why)
|
|
4075
|
+
errors.push(why);
|
|
4076
|
+
}
|
|
4077
|
+
if (config.connectorId === "google_sheets") {
|
|
4078
|
+
if (!config.sheetFileId)
|
|
4079
|
+
errors.push("Select a spreadsheet");
|
|
4080
|
+
if (!config.sheetName)
|
|
4081
|
+
errors.push("Select a sheet");
|
|
4082
|
+
}
|
|
4083
|
+
return { valid: errors.length === 0, errors };
|
|
4084
|
+
},
|
|
4085
|
+
merge: (userConfig) => ({ ...ConnectorTriggerConfig.defaults, ...userConfig }),
|
|
4086
|
+
getLabel: (config) => config.summary || config.connectorName || "Connector Trigger"
|
|
4087
|
+
};
|
|
4088
|
+
// src/catalog/storage/fileEditContract.ts
|
|
4089
|
+
var FILE_FORMAT_OPERATIONS = ["parse", "generate", "edit"];
|
|
4090
|
+
var FILE_EDIT_OPERATIONS = ["append", "update", "upsert", "set_fields"];
|
|
4091
|
+
var FILE_EDIT_MATCH_OPS = ["=", "!=", ">", "<", ">=", "<=", "contains"];
|
|
4092
|
+
var FILE_EDIT_DESTINATIONS = ["new", "in_place"];
|
|
4093
|
+
var FILE_EDIT_SOURCES = ["inline", "s3", "url"];
|
|
4094
|
+
var FILE_EDIT_SCHEMA = {
|
|
4095
|
+
editOperation: { type: "select", required: false, options: FILE_EDIT_OPERATIONS, description: "How the file is edited: append rows, update rows by key, upsert, or set fields on matching rows" },
|
|
4096
|
+
keyField: { type: "string", required: false, description: "Match key column for update / upsert" },
|
|
4097
|
+
mergeUpdate: { type: "boolean", required: false, description: "false replaces the whole matched row; default merges" },
|
|
4098
|
+
matchField: { type: "string", required: false, description: "set_fields: column the row filter reads" },
|
|
4099
|
+
matchOp: { type: "select", required: false, options: FILE_EDIT_MATCH_OPS, description: 'set_fields: comparison; "=" by default' },
|
|
4100
|
+
matchValue: { type: "string", required: false, description: "set_fields: value compared against" },
|
|
4101
|
+
setFields: { type: "object", required: false, description: "set_fields: { column: newValue } applied to matching rows" },
|
|
4102
|
+
destination: { type: "select", required: false, options: FILE_EDIT_DESTINATIONS, description: '"new" writes an edited copy (default); "in_place" overwrites an S3 source' },
|
|
4103
|
+
outputFileName: { type: "string", required: false, description: 'Name of the edited copy when destination is "new"' },
|
|
4104
|
+
source: { type: "select", required: false, options: FILE_EDIT_SOURCES, description: "Where the file to edit comes from; inferred from content when absent" },
|
|
4105
|
+
s3Key: { type: "string", required: false, description: 'source "s3": platform-bucket key of the file to edit' },
|
|
4106
|
+
url: { type: "url", required: false, description: 'source "url": the file to edit is fetched from here' }
|
|
4107
|
+
};
|
|
4108
|
+
function fileEditErrors(config) {
|
|
4109
|
+
const errors = [];
|
|
4110
|
+
if (config.operation !== "edit")
|
|
4111
|
+
return errors;
|
|
4112
|
+
const op = config.editOperation ?? "append";
|
|
4113
|
+
if (!FILE_EDIT_OPERATIONS.includes(op))
|
|
4114
|
+
errors.push(`Unknown edit operation "${op}"`);
|
|
4115
|
+
if ((op === "update" || op === "upsert") && !config.keyField)
|
|
4116
|
+
errors.push(`File edit "${op}" needs a Match key field`);
|
|
4117
|
+
return errors;
|
|
4118
|
+
}
|
|
4119
|
+
function fileFormatErrors(config) {
|
|
4120
|
+
const errors = [];
|
|
4121
|
+
if (config.operation !== undefined && config.operation !== "" && !FILE_FORMAT_OPERATIONS.includes(config.operation)) {
|
|
4122
|
+
errors.push(`Unknown operation "${config.operation}" — use parse, generate or edit`);
|
|
4123
|
+
}
|
|
4124
|
+
return [...errors, ...fileEditErrors(config)];
|
|
4125
|
+
}
|
|
4126
|
+
// src/catalog/storage/csv-action/config.ts
|
|
4127
|
+
var CsvActionConfig = {
|
|
4128
|
+
defaults: {
|
|
4129
|
+
operation: "parse",
|
|
4130
|
+
delimiter: ",",
|
|
4131
|
+
headerRow: 1,
|
|
4132
|
+
includeHeader: true,
|
|
4133
|
+
fileName: "export.csv"
|
|
4134
|
+
},
|
|
4135
|
+
schema: {
|
|
4136
|
+
operation: { type: "select", required: true, options: FILE_FORMAT_OPERATIONS, description: "parse (CSV → records), generate (records → CSV) or edit an existing file" },
|
|
4137
|
+
content: { type: "text", required: false, description: "CSV text, or an FX token from an upstream step" },
|
|
4138
|
+
delimiter: { type: "select", required: false, options: [",", ";", "\t", "|"] },
|
|
4139
|
+
headerRow: { type: "number", required: false, min: 1, description: "1-based row that holds the column headers" },
|
|
4140
|
+
encoding: { type: "string", required: false, description: "Text encoding (utf-8 by default)" },
|
|
4141
|
+
includeHeader: { type: "boolean", required: false, description: "generate: write the header row" },
|
|
4142
|
+
fileName: { type: "string", required: false, description: "generate: name of the produced file" },
|
|
4143
|
+
...FILE_EDIT_SCHEMA
|
|
4144
|
+
},
|
|
4145
|
+
validate: (config) => {
|
|
4146
|
+
const errors = fileFormatErrors(config);
|
|
4147
|
+
return { valid: errors.length === 0, errors };
|
|
4148
|
+
},
|
|
4149
|
+
merge: (userConfig) => ({ ...CsvActionConfig.defaults, ...userConfig }),
|
|
4150
|
+
getLabel: (config) => `CSV: ${config.operation || "parse"}`
|
|
4151
|
+
};
|
|
4152
|
+
// src/catalog/storage/json-action/config.ts
|
|
4153
|
+
var JsonActionConfig = {
|
|
4154
|
+
defaults: {
|
|
4155
|
+
operation: "parse",
|
|
4156
|
+
format: "json",
|
|
4157
|
+
prettyPrint: true,
|
|
4158
|
+
fileName: "export.json"
|
|
4159
|
+
},
|
|
4160
|
+
schema: {
|
|
4161
|
+
operation: { type: "select", required: true, options: FILE_FORMAT_OPERATIONS, description: "parse (JSON → records), generate (records → JSON) or edit an existing file" },
|
|
4162
|
+
format: { type: "select", required: false, options: ["json", "jsonl"], description: "json (array) or jsonl (one object per line)" },
|
|
4163
|
+
content: { type: "text", required: false, description: "JSON text, or an FX token from an upstream step" },
|
|
4164
|
+
prettyPrint: { type: "boolean", required: false, description: "generate: indent the output" },
|
|
4165
|
+
fileName: { type: "string", required: false, description: "generate: name of the produced file" },
|
|
4166
|
+
jsonl: { type: "boolean", required: false, description: "edit: treat the file as JSONL" },
|
|
4167
|
+
...FILE_EDIT_SCHEMA
|
|
4168
|
+
},
|
|
4169
|
+
validate: (config) => {
|
|
4170
|
+
const errors = fileFormatErrors(config);
|
|
4171
|
+
const format = config.format;
|
|
4172
|
+
if (format !== undefined && format !== "" && !["json", "jsonl"].includes(format)) {
|
|
4173
|
+
errors.push(`Unknown format "${format}" — use json or jsonl`);
|
|
4174
|
+
}
|
|
4175
|
+
return { valid: errors.length === 0, errors };
|
|
4176
|
+
},
|
|
4177
|
+
merge: (userConfig) => ({ ...JsonActionConfig.defaults, ...userConfig }),
|
|
4178
|
+
getLabel: (config) => `JSON: ${config.operation || "parse"}`
|
|
4179
|
+
};
|
|
4180
|
+
// src/catalog/storage/xml-action/config.ts
|
|
4181
|
+
var XmlActionConfig = {
|
|
4182
|
+
defaults: {
|
|
4183
|
+
operation: "parse",
|
|
4184
|
+
rootElement: "data",
|
|
4185
|
+
rowElement: "row",
|
|
4186
|
+
fileName: "export.xml"
|
|
4187
|
+
},
|
|
4188
|
+
schema: {
|
|
4189
|
+
operation: { type: "select", required: true, options: FILE_FORMAT_OPERATIONS, description: "parse (XML → records), generate (records → XML) or edit an existing file" },
|
|
4190
|
+
content: { type: "text", required: false, description: "XML text, or an FX token from an upstream step" },
|
|
4191
|
+
rootElement: { type: "string", required: false, description: "generate: root element name" },
|
|
4192
|
+
rowElement: { type: "string", required: false, description: "Element that holds one record" },
|
|
4193
|
+
fileName: { type: "string", required: false, description: "generate: name of the produced file" },
|
|
4194
|
+
...FILE_EDIT_SCHEMA
|
|
4195
|
+
},
|
|
4196
|
+
validate: (config) => {
|
|
4197
|
+
const errors = fileFormatErrors(config);
|
|
4198
|
+
return { valid: errors.length === 0, errors };
|
|
4199
|
+
},
|
|
4200
|
+
merge: (userConfig) => ({ ...XmlActionConfig.defaults, ...userConfig }),
|
|
4201
|
+
getLabel: (config) => `XML: ${config.operation || "parse"}`
|
|
4202
|
+
};
|
|
4203
|
+
// src/catalog/storage/excel-action/config.ts
|
|
4204
|
+
var ExcelActionConfig = {
|
|
4205
|
+
defaults: {
|
|
4206
|
+
operation: "parse",
|
|
4207
|
+
headerRow: 1,
|
|
4208
|
+
fileName: "export.xlsx"
|
|
4209
|
+
},
|
|
4210
|
+
schema: {
|
|
4211
|
+
operation: { type: "select", required: true, options: FILE_FORMAT_OPERATIONS, description: "parse (Excel → records), generate (records → Excel) or edit an existing file" },
|
|
4212
|
+
content: { type: "text", required: false, description: "Platform-bucket key of the workbook, base64 bytes, or an FX token from an upstream step" },
|
|
4213
|
+
sheetName: { type: "string", required: false, description: "Sheet to read; the first sheet when absent" },
|
|
4214
|
+
headerRow: { type: "number", required: false, min: 1, description: "1-based row that holds the column headers" },
|
|
4215
|
+
fileName: { type: "string", required: false, description: "generate: name of the produced file" },
|
|
4216
|
+
...FILE_EDIT_SCHEMA
|
|
4217
|
+
},
|
|
4218
|
+
validate: (config) => {
|
|
4219
|
+
const errors = fileFormatErrors(config);
|
|
4220
|
+
return { valid: errors.length === 0, errors };
|
|
4221
|
+
},
|
|
4222
|
+
merge: (userConfig) => ({ ...ExcelActionConfig.defaults, ...userConfig }),
|
|
4223
|
+
getLabel: (config) => `Excel: ${config.operation || "parse"}`
|
|
4224
|
+
};
|
|
4225
|
+
// src/catalog/storage/file-action/config.ts
|
|
4226
|
+
var FILE_ACTION_MODES = ["parse", "generate", "convert", "edit"];
|
|
4227
|
+
var FILE_ACTION_SOURCES = ["inline", "s3", "url", "previous_step", "upload"];
|
|
4228
|
+
var FILE_ACTION_FORMATS = ["auto", "csv", "tsv", "json", "jsonl", "xml", "excel"];
|
|
4229
|
+
var FILE_ACTION_OUTPUT_FORMATS = ["csv", "json", "excel", "xml", "tsv"];
|
|
4230
|
+
var FileActionConfig = {
|
|
4231
|
+
defaults: {
|
|
4232
|
+
mode: "parse",
|
|
4233
|
+
source: "inline",
|
|
4234
|
+
format: "auto"
|
|
4235
|
+
},
|
|
4236
|
+
schema: {
|
|
4237
|
+
...FILE_EDIT_SCHEMA,
|
|
4238
|
+
mode: { type: "select", required: true, options: FILE_ACTION_MODES, description: "parse, generate, convert or edit" },
|
|
4239
|
+
operation: { type: "select", required: false, options: FILE_ACTION_MODES, description: "Alias of mode; read first when both are set" },
|
|
4240
|
+
source: { type: "select", required: false, options: FILE_ACTION_SOURCES, description: "Where the file comes from (inline by default)" },
|
|
4241
|
+
format: { type: "select", required: false, options: FILE_ACTION_FORMATS, description: "File format; auto-detected from the name, then the content" },
|
|
4242
|
+
inlineContent: { type: "text", required: false, description: 'source "inline": the text (base64 for Excel)' },
|
|
4243
|
+
content: { type: "text", required: false, description: "Alias of inlineContent" },
|
|
4244
|
+
outputFormat: { type: "select", required: false, options: FILE_ACTION_OUTPUT_FORMATS, description: "generate / convert: format to write" },
|
|
4245
|
+
outputFileName: { type: "string", required: false, description: "generate / convert: name of the produced file" },
|
|
4246
|
+
fileName: { type: "string", required: false, description: "Name used to detect the format" },
|
|
4247
|
+
encoding: { type: "string", required: false },
|
|
4248
|
+
delimiter: { type: "string", required: false, description: "CSV / TSV delimiter" },
|
|
4249
|
+
headerRow: { type: "number", required: false, min: 1 },
|
|
4250
|
+
rowElement: { type: "string", required: false, description: "XML element that holds one record" },
|
|
4251
|
+
sheetName: { type: "string", required: false, description: "Excel sheet to read" },
|
|
4252
|
+
includeHeader: { type: "boolean", required: false },
|
|
4253
|
+
options: { type: "json", required: false, description: "Parser options read ahead of the top-level keys" }
|
|
4254
|
+
},
|
|
4255
|
+
validate: (config) => {
|
|
4256
|
+
const errors = [];
|
|
4257
|
+
const mode = config.operation || config.mode;
|
|
4258
|
+
if (mode !== undefined && mode !== "" && !FILE_ACTION_MODES.includes(mode)) {
|
|
4259
|
+
errors.push(`Unknown mode "${mode}" — use parse, generate, convert or edit`);
|
|
4260
|
+
}
|
|
4261
|
+
if (config.source === "upload")
|
|
4262
|
+
errors.push('source "upload" is not supported at run time');
|
|
4263
|
+
errors.push(...fileEditErrors({ ...config, operation: mode, source: undefined }));
|
|
4264
|
+
return { valid: errors.length === 0, errors };
|
|
4265
|
+
},
|
|
4266
|
+
merge: (userConfig) => ({ ...FileActionConfig.defaults, ...userConfig }),
|
|
4267
|
+
getLabel: (config) => `File: ${config.operation || config.mode || "parse"}`
|
|
4268
|
+
};
|
|
4269
|
+
// src/catalog/storage/storage-action/config.ts
|
|
4270
|
+
var FIXED_SCHEMA = {
|
|
4271
|
+
connector: { type: "connection", required: true, description: "Storage connector instance; its provider decides the operations" },
|
|
4272
|
+
operation: { type: "select", required: true, description: "Per provider: list, download, upload, delete, copy, move, presign, share, create_folder, transfer, sync" },
|
|
4273
|
+
outputAs: { type: "string", required: false, description: "Name of this step's output in the run's data bag" },
|
|
4274
|
+
content: { type: "text", required: false, description: "upload: the body" },
|
|
4275
|
+
destConnector: { type: "connection", required: false, description: "transfer / sync: destination connector instance" },
|
|
4276
|
+
destPath: { type: "string", required: false, description: "transfer / sync: destination path; also move / copy destination on path-based providers" },
|
|
4277
|
+
sourceIsDirectory: { type: "boolean", required: false, description: "transfer: copy a folder recursively" },
|
|
4278
|
+
cursor: { type: "json", required: false, description: "sync: walk cursor threaded by a cursor ForEach ({{$item.cursor}})" },
|
|
4279
|
+
fileBudget: { type: "number", required: false, min: 1, description: "sync: files per pass" },
|
|
4280
|
+
timeBudgetMs: { type: "number", required: false, min: 1, description: "sync: milliseconds per pass" },
|
|
4281
|
+
fileTypes: { type: "array", required: false, description: "list: keep only these extensions" },
|
|
4282
|
+
filePattern: { type: "string", required: false, description: "list: keep only names matching this glob" },
|
|
4283
|
+
bucket: { type: "string", required: false, description: "S3 / GCS: overrides the connector's bucket" },
|
|
4284
|
+
container: { type: "string", required: false, description: "Azure: overrides the connector's container" },
|
|
4285
|
+
region: { type: "string", required: false, description: "S3: overrides the connector's region" }
|
|
4286
|
+
};
|
|
4287
|
+
var EXTRA_TYPE = {
|
|
4288
|
+
string: "string",
|
|
4289
|
+
number: "number",
|
|
4290
|
+
select: "select",
|
|
4291
|
+
boolean: "boolean"
|
|
4292
|
+
};
|
|
4293
|
+
function extraField(f) {
|
|
4294
|
+
const field = { type: EXTRA_TYPE[f.type] ?? "string", required: false };
|
|
4295
|
+
if (f.type === "select" && f.options)
|
|
4296
|
+
field.options = f.options.map((o) => o.value);
|
|
4297
|
+
if (f.label)
|
|
4298
|
+
field.description = f.label;
|
|
4299
|
+
return field;
|
|
4300
|
+
}
|
|
4301
|
+
function storageOperations() {
|
|
4302
|
+
const seen = new Set;
|
|
4303
|
+
for (const provider of Object.values(STORAGE_PROVIDERS)) {
|
|
4304
|
+
for (const op of provider.operations)
|
|
4305
|
+
seen.add(op.value);
|
|
4306
|
+
}
|
|
4307
|
+
return [...seen];
|
|
4308
|
+
}
|
|
4309
|
+
function buildSchema() {
|
|
4310
|
+
const schema = { ...FIXED_SCHEMA };
|
|
4311
|
+
schema.operation = { ...schema.operation, options: storageOperations() };
|
|
4312
|
+
const pathKey = (key, label) => {
|
|
4313
|
+
if (!schema[key])
|
|
4314
|
+
schema[key] = { type: "string", required: false, description: label };
|
|
4315
|
+
const name = `${key}Name`;
|
|
4316
|
+
if (!schema[name])
|
|
4317
|
+
schema[name] = { type: "string", required: false, description: `Display name of the item picked for ${key}` };
|
|
4318
|
+
};
|
|
4319
|
+
for (const provider of Object.values(STORAGE_PROVIDERS)) {
|
|
4320
|
+
for (const op of provider.operations) {
|
|
4321
|
+
if (op.path)
|
|
4322
|
+
pathKey(op.path.key, op.path.label);
|
|
4323
|
+
if (op.dest)
|
|
4324
|
+
pathKey(op.dest.key, op.dest.label);
|
|
4325
|
+
for (const f of op.fields ?? []) {
|
|
4326
|
+
if (!schema[f.key])
|
|
4327
|
+
schema[f.key] = extraField(f);
|
|
4328
|
+
}
|
|
4329
|
+
}
|
|
4330
|
+
}
|
|
4331
|
+
return schema;
|
|
4332
|
+
}
|
|
4333
|
+
var StorageActionConfig = {
|
|
4334
|
+
defaults: {
|
|
4335
|
+
connector: "",
|
|
4336
|
+
operation: "download"
|
|
4337
|
+
},
|
|
4338
|
+
schema: buildSchema(),
|
|
4339
|
+
validate: (config) => {
|
|
4340
|
+
const errors = [];
|
|
4341
|
+
if (!config.connector)
|
|
4342
|
+
errors.push("Select a storage connector");
|
|
4343
|
+
if (!config.operation)
|
|
4344
|
+
errors.push("Select an operation");
|
|
4345
|
+
else if (!storageOperations().includes(config.operation))
|
|
4346
|
+
errors.push(`Unknown operation "${config.operation}"`);
|
|
4347
|
+
if (config.operation === "transfer" || config.operation === "sync") {
|
|
4348
|
+
if (!config.destConnector)
|
|
4349
|
+
errors.push("Select a destination connector");
|
|
4350
|
+
if (!config.path)
|
|
4351
|
+
errors.push(config.operation === "transfer" ? "Select a source path" : "Select a source folder");
|
|
4352
|
+
}
|
|
4353
|
+
if (config.fileBudget !== undefined && typeof config.fileBudget !== "number")
|
|
4354
|
+
errors.push("fileBudget must be a number");
|
|
4355
|
+
if (config.timeBudgetMs !== undefined && typeof config.timeBudgetMs !== "number")
|
|
4356
|
+
errors.push("timeBudgetMs must be a number");
|
|
4357
|
+
return { valid: errors.length === 0, errors };
|
|
4358
|
+
},
|
|
4359
|
+
merge: (userConfig) => ({ ...StorageActionConfig.defaults, ...userConfig }),
|
|
4360
|
+
getLabel: (config) => `Storage: ${config.operation || "download"}`
|
|
4361
|
+
};
|
|
4362
|
+
// src/catalog/storage/s3-action/config.ts
|
|
4363
|
+
var S3_OPERATIONS = ["list", "download", "upload", "delete", "copy", "move", "presign"];
|
|
4364
|
+
var S3ActionConfig = {
|
|
4365
|
+
defaults: {
|
|
4366
|
+
connector: "",
|
|
4367
|
+
operation: "download",
|
|
4368
|
+
contentType: "application/octet-stream",
|
|
4369
|
+
expiresIn: 3600,
|
|
4370
|
+
maxKeys: 100
|
|
4371
|
+
},
|
|
4372
|
+
schema: {
|
|
4373
|
+
connector: { type: "connection", required: true, description: "S3 connector instance" },
|
|
4374
|
+
operation: { type: "select", required: true, options: S3_OPERATIONS },
|
|
4375
|
+
bucket: { type: "string", required: false, description: "Overrides the connector's bucket" },
|
|
4376
|
+
region: { type: "string", required: false, description: "Overrides the connector's region" },
|
|
4377
|
+
key: { type: "string", required: false, description: "Object key" },
|
|
4378
|
+
prefix: { type: "string", required: false, description: "list: key prefix" },
|
|
4379
|
+
content: { type: "text", required: false, description: "upload: the body" },
|
|
4380
|
+
contentType: { type: "string", required: false, description: "upload: MIME type" },
|
|
4381
|
+
destBucket: { type: "string", required: false, description: "copy / move: destination bucket" },
|
|
4382
|
+
destKey: { type: "string", required: false, description: "copy / move: destination key" },
|
|
4383
|
+
expiresIn: { type: "number", required: false, min: 1, description: "presign: URL lifetime in seconds" },
|
|
4384
|
+
maxKeys: { type: "number", required: false, min: 1, description: "list: page size" },
|
|
4385
|
+
fileTypes: { type: "array", required: false, description: "list: keep only these extensions" },
|
|
4386
|
+
filePattern: { type: "string", required: false, description: "list: keep only names matching this glob" }
|
|
4387
|
+
},
|
|
4388
|
+
validate: (config) => {
|
|
4389
|
+
const errors = [];
|
|
4390
|
+
if (!config.connector)
|
|
4391
|
+
errors.push("Select an S3 connection");
|
|
4392
|
+
if (config.operation && !S3_OPERATIONS.includes(config.operation))
|
|
4393
|
+
errors.push(`Unknown operation "${config.operation}"`);
|
|
4394
|
+
return { valid: errors.length === 0, errors };
|
|
4395
|
+
},
|
|
4396
|
+
merge: (userConfig) => ({ ...S3ActionConfig.defaults, ...userConfig }),
|
|
4397
|
+
getLabel: (config) => `S3: ${config.operation || "download"}`
|
|
4398
|
+
};
|
|
4399
|
+
// src/catalog/storage/ftp-action/config.ts
|
|
4400
|
+
var FTP_OPERATIONS = ["download", "upload", "list", "delete", "move"];
|
|
4401
|
+
var FtpActionConfig = {
|
|
4402
|
+
defaults: {
|
|
4403
|
+
connector: "",
|
|
4404
|
+
operation: "download",
|
|
4405
|
+
ifExists: "overwrite"
|
|
4406
|
+
},
|
|
4407
|
+
schema: {
|
|
4408
|
+
connector: { type: "connection", required: true, description: "FTP / SFTP connector instance" },
|
|
4409
|
+
operation: { type: "select", required: true, options: FTP_OPERATIONS },
|
|
4410
|
+
remotePath: { type: "string", required: false, description: "File or folder path on the server" },
|
|
4411
|
+
content: { type: "text", required: false, description: "upload: the body" },
|
|
4412
|
+
fileName: { type: "string", required: false, description: "upload: file name" },
|
|
4413
|
+
destPath: { type: "string", required: false, description: "move: the new path" },
|
|
4414
|
+
ifExists: { type: "select", required: false, options: ["overwrite", "skip"], description: "upload: when the file exists" },
|
|
4415
|
+
fileTypes: { type: "array", required: false, description: "list: keep only these extensions" },
|
|
4416
|
+
filePattern: { type: "string", required: false, description: "list: keep only names matching this glob" }
|
|
4417
|
+
},
|
|
4418
|
+
validate: (config) => {
|
|
4419
|
+
const errors = [];
|
|
4420
|
+
if (!config.connector)
|
|
4421
|
+
errors.push("Select an FTP/SFTP connection");
|
|
4422
|
+
if (config.operation && !FTP_OPERATIONS.includes(config.operation))
|
|
4423
|
+
errors.push(`Unknown operation "${config.operation}"`);
|
|
4424
|
+
return { valid: errors.length === 0, errors };
|
|
4425
|
+
},
|
|
4426
|
+
merge: (userConfig) => ({ ...FtpActionConfig.defaults, ...userConfig }),
|
|
4427
|
+
getLabel: (config) => `FTP: ${config.operation || "download"}`
|
|
4428
|
+
};
|
|
4429
|
+
// src/catalog/storage/google-drive-action/config.ts
|
|
4430
|
+
var GOOGLE_DRIVE_OPERATIONS = ["upload", "download", "list", "delete", "move", "copy", "share", "create_folder"];
|
|
4431
|
+
var GoogleDriveActionConfig = {
|
|
4432
|
+
defaults: {
|
|
4433
|
+
connector: "",
|
|
4434
|
+
operation: "upload",
|
|
4435
|
+
mimeType: "application/octet-stream",
|
|
4436
|
+
shareRole: "reader",
|
|
4437
|
+
pageSize: 50
|
|
4438
|
+
},
|
|
4439
|
+
schema: {
|
|
4440
|
+
connector: { type: "connection", required: true, description: "Google Drive connector instance" },
|
|
4441
|
+
operation: { type: "select", required: true, options: GOOGLE_DRIVE_OPERATIONS },
|
|
4442
|
+
fileId: { type: "string", required: false, description: "download / delete / move / copy / share: the file" },
|
|
4443
|
+
folderId: { type: "string", required: false, description: "upload / list / create_folder: the folder (root when empty)" },
|
|
4444
|
+
folderName: { type: "string", required: false, description: "upload: folder path resolved or created when folderId is empty" },
|
|
4445
|
+
fileName: { type: "string", required: false, description: "upload / copy / create_folder: the name" },
|
|
4446
|
+
content: { type: "text", required: false, description: "upload: the body" },
|
|
4447
|
+
mimeType: { type: "string", required: false, description: "upload: MIME type" },
|
|
4448
|
+
createFolderIfNotExists: { type: "boolean", required: false, description: "upload: create folderName when missing" },
|
|
4449
|
+
destFolderId: { type: "string", required: false, description: "move / copy: destination folder" },
|
|
4450
|
+
shareEmail: { type: "string", required: false, description: "share: who" },
|
|
4451
|
+
shareRole: { type: "select", required: false, options: ["reader", "writer"], description: "share: permission" },
|
|
4452
|
+
query: { type: "string", required: false, description: "list: Drive search query" },
|
|
4453
|
+
pageSize: { type: "number", required: false, min: 1, description: "list: page size" },
|
|
4454
|
+
fileTypes: { type: "array", required: false, description: "list: keep only these extensions" },
|
|
4455
|
+
filePattern: { type: "string", required: false, description: "list: keep only names matching this glob" }
|
|
4456
|
+
},
|
|
4457
|
+
validate: (config) => {
|
|
4458
|
+
const errors = [];
|
|
4459
|
+
if (!config.connector)
|
|
4460
|
+
errors.push("Select a Google Drive connection");
|
|
4461
|
+
if (config.operation && !GOOGLE_DRIVE_OPERATIONS.includes(config.operation))
|
|
4462
|
+
errors.push(`Unknown operation "${config.operation}"`);
|
|
4463
|
+
if (config.operation === "share" && !config.shareEmail)
|
|
4464
|
+
errors.push("share: an email address is required");
|
|
4465
|
+
return { valid: errors.length === 0, errors };
|
|
4466
|
+
},
|
|
4467
|
+
merge: (userConfig) => ({ ...GoogleDriveActionConfig.defaults, ...userConfig }),
|
|
4468
|
+
getLabel: (config) => `Drive: ${config.operation || "upload"}`
|
|
4469
|
+
};
|
|
4470
|
+
// src/catalog/storage/dropbox-action/config.ts
|
|
4471
|
+
var DROPBOX_OPERATIONS = ["list", "download", "upload", "delete", "move", "copy"];
|
|
4472
|
+
var DropboxActionConfig = {
|
|
4473
|
+
defaults: {
|
|
4474
|
+
connector: "",
|
|
4475
|
+
operation: "download",
|
|
4476
|
+
mode: "overwrite"
|
|
4477
|
+
},
|
|
4478
|
+
schema: {
|
|
4479
|
+
connector: { type: "connection", required: true, description: "Dropbox connector instance" },
|
|
4480
|
+
operation: { type: "select", required: true, options: DROPBOX_OPERATIONS },
|
|
4481
|
+
path: { type: "string", required: false, description: "File path, or the folder to list" },
|
|
4482
|
+
content: { type: "text", required: false, description: "upload: the body" },
|
|
4483
|
+
fileName: { type: "string", required: false, description: "upload: file name" },
|
|
4484
|
+
destPath: { type: "string", required: false, description: "move / copy: destination path" },
|
|
4485
|
+
mode: { type: "select", required: false, options: ["overwrite", "add"], description: "upload: write mode" },
|
|
4486
|
+
fileTypes: { type: "array", required: false, description: "list: keep only these extensions" },
|
|
4487
|
+
filePattern: { type: "string", required: false, description: "list: keep only names matching this glob" }
|
|
4488
|
+
},
|
|
4489
|
+
validate: (config) => {
|
|
4490
|
+
const errors = [];
|
|
4491
|
+
if (!config.connector)
|
|
4492
|
+
errors.push("Select a Dropbox connection");
|
|
4493
|
+
if (config.operation && !DROPBOX_OPERATIONS.includes(config.operation))
|
|
4494
|
+
errors.push(`Unknown operation "${config.operation}"`);
|
|
4495
|
+
return { valid: errors.length === 0, errors };
|
|
4496
|
+
},
|
|
4497
|
+
merge: (userConfig) => ({ ...DropboxActionConfig.defaults, ...userConfig }),
|
|
4498
|
+
getLabel: (config) => `Dropbox: ${config.operation || "download"}`
|
|
4499
|
+
};
|
|
4500
|
+
// src/catalog/storage/onedrive-action/config.ts
|
|
4501
|
+
var ONEDRIVE_OPERATIONS = ["download", "upload", "list", "delete", "move", "copy"];
|
|
4502
|
+
var OneDriveActionConfig = {
|
|
4503
|
+
defaults: {
|
|
4504
|
+
connector: "",
|
|
4505
|
+
operation: "download",
|
|
4506
|
+
contentType: "application/octet-stream"
|
|
4507
|
+
},
|
|
4508
|
+
schema: {
|
|
4509
|
+
connector: { type: "connection", required: true, description: "Microsoft / OneDrive connector instance" },
|
|
4510
|
+
operation: { type: "select", required: true, options: ONEDRIVE_OPERATIONS },
|
|
4511
|
+
path: { type: "string", required: false, description: "Path from the drive root" },
|
|
4512
|
+
itemId: { type: "string", required: false, description: "Item id, as an alternative to path" },
|
|
4513
|
+
content: { type: "text", required: false, description: "upload: the body" },
|
|
4514
|
+
fileName: { type: "string", required: false, description: "upload: file name" },
|
|
4515
|
+
destPath: { type: "string", required: false, description: "move / copy: full destination path" },
|
|
4516
|
+
contentType: { type: "string", required: false, description: "upload: MIME type" },
|
|
4517
|
+
fileTypes: { type: "array", required: false, description: "list: keep only these extensions" },
|
|
4518
|
+
filePattern: { type: "string", required: false, description: "list: keep only names matching this glob" }
|
|
4519
|
+
},
|
|
4520
|
+
validate: (config) => {
|
|
4521
|
+
const errors = [];
|
|
4522
|
+
if (!config.connector)
|
|
4523
|
+
errors.push("Select a OneDrive connection");
|
|
4524
|
+
if (config.operation && !ONEDRIVE_OPERATIONS.includes(config.operation))
|
|
4525
|
+
errors.push(`Unknown operation "${config.operation}"`);
|
|
4526
|
+
return { valid: errors.length === 0, errors };
|
|
4527
|
+
},
|
|
4528
|
+
merge: (userConfig) => ({ ...OneDriveActionConfig.defaults, ...userConfig }),
|
|
4529
|
+
getLabel: (config) => `OneDrive: ${config.operation || "download"}`
|
|
4530
|
+
};
|
|
3863
4531
|
// src/catalog/workflow.ts
|
|
3864
4532
|
var NodeStatus;
|
|
3865
4533
|
((NodeStatus) => {
|
|
@@ -4747,7 +5415,22 @@ var CONFIG_CONTRACTS = {
|
|
|
4747
5415
|
webhook_trigger: { schema: WebhookTriggerConfig.schema, validate: asValidator(WebhookTriggerConfig.validate) },
|
|
4748
5416
|
debug: { schema: DebugConfig.schema, validate: asValidator(DebugConfig.validate) },
|
|
4749
5417
|
error: { schema: ErrorConfig.schema, validate: asValidator(ErrorConfig.validate) },
|
|
4750
|
-
variables: { schema: VariablesConfig.schema, validate: asValidator(VariablesConfig.validate) }
|
|
5418
|
+
variables: { schema: VariablesConfig.schema, validate: asValidator(VariablesConfig.validate) },
|
|
5419
|
+
ai_agent: { schema: AiAgentConfig.schema, validate: asValidator(AiAgentConfig.validate) },
|
|
5420
|
+
idp_extract: { schema: IdpExtractConfig.schema, validate: asValidator(IdpExtractConfig.validate) },
|
|
5421
|
+
group: { schema: GroupConfig.schema, validate: asValidator(GroupConfig.validate) },
|
|
5422
|
+
connector_trigger: { schema: ConnectorTriggerConfig.schema, validate: asValidator(ConnectorTriggerConfig.validate) },
|
|
5423
|
+
csv_action: { schema: CsvActionConfig.schema, validate: asValidator(CsvActionConfig.validate) },
|
|
5424
|
+
json_action: { schema: JsonActionConfig.schema, validate: asValidator(JsonActionConfig.validate) },
|
|
5425
|
+
xml_action: { schema: XmlActionConfig.schema, validate: asValidator(XmlActionConfig.validate) },
|
|
5426
|
+
excel_action: { schema: ExcelActionConfig.schema, validate: asValidator(ExcelActionConfig.validate) },
|
|
5427
|
+
file_action: { schema: FileActionConfig.schema, validate: asValidator(FileActionConfig.validate) },
|
|
5428
|
+
storage_action: { schema: StorageActionConfig.schema, validate: asValidator(StorageActionConfig.validate) },
|
|
5429
|
+
s3_action: { schema: S3ActionConfig.schema, validate: asValidator(S3ActionConfig.validate) },
|
|
5430
|
+
ftp_action: { schema: FtpActionConfig.schema, validate: asValidator(FtpActionConfig.validate) },
|
|
5431
|
+
google_drive_action: { schema: GoogleDriveActionConfig.schema, validate: asValidator(GoogleDriveActionConfig.validate) },
|
|
5432
|
+
dropbox_action: { schema: DropboxActionConfig.schema, validate: asValidator(DropboxActionConfig.validate) },
|
|
5433
|
+
onedrive_action: { schema: OneDriveActionConfig.schema, validate: asValidator(OneDriveActionConfig.validate) }
|
|
4751
5434
|
};
|
|
4752
5435
|
function contractFor(actionId) {
|
|
4753
5436
|
return actionId ? CONFIG_CONTRACTS[actionId] : undefined;
|
|
@@ -5065,30 +5748,63 @@ export {
|
|
|
5065
5748
|
ActionStatus,
|
|
5066
5749
|
ActionType,
|
|
5067
5750
|
AggregateFunction,
|
|
5751
|
+
AiAgentConfig,
|
|
5068
5752
|
CONDITION_OPERATORS,
|
|
5069
5753
|
CONFIG_CONTRACTS,
|
|
5754
|
+
CONNECTOR_EVENT_ENTITIES,
|
|
5070
5755
|
ConditionConfig,
|
|
5756
|
+
ConnectorTriggerConfig,
|
|
5757
|
+
CsvActionConfig,
|
|
5071
5758
|
DATABASE_CONNECTOR_IDS,
|
|
5759
|
+
DROPBOX_OPERATIONS,
|
|
5072
5760
|
DebugConfig,
|
|
5761
|
+
DropboxActionConfig,
|
|
5762
|
+
EVENT_CAPABLE_CONNECTOR_IDS,
|
|
5073
5763
|
EdgeType,
|
|
5074
5764
|
EmailConfig,
|
|
5765
|
+
ExcelActionConfig,
|
|
5766
|
+
FILE_ACTION_FORMATS,
|
|
5767
|
+
FILE_ACTION_MODES,
|
|
5768
|
+
FILE_ACTION_OUTPUT_FORMATS,
|
|
5769
|
+
FILE_ACTION_SOURCES,
|
|
5770
|
+
FILE_EDIT_DESTINATIONS,
|
|
5771
|
+
FILE_EDIT_MATCH_OPS,
|
|
5772
|
+
FILE_EDIT_OPERATIONS,
|
|
5773
|
+
FILE_EDIT_SCHEMA,
|
|
5774
|
+
FILE_EDIT_SOURCES,
|
|
5775
|
+
FILE_FORMAT_OPERATIONS,
|
|
5776
|
+
FTP_OPERATIONS,
|
|
5075
5777
|
FieldType,
|
|
5778
|
+
FileActionConfig,
|
|
5076
5779
|
ForEachConfig,
|
|
5780
|
+
FtpActionConfig,
|
|
5781
|
+
GOOGLE_DRIVE_OPERATIONS,
|
|
5782
|
+
GoogleDriveActionConfig,
|
|
5783
|
+
GroupConfig,
|
|
5784
|
+
IDP_EXTRACT_STRATEGIES,
|
|
5785
|
+
IdpExtractConfig,
|
|
5077
5786
|
JoinType,
|
|
5787
|
+
JsonActionConfig,
|
|
5078
5788
|
LogicalOperator,
|
|
5079
5789
|
MAPPING_FUNCTIONS,
|
|
5080
5790
|
MAPPING_FUNCTION_SPECS,
|
|
5081
5791
|
MAX_STEP_CONFIG_BYTES,
|
|
5082
5792
|
ManualTriggerConfig,
|
|
5083
5793
|
NodeStatus,
|
|
5794
|
+
ONEDRIVE_OPERATIONS,
|
|
5795
|
+
OneDriveActionConfig,
|
|
5084
5796
|
QueryMode,
|
|
5085
5797
|
QueryType,
|
|
5798
|
+
S3ActionConfig,
|
|
5799
|
+
S3_OPERATIONS,
|
|
5086
5800
|
STORAGE_CONNECTOR_IDS,
|
|
5087
5801
|
SortDirection,
|
|
5802
|
+
StorageActionConfig,
|
|
5088
5803
|
TRANSFORM_OPERATIONS,
|
|
5089
5804
|
TransformConfig,
|
|
5090
5805
|
USER_FUNCTION_PREFIX,
|
|
5091
5806
|
VariablesConfig,
|
|
5807
|
+
XmlActionConfig,
|
|
5092
5808
|
actionsRegistry,
|
|
5093
5809
|
buildPathOptions,
|
|
5094
5810
|
collectArrayPaths,
|
|
@@ -5101,6 +5817,8 @@ export {
|
|
|
5101
5817
|
contractVocabularyDrift,
|
|
5102
5818
|
declaredKeys,
|
|
5103
5819
|
emailDefinition,
|
|
5820
|
+
fileEditErrors,
|
|
5821
|
+
fileFormatErrors,
|
|
5104
5822
|
flattenNestedWorkflow,
|
|
5105
5823
|
generateConnectionsFromSteps,
|
|
5106
5824
|
generateEdgeId,
|
|
@@ -5111,20 +5829,25 @@ export {
|
|
|
5111
5829
|
getActionsByCategory,
|
|
5112
5830
|
getAllActions,
|
|
5113
5831
|
getEdgeValidationStatus,
|
|
5832
|
+
getEntitiesForConnector,
|
|
5114
5833
|
getNodeConfigStatus,
|
|
5115
5834
|
getNodeValidationStatus,
|
|
5116
5835
|
getStorageProvider,
|
|
5117
5836
|
inferSchemaFromSample,
|
|
5118
5837
|
isEditorPrivateKey,
|
|
5838
|
+
isEventCapableConnector,
|
|
5119
5839
|
isMappingFunction,
|
|
5120
5840
|
isQueryableConnector,
|
|
5121
5841
|
mappingTransformFunctionName,
|
|
5122
5842
|
migrateDelayConfig,
|
|
5123
5843
|
queryDefinition,
|
|
5124
5844
|
storageConfigKeys,
|
|
5845
|
+
storageOperations,
|
|
5846
|
+
summarizeConnectorTriggerEvents,
|
|
5125
5847
|
transformConnectionToEdge,
|
|
5126
5848
|
transformFlowToWorkflow,
|
|
5127
5849
|
transformStepToNode,
|
|
5850
|
+
validateConnectorTriggerEvents,
|
|
5128
5851
|
validateEdge,
|
|
5129
5852
|
validateFlowData,
|
|
5130
5853
|
validateNode,
|