@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.cjs
CHANGED
|
@@ -43,30 +43,63 @@ __export(exports_src, {
|
|
|
43
43
|
ActionStatus: () => ActionStatus,
|
|
44
44
|
ActionType: () => ActionType,
|
|
45
45
|
AggregateFunction: () => AggregateFunction,
|
|
46
|
+
AiAgentConfig: () => AiAgentConfig,
|
|
46
47
|
CONDITION_OPERATORS: () => CONDITION_OPERATORS,
|
|
47
48
|
CONFIG_CONTRACTS: () => CONFIG_CONTRACTS,
|
|
49
|
+
CONNECTOR_EVENT_ENTITIES: () => CONNECTOR_EVENT_ENTITIES,
|
|
48
50
|
ConditionConfig: () => ConditionConfig,
|
|
51
|
+
ConnectorTriggerConfig: () => ConnectorTriggerConfig,
|
|
52
|
+
CsvActionConfig: () => CsvActionConfig,
|
|
49
53
|
DATABASE_CONNECTOR_IDS: () => DATABASE_CONNECTOR_IDS,
|
|
54
|
+
DROPBOX_OPERATIONS: () => DROPBOX_OPERATIONS,
|
|
50
55
|
DebugConfig: () => DebugConfig,
|
|
56
|
+
DropboxActionConfig: () => DropboxActionConfig,
|
|
57
|
+
EVENT_CAPABLE_CONNECTOR_IDS: () => EVENT_CAPABLE_CONNECTOR_IDS,
|
|
51
58
|
EdgeType: () => EdgeType,
|
|
52
59
|
EmailConfig: () => EmailConfig,
|
|
60
|
+
ExcelActionConfig: () => ExcelActionConfig,
|
|
61
|
+
FILE_ACTION_FORMATS: () => FILE_ACTION_FORMATS,
|
|
62
|
+
FILE_ACTION_MODES: () => FILE_ACTION_MODES,
|
|
63
|
+
FILE_ACTION_OUTPUT_FORMATS: () => FILE_ACTION_OUTPUT_FORMATS,
|
|
64
|
+
FILE_ACTION_SOURCES: () => FILE_ACTION_SOURCES,
|
|
65
|
+
FILE_EDIT_DESTINATIONS: () => FILE_EDIT_DESTINATIONS,
|
|
66
|
+
FILE_EDIT_MATCH_OPS: () => FILE_EDIT_MATCH_OPS,
|
|
67
|
+
FILE_EDIT_OPERATIONS: () => FILE_EDIT_OPERATIONS,
|
|
68
|
+
FILE_EDIT_SCHEMA: () => FILE_EDIT_SCHEMA,
|
|
69
|
+
FILE_EDIT_SOURCES: () => FILE_EDIT_SOURCES,
|
|
70
|
+
FILE_FORMAT_OPERATIONS: () => FILE_FORMAT_OPERATIONS,
|
|
71
|
+
FTP_OPERATIONS: () => FTP_OPERATIONS,
|
|
53
72
|
FieldType: () => FieldType,
|
|
73
|
+
FileActionConfig: () => FileActionConfig,
|
|
54
74
|
ForEachConfig: () => ForEachConfig,
|
|
75
|
+
FtpActionConfig: () => FtpActionConfig,
|
|
76
|
+
GOOGLE_DRIVE_OPERATIONS: () => GOOGLE_DRIVE_OPERATIONS,
|
|
77
|
+
GoogleDriveActionConfig: () => GoogleDriveActionConfig,
|
|
78
|
+
GroupConfig: () => GroupConfig,
|
|
79
|
+
IDP_EXTRACT_STRATEGIES: () => IDP_EXTRACT_STRATEGIES,
|
|
80
|
+
IdpExtractConfig: () => IdpExtractConfig,
|
|
55
81
|
JoinType: () => JoinType,
|
|
82
|
+
JsonActionConfig: () => JsonActionConfig,
|
|
56
83
|
LogicalOperator: () => LogicalOperator,
|
|
57
84
|
MAPPING_FUNCTIONS: () => MAPPING_FUNCTIONS,
|
|
58
85
|
MAPPING_FUNCTION_SPECS: () => MAPPING_FUNCTION_SPECS,
|
|
59
86
|
MAX_STEP_CONFIG_BYTES: () => MAX_STEP_CONFIG_BYTES,
|
|
60
87
|
ManualTriggerConfig: () => ManualTriggerConfig,
|
|
61
88
|
NodeStatus: () => NodeStatus,
|
|
89
|
+
ONEDRIVE_OPERATIONS: () => ONEDRIVE_OPERATIONS,
|
|
90
|
+
OneDriveActionConfig: () => OneDriveActionConfig,
|
|
62
91
|
QueryMode: () => QueryMode,
|
|
63
92
|
QueryType: () => QueryType,
|
|
93
|
+
S3ActionConfig: () => S3ActionConfig,
|
|
94
|
+
S3_OPERATIONS: () => S3_OPERATIONS,
|
|
64
95
|
STORAGE_CONNECTOR_IDS: () => STORAGE_CONNECTOR_IDS,
|
|
65
96
|
SortDirection: () => SortDirection,
|
|
97
|
+
StorageActionConfig: () => StorageActionConfig,
|
|
66
98
|
TRANSFORM_OPERATIONS: () => TRANSFORM_OPERATIONS,
|
|
67
99
|
TransformConfig: () => TransformConfig,
|
|
68
100
|
USER_FUNCTION_PREFIX: () => USER_FUNCTION_PREFIX,
|
|
69
101
|
VariablesConfig: () => VariablesConfig,
|
|
102
|
+
XmlActionConfig: () => XmlActionConfig,
|
|
70
103
|
actionsRegistry: () => actionsRegistry,
|
|
71
104
|
buildPathOptions: () => buildPathOptions,
|
|
72
105
|
collectArrayPaths: () => collectArrayPaths,
|
|
@@ -79,6 +112,8 @@ __export(exports_src, {
|
|
|
79
112
|
contractVocabularyDrift: () => contractVocabularyDrift,
|
|
80
113
|
declaredKeys: () => declaredKeys,
|
|
81
114
|
emailDefinition: () => emailDefinition,
|
|
115
|
+
fileEditErrors: () => fileEditErrors,
|
|
116
|
+
fileFormatErrors: () => fileFormatErrors,
|
|
82
117
|
flattenNestedWorkflow: () => flattenNestedWorkflow,
|
|
83
118
|
generateConnectionsFromSteps: () => generateConnectionsFromSteps,
|
|
84
119
|
generateEdgeId: () => generateEdgeId,
|
|
@@ -89,20 +124,25 @@ __export(exports_src, {
|
|
|
89
124
|
getActionsByCategory: () => getActionsByCategory,
|
|
90
125
|
getAllActions: () => getAllActions,
|
|
91
126
|
getEdgeValidationStatus: () => getEdgeValidationStatus,
|
|
127
|
+
getEntitiesForConnector: () => getEntitiesForConnector,
|
|
92
128
|
getNodeConfigStatus: () => getNodeConfigStatus,
|
|
93
129
|
getNodeValidationStatus: () => getNodeValidationStatus,
|
|
94
130
|
getStorageProvider: () => getStorageProvider,
|
|
95
131
|
inferSchemaFromSample: () => inferSchemaFromSample,
|
|
96
132
|
isEditorPrivateKey: () => isEditorPrivateKey,
|
|
133
|
+
isEventCapableConnector: () => isEventCapableConnector,
|
|
97
134
|
isMappingFunction: () => isMappingFunction,
|
|
98
135
|
isQueryableConnector: () => isQueryableConnector,
|
|
99
136
|
mappingTransformFunctionName: () => mappingTransformFunctionName,
|
|
100
137
|
migrateDelayConfig: () => migrateDelayConfig,
|
|
101
138
|
queryDefinition: () => queryDefinition,
|
|
102
139
|
storageConfigKeys: () => storageConfigKeys,
|
|
140
|
+
storageOperations: () => storageOperations,
|
|
141
|
+
summarizeConnectorTriggerEvents: () => summarizeConnectorTriggerEvents,
|
|
103
142
|
transformConnectionToEdge: () => transformConnectionToEdge,
|
|
104
143
|
transformFlowToWorkflow: () => transformFlowToWorkflow,
|
|
105
144
|
transformStepToNode: () => transformStepToNode,
|
|
145
|
+
validateConnectorTriggerEvents: () => validateConnectorTriggerEvents,
|
|
106
146
|
validateEdge: () => validateEdge,
|
|
107
147
|
validateFlowData: () => validateFlowData,
|
|
108
148
|
validateNode: () => validateNode,
|
|
@@ -555,7 +595,7 @@ var connectorTriggerDefinition = {
|
|
|
555
595
|
key: "events",
|
|
556
596
|
label: "Events",
|
|
557
597
|
type: "json" /* JSON */,
|
|
558
|
-
description:
|
|
598
|
+
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.",
|
|
559
599
|
validation: { required: true }
|
|
560
600
|
}
|
|
561
601
|
]
|
|
@@ -1704,7 +1744,7 @@ var csvActionDefinition = {
|
|
|
1704
1744
|
color: "#198038",
|
|
1705
1745
|
inputSchema: {
|
|
1706
1746
|
fields: [
|
|
1707
|
-
{ 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 } },
|
|
1747
|
+
{ 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 } },
|
|
1708
1748
|
{ key: "content", label: "CSV Content", type: "string" /* String */, description: "Paste CSV content or use FX token from upstream step" },
|
|
1709
1749
|
{ key: "delimiter", label: "Delimiter", type: "select" /* Select */, options: [{ label: "Comma (,)", value: "," }, { label: "Semicolon (;)", value: ";" }, { label: "Tab", value: "\t" }, { label: "Pipe (|)", value: "|" }], defaultValue: "," },
|
|
1710
1750
|
{ key: "headerRow", label: "Header Row", type: "number" /* Number */, description: "Row number containing column headers (default: 1)", defaultValue: 1 },
|
|
@@ -1743,7 +1783,7 @@ var jsonActionDefinition = {
|
|
|
1743
1783
|
color: "#f1c21b",
|
|
1744
1784
|
inputSchema: {
|
|
1745
1785
|
fields: [
|
|
1746
|
-
{ 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 } },
|
|
1786
|
+
{ 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 } },
|
|
1747
1787
|
{ key: "format", label: "Format", type: "select" /* Select */, options: [{ label: "JSON (array)", value: "json" }, { label: "JSONL (one object per line)", value: "jsonl" }], defaultValue: "json" },
|
|
1748
1788
|
{ key: "content", label: "JSON Content", type: "string" /* String */, description: "Paste JSON content or use FX token from upstream step" },
|
|
1749
1789
|
{ key: "prettyPrint", label: "Pretty Print", type: "boolean" /* Boolean */, description: "Format output with indentation", defaultValue: true },
|
|
@@ -1780,7 +1820,7 @@ var xmlActionDefinition = {
|
|
|
1780
1820
|
color: "#e65100",
|
|
1781
1821
|
inputSchema: {
|
|
1782
1822
|
fields: [
|
|
1783
|
-
{ 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 } },
|
|
1823
|
+
{ 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 } },
|
|
1784
1824
|
{ key: "content", label: "XML Content", type: "string" /* String */, description: "Paste XML or use FX token" },
|
|
1785
1825
|
{ key: "rootElement", label: "Root Element", type: "string" /* String */, description: "Root XML element name (for generate)", defaultValue: "data" },
|
|
1786
1826
|
{ key: "rowElement", label: "Row Element", type: "string" /* String */, description: "Element name per record (for generate)", defaultValue: "row" },
|
|
@@ -1817,7 +1857,7 @@ var excelActionDefinition = {
|
|
|
1817
1857
|
color: "#217346",
|
|
1818
1858
|
inputSchema: {
|
|
1819
1859
|
fields: [
|
|
1820
|
-
{ 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 } },
|
|
1860
|
+
{ 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 } },
|
|
1821
1861
|
{ key: "content", label: "Excel File", type: "string" /* String */, description: "S3 key of uploaded Excel file or FX token from upstream" },
|
|
1822
1862
|
{ key: "sheetName", label: "Sheet Name", type: "string" /* String */, description: "Name of sheet to read (default: first sheet)" },
|
|
1823
1863
|
{ key: "headerRow", label: "Header Row", type: "number" /* Number */, description: "Row number containing headers", defaultValue: 1 },
|
|
@@ -1855,6 +1895,7 @@ var s3ActionDefinition = {
|
|
|
1855
1895
|
color: "#569A31",
|
|
1856
1896
|
inputSchema: {
|
|
1857
1897
|
fields: [
|
|
1898
|
+
{ key: "connector", label: "S3 Connection", type: "connection" /* Connection */, description: "Select a connected S3 account", validation: { required: true } },
|
|
1858
1899
|
{ 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 } },
|
|
1859
1900
|
{ key: "bucket", label: "Bucket Name", type: "string" /* String */, description: "S3 bucket name (defaults to the connector’s bucket)" },
|
|
1860
1901
|
{ key: "key", label: "Object Key (Path)", type: "string" /* String */, description: "S3 object key, e.g. data/reports/monthly.csv" },
|
|
@@ -2073,7 +2114,8 @@ var storageActionDefinition = {
|
|
|
2073
2114
|
{ label: "Get signed URL", value: "presign" },
|
|
2074
2115
|
{ label: "Share", value: "share" },
|
|
2075
2116
|
{ label: "Create folder", value: "create_folder" },
|
|
2076
|
-
{ label: "Transfer to another connector", value: "transfer" }
|
|
2117
|
+
{ label: "Transfer to another connector", value: "transfer" },
|
|
2118
|
+
{ label: "Sync folder to another connector", value: "sync" }
|
|
2077
2119
|
],
|
|
2078
2120
|
defaultValue: "download",
|
|
2079
2121
|
validation: { required: true }
|
|
@@ -3974,6 +4016,672 @@ function storageConfigKeys() {
|
|
|
3974
4016
|
}
|
|
3975
4017
|
return [...keys];
|
|
3976
4018
|
}
|
|
4019
|
+
// src/catalog/ai/ai-agent/config.ts
|
|
4020
|
+
var AiAgentConfig = {
|
|
4021
|
+
defaults: {
|
|
4022
|
+
agentId: ""
|
|
4023
|
+
},
|
|
4024
|
+
schema: {
|
|
4025
|
+
agentId: { type: "string", required: true, description: "Public id of a saved agent (agt_…)" },
|
|
4026
|
+
input: { type: "text", required: false, description: "The prompt; may reference upstream data with {{ods://…}} tokens. Empty uses the first upstream output." },
|
|
4027
|
+
overrides: { type: "object", required: false, description: "Per-step overrides: model, temperature, topP, maxTokens, reasoningEffort, verbosity, batchSize, instructions, instructionsMode, expectedSchema" }
|
|
4028
|
+
},
|
|
4029
|
+
validate: (config) => {
|
|
4030
|
+
const errors = [];
|
|
4031
|
+
if (!config.agentId || typeof config.agentId !== "string")
|
|
4032
|
+
errors.push("Select an agent");
|
|
4033
|
+
if (config.overrides !== undefined && (typeof config.overrides !== "object" || config.overrides === null || Array.isArray(config.overrides))) {
|
|
4034
|
+
errors.push("overrides must be an object");
|
|
4035
|
+
}
|
|
4036
|
+
return { valid: errors.length === 0, errors };
|
|
4037
|
+
},
|
|
4038
|
+
merge: (userConfig) => ({ ...AiAgentConfig.defaults, ...userConfig }),
|
|
4039
|
+
getLabel: (config) => config.agentId ? `Agent ${config.agentId}` : "AI Agent"
|
|
4040
|
+
};
|
|
4041
|
+
// src/catalog/ai/idp-extract/config.ts
|
|
4042
|
+
var IDP_EXTRACT_STRATEGIES = ["vision-direct", "auto"];
|
|
4043
|
+
var IdpExtractConfig = {
|
|
4044
|
+
defaults: {
|
|
4045
|
+
llmConnectorId: "",
|
|
4046
|
+
model: "",
|
|
4047
|
+
strategy: "vision-direct"
|
|
4048
|
+
},
|
|
4049
|
+
schema: {
|
|
4050
|
+
llmConnectorId: { type: "connection", required: true, description: "AI connector instance (its key and model run the extraction)" },
|
|
4051
|
+
model: { type: "string", required: true, description: "Model id offered by the connector" },
|
|
4052
|
+
expectedSchema: { type: "json", required: false, description: "JSON Schema of the fields to extract; empty extracts every field" },
|
|
4053
|
+
systemPromptOverride: { type: "text", required: false },
|
|
4054
|
+
strategy: { type: "select", required: false, options: IDP_EXTRACT_STRATEGIES }
|
|
4055
|
+
},
|
|
4056
|
+
validate: (config) => {
|
|
4057
|
+
const errors = [];
|
|
4058
|
+
if (!config.llmConnectorId)
|
|
4059
|
+
errors.push("Select an AI connection");
|
|
4060
|
+
if (!config.model)
|
|
4061
|
+
errors.push("Select a model");
|
|
4062
|
+
if (typeof config.expectedSchema === "string" && config.expectedSchema.trim() !== "") {
|
|
4063
|
+
try {
|
|
4064
|
+
JSON.parse(config.expectedSchema);
|
|
4065
|
+
} catch {
|
|
4066
|
+
errors.push("expectedSchema is not valid JSON");
|
|
4067
|
+
}
|
|
4068
|
+
}
|
|
4069
|
+
return { valid: errors.length === 0, errors };
|
|
4070
|
+
},
|
|
4071
|
+
merge: (userConfig) => ({ ...IdpExtractConfig.defaults, ...userConfig }),
|
|
4072
|
+
getLabel: (config) => config.model ? `IDP: ${config.model}` : "IDP Extract"
|
|
4073
|
+
};
|
|
4074
|
+
// src/catalog/logic/group/config.ts
|
|
4075
|
+
var GroupConfig = {
|
|
4076
|
+
defaults: {},
|
|
4077
|
+
schema: {},
|
|
4078
|
+
validate: (_config) => ({ valid: true, errors: [] }),
|
|
4079
|
+
merge: (_userConfig) => ({}),
|
|
4080
|
+
getLabel: () => "Group"
|
|
4081
|
+
};
|
|
4082
|
+
// src/catalog/triggers/connector-trigger/events.ts
|
|
4083
|
+
var EVENT_CAPABLE_CONNECTOR_IDS = new Set([
|
|
4084
|
+
"quickbooks_online",
|
|
4085
|
+
"shopify",
|
|
4086
|
+
"hubspot",
|
|
4087
|
+
"salesforce",
|
|
4088
|
+
"google_sheets",
|
|
4089
|
+
"whatsapp"
|
|
4090
|
+
]);
|
|
4091
|
+
var QBO_ENTITIES = [
|
|
4092
|
+
{ entity: "Invoice", supportedOperations: ["Create", "Update", "Delete", "Void", "Emailed"] },
|
|
4093
|
+
{ entity: "Customer", supportedOperations: ["Create", "Update", "Delete", "Merge"] },
|
|
4094
|
+
{ entity: "Payment", supportedOperations: ["Create", "Update", "Delete", "Void"] },
|
|
4095
|
+
{ entity: "Bill", supportedOperations: ["Create", "Update", "Delete", "Void"] },
|
|
4096
|
+
{ entity: "Estimate", supportedOperations: ["Create", "Update", "Delete"] },
|
|
4097
|
+
{ entity: "SalesReceipt", supportedOperations: ["Create", "Update", "Delete", "Void", "Emailed"] },
|
|
4098
|
+
{ entity: "CreditMemo", supportedOperations: ["Create", "Update", "Delete", "Void", "Emailed"] },
|
|
4099
|
+
{ entity: "Vendor", supportedOperations: ["Create", "Update", "Delete", "Merge"] },
|
|
4100
|
+
{ entity: "Item", supportedOperations: ["Create", "Update", "Delete"] },
|
|
4101
|
+
{ entity: "Account", supportedOperations: ["Create", "Update", "Delete", "Merge"] },
|
|
4102
|
+
{ entity: "JournalEntry", supportedOperations: ["Create", "Update", "Delete", "Void"] },
|
|
4103
|
+
{ entity: "PurchaseOrder", supportedOperations: ["Create", "Update", "Delete"] }
|
|
4104
|
+
];
|
|
4105
|
+
var SALESFORCE_ENTITIES = [
|
|
4106
|
+
{ entity: "Lead", supportedOperations: ["Create", "Update", "Delete", "Undelete"] },
|
|
4107
|
+
{ entity: "Account", supportedOperations: ["Create", "Update", "Delete", "Undelete"] },
|
|
4108
|
+
{ entity: "Contact", supportedOperations: ["Create", "Update", "Delete", "Undelete"] },
|
|
4109
|
+
{ entity: "Opportunity", supportedOperations: ["Create", "Update", "Delete", "Undelete"] },
|
|
4110
|
+
{ entity: "Case", supportedOperations: ["Create", "Update", "Delete", "Undelete"] }
|
|
4111
|
+
];
|
|
4112
|
+
var HUBSPOT_ENTITIES = [
|
|
4113
|
+
{ entity: "contact", supportedOperations: ["Create", "Update", "Delete", "Merge", "Restore", "AssociationChange"] },
|
|
4114
|
+
{ entity: "company", supportedOperations: ["Create", "Update", "Delete", "Merge", "Restore", "AssociationChange"] },
|
|
4115
|
+
{ entity: "deal", supportedOperations: ["Create", "Update", "Delete", "Merge", "Restore", "AssociationChange"] },
|
|
4116
|
+
{ entity: "ticket", supportedOperations: ["Create", "Update", "Delete", "Merge", "Restore", "AssociationChange"] },
|
|
4117
|
+
{ entity: "product", supportedOperations: ["Create", "Update", "Delete", "Restore"] },
|
|
4118
|
+
{ entity: "line_item", supportedOperations: ["Create", "Update", "Delete", "Restore"] },
|
|
4119
|
+
{ entity: "lead", supportedOperations: ["Create", "Update", "Delete", "Restore"] },
|
|
4120
|
+
{ entity: "quote", supportedOperations: ["Create", "Update", "Delete", "Restore"] },
|
|
4121
|
+
{ entity: "call", supportedOperations: ["Create", "Update", "Delete"] },
|
|
4122
|
+
{ entity: "email", supportedOperations: ["Create", "Update", "Delete"] },
|
|
4123
|
+
{ entity: "meeting_event", supportedOperations: ["Create", "Update", "Delete"] },
|
|
4124
|
+
{ entity: "task", supportedOperations: ["Create", "Update", "Delete"] },
|
|
4125
|
+
{ entity: "note", supportedOperations: ["Create", "Update", "Delete"] },
|
|
4126
|
+
{ entity: "order", supportedOperations: ["Create", "Update", "Delete"] },
|
|
4127
|
+
{ entity: "cart", supportedOperations: ["Create", "Update", "Delete"] },
|
|
4128
|
+
{ entity: "invoice", supportedOperations: ["Create", "Update", "Delete"] }
|
|
4129
|
+
];
|
|
4130
|
+
var SHOPIFY_ENTITIES = [
|
|
4131
|
+
{ entity: "Order", supportedOperations: ["Create", "Update", "Paid", "Fulfilled", "Cancelled"] },
|
|
4132
|
+
{ entity: "Product", supportedOperations: ["Create", "Update"] },
|
|
4133
|
+
{ entity: "Customer", supportedOperations: ["Create", "Update"] }
|
|
4134
|
+
];
|
|
4135
|
+
var GOOGLE_SHEETS_ENTITIES = [
|
|
4136
|
+
{ entity: "Row", supportedOperations: ["Create", "Update", "Delete"] },
|
|
4137
|
+
{ entity: "Sheet", supportedOperations: ["Create", "Update"] }
|
|
4138
|
+
];
|
|
4139
|
+
var WHATSAPP_ENTITIES = [
|
|
4140
|
+
{ entity: "Message", supportedOperations: ["Received"] }
|
|
4141
|
+
];
|
|
4142
|
+
var CONNECTOR_EVENT_ENTITIES = {
|
|
4143
|
+
quickbooks_online: QBO_ENTITIES,
|
|
4144
|
+
salesforce: SALESFORCE_ENTITIES,
|
|
4145
|
+
hubspot: HUBSPOT_ENTITIES,
|
|
4146
|
+
shopify: SHOPIFY_ENTITIES,
|
|
4147
|
+
google_sheets: GOOGLE_SHEETS_ENTITIES,
|
|
4148
|
+
whatsapp: WHATSAPP_ENTITIES
|
|
4149
|
+
};
|
|
4150
|
+
function getEntitiesForConnector(connectorId) {
|
|
4151
|
+
return CONNECTOR_EVENT_ENTITIES[connectorId] ?? [];
|
|
4152
|
+
}
|
|
4153
|
+
function isEventCapableConnector(connectorId) {
|
|
4154
|
+
return EVENT_CAPABLE_CONNECTOR_IDS.has(connectorId) && getEntitiesForConnector(connectorId).length > 0;
|
|
4155
|
+
}
|
|
4156
|
+
function summarizeConnectorTriggerEvents(connectorName, events) {
|
|
4157
|
+
const eventCount = events.reduce((acc, ev) => acc + ev.operations.length, 0);
|
|
4158
|
+
if (eventCount === 0)
|
|
4159
|
+
return connectorName;
|
|
4160
|
+
const noun = eventCount === 1 ? "event" : "events";
|
|
4161
|
+
return `${connectorName} · ${eventCount} ${noun}`;
|
|
4162
|
+
}
|
|
4163
|
+
function validateConnectorTriggerEvents(connectorId, events) {
|
|
4164
|
+
const entities = getEntitiesForConnector(connectorId);
|
|
4165
|
+
if (!isEventCapableConnector(connectorId)) {
|
|
4166
|
+
return `"${connectorId}" does not emit events a trigger can subscribe to. ` + `Event-capable connectors: ${[...EVENT_CAPABLE_CONNECTOR_IDS].join(", ")}.`;
|
|
4167
|
+
}
|
|
4168
|
+
if (!Array.isArray(events) || events.length === 0) {
|
|
4169
|
+
return 'events must be a non-empty array of { "entity": string, "operations": string[] }.';
|
|
4170
|
+
}
|
|
4171
|
+
const seen = new Set;
|
|
4172
|
+
for (const ev of events) {
|
|
4173
|
+
const entity = ev?.entity;
|
|
4174
|
+
const operations = ev?.operations;
|
|
4175
|
+
if (typeof entity !== "string" || !entity) {
|
|
4176
|
+
return 'Each event needs an "entity" (string).';
|
|
4177
|
+
}
|
|
4178
|
+
const known = entities.find((e) => e.entity === entity);
|
|
4179
|
+
if (!known) {
|
|
4180
|
+
const caseHit = entities.find((e) => e.entity.toLowerCase() === entity.toLowerCase());
|
|
4181
|
+
const hint = caseHit ? ` Did you mean "${caseHit.entity}"? Names are case-sensitive.` : "";
|
|
4182
|
+
return `Unknown entity "${entity}" for ${connectorId}.${hint} Entities: ${entities.map((e) => e.entity).join(", ")}.`;
|
|
4183
|
+
}
|
|
4184
|
+
if (seen.has(entity))
|
|
4185
|
+
return `Entity "${entity}" is listed twice — give it one entry with all its operations.`;
|
|
4186
|
+
seen.add(entity);
|
|
4187
|
+
if (!Array.isArray(operations) || operations.length === 0) {
|
|
4188
|
+
return `Event "${entity}" needs a non-empty "operations" array. Operations: ${known.supportedOperations.join(", ")}.`;
|
|
4189
|
+
}
|
|
4190
|
+
for (const op of operations) {
|
|
4191
|
+
if (typeof op !== "string" || !known.supportedOperations.includes(op)) {
|
|
4192
|
+
const caseHit = typeof op === "string" ? known.supportedOperations.find((o) => o.toLowerCase() === op.toLowerCase()) : undefined;
|
|
4193
|
+
const hint = caseHit ? ` Did you mean "${caseHit}"?` : "";
|
|
4194
|
+
return `Unknown operation "${String(op)}" for ${connectorId} ${entity}.${hint} Operations: ${known.supportedOperations.join(", ")}.`;
|
|
4195
|
+
}
|
|
4196
|
+
}
|
|
4197
|
+
}
|
|
4198
|
+
return null;
|
|
4199
|
+
}
|
|
4200
|
+
|
|
4201
|
+
// src/catalog/triggers/connector-trigger/config.ts
|
|
4202
|
+
var ConnectorTriggerConfig = {
|
|
4203
|
+
defaults: {
|
|
4204
|
+
connectorInstanceId: ""
|
|
4205
|
+
},
|
|
4206
|
+
schema: {
|
|
4207
|
+
connectorInstanceId: { type: "connection", required: true, description: "The connected app instance that emits the events" },
|
|
4208
|
+
events: { type: "array", required: true, description: "[{ entity, operations }] — exact names from the connector vocabulary; registers the trigger" },
|
|
4209
|
+
connectorId: { type: "string", required: false, description: "Connector type of the instance (hubspot, google_sheets, …)" },
|
|
4210
|
+
connectorName: { type: "string", required: false, description: "Display name of the instance" },
|
|
4211
|
+
subscribed: { type: "boolean", required: false, description: "Registration snapshot" },
|
|
4212
|
+
eventCount: { type: "number", required: false, description: "Registration snapshot" },
|
|
4213
|
+
summary: { type: "string", required: false, description: "Registration snapshot shown on the canvas" },
|
|
4214
|
+
sheetFileId: { type: "string", required: false, description: "Google Sheets: spreadsheet id" },
|
|
4215
|
+
sheetFileLabel: { type: "string", required: false, description: "Google Sheets: spreadsheet name" },
|
|
4216
|
+
sheetName: { type: "string", required: false, description: "Google Sheets: tab name" },
|
|
4217
|
+
sheetKeyColumn: { type: "string", required: false, description: "Google Sheets: row key column" },
|
|
4218
|
+
description: { type: "string", required: false, description: "Added to the trigger output when set" }
|
|
4219
|
+
},
|
|
4220
|
+
validate: (config) => {
|
|
4221
|
+
const errors = [];
|
|
4222
|
+
if (!config.connectorInstanceId)
|
|
4223
|
+
errors.push("Select a connected app");
|
|
4224
|
+
if (config.events !== undefined && !Array.isArray(config.events)) {
|
|
4225
|
+
errors.push("events must be an array of { entity, operations }");
|
|
4226
|
+
} else if (config.connectorId && Array.isArray(config.events) && config.events.length > 0) {
|
|
4227
|
+
const why = validateConnectorTriggerEvents(config.connectorId, config.events);
|
|
4228
|
+
if (why)
|
|
4229
|
+
errors.push(why);
|
|
4230
|
+
}
|
|
4231
|
+
if (config.connectorId === "google_sheets") {
|
|
4232
|
+
if (!config.sheetFileId)
|
|
4233
|
+
errors.push("Select a spreadsheet");
|
|
4234
|
+
if (!config.sheetName)
|
|
4235
|
+
errors.push("Select a sheet");
|
|
4236
|
+
}
|
|
4237
|
+
return { valid: errors.length === 0, errors };
|
|
4238
|
+
},
|
|
4239
|
+
merge: (userConfig) => ({ ...ConnectorTriggerConfig.defaults, ...userConfig }),
|
|
4240
|
+
getLabel: (config) => config.summary || config.connectorName || "Connector Trigger"
|
|
4241
|
+
};
|
|
4242
|
+
// src/catalog/storage/fileEditContract.ts
|
|
4243
|
+
var FILE_FORMAT_OPERATIONS = ["parse", "generate", "edit"];
|
|
4244
|
+
var FILE_EDIT_OPERATIONS = ["append", "update", "upsert", "set_fields"];
|
|
4245
|
+
var FILE_EDIT_MATCH_OPS = ["=", "!=", ">", "<", ">=", "<=", "contains"];
|
|
4246
|
+
var FILE_EDIT_DESTINATIONS = ["new", "in_place"];
|
|
4247
|
+
var FILE_EDIT_SOURCES = ["inline", "s3", "url"];
|
|
4248
|
+
var FILE_EDIT_SCHEMA = {
|
|
4249
|
+
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" },
|
|
4250
|
+
keyField: { type: "string", required: false, description: "Match key column for update / upsert" },
|
|
4251
|
+
mergeUpdate: { type: "boolean", required: false, description: "false replaces the whole matched row; default merges" },
|
|
4252
|
+
matchField: { type: "string", required: false, description: "set_fields: column the row filter reads" },
|
|
4253
|
+
matchOp: { type: "select", required: false, options: FILE_EDIT_MATCH_OPS, description: 'set_fields: comparison; "=" by default' },
|
|
4254
|
+
matchValue: { type: "string", required: false, description: "set_fields: value compared against" },
|
|
4255
|
+
setFields: { type: "object", required: false, description: "set_fields: { column: newValue } applied to matching rows" },
|
|
4256
|
+
destination: { type: "select", required: false, options: FILE_EDIT_DESTINATIONS, description: '"new" writes an edited copy (default); "in_place" overwrites an S3 source' },
|
|
4257
|
+
outputFileName: { type: "string", required: false, description: 'Name of the edited copy when destination is "new"' },
|
|
4258
|
+
source: { type: "select", required: false, options: FILE_EDIT_SOURCES, description: "Where the file to edit comes from; inferred from content when absent" },
|
|
4259
|
+
s3Key: { type: "string", required: false, description: 'source "s3": platform-bucket key of the file to edit' },
|
|
4260
|
+
url: { type: "url", required: false, description: 'source "url": the file to edit is fetched from here' }
|
|
4261
|
+
};
|
|
4262
|
+
function fileEditErrors(config) {
|
|
4263
|
+
const errors = [];
|
|
4264
|
+
if (config.operation !== "edit")
|
|
4265
|
+
return errors;
|
|
4266
|
+
const op = config.editOperation ?? "append";
|
|
4267
|
+
if (!FILE_EDIT_OPERATIONS.includes(op))
|
|
4268
|
+
errors.push(`Unknown edit operation "${op}"`);
|
|
4269
|
+
if ((op === "update" || op === "upsert") && !config.keyField)
|
|
4270
|
+
errors.push(`File edit "${op}" needs a Match key field`);
|
|
4271
|
+
return errors;
|
|
4272
|
+
}
|
|
4273
|
+
function fileFormatErrors(config) {
|
|
4274
|
+
const errors = [];
|
|
4275
|
+
if (config.operation !== undefined && config.operation !== "" && !FILE_FORMAT_OPERATIONS.includes(config.operation)) {
|
|
4276
|
+
errors.push(`Unknown operation "${config.operation}" — use parse, generate or edit`);
|
|
4277
|
+
}
|
|
4278
|
+
return [...errors, ...fileEditErrors(config)];
|
|
4279
|
+
}
|
|
4280
|
+
// src/catalog/storage/csv-action/config.ts
|
|
4281
|
+
var CsvActionConfig = {
|
|
4282
|
+
defaults: {
|
|
4283
|
+
operation: "parse",
|
|
4284
|
+
delimiter: ",",
|
|
4285
|
+
headerRow: 1,
|
|
4286
|
+
includeHeader: true,
|
|
4287
|
+
fileName: "export.csv"
|
|
4288
|
+
},
|
|
4289
|
+
schema: {
|
|
4290
|
+
operation: { type: "select", required: true, options: FILE_FORMAT_OPERATIONS, description: "parse (CSV → records), generate (records → CSV) or edit an existing file" },
|
|
4291
|
+
content: { type: "text", required: false, description: "CSV text, or an FX token from an upstream step" },
|
|
4292
|
+
delimiter: { type: "select", required: false, options: [",", ";", "\t", "|"] },
|
|
4293
|
+
headerRow: { type: "number", required: false, min: 1, description: "1-based row that holds the column headers" },
|
|
4294
|
+
encoding: { type: "string", required: false, description: "Text encoding (utf-8 by default)" },
|
|
4295
|
+
includeHeader: { type: "boolean", required: false, description: "generate: write the header row" },
|
|
4296
|
+
fileName: { type: "string", required: false, description: "generate: name of the produced file" },
|
|
4297
|
+
...FILE_EDIT_SCHEMA
|
|
4298
|
+
},
|
|
4299
|
+
validate: (config) => {
|
|
4300
|
+
const errors = fileFormatErrors(config);
|
|
4301
|
+
return { valid: errors.length === 0, errors };
|
|
4302
|
+
},
|
|
4303
|
+
merge: (userConfig) => ({ ...CsvActionConfig.defaults, ...userConfig }),
|
|
4304
|
+
getLabel: (config) => `CSV: ${config.operation || "parse"}`
|
|
4305
|
+
};
|
|
4306
|
+
// src/catalog/storage/json-action/config.ts
|
|
4307
|
+
var JsonActionConfig = {
|
|
4308
|
+
defaults: {
|
|
4309
|
+
operation: "parse",
|
|
4310
|
+
format: "json",
|
|
4311
|
+
prettyPrint: true,
|
|
4312
|
+
fileName: "export.json"
|
|
4313
|
+
},
|
|
4314
|
+
schema: {
|
|
4315
|
+
operation: { type: "select", required: true, options: FILE_FORMAT_OPERATIONS, description: "parse (JSON → records), generate (records → JSON) or edit an existing file" },
|
|
4316
|
+
format: { type: "select", required: false, options: ["json", "jsonl"], description: "json (array) or jsonl (one object per line)" },
|
|
4317
|
+
content: { type: "text", required: false, description: "JSON text, or an FX token from an upstream step" },
|
|
4318
|
+
prettyPrint: { type: "boolean", required: false, description: "generate: indent the output" },
|
|
4319
|
+
fileName: { type: "string", required: false, description: "generate: name of the produced file" },
|
|
4320
|
+
jsonl: { type: "boolean", required: false, description: "edit: treat the file as JSONL" },
|
|
4321
|
+
...FILE_EDIT_SCHEMA
|
|
4322
|
+
},
|
|
4323
|
+
validate: (config) => {
|
|
4324
|
+
const errors = fileFormatErrors(config);
|
|
4325
|
+
const format = config.format;
|
|
4326
|
+
if (format !== undefined && format !== "" && !["json", "jsonl"].includes(format)) {
|
|
4327
|
+
errors.push(`Unknown format "${format}" — use json or jsonl`);
|
|
4328
|
+
}
|
|
4329
|
+
return { valid: errors.length === 0, errors };
|
|
4330
|
+
},
|
|
4331
|
+
merge: (userConfig) => ({ ...JsonActionConfig.defaults, ...userConfig }),
|
|
4332
|
+
getLabel: (config) => `JSON: ${config.operation || "parse"}`
|
|
4333
|
+
};
|
|
4334
|
+
// src/catalog/storage/xml-action/config.ts
|
|
4335
|
+
var XmlActionConfig = {
|
|
4336
|
+
defaults: {
|
|
4337
|
+
operation: "parse",
|
|
4338
|
+
rootElement: "data",
|
|
4339
|
+
rowElement: "row",
|
|
4340
|
+
fileName: "export.xml"
|
|
4341
|
+
},
|
|
4342
|
+
schema: {
|
|
4343
|
+
operation: { type: "select", required: true, options: FILE_FORMAT_OPERATIONS, description: "parse (XML → records), generate (records → XML) or edit an existing file" },
|
|
4344
|
+
content: { type: "text", required: false, description: "XML text, or an FX token from an upstream step" },
|
|
4345
|
+
rootElement: { type: "string", required: false, description: "generate: root element name" },
|
|
4346
|
+
rowElement: { type: "string", required: false, description: "Element that holds one record" },
|
|
4347
|
+
fileName: { type: "string", required: false, description: "generate: name of the produced file" },
|
|
4348
|
+
...FILE_EDIT_SCHEMA
|
|
4349
|
+
},
|
|
4350
|
+
validate: (config) => {
|
|
4351
|
+
const errors = fileFormatErrors(config);
|
|
4352
|
+
return { valid: errors.length === 0, errors };
|
|
4353
|
+
},
|
|
4354
|
+
merge: (userConfig) => ({ ...XmlActionConfig.defaults, ...userConfig }),
|
|
4355
|
+
getLabel: (config) => `XML: ${config.operation || "parse"}`
|
|
4356
|
+
};
|
|
4357
|
+
// src/catalog/storage/excel-action/config.ts
|
|
4358
|
+
var ExcelActionConfig = {
|
|
4359
|
+
defaults: {
|
|
4360
|
+
operation: "parse",
|
|
4361
|
+
headerRow: 1,
|
|
4362
|
+
fileName: "export.xlsx"
|
|
4363
|
+
},
|
|
4364
|
+
schema: {
|
|
4365
|
+
operation: { type: "select", required: true, options: FILE_FORMAT_OPERATIONS, description: "parse (Excel → records), generate (records → Excel) or edit an existing file" },
|
|
4366
|
+
content: { type: "text", required: false, description: "Platform-bucket key of the workbook, base64 bytes, or an FX token from an upstream step" },
|
|
4367
|
+
sheetName: { type: "string", required: false, description: "Sheet to read; the first sheet when absent" },
|
|
4368
|
+
headerRow: { type: "number", required: false, min: 1, description: "1-based row that holds the column headers" },
|
|
4369
|
+
fileName: { type: "string", required: false, description: "generate: name of the produced file" },
|
|
4370
|
+
...FILE_EDIT_SCHEMA
|
|
4371
|
+
},
|
|
4372
|
+
validate: (config) => {
|
|
4373
|
+
const errors = fileFormatErrors(config);
|
|
4374
|
+
return { valid: errors.length === 0, errors };
|
|
4375
|
+
},
|
|
4376
|
+
merge: (userConfig) => ({ ...ExcelActionConfig.defaults, ...userConfig }),
|
|
4377
|
+
getLabel: (config) => `Excel: ${config.operation || "parse"}`
|
|
4378
|
+
};
|
|
4379
|
+
// src/catalog/storage/file-action/config.ts
|
|
4380
|
+
var FILE_ACTION_MODES = ["parse", "generate", "convert", "edit"];
|
|
4381
|
+
var FILE_ACTION_SOURCES = ["inline", "s3", "url", "previous_step", "upload"];
|
|
4382
|
+
var FILE_ACTION_FORMATS = ["auto", "csv", "tsv", "json", "jsonl", "xml", "excel"];
|
|
4383
|
+
var FILE_ACTION_OUTPUT_FORMATS = ["csv", "json", "excel", "xml", "tsv"];
|
|
4384
|
+
var FileActionConfig = {
|
|
4385
|
+
defaults: {
|
|
4386
|
+
mode: "parse",
|
|
4387
|
+
source: "inline",
|
|
4388
|
+
format: "auto"
|
|
4389
|
+
},
|
|
4390
|
+
schema: {
|
|
4391
|
+
...FILE_EDIT_SCHEMA,
|
|
4392
|
+
mode: { type: "select", required: true, options: FILE_ACTION_MODES, description: "parse, generate, convert or edit" },
|
|
4393
|
+
operation: { type: "select", required: false, options: FILE_ACTION_MODES, description: "Alias of mode; read first when both are set" },
|
|
4394
|
+
source: { type: "select", required: false, options: FILE_ACTION_SOURCES, description: "Where the file comes from (inline by default)" },
|
|
4395
|
+
format: { type: "select", required: false, options: FILE_ACTION_FORMATS, description: "File format; auto-detected from the name, then the content" },
|
|
4396
|
+
inlineContent: { type: "text", required: false, description: 'source "inline": the text (base64 for Excel)' },
|
|
4397
|
+
content: { type: "text", required: false, description: "Alias of inlineContent" },
|
|
4398
|
+
outputFormat: { type: "select", required: false, options: FILE_ACTION_OUTPUT_FORMATS, description: "generate / convert: format to write" },
|
|
4399
|
+
outputFileName: { type: "string", required: false, description: "generate / convert: name of the produced file" },
|
|
4400
|
+
fileName: { type: "string", required: false, description: "Name used to detect the format" },
|
|
4401
|
+
encoding: { type: "string", required: false },
|
|
4402
|
+
delimiter: { type: "string", required: false, description: "CSV / TSV delimiter" },
|
|
4403
|
+
headerRow: { type: "number", required: false, min: 1 },
|
|
4404
|
+
rowElement: { type: "string", required: false, description: "XML element that holds one record" },
|
|
4405
|
+
sheetName: { type: "string", required: false, description: "Excel sheet to read" },
|
|
4406
|
+
includeHeader: { type: "boolean", required: false },
|
|
4407
|
+
options: { type: "json", required: false, description: "Parser options read ahead of the top-level keys" }
|
|
4408
|
+
},
|
|
4409
|
+
validate: (config) => {
|
|
4410
|
+
const errors = [];
|
|
4411
|
+
const mode = config.operation || config.mode;
|
|
4412
|
+
if (mode !== undefined && mode !== "" && !FILE_ACTION_MODES.includes(mode)) {
|
|
4413
|
+
errors.push(`Unknown mode "${mode}" — use parse, generate, convert or edit`);
|
|
4414
|
+
}
|
|
4415
|
+
if (config.source === "upload")
|
|
4416
|
+
errors.push('source "upload" is not supported at run time');
|
|
4417
|
+
errors.push(...fileEditErrors({ ...config, operation: mode, source: undefined }));
|
|
4418
|
+
return { valid: errors.length === 0, errors };
|
|
4419
|
+
},
|
|
4420
|
+
merge: (userConfig) => ({ ...FileActionConfig.defaults, ...userConfig }),
|
|
4421
|
+
getLabel: (config) => `File: ${config.operation || config.mode || "parse"}`
|
|
4422
|
+
};
|
|
4423
|
+
// src/catalog/storage/storage-action/config.ts
|
|
4424
|
+
var FIXED_SCHEMA = {
|
|
4425
|
+
connector: { type: "connection", required: true, description: "Storage connector instance; its provider decides the operations" },
|
|
4426
|
+
operation: { type: "select", required: true, description: "Per provider: list, download, upload, delete, copy, move, presign, share, create_folder, transfer, sync" },
|
|
4427
|
+
outputAs: { type: "string", required: false, description: "Name of this step's output in the run's data bag" },
|
|
4428
|
+
content: { type: "text", required: false, description: "upload: the body" },
|
|
4429
|
+
destConnector: { type: "connection", required: false, description: "transfer / sync: destination connector instance" },
|
|
4430
|
+
destPath: { type: "string", required: false, description: "transfer / sync: destination path; also move / copy destination on path-based providers" },
|
|
4431
|
+
sourceIsDirectory: { type: "boolean", required: false, description: "transfer: copy a folder recursively" },
|
|
4432
|
+
cursor: { type: "json", required: false, description: "sync: walk cursor threaded by a cursor ForEach ({{$item.cursor}})" },
|
|
4433
|
+
fileBudget: { type: "number", required: false, min: 1, description: "sync: files per pass" },
|
|
4434
|
+
timeBudgetMs: { type: "number", required: false, min: 1, description: "sync: milliseconds per pass" },
|
|
4435
|
+
fileTypes: { type: "array", required: false, description: "list: keep only these extensions" },
|
|
4436
|
+
filePattern: { type: "string", required: false, description: "list: keep only names matching this glob" },
|
|
4437
|
+
bucket: { type: "string", required: false, description: "S3 / GCS: overrides the connector's bucket" },
|
|
4438
|
+
container: { type: "string", required: false, description: "Azure: overrides the connector's container" },
|
|
4439
|
+
region: { type: "string", required: false, description: "S3: overrides the connector's region" }
|
|
4440
|
+
};
|
|
4441
|
+
var EXTRA_TYPE = {
|
|
4442
|
+
string: "string",
|
|
4443
|
+
number: "number",
|
|
4444
|
+
select: "select",
|
|
4445
|
+
boolean: "boolean"
|
|
4446
|
+
};
|
|
4447
|
+
function extraField(f) {
|
|
4448
|
+
const field = { type: EXTRA_TYPE[f.type] ?? "string", required: false };
|
|
4449
|
+
if (f.type === "select" && f.options)
|
|
4450
|
+
field.options = f.options.map((o) => o.value);
|
|
4451
|
+
if (f.label)
|
|
4452
|
+
field.description = f.label;
|
|
4453
|
+
return field;
|
|
4454
|
+
}
|
|
4455
|
+
function storageOperations() {
|
|
4456
|
+
const seen = new Set;
|
|
4457
|
+
for (const provider of Object.values(STORAGE_PROVIDERS)) {
|
|
4458
|
+
for (const op of provider.operations)
|
|
4459
|
+
seen.add(op.value);
|
|
4460
|
+
}
|
|
4461
|
+
return [...seen];
|
|
4462
|
+
}
|
|
4463
|
+
function buildSchema() {
|
|
4464
|
+
const schema = { ...FIXED_SCHEMA };
|
|
4465
|
+
schema.operation = { ...schema.operation, options: storageOperations() };
|
|
4466
|
+
const pathKey = (key, label) => {
|
|
4467
|
+
if (!schema[key])
|
|
4468
|
+
schema[key] = { type: "string", required: false, description: label };
|
|
4469
|
+
const name = `${key}Name`;
|
|
4470
|
+
if (!schema[name])
|
|
4471
|
+
schema[name] = { type: "string", required: false, description: `Display name of the item picked for ${key}` };
|
|
4472
|
+
};
|
|
4473
|
+
for (const provider of Object.values(STORAGE_PROVIDERS)) {
|
|
4474
|
+
for (const op of provider.operations) {
|
|
4475
|
+
if (op.path)
|
|
4476
|
+
pathKey(op.path.key, op.path.label);
|
|
4477
|
+
if (op.dest)
|
|
4478
|
+
pathKey(op.dest.key, op.dest.label);
|
|
4479
|
+
for (const f of op.fields ?? []) {
|
|
4480
|
+
if (!schema[f.key])
|
|
4481
|
+
schema[f.key] = extraField(f);
|
|
4482
|
+
}
|
|
4483
|
+
}
|
|
4484
|
+
}
|
|
4485
|
+
return schema;
|
|
4486
|
+
}
|
|
4487
|
+
var StorageActionConfig = {
|
|
4488
|
+
defaults: {
|
|
4489
|
+
connector: "",
|
|
4490
|
+
operation: "download"
|
|
4491
|
+
},
|
|
4492
|
+
schema: buildSchema(),
|
|
4493
|
+
validate: (config) => {
|
|
4494
|
+
const errors = [];
|
|
4495
|
+
if (!config.connector)
|
|
4496
|
+
errors.push("Select a storage connector");
|
|
4497
|
+
if (!config.operation)
|
|
4498
|
+
errors.push("Select an operation");
|
|
4499
|
+
else if (!storageOperations().includes(config.operation))
|
|
4500
|
+
errors.push(`Unknown operation "${config.operation}"`);
|
|
4501
|
+
if (config.operation === "transfer" || config.operation === "sync") {
|
|
4502
|
+
if (!config.destConnector)
|
|
4503
|
+
errors.push("Select a destination connector");
|
|
4504
|
+
if (!config.path)
|
|
4505
|
+
errors.push(config.operation === "transfer" ? "Select a source path" : "Select a source folder");
|
|
4506
|
+
}
|
|
4507
|
+
if (config.fileBudget !== undefined && typeof config.fileBudget !== "number")
|
|
4508
|
+
errors.push("fileBudget must be a number");
|
|
4509
|
+
if (config.timeBudgetMs !== undefined && typeof config.timeBudgetMs !== "number")
|
|
4510
|
+
errors.push("timeBudgetMs must be a number");
|
|
4511
|
+
return { valid: errors.length === 0, errors };
|
|
4512
|
+
},
|
|
4513
|
+
merge: (userConfig) => ({ ...StorageActionConfig.defaults, ...userConfig }),
|
|
4514
|
+
getLabel: (config) => `Storage: ${config.operation || "download"}`
|
|
4515
|
+
};
|
|
4516
|
+
// src/catalog/storage/s3-action/config.ts
|
|
4517
|
+
var S3_OPERATIONS = ["list", "download", "upload", "delete", "copy", "move", "presign"];
|
|
4518
|
+
var S3ActionConfig = {
|
|
4519
|
+
defaults: {
|
|
4520
|
+
connector: "",
|
|
4521
|
+
operation: "download",
|
|
4522
|
+
contentType: "application/octet-stream",
|
|
4523
|
+
expiresIn: 3600,
|
|
4524
|
+
maxKeys: 100
|
|
4525
|
+
},
|
|
4526
|
+
schema: {
|
|
4527
|
+
connector: { type: "connection", required: true, description: "S3 connector instance" },
|
|
4528
|
+
operation: { type: "select", required: true, options: S3_OPERATIONS },
|
|
4529
|
+
bucket: { type: "string", required: false, description: "Overrides the connector's bucket" },
|
|
4530
|
+
region: { type: "string", required: false, description: "Overrides the connector's region" },
|
|
4531
|
+
key: { type: "string", required: false, description: "Object key" },
|
|
4532
|
+
prefix: { type: "string", required: false, description: "list: key prefix" },
|
|
4533
|
+
content: { type: "text", required: false, description: "upload: the body" },
|
|
4534
|
+
contentType: { type: "string", required: false, description: "upload: MIME type" },
|
|
4535
|
+
destBucket: { type: "string", required: false, description: "copy / move: destination bucket" },
|
|
4536
|
+
destKey: { type: "string", required: false, description: "copy / move: destination key" },
|
|
4537
|
+
expiresIn: { type: "number", required: false, min: 1, description: "presign: URL lifetime in seconds" },
|
|
4538
|
+
maxKeys: { type: "number", required: false, min: 1, description: "list: page size" },
|
|
4539
|
+
fileTypes: { type: "array", required: false, description: "list: keep only these extensions" },
|
|
4540
|
+
filePattern: { type: "string", required: false, description: "list: keep only names matching this glob" }
|
|
4541
|
+
},
|
|
4542
|
+
validate: (config) => {
|
|
4543
|
+
const errors = [];
|
|
4544
|
+
if (!config.connector)
|
|
4545
|
+
errors.push("Select an S3 connection");
|
|
4546
|
+
if (config.operation && !S3_OPERATIONS.includes(config.operation))
|
|
4547
|
+
errors.push(`Unknown operation "${config.operation}"`);
|
|
4548
|
+
return { valid: errors.length === 0, errors };
|
|
4549
|
+
},
|
|
4550
|
+
merge: (userConfig) => ({ ...S3ActionConfig.defaults, ...userConfig }),
|
|
4551
|
+
getLabel: (config) => `S3: ${config.operation || "download"}`
|
|
4552
|
+
};
|
|
4553
|
+
// src/catalog/storage/ftp-action/config.ts
|
|
4554
|
+
var FTP_OPERATIONS = ["download", "upload", "list", "delete", "move"];
|
|
4555
|
+
var FtpActionConfig = {
|
|
4556
|
+
defaults: {
|
|
4557
|
+
connector: "",
|
|
4558
|
+
operation: "download",
|
|
4559
|
+
ifExists: "overwrite"
|
|
4560
|
+
},
|
|
4561
|
+
schema: {
|
|
4562
|
+
connector: { type: "connection", required: true, description: "FTP / SFTP connector instance" },
|
|
4563
|
+
operation: { type: "select", required: true, options: FTP_OPERATIONS },
|
|
4564
|
+
remotePath: { type: "string", required: false, description: "File or folder path on the server" },
|
|
4565
|
+
content: { type: "text", required: false, description: "upload: the body" },
|
|
4566
|
+
fileName: { type: "string", required: false, description: "upload: file name" },
|
|
4567
|
+
destPath: { type: "string", required: false, description: "move: the new path" },
|
|
4568
|
+
ifExists: { type: "select", required: false, options: ["overwrite", "skip"], description: "upload: when the file exists" },
|
|
4569
|
+
fileTypes: { type: "array", required: false, description: "list: keep only these extensions" },
|
|
4570
|
+
filePattern: { type: "string", required: false, description: "list: keep only names matching this glob" }
|
|
4571
|
+
},
|
|
4572
|
+
validate: (config) => {
|
|
4573
|
+
const errors = [];
|
|
4574
|
+
if (!config.connector)
|
|
4575
|
+
errors.push("Select an FTP/SFTP connection");
|
|
4576
|
+
if (config.operation && !FTP_OPERATIONS.includes(config.operation))
|
|
4577
|
+
errors.push(`Unknown operation "${config.operation}"`);
|
|
4578
|
+
return { valid: errors.length === 0, errors };
|
|
4579
|
+
},
|
|
4580
|
+
merge: (userConfig) => ({ ...FtpActionConfig.defaults, ...userConfig }),
|
|
4581
|
+
getLabel: (config) => `FTP: ${config.operation || "download"}`
|
|
4582
|
+
};
|
|
4583
|
+
// src/catalog/storage/google-drive-action/config.ts
|
|
4584
|
+
var GOOGLE_DRIVE_OPERATIONS = ["upload", "download", "list", "delete", "move", "copy", "share", "create_folder"];
|
|
4585
|
+
var GoogleDriveActionConfig = {
|
|
4586
|
+
defaults: {
|
|
4587
|
+
connector: "",
|
|
4588
|
+
operation: "upload",
|
|
4589
|
+
mimeType: "application/octet-stream",
|
|
4590
|
+
shareRole: "reader",
|
|
4591
|
+
pageSize: 50
|
|
4592
|
+
},
|
|
4593
|
+
schema: {
|
|
4594
|
+
connector: { type: "connection", required: true, description: "Google Drive connector instance" },
|
|
4595
|
+
operation: { type: "select", required: true, options: GOOGLE_DRIVE_OPERATIONS },
|
|
4596
|
+
fileId: { type: "string", required: false, description: "download / delete / move / copy / share: the file" },
|
|
4597
|
+
folderId: { type: "string", required: false, description: "upload / list / create_folder: the folder (root when empty)" },
|
|
4598
|
+
folderName: { type: "string", required: false, description: "upload: folder path resolved or created when folderId is empty" },
|
|
4599
|
+
fileName: { type: "string", required: false, description: "upload / copy / create_folder: the name" },
|
|
4600
|
+
content: { type: "text", required: false, description: "upload: the body" },
|
|
4601
|
+
mimeType: { type: "string", required: false, description: "upload: MIME type" },
|
|
4602
|
+
createFolderIfNotExists: { type: "boolean", required: false, description: "upload: create folderName when missing" },
|
|
4603
|
+
destFolderId: { type: "string", required: false, description: "move / copy: destination folder" },
|
|
4604
|
+
shareEmail: { type: "string", required: false, description: "share: who" },
|
|
4605
|
+
shareRole: { type: "select", required: false, options: ["reader", "writer"], description: "share: permission" },
|
|
4606
|
+
query: { type: "string", required: false, description: "list: Drive search query" },
|
|
4607
|
+
pageSize: { type: "number", required: false, min: 1, description: "list: page size" },
|
|
4608
|
+
fileTypes: { type: "array", required: false, description: "list: keep only these extensions" },
|
|
4609
|
+
filePattern: { type: "string", required: false, description: "list: keep only names matching this glob" }
|
|
4610
|
+
},
|
|
4611
|
+
validate: (config) => {
|
|
4612
|
+
const errors = [];
|
|
4613
|
+
if (!config.connector)
|
|
4614
|
+
errors.push("Select a Google Drive connection");
|
|
4615
|
+
if (config.operation && !GOOGLE_DRIVE_OPERATIONS.includes(config.operation))
|
|
4616
|
+
errors.push(`Unknown operation "${config.operation}"`);
|
|
4617
|
+
if (config.operation === "share" && !config.shareEmail)
|
|
4618
|
+
errors.push("share: an email address is required");
|
|
4619
|
+
return { valid: errors.length === 0, errors };
|
|
4620
|
+
},
|
|
4621
|
+
merge: (userConfig) => ({ ...GoogleDriveActionConfig.defaults, ...userConfig }),
|
|
4622
|
+
getLabel: (config) => `Drive: ${config.operation || "upload"}`
|
|
4623
|
+
};
|
|
4624
|
+
// src/catalog/storage/dropbox-action/config.ts
|
|
4625
|
+
var DROPBOX_OPERATIONS = ["list", "download", "upload", "delete", "move", "copy"];
|
|
4626
|
+
var DropboxActionConfig = {
|
|
4627
|
+
defaults: {
|
|
4628
|
+
connector: "",
|
|
4629
|
+
operation: "download",
|
|
4630
|
+
mode: "overwrite"
|
|
4631
|
+
},
|
|
4632
|
+
schema: {
|
|
4633
|
+
connector: { type: "connection", required: true, description: "Dropbox connector instance" },
|
|
4634
|
+
operation: { type: "select", required: true, options: DROPBOX_OPERATIONS },
|
|
4635
|
+
path: { type: "string", required: false, description: "File path, or the folder to list" },
|
|
4636
|
+
content: { type: "text", required: false, description: "upload: the body" },
|
|
4637
|
+
fileName: { type: "string", required: false, description: "upload: file name" },
|
|
4638
|
+
destPath: { type: "string", required: false, description: "move / copy: destination path" },
|
|
4639
|
+
mode: { type: "select", required: false, options: ["overwrite", "add"], description: "upload: write mode" },
|
|
4640
|
+
fileTypes: { type: "array", required: false, description: "list: keep only these extensions" },
|
|
4641
|
+
filePattern: { type: "string", required: false, description: "list: keep only names matching this glob" }
|
|
4642
|
+
},
|
|
4643
|
+
validate: (config) => {
|
|
4644
|
+
const errors = [];
|
|
4645
|
+
if (!config.connector)
|
|
4646
|
+
errors.push("Select a Dropbox connection");
|
|
4647
|
+
if (config.operation && !DROPBOX_OPERATIONS.includes(config.operation))
|
|
4648
|
+
errors.push(`Unknown operation "${config.operation}"`);
|
|
4649
|
+
return { valid: errors.length === 0, errors };
|
|
4650
|
+
},
|
|
4651
|
+
merge: (userConfig) => ({ ...DropboxActionConfig.defaults, ...userConfig }),
|
|
4652
|
+
getLabel: (config) => `Dropbox: ${config.operation || "download"}`
|
|
4653
|
+
};
|
|
4654
|
+
// src/catalog/storage/onedrive-action/config.ts
|
|
4655
|
+
var ONEDRIVE_OPERATIONS = ["download", "upload", "list", "delete", "move", "copy"];
|
|
4656
|
+
var OneDriveActionConfig = {
|
|
4657
|
+
defaults: {
|
|
4658
|
+
connector: "",
|
|
4659
|
+
operation: "download",
|
|
4660
|
+
contentType: "application/octet-stream"
|
|
4661
|
+
},
|
|
4662
|
+
schema: {
|
|
4663
|
+
connector: { type: "connection", required: true, description: "Microsoft / OneDrive connector instance" },
|
|
4664
|
+
operation: { type: "select", required: true, options: ONEDRIVE_OPERATIONS },
|
|
4665
|
+
path: { type: "string", required: false, description: "Path from the drive root" },
|
|
4666
|
+
itemId: { type: "string", required: false, description: "Item id, as an alternative to path" },
|
|
4667
|
+
content: { type: "text", required: false, description: "upload: the body" },
|
|
4668
|
+
fileName: { type: "string", required: false, description: "upload: file name" },
|
|
4669
|
+
destPath: { type: "string", required: false, description: "move / copy: full destination path" },
|
|
4670
|
+
contentType: { type: "string", required: false, description: "upload: MIME type" },
|
|
4671
|
+
fileTypes: { type: "array", required: false, description: "list: keep only these extensions" },
|
|
4672
|
+
filePattern: { type: "string", required: false, description: "list: keep only names matching this glob" }
|
|
4673
|
+
},
|
|
4674
|
+
validate: (config) => {
|
|
4675
|
+
const errors = [];
|
|
4676
|
+
if (!config.connector)
|
|
4677
|
+
errors.push("Select a OneDrive connection");
|
|
4678
|
+
if (config.operation && !ONEDRIVE_OPERATIONS.includes(config.operation))
|
|
4679
|
+
errors.push(`Unknown operation "${config.operation}"`);
|
|
4680
|
+
return { valid: errors.length === 0, errors };
|
|
4681
|
+
},
|
|
4682
|
+
merge: (userConfig) => ({ ...OneDriveActionConfig.defaults, ...userConfig }),
|
|
4683
|
+
getLabel: (config) => `OneDrive: ${config.operation || "download"}`
|
|
4684
|
+
};
|
|
3977
4685
|
// src/catalog/workflow.ts
|
|
3978
4686
|
var NodeStatus;
|
|
3979
4687
|
((NodeStatus) => {
|
|
@@ -4861,7 +5569,22 @@ var CONFIG_CONTRACTS = {
|
|
|
4861
5569
|
webhook_trigger: { schema: WebhookTriggerConfig.schema, validate: asValidator(WebhookTriggerConfig.validate) },
|
|
4862
5570
|
debug: { schema: DebugConfig.schema, validate: asValidator(DebugConfig.validate) },
|
|
4863
5571
|
error: { schema: ErrorConfig.schema, validate: asValidator(ErrorConfig.validate) },
|
|
4864
|
-
variables: { schema: VariablesConfig.schema, validate: asValidator(VariablesConfig.validate) }
|
|
5572
|
+
variables: { schema: VariablesConfig.schema, validate: asValidator(VariablesConfig.validate) },
|
|
5573
|
+
ai_agent: { schema: AiAgentConfig.schema, validate: asValidator(AiAgentConfig.validate) },
|
|
5574
|
+
idp_extract: { schema: IdpExtractConfig.schema, validate: asValidator(IdpExtractConfig.validate) },
|
|
5575
|
+
group: { schema: GroupConfig.schema, validate: asValidator(GroupConfig.validate) },
|
|
5576
|
+
connector_trigger: { schema: ConnectorTriggerConfig.schema, validate: asValidator(ConnectorTriggerConfig.validate) },
|
|
5577
|
+
csv_action: { schema: CsvActionConfig.schema, validate: asValidator(CsvActionConfig.validate) },
|
|
5578
|
+
json_action: { schema: JsonActionConfig.schema, validate: asValidator(JsonActionConfig.validate) },
|
|
5579
|
+
xml_action: { schema: XmlActionConfig.schema, validate: asValidator(XmlActionConfig.validate) },
|
|
5580
|
+
excel_action: { schema: ExcelActionConfig.schema, validate: asValidator(ExcelActionConfig.validate) },
|
|
5581
|
+
file_action: { schema: FileActionConfig.schema, validate: asValidator(FileActionConfig.validate) },
|
|
5582
|
+
storage_action: { schema: StorageActionConfig.schema, validate: asValidator(StorageActionConfig.validate) },
|
|
5583
|
+
s3_action: { schema: S3ActionConfig.schema, validate: asValidator(S3ActionConfig.validate) },
|
|
5584
|
+
ftp_action: { schema: FtpActionConfig.schema, validate: asValidator(FtpActionConfig.validate) },
|
|
5585
|
+
google_drive_action: { schema: GoogleDriveActionConfig.schema, validate: asValidator(GoogleDriveActionConfig.validate) },
|
|
5586
|
+
dropbox_action: { schema: DropboxActionConfig.schema, validate: asValidator(DropboxActionConfig.validate) },
|
|
5587
|
+
onedrive_action: { schema: OneDriveActionConfig.schema, validate: asValidator(OneDriveActionConfig.validate) }
|
|
4865
5588
|
};
|
|
4866
5589
|
function contractFor(actionId) {
|
|
4867
5590
|
return actionId ? CONFIG_CONTRACTS[actionId] : undefined;
|