Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

feat(dropbox): add AI-ready atomic actions for files and batch jobs (#15661)

Odai Ahmadea9f0f942e20
diff --git a/bun.lock b/bun.lock
index 2cf5072b798..3f65229e60a 100644
--- a/bun.lock
+++ b/bun.lock
@@ -2746,7 +2746,7 @@
},
"packages/pieces/community/dropbox": {
"name": "@activepieces/piece-dropbox",
- "version": "0.8.0",
+ "version": "0.9.0",
"dependencies": {
"@activepieces/core-piece-types": "workspace:*",
"@activepieces/core-utils": "workspace:*",
@@ -2755,6 +2755,7 @@
},
"devDependencies": {
"tslib": "2.6.2",
+ "vitest": "3.2.6",
},
},
"packages/pieces/community/drupal": {
diff --git a/packages/pieces/community/dropbox/package.json b/packages/pieces/community/dropbox/package.json
index 80670277d10..f88fcbb4c63 100644
--- a/packages/pieces/community/dropbox/package.json
+++ b/packages/pieces/community/dropbox/package.json
@@ -1,12 +1,13 @@
{
"name": "@activepieces/piece-dropbox",
- "version": "0.8.0",
+ "version": "0.9.0",
"main": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
"scripts": {
"build": "tsc -p tsconfig.lib.json && cp package.json dist/",
"bundle": "node ../../../../dist/packages/cli/src/index.js pieces bundle",
- "lint": "eslint 'src/**/*.ts'"
+ "lint": "eslint 'src/**/*.ts'",
+ "test": "vitest run"
},
"dependencies": {
"@activepieces/pieces-common": "workspace:*",
@@ -15,6 +16,7 @@
"@activepieces/core-utils": "workspace:*"
},
"devDependencies": {
- "tslib": "2.6.2"
+ "tslib": "2.6.2",
+ "vitest": "3.2.6"
}
}
diff --git a/packages/pieces/community/dropbox/src/i18n/translation.json b/packages/pieces/community/dropbox/src/i18n/translation.json
index 16968be7d81..48656899fa5 100644
--- a/packages/pieces/community/dropbox/src/i18n/translation.json
+++ b/packages/pieces/community/dropbox/src/i18n/translation.json
@@ -13,6 +13,41 @@
"Move folder": "Move folder",
"Copy folder": "Copy folder",
"List a folder": "List a folder",
+ "Get File Metadata": "Get File Metadata",
+ "List File Revisions": "List File Revisions",
+ "Restore File Revision": "Restore File Revision",
+ "Create Copy Reference": "Create Copy Reference",
+ "Save Copy Reference": "Save Copy Reference",
+ "Lock File": "Lock File",
+ "Unlock File": "Unlock File",
+ "Get File Lock": "Get File Lock",
+ "Create Upload Link": "Create Upload Link",
+ "Download Folder as Zip": "Download Folder as Zip",
+ "Get File Preview": "Get File Preview",
+ "Get File Thumbnail": "Get File Thumbnail",
+ "Get Thumbnails (Batch)": "Get Thumbnails (Batch)",
+ "Save URL to Dropbox": "Save URL to Dropbox",
+ "Get Save URL Status": "Get Save URL Status",
+ "Start Copy Batch": "Start Copy Batch",
+ "Get Copy Batch Status": "Get Copy Batch Status",
+ "Start Move Batch": "Start Move Batch",
+ "Get Move Batch Status": "Get Move Batch Status",
+ "Start Delete Batch": "Start Delete Batch",
+ "Get Delete Batch Status": "Get Delete Batch Status",
+ "Start Create Folder Batch": "Start Create Folder Batch",
+ "Get Create Folder Batch Status": "Get Create Folder Batch Status",
+ "Create Property Template": "Create Property Template",
+ "Get Property Template": "Get Property Template",
+ "List Property Templates": "List Property Templates",
+ "Update Property Template": "Update Property Template",
+ "Add File Properties": "Add File Properties",
+ "Overwrite File Properties": "Overwrite File Properties",
+ "Update File Properties": "Update File Properties",
+ "Remove File Properties": "Remove File Properties",
+ "Search File Properties": "Search File Properties",
+ "Copy Entry": "Copy Entry",
+ "Move Entry": "Move Entry",
+ "Delete Entry": "Delete Entry",
"Custom API Call": "Custom API Call",
"Search for files and folders": "Search for files and folders",
"Create a new text file from text input": "Create a new text file from text input",
@@ -27,6 +62,41 @@
"Move a folder": "Move a folder",
"Copy a folder": "Copy a folder",
"List the contents of a folder": "List the contents of a folder",
+ "Get metadata for a file or folder": "Get metadata for a file or folder",
+ "List the stored revisions of a file": "List the stored revisions of a file",
+ "Restore a file to a previous revision": "Restore a file to a previous revision",
+ "Create a copy reference for a file or folder": "Create a copy reference for a file or folder",
+ "Save a copy reference into this account": "Save a copy reference into this account",
+ "Temporarily lock a file against edits": "Temporarily lock a file against edits",
+ "Release a lock on a file": "Release a lock on a file",
+ "Check whether a file is locked": "Check whether a file is locked",
+ "Create a temporary link for uploading a file": "Create a temporary link for uploading a file",
+ "Download a folder as a zip archive": "Download a folder as a zip archive",
+ "Get a PDF or HTML preview of a document": "Get a PDF or HTML preview of a document",
+ "Get a thumbnail image for a file": "Get a thumbnail image for a file",
+ "Get thumbnails for several files at once": "Get thumbnails for several files at once",
+ "Download a URL into Dropbox": "Download a URL into Dropbox",
+ "Check the status of a Save URL job": "Check the status of a Save URL job",
+ "Copy many files or folders in one job": "Copy many files or folders in one job",
+ "Check the status of a copy batch job": "Check the status of a copy batch job",
+ "Move many files or folders in one job": "Move many files or folders in one job",
+ "Check the status of a move batch job": "Check the status of a move batch job",
+ "Delete many files or folders in one job": "Delete many files or folders in one job",
+ "Check the status of a delete batch job": "Check the status of a delete batch job",
+ "Create many folders in one job": "Create many folders in one job",
+ "Check the status of a create folder batch job": "Check the status of a create folder batch job",
+ "Create a custom metadata template": "Create a custom metadata template",
+ "Get a custom metadata template": "Get a custom metadata template",
+ "List custom metadata template IDs": "List custom metadata template IDs",
+ "Rename a template or add fields to it": "Rename a template or add fields to it",
+ "Attach custom metadata to a file": "Attach custom metadata to a file",
+ "Replace custom metadata on a file": "Replace custom metadata on a file",
+ "Change individual custom metadata fields": "Change individual custom metadata fields",
+ "Detach custom metadata from a file": "Detach custom metadata from a file",
+ "Find files by custom metadata value": "Find files by custom metadata value",
+ "Copy a file or folder": "Copy a file or folder",
+ "Move or rename a file or folder": "Move or rename a file or folder",
+ "Delete a file or folder": "Delete a file or folder",
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
"Query": "Query",
"Path": "Path",
@@ -48,14 +118,40 @@
"Allow Ownership Transfer": "Allow Ownership Transfer",
"Recursive": "Recursive",
"Limit": "Limit",
+ "Include Deleted": "Include Deleted",
+ "Include Media Info": "Include Media Info",
+ "Include Shared Members Flag": "Include Shared Members Flag",
+ "Property Template IDs": "Property Template IDs",
+ "Mode": "Mode",
+ "Revision": "Revision",
+ "Copy Reference": "Copy Reference",
+ "Destination Path": "Destination Path",
+ "Write Mode": "Write Mode",
+ "Duration (seconds)": "Duration (seconds)",
+ "Folder Path": "Folder Path",
+ "Format": "Format",
+ "Size": "Size",
+ "Paths": "Paths",
+ "URL": "URL",
+ "Async Job ID": "Async Job ID",
+ "Entries": "Entries",
+ "Template Name": "Template Name",
+ "Description": "Description",
+ "Fields": "Fields",
+ "Template ID": "Template ID",
+ "Fields to Add": "Fields to Add",
+ "Fields to Add or Update": "Fields to Add or Update",
+ "Fields to Remove": "Fields to Remove",
+ "Template IDs": "Template IDs",
+ "Field Name": "Field Name",
"Method": "Method",
"Headers": "Headers",
"Query Parameters": "Query Parameters",
"Body Type": "Body Type",
"Body": "Body",
- "Response is Binary ?": "Response is Binary ?",
- "No Error on Failure": "No Error on Failure",
- "Timeout (in seconds)": "Timeout (in seconds)",
+ "Response is Binary": "Response is Binary",
+ "Return Error as Output": "Return Error as Output",
+ "Timeout": "Timeout",
"Follow redirects": "Follow redirects",
"The search string. Must be at least 3 characters.": "The search string. Must be at least 3 characters.",
"The path to search in. If not specified, the search is performed from the root.": "The path to search in. If not specified, the search is performed from the root.",
@@ -92,22 +188,103 @@
"The path of the folder to be listed (e.g. /folder1). Use an empty string for the root folder.": "The path of the folder to be listed (e.g. /folder1). Use an empty string for the root folder.",
"If set to true, the list folder operation will be applied recursively to all subfolders and the response will contain contents of all subfolders.": "If set to true, the list folder operation will be applied recursively to all subfolders and the response will contain contents of all subfolders.",
"The maximum number of results to return (between 1 and 2000). Default is 2000 if not specified.": "The maximum number of results to return (between 1 and 2000). Default is 2000 if not specified.",
+ "The file or folder to inspect. Accepts a path (/folder/file.txt), an id (id:abc123) or a revision (rev:a1c10ce0dd78).": "The file or folder to inspect. Accepts a path (/folder/file.txt), an id (id:abc123) or a revision (rev:a1c10ce0dd78).",
+ "Return metadata for a deleted entry instead of failing when the path no longer exists.": "Return metadata for a deleted entry instead of failing when the path no longer exists.",
+ "Include photo and video metadata when available.": "Include photo and video metadata when available.",
+ "Include whether the entry has explicit shared members assigned.": "Include whether the entry has explicit shared members assigned.",
+ "Return the custom metadata stored under these templates, each in the form ptid:xxxx. Leave empty to omit custom metadata.": "Return the custom metadata stored under these templates, each in the form ptid:xxxx. Leave empty to omit custom metadata.",
+ "The file whose revisions to list. Accepts a path (/folder/file.txt) or an id (id:abc123).": "The file whose revisions to list. Accepts a path (/folder/file.txt) or an id (id:abc123).",
+ "Path returns revisions of whatever currently sits at the path; ID follows the same file across moves and renames.": "Path returns revisions of whatever currently sits at the path; ID follows the same file across moves and renames.",
+ "Maximum revisions to return, between 1 and 100.": "Maximum revisions to return, between 1 and 100.",
+ "The file to restore, as a path (/folder/file.txt). This endpoint does not accept id: or rev: values.": "The file to restore, as a path (/folder/file.txt). This endpoint does not accept id: or rev: values.",
+ "The revision to restore the file to. Obtain it from List File Revisions.": "The revision to restore the file to. Obtain it from List File Revisions.",
+ "The file or folder to reference. Accepts a path (/folder/file.txt), an id (id:abc123) or a revision (rev:a1c10ce0dd78).": "The file or folder to reference. Accepts a path (/folder/file.txt), an id (id:abc123) or a revision (rev:a1c10ce0dd78).",
+ "The reference string returned by Create Copy Reference.": "The reference string returned by Create Copy Reference.",
+ "Where to save the entry, as a path (/folder/file.txt). This endpoint does not accept id: or ns: values.": "Where to save the entry, as a path (/folder/file.txt). This endpoint does not accept id: or ns: values.",
+ "The file to lock. Accepts a path (/folder/file.txt) or an id (id:abc123), but not a rev: value.": "The file to lock. Accepts a path (/folder/file.txt) or an id (id:abc123), but not a rev: value.",
+ "The file to unlock. Accepts a path (/folder/file.txt) or an id (id:abc123), but not a rev: value.": "The file to unlock. Accepts a path (/folder/file.txt) or an id (id:abc123), but not a rev: value.",
+ "The file to check. Accepts a path (/folder/file.txt) or an id (id:abc123), but not a rev: value.": "The file to check. Accepts a path (/folder/file.txt) or an id (id:abc123), but not a rev: value.",
+ "Where the uploaded file will be written (e.g. /folder/file.txt). Accepts a path or an id (id:abc123).": "Where the uploaded file will be written (e.g. /folder/file.txt). Accepts a path or an id (id:abc123).",
+ "Add keeps any existing file and renames on conflict; Overwrite replaces it.": "Add keeps any existing file and renames on conflict; Overwrite replaces it.",
+ "Let Dropbox rename the upload if the path conflicts.": "Let Dropbox rename the upload if the path conflicts.",
+ "How long the link stays valid, between 60 and 14400 seconds. Defaults to 14400.": "How long the link stays valid, between 60 and 14400 seconds. Defaults to 14400.",
+ "The folder to download (e.g. /reports). Accepts a path, an id (id:abc123) or a revision (rev:a1c10ce0dd78).": "The folder to download (e.g. /reports). Accepts a path, an id (id:abc123) or a revision (rev:a1c10ce0dd78).",
+ "The document to preview. Accepts a path (/folder/report.docx), an id (id:abc123) or a revision (rev:a1c10ce0dd78).": "The document to preview. Accepts a path (/folder/report.docx), an id (id:abc123) or a revision (rev:a1c10ce0dd78).",
+ "The image file to thumbnail. Accepts a path (/folder/photo.jpg), an id (id:abc123) or a revision (rev:a1c10ce0dd78).": "The image file to thumbnail. Accepts a path (/folder/photo.jpg), an id (id:abc123) or a revision (rev:a1c10ce0dd78).",
+ "Strict keeps the requested dimensions exactly; the bestfit modes preserve the aspect ratio.": "Strict keeps the requested dimensions exactly; the bestfit modes preserve the aspect ratio.",
+ "The image files to thumbnail, at most 25. Each accepts a path (/folder/photo.jpg), an id (id:abc123) or a revision (rev:a1c10ce0dd78).": "The image files to thumbnail, at most 25. Each accepts a path (/folder/photo.jpg), an id (id:abc123) or a revision (rev:a1c10ce0dd78).",
+ "Where to save the file, as a path (/folder/file.pdf). This endpoint does not accept id: or ns: values.": "Where to save the file, as a path (/folder/file.pdf). This endpoint does not accept id: or ns: values.",
+ "The publicly reachable URL for Dropbox to download.": "The publicly reachable URL for Dropbox to download.",
+ "The job id returned by Save URL to Dropbox.": "The job id returned by Save URL to Dropbox.",
+ "Each entry needs a From Path and a To Path. Both accept a path (/folder/file.txt) or an id (id:abc123). At most 1000 entries.": "Each entry needs a From Path and a To Path. Both accept a path (/folder/file.txt) or an id (id:abc123). At most 1000 entries.",
+ "Let Dropbox rename an entry when its destination conflicts.": "Let Dropbox rename an entry when its destination conflicts.",
+ "The job id returned by Start Copy Batch.": "The job id returned by Start Copy Batch.",
+ "The job id returned by Start Move Batch.": "The job id returned by Start Move Batch.",
+ "The entries to delete, at most 1000. Each accepts a path (/folder/file.txt) or an id (id:abc123).": "The entries to delete, at most 1000. Each accepts a path (/folder/file.txt) or an id (id:abc123).",
+ "The job id returned by Start Delete Batch.": "The job id returned by Start Delete Batch.",
+ "The folders to create, at most 10000. Each must be a path such as /reports/2026; this endpoint does not accept id: values.": "The folders to create, at most 10000. Each must be a path such as /reports/2026; this endpoint does not accept id: values.",
+ "Let Dropbox rename a folder when its path conflicts.": "Let Dropbox rename a folder when its path conflicts.",
+ "The job id returned by Start Create Folder Batch.": "The job id returned by Start Create Folder Batch.",
+ "Display name for the template.": "Display name for the template.",
+ "What this template is for, up to 1024 bytes.": "What this template is for, up to 1024 bytes.",
+ "The named fields this template defines. All field values are stored as text.": "The named fields this template defines. All field values are stored as text.",
+ "The template id, in the form ptid:xxxx. Obtain it from List Property Templates.": "The template id, in the form ptid:xxxx. Obtain it from List Property Templates.",
+ "Leave blank to keep the current name.": "Leave blank to keep the current name.",
+ "Leave blank to keep the current description.": "Leave blank to keep the current description.",
+ "New fields to append. Existing fields cannot be removed or renamed.": "New fields to append. Existing fields cannot be removed or renamed.",
+ "The file to annotate. Accepts a path (/folder/file.txt) or an id (id:abc123).": "The file to annotate. Accepts a path (/folder/file.txt) or an id (id:abc123).",
+ "The template defining these fields, in the form ptid:xxxx. Obtain it from List Property Templates.": "The template defining these fields, in the form ptid:xxxx. Obtain it from List Property Templates.",
+ "Name and value for each property. Every name must exist in the template.": "Name and value for each property. Every name must exist in the template.",
+ "The complete set of name and value pairs. Any field omitted here is removed from the file.": "The complete set of name and value pairs. Any field omitted here is removed from the file.",
+ "The file to update. Accepts a path (/folder/file.txt) or an id (id:abc123).": "The file to update. Accepts a path (/folder/file.txt) or an id (id:abc123).",
+ "The template whose fields are being changed, in the form ptid:xxxx.": "The template whose fields are being changed, in the form ptid:xxxx.",
+ "Fields to set. Fields not listed here keep their values.": "Fields to set. Fields not listed here keep their values.",
+ "Names of fields to clear from the file.": "Names of fields to clear from the file.",
+ "The file to clear. Accepts a path (/folder/file.txt) or an id (id:abc123).": "The file to clear. Accepts a path (/folder/file.txt) or an id (id:abc123).",
+ "The templates whose property groups should be removed, each in the form ptid:xxxx.": "The templates whose property groups should be removed, each in the form ptid:xxxx.",
+ "The value to match in the named field.": "The value to match in the named field.",
+ "The template field to search, as named when the template was created.": "The template field to search, as named when the template was created.",
+ "The file or folder to copy. Accepts a path (/folder/file.txt) or an id (id:abc123).": "The file or folder to copy. Accepts a path (/folder/file.txt) or an id (id:abc123).",
+ "The destination path, for example /folder2/file.txt.": "The destination path, for example /folder2/file.txt.",
+ "Let Dropbox rename the copy when the destination conflicts.": "Let Dropbox rename the copy when the destination conflicts.",
+ "The file or folder to move. Accepts a path (/folder/file.txt) or an id (id:abc123).": "The file or folder to move. Accepts a path (/folder/file.txt) or an id (id:abc123).",
+ "The destination path, for example /folder2/renamed.txt.": "The destination path, for example /folder2/renamed.txt.",
+ "Let Dropbox rename the entry when the destination conflicts.": "Let Dropbox rename the entry when the destination conflicts.",
+ "The file or folder to delete. Accepts a path (/folder/file.txt) or an id (id:abc123).": "The file or folder to delete. Accepts a path (/folder/file.txt) or an id (id:abc123).",
"Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",
+ "Appended to the URL as ?key=value.": "Appended to the URL as ?key=value.",
"Enable for files like PDFs, images, etc.": "Enable for files like PDFs, images, etc.",
+ "On a failed request, output the error instead of failing the step.": "On a failed request, output the error instead of failing the step.",
+ "Seconds to wait for a response. Empty: up to the flow limit (10 min).": "Seconds to wait for a response. Empty: up to the flow limit (10 min).",
+ "Follow 3xx redirects instead of returning them as the response.": "Follow 3xx redirects instead of returning them as the response.",
"Relevance": "Relevance",
"Modified Time": "Modified Time",
"Active": "Active",
"Deleted": "Deleted",
+ "ID": "ID",
+ "Add": "Add",
+ "Overwrite": "Overwrite",
+ "JPEG": "JPEG",
+ "PNG": "PNG",
+ "WebP": "WebP",
+ "32x32": "32x32",
+ "64x64": "64x64",
+ "128x128": "128x128",
+ "256x256": "256x256",
+ "480x320": "480x320",
+ "640x480": "640x480",
+ "960x640": "960x640",
+ "1024x768": "1024x768",
+ "2048x1536": "2048x1536",
+ "Strict": "Strict",
+ "Best Fit": "Best Fit",
+ "Fit One, Best Fit": "Fit One, Best Fit",
"GET": "GET",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "DELETE",
"HEAD": "HEAD",
- "None": "None",
- "JSON": "JSON",
- "Form Data": "Form Data",
- "Raw": "Raw",
"New Folder": "New Folder",
"Triggers when a new folder is created inside a watched Dropbox folder.": "Triggers when a new folder is created inside a watched Dropbox folder.",
"Watched Folder Path": "Watched Folder Path",
diff --git a/packages/pieces/community/dropbox/src/index.ts b/packages/pieces/community/dropbox/src/index.ts
index 1895158d169..45658d681aa 100644
--- a/packages/pieces/community/dropbox/src/index.ts
+++ b/packages/pieces/community/dropbox/src/index.ts
@@ -17,10 +17,36 @@ import { dropboxSearch } from './lib/actions/search';
import { dropboxUploadFile } from './lib/actions/upload-file';
import { dropboxDownloadFile } from './lib/actions/download-file';
import { dropboxAuth } from './lib/auth';
+import { dropboxGetFileMetadata } from './lib/actions/get-file-metadata';
+import { dropboxListFileRevisions } from './lib/actions/list-file-revisions';
+import { dropboxRestoreFile } from './lib/actions/restore-file';
+import { dropboxCreateCopyReference } from './lib/actions/create-copy-reference';
+import { dropboxSaveCopyReference } from './lib/actions/save-copy-reference';
+import { dropboxLockFile } from './lib/actions/lock-file';
+import { dropboxUnlockFile } from './lib/actions/unlock-file';
+import { dropboxGetFileLock } from './lib/actions/get-file-lock';
+import { dropboxCreateUploadLink } from './lib/actions/create-upload-link';
+import { dropboxDownloadFolderAsZip } from './lib/actions/download-folder-as-zip';
+import { dropboxGetFilePreview } from './lib/actions/get-file-preview';
+import { dropboxGetFileThumbnail } from './lib/actions/get-file-thumbnail';
+import { dropboxGetThumbnailsBatch } from './lib/actions/get-thumbnails-batch';
+import { dropboxSaveUrl } from './lib/actions/save-url';
+import { dropboxGetSaveUrlStatus } from './lib/actions/get-save-url-status';
+import { dropboxStartCopyBatch } from './lib/actions/start-copy-batch';
+import { dropboxGetCopyBatchStatus } from './lib/actions/get-copy-batch-status';
+import { dropboxStartMoveBatch } from './lib/actions/start-move-batch';
+import { dropboxGetMoveBatchStatus } from './lib/actions/get-move-batch-status';
+import { dropboxStartDeleteBatch } from './lib/actions/start-delete-batch';
+import { dropboxGetDeleteBatchStatus } from './lib/actions/get-delete-batch-status';
+import { dropboxStartCreateFolderBatch } from './lib/actions/start-create-folder-batch';
+import { dropboxGetCreateFolderBatchStatus } from './lib/actions/get-create-folder-batch-status';
+import { dropboxCopyEntry } from './lib/actions/copy-entry';
+import { dropboxMoveEntry } from './lib/actions/move-entry';
+import { dropboxDeleteEntry } from './lib/actions/delete-entry';
import { dropboxNewFolder } from './lib/triggers/new-folder';
export const dropbox = createPiece({
- minimumSupportedRelease: '0.30.0',
+ minimumSupportedRelease: '0.86.4',
logoUrl: 'https://cdn.activepieces.com/pieces/dropbox.png',
actions: [
dropboxSearch,
@@ -36,6 +62,32 @@ export const dropbox = createPiece({
dropboxMoveFolder,
dropboxCopyFolder,
dropboxListAFolder,
+ dropboxGetFileMetadata,
+ dropboxListFileRevisions,
+ dropboxRestoreFile,
+ dropboxCreateCopyReference,
+ dropboxSaveCopyReference,
+ dropboxLockFile,
+ dropboxUnlockFile,
+ dropboxGetFileLock,
+ dropboxCreateUploadLink,
+ dropboxDownloadFolderAsZip,
+ dropboxGetFilePreview,
+ dropboxGetFileThumbnail,
+ dropboxGetThumbnailsBatch,
+ dropboxSaveUrl,
+ dropboxGetSaveUrlStatus,
+ dropboxStartCopyBatch,
+ dropboxGetCopyBatchStatus,
+ dropboxStartMoveBatch,
+ dropboxGetMoveBatchStatus,
+ dropboxStartDeleteBatch,
+ dropboxGetDeleteBatchStatus,
+ dropboxStartCreateFolderBatch,
+ dropboxGetCreateFolderBatchStatus,
+ dropboxCopyEntry,
+ dropboxMoveEntry,
+ dropboxDeleteEntry,
createCustomApiCallAction({
baseUrl: () => 'https://api.dropboxapi.com/2',
auth: dropboxAuth,
diff --git a/packages/pieces/community/dropbox/src/lib/actions/copy-entry.ts b/packages/pieces/community/dropbox/src/lib/actions/copy-entry.ts
new file mode 100644
index 00000000000..3ac66a534be
--- /dev/null
+++ b/packages/pieces/community/dropbox/src/lib/actions/copy-entry.ts
@@ -0,0 +1,49 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { dropboxAuth } from '../auth';
+import { dropboxCommon } from '../common';
+import { entryOperationOutputSchema } from '../output-schemas';
+
+export const dropboxCopyEntry = createAction({
+ auth: dropboxAuth,
+ name: 'copy_dropbox_entry',
+ classification: 'WRITE',
+ displayName: 'Copy Entry',
+ description: 'Copy a file or folder',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Copies a Dropbox file or folder to a new path, leaving the original in place. Handles both files and folders, so no separate action is needed for each. Use Start Copy Batch for many entries at once. Not idempotent: each call creates another copy, so repeating it conflicts or, with autorename, produces duplicates.',
+ idempotent: false,
+ },
+ outputSchema: entryOperationOutputSchema,
+ props: {
+ from_path: Property.ShortText({
+ displayName: 'From Path',
+ description:
+ 'The file or folder to copy. Accepts a path (/folder/file.txt) or an id (id:abc123).',
+ required: true,
+ }),
+ to_path: Property.ShortText({
+ displayName: 'To Path',
+ description: 'The destination path, for example /folder2/file.txt.',
+ required: true,
+ }),
+ autorename: Property.Checkbox({
+ displayName: 'Auto Rename',
+ description: 'Let Dropbox rename the copy when the destination conflicts.',
+ defaultValue: false,
+ required: false,
+ }),
+ },
+ async run(context) {
+ return await dropboxCommon.rpc({
+ auth: context.auth.access_token,
+ path: '/files/copy_v2',
+ body: {
+ from_path: context.propsValue.from_path,
+ to_path: context.propsValue.to_path,
+ autorename: context.propsValue.autorename ?? false,
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/dropbox/src/lib/actions/copy-file.ts b/packages/pieces/community/dropbox/src/lib/actions/copy-file.ts
index a49f5868ac2..8e3a3c3161c 100644
--- a/packages/pieces/community/dropbox/src/lib/actions/copy-file.ts
+++ b/packages/pieces/community/dropbox/src/lib/actions/copy-file.ts
@@ -12,7 +12,7 @@ export const dropboxCopyFile = createAction({
name: 'copy_dropbox_file',
classification: 'WRITE',
description: 'Copy a file',
- audience: 'both',
+ audience: 'human',
aiMetadata: { description: 'Copies the file at the source path to a new destination path within Dropbox, leaving the original in place; optionally autorenames on conflict. Use to duplicate a single file. Not idempotent: each call creates a copy, so repeating it errors on conflict or, with autorename, produces additional duplicates.', idempotent: false },
displayName: 'Copy file',
outputSchema: fileMetadataOutputSchema,
diff --git a/packages/pieces/community/dropbox/src/lib/actions/copy-folder.ts b/packages/pieces/community/dropbox/src/lib/actions/copy-folder.ts
index 3230d77aef5..97e28e5521a 100644
--- a/packages/pieces/community/dropbox/src/lib/actions/copy-folder.ts
+++ b/packages/pieces/community/dropbox/src/lib/actions/copy-folder.ts
@@ -12,7 +12,7 @@ export const dropboxCopyFolder = createAction({
name: 'copy_dropbox_folder',
classification: 'WRITE',
description: 'Copy a folder',
- audience: 'both',
+ audience: 'human',
aiMetadata: { description: 'Copies the folder at the source path, including its contents, to a new destination path within Dropbox, leaving the original in place; optionally autorenames on conflict. Use to duplicate an entire directory. Not idempotent: each call creates a copy, so repeating it errors on conflict or, with autorename, produces additional duplicates.', idempotent: false },
displayName: 'Copy folder',
outputSchema: folderMetadataOutputSchema,
diff --git a/packages/pieces/community/dropbox/src/lib/actions/create-copy-reference.ts b/packages/pieces/community/dropbox/src/lib/actions/create-copy-reference.ts
new file mode 100644
index 00000000000..2c2130666eb
--- /dev/null
+++ b/packages/pieces/community/dropbox/src/lib/actions/create-copy-reference.ts
@@ -0,0 +1,34 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { dropboxAuth } from '../auth';
+import { dropboxCommon } from '../common';
+import { copyReferenceOutputSchema } from '../output-schemas';
+
+export const dropboxCreateCopyReference = createAction({
+ auth: dropboxAuth,
+ name: 'create_dropbox_copy_reference',
+ classification: 'WRITE',
+ displayName: 'Create Copy Reference',
+ description: 'Create a copy reference for a file or folder',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Creates a copy reference for a Dropbox file or folder, which Save Copy Reference can then use to copy it into a different Dropbox account. Use only for cross-account copies; within one account use Copy Dropbox Entry instead. The response carries the reference and its expiry date. Not idempotent: each call mints a new reference.',
+ idempotent: false,
+ },
+ outputSchema: copyReferenceOutputSchema,
+ props: {
+ path: Property.ShortText({
+ displayName: 'Path',
+ description:
+ 'The file or folder to reference. Accepts a path (/folder/file.txt), an id (id:abc123) or a revision (rev:a1c10ce0dd78).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ return await dropboxCommon.rpc({
+ auth: context.auth.access_token,
+ path: '/files/copy_reference/get',
+ body: { path: context.propsValue.path },
+ });
+ },
+});
diff --git a/packages/pieces/community/dropbox/src/lib/actions/create-upload-link.ts b/packages/pieces/community/dropbox/src/lib/actions/create-upload-link.ts
new file mode 100644
index 00000000000..ecf9e78a11a
--- /dev/null
+++ b/packages/pieces/community/dropbox/src/lib/actions/create-upload-link.ts
@@ -0,0 +1,71 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { dropboxAuth } from '../auth';
+import { dropboxCommon } from '../common';
+import { uploadLinkOutputSchema } from '../output-schemas';
+
+export const dropboxCreateUploadLink = createAction({
+ auth: dropboxAuth,
+ name: 'create_dropbox_upload_link',
+ classification: 'WRITE',
+ displayName: 'Create Upload Link',
+ description: 'Create a temporary link for uploading a file',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Creates a temporary URL that accepts a file upload to a fixed Dropbox path without further authentication. Use to hand an upload destination to an external system; use Upload File instead when the flow already holds the file. Not idempotent: each call mints a new link with its own expiry.',
+ idempotent: false,
+ },
+ outputSchema: uploadLinkOutputSchema,
+ props: {
+ path: Property.ShortText({
+ displayName: 'Destination Path',
+ description:
+ 'Where the uploaded file will be written (e.g. /folder/file.txt). Accepts a path or an id (id:abc123).',
+ required: true,
+ }),
+ mode: Property.StaticDropdown({
+ displayName: 'Write Mode',
+ description:
+ 'Add keeps any existing file and renames on conflict; Overwrite replaces it.',
+ required: false,
+ defaultValue: 'add',
+ options: {
+ options: [
+ { label: 'Add', value: 'add' },
+ { label: 'Overwrite', value: 'overwrite' },
+ ],
+ },
+ }),
+ autorename: Property.Checkbox({
+ displayName: 'Auto Rename',
+ description: 'Let Dropbox rename the upload if the path conflicts.',
+ defaultValue: false,
+ required: false,
+ }),
+ duration: Property.Number({
+ displayName: 'Duration (seconds)',
+ description:
+ 'How long the link stays valid, between 60 and 14400 seconds. Defaults to 14400.',
+ defaultValue: 14400,
+ required: false,
+ }),
+ },
+ async run(context) {
+ const duration = context.propsValue.duration ?? 14400;
+ if (duration < 60 || duration > 14400) {
+ throw new Error('Duration must be between 60 and 14400 seconds.');
+ }
+ return await dropboxCommon.rpc({
+ auth: context.auth.access_token,
+ path: '/files/get_temporary_upload_link',
+ body: {
+ commit_info: {
+ path: context.propsValue.path,
+ mode: context.propsValue.mode ?? 'add',
+ autorename: context.propsValue.autorename ?? false,
+ },
+ duration,
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/dropbox/src/lib/actions/delete-entry.ts b/packages/pieces/community/dropbox/src/lib/actions/delete-entry.ts
new file mode 100644
index 00000000000..123e5cc3977
--- /dev/null
+++ b/packages/pieces/community/dropbox/src/lib/actions/delete-entry.ts
@@ -0,0 +1,34 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { dropboxAuth } from '../auth';
+import { dropboxCommon } from '../common';
+import { entryOperationOutputSchema } from '../output-schemas';
+
+export const dropboxDeleteEntry = createAction({
+ auth: dropboxAuth,
+ name: 'delete_dropbox_entry',
+ classification: 'DESTRUCTIVE',
+ displayName: 'Delete Entry',
+ description: 'Delete a file or folder',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Deletes a Dropbox file or folder, sending it to trash where it stays restorable rather than erasing it. Deleting a folder also deletes everything inside it. Handles both files and folders, so no separate action is needed for each. Not idempotent: a second call fails because the path is already gone.',
+ idempotent: false,
+ },
+ outputSchema: entryOperationOutputSchema,
+ props: {
+ path: Property.ShortText({
+ displayName: 'Path',
+ description:
+ 'The file or folder to delete. Accepts a path (/folder/file.txt) or an id (id:abc123).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ return await dropboxCommon.rpc({
+ auth: context.auth.access_token,
+ path: '/files/delete_v2',
+ body: { path: context.propsValue.path },
+ });
+ },
+});
diff --git a/packages/pieces/community/dropbox/src/lib/actions/delete-file.ts b/packages/pieces/community/dropbox/src/lib/actions/delete-file.ts
index b9f1a1dffa0..8d3cd66e132 100644
--- a/packages/pieces/community/dropbox/src/lib/actions/delete-file.ts
+++ b/packages/pieces/community/dropbox/src/lib/actions/delete-file.ts
@@ -12,7 +12,7 @@ export const dropboxDeleteFile = createAction({
name: 'delete_dropbox_file',
classification: 'DESTRUCTIVE',
description: 'Delete a file',
- audience: 'both',
+ audience: 'human',
aiMetadata: { description: 'Permanently deletes the file at the given Dropbox path. Use to remove a specific file an agent has resolved the path for. Effectively idempotent on the end state once the path is gone, but a repeat call fails because the path no longer exists; treat as a destructive, non-recoverable mutation.', idempotent: false },
displayName: 'Delete file',
outputSchema: fileMetadataOutputSchema,
@@ -25,10 +25,6 @@ export const dropboxDeleteFile = createAction({
}),
},
async run(context) {
- const params = {
- path: context.propsValue.path,
- };
-
const result = await httpClient.sendRequest({
method: HttpMethod.POST,
url: `https://api.dropboxapi.com/2/files/delete_v2`,
diff --git a/packages/pieces/community/dropbox/src/lib/actions/delete-folder.ts b/packages/pieces/community/dropbox/src/lib/actions/delete-folder.ts
index 954d9f06c3d..62053a34f18 100644
--- a/packages/pieces/community/dropbox/src/lib/actions/delete-folder.ts
+++ b/packages/pieces/community/dropbox/src/lib/actions/delete-folder.ts
@@ -12,7 +12,7 @@ export const dropboxDeleteFolder = createAction({
name: 'delete_dropbox_folder',
classification: 'DESTRUCTIVE',
description: 'Delete a folder',
- audience: 'both',
+ audience: 'human',
aiMetadata: { description: 'Permanently deletes the folder at the given Dropbox path along with all of its contents. Use to remove an entire directory. Effectively idempotent on the end state once the path is gone, but a repeat call fails because the path no longer exists; treat as a destructive, non-recoverable mutation.', idempotent: false },
displayName: 'Delete folder',
outputSchema: folderMetadataOutputSchema,
diff --git a/packages/pieces/community/dropbox/src/lib/actions/download-folder-as-zip.ts b/packages/pieces/community/dropbox/src/lib/actions/download-folder-as-zip.ts
new file mode 100644
index 00000000000..c972a19ef24
--- /dev/null
+++ b/packages/pieces/community/dropbox/src/lib/actions/download-folder-as-zip.ts
@@ -0,0 +1,45 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { dropboxAuth } from '../auth';
+import { dropboxCommon } from '../common';
+import { zipDownloadOutputSchema } from '../output-schemas';
+
+export const dropboxDownloadFolderAsZip = createAction({
+ auth: dropboxAuth,
+ name: 'download_dropbox_folder_as_zip',
+ classification: 'READ',
+ displayName: 'Download Folder as Zip',
+ description: 'Download a folder as a zip archive',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Downloads an entire Dropbox folder as a single zip archive and returns it as a file object. Use to retrieve a whole folder in one step instead of listing it and downloading each file. The folder must be under 20 GB and contain fewer than 10,000 files. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: zipDownloadOutputSchema,
+ props: {
+ path: Property.ShortText({
+ displayName: 'Folder Path',
+ description:
+ 'The folder to download (e.g. /reports). Accepts a path, an id (id:abc123) or a revision (rev:a1c10ce0dd78).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const folderName =
+ (context.propsValue.path.match(/[^/]+$/) ?? ['dropbox-folder'])[0];
+ const { data, result } = await dropboxCommon.download<{
+ metadata?: unknown;
+ }>({
+ auth: context.auth.access_token,
+ path: '/files/download_zip',
+ arg: { path: context.propsValue.path },
+ });
+ return {
+ file: await context.files.write({
+ fileName: `${folderName}.zip`,
+ data,
+ }),
+ metadata: result?.metadata,
+ };
+ },
+});
diff --git a/packages/pieces/community/dropbox/src/lib/actions/get-copy-batch-status.ts b/packages/pieces/community/dropbox/src/lib/actions/get-copy-batch-status.ts
new file mode 100644
index 00000000000..492a36df091
--- /dev/null
+++ b/packages/pieces/community/dropbox/src/lib/actions/get-copy-batch-status.ts
@@ -0,0 +1,33 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { dropboxAuth } from '../auth';
+import { dropboxCommon } from '../common';
+import { relocationStatusOutputSchema } from '../output-schemas';
+
+export const dropboxGetCopyBatchStatus = createAction({
+ auth: dropboxAuth,
+ name: 'get_dropbox_copy_batch_status',
+ classification: 'READ',
+ displayName: 'Get Copy Batch Status',
+ description: 'Check the status of a copy batch job',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Reads the status of a copy batch started by Start Copy Batch, returning in_progress or complete with one result per entry. Dropbox reports no overall failure for this job, so check each entry: a batch where every entry failed still reports complete. Call once per check rather than looping. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: relocationStatusOutputSchema,
+ props: {
+ async_job_id: Property.ShortText({
+ displayName: 'Async Job ID',
+ description: 'The job id returned by Start Copy Batch.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ return await dropboxCommon.rpc({
+ auth: context.auth.access_token,
+ path: '/files/copy_batch/check_v2',
+ body: { async_job_id: context.propsValue.async_job_id },
+ });
+ },
+});
diff --git a/packages/pieces/community/dropbox/src/lib/actions/get-create-folder-batch-status.ts b/packages/pieces/community/dropbox/src/lib/actions/get-create-folder-batch-status.ts
new file mode 100644
index 00000000000..37ab3e675df
--- /dev/null
+++ b/packages/pieces/community/dropbox/src/lib/actions/get-create-folder-batch-status.ts
@@ -0,0 +1,33 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { dropboxAuth } from '../auth';
+import { dropboxCommon } from '../common';
+import { createFolderBatchStatusOutputSchema } from '../output-schemas';
+
+export const dropboxGetCreateFolderBatchStatus = createAction({
+ auth: dropboxAuth,
+ name: 'get_dropbox_create_folder_batch_status',
+ classification: 'READ',
+ displayName: 'Get Create Folder Batch Status',
+ description: 'Check the status of a create folder batch job',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Reads the status of a folder batch started by Start Create Folder Batch, returning in_progress, complete with one result per folder, or failed. Check each entry as well as the overall status, since individual folders can fail inside a complete job. Call once per check rather than looping. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: createFolderBatchStatusOutputSchema,
+ props: {
+ async_job_id: Property.ShortText({
+ displayName: 'Async Job ID',
+ description: 'The job id returned by Start Create Folder Batch.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ return await dropboxCommon.rpc({
+ auth: context.auth.access_token,
+ path: '/files/create_folder_batch/check',
+ body: { async_job_id: context.propsValue.async_job_id },
+ });
+ },
+});
diff --git a/packages/pieces/community/dropbox/src/lib/actions/get-delete-batch-status.ts b/packages/pieces/community/dropbox/src/lib/actions/get-delete-batch-status.ts
new file mode 100644
index 00000000000..b8fa06c3320
--- /dev/null
+++ b/packages/pieces/community/dropbox/src/lib/actions/get-delete-batch-status.ts
@@ -0,0 +1,33 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { dropboxAuth } from '../auth';
+import { dropboxCommon } from '../common';
+import { deleteBatchStatusOutputSchema } from '../output-schemas';
+
+export const dropboxGetDeleteBatchStatus = createAction({
+ auth: dropboxAuth,
+ name: 'get_dropbox_delete_batch_status',
+ classification: 'READ',
+ displayName: 'Get Delete Batch Status',
+ description: 'Check the status of a delete batch job',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Reads the status of a delete batch started by Start Delete Batch, returning in_progress, complete with one result per entry, or failed. Check each entry as well as the overall status, since individual paths can fail inside a complete job. Call once per check rather than looping. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: deleteBatchStatusOutputSchema,
+ props: {
+ async_job_id: Property.ShortText({
+ displayName: 'Async Job ID',
+ description: 'The job id returned by Start Delete Batch.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ return await dropboxCommon.rpc({
+ auth: context.auth.access_token,
+ path: '/files/delete_batch/check',
+ body: { async_job_id: context.propsValue.async_job_id },
+ });
+ },
+});
diff --git a/packages/pieces/community/dropbox/src/lib/actions/get-file-link.ts b/packages/pieces/community/dropbox/src/lib/actions/get-file-link.ts
index f46713012c6..3a17231f644 100644
--- a/packages/pieces/community/dropbox/src/lib/actions/get-file-link.ts
+++ b/packages/pieces/community/dropbox/src/lib/actions/get-file-link.ts
@@ -24,10 +24,6 @@ export const dropboxGetFileLink = createAction({
}),
},
async run(context) {
- const params = {
- path: context.propsValue.path,
- };
-
const result = await httpClient.sendRequest({
method: HttpMethod.POST,
url: `https://api.dropboxapi.com/2/files/get_temporary_link`,
diff --git a/packages/pieces/community/dropbox/src/lib/actions/get-file-lock.ts b/packages/pieces/community/dropbox/src/lib/actions/get-file-lock.ts
new file mode 100644
index 00000000000..b556ee0780c
--- /dev/null
+++ b/packages/pieces/community/dropbox/src/lib/actions/get-file-lock.ts
@@ -0,0 +1,35 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { dropboxAuth } from '../auth';
+import { dropboxCommon } from '../common';
+import { lockResultOutputSchema } from '../output-schemas';
+
+export const dropboxGetFileLock = createAction({
+ auth: dropboxAuth,
+ name: 'get_dropbox_file_lock',
+ classification: 'READ',
+ displayName: 'Get File Lock',
+ description: 'Check whether a file is locked',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Reports whether a Dropbox file is currently locked, who holds the lock and when it was taken. Use to check before editing a shared file rather than attempting a write and handling the failure. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: lockResultOutputSchema,
+ props: {
+ path: Property.ShortText({
+ displayName: 'Path',
+ description:
+ 'The file to check. Accepts a path (/folder/file.txt) or an id (id:abc123), but not a rev: value.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const response = await dropboxCommon.rpc<{ entries?: unknown }>({
+ auth: context.auth.access_token,
+ path: '/files/get_file_lock_batch',
+ body: { entries: [{ path: context.propsValue.path }] },
+ });
+ return dropboxCommon.unwrapEntry({ entries: response.entries, action: 'read the file lock' });
+ },
+});
diff --git a/packages/pieces/community/dropbox/src/lib/actions/get-file-metadata.ts b/packages/pieces/community/dropbox/src/lib/actions/get-file-metadata.ts
new file mode 100644
index 00000000000..9ec9ce4d9c8
--- /dev/null
+++ b/packages/pieces/community/dropbox/src/lib/actions/get-file-metadata.ts
@@ -0,0 +1,61 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { dropboxAuth } from '../auth';
+import { dropboxCommon } from '../common';
+import { entryMetadataOutputSchema } from '../output-schemas';
+
+export const dropboxGetFileMetadata = createAction({
+ auth: dropboxAuth,
+ name: 'get_dropbox_file_metadata',
+ classification: 'READ',
+ displayName: 'Get File Metadata',
+ description: 'Get metadata for a file or folder',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Returns metadata for a single Dropbox file or folder: name, id, path, size, revision and modification times. Use to inspect one known entry, or to resolve a path into the id and rev that other actions require; use Search Dropbox instead when looking for entries by name. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: entryMetadataOutputSchema,
+ props: {
+ path: Property.ShortText({
+ displayName: 'Path',
+ description:
+ 'The file or folder to inspect. Accepts a path (/folder/file.txt), an id (id:abc123) or a revision (rev:a1c10ce0dd78).',
+ required: true,
+ }),
+ include_deleted: Property.Checkbox({
+ displayName: 'Include Deleted',
+ description:
+ 'Return metadata for a deleted entry instead of failing when the path no longer exists.',
+ defaultValue: false,
+ required: false,
+ }),
+ include_media_info: Property.Checkbox({
+ displayName: 'Include Media Info',
+ description: 'Include photo and video metadata when available.',
+ defaultValue: false,
+ required: false,
+ }),
+ include_has_explicit_shared_members: Property.Checkbox({
+ displayName: 'Include Shared Members Flag',
+ description:
+ 'Include whether the entry has explicit shared members assigned.',
+ defaultValue: false,
+ required: false,
+ }),
+ },
+ async run(context) {
+ const body: Record<string, unknown> = {
+ path: context.propsValue.path,
+ include_deleted: context.propsValue.include_deleted ?? false,
+ include_media_info: context.propsValue.include_media_info ?? false,
+ include_has_explicit_shared_members:
+ context.propsValue.include_has_explicit_shared_members ?? false,
+ };
+ return await dropboxCommon.rpc({
+ auth: context.auth.access_token,
+ path: '/files/get_metadata',
+ body,
+ });
+ },
+});
diff --git a/packages/pieces/community/dropbox/src/lib/actions/get-file-preview.ts b/packages/pieces/community/dropbox/src/lib/actions/get-file-preview.ts
new file mode 100644
index 00000000000..5b5314b5fb3
--- /dev/null
+++ b/packages/pieces/community/dropbox/src/lib/actions/get-file-preview.ts
@@ -0,0 +1,44 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { dropboxAuth } from '../auth';
+import { dropboxCommon } from '../common';
+import { filePreviewOutputSchema } from '../output-schemas';
+
+export const dropboxGetFilePreview = createAction({
+ auth: dropboxAuth,
+ name: 'get_dropbox_file_preview',
+ classification: 'READ',
+ displayName: 'Get File Preview',
+ description: 'Get a PDF or HTML preview of a document',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Returns a PDF or HTML preview of a Dropbox document and its metadata. Supports office and text formats such as doc, docx, xls, xlsx, ppt, pptx, rtf and csv; use Get File Thumbnail for images. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: filePreviewOutputSchema,
+ props: {
+ path: Property.ShortText({
+ displayName: 'Path',
+ description:
+ 'The document to preview. Accepts a path (/folder/report.docx), an id (id:abc123) or a revision (rev:a1c10ce0dd78).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const baseName = (context.propsValue.path.match(/[^/]+$/) ?? ['preview'])[0];
+ const { data, result, contentType } = await dropboxCommon.download({
+ auth: context.auth.access_token,
+ path: '/files/get_preview',
+ arg: { path: context.propsValue.path },
+ });
+ const extension = dropboxCommon.previewExtensionFor(contentType);
+ return {
+ file: await context.files.write({
+ fileName: `${baseName.replace(/\.[^.]+$/, '')}.${extension}`,
+ data,
+ }),
+ contentType,
+ metadata: result,
+ };
+ },
+});
diff --git a/packages/pieces/community/dropbox/src/lib/actions/get-file-thumbnail.ts b/packages/pieces/community/dropbox/src/lib/actions/get-file-thumbnail.ts
new file mode 100644
index 00000000000..4b289a8b683
--- /dev/null
+++ b/packages/pieces/community/dropbox/src/lib/actions/get-file-thumbnail.ts
@@ -0,0 +1,94 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { dropboxAuth } from '../auth';
+import { dropboxCommon } from '../common';
+import { fileThumbnailOutputSchema } from '../output-schemas';
+
+export const dropboxGetFileThumbnail = createAction({
+ auth: dropboxAuth,
+ name: 'get_dropbox_file_thumbnail',
+ classification: 'READ',
+ displayName: 'Get File Thumbnail',
+ description: 'Get a thumbnail image for a file',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Returns a thumbnail image for a single Dropbox image file as a file object, with its metadata. Supports jpg, jpeg, png, tiff, tif, gif, webp, ppm and bmp under 20 MB; use Get Thumbnails (Batch) for many files at once. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: fileThumbnailOutputSchema,
+ props: {
+ path: Property.ShortText({
+ displayName: 'Path',
+ description:
+ 'The image file to thumbnail. Accepts a path (/folder/photo.jpg), an id (id:abc123) or a revision (rev:a1c10ce0dd78).',
+ required: true,
+ }),
+ format: Property.StaticDropdown({
+ displayName: 'Format',
+ required: false,
+ defaultValue: 'jpeg',
+ options: {
+ options: [
+ { label: 'JPEG', value: 'jpeg' },
+ { label: 'PNG', value: 'png' },
+ { label: 'WebP', value: 'webp' },
+ ],
+ },
+ }),
+ size: Property.StaticDropdown({
+ displayName: 'Size',
+ required: false,
+ defaultValue: 'w64h64',
+ options: {
+ options: [
+ { label: '32x32', value: 'w32h32' },
+ { label: '64x64', value: 'w64h64' },
+ { label: '128x128', value: 'w128h128' },
+ { label: '256x256', value: 'w256h256' },
+ { label: '480x320', value: 'w480h320' },
+ { label: '640x480', value: 'w640h480' },
+ { label: '960x640', value: 'w960h640' },
+ { label: '1024x768', value: 'w1024h768' },
+ { label: '2048x1536', value: 'w2048h1536' },
+ ],
+ },
+ }),
+ mode: Property.StaticDropdown({
+ displayName: 'Mode',
+ description:
+ 'Strict keeps the requested dimensions exactly; the bestfit modes preserve the aspect ratio.',
+ required: false,
+ defaultValue: 'strict',
+ options: {
+ options: [
+ { label: 'Strict', value: 'strict' },
+ { label: 'Best Fit', value: 'bestfit' },
+ { label: 'Fit One, Best Fit', value: 'fitone_bestfit' },
+ ],
+ },
+ }),
+ },
+ async run(context) {
+ const format = context.propsValue.format ?? 'jpeg';
+ const baseName = (context.propsValue.path.match(/[^/]+$/) ?? ['thumbnail'])[0];
+ const { data, result } = await dropboxCommon.download({
+ auth: context.auth.access_token,
+ path: '/files/get_thumbnail_v2',
+ arg: {
+ resource: { '.tag': 'path', path: context.propsValue.path },
+ format,
+ size: context.propsValue.size ?? 'w64h64',
+ mode: context.propsValue.mode ?? 'strict',
+ },
+ });
+ return {
+ file: await context.files.write({
+ fileName: `${baseName.replace(/\.[^.]+$/, '')}.${
+ format === 'jpeg' ? 'jpg' : format
+ }`,
+ data,
+ }),
+ metadata: result,
+ };
+ },
+});
diff --git a/packages/pieces/community/dropbox/src/lib/actions/get-move-batch-status.ts b/packages/pieces/community/dropbox/src/lib/actions/get-move-batch-status.ts
new file mode 100644
index 00000000000..abef630011c
--- /dev/null
+++ b/packages/pieces/community/dropbox/src/lib/actions/get-move-batch-status.ts
@@ -0,0 +1,33 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { dropboxAuth } from '../auth';
+import { dropboxCommon } from '../common';
+import { relocationStatusOutputSchema } from '../output-schemas';
+
+export const dropboxGetMoveBatchStatus = createAction({
+ auth: dropboxAuth,
+ name: 'get_dropbox_move_batch_status',
+ classification: 'READ',
+ displayName: 'Get Move Batch Status',
+ description: 'Check the status of a move batch job',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Reads the status of a move batch started by Start Move Batch, returning in_progress or complete with one result per entry. Dropbox reports no overall failure for this job, so check each entry: a batch where every entry failed still reports complete. Call once per check rather than looping. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: relocationStatusOutputSchema,
+ props: {
+ async_job_id: Property.ShortText({
+ displayName: 'Async Job ID',
+ description: 'The job id returned by Start Move Batch.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ return await dropboxCommon.rpc({
+ auth: context.auth.access_token,
+ path: '/files/move_batch/check_v2',
+ body: { async_job_id: context.propsValue.async_job_id },
+ });
+ },
+});
diff --git a/packages/pieces/community/dropbox/src/lib/actions/get-save-url-status.ts b/packages/pieces/community/dropbox/src/lib/actions/get-save-url-status.ts
new file mode 100644
index 00000000000..a78a0e1ca3a
--- /dev/null
+++ b/packages/pieces/community/dropbox/src/lib/actions/get-save-url-status.ts
@@ -0,0 +1,33 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { dropboxAuth } from '../auth';
+import { dropboxCommon } from '../common';
+import { saveUrlStatusOutputSchema } from '../output-schemas';
+
+export const dropboxGetSaveUrlStatus = createAction({
+ auth: dropboxAuth,
+ name: 'get_dropbox_save_url_status',
+ classification: 'READ',
+ displayName: 'Get Save URL Status',
+ description: 'Check the status of a Save URL job',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Reads the status of a Save URL job started by Save URL to Dropbox, returning in_progress, complete with the saved file metadata, or failed. Call it once per check rather than looping; re-run it after a delay while the status is in_progress. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: saveUrlStatusOutputSchema,
+ props: {
+ async_job_id: Property.ShortText({
+ displayName: 'Async Job ID',
+ description: 'The job id returned by Save URL to Dropbox.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ return await dropboxCommon.rpc({
+ auth: context.auth.access_token,
+ path: '/files/save_url/check_job_status',
+ body: { async_job_id: context.propsValue.async_job_id },
+ });
+ },
+});
diff --git a/packages/pieces/community/dropbox/src/lib/actions/get-thumbnails-batch.ts b/packages/pieces/community/dropbox/src/lib/actions/get-thumbnails-batch.ts
new file mode 100644
index 00000000000..2f0b451a6b3
--- /dev/null
+++ b/packages/pieces/community/dropbox/src/lib/actions/get-thumbnails-batch.ts
@@ -0,0 +1,81 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { dropboxAuth } from '../auth';
+import { dropboxCommon } from '../common';
+import { thumbnailBatchOutputSchema } from '../output-schemas';
+
+export const dropboxGetThumbnailsBatch = createAction({
+ auth: dropboxAuth,
+ name: 'get_dropbox_thumbnails_batch',
+ classification: 'READ',
+ displayName: 'Get Thumbnails (Batch)',
+ description: 'Get thumbnails for several files at once',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Returns base64-encoded thumbnails for up to 25 Dropbox image files in one call. Use to preview many images at once; use Get File Thumbnail for a single file you want as a downloadable file object. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: thumbnailBatchOutputSchema,
+ props: {
+ paths: Property.Array({
+ displayName: 'Paths',
+ description:
+ 'The image files to thumbnail, at most 25. Each accepts a path (/folder/photo.jpg), an id (id:abc123) or a revision (rev:a1c10ce0dd78).',
+ required: true,
+ }),
+ format: Property.StaticDropdown({
+ displayName: 'Format',
+ required: false,
+ defaultValue: 'jpeg',
+ options: {
+ options: [
+ { label: 'JPEG', value: 'jpeg' },
+ { label: 'PNG', value: 'png' },
+ { label: 'WebP', value: 'webp' },
+ ],
+ },
+ }),
+ size: Property.StaticDropdown({
+ displayName: 'Size',
+ required: false,
+ defaultValue: 'w64h64',
+ options: {
+ options: [
+ { label: '32x32', value: 'w32h32' },
+ { label: '64x64', value: 'w64h64' },
+ { label: '128x128', value: 'w128h128' },
+ { label: '256x256', value: 'w256h256' },
+ { label: '480x320', value: 'w480h320' },
+ { label: '640x480', value: 'w640h480' },
+ { label: '960x640', value: 'w960h640' },
+ { label: '1024x768', value: 'w1024h768' },
+ { label: '2048x1536', value: 'w2048h1536' },
+ ],
+ },
+ }),
+ },
+ async run(context) {
+ const paths = dropboxCommon.parseStringArray({
+ value: context.propsValue.paths,
+ displayName: 'Paths',
+ });
+ if (paths.length === 0) {
+ throw new Error('Provide at least one path to thumbnail.');
+ }
+ if (paths.length > 25) {
+ throw new Error('Dropbox accepts at most 25 paths per thumbnail batch.');
+ }
+ return await dropboxCommon.rpc({
+ auth: context.auth.access_token,
+ host: dropboxCommon.CONTENT_HOST,
+ path: '/files/get_thumbnail_batch',
+ body: {
+ entries: paths.map((path) => ({
+ path,
+ format: context.propsValue.format ?? 'jpeg',
+ size: context.propsValue.size ?? 'w64h64',
+ })),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/dropbox/src/lib/actions/list-file-revisions.ts b/packages/pieces/community/dropbox/src/lib/actions/list-file-revisions.ts
new file mode 100644
index 00000000000..e56bfc101fd
--- /dev/null
+++ b/packages/pieces/community/dropbox/src/lib/actions/list-file-revisions.ts
@@ -0,0 +1,61 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { dropboxAuth } from '../auth';
+import { dropboxCommon } from '../common';
+import { listRevisionsOutputSchema } from '../output-schemas';
+
+export const dropboxListFileRevisions = createAction({
+ auth: dropboxAuth,
+ name: 'list_dropbox_file_revisions',
+ classification: 'READ',
+ displayName: 'List File Revisions',
+ description: 'List the stored revisions of a file',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists the stored revisions of a Dropbox file, newest first, each with its rev identifier and modification time. Use to inspect a file history, or to obtain the rev value that Restore File requires. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: listRevisionsOutputSchema,
+ props: {
+ path: Property.ShortText({
+ displayName: 'Path',
+ description:
+ 'The file whose revisions to list. Accepts a path (/folder/file.txt) or an id (id:abc123).',
+ required: true,
+ }),
+ mode: Property.StaticDropdown({
+ displayName: 'Mode',
+ description:
+ 'Path returns revisions of whatever currently sits at the path; ID follows the same file across moves and renames.',
+ required: false,
+ defaultValue: 'path',
+ options: {
+ options: [
+ { label: 'Path', value: 'path' },
+ { label: 'ID', value: 'id' },
+ ],
+ },
+ }),
+ limit: Property.Number({
+ displayName: 'Limit',
+ description: 'Maximum revisions to return, between 1 and 100.',
+ defaultValue: 10,
+ required: false,
+ }),
+ },
+ async run(context) {
+ const limit = context.propsValue.limit ?? 10;
+ if (limit < 1 || limit > 100) {
+ throw new Error('Limit must be between 1 and 100.');
+ }
+ return await dropboxCommon.rpc({
+ auth: context.auth.access_token,
+ path: '/files/list_revisions',
+ body: {
+ path: context.propsValue.path,
+ mode: context.propsValue.mode ?? 'path',
+ limit,
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/dropbox/src/lib/actions/lock-file.ts b/packages/pieces/community/dropbox/src/lib/actions/lock-file.ts
new file mode 100644
index 00000000000..9ec206a6f5f
--- /dev/null
+++ b/packages/pieces/community/dropbox/src/lib/actions/lock-file.ts
@@ -0,0 +1,35 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { dropboxAuth } from '../auth';
+import { dropboxCommon } from '../common';
+import { lockResultOutputSchema } from '../output-schemas';
+
+export const dropboxLockFile = createAction({
+ auth: dropboxAuth,
+ name: 'lock_dropbox_file',
+ classification: 'WRITE',
+ displayName: 'Lock File',
+ description: 'Temporarily lock a file against edits',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Locks a Dropbox file so other members cannot edit it until it is unlocked. Use before rewriting a shared file so a concurrent edit cannot be lost; release it with Unlock File. Idempotent: locking an already-locked file leaves it locked.',
+ idempotent: true,
+ },
+ outputSchema: lockResultOutputSchema,
+ props: {
+ path: Property.ShortText({
+ displayName: 'Path',
+ description:
+ 'The file to lock. Accepts a path (/folder/file.txt) or an id (id:abc123), but not a rev: value.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const response = await dropboxCommon.rpc<{ entries?: unknown }>({
+ auth: context.auth.access_token,
+ path: '/files/lock_file_batch',
+ body: { entries: [{ path: context.propsValue.path }] },
+ });
+ return dropboxCommon.unwrapEntry({ entries: response.entries, action: 'lock the file' });
+ },
+});
diff --git a/packages/pieces/community/dropbox/src/lib/actions/move-entry.ts b/packages/pieces/community/dropbox/src/lib/actions/move-entry.ts
new file mode 100644
index 00000000000..fa8a0bdaaf4
--- /dev/null
+++ b/packages/pieces/community/dropbox/src/lib/actions/move-entry.ts
@@ -0,0 +1,49 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { dropboxAuth } from '../auth';
+import { dropboxCommon } from '../common';
+import { entryOperationOutputSchema } from '../output-schemas';
+
+export const dropboxMoveEntry = createAction({
+ auth: dropboxAuth,
+ name: 'move_dropbox_entry',
+ classification: 'WRITE',
+ displayName: 'Move Entry',
+ description: 'Move or rename a file or folder',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Moves a Dropbox file or folder to a new path, which also renames it. Handles both files and folders, so no separate action is needed for each. Use Start Move Batch for many entries at once. Not idempotent: once moved, repeating the call fails because the source path no longer exists.',
+ idempotent: false,
+ },
+ outputSchema: entryOperationOutputSchema,
+ props: {
+ from_path: Property.ShortText({
+ displayName: 'From Path',
+ description:
+ 'The file or folder to move. Accepts a path (/folder/file.txt) or an id (id:abc123).',
+ required: true,
+ }),
+ to_path: Property.ShortText({
+ displayName: 'To Path',
+ description: 'The destination path, for example /folder2/renamed.txt.',
+ required: true,
+ }),
+ autorename: Property.Checkbox({
+ displayName: 'Auto Rename',
+ description: 'Let Dropbox rename the entry when the destination conflicts.',
+ defaultValue: false,
+ required: false,
+ }),
+ },
+ async run(context) {
+ return await dropboxCommon.rpc({
+ auth: context.auth.access_token,
+ path: '/files/move_v2',
+ body: {
+ from_path: context.propsValue.from_path,
+ to_path: context.propsValue.to_path,
+ autorename: context.propsValue.autorename ?? false,
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/dropbox/src/lib/actions/move-file.ts b/packages/pieces/community/dropbox/src/lib/actions/move-file.ts
index 2709a7fccb9..9ae5dc0c239 100644
--- a/packages/pieces/community/dropbox/src/lib/actions/move-file.ts
+++ b/packages/pieces/community/dropbox/src/lib/actions/move-file.ts
@@ -12,7 +12,7 @@ export const dropboxMoveFile = createAction({
name: 'move_dropbox_file',
classification: 'WRITE',
description: 'Move a file',
- audience: 'both',
+ audience: 'human',
aiMetadata: { description: 'Moves (or renames) the file at the source path to a new destination path within Dropbox; optionally autorenames on conflict. Use to relocate or rename a single file. Not idempotent: after a successful move the source no longer exists, so repeating the call fails or, with autorename, can produce a differently named copy.', idempotent: false },
displayName: 'Move file',
outputSchema: fileMetadataOutputSchema,
diff --git a/packages/pieces/community/dropbox/src/lib/actions/move-folder.ts b/packages/pieces/community/dropbox/src/lib/actions/move-folder.ts
index ebeb41b9809..04147debc9c 100644
--- a/packages/pieces/community/dropbox/src/lib/actions/move-folder.ts
+++ b/packages/pieces/community/dropbox/src/lib/actions/move-folder.ts
@@ -12,7 +12,7 @@ export const dropboxMoveFolder = createAction({
name: 'move_dropbox_folder',
classification: 'WRITE',
description: 'Move a folder',
- audience: 'both',
+ audience: 'human',
aiMetadata: { description: 'Moves (or renames) the folder at the source path, including its contents, to a new destination path within Dropbox; optionally autorenames on conflict. Use to relocate or rename an entire directory. Not idempotent: after a successful move the source no longer exists, so repeating the call fails or, with autorename, produces a differently named folder.', idempotent: false },
displayName: 'Move folder',
outputSchema: folderMetadataOutputSchema,
diff --git a/packages/pieces/community/dropbox/src/lib/actions/restore-file.ts b/packages/pieces/community/dropbox/src/lib/actions/restore-file.ts
new file mode 100644
index 00000000000..f7cc00fdd5f
--- /dev/null
+++ b/packages/pieces/community/dropbox/src/lib/actions/restore-file.ts
@@ -0,0 +1,43 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { dropboxAuth } from '../auth';
+import { dropboxCommon } from '../common';
+import { uploadedFileOutputSchema } from '../output-schemas';
+
+export const dropboxRestoreFile = createAction({
+ auth: dropboxAuth,
+ name: 'restore_dropbox_file',
+ classification: 'WRITE',
+ displayName: 'Restore File Revision',
+ description: 'Restore a file to a previous revision',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Restores a Dropbox file to a previous revision, obtained from List File Revisions. Use to undo an unwanted change while keeping the history intact. Not idempotent: each call writes a new revision, so repeating it adds further revisions rather than converging.',
+ idempotent: false,
+ },
+ outputSchema: uploadedFileOutputSchema,
+ props: {
+ path: Property.ShortText({
+ displayName: 'Path',
+ description:
+ 'The file to restore, as a path (/folder/file.txt). This endpoint does not accept id: or rev: values.',
+ required: true,
+ }),
+ rev: Property.ShortText({
+ displayName: 'Revision',
+ description:
+ 'The revision to restore the file to. Obtain it from List File Revisions.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ return await dropboxCommon.rpc({
+ auth: context.auth.access_token,
+ path: '/files/restore',
+ body: {
+ path: context.propsValue.path,
+ rev: context.propsValue.rev,
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/dropbox/src/lib/actions/save-copy-reference.ts b/packages/pieces/community/dropbox/src/lib/actions/save-copy-reference.ts
new file mode 100644
index 00000000000..991317de261
--- /dev/null
+++ b/packages/pieces/community/dropbox/src/lib/actions/save-copy-reference.ts
@@ -0,0 +1,42 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { dropboxAuth } from '../auth';
+import { dropboxCommon } from '../common';
+import { fileMetadataOutputSchema } from '../output-schemas';
+
+export const dropboxSaveCopyReference = createAction({
+ auth: dropboxAuth,
+ name: 'save_dropbox_copy_reference',
+ classification: 'WRITE',
+ displayName: 'Save Copy Reference',
+ description: 'Save a copy reference into this account',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Saves a copy reference produced by Create Copy Reference into this Dropbox account at the given path. Use to complete a cross-account copy. Not idempotent: each call writes another copy at the destination path.',
+ idempotent: false,
+ },
+ outputSchema: fileMetadataOutputSchema,
+ props: {
+ copy_reference: Property.ShortText({
+ displayName: 'Copy Reference',
+ description: 'The reference string returned by Create Copy Reference.',
+ required: true,
+ }),
+ path: Property.ShortText({
+ displayName: 'Destination Path',
+ description:
+ 'Where to save the entry, as a path (/folder/file.txt). This endpoint does not accept id: or ns: values.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ return await dropboxCommon.rpc({
+ auth: context.auth.access_token,
+ path: '/files/copy_reference/save',
+ body: {
+ copy_reference: context.propsValue.copy_reference,
+ path: context.propsValue.path,
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/dropbox/src/lib/actions/save-url.ts b/packages/pieces/community/dropbox/src/lib/actions/save-url.ts
new file mode 100644
index 00000000000..d6fd4e8614f
--- /dev/null
+++ b/packages/pieces/community/dropbox/src/lib/actions/save-url.ts
@@ -0,0 +1,42 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { dropboxAuth } from '../auth';
+import { dropboxCommon } from '../common';
+import { saveUrlLaunchOutputSchema } from '../output-schemas';
+
+export const dropboxSaveUrl = createAction({
+ auth: dropboxAuth,
+ name: 'save_url_to_dropbox',
+ classification: 'WRITE',
+ displayName: 'Save URL to Dropbox',
+ description: 'Download a URL into Dropbox',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Tells Dropbox to fetch a public URL server-side and save it as a file. Small downloads finish immediately and return the file metadata; larger ones return an async job id that Get Save URL Status polls. Not idempotent: each call starts another download and writes another file.',
+ idempotent: false,
+ },
+ outputSchema: saveUrlLaunchOutputSchema,
+ props: {
+ path: Property.ShortText({
+ displayName: 'Destination Path',
+ description:
+ 'Where to save the file, as a path (/folder/file.pdf). This endpoint does not accept id: or ns: values.',
+ required: true,
+ }),
+ url: Property.ShortText({
+ displayName: 'URL',
+ description: 'The publicly reachable URL for Dropbox to download.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ return await dropboxCommon.rpc({
+ auth: context.auth.access_token,
+ path: '/files/save_url',
+ body: {
+ path: context.propsValue.path,
+ url: context.propsValue.url,
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/dropbox/src/lib/actions/start-copy-batch.ts b/packages/pieces/community/dropbox/src/lib/actions/start-copy-batch.ts
new file mode 100644
index 00000000000..48a602f9f99
--- /dev/null
+++ b/packages/pieces/community/dropbox/src/lib/actions/start-copy-batch.ts
@@ -0,0 +1,66 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { dropboxAuth } from '../auth';
+import { dropboxCommon } from '../common';
+import { relocationLaunchOutputSchema } from '../output-schemas';
+
+export const dropboxStartCopyBatch = createAction({
+ auth: dropboxAuth,
+ name: 'start_dropbox_copy_batch',
+ classification: 'WRITE',
+ displayName: 'Start Copy Batch',
+ description: 'Copy many files or folders in one job',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Starts a job copying up to 1000 Dropbox files or folders in one call, leaving the originals in place. Small batches complete immediately; larger ones return an async job id that Get Copy Batch Status polls. Not idempotent: each call copies again, so repeating it duplicates entries.',
+ idempotent: false,
+ },
+ outputSchema: relocationLaunchOutputSchema,
+ props: {
+ entries: Property.Array({
+ displayName: 'Entries',
+ description:
+ 'Each entry needs a From Path and a To Path. Both accept a path (/folder/file.txt) or an id (id:abc123). At most 1000 entries.',
+ required: true,
+ properties: {
+ from_path: Property.ShortText({
+ displayName: 'From Path',
+ required: true,
+ }),
+ to_path: Property.ShortText({
+ displayName: 'To Path',
+ required: true,
+ }),
+ },
+ }),
+ autorename: Property.Checkbox({
+ displayName: 'Auto Rename',
+ description: 'Let Dropbox rename an entry when its destination conflicts.',
+ defaultValue: false,
+ required: false,
+ }),
+ },
+ async run(context) {
+ const entries = dropboxCommon.parseRelocationEntries({
+ value: context.propsValue.entries,
+ displayName: 'Entries',
+ });
+ if (entries.length === 0) {
+ throw new Error('Provide at least one entry to copy.');
+ }
+ if (entries.length > 1000) {
+ throw new Error('Dropbox accepts at most 1000 entries per copy batch.');
+ }
+ return await dropboxCommon.rpc({
+ auth: context.auth.access_token,
+ path: '/files/copy_batch_v2',
+ body: {
+ entries: entries.map((entry) => ({
+ from_path: entry.from_path,
+ to_path: entry.to_path,
+ })),
+ autorename: context.propsValue.autorename ?? false,
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/dropbox/src/lib/actions/start-create-folder-batch.ts b/packages/pieces/community/dropbox/src/lib/actions/start-create-folder-batch.ts
new file mode 100644
index 00000000000..cc6afb83113
--- /dev/null
+++ b/packages/pieces/community/dropbox/src/lib/actions/start-create-folder-batch.ts
@@ -0,0 +1,55 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { dropboxAuth } from '../auth';
+import { dropboxCommon } from '../common';
+import { createFolderBatchLaunchOutputSchema } from '../output-schemas';
+
+export const dropboxStartCreateFolderBatch = createAction({
+ auth: dropboxAuth,
+ name: 'start_dropbox_create_folder_batch',
+ classification: 'WRITE',
+ displayName: 'Start Create Folder Batch',
+ description: 'Create many folders in one job',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Starts a job creating up to 10000 Dropbox folders in one call. Small batches complete immediately; larger ones return an async job id that Get Create Folder Batch Status polls. Not idempotent: without autorename a second call conflicts on folders that already exist.',
+ idempotent: false,
+ },
+ outputSchema: createFolderBatchLaunchOutputSchema,
+ props: {
+ paths: Property.Array({
+ displayName: 'Paths',
+ description:
+ 'The folders to create, at most 10000. Each must be a path such as /reports/2026; this endpoint does not accept id: values.',
+ required: true,
+ }),
+ autorename: Property.Checkbox({
+ displayName: 'Auto Rename',
+ description: 'Let Dropbox rename a folder when its path conflicts.',
+ defaultValue: false,
+ required: false,
+ }),
+ },
+ async run(context) {
+ const paths = dropboxCommon.parseStringArray({
+ value: context.propsValue.paths,
+ displayName: 'Paths',
+ });
+ if (paths.length === 0) {
+ throw new Error('Provide at least one folder path to create.');
+ }
+ if (paths.length > 10000) {
+ throw new Error(
+ 'Dropbox accepts at most 10000 folders per create folder batch.'
+ );
+ }
+ return await dropboxCommon.rpc({
+ auth: context.auth.access_token,
+ path: '/files/create_folder_batch',
+ body: {
+ paths,
+ autorename: context.propsValue.autorename ?? false,
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/dropbox/src/lib/actions/start-delete-batch.ts b/packages/pieces/community/dropbox/src/lib/actions/start-delete-batch.ts
new file mode 100644
index 00000000000..def1fa77fd9
--- /dev/null
+++ b/packages/pieces/community/dropbox/src/lib/actions/start-delete-batch.ts
@@ -0,0 +1,44 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { dropboxAuth } from '../auth';
+import { dropboxCommon } from '../common';
+import { deleteBatchLaunchOutputSchema } from '../output-schemas';
+
+export const dropboxStartDeleteBatch = createAction({
+ auth: dropboxAuth,
+ name: 'start_dropbox_delete_batch',
+ classification: 'DESTRUCTIVE',
+ displayName: 'Start Delete Batch',
+ description: 'Delete many files or folders in one job',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Starts a job deleting up to 1000 Dropbox files or folders in one call. Deleted entries go to trash and remain restorable, they are not erased. Small batches complete immediately; larger ones return an async job id that Get Delete Batch Status polls. Not idempotent: a second call fails on paths already deleted.',
+ idempotent: false,
+ },
+ outputSchema: deleteBatchLaunchOutputSchema,
+ props: {
+ paths: Property.Array({
+ displayName: 'Paths',
+ description:
+ 'The entries to delete, at most 1000. Each accepts a path (/folder/file.txt) or an id (id:abc123).',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const paths = dropboxCommon.parseStringArray({
+ value: context.propsValue.paths,
+ displayName: 'Paths',
+ });
+ if (paths.length === 0) {
+ throw new Error('Provide at least one path to delete.');
+ }
+ if (paths.length > 1000) {
+ throw new Error('Dropbox accepts at most 1000 entries per delete batch.');
+ }
+ return await dropboxCommon.rpc({
+ auth: context.auth.access_token,
+ path: '/files/delete_batch',
+ body: { entries: paths.map((path) => ({ path })) },
+ });
+ },
+});
diff --git a/packages/pieces/community/dropbox/src/lib/actions/start-move-batch.ts b/packages/pieces/community/dropbox/src/lib/actions/start-move-batch.ts
new file mode 100644
index 00000000000..4d9cc683636
--- /dev/null
+++ b/packages/pieces/community/dropbox/src/lib/actions/start-move-batch.ts
@@ -0,0 +1,66 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { dropboxAuth } from '../auth';
+import { dropboxCommon } from '../common';
+import { relocationLaunchOutputSchema } from '../output-schemas';
+
+export const dropboxStartMoveBatch = createAction({
+ auth: dropboxAuth,
+ name: 'start_dropbox_move_batch',
+ classification: 'WRITE',
+ displayName: 'Start Move Batch',
+ description: 'Move many files or folders in one job',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Starts a job moving up to 1000 Dropbox files or folders in one call. Small batches complete immediately; larger ones return an async job id that Get Move Batch Status polls. Not idempotent: once an entry has moved, repeating the call fails because the source path no longer exists.',
+ idempotent: false,
+ },
+ outputSchema: relocationLaunchOutputSchema,
+ props: {
+ entries: Property.Array({
+ displayName: 'Entries',
+ description:
+ 'Each entry needs a From Path and a To Path. Both accept a path (/folder/file.txt) or an id (id:abc123). At most 1000 entries.',
+ required: true,
+ properties: {
+ from_path: Property.ShortText({
+ displayName: 'From Path',
+ required: true,
+ }),
+ to_path: Property.ShortText({
+ displayName: 'To Path',
+ required: true,
+ }),
+ },
+ }),
+ autorename: Property.Checkbox({
+ displayName: 'Auto Rename',
+ description: 'Let Dropbox rename an entry when its destination conflicts.',
+ defaultValue: false,
+ required: false,
+ }),
+ },
+ async run(context) {
+ const entries = dropboxCommon.parseRelocationEntries({
+ value: context.propsValue.entries,
+ displayName: 'Entries',
+ });
+ if (entries.length === 0) {
+ throw new Error('Provide at least one entry to move.');
+ }
+ if (entries.length > 1000) {
+ throw new Error('Dropbox accepts at most 1000 entries per move batch.');
+ }
+ return await dropboxCommon.rpc({
+ auth: context.auth.access_token,
+ path: '/files/move_batch_v2',
+ body: {
+ entries: entries.map((entry) => ({
+ from_path: entry.from_path,
+ to_path: entry.to_path,
+ })),
+ autorename: context.propsValue.autorename ?? false,
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/dropbox/src/lib/actions/unlock-file.ts b/packages/pieces/community/dropbox/src/lib/actions/unlock-file.ts
new file mode 100644
index 00000000000..7e355dde3b8
--- /dev/null
+++ b/packages/pieces/community/dropbox/src/lib/actions/unlock-file.ts
@@ -0,0 +1,35 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { dropboxAuth } from '../auth';
+import { dropboxCommon } from '../common';
+import { lockResultOutputSchema } from '../output-schemas';
+
+export const dropboxUnlockFile = createAction({
+ auth: dropboxAuth,
+ name: 'unlock_dropbox_file',
+ classification: 'WRITE',
+ displayName: 'Unlock File',
+ description: 'Release a lock on a file',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Releases a lock previously taken on a Dropbox file so other members can edit it again. Use after finishing the write that Lock File protected. Idempotent: unlocking a file that is not locked leaves it unlocked.',
+ idempotent: true,
+ },
+ outputSchema: lockResultOutputSchema,
+ props: {
+ path: Property.ShortText({
+ displayName: 'Path',
+ description:
+ 'The file to unlock. Accepts a path (/folder/file.txt) or an id (id:abc123), but not a rev: value.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const response = await dropboxCommon.rpc<{ entries?: unknown }>({
+ auth: context.auth.access_token,
+ path: '/files/unlock_file_batch',
+ body: { entries: [{ path: context.propsValue.path }] },
+ });
+ return dropboxCommon.unwrapEntry({ entries: response.entries, action: 'unlock the file' });
+ },
+});
diff --git a/packages/pieces/community/dropbox/src/lib/common.test.ts b/packages/pieces/community/dropbox/src/lib/common.test.ts
new file mode 100644
index 00000000000..baa5f432a08
--- /dev/null
+++ b/packages/pieces/community/dropbox/src/lib/common.test.ts
@@ -0,0 +1,53 @@
+import { describe, expect, it } from 'vitest';
+import { dropboxCommon } from './common';
+
+describe('unwrapEntry', () => {
+ it('returns the first entry when Dropbox reports success', () => {
+ const entry = { '.tag': 'success', metadata: { name: 'doc.txt' } };
+ expect(
+ dropboxCommon.unwrapEntry({ entries: [entry], action: 'lock the file' })
+ ).toEqual(entry);
+ });
+
+ it('throws when the single entry failed, so a per-entry failure is not reported as success', () => {
+ const entries = [
+ { '.tag': 'failure', failure: { '.tag': 'path_lookup' } },
+ ];
+ expect(() =>
+ dropboxCommon.unwrapEntry({ entries, action: 'lock the file' })
+ ).toThrowError(/could not lock the file/);
+ });
+
+ it('includes the failure payload in the message', () => {
+ const entries = [{ '.tag': 'failure', failure: { '.tag': 'not_found' } }];
+ expect(() =>
+ dropboxCommon.unwrapEntry({ entries, action: 'unlock the file' })
+ ).toThrowError(/not_found/);
+ });
+
+ it('throws when Dropbox returns no entries at all', () => {
+ expect(() =>
+ dropboxCommon.unwrapEntry({ entries: [], action: 'read the file lock' })
+ ).toThrowError(/no result entry/);
+ });
+
+ it('throws when the entries field is missing rather than returning undefined', () => {
+ expect(() =>
+ dropboxCommon.unwrapEntry({ entries: undefined, action: 'lock the file' })
+ ).toThrowError(/no result entry/);
+ });
+});
+
+describe('previewExtensionFor', () => {
+ it('uses html when Dropbox returns an HTML preview', () => {
+ expect(dropboxCommon.previewExtensionFor('text/html')).toBe('html');
+ });
+
+ it('uses pdf for the PDF preview content type', () => {
+ expect(dropboxCommon.previewExtensionFor('application/pdf')).toBe('pdf');
+ });
+
+ it('falls back to pdf when the content type is absent', () => {
+ expect(dropboxCommon.previewExtensionFor(undefined)).toBe('pdf');
+ });
+});
\ No newline at end of file
diff --git a/packages/pieces/community/dropbox/src/lib/common.ts b/packages/pieces/community/dropbox/src/lib/common.ts
new file mode 100644
index 00000000000..8619b24eb38
--- /dev/null
+++ b/packages/pieces/community/dropbox/src/lib/common.ts
@@ -0,0 +1,237 @@
+import {
+ AuthenticationType,
+ httpClient,
+ HttpMethod,
+} from '@activepieces/pieces-common';
+
+const API_HOST = 'https://api.dropboxapi.com/2';
+const CONTENT_HOST = 'https://content.dropboxapi.com/2';
+
+export const dropboxCommon = {
+ CONTENT_HOST,
+ rpc,
+ download,
+ unwrapEntry,
+ previewExtensionFor,
+ parseStringArray,
+ parseRelocationEntries,
+};
+
+function encodeApiArg(arg: unknown): string {
+ return JSON.stringify(arg).replace(
+ /[\u007f-￿]/g,
+ (c) => '\\u' + ('000' + c.charCodeAt(0).toString(16)).slice(-4)
+ );
+}
+
+function describeError(error: unknown): string | undefined {
+ if (!isObject(error)) {
+ return undefined;
+ }
+ const response = error['response'];
+ if (!isObject(response)) {
+ return undefined;
+ }
+ const body = response['body'];
+ const summary =
+ isObject(body) && 'error_summary' in body
+ ? String(body['error_summary'])
+ : undefined;
+ switch (response['status']) {
+ case 401:
+ return 'Dropbox rejected the credentials. Reconnect the Dropbox connection.';
+ case 403:
+ return `Dropbox denied this request. The connection may lack the required scope, or the account plan may not include this feature. ${
+ summary ?? ''
+ }`.trim();
+ case 409:
+ return `Dropbox could not complete the request: ${
+ summary ?? 'the path or resource is in an unexpected state.'
+ }`;
+ case 429:
+ return 'Dropbox rate limit reached. Retry after a short delay.';
+ default:
+ return summary;
+ }
+}
+
+async function rpc<T>({
+ auth,
+ path,
+ body,
+ host = API_HOST,
+}: {
+ auth: string;
+ path: string;
+ body: unknown;
+ host?: string;
+}): Promise<T> {
+ try {
+ const response = await httpClient.sendRequest<T>({
+ method: HttpMethod.POST,
+ url: `${host}${path}`,
+ ...(body === null
+ ? {}
+ : { headers: { 'Content-Type': 'application/json' }, body }),
+ authentication: { type: AuthenticationType.BEARER_TOKEN, token: auth },
+ });
+ return response.body;
+ } catch (error) {
+ const message = describeError(error);
+ if (message !== undefined) {
+ throw new Error(message);
+ }
+ throw error;
+ }
+}
+
+async function download<TResult>({
+ auth,
+ path,
+ arg,
+}: {
+ auth: string;
+ path: string;
+ arg: unknown;
+}): Promise<{
+ data: Buffer;
+ result: TResult | undefined;
+ contentType: string | undefined;
+}> {
+ try {
+ const response = await httpClient.sendRequest<Buffer>({
+ method: HttpMethod.POST,
+ url: `${CONTENT_HOST}${path}`,
+ headers: {
+ 'Content-Type': 'application/octet-stream',
+ 'Dropbox-API-Arg': encodeApiArg(arg),
+ },
+ authentication: { type: AuthenticationType.BEARER_TOKEN, token: auth },
+ responseType: 'stream',
+ });
+ const header = response.headers?.['dropbox-api-result'];
+ const contentType = response.headers?.['content-type'];
+ return {
+ data: response.body,
+ result: typeof header === 'string' ? JSON.parse(header) : undefined,
+ contentType:
+ typeof contentType === 'string'
+ ? contentType.split(';')[0].trim()
+ : undefined,
+ };
+ } catch (error) {
+ const message = describeError(error);
+ if (message !== undefined) {
+ throw new Error(message);
+ }
+ throw error;
+ }
+}
+
+function unwrapEntry({
+ entries,
+ action,
+}: {
+ entries: unknown;
+ action: string;
+}): unknown {
+ if (!Array.isArray(entries) || entries.length === 0) {
+ throw new Error(`Dropbox returned no result entry for ${action}.`);
+ }
+ const entry: unknown = entries[0];
+ if (isObject(entry) && entry['.tag'] === 'failure') {
+ throw new Error(
+ `Dropbox could not ${action}: ${JSON.stringify(entry['failure'])}`
+ );
+ }
+ return entry;
+}
+
+function isObject(value: unknown): value is Record<string, unknown> {
+ return typeof value === 'object' && value !== null;
+}
+
+function previewExtensionFor(contentType: string | undefined): string {
+ return contentType === 'text/html' ? 'html' : 'pdf';
+}
+
+function toArray({
+ value,
+ displayName,
+}: {
+ value: unknown;
+ displayName: string;
+}): unknown[] {
+ if (Array.isArray(value)) {
+ return value;
+ }
+ if (typeof value === 'string') {
+ const trimmed = value.trim();
+ if (trimmed.length === 0) {
+ return [];
+ }
+ try {
+ const parsed: unknown = JSON.parse(trimmed);
+ if (Array.isArray(parsed)) {
+ return parsed;
+ }
+ } catch {
+ throw new Error(`${displayName} must be a list.`);
+ }
+ }
+ throw new Error(`${displayName} must be a list.`);
+}
+
+function parseStringArray({
+ value,
+ displayName,
+}: {
+ value: unknown;
+ displayName: string;
+}): string[] {
+ const items = toArray({ value, displayName });
+ const strings = items.filter(isNonEmptyString);
+ if (strings.length !== items.length) {
+ throw new Error(
+ `Every entry in ${displayName} must be a non-empty text value.`
+ );
+ }
+ return strings;
+}
+
+function parseRelocationEntries({
+ value,
+ displayName,
+}: {
+ value: unknown;
+ displayName: string;
+}): RelocationEntry[] {
+ const items = toArray({ value, displayName });
+ const entries = items.filter(isRelocationEntry);
+ if (entries.length !== items.length) {
+ throw new Error(
+ `Every entry in ${displayName} must have a From Path and a To Path.`
+ );
+ }
+ return entries.map((entry) => ({
+ from_path: entry.from_path,
+ to_path: entry.to_path,
+ }));
+}
+
+function isNonEmptyString(value: unknown): value is string {
+ return typeof value === 'string' && value.trim().length > 0;
+}
+
+function isRelocationEntry(value: unknown): value is RelocationEntry {
+ return (
+ isObject(value) &&
+ isNonEmptyString(value['from_path']) &&
+ isNonEmptyString(value['to_path'])
+ );
+}
+
+type RelocationEntry = {
+ from_path: string;
+ to_path: string;
+};
diff --git a/packages/pieces/community/dropbox/src/lib/output-schemas.test.ts b/packages/pieces/community/dropbox/src/lib/output-schemas.test.ts
new file mode 100644
index 00000000000..d2764085942
--- /dev/null
+++ b/packages/pieces/community/dropbox/src/lib/output-schemas.test.ts
@@ -0,0 +1,86 @@
+import { OutputSchema, OutputSchemaField } from '@activepieces/pieces-framework';
+import { describe, expect, it } from 'vitest';
+import {
+ createFolderBatchLaunchOutputSchema,
+ createFolderBatchStatusOutputSchema,
+ deleteBatchLaunchOutputSchema,
+ deleteBatchStatusOutputSchema,
+ entryOperationOutputSchema,
+ relocationLaunchOutputSchema,
+ relocationStatusOutputSchema,
+ saveUrlLaunchOutputSchema,
+} from './output-schemas';
+
+function collectKeys(fields: OutputSchemaField[] | undefined): string[] {
+ if (fields === undefined) {
+ return [];
+ }
+ return fields.flatMap((field) => [
+ field.key,
+ ...collectKeys(field.children),
+ ...collectKeys(field.listItems),
+ ]);
+}
+
+const allSchemas: Record<string, OutputSchema> = {
+ saveUrlLaunchOutputSchema,
+ relocationLaunchOutputSchema,
+ relocationStatusOutputSchema,
+ deleteBatchLaunchOutputSchema,
+ deleteBatchStatusOutputSchema,
+ createFolderBatchLaunchOutputSchema,
+ createFolderBatchStatusOutputSchema,
+ entryOperationOutputSchema,
+};
+
+describe('Dropbox union discriminator paths', () => {
+ it.each(Object.entries(allSchemas))(
+ 'escapes the .tag discriminator in %s',
+ (_name, schema) => {
+ for (const key of collectKeys(schema.fields)) {
+ if (!key.includes('tag')) {
+ continue;
+ }
+ expect(key).toContain("['.tag']");
+ expect(key).not.toMatch(/(^|\.)\.?tag$/);
+ }
+ }
+ );
+});
+
+describe('async job schemas describe both union branches', () => {
+ it.each([
+ ['saveUrlLaunchOutputSchema', saveUrlLaunchOutputSchema],
+ ['relocationLaunchOutputSchema', relocationLaunchOutputSchema],
+ ['deleteBatchLaunchOutputSchema', deleteBatchLaunchOutputSchema],
+ ['createFolderBatchLaunchOutputSchema', createFolderBatchLaunchOutputSchema],
+ ])(
+ '%s exposes async_job_id alongside the inline-complete fields',
+ (_name, schema) => {
+ const keys = collectKeys(schema.fields);
+ expect(keys).toContain('async_job_id');
+ expect(keys).toContain("['.tag']");
+ expect(keys.length).toBeGreaterThan(2);
+ }
+ );
+});
+
+describe('batch status schemas surface per-entry outcomes', () => {
+ it.each([
+ ['relocationStatusOutputSchema', relocationStatusOutputSchema],
+ ['deleteBatchStatusOutputSchema', deleteBatchStatusOutputSchema],
+ ['createFolderBatchStatusOutputSchema', createFolderBatchStatusOutputSchema],
+ ])('%s exposes a per-entry failure reason', (_name, schema) => {
+ expect(collectKeys(schema.fields)).toContain("failure['.tag']");
+ });
+});
+
+describe('entryOperationOutputSchema', () => {
+ it('labels the result as an entry rather than a file, since folders are accepted', () => {
+ expect(entryOperationOutputSchema.fields[0].label).toBe('Entry');
+ });
+
+ it('carries the kind discriminator so folder results are distinguishable', () => {
+ expect(collectKeys(entryOperationOutputSchema.fields)).toContain("['.tag']");
+ });
+});
diff --git a/packages/pieces/community/dropbox/src/lib/output-schemas.ts b/packages/pieces/community/dropbox/src/lib/output-schemas.ts
index dfb9c5f5a8b..fc6a58ad938 100644
--- a/packages/pieces/community/dropbox/src/lib/output-schemas.ts
+++ b/packages/pieces/community/dropbox/src/lib/output-schemas.ts
@@ -7,6 +7,22 @@ const entryFields: OutputSchema['fields'] = [
{ key: 'path_lower', label: 'Path (Lowercase)' },
];
+const relocationEntryFields: OutputSchema['fields'] = [
+ { key: "['.tag']", label: 'Outcome' },
+ { key: 'success.name', label: 'Name' },
+ { key: 'success.id', label: 'ID' },
+ { key: 'success.path_display', label: 'Path' },
+ { key: "failure['.tag']", label: 'Failure Reason' },
+];
+
+const batchEntryFields: OutputSchema['fields'] = [
+ { key: "['.tag']", label: 'Outcome' },
+ { key: 'metadata.name', label: 'Name' },
+ { key: 'metadata.id', label: 'ID' },
+ { key: 'metadata.path_display', label: 'Path' },
+ { key: "failure['.tag']", label: 'Failure Reason' },
+];
+
const fileFields: OutputSchema['fields'] = [
...entryFields,
{ key: 'size', label: 'Size', format: 'filesize' },
@@ -27,6 +43,28 @@ export const folderMetadataOutputSchema: OutputSchema = {
fields: [{ key: 'metadata', label: 'Folder', children: entryFields }],
};
+export const entryOperationOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'metadata',
+ label: 'Entry',
+ children: [
+ {
+ key: "['.tag']",
+ label: 'Kind',
+ description: 'Either file or folder. The fields below are only present for files.',
+ },
+ ...entryFields,
+ { key: 'size', label: 'Size', format: 'filesize' },
+ { key: 'client_modified', label: 'Client Modified', format: 'datetime' },
+ { key: 'server_modified', label: 'Server Modified', format: 'datetime' },
+ { key: 'rev', label: 'Revision' },
+ { key: 'content_hash', label: 'Content Hash' },
+ ],
+ },
+ ],
+};
+
export const getFileLinkOutputSchema: OutputSchema = {
fields: [
{ key: 'link', label: 'Temporary Link', format: 'url' },
@@ -69,3 +107,151 @@ export const searchOutputSchema: OutputSchema = {
};
export const newFolderTriggerOutputSchema: OutputSchema = { fields: entryFields };
+
+export const entryMetadataOutputSchema: OutputSchema = {
+ fields: [{ key: "['.tag']", label: 'Kind' }, ...fileFields],
+};
+
+export const listRevisionsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'is_deleted', label: 'Is Deleted', format: 'boolean' },
+ { key: 'has_more', label: 'Has More', format: 'boolean' },
+ { key: 'entries', label: 'Revisions', labelKey: 'rev', listItems: fileFields },
+ ],
+};
+
+export const copyReferenceOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'copy_reference', label: 'Copy Reference' },
+ { key: 'expires', label: 'Expires', format: 'datetime' },
+ { key: 'metadata', label: 'Entry', children: fileFields },
+ ],
+};
+
+export const lockResultOutputSchema: OutputSchema = {
+ fields: [
+ { key: "['.tag']", label: 'Outcome' },
+ { key: "lock.content['.tag']", label: 'Lock State' },
+ {
+ key: 'metadata',
+ label: 'File',
+ children: [
+ ...fileFields,
+ {
+ key: 'file_lock_info',
+ label: 'Lock Details',
+ children: [
+ { key: 'is_lockholder', label: 'Is Lock Holder', format: 'boolean' },
+ { key: 'lockholder_name', label: 'Lock Holder' },
+ { key: 'created', label: 'Locked At', format: 'datetime' },
+ ],
+ },
+ ],
+ },
+ ],
+};
+
+export const uploadLinkOutputSchema: OutputSchema = {
+ fields: [{ key: 'link', label: 'Upload Link', format: 'url' }],
+};
+
+export const thumbnailBatchOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'entries',
+ label: 'Thumbnails',
+ labelKey: 'metadata.name',
+ listItems: [
+ { key: 'metadata.name', label: 'Name' },
+ { key: 'metadata.path_display', label: 'Path' },
+ { key: 'thumbnail', label: 'Thumbnail (base64)' },
+ ],
+ },
+ ],
+};
+
+export const zipDownloadOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'file', label: 'Zip Archive', format: 'url' },
+ { key: 'metadata', label: 'Folder', children: entryFields },
+ ],
+};
+
+export const filePreviewOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'file', label: 'Preview', format: 'url' },
+ { key: 'metadata', label: 'File', children: fileFields },
+ ],
+};
+
+export const fileThumbnailOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'file', label: 'Thumbnail', format: 'url' },
+ {
+ key: 'metadata.file_metadata',
+ label: 'File',
+ children: fileFields,
+ },
+ ],
+};
+
+export const saveUrlLaunchOutputSchema: OutputSchema = {
+ fields: [
+ { key: "['.tag']", label: 'Result' },
+ { key: 'async_job_id', label: 'Async Job ID' },
+ ...fileFields,
+ ],
+};
+
+export const saveUrlStatusOutputSchema: OutputSchema = {
+ fields: [{ key: "['.tag']", label: 'Status' }, ...fileFields],
+};
+
+export const relocationLaunchOutputSchema: OutputSchema = {
+ fields: [
+ { key: "['.tag']", label: 'Result' },
+ { key: 'async_job_id', label: 'Async Job ID' },
+ { key: 'entries', label: 'Entries', labelKey: "['.tag']", listItems: relocationEntryFields },
+ ],
+};
+
+export const relocationStatusOutputSchema: OutputSchema = {
+ fields: [
+ { key: "['.tag']", label: 'Status' },
+ { key: 'entries', label: 'Entries', labelKey: "['.tag']", listItems: relocationEntryFields },
+ ],
+};
+
+export const deleteBatchLaunchOutputSchema: OutputSchema = {
+ fields: [
+ { key: "['.tag']", label: 'Result' },
+ { key: 'async_job_id', label: 'Async Job ID' },
+ { key: 'entries', label: 'Entries', labelKey: "['.tag']", listItems: batchEntryFields },
+ ],
+};
+
+export const deleteBatchStatusOutputSchema: OutputSchema = {
+ fields: [
+ { key: "['.tag']", label: 'Status' },
+ { key: 'entries', label: 'Entries', labelKey: "['.tag']", listItems: batchEntryFields },
+ ],
+};
+
+export const createFolderBatchLaunchOutputSchema: OutputSchema = {
+ fields: [
+ { key: "['.tag']", label: 'Result' },
+ { key: 'async_job_id', label: 'Async Job ID' },
+ { key: 'entries', label: 'Entries', labelKey: "['.tag']", listItems: batchEntryFields },
+ ],
+};
+
+export const createFolderBatchStatusOutputSchema: OutputSchema = {
+ fields: [
+ { key: "['.tag']", label: 'Status' },
+ { key: 'entries', label: 'Entries', labelKey: "['.tag']", listItems: batchEntryFields },
+ ],
+};
+
+
+
+
diff --git a/packages/pieces/community/dropbox/vitest.config.ts b/packages/pieces/community/dropbox/vitest.config.ts
new file mode 100644
index 00000000000..9d8c6a715d3
--- /dev/null
+++ b/packages/pieces/community/dropbox/vitest.config.ts
@@ -0,0 +1,23 @@
+import path from 'path';
+import { defineConfig } from 'vitest/config';
+
+const repoRoot = path.resolve(__dirname, '../../../..');
+
+export default defineConfig({
+ test: {
+ globals: true,
+ environment: 'node',
+ },
+ resolve: {
+ alias: {
+ '@activepieces/pieces-framework': path.resolve(
+ repoRoot,
+ 'packages/pieces/framework/src/index.ts'
+ ),
+ '@activepieces/pieces-common': path.resolve(
+ repoRoot,
+ 'packages/pieces/common/src/index.ts'
+ ),
+ },
+ },
+});