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
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:
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"node": "n8n-nodes-base.adalo",
|
||||
"nodeVersion": "1.0",
|
||||
"codexVersion": "1.0",
|
||||
"categories": ["Data & Storage"],
|
||||
"resources": {
|
||||
"credentialDocumentation": [
|
||||
{
|
||||
"url": "https://docs.n8n.io/integrations/builtin/credentials/adalo/"
|
||||
}
|
||||
],
|
||||
"primaryDocumentation": [
|
||||
{
|
||||
"url": "https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.adalo/"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,212 @@
|
||||
import {
|
||||
NodeConnectionTypes,
|
||||
type IDataObject,
|
||||
type IExecuteSingleFunctions,
|
||||
type IHttpRequestOptions,
|
||||
type INodeType,
|
||||
type INodeTypeDescription,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { collectionFields } from './CollectionDescription';
|
||||
import type { FieldsUiValues } from './types';
|
||||
|
||||
export class Adalo implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
displayName: 'Adalo',
|
||||
name: 'adalo',
|
||||
icon: 'file:adalo.svg',
|
||||
group: ['transform'],
|
||||
version: 1,
|
||||
subtitle: '={{$parameter["operation"] + ": " + $parameter["collectionId"]}}',
|
||||
description: 'Consume Adalo API',
|
||||
defaults: {
|
||||
name: 'Adalo',
|
||||
},
|
||||
usableAsTool: true,
|
||||
inputs: [NodeConnectionTypes.Main],
|
||||
outputs: [NodeConnectionTypes.Main],
|
||||
credentials: [
|
||||
{
|
||||
name: 'adaloApi',
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
requestDefaults: {
|
||||
baseURL: '=https://api.adalo.com/v0/apps/{{$credentials.appId}}',
|
||||
},
|
||||
requestOperations: {
|
||||
pagination: {
|
||||
type: 'offset',
|
||||
properties: {
|
||||
limitParameter: 'limit',
|
||||
offsetParameter: 'offset',
|
||||
pageSize: 100,
|
||||
type: 'query',
|
||||
},
|
||||
},
|
||||
},
|
||||
properties: [
|
||||
{
|
||||
displayName: 'Resource',
|
||||
name: 'resource',
|
||||
type: 'options',
|
||||
noDataExpression: true,
|
||||
default: 'collection',
|
||||
options: [
|
||||
{
|
||||
name: 'Collection',
|
||||
value: 'collection',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
displayName: 'Operation',
|
||||
name: 'operation',
|
||||
type: 'options',
|
||||
noDataExpression: true,
|
||||
options: [
|
||||
{
|
||||
name: 'Create',
|
||||
value: 'create',
|
||||
description: 'Create a row',
|
||||
routing: {
|
||||
send: {
|
||||
preSend: [this.presendCreateUpdate],
|
||||
},
|
||||
request: {
|
||||
method: 'POST',
|
||||
url: '=/collections/{{$parameter["collectionId"]}}',
|
||||
},
|
||||
},
|
||||
action: 'Create a row',
|
||||
},
|
||||
{
|
||||
name: 'Delete',
|
||||
value: 'delete',
|
||||
description: 'Delete a row',
|
||||
routing: {
|
||||
request: {
|
||||
method: 'DELETE',
|
||||
url: '=/collections/{{$parameter["collectionId"]}}/{{$parameter["rowId"]}}',
|
||||
},
|
||||
output: {
|
||||
postReceive: [
|
||||
{
|
||||
type: 'set',
|
||||
properties: {
|
||||
value: '={{ { "success": true } }}',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
action: 'Delete a row',
|
||||
},
|
||||
{
|
||||
name: 'Get',
|
||||
value: 'get',
|
||||
description: 'Retrieve a row',
|
||||
routing: {
|
||||
request: {
|
||||
method: 'GET',
|
||||
url: '=/collections/{{$parameter["collectionId"]}}/{{$parameter["rowId"]}}',
|
||||
},
|
||||
},
|
||||
action: 'Retrieve a row',
|
||||
},
|
||||
{
|
||||
name: 'Get Many',
|
||||
value: 'getAll',
|
||||
description: 'Retrieve many rows',
|
||||
routing: {
|
||||
request: {
|
||||
method: 'GET',
|
||||
url: '=/collections/{{$parameter["collectionId"]}}',
|
||||
qs: {
|
||||
limit: '={{$parameter["limit"]}}',
|
||||
},
|
||||
},
|
||||
send: {
|
||||
paginate: '={{$parameter["returnAll"]}}',
|
||||
},
|
||||
output: {
|
||||
postReceive: [
|
||||
{
|
||||
type: 'rootProperty',
|
||||
properties: {
|
||||
property: 'records',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
action: 'Retrieve all rows',
|
||||
},
|
||||
{
|
||||
name: 'Update',
|
||||
value: 'update',
|
||||
description: 'Update a row',
|
||||
routing: {
|
||||
send: {
|
||||
preSend: [this.presendCreateUpdate],
|
||||
},
|
||||
request: {
|
||||
method: 'PUT',
|
||||
url: '=/collections/{{$parameter["collectionId"]}}/{{$parameter["rowId"]}}',
|
||||
},
|
||||
},
|
||||
action: 'Update a row',
|
||||
},
|
||||
],
|
||||
default: 'getAll',
|
||||
},
|
||||
{
|
||||
displayName: 'Collection ID',
|
||||
name: 'collectionId',
|
||||
type: 'string',
|
||||
required: true,
|
||||
default: '',
|
||||
description:
|
||||
'Open your Adalo application and click on the three buttons beside the collection name, then select API Documentation',
|
||||
hint: "You can find information about app's collections on https://app.adalo.com/apps/<strong>your-app-id</strong>/api-docs",
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['collection'],
|
||||
},
|
||||
},
|
||||
},
|
||||
...collectionFields,
|
||||
],
|
||||
};
|
||||
|
||||
async presendCreateUpdate(
|
||||
this: IExecuteSingleFunctions,
|
||||
requestOptions: IHttpRequestOptions,
|
||||
): Promise<IHttpRequestOptions> {
|
||||
const dataToSend = this.getNodeParameter('dataToSend', 0) as 'defineBelow' | 'autoMapInputData';
|
||||
|
||||
requestOptions.body = {};
|
||||
|
||||
if (dataToSend === 'autoMapInputData') {
|
||||
const inputData = this.getInputData();
|
||||
const rawInputsToIgnore = this.getNodeParameter('inputsToIgnore') as string;
|
||||
|
||||
const inputKeysToIgnore = rawInputsToIgnore.split(',').map((c) => c.trim());
|
||||
const inputKeys = Object.keys(inputData.json).filter(
|
||||
(key) => !inputKeysToIgnore.includes(key),
|
||||
);
|
||||
|
||||
for (const key of inputKeys) {
|
||||
(requestOptions.body as IDataObject)[key] = inputData.json[key];
|
||||
}
|
||||
} else {
|
||||
const fields = this.getNodeParameter('fieldsUi.fieldValues') as FieldsUiValues;
|
||||
|
||||
for (const field of fields) {
|
||||
(requestOptions.body as IDataObject)[field.fieldId] = field.fieldValue;
|
||||
}
|
||||
}
|
||||
|
||||
return requestOptions;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
|
||||
export const collectionFields: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Row ID',
|
||||
name: 'rowId',
|
||||
type: 'string',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['get', 'delete', 'update'],
|
||||
resource: ['collection'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
required: true,
|
||||
},
|
||||
|
||||
/**
|
||||
* create / update
|
||||
*/
|
||||
|
||||
{
|
||||
displayName: 'Data to Send',
|
||||
name: 'dataToSend',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
name: 'Auto-Map Input Data to Columns',
|
||||
value: 'autoMapInputData',
|
||||
description: 'Use when node input properties match destination column names',
|
||||
},
|
||||
{
|
||||
name: 'Define Below for Each Column',
|
||||
value: 'defineBelow',
|
||||
description: 'Set the value for each destination column',
|
||||
},
|
||||
],
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['create', 'update'],
|
||||
resource: ['collection'],
|
||||
},
|
||||
},
|
||||
default: 'defineBelow',
|
||||
description: 'Whether to insert the input data this node receives in the new row',
|
||||
},
|
||||
{
|
||||
displayName: 'Inputs to Ignore',
|
||||
name: 'inputsToIgnore',
|
||||
type: 'string',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['create', 'update'],
|
||||
dataToSend: ['autoMapInputData'],
|
||||
resource: ['collection'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description:
|
||||
'List of input properties to avoid sending, separated by commas. Leave empty to send all properties.',
|
||||
placeholder: 'Enter properties...',
|
||||
},
|
||||
{
|
||||
displayName: 'Fields to Send',
|
||||
name: 'fieldsUi',
|
||||
placeholder: 'Add Field',
|
||||
type: 'fixedCollection',
|
||||
description:
|
||||
'Field must be defined in the collection, otherwise it will be ignored. If field defined in the collection is not set here, it will be set to null.',
|
||||
typeOptions: {
|
||||
multipleValueButtonText: 'Add Field to Send',
|
||||
multipleValues: true,
|
||||
},
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['create', 'update'],
|
||||
dataToSend: ['defineBelow'],
|
||||
resource: ['collection'],
|
||||
},
|
||||
},
|
||||
default: {},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Field',
|
||||
name: 'fieldValues',
|
||||
values: [
|
||||
{
|
||||
displayName: 'Field ID',
|
||||
name: 'fieldId',
|
||||
type: 'string',
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'Field Value',
|
||||
name: 'fieldValue',
|
||||
type: 'string',
|
||||
default: '',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
/**
|
||||
* getAll
|
||||
*/
|
||||
|
||||
{
|
||||
displayName: 'Return All',
|
||||
name: 'returnAll',
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
description: 'Whether to return all results or only up to a given limit',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['getAll'],
|
||||
resource: ['collection'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Limit',
|
||||
name: 'limit',
|
||||
type: 'number',
|
||||
default: 100,
|
||||
typeOptions: {
|
||||
minValue: 1,
|
||||
maxValue: 100,
|
||||
},
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['getAll'],
|
||||
resource: ['collection'],
|
||||
returnAll: [false],
|
||||
},
|
||||
},
|
||||
description: 'Max number of results to return',
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"created_at": {
|
||||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"updated_at": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"version": 1
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"created_at": {
|
||||
"type": "string"
|
||||
},
|
||||
"deleted_TS": {
|
||||
"type": "null"
|
||||
},
|
||||
"dropbox_thumbnailURL": {
|
||||
"type": "null"
|
||||
},
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"updated_at": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"version": 1
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="438" height="438" style="shape-rendering:geometricPrecision;text-rendering:geometricPrecision;image-rendering:optimizeQuality;fill-rule:evenodd;clip-rule:evenodd"><path fill="#09a595" d="M199.5-.5h19v22Q92.504 27.319 38 140.5q-35.76 91.255 11.5 177a145.6 145.6 0 0 0-20 11q-25.522-42.567-30-92v-36Q13.954 78.293 122.5 21q36.926-17.101 77-21.5" style="opacity:.999"/><path fill="#ea4c2e" d="M218.5-.5h18q130.095 15.852 184.5 135 14.124 35.394 16.5 73v21q-2.68 52.038-29 97a198 198 0 0 1-20-12q37.113-71.613 17.5-150Q372.673 61.674 270.5 29q-25.88-6.236-52-7.5z" style="opacity:.999"/><path fill="#fefefe" d="M218.5 21.5q26.12 1.264 52 7.5Q372.673 61.674 406 163.5q19.613 78.387-17.5 150-59.03 96.298-173 99-107.855-4.904-166-95-47.26-85.745-11.5-177 54.503-113.181 180.5-119" style="opacity:1"/><path fill="#343434" d="M321.5 72.5q2.588.514 1.5 3A547 547 0 0 0 312.5 95a602 602 0 0 0 11 20.5q-1.834 1.671-4 .5a233 233 0 0 0-18-9.5 725 725 0 0 0-19 9.5q-1.702 1.124-3-.5a578 578 0 0 0 10-20.5 577 577 0 0 0-10-20.5q1.298-1.625 3-.5a161 161 0 0 0 18.5 9.5q10.916-4.578 20.5-11" style="opacity:1"/><path fill="#3b3b3b" d="M226.5 80.5q4.338 3.346 7 8.5 6.556.258 13 1.5l-9 6-2 13a154 154 0 0 0-7-9.5l-12-1a86 86 0 0 1 9-6.5 36.9 36.9 0 0 0 1-12" style="opacity:1"/><path fill="#323232" d="M215.5 188.5a577 577 0 0 1-16.5-28 32.5 32.5 0 0 1-.5-8q5.79-16.4 23-12.5a32 32 0 0 1 7.5 5.5l103 170q2.281 23.718-21.5 21.5-5.103-2.1-8.5-6.5a20572 20572 0 0 0-86.5-142" style="opacity:1"/><path fill="#373737" d="M295.5 149.5q4.662 4.243 8 10 6.947 1.242 14 1.5a184 184 0 0 0-10.5 7.5 86.6 86.6 0 0 1-1.5 13l-7-10a86.6 86.6 0 0 0-13-1.5 86 86 0 0 1 9-6.5 49.9 49.9 0 0 0 1-14" style="opacity:1"/><path fill="#bbb" d="M198.5 152.5a32.5 32.5 0 0 0 .5 8 577 577 0 0 0 16.5 28 22390 22390 0 0 0-86.5 142q-10.027 11.031-23.5 4.5-9.877-8.036-6.5-20.5a19243 19243 0 0 1 99.5-162" style="opacity:1"/><path fill="#333" d="M210.5 257.5q24.901-2.333 29 22-3.077 26.814-30 22.5-19.836-9.978-13.5-31.5 5.677-8.437 14.5-13" style="opacity:1"/><path fill="#f5b915" d="M388.5 313.5a198 198 0 0 0 20 12q-35.346 63.587-102 93.5-39.96 17.038-83 18.5h-11q-110.685-6.214-175.5-96a63.5 63.5 0 0 1-7.5-13 145.6 145.6 0 0 1 20-11q58.145 90.096 166 95 113.97-2.702 173-99" style="opacity:.999"/></svg>
|
||||
|
After Width: | Height: | Size: 2.3 KiB |
@@ -0,0 +1,11 @@
|
||||
export type AdaloCredentials = {
|
||||
apiKey: string;
|
||||
appId: string;
|
||||
};
|
||||
|
||||
export type FieldsUiValues = Array<{
|
||||
fieldId: string;
|
||||
fieldValue: string;
|
||||
}>;
|
||||
|
||||
export type Operation = 'create' | 'delete' | 'update' | 'get' | 'getAll';
|
||||
Reference in New Issue
Block a user