@octaviaflow/flow-rules 0.1.0 → 0.2.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.
Files changed (74) hide show
  1. package/dist/index.d.ts +6 -0
  2. package/dist/index.js +3010 -28
  3. package/package.json +14 -5
  4. package/dist/catalog/actions/console-log/config.js +0 -70
  5. package/dist/catalog/actions/console-log/index.js +0 -89
  6. package/dist/catalog/actions/delay/config.js +0 -79
  7. package/dist/catalog/actions/delay/index.js +0 -71
  8. package/dist/catalog/actions/delay/migrate.js +0 -38
  9. package/dist/catalog/actions/delay/types.js +0 -17
  10. package/dist/catalog/actions/http-request/config.js +0 -111
  11. package/dist/catalog/actions/http-request/index.js +0 -223
  12. package/dist/catalog/ai/ai-agent/index.js +0 -72
  13. package/dist/catalog/ai/idp-extract/index.js +0 -90
  14. package/dist/catalog/api/graphql-query/config.js +0 -31
  15. package/dist/catalog/api/graphql-query/index.js +0 -75
  16. package/dist/catalog/communication/email-send/config.js +0 -80
  17. package/dist/catalog/communication/email-send/index.js +0 -152
  18. package/dist/catalog/communication/google-chat/config.js +0 -28
  19. package/dist/catalog/communication/google-chat/index.js +0 -36
  20. package/dist/catalog/communication/slack-message/config.js +0 -36
  21. package/dist/catalog/communication/slack-message/index.js +0 -37
  22. package/dist/catalog/communication/teams-message/config.js +0 -29
  23. package/dist/catalog/communication/teams-message/index.js +0 -39
  24. package/dist/catalog/communication/webhook-call/config.js +0 -31
  25. package/dist/catalog/communication/webhook-call/index.js +0 -43
  26. package/dist/catalog/communication/whatsapp-send/config.js +0 -36
  27. package/dist/catalog/communication/whatsapp-send/index.js +0 -57
  28. package/dist/catalog/general/query/config.js +0 -257
  29. package/dist/catalog/general/query/index.js +0 -271
  30. package/dist/catalog/general/query/types.js +0 -82
  31. package/dist/catalog/general/transform/config.js +0 -95
  32. package/dist/catalog/general/transform/index.js +0 -63
  33. package/dist/catalog/index.js +0 -168
  34. package/dist/catalog/logic/condition/config.js +0 -93
  35. package/dist/catalog/logic/condition/index.js +0 -64
  36. package/dist/catalog/logic/for-each/config.js +0 -75
  37. package/dist/catalog/logic/for-each/index.js +0 -92
  38. package/dist/catalog/logic/for-each/pathOptions.js +0 -151
  39. package/dist/catalog/logic/group/index.js +0 -46
  40. package/dist/catalog/policies.js +0 -62
  41. package/dist/catalog/storage/csv-action/index.js +0 -38
  42. package/dist/catalog/storage/dropbox-action/index.js +0 -33
  43. package/dist/catalog/storage/excel-action/index.js +0 -32
  44. package/dist/catalog/storage/file-action/index.js +0 -119
  45. package/dist/catalog/storage/file-operation/config.js +0 -45
  46. package/dist/catalog/storage/file-operation/index.js +0 -111
  47. package/dist/catalog/storage/ftp-action/index.js +0 -33
  48. package/dist/catalog/storage/google-drive-action/index.js +0 -38
  49. package/dist/catalog/storage/json-action/index.js +0 -31
  50. package/dist/catalog/storage/onedrive-action/index.js +0 -33
  51. package/dist/catalog/storage/s3-action/index.js +0 -36
  52. package/dist/catalog/storage/storage-action/index.js +0 -72
  53. package/dist/catalog/storage/storageCapabilities.js +0 -207
  54. package/dist/catalog/storage/xml-action/index.js +0 -31
  55. package/dist/catalog/transforms/format/config.js +0 -19
  56. package/dist/catalog/transforms/format/index.js +0 -39
  57. package/dist/catalog/triggers/connector-trigger/index.js +0 -72
  58. package/dist/catalog/triggers/manual-trigger/config.js +0 -60
  59. package/dist/catalog/triggers/manual-trigger/index.js +0 -74
  60. package/dist/catalog/triggers/schedule-trigger/config.js +0 -42
  61. package/dist/catalog/triggers/schedule-trigger/index.js +0 -102
  62. package/dist/catalog/triggers/webhook-trigger/config.js +0 -27
  63. package/dist/catalog/triggers/webhook-trigger/index.js +0 -89
  64. package/dist/catalog/types.js +0 -135
  65. package/dist/catalog/utility/debug/config.js +0 -90
  66. package/dist/catalog/utility/debug/index.js +0 -38
  67. package/dist/catalog/utility/error/config.js +0 -25
  68. package/dist/catalog/utility/error/index.js +0 -46
  69. package/dist/catalog/utility/variables/config.js +0 -70
  70. package/dist/catalog/utility/variables/index.js +0 -40
  71. package/dist/catalog/workflow.js +0 -25
  72. package/dist/ids.js +0 -53
  73. package/dist/rules/nodeConfigStatus.js +0 -217
  74. package/dist/rules/workflowValidator.js +0 -358
@@ -1,33 +0,0 @@
1
- import { ActionCategory, ActionType, ActionStatus, FieldType } from '../../types';
2
- export const ftpActionDefinition = {
3
- id: 'ftp_action',
4
- name: 'FTP / SFTP',
5
- description: 'Upload, download, list, delete, or move files on FTP/SFTP servers. Select a configured FTP connector, then pick files from the remote file explorer.',
6
- category: ActionCategory.Storage,
7
- type: ActionType.FtpAction,
8
- tags: ['ftp', 'sftp', 'ftps', 'file', 'transfer', 'server', 'built-in'],
9
- status: ActionStatus.Beta,
10
- icon: 'DataBackup',
11
- color: '#005d5d',
12
- inputSchema: {
13
- fields: [
14
- { key: 'connector', label: 'FTP / SFTP Connection', type: FieldType.Connection, description: 'Select a configured FTP/SFTP connector from Integrations', validation: { required: true } },
15
- { key: 'operation', label: 'Operation', type: FieldType.Select, options: [{ label: 'Download File', value: 'download' }, { label: 'Upload File', value: 'upload' }, { label: 'List Files', value: 'list' }, { label: 'Delete File', value: 'delete' }, { label: 'Move / Rename', value: 'move' }], defaultValue: 'download', validation: { required: true } },
16
- { key: 'remotePath', label: 'Remote Path', type: FieldType.String, description: 'File or folder path on the server (use file explorer to browse)' },
17
- { key: 'content', label: 'File Content (Upload)', type: FieldType.String, description: 'Content to upload — use FX token from upstream step' },
18
- { key: 'fileName', label: 'File Name (Upload)', type: FieldType.String, description: 'Name for the uploaded file' },
19
- { key: 'destPath', label: 'Destination Path (Move)', type: FieldType.String, description: 'New path for moved/renamed file' },
20
- { key: 'ifExists', label: 'If File Exists', type: FieldType.Select, options: [{ label: 'Overwrite', value: 'overwrite' }, { label: 'Skip', value: 'skip' }], defaultValue: 'overwrite' },
21
- ],
22
- },
23
- outputSchema: {
24
- type: 'object',
25
- properties: [
26
- { key: 'data', type: FieldType.JSON, description: 'Downloaded content, file list, or result' },
27
- { key: 'files', type: FieldType.JSON, description: 'List of files (for list op)' },
28
- { key: 'success', type: FieldType.Boolean, description: 'Whether operation succeeded' },
29
- ],
30
- sampleOutput: { success: true, data: 'file content here' },
31
- },
32
- version: '1.0.0', createdAt: '2026-03-29T00:00:00Z', updatedAt: '2026-03-29T00:00:00Z', createdBy: 'system', isOfficial: true, testable: false,
33
- };
@@ -1,38 +0,0 @@
1
- import { ActionCategory, ActionType, ActionStatus, FieldType } from '../../types';
2
- export const googleDriveActionDefinition = {
3
- id: 'google_drive_action',
4
- name: 'Google Drive',
5
- description: 'Upload, download, list, delete, move, copy, or share files in Google Drive',
6
- category: ActionCategory.Storage,
7
- type: ActionType.GoogleDriveAction,
8
- tags: ['google', 'drive', 'cloud', 'storage', 'upload', 'download', 'built-in'],
9
- status: ActionStatus.Beta,
10
- icon: 'CloudUpload',
11
- color: '#4285F4',
12
- inputSchema: {
13
- fields: [
14
- { key: 'connector', label: 'Google Account', type: FieldType.Connection, description: 'Select a connected Google Sheets connector (shares Drive access)', validation: { required: true } },
15
- { key: 'operation', label: 'Operation', type: FieldType.Select, options: [{ label: 'Upload File', value: 'upload' }, { label: 'Download File', value: 'download' }, { label: 'List Files', value: 'list' }, { label: 'Delete File', value: 'delete' }, { label: 'Move File', value: 'move' }, { label: 'Copy File', value: 'copy' }, { label: 'Share File', value: 'share' }, { label: 'Create Folder', value: 'create_folder' }], defaultValue: 'upload', validation: { required: true } },
16
- { key: 'fileId', label: 'File ID / Path', type: FieldType.String, description: 'Google Drive file ID (use file explorer to browse)' },
17
- { key: 'folderId', label: 'Folder ID', type: FieldType.String, description: 'Target folder (root if empty)' },
18
- { key: 'fileName', label: 'File Name', type: FieldType.String },
19
- { key: 'content', label: 'File Content (Upload)', type: FieldType.String, description: 'Content to upload — use FX token from upstream' },
20
- { key: 'mimeType', label: 'MIME Type', type: FieldType.String, defaultValue: 'application/octet-stream' },
21
- { key: 'destFolderId', label: 'Destination Folder (Move/Copy)', type: FieldType.String },
22
- { key: 'shareEmail', label: 'Share With Email', type: FieldType.String },
23
- { key: 'shareRole', label: 'Permission', type: FieldType.Select, options: [{ label: 'Viewer', value: 'reader' }, { label: 'Editor', value: 'writer' }], defaultValue: 'reader' },
24
- { key: 'query', label: 'Search Query (List)', type: FieldType.String, description: "e.g. name contains 'report'" },
25
- { key: 'pageSize', label: 'Max Results', type: FieldType.Number, defaultValue: 50 },
26
- ],
27
- },
28
- outputSchema: {
29
- type: 'object',
30
- properties: [
31
- { key: 'data', type: FieldType.JSON, description: 'File content, file list, or operation result' },
32
- { key: 'fileId', type: FieldType.String, description: 'Google Drive file ID' },
33
- { key: 'webViewLink', type: FieldType.String, description: 'Link to view file in browser' },
34
- ],
35
- sampleOutput: { fileId: '1abc...', webViewLink: 'https://drive.google.com/file/d/1abc.../view' },
36
- },
37
- version: '1.0.0', createdAt: '2026-03-28T00:00:00Z', updatedAt: '2026-03-28T00:00:00Z', createdBy: 'system', isOfficial: true, testable: false,
38
- };
@@ -1,31 +0,0 @@
1
- import { ActionCategory, ActionType, ActionStatus, FieldType } from '../../types';
2
- export const jsonActionDefinition = {
3
- id: 'json_action',
4
- name: 'JSON',
5
- description: 'Parse JSON/JSONL files into structured records or generate JSON from workflow data',
6
- category: ActionCategory.Storage,
7
- type: ActionType.JsonAction,
8
- tags: ['json', 'jsonl', 'parse', 'generate', 'file', 'format', 'built-in'],
9
- status: ActionStatus.Stable,
10
- icon: 'DataStructured',
11
- color: '#f1c21b',
12
- inputSchema: {
13
- fields: [
14
- { key: 'operation', label: 'Operation', type: FieldType.Select, options: [{ label: 'Parse (JSON → Records)', value: 'parse' }, { label: 'Generate (Records → JSON)', value: 'generate' }], defaultValue: 'parse', validation: { required: true } },
15
- { key: 'format', label: 'Format', type: FieldType.Select, options: [{ label: 'JSON (array)', value: 'json' }, { label: 'JSONL (one object per line)', value: 'jsonl' }], defaultValue: 'json' },
16
- { key: 'content', label: 'JSON Content', type: FieldType.String, description: 'Paste JSON content or use FX token from upstream step' },
17
- { key: 'prettyPrint', label: 'Pretty Print', type: FieldType.Boolean, description: 'Format output with indentation', defaultValue: true },
18
- { key: 'fileName', label: 'Output File Name', type: FieldType.String, defaultValue: 'export.json' },
19
- ],
20
- },
21
- outputSchema: {
22
- type: 'object',
23
- properties: [
24
- { key: 'data', type: FieldType.Array, description: 'Parsed records (parse mode) — loop these with a ForEach. Generated JSON string in generate mode.' },
25
- { key: 'columns', type: FieldType.JSON, description: 'Field names' },
26
- { key: 'rowCount', type: FieldType.Number, description: 'Number of records' },
27
- ],
28
- sampleOutput: { data: [{ id: 1, name: 'Widget' }], columns: ['id', 'name'], rowCount: 1 },
29
- },
30
- version: '1.0.0', createdAt: '2026-03-28T00:00:00Z', updatedAt: '2026-03-28T00:00:00Z', createdBy: 'system', isOfficial: true, testable: false,
31
- };
@@ -1,33 +0,0 @@
1
- import { ActionCategory, ActionType, ActionStatus, FieldType } from '../../types';
2
- export const onedriveActionDefinition = {
3
- id: 'onedrive_action',
4
- name: 'OneDrive',
5
- description: 'Upload, download, list, delete, move, or copy files in Microsoft OneDrive',
6
- category: ActionCategory.Storage,
7
- type: ActionType.OneDriveAction,
8
- tags: ['onedrive', 'microsoft', 'cloud', 'storage', 'built-in'],
9
- status: ActionStatus.Beta,
10
- icon: 'CloudUpload',
11
- color: '#0078D4',
12
- inputSchema: {
13
- fields: [
14
- { key: 'connector', label: 'Microsoft Account', type: FieldType.Connection, description: 'Select a connected Microsoft/OneDrive account', validation: { required: true } },
15
- { key: 'operation', label: 'Operation', type: FieldType.Select, options: [{ label: 'Download File', value: 'download' }, { label: 'Upload File', value: 'upload' }, { label: 'List Files', value: 'list' }, { label: 'Delete', value: 'delete' }, { label: 'Move', value: 'move' }, { label: 'Copy', value: 'copy' }], defaultValue: 'download', validation: { required: true } },
16
- { key: 'path', label: 'File / Folder Path', type: FieldType.String, description: 'Path on OneDrive (use file explorer to browse)' },
17
- { key: 'itemId', label: 'Item ID', type: FieldType.String, description: 'OneDrive item ID (alternative to path)' },
18
- { key: 'content', label: 'File Content (Upload)', type: FieldType.String, description: 'Content to upload — use FX token from upstream' },
19
- { key: 'fileName', label: 'File Name (Upload)', type: FieldType.String },
20
- { key: 'destPath', label: 'Destination Path (Move/Copy)', type: FieldType.String },
21
- ],
22
- },
23
- outputSchema: {
24
- type: 'object',
25
- properties: [
26
- { key: 'data', type: FieldType.JSON, description: 'File content, list, or metadata' },
27
- { key: 'itemId', type: FieldType.String, description: 'OneDrive item ID' },
28
- { key: 'webUrl', type: FieldType.String, description: 'Browser URL' },
29
- ],
30
- sampleOutput: { itemId: 'abc123', webUrl: 'https://onedrive.live.com/...' },
31
- },
32
- version: '1.0.0', createdAt: '2026-03-28T00:00:00Z', updatedAt: '2026-03-28T00:00:00Z', createdBy: 'system', isOfficial: true, testable: false,
33
- };
@@ -1,36 +0,0 @@
1
- import { ActionCategory, ActionType, ActionStatus, FieldType } from '../../types';
2
- export const s3ActionDefinition = {
3
- id: 's3_action',
4
- name: 'AWS S3',
5
- description: 'Upload, download, list, delete, or copy files in Amazon S3 buckets',
6
- category: ActionCategory.Storage,
7
- type: ActionType.S3Action,
8
- tags: ['s3', 'aws', 'storage', 'cloud', 'bucket', 'upload', 'download', 'built-in'],
9
- status: ActionStatus.Stable,
10
- icon: 'CloudUpload',
11
- color: '#569A31',
12
- inputSchema: {
13
- fields: [
14
- { key: 'operation', label: 'Operation', type: FieldType.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 } },
15
- { key: 'bucket', label: 'Bucket Name', type: FieldType.String, description: 'S3 bucket name (defaults to the connector’s bucket)' },
16
- { key: 'key', label: 'Object Key (Path)', type: FieldType.String, description: 'S3 object key, e.g. data/reports/monthly.csv' },
17
- { key: 'prefix', label: 'Prefix (for List)', type: FieldType.String, description: 'Filter objects by prefix (folder path)' },
18
- { key: 'content', label: 'File Content (for Upload)', type: FieldType.String, description: 'Content to upload — use FX token from upstream step' },
19
- { key: 'contentType', label: 'Content Type', type: FieldType.String, description: 'MIME type (e.g. text/csv, application/json)', defaultValue: 'application/octet-stream' },
20
- { key: 'destBucket', label: 'Destination Bucket (for Copy)', type: FieldType.String },
21
- { key: 'destKey', label: 'Destination Key (for Copy)', type: FieldType.String },
22
- { key: 'expiresIn', label: 'URL Expiry (seconds)', type: FieldType.Number, description: 'Presigned URL expiry time', defaultValue: 3600 },
23
- { key: 'maxKeys', label: 'Max Results (for List)', type: FieldType.Number, defaultValue: 100 },
24
- ],
25
- },
26
- outputSchema: {
27
- type: 'object',
28
- properties: [
29
- { key: 'data', type: FieldType.JSON, description: 'Downloaded content, file list, or operation result' },
30
- { key: 'key', type: FieldType.String, description: 'S3 object key' },
31
- { key: 'url', type: FieldType.String, description: 'Presigned URL (for presign operation)' },
32
- ],
33
- sampleOutput: { data: 'file content here', key: 'data/reports/monthly.csv' },
34
- },
35
- version: '1.0.0', createdAt: '2026-03-28T00:00:00Z', updatedAt: '2026-03-28T00:00:00Z', createdBy: 'system', isOfficial: true, testable: false,
36
- };
@@ -1,72 +0,0 @@
1
- import { ActionCategory, ActionType, ActionStatus, FieldType } from '../../types';
2
- /**
3
- * Unified Cloud Storage action. One catalog entry for every storage connector
4
- * (Amazon S3, Dropbox, OneDrive, Google Drive, FTP/SFTP). The provider is the
5
- * connector you pick; the custom `StorageConfigPanel` adapts the operations +
6
- * fields to that provider (driven by `storageCapabilities.ts`) and uses the DS
7
- * FilePicker to browse the connector's real files. Replaces the per-provider
8
- * actions; existing per-provider nodes still execute (back-compat).
9
- *
10
- * The `inputSchema` below is a minimal fallback for generic rendering — the
11
- * real config UI is the custom panel.
12
- */
13
- export const storageActionDefinition = {
14
- id: 'storage_action',
15
- name: 'Storage',
16
- description: 'Browse, transfer, and manage files on any connected storage — cloud (Amazon S3, Google Drive, OneDrive, Dropbox, GCS, Azure Blob) or FTP/SFTP.',
17
- category: ActionCategory.Storage,
18
- type: ActionType.StorageAction,
19
- tags: ['storage', 'files', 's3', 'dropbox', 'onedrive', 'google drive', 'ftp', 'sftp', 'upload', 'download', 'cloud', 'built-in'],
20
- status: ActionStatus.Stable,
21
- icon: 'CloudUpload',
22
- color: '#4F46E5',
23
- inputSchema: {
24
- fields: [
25
- { key: 'connector', label: 'Storage connector', type: FieldType.Connection, description: 'Pick a connected storage connector — its provider drives the available operations.', validation: { required: true } },
26
- {
27
- key: 'operation', label: 'Operation', type: FieldType.Select,
28
- options: [
29
- { label: 'List files', value: 'list' },
30
- { label: 'Download file', value: 'download' },
31
- { label: 'Upload file', value: 'upload' },
32
- { label: 'Delete file', value: 'delete' },
33
- { label: 'Copy file', value: 'copy' },
34
- { label: 'Move / rename', value: 'move' },
35
- { label: 'Get signed URL', value: 'presign' },
36
- { label: 'Share', value: 'share' },
37
- { label: 'Create folder', value: 'create_folder' },
38
- { label: 'Transfer to another connector', value: 'transfer' },
39
- ],
40
- defaultValue: 'download', validation: { required: true },
41
- },
42
- { key: 'path', label: 'Path', type: FieldType.String, description: 'File or folder path — use the file browser in the panel.' },
43
- { key: 'destPath', label: 'Destination path', type: FieldType.String, description: 'Target for copy / move.' },
44
- { key: 'content', label: 'File content (for Upload)', type: FieldType.String, description: 'Content to upload — bind an FX token from an upstream step.' },
45
- ],
46
- },
47
- outputSchema: {
48
- type: 'object',
49
- properties: [
50
- { key: 'operation', type: FieldType.String, description: 'The operation that ran' },
51
- { key: 'data', type: FieldType.JSON, description: 'Operation result or downloaded content' },
52
- { key: 'files', type: FieldType.JSON, description: 'Listing (for the List operation)' },
53
- { key: 'path', type: FieldType.String, description: 'Affected file/folder path' },
54
- { key: 'url', type: FieldType.String, description: 'Signed URL (for the Get signed URL operation)' },
55
- ],
56
- // Listings are normalized across providers (DEV-187): each entry carries a
57
- // parsed `ext` + best-effort `mimeType` so a ForEach → Condition can filter
58
- // "only the .csv files" without string-munging the name.
59
- sampleOutput: {
60
- operation: 'list',
61
- files: [
62
- { name: 'report.csv', path: '/reports/report.csv', ext: 'csv', mimeType: 'text/csv', type: 'file', size: 2048, modifiedAt: '2026-06-18T10:00:00Z' },
63
- ],
64
- },
65
- },
66
- version: '1.0.0',
67
- createdAt: '2026-06-05T00:00:00Z',
68
- updatedAt: '2026-06-05T00:00:00Z',
69
- createdBy: 'system',
70
- isOfficial: true,
71
- testable: false,
72
- };
@@ -1,207 +0,0 @@
1
- // ============================================
2
- // Storage capability registry
3
- // ============================================
4
- // Single source of truth for the unified `storage_action` config panel. Per
5
- // storage connector (provider), declares which operations are available and,
6
- // for each operation, which config fields to render — including the
7
- // provider-native key each FilePicker path is stored under.
8
- //
9
- // The Engine's storageExecutor reads these native keys (cfg.key / cfg.remotePath
10
- // / cfg.path / cfg.fileId / cfg.folderId ...), so the panel writes them directly
11
- // here — no Engine-side path mapping needed.
12
- // ============================================
13
- // ── shared field fragments ──────────────────────────────────────────────────
14
- const contentTypeField = {
15
- key: 'contentType',
16
- label: 'Content type',
17
- type: 'string',
18
- placeholder: 'application/octet-stream',
19
- advanced: true,
20
- hint: 'MIME type for the uploaded file.',
21
- };
22
- // ── providers ───────────────────────────────────────────────────────────────
23
- export const STORAGE_PROVIDERS = {
24
- aws_s3: {
25
- connectorId: 'aws_s3',
26
- label: 'Amazon S3',
27
- browse: true,
28
- operations: [
29
- { value: 'list', label: 'List files', path: { key: 'prefix', label: 'Folder', selectMode: 'folder' }, fields: [{ key: 'maxKeys', label: 'Max results', type: 'number', defaultValue: 100, advanced: true }] },
30
- { value: 'download', label: 'Download file', path: { key: 'key', label: 'File', selectMode: 'both', required: true } },
31
- { value: 'upload', label: 'Upload file', path: { key: 'key', label: 'Destination key', selectMode: 'both', required: true }, content: true, fields: [contentTypeField] },
32
- { value: 'delete', label: 'Delete file', path: { key: 'key', label: 'File', selectMode: 'both', required: true } },
33
- { value: 'copy', label: 'Copy file', path: { key: 'key', label: 'Source file', selectMode: 'both', required: true }, dest: { key: 'destKey', label: 'Destination key', selectMode: 'both', required: true } },
34
- { value: 'move', label: 'Move / rename', path: { key: 'key', label: 'Source file', selectMode: 'both', required: true }, dest: { key: 'destKey', label: 'Destination key', selectMode: 'both', required: true } },
35
- { value: 'presign', label: 'Get signed URL', path: { key: 'key', label: 'File', selectMode: 'both', required: true }, fields: [{ key: 'expiresIn', label: 'Expiry (seconds)', type: 'number', defaultValue: 3600, advanced: true }] },
36
- ],
37
- },
38
- ftp_sftp: {
39
- connectorId: 'ftp_sftp',
40
- label: 'FTP / SFTP',
41
- browse: true,
42
- operations: [
43
- { value: 'list', label: 'List files', path: { key: 'remotePath', label: 'Folder', selectMode: 'folder' } },
44
- { value: 'download', label: 'Download file', path: { key: 'remotePath', label: 'File', selectMode: 'both', required: true } },
45
- { value: 'upload', label: 'Upload file', path: { key: 'remotePath', label: 'Destination path', selectMode: 'both', required: true }, content: true },
46
- { value: 'delete', label: 'Delete file', path: { key: 'remotePath', label: 'File', selectMode: 'both', required: true } },
47
- { value: 'move', label: 'Move / rename', path: { key: 'remotePath', label: 'Source file', selectMode: 'both', required: true }, dest: { key: 'destPath', label: 'Destination path', selectMode: 'both', required: true } },
48
- ],
49
- },
50
- dropbox: {
51
- connectorId: 'dropbox',
52
- label: 'Dropbox',
53
- browse: true,
54
- operations: [
55
- { value: 'list', label: 'List files', path: { key: 'path', label: 'Folder', selectMode: 'folder' } },
56
- { value: 'download', label: 'Download file', path: { key: 'path', label: 'File', selectMode: 'both', required: true } },
57
- { value: 'upload', label: 'Upload file', path: { key: 'path', label: 'Destination path', selectMode: 'both', required: true }, content: true, fields: [{ key: 'mode', label: 'Write mode', type: 'select', options: [{ label: 'Overwrite', value: 'overwrite' }, { label: 'Add (keep both)', value: 'add' }], defaultValue: 'overwrite', advanced: true }] },
58
- { value: 'delete', label: 'Delete file', path: { key: 'path', label: 'File', selectMode: 'both', required: true } },
59
- { value: 'copy', label: 'Copy file', path: { key: 'path', label: 'Source file', selectMode: 'both', required: true }, dest: { key: 'destPath', label: 'Destination path', selectMode: 'both', required: true } },
60
- { value: 'move', label: 'Move / rename', path: { key: 'path', label: 'Source file', selectMode: 'both', required: true }, dest: { key: 'destPath', label: 'Destination path', selectMode: 'both', required: true } },
61
- ],
62
- },
63
- onedrive: {
64
- connectorId: 'onedrive',
65
- label: 'OneDrive',
66
- browse: true,
67
- operations: [
68
- { value: 'list', label: 'List files', path: { key: 'path', label: 'Folder', selectMode: 'folder' } },
69
- { value: 'download', label: 'Download file', path: { key: 'path', label: 'File', selectMode: 'both', required: true } },
70
- { value: 'upload', label: 'Upload file', path: { key: 'path', label: 'Destination path', selectMode: 'both', required: true }, content: true, fields: [contentTypeField] },
71
- { value: 'delete', label: 'Delete file', path: { key: 'path', label: 'File', selectMode: 'both', required: true } },
72
- { value: 'copy', label: 'Copy file', path: { key: 'path', label: 'Source file', selectMode: 'both', required: true }, dest: { key: 'destPath', label: 'Destination path', selectMode: 'both', required: true } },
73
- { value: 'move', label: 'Move / rename', path: { key: 'path', label: 'Source file', selectMode: 'both', required: true }, dest: { key: 'destPath', label: 'Destination path', selectMode: 'both', required: true } },
74
- ],
75
- },
76
- // Google Drive uses opaque folderIds (not hierarchical paths); the FilePicker
77
- // navigates by folderId and writes the picked id to fileId / folderId.
78
- google_drive: {
79
- connectorId: 'google_drive',
80
- label: 'Google Drive',
81
- browse: true,
82
- operations: [
83
- { value: 'list', label: 'List files', path: { key: 'folderId', label: 'Folder', selectMode: 'folder' }, fields: [{ key: 'query', label: 'Search query', type: 'string', advanced: true }, { key: 'pageSize', label: 'Max results', type: 'number', defaultValue: 50, advanced: true }] },
84
- { value: 'download', label: 'Download file', path: { key: 'fileId', label: 'File', selectMode: 'both', required: true } },
85
- { value: 'upload', label: 'Upload file', path: { key: 'folderId', label: 'Destination folder', selectMode: 'both' }, content: true, fields: [{ key: 'fileName', label: 'File name', type: 'string', required: true }, { key: 'mimeType', label: 'Content type', type: 'string', advanced: true }] },
86
- { value: 'delete', label: 'Delete file', path: { key: 'fileId', label: 'File', selectMode: 'both', required: true } },
87
- { value: 'move', label: 'Move', path: { key: 'fileId', label: 'File', selectMode: 'both', required: true }, dest: { key: 'destFolderId', label: 'Destination folder', selectMode: 'both', required: true } },
88
- { value: 'copy', label: 'Copy', path: { key: 'fileId', label: 'File', selectMode: 'both', required: true }, dest: { key: 'destFolderId', label: 'Destination folder', selectMode: 'both' }, fields: [{ key: 'fileName', label: 'New name', type: 'string' }] },
89
- { value: 'share', label: 'Share', path: { key: 'fileId', label: 'File', selectMode: 'both', required: true }, fields: [{ key: 'shareEmail', label: 'Share with (email)', type: 'string', required: true }, { key: 'shareRole', label: 'Role', type: 'select', options: [{ label: 'Viewer', value: 'reader' }, { label: 'Editor', value: 'writer' }], defaultValue: 'reader' }] },
90
- { value: 'create_folder', label: 'Create folder', path: { key: 'folderId', label: 'Parent folder', selectMode: 'both' }, fields: [{ key: 'fileName', label: 'Folder name', type: 'string', required: true }] },
91
- ],
92
- },
93
- // GCS is an S3-like flat object store — paths are object keys written to `key`.
94
- gcs: {
95
- connectorId: 'gcs',
96
- label: 'Google Cloud Storage',
97
- browse: true,
98
- operations: [
99
- { value: 'list', label: 'List files', path: { key: 'prefix', label: 'Folder', selectMode: 'folder' }, fields: [{ key: 'maxKeys', label: 'Max results', type: 'number', defaultValue: 100, advanced: true }] },
100
- { value: 'download', label: 'Download file', path: { key: 'key', label: 'File', selectMode: 'both', required: true } },
101
- { value: 'upload', label: 'Upload file', path: { key: 'key', label: 'Destination key', selectMode: 'both', required: true }, content: true, fields: [contentTypeField] },
102
- { value: 'delete', label: 'Delete file', path: { key: 'key', label: 'File', selectMode: 'both', required: true } },
103
- { value: 'copy', label: 'Copy file', path: { key: 'key', label: 'Source file', selectMode: 'both', required: true }, dest: { key: 'destKey', label: 'Destination key', selectMode: 'both', required: true } },
104
- { value: 'move', label: 'Move / rename', path: { key: 'key', label: 'Source file', selectMode: 'both', required: true }, dest: { key: 'destKey', label: 'Destination key', selectMode: 'both', required: true } },
105
- { value: 'presign', label: 'Get signed URL', path: { key: 'key', label: 'File', selectMode: 'both', required: true }, fields: [{ key: 'expiresIn', label: 'Expiry (seconds)', type: 'number', defaultValue: 3600, advanced: true }] },
106
- ],
107
- },
108
- // Azure Blob is a flat blob store — paths are blob names written to `blob`.
109
- azure_blob: {
110
- connectorId: 'azure_blob',
111
- label: 'Azure Blob Storage',
112
- browse: true,
113
- operations: [
114
- { value: 'list', label: 'List files', path: { key: 'prefix', label: 'Folder', selectMode: 'folder' }, fields: [{ key: 'maxKeys', label: 'Max results', type: 'number', defaultValue: 100, advanced: true }] },
115
- { value: 'download', label: 'Download file', path: { key: 'blob', label: 'File', selectMode: 'both', required: true } },
116
- { value: 'upload', label: 'Upload file', path: { key: 'blob', label: 'Destination blob', selectMode: 'both', required: true }, content: true, fields: [contentTypeField] },
117
- { value: 'delete', label: 'Delete file', path: { key: 'blob', label: 'File', selectMode: 'both', required: true } },
118
- { value: 'copy', label: 'Copy file', path: { key: 'blob', label: 'Source blob', selectMode: 'both', required: true }, dest: { key: 'destBlob', label: 'Destination blob', selectMode: 'both', required: true } },
119
- { value: 'move', label: 'Move / rename', path: { key: 'blob', label: 'Source blob', selectMode: 'both', required: true }, dest: { key: 'destBlob', label: 'Destination blob', selectMode: 'both', required: true } },
120
- { value: 'presign', label: 'Get signed URL', path: { key: 'blob', label: 'File', selectMode: 'both', required: true }, fields: [{ key: 'expiresIn', label: 'Expiry (seconds)', type: 'number', defaultValue: 3600, advanced: true }] },
121
- ],
122
- },
123
- };
124
- // Google Sheets connectors share Drive access (same token + endpoints).
125
- STORAGE_PROVIDERS.google_sheets = { ...STORAGE_PROVIDERS.google_drive, connectorId: 'google_sheets' };
126
- // Cross-connector Transfer — available on every provider as the SOURCE; the
127
- // destination is a second connector chosen in the panel. Rendered specially by
128
- // StorageConfigPanel (source FilePicker + destination connector + dest path).
129
- const transferOp = {
130
- value: 'transfer',
131
- label: 'Transfer to another connector',
132
- path: { key: 'path', label: 'Source file or folder', selectMode: 'both', required: true },
133
- };
134
- for (const id of ['aws_s3', 'ftp_sftp', 'dropbox', 'onedrive', 'google_drive', 'gcs', 'azure_blob']) {
135
- STORAGE_PROVIDERS[id].operations.push(transferOp);
136
- }
137
- // Folder SYNC — recursive folder→folder copy to another connector that runs
138
- // reliably as the BODY of a `cursor`-mode ForEach: each pass is bounded and the
139
- // engine threads the BFS cursor across passes, so an arbitrarily deep tree never
140
- // hits the per-step deadline. Rendered specially by StorageConfigPanel.
141
- const syncOp = {
142
- value: 'sync',
143
- label: 'Sync folder to another connector',
144
- path: { key: 'path', label: 'Source folder', selectMode: 'both', required: true },
145
- fields: [
146
- {
147
- key: 'ifExists',
148
- label: 'If a file already exists',
149
- type: 'select',
150
- options: [
151
- { label: 'Overwrite', value: 'overwrite' },
152
- { label: 'Skip it', value: 'skip' },
153
- { label: 'Keep both (rename)', value: 'rename' },
154
- ],
155
- defaultValue: 'overwrite',
156
- hint: 'What to do when the destination already has the file.',
157
- },
158
- {
159
- key: 'onError',
160
- label: 'On file error',
161
- type: 'select',
162
- options: [
163
- { label: 'Stop the sync', value: 'abort' },
164
- { label: 'Skip the file & continue', value: 'skip' },
165
- ],
166
- defaultValue: 'abort',
167
- hint: 'A bad file (timeout, lock, permission) stops the whole sync, or is skipped.',
168
- },
169
- ],
170
- };
171
- for (const id of ['aws_s3', 'ftp_sftp', 'dropbox', 'onedrive', 'google_drive', 'gcs', 'azure_blob']) {
172
- STORAGE_PROVIDERS[id].operations.push(syncOp);
173
- }
174
- /** Connector ids the unified storage action's connector picker offers.
175
- * Google Sheets shares Drive access (kept in STORAGE_PROVIDERS for browse
176
- * compat) but it's a spreadsheet/data connector — not a file store — so it's
177
- * excluded from the picker (a "Google Sheets" app under Storage confuses
178
- * users). Use the Google Drive connector for file operations. */
179
- export const STORAGE_CONNECTOR_IDS = Object.keys(STORAGE_PROVIDERS).filter((id) => id !== 'google_sheets');
180
- export function getStorageProvider(connectorId) {
181
- if (!connectorId)
182
- return undefined;
183
- // Accept legacy hyphenated ids (e.g. 'aws-s3') as their canonical underscore
184
- // form ('aws_s3') so connector instances created before the id was canonicalised
185
- // still resolve to their provider spec.
186
- return STORAGE_PROVIDERS[connectorId] ?? STORAGE_PROVIDERS[connectorId.replace(/-/g, '_')];
187
- }
188
- /** All config keys any operation might write — used to clear stale fields when the operation/provider changes. */
189
- export function storageConfigKeys() {
190
- const keys = new Set([
191
- 'operation', 'connector', 'content', 'outputAs',
192
- // cross-connector Transfer + folder Sync fields
193
- 'path', 'destPath', 'destConnector', 'sourceIsDirectory',
194
- 'cursor', 'fileBudget', 'timeBudgetMs',
195
- ]);
196
- for (const provider of Object.values(STORAGE_PROVIDERS)) {
197
- for (const op of provider.operations) {
198
- if (op.path)
199
- keys.add(op.path.key);
200
- if (op.dest)
201
- keys.add(op.dest.key);
202
- for (const f of op.fields ?? [])
203
- keys.add(f.key);
204
- }
205
- }
206
- return [...keys];
207
- }
@@ -1,31 +0,0 @@
1
- import { ActionCategory, ActionType, ActionStatus, FieldType } from '../../types';
2
- export const xmlActionDefinition = {
3
- id: 'xml_action',
4
- name: 'XML',
5
- description: 'Parse XML files into structured records or generate XML from workflow data',
6
- category: ActionCategory.Storage,
7
- type: ActionType.XmlAction,
8
- tags: ['xml', 'parse', 'generate', 'file', 'format', 'built-in'],
9
- status: ActionStatus.Beta,
10
- icon: 'Code',
11
- color: '#e65100',
12
- inputSchema: {
13
- fields: [
14
- { key: 'operation', label: 'Operation', type: FieldType.Select, options: [{ label: 'Parse (XML → Records)', value: 'parse' }, { label: 'Generate (Records → XML)', value: 'generate' }], defaultValue: 'parse', validation: { required: true } },
15
- { key: 'content', label: 'XML Content', type: FieldType.String, description: 'Paste XML or use FX token' },
16
- { key: 'rootElement', label: 'Root Element', type: FieldType.String, description: 'Root XML element name (for generate)', defaultValue: 'data' },
17
- { key: 'rowElement', label: 'Row Element', type: FieldType.String, description: 'Element name per record (for generate)', defaultValue: 'row' },
18
- { key: 'fileName', label: 'Output File Name', type: FieldType.String, defaultValue: 'export.xml' },
19
- ],
20
- },
21
- outputSchema: {
22
- type: 'object',
23
- properties: [
24
- { key: 'data', type: FieldType.Array, description: 'Parsed records (parse mode) — loop these with a ForEach. Generated XML string in generate mode.' },
25
- { key: 'columns', type: FieldType.JSON, description: 'Field names' },
26
- { key: 'rowCount', type: FieldType.Number, description: 'Number of records' },
27
- ],
28
- sampleOutput: { data: [{ id: 1, name: 'Widget' }], columns: ['id', 'name'], rowCount: 1 },
29
- },
30
- version: '1.0.0', createdAt: '2026-03-28T00:00:00Z', updatedAt: '2026-03-28T00:00:00Z', createdBy: 'system', isOfficial: true, testable: false,
31
- };
@@ -1,19 +0,0 @@
1
- export const FormatConfig = {
2
- defaults: { input: '', format: 'json' },
3
- schema: {
4
- input: { type: 'expression', required: true },
5
- format: { type: 'select', required: true },
6
- },
7
- validate: (config) => {
8
- const errors = [];
9
- if (!config.input)
10
- errors.push('Input required');
11
- if (!config.format)
12
- errors.push('Format required');
13
- return { valid: errors.length === 0, errors };
14
- },
15
- merge: (userConfig) => {
16
- return { ...FormatConfig.defaults, ...userConfig };
17
- },
18
- getLabel: (config) => `Format as ${config.format.toUpperCase()}`,
19
- };
@@ -1,39 +0,0 @@
1
- /**
2
- * Format Transform Action
3
- */
4
- import { ActionCategory, ActionType, ActionStatus, FieldType } from '../../types';
5
- export const formatDefinition = {
6
- id: 'format',
7
- name: 'Format',
8
- description: 'Format data (JSON, CSV, XML, etc.)',
9
- category: ActionCategory.Transform,
10
- type: ActionType.Format,
11
- tags: ['transform', 'format', 'built-in'],
12
- status: ActionStatus.Stable,
13
- icon: 'TextFormatting',
14
- color: '#24a148',
15
- inputSchema: {
16
- fields: [
17
- { key: 'input', label: 'Input', type: FieldType.Expression, validation: { required: true } },
18
- { key: 'format', label: 'Format', type: FieldType.Select, options: [
19
- { label: 'JSON', value: 'json' },
20
- { label: 'CSV', value: 'csv' },
21
- { label: 'XML', value: 'xml' },
22
- { label: 'YAML', value: 'yaml' },
23
- ], validation: { required: true } },
24
- ],
25
- },
26
- outputSchema: {
27
- type: 'string',
28
- properties: [
29
- { key: 'result', type: FieldType.String, description: 'Formatted output' },
30
- ],
31
- sampleOutput: { result: '' },
32
- },
33
- version: '1.0.0',
34
- createdAt: '2025-01-01T00:00:00Z',
35
- updatedAt: '2025-12-15T00:00:00Z',
36
- createdBy: 'system',
37
- isOfficial: true,
38
- testable: true,
39
- };
@@ -1,72 +0,0 @@
1
- /**
2
- * Connector Trigger Action
3
- *
4
- * Trigger workflows via connector platform events (e.g. QuickBooks Online webhooks)
5
- */
6
- import { ActionCategory, ActionType, ActionStatus, FieldType } from '../../types';
7
- export const connectorTriggerDefinition = {
8
- id: 'connector_trigger',
9
- name: 'Connector Trigger',
10
- description: 'Trigger workflow when a connector platform event occurs',
11
- category: ActionCategory.Trigger,
12
- type: ActionType.Event,
13
- tags: ['trigger', 'connector', 'event', 'built-in'],
14
- status: ActionStatus.Stable,
15
- icon: 'Connect',
16
- color: '#6929c4',
17
- inputSchema: {
18
- fields: [
19
- {
20
- key: 'connectorInstanceId',
21
- label: 'Connector Instance',
22
- type: FieldType.String,
23
- description: 'The connected app instance to listen to',
24
- validation: { required: true },
25
- },
26
- {
27
- key: 'events',
28
- label: 'Events',
29
- type: FieldType.JSON,
30
- description: 'Entity/operation pairs to subscribe to',
31
- validation: { required: true },
32
- },
33
- ],
34
- },
35
- outputSchema: {
36
- type: 'object',
37
- properties: [
38
- {
39
- key: 'eventType',
40
- type: FieldType.String,
41
- description: 'The type of event that occurred',
42
- },
43
- {
44
- key: 'entity',
45
- type: FieldType.String,
46
- description: 'The entity that changed (e.g. Invoice)',
47
- },
48
- {
49
- key: 'operation',
50
- type: FieldType.String,
51
- description: 'The operation performed (e.g. Create)',
52
- },
53
- {
54
- key: 'payload',
55
- type: FieldType.JSON,
56
- description: 'The event payload from the connector',
57
- },
58
- ],
59
- sampleOutput: {
60
- eventType: 'connector.event',
61
- entity: 'Invoice',
62
- operation: 'Create',
63
- payload: { id: '123', amount: 500 },
64
- },
65
- },
66
- version: '1.0.0',
67
- createdAt: '2025-01-01T00:00:00Z',
68
- updatedAt: '2025-12-15T00:00:00Z',
69
- createdBy: 'system',
70
- isOfficial: true,
71
- testable: false,
72
- };