first commit
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled

This commit is contained in:
2026-03-17 16:22:57 +03:30
commit 3d5eaf9445
15349 changed files with 2847338 additions and 0 deletions
@@ -0,0 +1,54 @@
import type {
IExecuteFunctions,
IHookFunctions,
IDataObject,
ILoadOptionsFunctions,
JsonObject,
IHttpRequestMethods,
IRequestOptions,
} from 'n8n-workflow';
import { NodeApiError } from 'n8n-workflow';
/**
* Make an authenticated API request to Raindrop.
*/
export async function raindropApiRequest(
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions,
method: IHttpRequestMethods,
endpoint: string,
qs: IDataObject,
body: IDataObject,
option: IDataObject = {},
) {
const options: IRequestOptions = {
headers: {
'user-agent': 'n8n',
'Content-Type': 'application/json',
},
method,
uri: `https://api.raindrop.io/rest/v1${endpoint}`,
qs,
body,
json: true,
};
if (!Object.keys(body).length) {
delete options.body;
}
if (!Object.keys(qs).length) {
delete options.qs;
}
if (Object.keys(option).length !== 0) {
Object.assign(options, option);
}
try {
return await this.helpers.requestOAuth2.call(this, 'raindropOAuth2Api', options, {
includeCredentialsOnRefreshOnBody: true,
});
} catch (error) {
throw new NodeApiError(this.getNode(), error as JsonObject);
}
}
@@ -0,0 +1,18 @@
{
"node": "n8n-nodes-base.raindrop",
"nodeVersion": "1.0",
"codexVersion": "1.0",
"categories": ["Productivity"],
"resources": {
"credentialDocumentation": [
{
"url": "https://docs.n8n.io/integrations/builtin/credentials/raindrop/"
}
],
"primaryDocumentation": [
{
"url": "https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.raindrop/"
}
]
}
}
@@ -0,0 +1,429 @@
import isEmpty from 'lodash/isEmpty';
import omit from 'lodash/omit';
import type {
IExecuteFunctions,
IDataObject,
ILoadOptionsFunctions,
INodeExecutionData,
INodeType,
INodeTypeDescription,
} from 'n8n-workflow';
import { NodeConnectionTypes, NodeOperationError } from 'n8n-workflow';
import {
bookmarkFields,
bookmarkOperations,
collectionFields,
collectionOperations,
tagFields,
tagOperations,
userFields,
userOperations,
} from './descriptions';
import { raindropApiRequest } from './GenericFunctions';
export class Raindrop implements INodeType {
description: INodeTypeDescription = {
displayName: 'Raindrop',
name: 'raindrop',
icon: 'file:raindrop.svg',
group: ['transform'],
version: 1,
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
description: 'Consume the Raindrop API',
defaults: {
name: 'Raindrop',
},
usableAsTool: true,
inputs: [NodeConnectionTypes.Main],
outputs: [NodeConnectionTypes.Main],
credentials: [
{
name: 'raindropOAuth2Api',
required: true,
},
],
properties: [
{
displayName: 'Resource',
name: 'resource',
type: 'options',
noDataExpression: true,
options: [
{
name: 'Bookmark',
value: 'bookmark',
},
{
name: 'Collection',
value: 'collection',
},
{
name: 'Tag',
value: 'tag',
},
{
name: 'User',
value: 'user',
},
],
default: 'collection',
},
...bookmarkOperations,
...bookmarkFields,
...collectionOperations,
...collectionFields,
...tagOperations,
...tagFields,
...userOperations,
...userFields,
],
};
methods = {
loadOptions: {
async getCollections(this: ILoadOptionsFunctions) {
const responseData = await raindropApiRequest.call(this, 'GET', '/collections', {}, {});
return responseData.items.map((item: { title: string; _id: string }) => ({
name: item.title,
value: item._id,
}));
},
},
};
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
const items = this.getInputData();
const resource = this.getNodeParameter('resource', 0);
const operation = this.getNodeParameter('operation', 0);
let responseData;
const returnData: IDataObject[] = [];
for (let i = 0; i < items.length; i++) {
try {
if (resource === 'bookmark') {
// *********************************************************************
// bookmark
// *********************************************************************
// https://developer.raindrop.io/v1/raindrops
if (operation === 'create') {
// ----------------------------------
// bookmark: create
// ----------------------------------
const body: IDataObject = {
link: this.getNodeParameter('link', i),
collection: {
$id: this.getNodeParameter('collectionId', i),
},
};
const additionalFields = this.getNodeParameter('additionalFields', i);
if (!isEmpty(additionalFields)) {
Object.assign(body, additionalFields);
}
if (additionalFields.pleaseParse === true) {
body.pleaseParse = {};
delete additionalFields.pleaseParse;
}
if (additionalFields.tags) {
body.tags = (additionalFields.tags as string).split(',').map((tag) => tag.trim());
}
const endpoint = '/raindrop';
responseData = await raindropApiRequest.call(this, 'POST', endpoint, {}, body);
responseData = responseData.item;
} else if (operation === 'delete') {
// ----------------------------------
// bookmark: delete
// ----------------------------------
const bookmarkId = this.getNodeParameter('bookmarkId', i);
const endpoint = `/raindrop/${bookmarkId}`;
responseData = await raindropApiRequest.call(this, 'DELETE', endpoint, {}, {});
} else if (operation === 'get') {
// ----------------------------------
// bookmark: get
// ----------------------------------
const bookmarkId = this.getNodeParameter('bookmarkId', i);
const endpoint = `/raindrop/${bookmarkId}`;
responseData = await raindropApiRequest.call(this, 'GET', endpoint, {}, {});
responseData = responseData.item;
} else if (operation === 'getAll') {
// ----------------------------------
// bookmark: getAll
// ----------------------------------
const returnAll = this.getNodeParameter('returnAll', i);
const collectionId = this.getNodeParameter('collectionId', i);
const endpoint = `/raindrops/${collectionId}`;
responseData = await raindropApiRequest.call(this, 'GET', endpoint, {}, {});
responseData = responseData.items;
if (!returnAll) {
const limit = this.getNodeParameter('limit', 0);
responseData = responseData.slice(0, limit);
}
} else if (operation === 'update') {
// ----------------------------------
// bookmark: update
// ----------------------------------
const bookmarkId = this.getNodeParameter('bookmarkId', i);
const body = {} as IDataObject;
const updateFields = this.getNodeParameter('updateFields', i);
if (isEmpty(updateFields)) {
throw new NodeOperationError(
this.getNode(),
`Please enter at least one field to update for the ${resource}.`,
{ itemIndex: i },
);
}
Object.assign(body, updateFields);
if (updateFields.collectionId) {
body.collection = {
$id: updateFields.collectionId,
};
delete updateFields.collectionId;
}
if (updateFields.pleaseParse === true) {
body.pleaseParse = {};
delete updateFields.pleaseParse;
}
if (updateFields.tags) {
body.tags = (updateFields.tags as string).split(',').map((tag) => tag.trim());
}
const endpoint = `/raindrop/${bookmarkId}`;
responseData = await raindropApiRequest.call(this, 'PUT', endpoint, {}, body);
responseData = responseData.item;
}
} else if (resource === 'collection') {
// *********************************************************************
// collection
// *********************************************************************
// https://developer.raindrop.io/v1/collections/methods
if (operation === 'create') {
// ----------------------------------
// collection: create
// ----------------------------------
const body = {
title: this.getNodeParameter('title', i),
} as IDataObject;
const additionalFields = this.getNodeParameter('additionalFields', i);
if (!isEmpty(additionalFields)) {
Object.assign(body, additionalFields);
}
if (additionalFields.cover) {
body.cover = [body.cover];
}
if (additionalFields.parentId) {
body['parent.$id'] = parseInt(additionalFields.parentId as string, 10);
delete additionalFields.parentId;
}
responseData = await raindropApiRequest.call(this, 'POST', '/collection', {}, body);
responseData = responseData.item;
} else if (operation === 'delete') {
// ----------------------------------
// collection: delete
// ----------------------------------
const collectionId = this.getNodeParameter('collectionId', i);
const endpoint = `/collection/${collectionId}`;
responseData = await raindropApiRequest.call(this, 'DELETE', endpoint, {}, {});
} else if (operation === 'get') {
// ----------------------------------
// collection: get
// ----------------------------------
const collectionId = this.getNodeParameter('collectionId', i);
const endpoint = `/collection/${collectionId}`;
responseData = await raindropApiRequest.call(this, 'GET', endpoint, {}, {});
responseData = responseData.item;
} else if (operation === 'getAll') {
// ----------------------------------
// collection: getAll
// ----------------------------------
const returnAll = this.getNodeParameter('returnAll', 0);
const endpoint =
this.getNodeParameter('type', i) === 'parent'
? '/collections'
: '/collections/childrens';
responseData = await raindropApiRequest.call(this, 'GET', endpoint, {}, {});
responseData = responseData.items;
if (!returnAll) {
const limit = this.getNodeParameter('limit', 0);
responseData = responseData.slice(0, limit);
}
} else if (operation === 'update') {
// ----------------------------------
// collection: update
// ----------------------------------
const collectionId = this.getNodeParameter('collectionId', i);
const body = {} as IDataObject;
const updateFields = this.getNodeParameter('updateFields', i);
if (isEmpty(updateFields)) {
throw new NodeOperationError(
this.getNode(),
`Please enter at least one field to update for the ${resource}.`,
{ itemIndex: i },
);
}
if (updateFields.parentId) {
body['parent.$id'] = parseInt(updateFields.parentId as string, 10);
delete updateFields.parentId;
}
Object.assign(body, omit(updateFields, 'binaryPropertyName'));
const endpoint = `/collection/${collectionId}`;
responseData = await raindropApiRequest.call(this, 'PUT', endpoint, {}, body);
responseData = responseData.item;
// cover-specific endpoint
if (updateFields.cover) {
const binaryPropertyName = updateFields.cover as string;
const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
const dataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
const formData = {
cover: {
value: dataBuffer,
options: {
filename: binaryData.fileName,
contentType: binaryData.mimeType,
},
},
};
const requestEndpoint = `/collection/${collectionId}/cover`;
responseData = await raindropApiRequest.call(
this,
'PUT',
requestEndpoint,
{},
{},
{ 'Content-Type': 'multipart/form-data', formData },
);
responseData = responseData.item;
}
}
} else if (resource === 'user') {
// *********************************************************************
// user
// *********************************************************************
// https://developer.raindrop.io/v1/user
if (operation === 'get') {
// ----------------------------------
// user: get
// ----------------------------------
const self = this.getNodeParameter('self', i);
let endpoint = '/user';
if (self === false) {
const userId = this.getNodeParameter('userId', i);
endpoint += `/${userId}`;
}
responseData = await raindropApiRequest.call(this, 'GET', endpoint, {}, {});
responseData = responseData.user;
}
} else if (resource === 'tag') {
// *********************************************************************
// tag
// *********************************************************************
// https://developer.raindrop.io/v1/tags
if (operation === 'delete') {
// ----------------------------------
// tag: delete
// ----------------------------------
let endpoint = '/tags';
const body: IDataObject = {
tags: (this.getNodeParameter('tags', i) as string).split(','),
};
const additionalFields = this.getNodeParameter('additionalFields', i);
if (additionalFields.collectionId) {
endpoint += `/${additionalFields.collectionId}`;
}
responseData = await raindropApiRequest.call(this, 'DELETE', endpoint, {}, body);
} else if (operation === 'getAll') {
// ----------------------------------
// tag: getAll
// ----------------------------------
let endpoint = '/tags';
const returnAll = this.getNodeParameter('returnAll', i);
const filter = this.getNodeParameter('filters', i);
if (filter.collectionId) {
endpoint += `/${filter.collectionId}`;
}
responseData = await raindropApiRequest.call(this, 'GET', endpoint, {}, {});
responseData = responseData.items;
if (!returnAll) {
const limit = this.getNodeParameter('limit', 0);
responseData = responseData.slice(0, limit);
}
}
}
Array.isArray(responseData)
? returnData.push(...(responseData as IDataObject[]))
: returnData.push(responseData as IDataObject);
} catch (error) {
if (this.continueOnFail()) {
returnData.push({ error: error.message });
continue;
}
throw error;
}
}
return [this.helpers.returnJsonArray(returnData)];
}
}
@@ -0,0 +1,147 @@
{
"type": "object",
"properties": {
"_id": {
"type": "integer"
},
"collection": {
"type": "object",
"properties": {
"$id": {
"type": "integer"
},
"$ref": {
"type": "string"
},
"oid": {
"type": "integer"
}
}
},
"collectionId": {
"type": "integer"
},
"cover": {
"type": "string"
},
"created": {
"type": "string"
},
"creatorRef": {
"type": "object",
"properties": {
"_id": {
"type": "integer"
},
"avatar": {
"type": "string"
},
"email": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"domain": {
"type": "string"
},
"excerpt": {
"type": "string"
},
"highlights": {
"type": "array",
"items": {
"type": "object",
"properties": {
"_id": {
"type": "string"
},
"color": {
"type": "string"
},
"created": {
"type": "string"
},
"creatorRef": {
"type": "integer"
},
"lastUpdate": {
"type": "string"
},
"note": {
"type": "string"
},
"text": {
"type": "string"
}
}
}
},
"important": {
"type": "boolean"
},
"lastUpdate": {
"type": "string"
},
"link": {
"type": "string"
},
"media": {
"type": "array",
"items": {
"type": "object",
"properties": {
"link": {
"type": "string"
},
"type": {
"type": "string"
}
}
}
},
"note": {
"type": "string"
},
"reminder": {
"type": "object",
"properties": {
"date": {
"type": "null"
}
}
},
"removed": {
"type": "boolean"
},
"sort": {
"type": "integer"
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
},
"title": {
"type": "string"
},
"type": {
"type": "string"
},
"user": {
"type": "object",
"properties": {
"$id": {
"type": "integer"
},
"$ref": {
"type": "string"
}
}
}
},
"version": 1
}
@@ -0,0 +1,96 @@
{
"type": "object",
"properties": {
"_id": {
"type": "integer"
},
"access": {
"type": "object",
"properties": {
"draggable": {
"type": "boolean"
},
"for": {
"type": "integer"
},
"level": {
"type": "integer"
},
"root": {
"type": "boolean"
}
}
},
"author": {
"type": "boolean"
},
"color": {
"type": "string"
},
"count": {
"type": "integer"
},
"cover": {
"type": "array",
"items": {
"type": "string"
}
},
"created": {
"type": "string"
},
"creatorRef": {
"type": "object",
"properties": {
"_id": {
"type": "integer"
},
"email": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"description": {
"type": "string"
},
"expanded": {
"type": "boolean"
},
"lastAction": {
"type": "string"
},
"lastUpdate": {
"type": "string"
},
"public": {
"type": "boolean"
},
"slug": {
"type": "string"
},
"sort": {
"type": "integer"
},
"title": {
"type": "string"
},
"user": {
"type": "object",
"properties": {
"$id": {
"type": "integer"
},
"$ref": {
"type": "string"
}
}
},
"view": {
"type": "string"
}
},
"version": 1
}
@@ -0,0 +1,300 @@
import type { INodeProperties } from 'n8n-workflow';
export const bookmarkOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
default: 'get',
options: [
{
name: 'Create',
value: 'create',
action: 'Create a bookmark',
},
{
name: 'Delete',
value: 'delete',
action: 'Delete a bookmark',
},
{
name: 'Get',
value: 'get',
action: 'Get a bookmark',
},
{
name: 'Get Many',
value: 'getAll',
action: 'Get many bookmarks',
},
{
name: 'Update',
value: 'update',
action: 'Update a bookmark',
},
],
displayOptions: {
show: {
resource: ['bookmark'],
},
},
},
];
export const bookmarkFields: INodeProperties[] = [
// ----------------------------------
// bookmark: create
// ----------------------------------
{
displayName: 'Collection Name or ID',
name: 'collectionId',
type: 'options',
description:
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
displayOptions: {
show: {
resource: ['bookmark'],
operation: ['create'],
},
},
typeOptions: {
loadOptionsMethod: 'getCollections',
},
default: '',
},
{
displayName: 'Link',
name: 'link',
type: 'string',
required: true,
default: '',
description: 'Link of the bookmark to be created',
displayOptions: {
show: {
resource: ['bookmark'],
operation: ['create'],
},
},
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: ['bookmark'],
operation: ['create'],
},
},
options: [
{
displayName: 'Important',
name: 'important',
type: 'boolean',
default: false,
description: 'Whether this bookmark is marked as favorite',
},
{
displayName: 'Order',
name: 'order',
type: 'number',
default: 0,
description:
'Sort order for the bookmark. For example, to move it to first place, enter 0.',
},
{
displayName: 'Parse Metadata',
name: 'pleaseParse',
type: 'boolean',
default: false,
description: 'Whether Raindrop should load cover, description and HTML for the URL',
},
{
displayName: 'Tags',
name: 'tags',
type: 'string',
default: '',
description: 'Bookmark tags. Multiple tags can be set separated by comma.',
},
{
displayName: 'Title',
name: 'title',
type: 'string',
default: '',
description: 'Title of the bookmark to create',
},
],
},
// ----------------------------------
// bookmark: delete
// ----------------------------------
{
displayName: 'Bookmark ID',
name: 'bookmarkId',
type: 'string',
default: '',
required: true,
description: 'The ID of the bookmark to delete',
displayOptions: {
show: {
resource: ['bookmark'],
operation: ['delete'],
},
},
},
// ----------------------------------
// bookmark: get
// ----------------------------------
{
displayName: 'Bookmark ID',
name: 'bookmarkId',
type: 'string',
default: '',
required: true,
description: 'The ID of the bookmark to retrieve',
displayOptions: {
show: {
resource: ['bookmark'],
operation: ['get'],
},
},
},
// ----------------------------------
// bookmark: getAll
// ----------------------------------
{
displayName: 'Collection Name or ID',
name: 'collectionId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getCollections',
},
default: [],
required: true,
description:
'The ID of the collection from which to retrieve all bookmarks. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
displayOptions: {
show: {
resource: ['bookmark'],
operation: ['getAll'],
},
},
},
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
resource: ['bookmark'],
operation: ['getAll'],
},
},
default: false,
description: 'Whether to return all results or only up to a given limit',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
resource: ['bookmark'],
operation: ['getAll'],
returnAll: [false],
},
},
typeOptions: {
minValue: 1,
maxValue: 10,
},
default: 5,
description: 'Max number of results to return',
},
// ----------------------------------
// bookmark: update
// ----------------------------------
{
displayName: 'Bookmark ID',
name: 'bookmarkId',
type: 'string',
default: '',
required: true,
description: 'The ID of the bookmark to update',
displayOptions: {
show: {
resource: ['bookmark'],
operation: ['update'],
},
},
},
{
displayName: 'Update Fields',
name: 'updateFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: ['bookmark'],
operation: ['update'],
},
},
options: [
{
displayName: 'Collection Name or ID',
name: 'collectionId',
type: 'options',
description:
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
typeOptions: {
loadOptionsMethod: 'getCollections',
},
default: '',
},
{
displayName: 'Important',
name: 'important',
type: 'boolean',
default: false,
description: 'Whether this bookmark is marked as favorite',
},
{
displayName: 'Order',
name: 'order',
type: 'number',
default: 0,
description:
'For example if you want to move bookmark to the first place set this field to 0',
},
{
displayName: 'Parse Metadata',
name: 'pleaseParse',
type: 'boolean',
default: false,
description: 'Whether Raindrop should reload cover, description and HTML for the URL',
},
{
displayName: 'Tags',
name: 'tags',
type: 'string',
default: '',
description: 'Bookmark tags. Multiple tags can be set separated by comma.',
},
{
displayName: 'Title',
name: 'title',
type: 'string',
default: '',
description: 'Title of the bookmark to be created',
},
],
},
];
@@ -0,0 +1,324 @@
import type { INodeProperties } from 'n8n-workflow';
export const collectionOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
default: 'get',
options: [
{
name: 'Create',
value: 'create',
action: 'Create a collection',
},
{
name: 'Delete',
value: 'delete',
action: 'Delete a collection',
},
{
name: 'Get',
value: 'get',
action: 'Get a collection',
},
{
name: 'Get Many',
value: 'getAll',
action: 'Get many collections',
},
{
name: 'Update',
value: 'update',
action: 'Update a collection',
},
],
displayOptions: {
show: {
resource: ['collection'],
},
},
},
];
export const collectionFields: INodeProperties[] = [
// ----------------------------------
// collection: create
// ----------------------------------
{
displayName: 'Title',
name: 'title',
type: 'string',
required: true,
default: '',
description: 'Title of the collection to create',
displayOptions: {
show: {
resource: ['collection'],
operation: ['create'],
},
},
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: ['collection'],
operation: ['create'],
},
},
options: [
{
displayName: 'Cover',
name: 'cover',
type: 'string',
default: '',
description: 'URL of an image to use as cover for the collection',
},
{
displayName: 'Public',
name: 'public',
type: 'boolean',
default: false,
description: 'Whether the collection will be accessible without authentication',
},
{
displayName: 'Parent ID',
name: 'parentId',
type: 'string',
default: '',
description: "ID of this collection's parent collection, if it is a child collection",
},
{
displayName: 'Sort Order',
name: 'sort',
type: 'number',
default: 1,
description:
'Descending sort order of this collection. The number is the position of the collection among all the collections with the same parent ID.',
},
{
displayName: 'View',
name: 'view',
type: 'options',
default: 'list',
description: 'View style of this collection',
options: [
{
name: 'List',
value: 'list',
},
{
name: 'Simple',
value: 'simple',
},
{
name: 'Grid',
value: 'grid',
},
{
name: 'Masonry',
value: 'Masonry',
},
],
},
],
},
// ----------------------------------
// collection: delete
// ----------------------------------
{
displayName: 'Collection ID',
name: 'collectionId',
type: 'string',
default: '',
required: true,
description: 'The ID of the collection to delete',
displayOptions: {
show: {
resource: ['collection'],
operation: ['delete'],
},
},
},
// ----------------------------------
// collection: get
// ----------------------------------
{
displayName: 'Collection ID',
name: 'collectionId',
type: 'string',
default: '',
required: true,
description: 'The ID of the collection to retrieve',
displayOptions: {
show: {
resource: ['collection'],
operation: ['get'],
},
},
},
// ----------------------------------
// collection: getAll
// ----------------------------------
{
displayName: 'Type',
name: 'type',
type: 'options',
required: true,
default: 'parent',
displayOptions: {
show: {
resource: ['collection'],
operation: ['getAll'],
},
},
options: [
{
name: 'Parent',
value: 'parent',
description: 'Root-level collections',
},
{
name: 'Children',
value: 'children',
description: 'Nested collections',
},
],
},
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
resource: ['collection'],
operation: ['getAll'],
},
},
default: false,
description: 'Whether to return all results or only up to a given limit',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
resource: ['collection'],
operation: ['getAll'],
returnAll: [false],
},
},
typeOptions: {
minValue: 1,
maxValue: 10,
},
default: 5,
description: 'Max number of results to return',
},
// ----------------------------------
// collection: update
// ----------------------------------
{
displayName: 'Collection ID',
name: 'collectionId',
type: 'string',
default: '',
required: true,
description: 'The ID of the collection to update',
displayOptions: {
show: {
resource: ['collection'],
operation: ['update'],
},
},
},
{
displayName: 'Update Fields',
name: 'updateFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: ['collection'],
operation: ['update'],
},
},
options: [
{
displayName: 'Cover',
name: 'cover',
type: 'string',
default: 'data',
placeholder: '',
description:
'Name of the binary property containing the data for the image to upload as a cover',
},
{
displayName: 'Public',
name: 'public',
type: 'boolean',
default: false,
description: 'Whether the collection will be accessible without authentication',
},
{
displayName: 'Parent ID',
name: 'parentId',
type: 'string',
default: '',
description: "ID of this collection's parent collection, if it is a child collection",
},
{
displayName: 'Sort Order',
name: 'sort',
type: 'number',
default: 1,
description:
'Descending sort order of this collection. The number is the position of the collection among all the collections with the same parent ID.',
},
{
displayName: 'Title',
name: 'title',
type: 'string',
default: '',
description: 'Title of the collection to update',
},
{
displayName: 'View',
name: 'view',
type: 'options',
default: 'list',
description: 'View style of this collection',
options: [
{
name: 'List',
value: 'list',
},
{
name: 'Simple',
value: 'simple',
},
{
name: 'Grid',
value: 'grid',
},
{
name: 'Masonry',
value: 'Masonry',
},
],
},
],
},
];
@@ -0,0 +1,135 @@
import type { INodeProperties } from 'n8n-workflow';
export const tagOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
default: 'get',
options: [
{
name: 'Delete',
value: 'delete',
action: 'Delete a tag',
},
{
name: 'Get Many',
value: 'getAll',
action: 'Get many tags',
},
],
displayOptions: {
show: {
resource: ['tag'],
},
},
},
];
export const tagFields: INodeProperties[] = [
// ----------------------------------
// tag: delete
// ----------------------------------
{
displayName: 'Tags',
name: 'tags',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
resource: ['tag'],
operation: ['delete'],
},
},
description:
'One or more tags to delete. Enter comma-separated values to delete multiple tags.',
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Filter',
default: {},
displayOptions: {
show: {
resource: ['tag'],
operation: ['delete'],
},
},
options: [
{
displayName: 'Collection Name or ID',
name: 'collectionId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getCollections',
},
default: '',
description:
'It\'s possible to restrict remove action to just one collection. It\'s optional. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
},
],
},
// ----------------------------------
// tag: getAll
// ----------------------------------
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
resource: ['tag'],
operation: ['getAll'],
},
},
default: false,
description: 'Whether to return all results or only up to a given limit',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
resource: ['tag'],
operation: ['getAll'],
returnAll: [false],
},
},
typeOptions: {
minValue: 1,
maxValue: 10,
},
default: 5,
description: 'Max number of results to return',
},
{
displayName: 'Filters',
name: 'filters',
type: 'collection',
placeholder: 'Add Filter',
default: {},
displayOptions: {
show: {
resource: ['tag'],
operation: ['getAll'],
},
},
options: [
{
displayName: 'Collection Name or ID',
name: 'collectionId',
type: 'options',
description:
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
typeOptions: {
loadOptionsMethod: 'getCollections',
},
default: '',
},
],
},
];
@@ -0,0 +1,58 @@
import type { INodeProperties } from 'n8n-workflow';
export const userOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
default: 'get',
options: [
{
name: 'Get',
value: 'get',
action: 'Get a user',
},
],
displayOptions: {
show: {
resource: ['user'],
},
},
},
];
export const userFields: INodeProperties[] = [
// ----------------------------------
// user: get
// ----------------------------------
{
displayName: 'Self',
name: 'self',
type: 'boolean',
default: true,
required: true,
description: 'Whether to return details on the logged-in user',
displayOptions: {
show: {
resource: ['user'],
operation: ['get'],
},
},
},
{
displayName: 'User ID',
name: 'userId',
type: 'string',
default: '',
required: true,
description: 'The ID of the user to retrieve',
displayOptions: {
show: {
resource: ['user'],
operation: ['get'],
self: [false],
},
},
},
];
@@ -0,0 +1,4 @@
export * from './BookmarkDescription';
export * from './CollectionDescription';
export * from './TagDescription';
export * from './UserDescription';
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="-2 -5 42 42"><defs><path id="a" d="M9.5.917a9.5 9.5 0 0 1 9.5 9.5v9.5H9.5a9.5 9.5 0 0 1 0-19"/><path id="c" d="M0 19.917v-9.5l.004-.27a9.5 9.5 0 1 1 9.496 9.77z"/></defs><g fill="none" fill-rule="evenodd"><path fill="#1988E0" d="M28.192 4.7c5.077 4.933 5.077 12.93 0 17.863q-.255.248-.519.479L19 31l-8.673-7.958q-.264-.231-.52-.479c-5.076-4.932-5.076-12.93 0-17.863 5.077-4.933 13.309-4.933 18.385 0"/><g transform="translate(0 11.083)"><mask id="b" fill="#fff"><use xlink:href="#a"/></mask><use xlink:href="#a" fill="#2CD4ED"/><path fill="#0DB4E2" d="M28.192-6.384c5.077 4.933 5.077 12.931 0 17.864q-.255.247-.519.478L19 19.917l-8.673-7.959q-.264-.23-.52-.478c-5.076-4.933-5.076-12.93 0-17.864 5.077-4.933 13.309-4.933 18.385 0" mask="url(#b)"/></g><g transform="translate(19 11.083)"><mask id="d" fill="#fff"><use xlink:href="#c"/></mask><use xlink:href="#c" fill="#3169FF"/><path fill="#3153FF" d="M9.192-6.384c5.077 4.933 5.077 12.931 0 17.864q-.255.247-.519.478L0 19.917l-8.673-7.959q-.264-.23-.52-.478c-5.076-4.933-5.076-12.93 0-17.864 5.077-4.933 13.309-4.933 18.385 0" mask="url(#d)"/></g></g></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB