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(raindrop): let AI agents manage bookmarks, highlights, collections, sharing and tags (#16980)

Kishan Parmar83541fcc9484
diff --git a/bun.lock b/bun.lock
index db7fcbfe514..6137996324c 100644
--- a/bun.lock
+++ b/bun.lock
@@ -7750,7 +7750,7 @@
},
"packages/pieces/community/raindrop": {
"name": "@activepieces/piece-raindrop",
- "version": "0.1.3",
+ "version": "0.2.0",
"dependencies": {
"@activepieces/core-piece-types": "workspace:*",
"@activepieces/core-utils": "workspace:*",
diff --git a/packages/pieces/community/raindrop/package.json b/packages/pieces/community/raindrop/package.json
index ba1625dc7bf..6d829db188d 100644
--- a/packages/pieces/community/raindrop/package.json
+++ b/packages/pieces/community/raindrop/package.json
@@ -1,6 +1,6 @@
{
"name": "@activepieces/piece-raindrop",
- "version": "0.1.3",
+ "version": "0.2.0",
"main": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
"scripts": {
diff --git a/packages/pieces/community/raindrop/src/index.ts b/packages/pieces/community/raindrop/src/index.ts
index a48c63fc3ca..d46aeac7e65 100644
--- a/packages/pieces/community/raindrop/src/index.ts
+++ b/packages/pieces/community/raindrop/src/index.ts
@@ -2,18 +2,20 @@ import { createCustomApiCallAction } from '@activepieces/pieces-common';
import { createPiece } from '@activepieces/pieces-framework';
import { PieceCategory } from '@activepieces/pieces-framework';
import { raindropAuth } from './lib/auth';
+import { raindropClient } from './lib/common/client';
import { createRaindropAction } from './lib/actions/create-raindrop';
import { getRaindropAction } from './lib/actions/get-raindrop';
import { updateRaindropAction } from './lib/actions/update-raindrop';
import { deleteRaindropAction } from './lib/actions/delete-raindrop';
import { findRaindropsAction } from './lib/actions/find-raindrops';
+import { raindropAiActions } from './lib/actions/ai';
export { raindropAuth };
export const raindrop = createPiece({
displayName: 'Raindrop',
description:
'Bookmark manager to save, search, and organize content from the web',
- minimumSupportedRelease: '0.36.1',
+ minimumSupportedRelease: '0.88.2',
logoUrl: 'https://cdn.activepieces.com/pieces/raindrop.png',
categories: [PieceCategory.PRODUCTIVITY, PieceCategory.CONTENT_AND_FILES],
auth: raindropAuth,
@@ -24,8 +26,9 @@ export const raindrop = createPiece({
updateRaindropAction,
deleteRaindropAction,
findRaindropsAction,
+ ...raindropAiActions,
createCustomApiCallAction({
- baseUrl: () => 'https://api.raindrop.io/rest/v1',
+ baseUrl: () => raindropClient.baseUrl(),
auth: raindropAuth,
authMapping: async (auth) => ({
Authorization: `Bearer ${auth.access_token}`,
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/backups/create-backup.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/backups/create-backup.ts
new file mode 100644
index 00000000000..98b6619a880
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/backups/create-backup.ts
@@ -0,0 +1,34 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropClient } from '../../../common/client';
+import { raindropCreateBackupOutputSchema } from '../../../output-schemas';
+
+export const raindropCreateBackupAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_create_backup',
+ outputSchema: raindropCreateBackupOutputSchema,
+ displayName: 'Create Backup',
+ description: 'Starts generating a new backup of all bookmarks.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Starts generating a new full backup in the background; Raindrop.io emails the account owner when it is ready. Returns no backup ID: poll List Backups until a new entry appears, then fetch it with Download Backup. Not idempotent: each call queues another backup and another email.',
+ idempotent: false,
+ },
+ props: {},
+ async run({ auth }) {
+ return await raindropClient.request<RaindropCreateBackupResponse>({
+ auth,
+ method: HttpMethod.GET,
+ path: '/backup',
+ });
+ },
+});
+
+type RaindropCreateBackupResponse = {
+ result: boolean;
+ message: string;
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/backups/download-backup.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/backups/download-backup.ts
new file mode 100644
index 00000000000..b082010d876
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/backups/download-backup.ts
@@ -0,0 +1,53 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropClient } from '../../../common/client';
+import { raindropDownloadBackupOutputSchema } from '../../../output-schemas';
+
+export const raindropDownloadBackupAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_download_backup',
+ outputSchema: raindropDownloadBackupOutputSchema,
+ displayName: 'Download Backup',
+ description: 'Downloads a backup as an HTML or CSV file.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Downloads one backup as an HTML (browser bookmarks format) or CSV file and returns the stored file. Get the Backup ID from List Backups; a backup started with Create Backup only appears there once it is ready.',
+ idempotent: true,
+ },
+ props: {
+ backupId: Property.ShortText({
+ displayName: 'Backup ID',
+ description: 'Backup ID from List Backups, e.g. "659d42a35ffbb2eb5ae1cb86".',
+ required: true,
+ }),
+ format: Property.StaticDropdown({
+ displayName: 'Format',
+ description: 'File format of the download.',
+ required: true,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'HTML', value: 'html' },
+ { label: 'CSV', value: 'csv' },
+ ],
+ },
+ }),
+ },
+ async run({ auth, propsValue, files }) {
+ const response = await raindropClient.request<Buffer>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/backup/${encodeURIComponent(propsValue.backupId)}.${encodeURIComponent(
+ propsValue.format,
+ )}`,
+ responseType: 'arraybuffer',
+ });
+ const fileName = `raindrop-backup-${propsValue.backupId}.${propsValue.format}`;
+ const file = await files.write({ fileName, data: Buffer.from(response) });
+ return { file, fileName };
+ },
+});
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/backups/list-backups.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/backups/list-backups.ts
new file mode 100644
index 00000000000..5853ad71e33
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/backups/list-backups.ts
@@ -0,0 +1,34 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropClient } from '../../../common/client';
+import { raindropListBackupsOutputSchema } from '../../../output-schemas';
+
+export const raindropListBackupsAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_list_backups',
+ outputSchema: raindropListBackupsOutputSchema,
+ displayName: 'List Backups',
+ description: 'Lists the account backups, newest first.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ "Lists the account's backups with their IDs and creation dates, newest first. Use it to get the Backup ID for Download Backup, or to check whether a backup started with Create Backup is ready.",
+ idempotent: true,
+ },
+ props: {},
+ async run({ auth }) {
+ return await raindropClient.request<RaindropListBackupsResponse>({
+ auth,
+ method: HttpMethod.GET,
+ path: '/backups',
+ });
+ },
+});
+
+type RaindropListBackupsResponse = {
+ result: boolean;
+ items: { _id: string; created: string }[];
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/bookmarks/create-bookmark.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/bookmarks/create-bookmark.ts
new file mode 100644
index 00000000000..a70543dd34c
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/bookmarks/create-bookmark.ts
@@ -0,0 +1,79 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropAiProps } from '../../../common/ai-props';
+import { raindropClient } from '../../../common/client';
+import { raindropUtils } from '../../../common/utils';
+import { raindropCreateBookmarkOutputSchema } from '../../../output-schemas';
+
+export const raindropCreateBookmarkAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_create_bookmark',
+ outputSchema: raindropCreateBookmarkOutputSchema,
+ displayName: 'Create Bookmark',
+ description: 'Saves a new bookmark (raindrop) from a URL.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Saves a URL as a new Raindrop.io bookmark, optionally with title, excerpt, note, tags, collection and favourite flag. Missing title, excerpt and cover are parsed from the page in the background. Not idempotent: each call adds another bookmark, even for a URL already saved (use Check URLs Exist first to avoid duplicates).',
+ idempotent: false,
+ },
+ props: {
+ link: Property.ShortText({
+ displayName: 'URL',
+ description: 'The URL to bookmark, e.g. "https://example.com/article".',
+ required: true,
+ }),
+ title: Property.ShortText({
+ displayName: 'Title',
+ description: 'Bookmark title. Parsed from the page when omitted.',
+ required: false,
+ }),
+ excerpt: Property.LongText({
+ displayName: 'Excerpt',
+ description: 'Short description of the page.',
+ required: false,
+ }),
+ note: Property.LongText({
+ displayName: 'Note',
+ description: 'Personal note on the bookmark.',
+ required: false,
+ }),
+ collectionId: raindropAiProps.collectionId({
+ required: false,
+ description: 'Collection ID to save into, from List Collections. Defaults to Unsorted (-1).',
+ }),
+ tags: raindropAiProps.tags({ required: false }),
+ important: raindropAiProps.booleanChoice({
+ required: false,
+ displayName: 'Favourite',
+ description: 'Mark the bookmark as a favourite.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const tags = raindropUtils.toStringList({ value: propsValue.tags });
+ return await raindropClient.request<RaindropCreateBookmarkResponse>({
+ auth,
+ method: HttpMethod.POST,
+ path: '/raindrop',
+ body: {
+ link: propsValue.link,
+ title: propsValue.title,
+ excerpt: propsValue.excerpt,
+ note: propsValue.note,
+ collection:
+ propsValue.collectionId !== undefined ? { $id: propsValue.collectionId } : undefined,
+ tags: tags.length > 0 ? tags : undefined,
+ important: raindropUtils.toBoolean({ value: propsValue.important }),
+ pleaseParse: {},
+ },
+ });
+ },
+});
+
+type RaindropCreateBookmarkResponse = {
+ result: boolean;
+ item: Record<string, unknown>;
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/bookmarks/create-bookmarks.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/bookmarks/create-bookmarks.ts
new file mode 100644
index 00000000000..f3228dd5c74
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/bookmarks/create-bookmarks.ts
@@ -0,0 +1,65 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropClient } from '../../../common/client';
+import { raindropCreateBookmarksOutputSchema } from '../../../output-schemas';
+
+export const raindropCreateBookmarksAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_create_bookmarks',
+ outputSchema: raindropCreateBookmarksOutputSchema,
+ displayName: 'Create Bookmarks',
+ description: 'Saves up to 100 bookmarks in one call.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Saves 1 to 100 bookmarks in one call; each item needs a "link" and may set title, excerpt, note, tags, important and collection ({"$id": <ID from List Collections>}). Use Create Bookmark for a single URL. Not idempotent: repeating it saves duplicates (use Check URLs Exist first).',
+ idempotent: false,
+ },
+ props: {
+ items: Property.Json({
+ displayName: 'Bookmarks',
+ description:
+ 'JSON array of 1 to 100 bookmark objects, e.g. [{"link": "https://example.com", "title": "Example", "tags": ["ai"], "collection": {"$id": 123}}]. Missing title, excerpt and cover are parsed from the page.',
+ required: true,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const items: unknown = propsValue.items;
+ if (!isBookmarkList(items) || items.length === 0 || items.length > 100) {
+ throw new Error(
+ 'Bookmarks must be a JSON array of 1 to 100 objects, each with a non-empty "link".',
+ );
+ }
+ return await raindropClient.request<RaindropCreateBookmarksResponse>({
+ auth,
+ method: HttpMethod.POST,
+ path: '/raindrops',
+ body: { items: items.map((item) => ({ pleaseParse: {}, ...item })) },
+ });
+ },
+});
+
+function isBookmarkList(value: unknown): value is BookmarkInput[] {
+ return (
+ Array.isArray(value) &&
+ value.every(
+ (item: unknown) =>
+ typeof item === 'object' &&
+ item !== null &&
+ !Array.isArray(item) &&
+ 'link' in item &&
+ typeof item.link === 'string' &&
+ item.link !== '',
+ )
+ );
+}
+
+type BookmarkInput = Record<string, unknown> & { link: string };
+
+type RaindropCreateBookmarksResponse = {
+ result: boolean;
+ items: Record<string, unknown>[];
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/bookmarks/delete-bookmark.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/bookmarks/delete-bookmark.ts
new file mode 100644
index 00000000000..8816037b4af
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/bookmarks/delete-bookmark.ts
@@ -0,0 +1,36 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropAiProps } from '../../../common/ai-props';
+import { raindropClient } from '../../../common/client';
+import { raindropDeleteBookmarkOutputSchema } from '../../../output-schemas';
+
+export const raindropDeleteBookmarkAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_delete_bookmark',
+ outputSchema: raindropDeleteBookmarkOutputSchema,
+ displayName: 'Delete Bookmark',
+ description: 'Moves a bookmark to Trash, or deletes it permanently if already in Trash.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Deletes one bookmark by ID (from List Bookmarks). The first call moves it to Trash (recoverable); calling it on a bookmark already in Trash deletes it permanently, so do not repeat it. Use Delete Bookmarks for many at once.',
+ idempotent: false,
+ },
+ props: {
+ raindropId: raindropAiProps.raindropId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await raindropClient.request<RaindropDeleteBookmarkResponse>({
+ auth,
+ method: HttpMethod.DELETE,
+ path: `/raindrop/${encodeURIComponent(propsValue.raindropId)}`,
+ });
+ },
+});
+
+type RaindropDeleteBookmarkResponse = {
+ result: boolean;
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/bookmarks/delete-bookmarks.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/bookmarks/delete-bookmarks.ts
new file mode 100644
index 00000000000..f6626a7e46f
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/bookmarks/delete-bookmarks.ts
@@ -0,0 +1,71 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropAiProps } from '../../../common/ai-props';
+import { raindropClient } from '../../../common/client';
+import { raindropUtils } from '../../../common/utils';
+import { raindropDeleteBookmarksOutputSchema } from '../../../output-schemas';
+
+export const raindropDeleteBookmarksAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_delete_bookmarks',
+ outputSchema: raindropDeleteBookmarksOutputSchema,
+ displayName: 'Delete Bookmarks',
+ description: 'Moves many bookmarks in a collection to Trash at once.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Moves every bookmark in a collection that matches the given IDs and/or search to Trash, or the whole collection when All Bookmarks is true (an empty ID list never means all). With collection -99 (Trash) they are deleted permanently. Collection 0 covers every collection except Trash; use Delete Bookmark for a single bookmark.',
+ idempotent: false,
+ },
+ props: {
+ collectionId: raindropAiProps.collectionId({
+ required: true,
+ description:
+ 'Collection ID holding the bookmarks, from List Collections. -1 = Unsorted, -99 = Trash (permanent delete); 0 = all collections except Trash.',
+ }),
+ ids: Property.Array({
+ displayName: 'Bookmark IDs',
+ description: 'Only delete these bookmark IDs, from List Bookmarks.',
+ required: false,
+ }),
+ allBookmarks: raindropAiProps.booleanChoice({
+ required: false,
+ displayName: 'All Bookmarks',
+ description:
+ 'Set to true to delete every bookmark in the collection. Required when neither Bookmark IDs nor Search is set.',
+ }),
+ search: Property.ShortText({
+ displayName: 'Search',
+ description: 'Only delete bookmarks matching this Raindrop search query, e.g. "#old".',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const ids = raindropUtils.toStringList({ value: propsValue.ids });
+ const allBookmarks = raindropUtils.toBoolean({ value: propsValue.allBookmarks }) === true;
+ const filtered = ids.length > 0 || (propsValue.search ?? '') !== '';
+ if (allBookmarks && filtered) {
+ throw new Error('Set either All Bookmarks or Bookmark IDs / Search, not both.');
+ }
+ if (!allBookmarks && !filtered) {
+ throw new Error(
+ 'Set Bookmark IDs or Search, or set All Bookmarks to true to delete the whole collection.',
+ );
+ }
+ return await raindropClient.request<RaindropDeleteBookmarksResponse>({
+ auth,
+ method: HttpMethod.DELETE,
+ path: `/raindrops/${encodeURIComponent(propsValue.collectionId)}`,
+ query: propsValue.search !== undefined ? { search: propsValue.search } : undefined,
+ body: ids.length > 0 ? { ids } : undefined,
+ });
+ },
+});
+
+type RaindropDeleteBookmarksResponse = {
+ result: boolean;
+ modified: number;
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/bookmarks/export-bookmarks.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/bookmarks/export-bookmarks.ts
new file mode 100644
index 00000000000..b57c5ca72cf
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/bookmarks/export-bookmarks.ts
@@ -0,0 +1,66 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropAiProps } from '../../../common/ai-props';
+import { raindropClient } from '../../../common/client';
+import { raindropDownloadBackupOutputSchema } from '../../../output-schemas';
+
+export const raindropExportBookmarksAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_export_bookmarks',
+ outputSchema: raindropDownloadBackupOutputSchema,
+ displayName: 'Export Bookmarks',
+ description: 'Exports the bookmarks of a collection as a CSV, HTML or ZIP file.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Exports all bookmarks of a collection (0 = all), optionally filtered by search, as a CSV, HTML or ZIP file and returns the file. Use List Bookmarks to read bookmarks as data instead.',
+ idempotent: true,
+ },
+ props: {
+ collectionId: raindropAiProps.collectionId({
+ required: false,
+ description:
+ 'Collection ID from List Collections. Defaults to 0 (all bookmarks); -1 = Unsorted, -99 = Trash.',
+ }),
+ format: Property.StaticDropdown({
+ displayName: 'Format',
+ description: 'File format of the export.',
+ required: true,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'CSV', value: 'csv' },
+ { label: 'HTML', value: 'html' },
+ { label: 'ZIP', value: 'zip' },
+ ],
+ },
+ }),
+ search: Property.ShortText({
+ displayName: 'Search',
+ description: 'Only export bookmarks matching this Raindrop search query, e.g. "#ai".',
+ required: false,
+ }),
+ sort: raindropAiProps.bookmarkSort({ required: false }),
+ },
+ async run({ auth, propsValue, files }) {
+ const collectionId = propsValue.collectionId ?? '0';
+ const response = await raindropClient.request<Buffer>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/raindrops/${encodeURIComponent(collectionId)}/export.${encodeURIComponent(
+ propsValue.format,
+ )}`,
+ query: {
+ ...(propsValue.search !== undefined ? { search: propsValue.search } : {}),
+ ...(propsValue.sort !== undefined ? { sort: propsValue.sort } : {}),
+ },
+ responseType: 'arraybuffer',
+ });
+ const fileName = `raindrop-export-${collectionId}.${propsValue.format}`;
+ const file = await files.write({ fileName, data: Buffer.from(response) });
+ return { file, fileName };
+ },
+});
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/bookmarks/get-bookmark.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/bookmarks/get-bookmark.ts
new file mode 100644
index 00000000000..385e52082cc
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/bookmarks/get-bookmark.ts
@@ -0,0 +1,37 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropAiProps } from '../../../common/ai-props';
+import { raindropClient } from '../../../common/client';
+import { raindropGetBookmarkOutputSchema } from '../../../output-schemas';
+
+export const raindropGetBookmarkAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_get_bookmark',
+ outputSchema: raindropGetBookmarkOutputSchema,
+ displayName: 'Get Bookmark',
+ description: 'Gets a single bookmark by its ID.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Gets one bookmark by ID, including its tags, collection, cover and highlights. Use it when you already have the ID from List Bookmarks or Create Bookmark; use List Bookmarks to search by text instead.',
+ idempotent: true,
+ },
+ props: {
+ raindropId: raindropAiProps.raindropId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await raindropClient.request<RaindropGetBookmarkResponse>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/raindrop/${encodeURIComponent(propsValue.raindropId)}`,
+ });
+ },
+});
+
+type RaindropGetBookmarkResponse = {
+ result: boolean;
+ item: Record<string, unknown>;
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/bookmarks/list-bookmarks.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/bookmarks/list-bookmarks.ts
new file mode 100644
index 00000000000..8517550a964
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/bookmarks/list-bookmarks.ts
@@ -0,0 +1,78 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropAiProps } from '../../../common/ai-props';
+import { raindropClient } from '../../../common/client';
+import { raindropUtils } from '../../../common/utils';
+import { raindropListBookmarksOutputSchema } from '../../../output-schemas';
+
+export const raindropListBookmarksAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_list_bookmarks',
+ outputSchema: raindropListBookmarksOutputSchema,
+ displayName: 'List Bookmarks',
+ description: 'Lists bookmarks in a collection, with optional search and sort.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists one page of bookmarks from a collection (0 = all except Trash), optionally filtered by a Raindrop search query and sorted. Use it to find bookmark IDs for Get Bookmark, Update Bookmark or Delete Bookmark. Returns at most 50 bookmarks per call; raise Page to read further. A bookmark created or bulk-updated seconds ago may not match a search yet.',
+ idempotent: true,
+ },
+ props: {
+ collectionId: raindropAiProps.collectionId({
+ required: false,
+ description:
+ 'Collection ID from List Collections or List Child Collections. Defaults to 0 (all bookmarks except Trash); -1 = Unsorted, -99 = Trash.',
+ }),
+ search: Property.ShortText({
+ displayName: 'Search',
+ description:
+ 'Raindrop search query, the same text that works in the Raindrop app search box, e.g. "#ai type:article".',
+ required: false,
+ }),
+ sort: raindropAiProps.bookmarkSort({ required: false }),
+ page: Property.Number({
+ displayName: 'Page',
+ description: 'Zero-based page number. Defaults to 0.',
+ required: false,
+ }),
+ perpage: Property.Number({
+ displayName: 'Per Page',
+ description: 'Bookmarks per page, 1 to 50. Defaults to 25.',
+ required: false,
+ }),
+ nested: raindropAiProps.booleanChoice({
+ required: false,
+ displayName: 'Include Nested Collections',
+ description: 'Yes also includes bookmarks from child collections. Defaults to No.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const perpage = propsValue.perpage ?? 25;
+ if (perpage < 1) {
+ throw new Error('Per Page must be at least 1.');
+ }
+ const nested = raindropUtils.toBoolean({ value: propsValue.nested });
+ return await raindropClient.request<RaindropListBookmarksResponse>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/raindrops/${encodeURIComponent(propsValue.collectionId ?? '0')}`,
+ query: {
+ page: String(propsValue.page ?? 0),
+ perpage: String(Math.min(perpage, 50)),
+ ...(propsValue.search !== undefined ? { search: propsValue.search } : {}),
+ ...(propsValue.sort !== undefined ? { sort: propsValue.sort } : {}),
+ ...(nested === true ? { nested: 'true' } : {}),
+ },
+ });
+ },
+});
+
+type RaindropListBookmarksResponse = {
+ result: boolean;
+ items: Record<string, unknown>[];
+ count: number;
+ collectionId: number;
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/bookmarks/update-bookmark.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/bookmarks/update-bookmark.ts
new file mode 100644
index 00000000000..3cb85a35711
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/bookmarks/update-bookmark.ts
@@ -0,0 +1,118 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropAiProps } from '../../../common/ai-props';
+import { raindropClient } from '../../../common/client';
+import { raindropUtils } from '../../../common/utils';
+import { raindropUpdateBookmarkOutputSchema } from '../../../output-schemas';
+
+export const raindropUpdateBookmarkAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_update_bookmark',
+ outputSchema: raindropUpdateBookmarkOutputSchema,
+ displayName: 'Update Bookmark',
+ description: 'Updates the fields you set on an existing bookmark.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Changes only the fields you set on one bookmark (ID from List Bookmarks): URL, title, excerpt, note, cover, collection, tags or favourite flag. Tags replace the existing list; set Clear Tags to remove them all. Use Update Bookmarks to change many bookmarks at once.',
+ idempotent: true,
+ },
+ props: {
+ raindropId: raindropAiProps.raindropId({ required: true }),
+ link: Property.ShortText({
+ displayName: 'URL',
+ description: 'New URL for the bookmark.',
+ required: false,
+ }),
+ title: Property.ShortText({
+ displayName: 'Title',
+ description: 'New title.',
+ required: false,
+ }),
+ excerpt: Property.LongText({
+ displayName: 'Excerpt',
+ description: 'New short description of the page.',
+ required: false,
+ }),
+ note: Property.LongText({
+ displayName: 'Note',
+ description: 'New personal note.',
+ required: false,
+ }),
+ cover: Property.ShortText({
+ displayName: 'Cover URL',
+ description:
+ 'New cover image URL. Use Upload Bookmark Cover to upload an image file instead.',
+ required: false,
+ }),
+ collectionId: raindropAiProps.collectionId({
+ required: false,
+ description:
+ 'Collection ID to move the bookmark into, from List Collections. -1 = Unsorted, -99 = Trash.',
+ }),
+ tags: raindropAiProps.tags({
+ required: false,
+ description: 'Tag names that replace the current tags, e.g. ["reading", "ai"].',
+ }),
+ clearTags: raindropAiProps.booleanChoice({
+ required: false,
+ displayName: 'Clear Tags',
+ description: 'Remove all tags from the bookmark. Cannot be combined with Tags.',
+ }),
+ important: raindropAiProps.booleanChoice({
+ required: false,
+ displayName: 'Favourite',
+ description: 'Mark or unmark the bookmark as a favourite.',
+ }),
+ order: Property.Number({
+ displayName: 'Order',
+ description: 'Sort position in its collection, ascending; 0 moves it to the top.',
+ required: false,
+ }),
+ pleaseParse: raindropAiProps.booleanChoice({
+ required: false,
+ displayName: 'Re-parse Metadata',
+ description: 'Re-read cover, type and content from the URL in the background.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const tags = raindropUtils.toStringList({ value: propsValue.tags });
+ const clearTags = raindropUtils.toBoolean({ value: propsValue.clearTags }) === true;
+ if (clearTags && tags.length > 0) {
+ throw new Error('Set either Tags or Clear Tags, not both.');
+ }
+ const body: Record<string, unknown> = {
+ ...(propsValue.link !== undefined ? { link: propsValue.link } : {}),
+ ...(propsValue.title !== undefined ? { title: propsValue.title } : {}),
+ ...(propsValue.excerpt !== undefined ? { excerpt: propsValue.excerpt } : {}),
+ ...(propsValue.note !== undefined ? { note: propsValue.note } : {}),
+ ...(propsValue.cover !== undefined ? { cover: propsValue.cover } : {}),
+ ...(propsValue.collectionId !== undefined
+ ? { collection: { $id: propsValue.collectionId } }
+ : {}),
+ ...(tags.length > 0 ? { tags } : {}),
+ ...(clearTags ? { tags: [] } : {}),
+ ...(propsValue.important !== undefined
+ ? { important: raindropUtils.toBoolean({ value: propsValue.important }) }
+ : {}),
+ ...(propsValue.order !== undefined ? { order: propsValue.order } : {}),
+ ...(raindropUtils.toBoolean({ value: propsValue.pleaseParse }) === true
+ ? { pleaseParse: {} }
+ : {}),
+ };
+ return await raindropClient.request<RaindropUpdateBookmarkResponse>({
+ auth,
+ method: HttpMethod.PUT,
+ path: `/raindrop/${encodeURIComponent(propsValue.raindropId)}`,
+ body,
+ });
+ },
+});
+
+type RaindropUpdateBookmarkResponse = {
+ result: boolean;
+ item: Record<string, unknown>;
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/bookmarks/update-bookmarks.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/bookmarks/update-bookmarks.ts
new file mode 100644
index 00000000000..498fb37cc45
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/bookmarks/update-bookmarks.ts
@@ -0,0 +1,116 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropAiProps } from '../../../common/ai-props';
+import { raindropClient } from '../../../common/client';
+import { raindropUtils } from '../../../common/utils';
+import { raindropDeleteBookmarksOutputSchema } from '../../../output-schemas';
+
+export const raindropUpdateBookmarksAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_update_bookmarks',
+ outputSchema: raindropDeleteBookmarksOutputSchema,
+ displayName: 'Update Bookmarks',
+ description: 'Updates many bookmarks in a collection at once.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Updates every bookmark in a collection that matches the given IDs and/or search, or the whole collection when All Bookmarks is true (an empty ID list never means all): favourite flag, cover, move to another collection, or tags (appended; Clear Tags removes all). Collection 0 covers every collection except Trash. Use Update Bookmark for a single bookmark or to replace its tags.',
+ idempotent: true,
+ },
+ props: {
+ collectionId: raindropAiProps.collectionId({
+ required: true,
+ description:
+ 'Collection ID holding the bookmarks, from List Collections. -1 = Unsorted, -99 = Trash; 0 = all collections except Trash.',
+ }),
+ ids: Property.Array({
+ displayName: 'Bookmark IDs',
+ description: 'Only update these bookmark IDs, from List Bookmarks.',
+ required: false,
+ }),
+ allBookmarks: raindropAiProps.booleanChoice({
+ required: false,
+ displayName: 'All Bookmarks',
+ description:
+ 'Set to true to update every bookmark in the collection. Required when neither Bookmark IDs nor Search is set.',
+ }),
+ search: Property.ShortText({
+ displayName: 'Search',
+ description: 'Only update bookmarks matching this Raindrop search query, e.g. "#ai".',
+ required: false,
+ }),
+ important: raindropAiProps.booleanChoice({
+ required: false,
+ displayName: 'Favourite',
+ description: 'Mark or unmark the bookmarks as favourites.',
+ }),
+ tags: raindropAiProps.tags({
+ required: false,
+ description: 'Tag names to add to the bookmarks, e.g. ["reading"]. Existing tags are kept.',
+ }),
+ clearTags: raindropAiProps.booleanChoice({
+ required: false,
+ displayName: 'Clear Tags',
+ description: 'Remove all tags from the bookmarks. Cannot be combined with Tags.',
+ }),
+ cover: Property.ShortText({
+ displayName: 'Cover URL',
+ description: 'Cover image URL to set, or "<screenshot>" to use a page screenshot.',
+ required: false,
+ }),
+ targetCollectionId: raindropAiProps.collectionId({
+ required: false,
+ displayName: 'Move to Collection ID',
+ description: 'Collection ID to move the bookmarks into, from List Collections.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const ids = raindropUtils.toStringList({ value: propsValue.ids });
+ const allBookmarks = raindropUtils.toBoolean({ value: propsValue.allBookmarks }) === true;
+ const filtered = ids.length > 0 || (propsValue.search ?? '') !== '';
+ if (allBookmarks && filtered) {
+ throw new Error('Set either All Bookmarks or Bookmark IDs / Search, not both.');
+ }
+ if (!allBookmarks && !filtered) {
+ throw new Error(
+ 'Set Bookmark IDs or Search, or set All Bookmarks to true to update the whole collection.',
+ );
+ }
+ const tags = raindropUtils.toStringList({ value: propsValue.tags });
+ const clearTags = raindropUtils.toBoolean({ value: propsValue.clearTags }) === true;
+ if (clearTags && tags.length > 0) {
+ throw new Error('Set either Tags or Clear Tags, not both.');
+ }
+ const changes: Record<string, unknown> = {
+ ...(propsValue.important !== undefined
+ ? { important: raindropUtils.toBoolean({ value: propsValue.important }) }
+ : {}),
+ ...(tags.length > 0 ? { tags } : {}),
+ ...(clearTags ? { tags: [] } : {}),
+ ...(propsValue.cover !== undefined ? { cover: propsValue.cover } : {}),
+ ...(propsValue.targetCollectionId !== undefined
+ ? { collection: { $id: propsValue.targetCollectionId } }
+ : {}),
+ };
+ if (Object.keys(changes).length === 0) {
+ throw new Error(
+ 'Set at least one change: Favourite, Tags, Clear Tags, Cover URL or Move to Collection ID.',
+ );
+ }
+ return await raindropClient.request<RaindropUpdateBookmarksResponse>({
+ auth,
+ method: HttpMethod.PUT,
+ path: `/raindrops/${encodeURIComponent(propsValue.collectionId)}`,
+ query: propsValue.search !== undefined ? { search: propsValue.search } : undefined,
+ body: { ...changes, ...(ids.length > 0 ? { ids } : {}) },
+ });
+ },
+});
+
+type RaindropUpdateBookmarksResponse = {
+ result: boolean;
+ modified?: number;
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/bookmarks/upload-bookmark-cover.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/bookmarks/upload-bookmark-cover.ts
new file mode 100644
index 00000000000..bfc42c3cccd
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/bookmarks/upload-bookmark-cover.ts
@@ -0,0 +1,45 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropAiProps } from '../../../common/ai-props';
+import { raindropClient } from '../../../common/client';
+import { raindropUploadBookmarkCoverOutputSchema } from '../../../output-schemas';
+
+export const raindropUploadBookmarkCoverAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_upload_bookmark_cover',
+ outputSchema: raindropUploadBookmarkCoverOutputSchema,
+ displayName: 'Upload Bookmark Cover',
+ description: 'Uploads an image as the cover of a bookmark.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Uploads a PNG, GIF or JPEG file and sets it as the cover of one bookmark (ID from List Bookmarks), replacing the current cover. To set a cover from an image URL, use Update Bookmark instead.',
+ idempotent: false,
+ },
+ props: {
+ raindropId: raindropAiProps.raindropId({ required: true }),
+ cover: Property.File({
+ displayName: 'Cover Image',
+ description: 'PNG, GIF or JPEG image file.',
+ required: true,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const form = new FormData();
+ form.append('cover', new Blob([propsValue.cover.data]), propsValue.cover.filename);
+ return await raindropClient.request<RaindropUploadBookmarkCoverResponse>({
+ auth,
+ method: HttpMethod.PUT,
+ path: `/raindrop/${encodeURIComponent(propsValue.raindropId)}/cover`,
+ body: form,
+ });
+ },
+});
+
+type RaindropUploadBookmarkCoverResponse = {
+ result: boolean;
+ item: Record<string, unknown>;
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/bookmarks/upload-file.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/bookmarks/upload-file.ts
new file mode 100644
index 00000000000..7ddd8576a59
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/bookmarks/upload-file.ts
@@ -0,0 +1,43 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropClient } from '../../../common/client';
+import { raindropUploadFileOutputSchema } from '../../../output-schemas';
+
+export const raindropUploadFileAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_upload_file',
+ outputSchema: raindropUploadFileOutputSchema,
+ displayName: 'Upload File',
+ description: 'Uploads a file and saves it as a new bookmark.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Uploads a file (image, PDF, document) to Raindrop.io and saves it as a new bookmark in Unsorted; move it with Update Bookmark. Use Create Bookmark to save a web URL instead. Not idempotent: each call stores another copy.',
+ idempotent: false,
+ },
+ props: {
+ file: Property.File({
+ displayName: 'File',
+ description: 'The file to upload.',
+ required: true,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const form = new FormData();
+ form.append('file', new Blob([propsValue.file.data]), propsValue.file.filename);
+ return await raindropClient.request<RaindropUploadFileResponse>({
+ auth,
+ method: HttpMethod.PUT,
+ path: '/raindrop/file',
+ body: form,
+ });
+ },
+});
+
+type RaindropUploadFileResponse = {
+ result: boolean;
+ item: Record<string, unknown>;
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/collections/create-collection.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/collections/create-collection.ts
new file mode 100644
index 00000000000..55bfd382587
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/collections/create-collection.ts
@@ -0,0 +1,59 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropAiProps } from '../../../common/ai-props';
+import { raindropClient } from '../../../common/client';
+import { raindropUtils } from '../../../common/utils';
+import { raindropCreateCollectionOutputSchema } from '../../../output-schemas';
+
+export const raindropCreateCollectionAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_create_collection',
+ outputSchema: raindropCreateCollectionOutputSchema,
+ displayName: 'Create Collection',
+ description: 'Creates a new collection.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Creates a new collection, at the root or nested under a parent collection, with an optional cover. Raindrop ignores visibility and view on create; set them afterwards with Update Collection. Not idempotent: each call adds another collection, even with the same title (use List Collections first to avoid duplicates).',
+ idempotent: false,
+ },
+ props: {
+ title: Property.ShortText({
+ displayName: 'Title',
+ description: 'Name of the collection.',
+ required: true,
+ }),
+ parentId: raindropAiProps.collectionId({
+ required: false,
+ displayName: 'Parent Collection ID',
+ description:
+ 'ID of the parent collection, from List Collections or List Child Collections. Omit to create a root collection.',
+ }),
+ cover: Property.Array({
+ displayName: 'Cover URLs',
+ description: 'Cover image URLs, e.g. one from Search Covers or List Featured Covers.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const cover = raindropUtils.toStringList({ value: propsValue.cover });
+ return await raindropClient.request<RaindropCreateCollectionResponse>({
+ auth,
+ method: HttpMethod.POST,
+ path: '/collection',
+ body: {
+ title: propsValue.title,
+ parent: propsValue.parentId !== undefined ? { $id: propsValue.parentId } : undefined,
+ cover: cover.length > 0 ? cover : undefined,
+ },
+ });
+ },
+});
+
+type RaindropCreateCollectionResponse = {
+ result: boolean;
+ item: Record<string, unknown>;
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/collections/delete-collection.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/collections/delete-collection.ts
new file mode 100644
index 00000000000..94ae300a8ab
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/collections/delete-collection.ts
@@ -0,0 +1,36 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropAiProps } from '../../../common/ai-props';
+import { raindropClient } from '../../../common/client';
+import { raindropEmptyTrashOutputSchema } from '../../../output-schemas';
+
+export const raindropDeleteCollectionAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_delete_collection',
+ outputSchema: raindropEmptyTrashOutputSchema,
+ displayName: 'Delete Collection',
+ description: 'Deletes a collection and all its sub-collections.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Deletes one collection and all of its nested collections; their bookmarks move to Trash. Get the collection ID from List Collections or List Child Collections. Use Delete Collections to remove several at once.',
+ idempotent: false,
+ },
+ props: {
+ collectionId: raindropAiProps.collectionId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await raindropClient.request<RaindropDeleteCollectionResponse>({
+ auth,
+ method: HttpMethod.DELETE,
+ path: `/collection/${encodeURIComponent(propsValue.collectionId)}`,
+ });
+ },
+});
+
+type RaindropDeleteCollectionResponse = {
+ result: boolean;
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/collections/delete-collections.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/collections/delete-collections.ts
new file mode 100644
index 00000000000..6c9df996a69
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/collections/delete-collections.ts
@@ -0,0 +1,46 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropClient } from '../../../common/client';
+import { raindropUtils } from '../../../common/utils';
+import { raindropDeleteCollectionsOutputSchema } from '../../../output-schemas';
+
+export const raindropDeleteCollectionsAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_delete_collections',
+ outputSchema: raindropDeleteCollectionsOutputSchema,
+ displayName: 'Delete Collections',
+ description: 'Deletes several collections at once.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Deletes several collections in one call; their bookmarks move to Trash. Nested collections are not removed with their parent here, so list their IDs too (from List Child Collections). Use Delete Collection for a single collection with all its descendants.',
+ idempotent: false,
+ },
+ props: {
+ ids: Property.Array({
+ displayName: 'Collection IDs',
+ description:
+ 'IDs of the collections to delete, from List Collections or List Child Collections, e.g. ["123", "456"].',
+ required: true,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const ids = raindropUtils.toStringList({ value: propsValue.ids });
+ if (ids.length === 0 || !ids.every((id) => id !== '')) {
+ throw new Error('Collection IDs must be a non-empty list of IDs.');
+ }
+ return await raindropClient.request<RaindropDeleteCollectionsResponse>({
+ auth,
+ method: HttpMethod.DELETE,
+ path: '/collections',
+ body: { ids },
+ });
+ },
+});
+
+type RaindropDeleteCollectionsResponse = {
+ result: boolean;
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/collections/delete-empty-collections.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/collections/delete-empty-collections.ts
new file mode 100644
index 00000000000..20b84b2bbee
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/collections/delete-empty-collections.ts
@@ -0,0 +1,34 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropClient } from '../../../common/client';
+import { raindropDeleteEmptyCollectionsOutputSchema } from '../../../output-schemas';
+
+export const raindropDeleteEmptyCollectionsAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_delete_empty_collections',
+ outputSchema: raindropDeleteEmptyCollectionsOutputSchema,
+ displayName: 'Delete Empty Collections',
+ description: 'Deletes every collection that has no bookmarks.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Deletes every collection that holds no bookmarks and returns how many were removed. Repeating it removes nothing more. Use Delete Collection or Delete Collections to remove specific collections.',
+ idempotent: true,
+ },
+ props: {},
+ async run({ auth }) {
+ return await raindropClient.request<RaindropDeleteEmptyCollectionsResponse>({
+ auth,
+ method: HttpMethod.PUT,
+ path: '/collections/clean',
+ });
+ },
+});
+
+type RaindropDeleteEmptyCollectionsResponse = {
+ result: boolean;
+ count: number;
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/collections/empty-trash.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/collections/empty-trash.ts
new file mode 100644
index 00000000000..1e682f9b746
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/collections/empty-trash.ts
@@ -0,0 +1,33 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropClient } from '../../../common/client';
+import { raindropEmptyTrashOutputSchema } from '../../../output-schemas';
+
+export const raindropEmptyTrashAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_empty_trash',
+ outputSchema: raindropEmptyTrashOutputSchema,
+ displayName: 'Empty Trash',
+ description: 'Permanently deletes every bookmark in Trash.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Permanently deletes every bookmark in the Trash collection (-99); they cannot be recovered. Get Collection Counts shows how many are in Trash first.',
+ idempotent: true,
+ },
+ props: {},
+ async run({ auth }) {
+ return await raindropClient.request<RaindropEmptyTrashResponse>({
+ auth,
+ method: HttpMethod.DELETE,
+ path: '/collection/-99',
+ });
+ },
+});
+
+type RaindropEmptyTrashResponse = {
+ result: boolean;
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/collections/expand-collections.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/collections/expand-collections.ts
new file mode 100644
index 00000000000..fa843cb0b98
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/collections/expand-collections.ts
@@ -0,0 +1,44 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropAiProps } from '../../../common/ai-props';
+import { raindropClient } from '../../../common/client';
+import { raindropUtils } from '../../../common/utils';
+import { raindropEmptyTrashOutputSchema } from '../../../output-schemas';
+
+export const raindropExpandCollectionsAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_expand_collections',
+ outputSchema: raindropEmptyTrashOutputSchema,
+ displayName: 'Expand Collections',
+ description: 'Expands or collapses all collections.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Expands or collapses the sub-collections of every collection at once. To change a single collection use Update Collection with Expanded.',
+ idempotent: true,
+ },
+ props: {
+ expanded: raindropAiProps.booleanChoice({
+ required: true,
+ displayName: 'Expanded',
+ description: 'Yes expands all collections, No collapses all.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await raindropClient.request<RaindropExpandCollectionsResponse>({
+ auth,
+ method: HttpMethod.PUT,
+ path: '/collections',
+ body: {
+ expanded: raindropUtils.toBoolean({ value: propsValue.expanded }),
+ },
+ });
+ },
+});
+
+type RaindropExpandCollectionsResponse = {
+ result: boolean;
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/collections/get-collection-counts.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/collections/get-collection-counts.ts
new file mode 100644
index 00000000000..e8a6c7f1523
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/collections/get-collection-counts.ts
@@ -0,0 +1,35 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropClient } from '../../../common/client';
+import { raindropGetCollectionCountsOutputSchema } from '../../../output-schemas';
+
+export const raindropGetCollectionCountsAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_get_collection_counts',
+ outputSchema: raindropGetCollectionCountsOutputSchema,
+ displayName: 'Get Collection Counts',
+ description: 'Gets bookmark counts for the system collections (All, Unsorted, Trash).',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ "Returns the bookmark count of each system collection (0 = all bookmarks, -1 = Unsorted, -99 = Trash) plus the number of duplicate and broken bookmarks. For a user collection's count use Get Collection.",
+ idempotent: true,
+ },
+ props: {},
+ async run({ auth }) {
+ return await raindropClient.request<RaindropGetCollectionCountsResponse>({
+ auth,
+ method: HttpMethod.GET,
+ path: '/user/stats',
+ });
+ },
+});
+
+type RaindropGetCollectionCountsResponse = {
+ result: boolean;
+ items: { _id: number; count: number }[];
+ meta: Record<string, unknown>;
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/collections/get-collection.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/collections/get-collection.ts
new file mode 100644
index 00000000000..955d02bb4c1
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/collections/get-collection.ts
@@ -0,0 +1,37 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropAiProps } from '../../../common/ai-props';
+import { raindropClient } from '../../../common/client';
+import { raindropGetCollectionOutputSchema } from '../../../output-schemas';
+
+export const raindropGetCollectionAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_get_collection',
+ outputSchema: raindropGetCollectionOutputSchema,
+ displayName: 'Get Collection',
+ description: 'Gets a single collection by ID.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Returns one collection by ID with its title, bookmark count, cover, view, visibility, access level and parent. Get the ID from List Collections or List Child Collections.',
+ idempotent: true,
+ },
+ props: {
+ collectionId: raindropAiProps.collectionId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await raindropClient.request<RaindropGetCollectionResponse>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/collection/${encodeURIComponent(propsValue.collectionId)}`,
+ });
+ },
+});
+
+type RaindropGetCollectionResponse = {
+ result: boolean;
+ item: Record<string, unknown>;
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/collections/list-child-collections.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/collections/list-child-collections.ts
new file mode 100644
index 00000000000..3ee3137c044
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/collections/list-child-collections.ts
@@ -0,0 +1,25 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropApi } from '../../../common/api';
+import { raindropListChildCollectionsOutputSchema } from '../../../output-schemas';
+
+export const raindropListChildCollectionsAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_list_child_collections',
+ outputSchema: raindropListChildCollectionsOutputSchema,
+ displayName: 'List Child Collections',
+ description: 'Lists all nested (child) collections.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Returns every nested collection (one that has a parent), each with its ID, title, bookmark count and parent.$id. Use List Collections for root collections; this action does not include them.',
+ idempotent: true,
+ },
+ props: {},
+ async run({ auth }) {
+ const items = await raindropApi.listChildCollections({ auth });
+ return { items, count: items.length };
+ },
+});
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/collections/list-collections.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/collections/list-collections.ts
new file mode 100644
index 00000000000..0e38bade676
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/collections/list-collections.ts
@@ -0,0 +1,25 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropApi } from '../../../common/api';
+import { raindropListCollectionsOutputSchema } from '../../../output-schemas';
+
+export const raindropListCollectionsAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_list_collections',
+ outputSchema: raindropListCollectionsOutputSchema,
+ displayName: 'List Collections',
+ description: 'Lists all root (top-level) collections.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Returns every root (top-level) collection with its ID, title, bookmark count, sort position and settings. Use List Child Collections for nested collections; together they give every collection ID other actions take.',
+ idempotent: true,
+ },
+ props: {},
+ async run({ auth }) {
+ const items = await raindropApi.listCollections({ auth });
+ return { items, count: items.length };
+ },
+});
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/collections/list-featured-covers.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/collections/list-featured-covers.ts
new file mode 100644
index 00000000000..1dfef3235da
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/collections/list-featured-covers.ts
@@ -0,0 +1,34 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropClient } from '../../../common/client';
+import { raindropListFeaturedCoversOutputSchema } from '../../../output-schemas';
+
+export const raindropListFeaturedCoversAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_list_featured_covers',
+ outputSchema: raindropListFeaturedCoversOutputSchema,
+ displayName: 'List Featured Covers',
+ description: 'Lists the featured cover icon sets.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Returns the featured cover icon sets, each with its icon image URLs. Pass a returned URL as a cover to Create Collection or Update Collection. Use Search Covers to find icons by keyword.',
+ idempotent: true,
+ },
+ props: {},
+ async run({ auth }) {
+ return await raindropClient.request<RaindropListFeaturedCoversResponse>({
+ auth,
+ method: HttpMethod.GET,
+ path: '/collections/covers',
+ });
+ },
+});
+
+type RaindropListFeaturedCoversResponse = {
+ result?: boolean;
+ items: { title: string; icons: { png?: string; svg?: string }[] }[];
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/collections/merge-collections.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/collections/merge-collections.ts
new file mode 100644
index 00000000000..18ec82ca497
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/collections/merge-collections.ts
@@ -0,0 +1,52 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropAiProps } from '../../../common/ai-props';
+import { raindropClient } from '../../../common/client';
+import { raindropUtils } from '../../../common/utils';
+import { raindropDeleteCollectionsOutputSchema } from '../../../output-schemas';
+
+export const raindropMergeCollectionsAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_merge_collections',
+ outputSchema: raindropDeleteCollectionsOutputSchema,
+ displayName: 'Merge Collections',
+ description: 'Merges several collections into one.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Moves the bookmarks of the listed collections into a target collection and removes the merged collections. Get all IDs from List Collections or List Child Collections. Cannot be undone.',
+ idempotent: false,
+ },
+ props: {
+ to: raindropAiProps.collectionId({
+ required: true,
+ displayName: 'Target Collection ID',
+ description:
+ 'ID of the collection to merge into, from List Collections or List Child Collections.',
+ }),
+ ids: Property.Array({
+ displayName: 'Collection IDs',
+ description: 'IDs of the collections to merge into the target, e.g. ["123", "456"].',
+ required: true,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const ids = raindropUtils.toStringList({ value: propsValue.ids });
+ if (ids.length === 0 || !ids.every((id) => id !== '')) {
+ throw new Error('Collection IDs must be a non-empty list of IDs.');
+ }
+ return await raindropClient.request<RaindropMergeCollectionsResponse>({
+ auth,
+ method: HttpMethod.PUT,
+ path: '/collections/merge',
+ body: { to: propsValue.to, ids },
+ });
+ },
+});
+
+type RaindropMergeCollectionsResponse = {
+ result: boolean;
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/collections/search-covers.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/collections/search-covers.ts
new file mode 100644
index 00000000000..2f94ef335af
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/collections/search-covers.ts
@@ -0,0 +1,40 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropClient } from '../../../common/client';
+import { raindropSearchCoversOutputSchema } from '../../../output-schemas';
+
+export const raindropSearchCoversAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_search_covers',
+ outputSchema: raindropSearchCoversOutputSchema,
+ displayName: 'Search Covers',
+ description: 'Searches cover icons by keyword.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Searches the cover icon library by keyword and returns icon image URLs grouped by source. Pass a returned URL as a cover to Create Collection or Update Collection. Use List Featured Covers to browse without a keyword.',
+ idempotent: true,
+ },
+ props: {
+ text: Property.ShortText({
+ displayName: 'Search Text',
+ description: 'Keyword to search for, e.g. "pokemon".',
+ required: true,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await raindropClient.request<RaindropSearchCoversResponse>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/collections/covers/${encodeURIComponent(propsValue.text)}`,
+ });
+ },
+});
+
+type RaindropSearchCoversResponse = {
+ result: boolean;
+ items: { title: string; icons: { png?: string; svg?: string }[] }[];
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/collections/sort-collections.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/collections/sort-collections.ts
new file mode 100644
index 00000000000..e21f9a5c87e
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/collections/sort-collections.ts
@@ -0,0 +1,48 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropClient } from '../../../common/client';
+import { raindropEmptyTrashOutputSchema } from '../../../output-schemas';
+
+export const raindropSortCollectionsAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_sort_collections',
+ outputSchema: raindropEmptyTrashOutputSchema,
+ displayName: 'Sort Collections',
+ description: 'Reorders all collections by title or bookmark count.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ "Reorders all of the user's collections at once: alphabetically ascending or descending, or by bookmark count descending.",
+ idempotent: true,
+ },
+ props: {
+ sort: Property.StaticDropdown({
+ displayName: 'Sort By',
+ description: 'Order to apply to all collections.',
+ required: true,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Title (A to Z)', value: 'title' },
+ { label: 'Title (Z to A)', value: '-title' },
+ { label: 'Bookmark count (most first)', value: '-count' },
+ ],
+ },
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await raindropClient.request<RaindropSortCollectionsResponse>({
+ auth,
+ method: HttpMethod.PUT,
+ path: '/collections',
+ body: { sort: propsValue.sort },
+ });
+ },
+});
+
+type RaindropSortCollectionsResponse = {
+ result: boolean;
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/collections/update-collection.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/collections/update-collection.ts
new file mode 100644
index 00000000000..4f8ca670098
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/collections/update-collection.ts
@@ -0,0 +1,95 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropAiProps } from '../../../common/ai-props';
+import { raindropClient } from '../../../common/client';
+import { raindropUtils } from '../../../common/utils';
+import { raindropUpdateCollectionOutputSchema } from '../../../output-schemas';
+
+export const raindropUpdateCollectionAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_update_collection',
+ outputSchema: raindropUpdateCollectionOutputSchema,
+ displayName: 'Update Collection',
+ description: 'Updates an existing collection.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Changes only the fields you set on an existing collection: title, parent, visibility, view, cover or expanded state. Get the collection ID from List Collections or List Child Collections. To upload a cover image file use Upload Collection Cover instead.',
+ idempotent: true,
+ },
+ props: {
+ collectionId: raindropAiProps.collectionId({ required: true }),
+ title: Property.ShortText({
+ displayName: 'Title',
+ description: 'New name of the collection.',
+ required: false,
+ }),
+ parentId: raindropAiProps.collectionId({
+ required: false,
+ displayName: 'Parent Collection ID',
+ description:
+ 'ID of the new parent collection, from List Collections or List Child Collections.',
+ }),
+ public: raindropAiProps.booleanChoice({
+ required: false,
+ displayName: 'Public',
+ description: 'Make the collection and its bookmarks accessible without authentication.',
+ }),
+ view: raindropAiProps.collectionView({ required: false }),
+ cover: Property.Array({
+ displayName: 'Cover URLs',
+ description:
+ 'Cover image URLs, e.g. one from Search Covers or List Featured Covers. Replaces the current cover.',
+ required: false,
+ }),
+ clearCover: raindropAiProps.booleanChoice({
+ required: false,
+ displayName: 'Clear Cover',
+ description: 'Yes removes the current cover. Cannot be combined with Cover URLs.',
+ }),
+ moveToRoot: raindropAiProps.booleanChoice({
+ required: false,
+ displayName: 'Move to Root',
+ description:
+ 'Yes makes the collection a root collection. Cannot be combined with Parent Collection ID.',
+ }),
+ expanded: raindropAiProps.booleanChoice({
+ required: false,
+ displayName: 'Expanded',
+ description: "Show the collection's sub-collections expanded.",
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const cover = raindropUtils.toStringList({ value: propsValue.cover });
+ const clearCover = raindropUtils.toBoolean({ value: propsValue.clearCover }) === true;
+ const moveToRoot = raindropUtils.toBoolean({ value: propsValue.moveToRoot }) === true;
+ if (clearCover && cover.length > 0) {
+ throw new Error('Set either Cover URLs or Clear Cover, not both.');
+ }
+ if (moveToRoot && propsValue.parentId !== undefined) {
+ throw new Error('Set either Parent Collection ID or Move to Root, not both.');
+ }
+ const parent = propsValue.parentId !== undefined ? { $id: propsValue.parentId } : undefined;
+ return await raindropClient.request<RaindropUpdateCollectionResponse>({
+ auth,
+ method: HttpMethod.PUT,
+ path: `/collection/${encodeURIComponent(propsValue.collectionId)}`,
+ body: {
+ title: propsValue.title,
+ parent: moveToRoot ? null : parent,
+ public: raindropUtils.toBoolean({ value: propsValue.public }),
+ view: propsValue.view,
+ cover: clearCover ? [] : cover.length > 0 ? cover : undefined,
+ expanded: raindropUtils.toBoolean({ value: propsValue.expanded }),
+ },
+ });
+ },
+});
+
+type RaindropUpdateCollectionResponse = {
+ result: boolean;
+ item: Record<string, unknown>;
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/collections/upload-collection-cover.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/collections/upload-collection-cover.ts
new file mode 100644
index 00000000000..5fa2b820617
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/collections/upload-collection-cover.ts
@@ -0,0 +1,45 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropAiProps } from '../../../common/ai-props';
+import { raindropClient } from '../../../common/client';
+import { raindropUploadCollectionCoverOutputSchema } from '../../../output-schemas';
+
+export const raindropUploadCollectionCoverAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_upload_collection_cover',
+ outputSchema: raindropUploadCollectionCoverOutputSchema,
+ displayName: 'Upload Collection Cover',
+ description: 'Uploads an image file as the cover of a collection.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Uploads a PNG, GIF or JPEG file and sets it as the cover of a collection, replacing the current one. Get the collection ID from List Collections or List Child Collections. To set a cover from a URL use Update Collection instead.',
+ idempotent: false,
+ },
+ props: {
+ collectionId: raindropAiProps.collectionId({ required: true }),
+ cover: Property.File({
+ displayName: 'Cover Image',
+ description: 'PNG, GIF or JPEG image file.',
+ required: true,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const form = new FormData();
+ form.append('cover', new Blob([propsValue.cover.data]), propsValue.cover.filename);
+ return await raindropClient.request<RaindropUploadCollectionCoverResponse>({
+ auth,
+ method: HttpMethod.PUT,
+ path: `/collection/${encodeURIComponent(propsValue.collectionId)}/cover`,
+ body: form,
+ });
+ },
+});
+
+type RaindropUploadCollectionCoverResponse = {
+ result: boolean;
+ item: Record<string, unknown>;
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/highlights/add-highlight.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/highlights/add-highlight.ts
new file mode 100644
index 00000000000..8bdd8a58437
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/highlights/add-highlight.ts
@@ -0,0 +1,46 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropAiProps } from '../../../common/ai-props';
+import { raindropClient } from '../../../common/client';
+import { raindropAddHighlightOutputSchema } from '../../../output-schemas';
+
+export const raindropAddHighlightAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_add_highlight',
+ outputSchema: raindropAddHighlightOutputSchema,
+ displayName: 'Add Highlight',
+ description: 'Adds a highlighted quote to a bookmark.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ "Adds one highlight (a quoted passage) to a bookmark, with an optional color (yellow by default). Not idempotent: each call adds another highlight, even with the same text. The new highlight ID is in the returned bookmark's highlights list; use Update Highlight to change an existing one.",
+ idempotent: false,
+ },
+ props: {
+ raindropId: raindropAiProps.raindropId({ required: true }),
+ text: Property.LongText({
+ displayName: 'Text',
+ description: 'The highlighted passage, e.g. "Some quote".',
+ required: true,
+ }),
+ color: raindropAiProps.highlightColor({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await raindropClient.request<RaindropAddHighlightResponse>({
+ auth,
+ method: HttpMethod.PUT,
+ path: `/raindrop/${encodeURIComponent(propsValue.raindropId)}`,
+ body: {
+ highlights: [{ text: propsValue.text, color: propsValue.color }],
+ },
+ });
+ },
+});
+
+type RaindropAddHighlightResponse = {
+ result: boolean;
+ item: Record<string, unknown>;
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/highlights/delete-highlight.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/highlights/delete-highlight.ts
new file mode 100644
index 00000000000..e0692e34744
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/highlights/delete-highlight.ts
@@ -0,0 +1,48 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropAiProps } from '../../../common/ai-props';
+import { raindropClient } from '../../../common/client';
+import { raindropDeleteHighlightOutputSchema } from '../../../output-schemas';
+
+export const raindropDeleteHighlightAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_delete_highlight',
+ outputSchema: raindropDeleteHighlightOutputSchema,
+ displayName: 'Delete Highlight',
+ description: 'Removes a highlight from a bookmark.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Permanently removes one highlight from a bookmark; the bookmark itself stays. Needs the bookmark ID and the highlight ID, both from List Highlights (raindropRef and _id). Repeating the call leaves the bookmark unchanged.',
+ idempotent: true,
+ },
+ props: {
+ raindropId: raindropAiProps.raindropId({
+ required: true,
+ description: 'ID of the bookmark the highlight is on: raindropRef from List Highlights.',
+ }),
+ highlightId: Property.ShortText({
+ displayName: 'Highlight ID',
+ description: 'Highlight _id from List Highlights, e.g. "62388e9e48b63606f41e44a6".',
+ required: true,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await raindropClient.request<RaindropDeleteHighlightResponse>({
+ auth,
+ method: HttpMethod.PUT,
+ path: `/raindrop/${encodeURIComponent(propsValue.raindropId)}`,
+ body: {
+ highlights: [{ _id: propsValue.highlightId, text: '' }],
+ },
+ });
+ },
+});
+
+type RaindropDeleteHighlightResponse = {
+ result: boolean;
+ item: Record<string, unknown>;
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/highlights/list-highlights.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/highlights/list-highlights.ts
new file mode 100644
index 00000000000..2e885ef0d7a
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/highlights/list-highlights.ts
@@ -0,0 +1,59 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropAiProps } from '../../../common/ai-props';
+import { raindropClient } from '../../../common/client';
+import { raindropListHighlightsOutputSchema } from '../../../output-schemas';
+
+export const raindropListHighlightsAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_list_highlights',
+ outputSchema: raindropListHighlightsOutputSchema,
+ displayName: 'List Highlights',
+ description: 'Lists highlights across all bookmarks or in one collection.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists highlights with their text, color, tags and the bookmark they belong to (raindropRef), newest first, one page at a time. Set Collection ID (from List Collections) to limit to one collection; leave it empty for all. Returns the highlight IDs Update Highlight and Delete Highlight need.',
+ idempotent: true,
+ },
+ props: {
+ collectionId: raindropAiProps.collectionId({
+ required: false,
+ description:
+ 'Collection ID from List Collections to list highlights of. Leave empty for highlights in all collections.',
+ }),
+ page: Property.Number({
+ displayName: 'Page',
+ description: 'Zero-based page number. Defaults to 0.',
+ required: false,
+ }),
+ perpage: Property.Number({
+ displayName: 'Per Page',
+ description: 'Highlights per page, 1 to 50. Defaults to 25.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const perpage = Math.min(Math.max(propsValue.perpage ?? 25, 1), 50);
+ return await raindropClient.request<RaindropListHighlightsResponse>({
+ auth,
+ method: HttpMethod.GET,
+ path:
+ propsValue.collectionId !== undefined
+ ? `/highlights/${propsValue.collectionId}`
+ : '/highlights',
+ query: {
+ page: String(propsValue.page ?? 0),
+ perpage: String(perpage),
+ },
+ });
+ },
+});
+
+type RaindropListHighlightsResponse = {
+ result: boolean;
+ items: Record<string, unknown>[];
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/highlights/update-highlight.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/highlights/update-highlight.ts
new file mode 100644
index 00000000000..b62851952de
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/highlights/update-highlight.ts
@@ -0,0 +1,72 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropAiProps } from '../../../common/ai-props';
+import { raindropClient } from '../../../common/client';
+import { raindropUpdateHighlightOutputSchema } from '../../../output-schemas';
+
+export const raindropUpdateHighlightAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_update_highlight',
+ outputSchema: raindropUpdateHighlightOutputSchema,
+ displayName: 'Update Highlight',
+ description: 'Changes the text or color of a highlight on a bookmark.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Changes the text and/or color of one existing highlight; fields left empty stay as they are. Needs the bookmark ID and the highlight ID, both from List Highlights (raindropRef and _id). Use Add Highlight for a new one and Delete Highlight to remove one.',
+ idempotent: true,
+ },
+ props: {
+ raindropId: raindropAiProps.raindropId({
+ required: true,
+ description: 'ID of the bookmark the highlight is on: raindropRef from List Highlights.',
+ }),
+ highlightId: Property.ShortText({
+ displayName: 'Highlight ID',
+ description: 'Highlight _id from List Highlights, e.g. "62388e9e48b63606f41e44a6".',
+ required: true,
+ }),
+ text: Property.LongText({
+ displayName: 'Text',
+ description: 'New highlighted passage.',
+ required: false,
+ }),
+ color: raindropAiProps.highlightColor({
+ required: false,
+ description: 'New highlight color.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ if (propsValue.text === undefined && propsValue.color === undefined) {
+ throw new Error('Set at least one of Text or Color.');
+ }
+ const response = await raindropClient.request<RaindropUpdateHighlightResponse>({
+ auth,
+ method: HttpMethod.PUT,
+ path: `/raindrop/${encodeURIComponent(propsValue.raindropId)}`,
+ body: {
+ highlights: [
+ {
+ _id: propsValue.highlightId,
+ text: propsValue.text,
+ color: propsValue.color,
+ },
+ ],
+ },
+ });
+ if (!response.item.highlights.some((highlight) => highlight._id === propsValue.highlightId)) {
+ throw new Error(
+ `Highlight ${propsValue.highlightId} not found on bookmark ${propsValue.raindropId}. Use List Highlights to get its ID.`,
+ );
+ }
+ return response;
+ },
+});
+
+type RaindropUpdateHighlightResponse = {
+ result: boolean;
+ item: { highlights: { _id: string }[] } & Record<string, unknown>;
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/import/check-urls-exist.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/import/check-urls-exist.ts
new file mode 100644
index 00000000000..82170672c15
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/import/check-urls-exist.ts
@@ -0,0 +1,46 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropClient } from '../../../common/client';
+import { raindropUtils } from '../../../common/utils';
+import { raindropCheckUrlsExistOutputSchema } from '../../../output-schemas';
+
+export const raindropCheckUrlsExistAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_check_urls_exist',
+ outputSchema: raindropCheckUrlsExistOutputSchema,
+ displayName: 'Check URLs Exist',
+ description: 'Checks whether URLs are already saved as bookmarks.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Checks which of the given URLs are already saved in Raindrop.io and returns the IDs of the matching bookmarks (empty when none are saved). Call it before Create Bookmark to avoid duplicates. Requires at least one URL.',
+ idempotent: true,
+ },
+ props: {
+ urls: Property.Array({
+ displayName: 'URLs',
+ description: 'URLs to look up, e.g. ["https://example.com/a", "https://example.com/b"].',
+ required: true,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const urls = raindropUtils.toStringList({ value: propsValue.urls });
+ if (urls.length === 0) {
+ throw new Error('urls must contain at least one URL.');
+ }
+ return await raindropClient.request<RaindropCheckUrlsExistResponse>({
+ auth,
+ method: HttpMethod.POST,
+ path: '/import/url/exists',
+ body: { urls },
+ });
+ },
+});
+
+type RaindropCheckUrlsExistResponse = {
+ result: boolean;
+ ids: number[];
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/import/parse-import-file.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/import/parse-import-file.ts
new file mode 100644
index 00000000000..c970579d5c1
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/import/parse-import-file.ts
@@ -0,0 +1,43 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropClient } from '../../../common/client';
+import { raindropParseImportFileOutputSchema } from '../../../output-schemas';
+
+export const raindropParseImportFileAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_parse_import_file',
+ outputSchema: raindropParseImportFileOutputSchema,
+ displayName: 'Parse Import File',
+ description: 'Converts an HTML bookmarks export file into JSON folders and bookmarks.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Converts an HTML bookmarks file (Netscape browser export, Pocket or Instapaper format) into a JSON tree of folders and bookmarks. Nothing is saved: create the bookmarks afterwards with Create Bookmark.',
+ idempotent: true,
+ },
+ props: {
+ file: Property.File({
+ displayName: 'Bookmarks File',
+ description: 'HTML bookmarks file in Netscape, Pocket or Instapaper export format.',
+ required: true,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const form = new FormData();
+ form.append('import', new Blob([propsValue.file.data]), propsValue.file.filename);
+ return await raindropClient.request<RaindropParseImportFileResponse>({
+ auth,
+ method: HttpMethod.POST,
+ path: '/import/file',
+ body: form,
+ });
+ },
+});
+
+type RaindropParseImportFileResponse = {
+ result: boolean;
+ items: Record<string, unknown>[];
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/import/parse-url.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/import/parse-url.ts
new file mode 100644
index 00000000000..44975708982
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/import/parse-url.ts
@@ -0,0 +1,49 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropClient } from '../../../common/client';
+import { raindropParseUrlOutputSchema } from '../../../output-schemas';
+
+export const raindropParseUrlAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_parse_url',
+ outputSchema: raindropParseUrlOutputSchema,
+ displayName: 'Parse URL',
+ description: 'Extracts title, excerpt, media and type from any URL without saving it.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Fetches a URL and returns what Raindrop.io would parse from it (title, excerpt, cover media, type, canonical link) without saving anything. Use it to preview a page before Create Bookmark; use Check URLs Exist to see whether a URL is already saved. Fails when the URL is unreachable or invalid.',
+ idempotent: true,
+ },
+ props: {
+ url: Property.ShortText({
+ displayName: 'URL',
+ description: 'The URL to parse, e.g. "https://example.com/article".',
+ required: true,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const response = await raindropClient.request<RaindropParseUrlResponse>({
+ auth,
+ method: HttpMethod.GET,
+ path: '/import/url/parse',
+ query: { url: propsValue.url },
+ });
+ if (response.error) {
+ throw new Error(
+ `Raindrop could not parse ${propsValue.url}: ${response.errorMessage ?? response.error}`,
+ );
+ }
+ return response;
+ },
+});
+
+type RaindropParseUrlResponse = {
+ result: boolean;
+ item: Record<string, unknown>;
+ error?: string;
+ errorMessage?: string;
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/index.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/index.ts
new file mode 100644
index 00000000000..8540ea7109d
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/index.ts
@@ -0,0 +1,105 @@
+import { raindropCreateBackupAction } from './backups/create-backup';
+import { raindropDownloadBackupAction } from './backups/download-backup';
+import { raindropListBackupsAction } from './backups/list-backups';
+import { raindropCreateBookmarkAction } from './bookmarks/create-bookmark';
+import { raindropCreateBookmarksAction } from './bookmarks/create-bookmarks';
+import { raindropDeleteBookmarkAction } from './bookmarks/delete-bookmark';
+import { raindropDeleteBookmarksAction } from './bookmarks/delete-bookmarks';
+import { raindropExportBookmarksAction } from './bookmarks/export-bookmarks';
+import { raindropGetBookmarkAction } from './bookmarks/get-bookmark';
+import { raindropListBookmarksAction } from './bookmarks/list-bookmarks';
+import { raindropUpdateBookmarkAction } from './bookmarks/update-bookmark';
+import { raindropUpdateBookmarksAction } from './bookmarks/update-bookmarks';
+import { raindropUploadBookmarkCoverAction } from './bookmarks/upload-bookmark-cover';
+import { raindropUploadFileAction } from './bookmarks/upload-file';
+import { raindropCreateCollectionAction } from './collections/create-collection';
+import { raindropDeleteCollectionAction } from './collections/delete-collection';
+import { raindropDeleteCollectionsAction } from './collections/delete-collections';
+import { raindropDeleteEmptyCollectionsAction } from './collections/delete-empty-collections';
+import { raindropEmptyTrashAction } from './collections/empty-trash';
+import { raindropExpandCollectionsAction } from './collections/expand-collections';
+import { raindropGetCollectionAction } from './collections/get-collection';
+import { raindropGetCollectionCountsAction } from './collections/get-collection-counts';
+import { raindropListChildCollectionsAction } from './collections/list-child-collections';
+import { raindropListCollectionsAction } from './collections/list-collections';
+import { raindropListFeaturedCoversAction } from './collections/list-featured-covers';
+import { raindropMergeCollectionsAction } from './collections/merge-collections';
+import { raindropSearchCoversAction } from './collections/search-covers';
+import { raindropSortCollectionsAction } from './collections/sort-collections';
+import { raindropUpdateCollectionAction } from './collections/update-collection';
+import { raindropUploadCollectionCoverAction } from './collections/upload-collection-cover';
+import { raindropAddHighlightAction } from './highlights/add-highlight';
+import { raindropDeleteHighlightAction } from './highlights/delete-highlight';
+import { raindropListHighlightsAction } from './highlights/list-highlights';
+import { raindropUpdateHighlightAction } from './highlights/update-highlight';
+import { raindropCheckUrlsExistAction } from './import/check-urls-exist';
+import { raindropParseImportFileAction } from './import/parse-import-file';
+import { raindropParseUrlAction } from './import/parse-url';
+import { raindropAcceptInvitationAction } from './sharing/accept-invitation';
+import { raindropListCollaboratorsAction } from './sharing/list-collaborators';
+import { raindropRemoveCollaboratorAction } from './sharing/remove-collaborator';
+import { raindropShareCollectionAction } from './sharing/share-collection';
+import { raindropUnshareCollectionAction } from './sharing/unshare-collection';
+import { raindropUpdateCollaboratorAction } from './sharing/update-collaborator';
+import { raindropDeleteTagsAction } from './tags/delete-tags';
+import { raindropGetFiltersAction } from './tags/get-filters';
+import { raindropListTagsAction } from './tags/list-tags';
+import { raindropMergeTagsAction } from './tags/merge-tags';
+import { raindropRenameTagAction } from './tags/rename-tag';
+import { raindropGetCurrentUserAction } from './user/get-current-user';
+import { raindropGetUserByNameAction } from './user/get-user-by-name';
+import { raindropUpdateUserAction } from './user/update-user';
+
+export const raindropAiActions = [
+ raindropCreateBackupAction,
+ raindropDownloadBackupAction,
+ raindropListBackupsAction,
+ raindropCreateBookmarkAction,
+ raindropCreateBookmarksAction,
+ raindropDeleteBookmarkAction,
+ raindropDeleteBookmarksAction,
+ raindropExportBookmarksAction,
+ raindropGetBookmarkAction,
+ raindropListBookmarksAction,
+ raindropUpdateBookmarkAction,
+ raindropUpdateBookmarksAction,
+ raindropUploadBookmarkCoverAction,
+ raindropUploadFileAction,
+ raindropCreateCollectionAction,
+ raindropDeleteCollectionAction,
+ raindropDeleteCollectionsAction,
+ raindropDeleteEmptyCollectionsAction,
+ raindropEmptyTrashAction,
+ raindropExpandCollectionsAction,
+ raindropGetCollectionCountsAction,
+ raindropGetCollectionAction,
+ raindropListChildCollectionsAction,
+ raindropListCollectionsAction,
+ raindropListFeaturedCoversAction,
+ raindropMergeCollectionsAction,
+ raindropSearchCoversAction,
+ raindropSortCollectionsAction,
+ raindropUpdateCollectionAction,
+ raindropUploadCollectionCoverAction,
+ raindropAddHighlightAction,
+ raindropDeleteHighlightAction,
+ raindropListHighlightsAction,
+ raindropUpdateHighlightAction,
+ raindropCheckUrlsExistAction,
+ raindropParseImportFileAction,
+ raindropParseUrlAction,
+ raindropAcceptInvitationAction,
+ raindropListCollaboratorsAction,
+ raindropRemoveCollaboratorAction,
+ raindropShareCollectionAction,
+ raindropUnshareCollectionAction,
+ raindropUpdateCollaboratorAction,
+ raindropDeleteTagsAction,
+ raindropGetFiltersAction,
+ raindropListTagsAction,
+ raindropMergeTagsAction,
+ raindropRenameTagAction,
+ raindropGetCurrentUserAction,
+ raindropGetUserByNameAction,
+ raindropUpdateUserAction,
+];
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/sharing/accept-invitation.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/sharing/accept-invitation.ts
new file mode 100644
index 00000000000..72e182647c4
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/sharing/accept-invitation.ts
@@ -0,0 +1,46 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropAiProps } from '../../../common/ai-props';
+import { raindropClient } from '../../../common/client';
+import { raindropAcceptInvitationOutputSchema } from '../../../output-schemas';
+
+export const raindropAcceptInvitationAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_accept_invitation',
+ displayName: 'Accept Invitation',
+ description: 'Joins a shared collection using an invitation token.',
+ audience: 'ai',
+ outputSchema: raindropAcceptInvitationOutputSchema,
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Joins a collection another user shared with you, using the secret token from the invitation email sent by Share Collection. Fails if the token is wrong or expired, or if you already own the collection.',
+ idempotent: false,
+ },
+ props: {
+ collectionId: raindropAiProps.collectionId({
+ required: true,
+ description: 'ID of the collection you were invited to, from the invitation email.',
+ }),
+ token: Property.ShortText({
+ displayName: 'Invitation Token',
+ description: 'Secret token from the invitation email link.',
+ required: true,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await raindropClient.request<RaindropAcceptInvitationResponse>({
+ auth,
+ method: HttpMethod.POST,
+ path: `/collection/${encodeURIComponent(propsValue.collectionId)}/join`,
+ body: { token: propsValue.token },
+ });
+ },
+});
+
+type RaindropAcceptInvitationResponse = {
+ result: boolean;
+ role: string;
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/sharing/list-collaborators.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/sharing/list-collaborators.ts
new file mode 100644
index 00000000000..18426ca3994
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/sharing/list-collaborators.ts
@@ -0,0 +1,40 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropAiProps } from '../../../common/ai-props';
+import { raindropClient } from '../../../common/client';
+import { raindropListCollaboratorsOutputSchema } from '../../../output-schemas';
+
+export const raindropListCollaboratorsAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_list_collaborators',
+ outputSchema: raindropListCollaboratorsOutputSchema,
+ displayName: 'List Collaborators',
+ description: 'Lists the people a collection is shared with.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the collaborators of a shared collection (ID from List Collections) with their user ID, name, email and role. Use it to get the User ID that Update Collaborator and Remove Collaborator take.',
+ idempotent: true,
+ },
+ props: {
+ collectionId: raindropAiProps.collectionId({
+ required: true,
+ description: 'ID of the shared collection, from List Collections.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await raindropClient.request<RaindropListCollaboratorsResponse>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/collection/${encodeURIComponent(propsValue.collectionId)}/sharing`,
+ });
+ },
+});
+
+type RaindropListCollaboratorsResponse = {
+ result: boolean;
+ items: Record<string, unknown>[];
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/sharing/remove-collaborator.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/sharing/remove-collaborator.ts
new file mode 100644
index 00000000000..b3f0345a541
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/sharing/remove-collaborator.ts
@@ -0,0 +1,46 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropAiProps } from '../../../common/ai-props';
+import { raindropClient } from '../../../common/client';
+import { raindropEmptyTrashOutputSchema } from '../../../output-schemas';
+
+export const raindropRemoveCollaboratorAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_remove_collaborator',
+ outputSchema: raindropEmptyTrashOutputSchema,
+ displayName: 'Remove Collaborator',
+ description: 'Removes a person from a shared collection.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Removes one collaborator from a shared collection; they lose access until invited again with Share Collection. Collection ID comes from List Collections, User ID from List Collaborators. To remove everyone at once use Unshare Collection.',
+ idempotent: false,
+ },
+ props: {
+ collectionId: raindropAiProps.collectionId({
+ required: true,
+ description: 'ID of the shared collection, from List Collections.',
+ }),
+ userId: Property.ShortText({
+ displayName: 'User ID',
+ description: 'Collaborator user ID, from List Collaborators.',
+ required: true,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await raindropClient.request<RaindropRemoveCollaboratorResponse>({
+ auth,
+ method: HttpMethod.DELETE,
+ path: `/collection/${encodeURIComponent(
+ propsValue.collectionId,
+ )}/sharing/${encodeURIComponent(propsValue.userId)}`,
+ });
+ },
+});
+
+type RaindropRemoveCollaboratorResponse = {
+ result: boolean;
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/sharing/share-collection.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/sharing/share-collection.ts
new file mode 100644
index 00000000000..92ecb073031
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/sharing/share-collection.ts
@@ -0,0 +1,58 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropAiProps } from '../../../common/ai-props';
+import { raindropClient } from '../../../common/client';
+import { raindropUtils } from '../../../common/utils';
+import { raindropShareCollectionOutputSchema } from '../../../output-schemas';
+
+export const raindropShareCollectionAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_share_collection',
+ outputSchema: raindropShareCollectionOutputSchema,
+ displayName: 'Share Collection',
+ description: 'Invites people by email to collaborate on a collection.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Sends invitation emails to join a collection (ID from List Collections) as a member (can edit and invite others) or viewer (read-only). Takes 1 to 10 emails per call. Not idempotent: each call sends the invitations again; use List Collaborators to see who already joined.',
+ idempotent: false,
+ },
+ props: {
+ collectionId: raindropAiProps.collectionId({
+ required: true,
+ description: 'ID of the collection to share, from List Collections.',
+ }),
+ emails: Property.Array({
+ displayName: 'Emails',
+ description: 'Email addresses to invite, 1 to 10 per call, e.g. ["[email protected]"].',
+ required: true,
+ }),
+ role: raindropAiProps.collaboratorRole({
+ required: true,
+ description: 'Access level: "member" can edit and invite more people, "viewer" is read-only.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const emails = raindropUtils.toStringList({ value: propsValue.emails });
+ if (emails.length > 10) {
+ throw new Error(`Emails takes at most 10 addresses per call; got ${emails.length}.`);
+ }
+ return await raindropClient.request<RaindropShareCollectionResponse>({
+ auth,
+ method: HttpMethod.POST,
+ path: `/collection/${encodeURIComponent(propsValue.collectionId)}/sharing`,
+ body: {
+ role: propsValue.role,
+ emails,
+ },
+ });
+ },
+});
+
+type RaindropShareCollectionResponse = {
+ result: boolean;
+ emails: string[];
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/sharing/unshare-collection.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/sharing/unshare-collection.ts
new file mode 100644
index 00000000000..2e305efc27b
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/sharing/unshare-collection.ts
@@ -0,0 +1,39 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropAiProps } from '../../../common/ai-props';
+import { raindropClient } from '../../../common/client';
+import { raindropEmptyTrashOutputSchema } from '../../../output-schemas';
+
+export const raindropUnshareCollectionAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_unshare_collection',
+ outputSchema: raindropEmptyTrashOutputSchema,
+ displayName: 'Unshare Collection',
+ description: 'Stops sharing a collection you own, or leaves a collection shared with you.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'For a collection you own, unshares it and removes every collaborator; for a collection shared with you, removes you from it. Collection ID comes from List Collections. To remove a single person use Remove Collaborator.',
+ idempotent: false,
+ },
+ props: {
+ collectionId: raindropAiProps.collectionId({
+ required: true,
+ description: 'ID of the shared collection, from List Collections.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await raindropClient.request<RaindropUnshareCollectionResponse>({
+ auth,
+ method: HttpMethod.DELETE,
+ path: `/collection/${encodeURIComponent(propsValue.collectionId)}/sharing`,
+ });
+ },
+});
+
+type RaindropUnshareCollectionResponse = {
+ result: boolean;
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/sharing/update-collaborator.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/sharing/update-collaborator.ts
new file mode 100644
index 00000000000..e8f4a201162
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/sharing/update-collaborator.ts
@@ -0,0 +1,55 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropAiProps } from '../../../common/ai-props';
+import { raindropClient } from '../../../common/client';
+import { raindropEmptyTrashOutputSchema } from '../../../output-schemas';
+
+export const raindropUpdateCollaboratorAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_update_collaborator',
+ outputSchema: raindropEmptyTrashOutputSchema,
+ displayName: 'Update Collaborator',
+ description: "Changes a collaborator's access level on a shared collection.",
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ "Sets a collaborator's role on a shared collection to member (can edit and invite) or viewer (read-only). Collection ID comes from List Collections, User ID from List Collaborators. Use Remove Collaborator to take access away instead.",
+ idempotent: true,
+ },
+ props: {
+ collectionId: raindropAiProps.collectionId({
+ required: true,
+ description: 'ID of the shared collection, from List Collections.',
+ }),
+ userId: Property.ShortText({
+ displayName: 'User ID',
+ description: 'Collaborator user ID, from List Collaborators.',
+ required: true,
+ }),
+ role: raindropAiProps.collaboratorRole({
+ required: true,
+ description:
+ 'New access level: "member" can edit and invite more people, "viewer" is read-only.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ if (propsValue.role !== 'member' && propsValue.role !== 'viewer') {
+ throw new Error(`Role must be "member" or "viewer"; got "${propsValue.role}".`);
+ }
+ return await raindropClient.request<RaindropUpdateCollaboratorResponse>({
+ auth,
+ method: HttpMethod.PUT,
+ path: `/collection/${encodeURIComponent(
+ propsValue.collectionId,
+ )}/sharing/${encodeURIComponent(propsValue.userId)}`,
+ body: { role: propsValue.role },
+ });
+ },
+});
+
+type RaindropUpdateCollaboratorResponse = {
+ result: boolean;
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/tags/delete-tags.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/tags/delete-tags.ts
new file mode 100644
index 00000000000..71116a75de1
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/tags/delete-tags.ts
@@ -0,0 +1,53 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropAiProps } from '../../../common/ai-props';
+import { raindropClient } from '../../../common/client';
+import { raindropUtils } from '../../../common/utils';
+import { raindropEmptyTrashOutputSchema } from '../../../output-schemas';
+
+export const raindropDeleteTagsAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_delete_tags',
+ outputSchema: raindropEmptyTrashOutputSchema,
+ displayName: 'Delete Tags',
+ description: 'Removes tags from every bookmark that has them.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Removes the given tags from all bookmarks that carry them, everywhere or only within one collection; the bookmarks themselves stay. Tag names come from List Tags. Cannot be undone, but repeating the call changes nothing more.',
+ idempotent: true,
+ },
+ props: {
+ tags: raindropAiProps.tags({
+ required: true,
+ description: 'Tag names to remove, exactly as returned by List Tags, e.g. ["old", "temp"].',
+ }),
+ collectionId: raindropAiProps.collectionId({
+ required: false,
+ description:
+ 'Collection ID from List Collections to limit the removal to. Leave empty to remove from all collections.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const tags = raindropUtils.toStringList({ value: propsValue.tags });
+ if (tags.length === 0) {
+ throw new Error('Tags must list at least one tag name.');
+ }
+ return await raindropClient.request<RaindropDeleteTagsResponse>({
+ auth,
+ method: HttpMethod.DELETE,
+ path:
+ propsValue.collectionId !== undefined
+ ? `/tags/${encodeURIComponent(propsValue.collectionId)}`
+ : '/tags',
+ body: { tags },
+ });
+ },
+});
+
+type RaindropDeleteTagsResponse = {
+ result: boolean;
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/tags/get-filters.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/tags/get-filters.ts
new file mode 100644
index 00000000000..2d350dc225a
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/tags/get-filters.ts
@@ -0,0 +1,67 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropAiProps } from '../../../common/ai-props';
+import { raindropClient } from '../../../common/client';
+import { raindropGetFiltersOutputSchema } from '../../../output-schemas';
+
+export const raindropGetFiltersAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_get_filters',
+ outputSchema: raindropGetFiltersOutputSchema,
+ displayName: 'Get Filters',
+ description: 'Gets tag, type, favourite, broken and duplicate counts for a collection.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Returns bookmark counts for a collection (or all bookmarks): per tag, per type (article, image, video, ...), favourites, untagged, broken links and duplicates, optionally narrowed by a search query. Use List Tags when only tag names are needed.',
+ idempotent: true,
+ },
+ props: {
+ collectionId: raindropAiProps.collectionId({
+ required: false,
+ description: 'Collection ID from List Collections. Defaults to 0 (all bookmarks).',
+ }),
+ tagsSort: Property.StaticDropdown({
+ displayName: 'Sort Tags By',
+ description: 'Order of the tags list. Defaults to count.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Count (highest first)', value: '-count' },
+ { label: 'Name', value: '_id' },
+ ],
+ },
+ }),
+ search: Property.ShortText({
+ displayName: 'Search',
+ description:
+ 'Raindrop search query to count only matching bookmarks, e.g. "#reading" or "apple".',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await raindropClient.request<RaindropGetFiltersResponse>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/filters/${encodeURIComponent(propsValue.collectionId ?? '0')}`,
+ query: {
+ ...(propsValue.tagsSort !== undefined ? { tagsSort: propsValue.tagsSort } : {}),
+ ...(propsValue.search !== undefined ? { search: propsValue.search } : {}),
+ },
+ });
+ },
+});
+
+type RaindropGetFiltersResponse = {
+ result: boolean;
+ broken: { count: number };
+ duplicates: { count: number };
+ important: { count: number };
+ notag: { count: number };
+ tags: { _id: string; count: number }[];
+ types: { _id: string; count: number }[];
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/tags/list-tags.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/tags/list-tags.ts
new file mode 100644
index 00000000000..c2ea7cec73b
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/tags/list-tags.ts
@@ -0,0 +1,44 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropAiProps } from '../../../common/ai-props';
+import { raindropClient } from '../../../common/client';
+import { raindropListTagsOutputSchema } from '../../../output-schemas';
+
+export const raindropListTagsAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_list_tags',
+ outputSchema: raindropListTagsOutputSchema,
+ displayName: 'List Tags',
+ description: 'Lists tags with the number of bookmarks using each.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists every tag name (_id) with its bookmark count, across all collections or within one. Use it to find exact tag names before Rename Tag, Merge Tags or Delete Tags; use Get Filters for tag counts alongside type, favourite and broken-link counts.',
+ idempotent: true,
+ },
+ props: {
+ collectionId: raindropAiProps.collectionId({
+ required: false,
+ description:
+ 'Collection ID from List Collections to list tags of. Leave empty for tags in all collections.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await raindropClient.request<RaindropListTagsResponse>({
+ auth,
+ method: HttpMethod.GET,
+ path:
+ propsValue.collectionId !== undefined
+ ? `/tags/${encodeURIComponent(propsValue.collectionId)}`
+ : '/tags',
+ });
+ },
+});
+
+type RaindropListTagsResponse = {
+ result: boolean;
+ items: { _id: string; count: number }[];
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/tags/merge-tags.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/tags/merge-tags.ts
new file mode 100644
index 00000000000..eb138821cda
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/tags/merge-tags.ts
@@ -0,0 +1,63 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropAiProps } from '../../../common/ai-props';
+import { raindropClient } from '../../../common/client';
+import { raindropUtils } from '../../../common/utils';
+import { raindropEmptyTrashOutputSchema } from '../../../output-schemas';
+
+export const raindropMergeTagsAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_merge_tags',
+ outputSchema: raindropEmptyTrashOutputSchema,
+ displayName: 'Merge Tags',
+ description: 'Merges several tags into one tag.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Replaces each of the given tags with one target tag on every bookmark that has them, everywhere or only within one collection. Tag names come from List Tags. To rename a single tag, use Rename Tag.',
+ idempotent: true,
+ },
+ props: {
+ tags: raindropAiProps.tags({
+ required: true,
+ description:
+ 'Tag names to merge, exactly as returned by List Tags, e.g. ["js", "javascript"].',
+ }),
+ newName: Property.ShortText({
+ displayName: 'Merged Tag Name',
+ description:
+ 'Name of the tag they are merged into. Can be one of the listed tags or a new name.',
+ required: true,
+ }),
+ collectionId: raindropAiProps.collectionId({
+ required: false,
+ description:
+ 'Collection ID from List Collections to limit the merge to. Leave empty to merge in all collections.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const tags = raindropUtils.toStringList({ value: propsValue.tags });
+ if (tags.length === 0) {
+ throw new Error('Tags must list at least one tag name.');
+ }
+ return await raindropClient.request<RaindropMergeTagsResponse>({
+ auth,
+ method: HttpMethod.PUT,
+ path:
+ propsValue.collectionId !== undefined
+ ? `/tags/${encodeURIComponent(propsValue.collectionId)}`
+ : '/tags',
+ body: {
+ replace: propsValue.newName,
+ tags,
+ },
+ });
+ },
+});
+
+type RaindropMergeTagsResponse = {
+ result: boolean;
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/tags/rename-tag.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/tags/rename-tag.ts
new file mode 100644
index 00000000000..681c32061e3
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/tags/rename-tag.ts
@@ -0,0 +1,57 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropAiProps } from '../../../common/ai-props';
+import { raindropClient } from '../../../common/client';
+import { raindropEmptyTrashOutputSchema } from '../../../output-schemas';
+
+export const raindropRenameTagAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_rename_tag',
+ outputSchema: raindropEmptyTrashOutputSchema,
+ displayName: 'Rename Tag',
+ description: 'Renames a tag on every bookmark that has it.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Renames one tag on all bookmarks that carry it, everywhere or only within one collection. Tag names come from List Tags. To fold several tags into one, use Merge Tags.',
+ idempotent: true,
+ },
+ props: {
+ tag: Property.ShortText({
+ displayName: 'Tag',
+ description: 'Current tag name, exactly as returned by List Tags.',
+ required: true,
+ }),
+ newName: Property.ShortText({
+ displayName: 'New Name',
+ description: 'New tag name.',
+ required: true,
+ }),
+ collectionId: raindropAiProps.collectionId({
+ required: false,
+ description:
+ 'Collection ID from List Collections to limit the rename to. Leave empty to rename in all collections.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await raindropClient.request<RaindropRenameTagResponse>({
+ auth,
+ method: HttpMethod.PUT,
+ path:
+ propsValue.collectionId !== undefined
+ ? `/tags/${encodeURIComponent(propsValue.collectionId)}`
+ : '/tags',
+ body: {
+ replace: propsValue.newName,
+ tags: [propsValue.tag],
+ },
+ });
+ },
+});
+
+type RaindropRenameTagResponse = {
+ result: boolean;
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/user/get-current-user.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/user/get-current-user.ts
new file mode 100644
index 00000000000..cbe0bb96a83
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/user/get-current-user.ts
@@ -0,0 +1,34 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropClient } from '../../../common/client';
+import { raindropGetCurrentUserOutputSchema } from '../../../output-schemas';
+
+export const raindropGetCurrentUserAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_get_current_user',
+ outputSchema: raindropGetCurrentUserOutputSchema,
+ displayName: 'Get Current User',
+ description: 'Gets the profile and settings of the connected account.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ "Returns the connected Raindrop.io account: name, email, Pro status, storage usage, settings (config) and the sidebar collection groups. Read it before Update User, whose groups input replaces the whole list. Use Get User by Name for someone else's public profile.",
+ idempotent: true,
+ },
+ props: {},
+ async run({ auth }) {
+ return await raindropClient.request<RaindropGetCurrentUserResponse>({
+ auth,
+ method: HttpMethod.GET,
+ path: '/user',
+ });
+ },
+});
+
+type RaindropGetCurrentUserResponse = {
+ result: boolean;
+ user: Record<string, unknown>;
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/user/get-user-by-name.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/user/get-user-by-name.ts
new file mode 100644
index 00000000000..9a9322631ad
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/user/get-user-by-name.ts
@@ -0,0 +1,40 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropClient } from '../../../common/client';
+import { raindropGetUserByNameOutputSchema } from '../../../output-schemas';
+
+export const raindropGetUserByNameAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_get_user_by_name',
+ outputSchema: raindropGetUserByNameOutputSchema,
+ displayName: 'Get User by Name',
+ description: 'Gets the public profile of a Raindrop.io user by username.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ "Returns the public profile (ID, full name, Pro status, registration date) of any Raindrop.io user by username. Use Get Current User for the connected account's own details. Fails with 404 when the username does not exist.",
+ idempotent: true,
+ },
+ props: {
+ name: Property.ShortText({
+ displayName: 'Username',
+ description: "The Raindrop.io username, as shown in the user's public profile URL.",
+ required: true,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await raindropClient.request<RaindropGetUserByNameResponse>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/user/name/${encodeURIComponent(propsValue.name)}`,
+ });
+ },
+});
+
+type RaindropGetUserByNameResponse = {
+ result: boolean;
+ user: Record<string, unknown>;
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/ai/user/update-user.ts b/packages/pieces/community/raindrop/src/lib/actions/ai/user/update-user.ts
new file mode 100644
index 00000000000..bbc53c63a41
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/actions/ai/user/update-user.ts
@@ -0,0 +1,67 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../../../auth';
+import { raindropClient } from '../../../common/client';
+import { raindropUpdateUserOutputSchema } from '../../../output-schemas';
+
+export const raindropUpdateUserAction = createAction({
+ auth: raindropAuth,
+ name: 'raindrop_update_user',
+ outputSchema: raindropUpdateUserOutputSchema,
+ displayName: 'Update User',
+ description: "Updates the connected account's name, email, settings or collection groups.",
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ "Changes the connected account's full name, email, settings (config) or sidebar collection groups; only the inputs you set are sent. Groups replaces the whole list, so read the current groups with Get Current User first and send the full edited list; there is no revision check, so a concurrent edit can be overwritten. Password changes are not supported.",
+ idempotent: true,
+ },
+ props: {
+ fullName: Property.ShortText({
+ displayName: 'Full Name',
+ description: 'New display name.',
+ required: false,
+ }),
+ email: Property.ShortText({
+ displayName: 'Email',
+ description: 'New account email address.',
+ required: false,
+ }),
+ config: Property.Json({
+ displayName: 'Settings',
+ description:
+ 'Settings keys to change, e.g. {"raindrops_sort": "-created", "raindrops_view": "grid", "lang": "en_US"}. Keys as returned in "config" by Get Current User.',
+ required: false,
+ }),
+ groups: Property.Json({
+ displayName: 'Collection Groups',
+ description:
+ 'Full list of sidebar groups, replacing the current one, e.g. [{"title": "My Collections", "hidden": false, "sort": 0, "collections": [8364483, 8364403]}]. Collection IDs from List Collections.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const { fullName, email, config, groups } = propsValue;
+ if (groups !== undefined && !Array.isArray(groups)) {
+ throw new Error('groups must be a JSON array of group objects.');
+ }
+ return await raindropClient.request<RaindropUpdateUserResponse>({
+ auth,
+ method: HttpMethod.PUT,
+ path: '/user',
+ body: {
+ ...(fullName !== undefined ? { fullName } : {}),
+ ...(email !== undefined ? { email } : {}),
+ ...(config !== undefined ? { config } : {}),
+ ...(groups !== undefined ? { groups } : {}),
+ },
+ });
+ },
+});
+
+type RaindropUpdateUserResponse = {
+ result: boolean;
+ user: Record<string, unknown>;
+};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/create-raindrop.ts b/packages/pieces/community/raindrop/src/lib/actions/create-raindrop.ts
index abe5a7b66cd..f30b06c1ef3 100644
--- a/packages/pieces/community/raindrop/src/lib/actions/create-raindrop.ts
+++ b/packages/pieces/community/raindrop/src/lib/actions/create-raindrop.ts
@@ -1,15 +1,20 @@
-import { httpClient, HttpMethod } from '@activepieces/pieces-common';
+import { HttpMethod } from '@activepieces/pieces-common';
import { createAction, Property } from '@activepieces/pieces-framework';
import { raindropAuth } from '../auth';
-import { raindropCommons } from '../common';
+import { raindropClient } from '../common/client';
+import { raindropProps } from '../common/props';
+import type { RaindropItem } from '../common/types';
+import { raindropUtils } from '../common/utils';
+import { getRaindropOutputSchema } from '../output-schemas';
export const createRaindropAction = createAction({
auth: raindropAuth,
name: 'create_raindrop',
+ outputSchema: getRaindropOutputSchema,
classification: 'WRITE',
displayName: 'Create Bookmark',
description: 'Saves a new bookmark to your Raindrop.io account',
- audience: 'both',
+ audience: 'human',
aiMetadata: {
description:
'Creates a new bookmark (raindrop) in Raindrop.io from a URL, optionally setting title, excerpt, note, tags, target collection, and favourite flag. Use to save a web page to a user\'s account. The URL is required; if no title is given Raindrop auto-extracts it from the page. Not idempotent: each call adds another bookmark, even for a URL already saved.',
@@ -37,7 +42,7 @@ export const createRaindropAction = createAction({
description: 'Personal note to attach to this bookmark',
required: false,
}),
- collection_id: raindropCommons.collectionDropdown,
+ collection_id: raindropProps.collectionId({ required: false }),
tags: Property.Array({
displayName: 'Tags',
description:
@@ -54,7 +59,6 @@ export const createRaindropAction = createAction({
async run(context) {
const { link, title, excerpt, note, collection_id, tags, important } =
context.propsValue;
- const accessToken = context.auth.access_token;
const body: Record<string, unknown> = {
link,
@@ -66,51 +70,17 @@ export const createRaindropAction = createAction({
if (collection_id !== null && collection_id !== undefined) {
body['collection'] = { $id: collection_id };
}
- if (tags && (tags as string[]).length > 0) body['tags'] = tags;
+ if (tags && tags.length > 0) body['tags'] = tags;
if (important) body['important'] = important;
- const response = await httpClient.sendRequest<{ item: RaindropApiResponse }>({
+ const response = await raindropClient.request<{ item: RaindropItem }>({
+ auth: context.auth,
method: HttpMethod.POST,
- url: `${raindropCommons.BASE_URL}/raindrop`,
- headers: {
- Authorization: `Bearer ${accessToken}`,
- 'Content-Type': 'application/json',
- },
+ path: '/raindrop',
+ headers: { 'Content-Type': 'application/json' },
body,
});
- return flattenResponse(response.body.item);
+ return raindropUtils.flattenRaindrop({ raindrop: response.item });
},
});
-
-function flattenResponse(item: RaindropApiResponse) {
- return {
- id: item._id,
- title: item.title ?? null,
- excerpt: item.excerpt ?? null,
- note: item.note ?? null,
- link: item.link ?? null,
- type: item.type ?? null,
- tags: Array.isArray(item.tags) ? item.tags.join(', ') : null,
- important: item.important ?? false,
- collection_id: item.collection?.$id ?? null,
- cover: item.cover ?? null,
- created_at: item.created ?? null,
- updated_at: item.lastUpdate ?? null,
- };
-}
-
-type RaindropApiResponse = {
- _id: number;
- title?: string;
- excerpt?: string;
- note?: string;
- link?: string;
- type?: string;
- tags?: string[];
- important?: boolean;
- collection?: { $id: number };
- cover?: string;
- created?: string;
- lastUpdate?: string;
-};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/delete-raindrop.ts b/packages/pieces/community/raindrop/src/lib/actions/delete-raindrop.ts
index 1e498787aef..32e62b91441 100644
--- a/packages/pieces/community/raindrop/src/lib/actions/delete-raindrop.ts
+++ b/packages/pieces/community/raindrop/src/lib/actions/delete-raindrop.ts
@@ -1,16 +1,18 @@
-import { httpClient, HttpMethod } from '@activepieces/pieces-common';
+import { HttpMethod } from '@activepieces/pieces-common';
import { createAction, Property } from '@activepieces/pieces-framework';
import { raindropAuth } from '../auth';
-import { raindropCommons } from '../common';
+import { raindropClient } from '../common/client';
+import { deleteRaindropOutputSchema } from '../output-schemas';
export const deleteRaindropAction = createAction({
auth: raindropAuth,
name: 'delete_raindrop',
+ outputSchema: deleteRaindropOutputSchema,
classification: 'DESTRUCTIVE',
displayName: 'Delete Bookmark',
description:
'Moves a bookmark to the trash. To permanently delete it, empty the trash in Raindrop.io.',
- audience: 'both',
+ audience: 'human',
aiMetadata: {
description:
'Moves a Raindrop.io bookmark, identified by its numeric ID, to the trash (a soft delete; emptying the trash in Raindrop.io is a separate manual step). Use to remove a bookmark from a user\'s active collections. Not idempotent: a repeat call on an already-trashed or missing ID errors rather than no-ops.',
@@ -26,12 +28,11 @@ export const deleteRaindropAction = createAction({
},
async run(context) {
const { raindrop_id } = context.propsValue;
- const accessToken = context.auth.access_token;
- await httpClient.sendRequest({
+ await raindropClient.request<unknown>({
+ auth: context.auth,
method: HttpMethod.DELETE,
- url: `${raindropCommons.BASE_URL}/raindrop/${raindrop_id}`,
- headers: { Authorization: `Bearer ${accessToken}` },
+ path: `/raindrop/${raindrop_id}`,
});
return { success: true, deleted_id: raindrop_id };
diff --git a/packages/pieces/community/raindrop/src/lib/actions/find-raindrops.ts b/packages/pieces/community/raindrop/src/lib/actions/find-raindrops.ts
index 2c3ffed6687..8327ac06d9d 100644
--- a/packages/pieces/community/raindrop/src/lib/actions/find-raindrops.ts
+++ b/packages/pieces/community/raindrop/src/lib/actions/find-raindrops.ts
@@ -1,22 +1,27 @@
-import { httpClient, HttpMethod } from '@activepieces/pieces-common';
+import { HttpMethod } from '@activepieces/pieces-common';
import { createAction, Property } from '@activepieces/pieces-framework';
import { raindropAuth } from '../auth';
-import { raindropCommons } from '../common';
+import { raindropClient } from '../common/client';
+import { raindropProps } from '../common/props';
+import type { RaindropItem } from '../common/types';
+import { raindropUtils } from '../common/utils';
+import { findRaindropsOutputSchema } from '../output-schemas';
export const findRaindropsAction = createAction({
auth: raindropAuth,
name: 'find_raindrops',
+ outputSchema: findRaindropsOutputSchema,
classification: 'SEARCH',
displayName: 'Find Bookmarks',
description: 'Lists bookmarks from a collection, with optional keyword search',
- audience: 'both',
+ audience: 'human',
aiMetadata: {
description:
'Lists bookmarks from a Raindrop.io collection, sorted newest-first. Operates in two modes: with an empty search it returns all bookmarks in the collection, and with a search query it filters by keyword (supporting operators like #tag or type:article). Defaults to a collection covering all bookmarks when none is chosen; returns up to 50 per call. Use to discover bookmark IDs or browse saved content. Read-only and idempotent.',
idempotent: true,
},
props: {
- collection_id: raindropCommons.collectionDropdown,
+ collection_id: raindropProps.collectionId({ required: false }),
search: Property.ShortText({
displayName: 'Search Query',
description:
@@ -32,7 +37,6 @@ export const findRaindropsAction = createAction({
},
async run(context) {
const { collection_id, search, limit } = context.propsValue;
- const accessToken = context.auth.access_token;
const collectionIdToUse = collection_id ?? 0;
const perpage = Math.min(limit ?? 25, 50);
@@ -44,41 +48,15 @@ export const findRaindropsAction = createAction({
};
if (search) queryParams['search'] = search;
- const response = await httpClient.sendRequest<{ items: RaindropApiItem[] }>({
+ const response = await raindropClient.request<{ items: RaindropItem[] }>({
+ auth: context.auth,
method: HttpMethod.GET,
- url: `${raindropCommons.BASE_URL}/raindrops/${collectionIdToUse}`,
- headers: { Authorization: `Bearer ${accessToken}` },
- queryParams,
+ path: `/raindrops/${collectionIdToUse}`,
+ query: queryParams,
});
- return response.body.items.map((item) => ({
- id: item._id,
- title: item.title ?? null,
- excerpt: item.excerpt ?? null,
- note: item.note ?? null,
- link: item.link ?? null,
- type: item.type ?? null,
- tags: Array.isArray(item.tags) ? item.tags.join(', ') : null,
- important: item.important ?? false,
- collection_id: item.collection?.$id ?? null,
- cover: item.cover ?? null,
- created_at: item.created ?? null,
- updated_at: item.lastUpdate ?? null,
- }));
+ return response.items.map((item) =>
+ raindropUtils.flattenRaindrop({ raindrop: item })
+ );
},
});
-
-type RaindropApiItem = {
- _id: number;
- title?: string;
- excerpt?: string;
- note?: string;
- link?: string;
- type?: string;
- tags?: string[];
- important?: boolean;
- collection?: { $id: number };
- cover?: string;
- created?: string;
- lastUpdate?: string;
-};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/get-raindrop.ts b/packages/pieces/community/raindrop/src/lib/actions/get-raindrop.ts
index 7ea99e8f29f..5ac0e01948e 100644
--- a/packages/pieces/community/raindrop/src/lib/actions/get-raindrop.ts
+++ b/packages/pieces/community/raindrop/src/lib/actions/get-raindrop.ts
@@ -1,15 +1,19 @@
-import { httpClient, HttpMethod } from '@activepieces/pieces-common';
+import { HttpMethod } from '@activepieces/pieces-common';
import { createAction, Property } from '@activepieces/pieces-framework';
import { raindropAuth } from '../auth';
-import { raindropCommons } from '../common';
+import { raindropClient } from '../common/client';
+import type { RaindropItem } from '../common/types';
+import { raindropUtils } from '../common/utils';
+import { getRaindropOutputSchema } from '../output-schemas';
export const getRaindropAction = createAction({
auth: raindropAuth,
name: 'get_raindrop',
+ outputSchema: getRaindropOutputSchema,
classification: 'READ',
displayName: 'Get Bookmark',
description: 'Retrieves the details of a bookmark by its ID',
- audience: 'both',
+ audience: 'human',
aiMetadata: {
description:
'Fetches a single Raindrop.io bookmark by its numeric ID. Use when you already have a bookmark ID and need its full details (title, link, tags, collection, etc.); to locate bookmarks by keyword or collection instead, use Find Bookmarks. Read-only and idempotent.',
@@ -25,46 +29,13 @@ export const getRaindropAction = createAction({
},
async run(context) {
const { raindrop_id } = context.propsValue;
- const accessToken = context.auth.access_token;
- const response = await httpClient.sendRequest<{ item: RaindropApiResponse }>({
+ const response = await raindropClient.request<{ item: RaindropItem }>({
+ auth: context.auth,
method: HttpMethod.GET,
- url: `${raindropCommons.BASE_URL}/raindrop/${raindrop_id}`,
- headers: { Authorization: `Bearer ${accessToken}` },
+ path: `/raindrop/${raindrop_id}`,
});
- return flattenResponse(response.body.item);
+ return raindropUtils.flattenRaindrop({ raindrop: response.item });
},
});
-
-function flattenResponse(item: RaindropApiResponse) {
- return {
- id: item._id,
- title: item.title ?? null,
- excerpt: item.excerpt ?? null,
- note: item.note ?? null,
- link: item.link ?? null,
- type: item.type ?? null,
- tags: Array.isArray(item.tags) ? item.tags.join(', ') : null,
- important: item.important ?? false,
- collection_id: item.collection?.$id ?? null,
- cover: item.cover ?? null,
- created_at: item.created ?? null,
- updated_at: item.lastUpdate ?? null,
- };
-}
-
-type RaindropApiResponse = {
- _id: number;
- title?: string;
- excerpt?: string;
- note?: string;
- link?: string;
- type?: string;
- tags?: string[];
- important?: boolean;
- collection?: { $id: number };
- cover?: string;
- created?: string;
- lastUpdate?: string;
-};
diff --git a/packages/pieces/community/raindrop/src/lib/actions/update-raindrop.ts b/packages/pieces/community/raindrop/src/lib/actions/update-raindrop.ts
index cd730420bde..9a3d0e9eaec 100644
--- a/packages/pieces/community/raindrop/src/lib/actions/update-raindrop.ts
+++ b/packages/pieces/community/raindrop/src/lib/actions/update-raindrop.ts
@@ -1,15 +1,20 @@
-import { httpClient, HttpMethod } from '@activepieces/pieces-common';
+import { HttpMethod } from '@activepieces/pieces-common';
import { createAction, Property } from '@activepieces/pieces-framework';
import { raindropAuth } from '../auth';
-import { raindropCommons } from '../common';
+import { raindropClient } from '../common/client';
+import { raindropProps } from '../common/props';
+import type { RaindropItem } from '../common/types';
+import { raindropUtils } from '../common/utils';
+import { updateRaindropOutputSchema } from '../output-schemas';
export const updateRaindropAction = createAction({
auth: raindropAuth,
name: 'update_raindrop',
+ outputSchema: updateRaindropOutputSchema,
classification: 'WRITE',
displayName: 'Update Bookmark',
description: 'Updates the details of an existing bookmark',
- audience: 'both',
+ audience: 'human',
aiMetadata: {
description:
'Updates an existing Raindrop.io bookmark identified by its numeric ID, changing any of title, excerpt, note, tags, collection, or favourite flag. Only supplied fields are changed; supplying tags replaces the existing tag list. Idempotent: repeating the same update yields the same final state.',
@@ -37,7 +42,7 @@ export const updateRaindropAction = createAction({
description: 'Updated personal note attached to the bookmark',
required: false,
}),
- collection_id: raindropCommons.collectionDropdown,
+ collection_id: raindropProps.collectionId({ required: false }),
tags: Property.Array({
displayName: 'Tags',
description:
@@ -53,7 +58,6 @@ export const updateRaindropAction = createAction({
async run(context) {
const { raindrop_id, title, excerpt, note, collection_id, tags, important } =
context.propsValue;
- const accessToken = context.auth.access_token;
const body: Record<string, unknown> = {};
if (title !== undefined && title !== null) body['title'] = title;
@@ -62,51 +66,17 @@ export const updateRaindropAction = createAction({
if (collection_id !== null && collection_id !== undefined) {
body['collection'] = { $id: collection_id };
}
- if (tags && (tags as string[]).length > 0) body['tags'] = tags;
+ if (tags && tags.length > 0) body['tags'] = tags;
if (important !== undefined && important !== null) body['important'] = important;
- const response = await httpClient.sendRequest<{ item: RaindropApiResponse }>({
+ const response = await raindropClient.request<{ item: RaindropItem }>({
+ auth: context.auth,
method: HttpMethod.PUT,
- url: `${raindropCommons.BASE_URL}/raindrop/${raindrop_id}`,
- headers: {
- Authorization: `Bearer ${accessToken}`,
- 'Content-Type': 'application/json',
- },
+ path: `/raindrop/${raindrop_id}`,
+ headers: { 'Content-Type': 'application/json' },
body,
});
- return flattenResponse(response.body.item);
+ return raindropUtils.flattenRaindrop({ raindrop: response.item });
},
});
-
-function flattenResponse(item: RaindropApiResponse) {
- return {
- id: item._id,
- title: item.title ?? null,
- excerpt: item.excerpt ?? null,
- note: item.note ?? null,
- link: item.link ?? null,
- type: item.type ?? null,
- tags: Array.isArray(item.tags) ? item.tags.join(', ') : null,
- important: item.important ?? false,
- collection_id: item.collection?.$id ?? null,
- cover: item.cover ?? null,
- created_at: item.created ?? null,
- updated_at: item.lastUpdate ?? null,
- };
-}
-
-type RaindropApiResponse = {
- _id: number;
- title?: string;
- excerpt?: string;
- note?: string;
- link?: string;
- type?: string;
- tags?: string[];
- important?: boolean;
- collection?: { $id: number };
- cover?: string;
- created?: string;
- lastUpdate?: string;
-};
diff --git a/packages/pieces/community/raindrop/src/lib/auth.ts b/packages/pieces/community/raindrop/src/lib/auth.ts
index 8a7c1baa693..3ae6b5f39c6 100644
--- a/packages/pieces/community/raindrop/src/lib/auth.ts
+++ b/packages/pieces/community/raindrop/src/lib/auth.ts
@@ -1,5 +1,7 @@
+import { HttpMethod } from '@activepieces/pieces-common';
import { PieceAuth } from '@activepieces/pieces-framework';
-import { httpClient, HttpMethod } from '@activepieces/pieces-common';
+import { raindropClient } from './common/client';
+import type { RaindropUser } from './common/types';
export const raindropAuth = PieceAuth.OAuth2({
required: true,
@@ -9,17 +11,15 @@ export const raindropAuth = PieceAuth.OAuth2({
extra: {},
getConnectionIdentifier: async ({ auth }) => {
try {
- const response = await httpClient.sendRequest<RaindropUser>({
+ const response = await raindropClient.request<RaindropUser>({
+ auth: { access_token: auth.access_token },
method: HttpMethod.GET,
- url: 'https://api.raindrop.io/rest/v1/user',
- headers: { Authorization: `Bearer ${auth.access_token}` },
+ path: '/user',
timeout: 5000,
});
- return response.body?.user?.email || response.body?.user?.fullName || undefined;
+ return response?.user?.email || response?.user?.fullName || undefined;
} catch {
return undefined;
}
},
});
-
-type RaindropUser = { user?: { email?: string; fullName?: string } };
diff --git a/packages/pieces/community/raindrop/src/lib/common/ai-props.ts b/packages/pieces/community/raindrop/src/lib/common/ai-props.ts
new file mode 100644
index 00000000000..b312fd34c85
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/common/ai-props.ts
@@ -0,0 +1,153 @@
+import { Property } from '@activepieces/pieces-framework';
+
+import type { PropParams } from './props';
+
+function raindropId<R extends boolean>({
+ required,
+ displayName = 'Bookmark ID',
+ description = 'Numeric bookmark ID, e.g. "123456789". Use List Bookmarks or Create Bookmark to get it.',
+}: PropParams<R>) {
+ return Property.ShortText({ displayName, description, required });
+}
+
+function collectionId<R extends boolean>({
+ required,
+ displayName = 'Collection ID',
+ description = 'Numeric collection ID from List Collections or List Child Collections. System collections: 0 = all bookmarks, -1 = Unsorted, -99 = Trash.',
+}: PropParams<R>) {
+ return Property.ShortText({ displayName, description, required });
+}
+
+function tags<R extends boolean>({
+ required,
+ displayName = 'Tags',
+ description = 'Tag names, e.g. ["reading", "ai"].',
+}: PropParams<R>) {
+ return Property.Array({ displayName, description, required });
+}
+
+function booleanChoice<R extends boolean>({
+ required,
+ displayName,
+ description,
+}: PropParams<R> & { displayName: string }) {
+ return Property.StaticDropdown({
+ displayName,
+ description,
+ required,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Yes', value: 'true' },
+ { label: 'No', value: 'false' },
+ ],
+ },
+ });
+}
+
+function collaboratorRole<R extends boolean>({
+ required,
+ displayName = 'Role',
+ description = 'Access level: "member" can edit and invite others, "viewer" is read-only.',
+}: PropParams<R>) {
+ return Property.StaticDropdown({
+ displayName,
+ description,
+ required,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Member', value: 'member' },
+ { label: 'Viewer', value: 'viewer' },
+ ],
+ },
+ });
+}
+
+function highlightColor<R extends boolean>({
+ required,
+ displayName = 'Color',
+ description = 'Highlight color. Defaults to yellow.',
+}: PropParams<R>) {
+ return Property.StaticDropdown({
+ displayName,
+ description,
+ required,
+ options: {
+ disabled: false,
+ options: HIGHLIGHT_COLORS.map((color) => ({ label: color, value: color })),
+ },
+ });
+}
+
+function collectionView<R extends boolean>({
+ required,
+ displayName = 'View',
+ description = 'How bookmarks in the collection are displayed.',
+}: PropParams<R>) {
+ return Property.StaticDropdown({
+ displayName,
+ description,
+ required,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'List', value: 'list' },
+ { label: 'Simple', value: 'simple' },
+ { label: 'Grid', value: 'grid' },
+ { label: 'Masonry', value: 'masonry' },
+ ],
+ },
+ });
+}
+
+function bookmarkSort<R extends boolean>({
+ required,
+ displayName = 'Sort',
+ description = 'Sort order. Defaults to newest first (-created).',
+}: PropParams<R>) {
+ return Property.StaticDropdown({
+ displayName,
+ description,
+ required,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Newest first', value: '-created' },
+ { label: 'Oldest first', value: 'created' },
+ { label: 'Relevance (with Search only)', value: 'score' },
+ { label: 'Manual order', value: '-sort' },
+ { label: 'Title A-Z', value: 'title' },
+ { label: 'Title Z-A', value: '-title' },
+ { label: 'Domain A-Z', value: 'domain' },
+ { label: 'Domain Z-A', value: '-domain' },
+ ],
+ },
+ });
+}
+
+export const raindropAiProps = {
+ raindropId,
+ collectionId,
+ tags,
+ booleanChoice,
+ collaboratorRole,
+ highlightColor,
+ collectionView,
+ bookmarkSort,
+};
+
+const HIGHLIGHT_COLORS = [
+ 'yellow',
+ 'blue',
+ 'brown',
+ 'cyan',
+ 'gray',
+ 'green',
+ 'indigo',
+ 'orange',
+ 'pink',
+ 'purple',
+ 'red',
+ 'teal',
+];
diff --git a/packages/pieces/community/raindrop/src/lib/common/api.ts b/packages/pieces/community/raindrop/src/lib/common/api.ts
new file mode 100644
index 00000000000..3426e990956
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/common/api.ts
@@ -0,0 +1,29 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+
+import { raindropClient } from './client';
+
+import type { RaindropAuthValue, RaindropCollection } from './types';
+
+async function listCollections({
+ auth,
+}: {
+ auth: RaindropAuthValue;
+}): Promise<RaindropCollection[]> {
+ const response = await raindropClient.request<{
+ items: RaindropCollection[];
+ }>({ auth, method: HttpMethod.GET, path: '/collections' });
+ return response.items;
+}
+
+async function listChildCollections({
+ auth,
+}: {
+ auth: RaindropAuthValue;
+}): Promise<RaindropCollection[]> {
+ const response = await raindropClient.request<{
+ items: RaindropCollection[];
+ }>({ auth, method: HttpMethod.GET, path: '/collections/childrens' });
+ return response.items;
+}
+
+export const raindropApi = { listCollections, listChildCollections };
diff --git a/packages/pieces/community/raindrop/src/lib/common/client.ts b/packages/pieces/community/raindrop/src/lib/common/client.ts
new file mode 100644
index 00000000000..201a0f6f961
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/common/client.ts
@@ -0,0 +1,41 @@
+import { HttpHeaders, HttpMethod, httpClient, QueryParams } from '@activepieces/pieces-common';
+
+import type { RaindropAuthValue } from './types';
+
+function baseUrl(): string {
+ return 'https://api.raindrop.io/rest/v1';
+}
+
+async function request<T>({
+ auth,
+ method,
+ path,
+ query,
+ body,
+ headers,
+ timeout,
+ responseType,
+}: RequestParams & { auth: RaindropAuthValue }): Promise<T> {
+ const response = await httpClient.sendRequest<T>({
+ method,
+ url: `${baseUrl()}${path}`,
+ headers: { Authorization: `Bearer ${auth.access_token}`, ...headers },
+ queryParams: query,
+ body,
+ timeout,
+ responseType,
+ });
+ return response.body;
+}
+
+export const raindropClient = { baseUrl, request };
+
+type RequestParams = {
+ method: HttpMethod;
+ path: string;
+ query?: QueryParams;
+ body?: unknown;
+ headers?: HttpHeaders;
+ timeout?: number;
+ responseType?: 'arraybuffer' | 'json';
+};
diff --git a/packages/pieces/community/raindrop/src/lib/common/index.ts b/packages/pieces/community/raindrop/src/lib/common/index.ts
deleted file mode 100644
index fa598e13c4f..00000000000
--- a/packages/pieces/community/raindrop/src/lib/common/index.ts
+++ /dev/null
@@ -1,117 +0,0 @@
-import { httpClient, HttpMethod } from '@activepieces/pieces-common';
-import {Property } from '@activepieces/pieces-framework';
-import { raindropAuth } from '../auth';
-
-const BASE_URL = 'https://api.raindrop.io/rest/v1';
-
-const collectionDropdown = Property.Dropdown({
- displayName: 'Collection',
- description:
- 'Select the collection to use. Leave empty to use "Unsorted" (default inbox).',
- refreshers: [],
- required: false,
- auth: raindropAuth,
- options: async ({ auth }) => {
- if (!auth) {
- return {
- disabled: true,
- options: [],
- placeholder: 'Please connect your account first',
- };
- }
- const accessToken = auth.access_token;
- try {
- const [rootResp, childResp] = await Promise.all([
- httpClient.sendRequest<{ items: CollectionItem[] }>({
- method: HttpMethod.GET,
- url: `${BASE_URL}/collections`,
- headers: { Authorization: `Bearer ${accessToken}` },
- }),
- httpClient.sendRequest<{ items: CollectionItem[] }>({
- method: HttpMethod.GET,
- url: `${BASE_URL}/collections/childrens`,
- headers: { Authorization: `Bearer ${accessToken}` },
- }),
- ]);
- const allCollections = [
- ...rootResp.body.items,
- ...childResp.body.items,
- ];
- return {
- disabled: false,
- options: [
- { label: 'Unsorted', value: -1 },
- ...allCollections.map((c) => ({ label: c.title, value: c._id })),
- ],
- };
- } catch {
- return {
- disabled: true,
- options: [],
- placeholder: 'Failed to load collections. Check your connection.',
- };
- }
- },
-});
-
-export const raindropCommons = {
- BASE_URL,
- collectionDropdown,
- flattenRaindrop,
-};
-
-function flattenRaindrop({
- raindrop,
-}: {
- raindrop: RaindropApiItem;
-}): FlatRaindrop {
- return {
- id: raindrop._id,
- title: raindrop.title ?? null,
- excerpt: raindrop.excerpt ?? null,
- note: raindrop.note ?? null,
- link: raindrop.link ?? null,
- type: raindrop.type ?? null,
- tags: Array.isArray(raindrop.tags) ? raindrop.tags.join(', ') : null,
- important: raindrop.important ?? false,
- collection_id: raindrop.collection?.$id ?? null,
- cover: raindrop.cover ?? null,
- created_at: raindrop.created ?? null,
- updated_at: raindrop.lastUpdate ?? null,
- };
-}
-
-type CollectionItem = {
- _id: number;
- title: string;
-};
-
-type RaindropApiItem = {
- _id: number;
- title?: string;
- excerpt?: string;
- note?: string;
- link?: string;
- type?: string;
- tags?: string[];
- important?: boolean;
- collection?: { $id: number };
- cover?: string;
- created?: string;
- lastUpdate?: string;
-};
-
-type FlatRaindrop = {
- id: number;
- title: string | null;
- excerpt: string | null;
- note: string | null;
- link: string | null;
- type: string | null;
- tags: string | null;
- important: boolean;
- collection_id: number | null;
- cover: string | null;
- created_at: string | null;
- updated_at: string | null;
-};
diff --git a/packages/pieces/community/raindrop/src/lib/common/props.ts b/packages/pieces/community/raindrop/src/lib/common/props.ts
new file mode 100644
index 00000000000..89f4da7ad79
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/common/props.ts
@@ -0,0 +1,55 @@
+import { DropdownState, Property } from '@activepieces/pieces-framework';
+
+import { raindropAuth } from '../auth';
+import { raindropApi } from './api';
+
+function collectionId<R extends boolean>({
+ required,
+ displayName = 'Collection',
+ description = 'Select the collection to use. Leave empty to use "Unsorted" (default inbox).',
+}: PropParams<R>) {
+ return Property.Dropdown({
+ displayName,
+ description,
+ refreshers: [],
+ required,
+ auth: raindropAuth,
+ options: async ({ auth }) => {
+ if (!auth) {
+ return disabledOptions({
+ placeholder: 'Please connect your account first',
+ });
+ }
+ try {
+ const [rootCollections, childCollections] = await Promise.all([
+ raindropApi.listCollections({ auth }),
+ raindropApi.listChildCollections({ auth }),
+ ]);
+ const allCollections = [...rootCollections, ...childCollections];
+ return {
+ disabled: false,
+ options: [
+ { label: 'Unsorted', value: -1 },
+ ...allCollections.map((c) => ({ label: c.title, value: c._id })),
+ ],
+ };
+ } catch {
+ return disabledOptions({
+ placeholder: 'Failed to load collections. Check your connection.',
+ });
+ }
+ },
+ });
+}
+
+function disabledOptions({ placeholder }: { placeholder: string }): DropdownState<never> {
+ return { disabled: true, options: [], placeholder };
+}
+
+export const raindropProps = { collectionId };
+
+export type PropParams<R extends boolean> = {
+ required: R;
+ displayName?: string;
+ description?: string;
+};
diff --git a/packages/pieces/community/raindrop/src/lib/common/types.ts b/packages/pieces/community/raindrop/src/lib/common/types.ts
new file mode 100644
index 00000000000..d806c4a9942
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/common/types.ts
@@ -0,0 +1,38 @@
+export type RaindropAuthValue = { access_token: string };
+
+export type RaindropCollection = {
+ _id: number;
+ title: string;
+};
+
+export type RaindropItem = {
+ _id: number;
+ title?: string;
+ excerpt?: string;
+ note?: string;
+ link?: string;
+ type?: string;
+ tags?: string[];
+ important?: boolean;
+ collection?: { $id: number };
+ cover?: string;
+ created?: string;
+ lastUpdate?: string;
+};
+
+export type RaindropFlatItem = {
+ id: number;
+ title: string | null;
+ excerpt: string | null;
+ note: string | null;
+ link: string | null;
+ type: string | null;
+ tags: string | null;
+ important: boolean;
+ collection_id: number | null;
+ cover: string | null;
+ created_at: string | null;
+ updated_at: string | null;
+};
+
+export type RaindropUser = { user?: { email?: string; fullName?: string } };
diff --git a/packages/pieces/community/raindrop/src/lib/common/utils.ts b/packages/pieces/community/raindrop/src/lib/common/utils.ts
new file mode 100644
index 00000000000..c66daefa3d5
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/common/utils.ts
@@ -0,0 +1,28 @@
+import type { RaindropFlatItem, RaindropItem } from './types';
+
+function flattenRaindrop({ raindrop }: { raindrop: RaindropItem }): RaindropFlatItem {
+ return {
+ id: raindrop._id,
+ title: raindrop.title ?? null,
+ excerpt: raindrop.excerpt ?? null,
+ note: raindrop.note ?? null,
+ link: raindrop.link ?? null,
+ type: raindrop.type ?? null,
+ tags: Array.isArray(raindrop.tags) ? raindrop.tags.join(', ') : null,
+ important: raindrop.important ?? false,
+ collection_id: raindrop.collection?.$id ?? null,
+ cover: raindrop.cover ?? null,
+ created_at: raindrop.created ?? null,
+ updated_at: raindrop.lastUpdate ?? null,
+ };
+}
+
+function toBoolean({ value }: { value: string | undefined }): boolean | undefined {
+ return value === undefined ? undefined : value === 'true';
+}
+
+function toStringList({ value }: { value: unknown[] | undefined }): string[] {
+ return (value ?? []).map((item) => String(item));
+}
+
+export const raindropUtils = { flattenRaindrop, toBoolean, toStringList };
diff --git a/packages/pieces/community/raindrop/src/lib/output-schemas.ts b/packages/pieces/community/raindrop/src/lib/output-schemas.ts
new file mode 100644
index 00000000000..ff5e315c805
--- /dev/null
+++ b/packages/pieces/community/raindrop/src/lib/output-schemas.ts
@@ -0,0 +1,767 @@
+import { OutputSchema } from '@activepieces/pieces-framework';
+
+const referenceFields: OutputSchema['fields'] = [{ key: '$id', label: 'ID', format: 'number' }];
+
+const creatorFields: OutputSchema['fields'] = [
+ { key: '_id', label: 'User ID', format: 'number' },
+ { key: 'name', label: 'Username' },
+ { key: 'email', label: 'Email', format: 'email' },
+];
+
+const bookmarkCreatorFields: OutputSchema['fields'] = [
+ ...creatorFields,
+ { key: 'avatar', label: 'Avatar', format: 'image' },
+];
+
+const mediaFields: OutputSchema['fields'] = [
+ { key: 'link', label: 'URL', format: 'image' },
+ { key: 'type', label: 'Type' },
+];
+
+const fileFields: OutputSchema['fields'] = [
+ { key: 'name', label: 'File Name' },
+ { key: 'size', label: 'Size', format: 'filesize' },
+ { key: 'type', label: 'MIME Type' },
+];
+
+const highlightFields: OutputSchema['fields'] = [
+ { key: '_id', label: 'Highlight ID' },
+ { key: 'text', label: 'Highlighted Text' },
+ { key: 'note', label: 'Note' },
+ { key: 'color', label: 'Color' },
+ { key: 'created', label: 'Created', format: 'datetime' },
+];
+
+const bookmarkHighlightFields: OutputSchema['fields'] = [
+ ...highlightFields,
+ { key: 'lastUpdate', label: 'Last Updated', format: 'datetime' },
+ { key: 'creatorRef', label: 'Created By (User ID)', format: 'number' },
+];
+
+const bookmarkFields: OutputSchema['fields'] = [
+ { key: '_id', label: 'Bookmark ID', format: 'number' },
+ { key: 'title', label: 'Title' },
+ { key: 'link', label: 'URL', format: 'url' },
+ { key: 'domain', label: 'Domain' },
+ { key: 'excerpt', label: 'Excerpt' },
+ { key: 'note', label: 'Note' },
+ { key: 'type', label: 'Type' },
+ { key: 'cover', label: 'Cover', format: 'image' },
+ { key: 'tags', label: 'Tags' },
+ { key: 'removed', label: 'In Trash', format: 'boolean' },
+ { key: 'collectionId', label: 'Collection ID', format: 'number' },
+ { key: 'collection', label: 'Collection', children: referenceFields },
+ { key: 'user', label: 'Owner', children: referenceFields },
+ { key: 'creatorRef', label: 'Created By', children: bookmarkCreatorFields },
+ { key: 'created', label: 'Created', format: 'datetime' },
+ { key: 'lastUpdate', label: 'Last Updated', format: 'datetime' },
+];
+
+const flatBookmarkFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'Bookmark ID', format: 'number' },
+ { key: 'title', label: 'Title' },
+ { key: 'excerpt', label: 'Excerpt' },
+ { key: 'note', label: 'Note' },
+ { key: 'link', label: 'URL', format: 'url' },
+ { key: 'type', label: 'Type' },
+ { key: 'tags', label: 'Tags' },
+ { key: 'important', label: 'Favorite', format: 'boolean' },
+ { key: 'collection_id', label: 'Collection ID', format: 'number' },
+ { key: 'cover', label: 'Cover', format: 'image' },
+ { key: 'created_at', label: 'Created', format: 'datetime' },
+ { key: 'updated_at', label: 'Last Updated', format: 'datetime' },
+];
+
+const collectionFields: OutputSchema['fields'] = [
+ { key: '_id', label: 'Collection ID', format: 'number' },
+ { key: 'title', label: 'Title' },
+ { key: 'description', label: 'Description' },
+ { key: 'slug', label: 'Slug' },
+ { key: 'color', label: 'Color' },
+ { key: 'view', label: 'View' },
+ { key: 'public', label: 'Public', format: 'boolean' },
+ { key: 'expanded', label: 'Expanded', format: 'boolean' },
+ { key: 'count', label: 'Bookmark Count', format: 'number' },
+ { key: 'cover', label: 'Cover URLs' },
+ { key: 'parent', label: 'Parent Collection', children: referenceFields },
+ { key: 'user', label: 'Owner', children: referenceFields },
+ { key: 'creatorRef', label: 'Created By', children: creatorFields },
+ {
+ key: 'access',
+ label: 'Your Access',
+ children: [
+ { key: 'for', label: 'User ID', format: 'number' },
+ { key: 'level', label: 'Access Level', format: 'number' },
+ { key: 'root', label: 'Root Collection', format: 'boolean' },
+ { key: 'draggable', label: 'Draggable', format: 'boolean' },
+ ],
+ },
+ { key: 'author', label: 'You Are the Author', format: 'boolean' },
+ { key: 'created', label: 'Created', format: 'datetime' },
+ { key: 'lastUpdate', label: 'Last Updated', format: 'datetime' },
+ { key: 'lastAction', label: 'Last Activity', format: 'datetime' },
+];
+
+const iconSetFields: OutputSchema['fields'] = [
+ { key: 'title', label: 'Title' },
+ { key: 'icons', label: 'Icons', listItems: [{ key: 'png', label: 'PNG', format: 'image' }] },
+];
+
+const userConfigFields: OutputSchema['fields'] = [
+ { key: 'raindrops_hide', label: 'Hidden Bookmark Elements' },
+ { key: 'nested_view_legacy', label: 'Legacy Nested View', format: 'boolean' },
+];
+
+const userFields: OutputSchema['fields'] = [
+ { key: '_id', label: 'User ID', format: 'number' },
+ { key: 'fullName', label: 'Full Name' },
+ { key: 'name', label: 'Username' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'avatar', label: 'Avatar', format: 'image' },
+ { key: 'emailConfirmed', label: 'Email Confirmed', format: 'boolean' },
+ { key: 'pro', label: 'Pro', format: 'boolean' },
+ { key: 'registered', label: 'Registered', format: 'datetime' },
+ { key: 'lastAction', label: 'Last Activity', format: 'datetime' },
+ { key: 'lastUpdate', label: 'Last Updated', format: 'datetime' },
+];
+
+const collaboratorFields: OutputSchema['fields'] = [
+ ...userFields,
+ { key: 'role', label: 'Role' },
+ { key: 'level', label: 'Access Level', format: 'number' },
+ { key: 'me', label: 'Is You', format: 'boolean' },
+ { key: 'config', label: 'Settings', children: userConfigFields },
+];
+
+const accountFields: OutputSchema['fields'] = [
+ ...userFields,
+ { key: 'provider', label: 'Sign-in Provider' },
+ { key: 'lastVisit', label: 'Last Visit', format: 'datetime' },
+ {
+ key: 'tfa',
+ label: 'Two-Factor Auth',
+ children: [{ key: 'enabled', label: 'Enabled', format: 'boolean' }],
+ },
+ {
+ key: 'google',
+ label: 'Google Sign-in',
+ children: [{ key: 'enabled', label: 'Enabled', format: 'boolean' }],
+ },
+ {
+ key: 'files',
+ label: 'File Storage',
+ children: [
+ { key: 'used', label: 'Used', format: 'filesize' },
+ { key: 'size', label: 'Quota', format: 'filesize' },
+ { key: 'lastCheckPoint', label: 'Quota Period Start', format: 'datetime' },
+ ],
+ },
+ {
+ key: 'groups',
+ label: 'Collection Groups',
+ labelKey: 'title',
+ listItems: [
+ { key: 'title', label: 'Title' },
+ { key: 'hidden', label: 'Hidden', format: 'boolean' },
+ { key: 'collections', label: 'Collection IDs' },
+ ],
+ },
+ {
+ key: 'config',
+ label: 'Settings',
+ children: [
+ ...userConfigFields,
+ { key: 'default_collection_view', label: 'Default Collection View' },
+ { key: 'raindrops_buttons', label: 'Bookmark Buttons' },
+ { key: 'raindrops_search_by_score', label: 'Search by Relevance', format: 'boolean' },
+ {
+ key: 'raindrops_search_incollection',
+ label: 'Search in Current Collection',
+ format: 'boolean',
+ },
+ { key: 'raindrops_sort', label: 'Bookmark Sort Order' },
+ { key: 'broken_level', label: 'Broken Link Check Level' },
+ { key: 'font_size', label: 'Font Size', format: 'number' },
+ { key: 'font_color', label: 'Font Color' },
+ {
+ key: 'add_default_collection',
+ label: 'Default Collection for New Bookmarks',
+ format: 'number',
+ },
+ { key: 'acknowledge', label: 'Acknowledged Notices' },
+ { key: 'ai_suggestions', label: 'AI Suggestions', format: 'boolean' },
+ { key: 'ai_assistant', label: 'AI Assistant', format: 'boolean' },
+ ],
+ },
+];
+
+const tagFields: OutputSchema['fields'] = [
+ { key: '_id', label: 'Tag' },
+ { key: 'count', label: 'Bookmark Count', format: 'number' },
+];
+
+export const raindropCreateBackupOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'result', label: 'Queued', format: 'boolean' },
+ { key: 'message', label: 'Message' },
+ ],
+};
+
+export const raindropDownloadBackupOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'file', label: 'File', format: 'url' },
+ { key: 'fileName', label: 'File Name' },
+ ],
+};
+
+export const raindropListBackupsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'result', label: 'Success', format: 'boolean' },
+ {
+ key: 'items',
+ label: 'Backups',
+ labelKey: 'created',
+ listItems: [
+ { key: '_id', label: 'Backup ID' },
+ { key: 'created', label: 'Created', format: 'datetime' },
+ ],
+ },
+ ],
+};
+
+export const raindropDeleteBookmarksOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'result', label: 'Success', format: 'boolean' },
+ { key: 'matched', label: 'Bookmarks Matched', format: 'number' },
+ { key: 'modified', label: 'Bookmarks Changed', format: 'number' },
+ ],
+};
+
+export const raindropGetBookmarkOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'result', label: 'Success', format: 'boolean' },
+ {
+ key: 'item',
+ label: 'Bookmark',
+ children: [
+ ...bookmarkFields,
+ { key: 'important', label: 'Favorite', format: 'boolean' },
+ { key: 'media', label: 'Media', listItems: mediaFields },
+ { key: 'highlights', label: 'Highlights' },
+ { key: 'file', label: 'Uploaded File', children: fileFields },
+ ],
+ },
+ { key: 'author', label: 'You Are the Author', format: 'boolean' },
+ ],
+};
+
+export const raindropListBookmarksOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'result', label: 'Success', format: 'boolean' },
+ {
+ key: 'items',
+ label: 'Bookmarks',
+ labelKey: 'title',
+ listItems: [
+ ...bookmarkFields,
+ { key: 'important', label: 'Favorite', format: 'boolean' },
+ { key: 'media', label: 'Media' },
+ { key: 'highlights', label: 'Highlights' },
+ {
+ key: 'highlight',
+ label: 'Search Match',
+ children: [
+ { key: 'link', label: 'URL Match', format: 'html' },
+ { key: 'title', label: 'Title Match', format: 'html' },
+ ],
+ },
+ ],
+ },
+ { key: 'count', label: 'Total Count', format: 'number' },
+ { key: 'collectionId', label: 'Collection ID', format: 'number' },
+ ],
+};
+
+export const raindropCreateBookmarkOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'result', label: 'Success', format: 'boolean' },
+ {
+ key: 'item',
+ label: 'Bookmark',
+ children: [
+ ...bookmarkFields,
+ { key: 'important', label: 'Favorite', format: 'boolean' },
+ { key: 'media', label: 'Media' },
+ ],
+ },
+ ],
+};
+
+export const raindropCreateBookmarksOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'result', label: 'Success', format: 'boolean' },
+ {
+ key: 'items',
+ label: 'Bookmarks',
+ labelKey: 'title',
+ listItems: [
+ ...bookmarkFields.filter(({ key }) => key !== 'creatorRef'),
+ { key: 'creatorRef', label: 'Created By (User ID)', format: 'number' },
+ { key: 'media', label: 'Media' },
+ { key: 'highlights', label: 'Highlights' },
+ ],
+ },
+ ],
+};
+
+export const raindropUploadBookmarkCoverOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'result', label: 'Success', format: 'boolean' },
+ {
+ key: 'item',
+ label: 'Bookmark',
+ children: [
+ ...bookmarkFields,
+ { key: 'important', label: 'Favorite', format: 'boolean' },
+ { key: 'media', label: 'Media', listItems: mediaFields },
+ ],
+ },
+ ],
+};
+
+export const raindropDeleteBookmarkOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'result', label: 'Success', format: 'boolean' },
+ {
+ key: 'item',
+ label: 'Bookmark',
+ children: [...bookmarkFields, { key: 'media', label: 'Media' }],
+ },
+ ],
+};
+
+export const deleteRaindropOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'deleted_id', label: 'Deleted Bookmark ID' },
+ ],
+};
+
+export const getRaindropOutputSchema: OutputSchema = {
+ fields: flatBookmarkFields,
+};
+
+export const findRaindropsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'raindrops',
+ label: 'Bookmarks',
+ value: '',
+ listItems: flatBookmarkFields,
+ },
+ ],
+ itemLabel: '{title}',
+};
+
+export const updateRaindropOutputSchema: OutputSchema = {
+ fields: flatBookmarkFields,
+};
+
+export const raindropUpdateBookmarkOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'result', label: 'Success', format: 'boolean' },
+ {
+ key: 'item',
+ label: 'Bookmark',
+ children: [
+ ...bookmarkFields,
+ { key: 'important', label: 'Favorite', format: 'boolean' },
+ { key: 'media', label: 'Media', listItems: mediaFields },
+ { key: 'highlights', label: 'Highlights' },
+ ],
+ },
+ ],
+};
+
+export const raindropUploadFileOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'result', label: 'Success', format: 'boolean' },
+ {
+ key: 'item',
+ label: 'Bookmark',
+ children: [
+ ...bookmarkFields,
+ { key: 'media', label: 'Media' },
+ { key: 'file', label: 'Uploaded File', children: fileFields },
+ ],
+ },
+ ],
+};
+
+export const raindropDeleteEmptyCollectionsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'result', label: 'Success', format: 'boolean' },
+ { key: 'count', label: 'Collections Removed', format: 'number' },
+ ],
+};
+
+export const raindropGetCollectionCountsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'result', label: 'Success', format: 'boolean' },
+ {
+ key: 'items',
+ label: 'Collection Counts',
+ listItems: [
+ { key: '_id', label: 'Collection ID', format: 'number' },
+ { key: 'count', label: 'Bookmark Count', format: 'number' },
+ ],
+ },
+ {
+ key: 'meta',
+ label: 'Account Summary',
+ children: [
+ { key: '_id', label: 'User ID', format: 'number' },
+ { key: 'changedBookmarksDate', label: 'Bookmarks Last Changed', format: 'datetime' },
+ { key: 'pro', label: 'Pro', format: 'boolean' },
+ ],
+ },
+ ],
+};
+
+export const raindropEmptyTrashOutputSchema: OutputSchema = {
+ fields: [{ key: 'result', label: 'Success', format: 'boolean' }],
+};
+
+export const raindropCreateCollectionOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'result', label: 'Success', format: 'boolean' },
+ { key: 'item', label: 'Collection', children: collectionFields },
+ ],
+};
+
+export const raindropUpdateCollectionOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'result', label: 'Success', format: 'boolean' },
+ { key: 'item', label: 'Collection', children: collectionFields },
+ ],
+};
+
+export const raindropDeleteCollectionsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'result', label: 'Success', format: 'boolean' },
+ { key: 'modified', label: 'Collections Changed', format: 'number' },
+ { key: 'ids', label: 'Collection IDs' },
+ ],
+};
+
+export const raindropListFeaturedCoversOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'result', label: 'Success', format: 'boolean' },
+ {
+ key: 'items',
+ label: 'Icon Sets',
+ labelKey: 'title',
+ listItems: [...iconSetFields, { key: 'link', label: 'Author URL', format: 'url' }],
+ },
+ ],
+};
+
+export const raindropGetCollectionOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'result', label: 'Success', format: 'boolean' },
+ { key: 'item', label: 'Collection', children: collectionFields },
+ ],
+};
+
+export const raindropListChildCollectionsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'items', label: 'Collections', labelKey: 'title', listItems: collectionFields },
+ { key: 'count', label: 'Total Count', format: 'number' },
+ ],
+};
+
+export const raindropListCollectionsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'items',
+ label: 'Collections',
+ labelKey: 'title',
+ listItems: collectionFields.filter(({ key }) => key !== 'color'),
+ },
+ { key: 'count', label: 'Total Count', format: 'number' },
+ ],
+};
+
+export const raindropSearchCoversOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'result', label: 'Success', format: 'boolean' },
+ { key: 'items', label: 'Icon Sets', labelKey: 'title', listItems: iconSetFields },
+ ],
+};
+
+export const raindropUploadCollectionCoverOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'result', label: 'Success', format: 'boolean' },
+ { key: 'item', label: 'Collection', children: collectionFields },
+ ],
+};
+
+export const raindropAddHighlightOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'result', label: 'Success', format: 'boolean' },
+ {
+ key: 'item',
+ label: 'Bookmark',
+ children: [
+ ...bookmarkFields,
+ { key: 'media', label: 'Media' },
+ {
+ key: 'highlights',
+ label: 'Highlights',
+ labelKey: 'text',
+ listItems: bookmarkHighlightFields,
+ },
+ ],
+ },
+ ],
+};
+
+export const raindropDeleteHighlightOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'result', label: 'Success', format: 'boolean' },
+ {
+ key: 'item',
+ label: 'Bookmark',
+ children: [
+ ...bookmarkFields,
+ { key: 'media', label: 'Media' },
+ { key: 'highlights', label: 'Highlights' },
+ ],
+ },
+ ],
+};
+
+export const raindropListHighlightsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'result', label: 'Success', format: 'boolean' },
+ {
+ key: 'items',
+ label: 'Highlights',
+ labelKey: 'text',
+ listItems: [
+ ...highlightFields,
+ { key: 'raindropRef', label: 'Bookmark ID', format: 'number' },
+ { key: 'title', label: 'Bookmark Title' },
+ { key: 'link', label: 'Bookmark URL', format: 'url' },
+ { key: 'tags', label: 'Bookmark Tags' },
+ ],
+ },
+ { key: 'count', label: 'Total Count', format: 'number' },
+ ],
+};
+
+export const raindropUpdateHighlightOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'result', label: 'Success', format: 'boolean' },
+ {
+ key: 'item',
+ label: 'Bookmark',
+ children: [
+ ...bookmarkFields,
+ { key: 'media', label: 'Media' },
+ {
+ key: 'highlights',
+ label: 'Highlights',
+ labelKey: 'text',
+ listItems: bookmarkHighlightFields,
+ },
+ ],
+ },
+ ],
+};
+
+export const raindropCheckUrlsExistOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'result', label: 'Any Exist', format: 'boolean' },
+ { key: 'ids', label: 'Existing Bookmark IDs' },
+ { key: 'id', label: 'First Existing Bookmark ID', format: 'number' },
+ {
+ key: 'duplicates',
+ label: 'Duplicates',
+ labelKey: 'link',
+ listItems: [
+ { key: '_id', label: 'Bookmark ID', format: 'number' },
+ { key: 'link', label: 'URL', format: 'url' },
+ ],
+ },
+ ],
+};
+
+export const raindropParseImportFileOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'result', label: 'Success', format: 'boolean' },
+ {
+ key: 'items',
+ label: 'Folders',
+ labelKey: 'title',
+ listItems: [
+ { key: 'title', label: 'Title' },
+ { key: 'created', label: 'Created', format: 'datetime' },
+ { key: 'lastUpdate', label: 'Last Updated', format: 'datetime' },
+ { key: 'folders', label: 'Subfolders' },
+ {
+ key: 'bookmarks',
+ label: 'Bookmarks',
+ labelKey: 'title',
+ listItems: [
+ { key: 'title', label: 'Title' },
+ { key: 'link', label: 'URL', format: 'url' },
+ { key: 'excerpt', label: 'Excerpt' },
+ { key: 'note', label: 'Note' },
+ { key: 'tags', label: 'Tags' },
+ { key: 'cover', label: 'Cover', format: 'image' },
+ { key: 'important', label: 'Favorite', format: 'boolean' },
+ { key: 'media', label: 'Media' },
+ { key: 'highlights', label: 'Highlights' },
+ { key: 'created', label: 'Created', format: 'datetime' },
+ { key: 'lastUpdate', label: 'Last Updated', format: 'datetime' },
+ ],
+ },
+ ],
+ },
+ {
+ key: 'count',
+ label: 'Totals',
+ children: [
+ { key: 'bookmarks', label: 'Bookmarks', format: 'number' },
+ { key: 'duplicates', label: 'Duplicates', format: 'number' },
+ { key: 'folders', label: 'Folders', format: 'number' },
+ { key: 'tags', label: 'Tags', format: 'number' },
+ { key: 'highlights', label: 'Highlights', format: 'number' },
+ ],
+ },
+ ],
+};
+
+export const raindropParseUrlOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'result', label: 'Success', format: 'boolean' },
+ {
+ key: 'item',
+ label: 'Page',
+ children: [
+ { key: 'title', label: 'Title' },
+ { key: 'excerpt', label: 'Excerpt' },
+ { key: 'type', label: 'Type' },
+ { key: 'cover', label: 'Cover', format: 'image' },
+ { key: 'media', label: 'Media' },
+ { key: 'meta', label: 'Metadata', children: [{ key: 'tags', label: 'Tags' }] },
+ ],
+ },
+ ],
+};
+
+export const raindropGetCurrentUserOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'result', label: 'Success', format: 'boolean' },
+ { key: 'user', label: 'User', children: accountFields },
+ ],
+};
+
+export const raindropListCollaboratorsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'result', label: 'Success', format: 'boolean' },
+ { key: 'items', label: 'Collaborators', labelKey: 'fullName', listItems: collaboratorFields },
+ ],
+};
+
+export const raindropShareCollectionOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'result', label: 'Success', format: 'boolean' },
+ { key: 'token', label: 'Invitation Token' },
+ { key: 'link', label: 'Invitation Link', format: 'url' },
+ ],
+};
+
+export const raindropGetFiltersOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'result', label: 'Success', format: 'boolean' },
+ { key: 'collectionId', label: 'Collection ID', format: 'number' },
+ {
+ key: 'total',
+ label: 'All Bookmarks',
+ children: [{ key: 'count', label: 'Count', format: 'number' }],
+ },
+ {
+ key: 'notag',
+ label: 'Untagged',
+ children: [{ key: 'count', label: 'Count', format: 'number' }],
+ },
+ {
+ key: 'note',
+ label: 'With Notes',
+ children: [{ key: 'count', label: 'Count', format: 'number' }],
+ },
+ { key: 'tags', label: 'Tags', labelKey: '_id', listItems: tagFields },
+ {
+ key: 'types',
+ label: 'Types',
+ labelKey: '_id',
+ listItems: [
+ { key: '_id', label: 'Type' },
+ { key: 'count', label: 'Bookmark Count', format: 'number' },
+ ],
+ },
+ {
+ key: 'domains',
+ label: 'Domains',
+ labelKey: '_id',
+ listItems: [
+ { key: '_id', label: 'Domain' },
+ { key: 'count', label: 'Bookmark Count', format: 'number' },
+ ],
+ },
+ {
+ key: 'created',
+ label: 'Created by Month',
+ labelKey: '_id',
+ listItems: [
+ { key: '_id', label: 'Month' },
+ { key: 'count', label: 'Bookmark Count', format: 'number' },
+ ],
+ },
+ ],
+};
+
+export const raindropListTagsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'result', label: 'Success', format: 'boolean' },
+ { key: 'items', label: 'Tags', labelKey: '_id', listItems: tagFields },
+ ],
+};
+
+export const raindropGetUserByNameOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'result', label: 'Success', format: 'boolean' },
+ {
+ key: 'user',
+ label: 'User',
+ children: [...userFields, { key: 'config', label: 'Settings', children: userConfigFields }],
+ },
+ ],
+};
+
+export const raindropUpdateUserOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'result', label: 'Success', format: 'boolean' },
+ { key: 'user', label: 'User', children: accountFields },
+ { key: 'item', label: 'Updated User', children: accountFields },
+ ],
+};
+
+export const raindropAcceptInvitationOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'result', label: 'Result', format: 'boolean' },
+ { key: 'role', label: 'Role' },
+ ],
+};