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,142 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
|
||||
import * as create from './create.operation';
|
||||
import * as del from './delete.operation';
|
||||
import * as get from './get.operation';
|
||||
import * as getAll from './getAll.operation';
|
||||
import * as update from './update.operation';
|
||||
import * as upsert from './upsert.operation';
|
||||
import { handleErrorPostReceive, simplifyItemPostReceive } from '../../helpers/utils';
|
||||
import { ignoreHttpStatusErrorsConfig } from '../common.descriptions';
|
||||
|
||||
export const description: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Operation',
|
||||
name: 'operation',
|
||||
type: 'options',
|
||||
noDataExpression: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['item'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: 'Create',
|
||||
value: 'create',
|
||||
description: 'Create an item in an existing list',
|
||||
routing: {
|
||||
request: {
|
||||
method: 'POST',
|
||||
url: '=/sites/{{ $parameter["site"] }}/lists/{{ $parameter["list"] }}/items',
|
||||
},
|
||||
output: {
|
||||
postReceive: [handleErrorPostReceive],
|
||||
},
|
||||
},
|
||||
action: 'Create item in a list',
|
||||
},
|
||||
{
|
||||
name: 'Create or Update',
|
||||
value: 'upsert',
|
||||
description: 'Create a new item, or update the current one if it already exists (upsert)',
|
||||
routing: {
|
||||
request: {
|
||||
method: 'POST',
|
||||
url: '=/sites/{{ $parameter["site"] }}/lists/{{ $parameter["list"] }}/items',
|
||||
},
|
||||
output: {
|
||||
postReceive: [handleErrorPostReceive],
|
||||
},
|
||||
},
|
||||
action: 'Create or update item (upsert)',
|
||||
},
|
||||
{
|
||||
name: 'Delete',
|
||||
value: 'delete',
|
||||
description: 'Delete an item from a list',
|
||||
routing: {
|
||||
request: {
|
||||
method: 'DELETE',
|
||||
url: '=/sites/{{ $parameter["site"] }}/lists/{{ $parameter["list"] }}/items/{{ $parameter["item"] }}',
|
||||
},
|
||||
output: {
|
||||
postReceive: [
|
||||
handleErrorPostReceive,
|
||||
{
|
||||
type: 'set',
|
||||
properties: {
|
||||
value: '={{ { "deleted": true } }}',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
action: 'Delete an item',
|
||||
},
|
||||
{
|
||||
name: 'Get',
|
||||
value: 'get',
|
||||
description: 'Retrieve an item from a list',
|
||||
routing: {
|
||||
request: {
|
||||
ignoreHttpStatusErrors: ignoreHttpStatusErrorsConfig,
|
||||
method: 'GET',
|
||||
url: '=/sites/{{ $parameter["site"] }}/lists/{{ $parameter["list"] }}/items/{{ $parameter["item"] }}',
|
||||
},
|
||||
output: {
|
||||
postReceive: [handleErrorPostReceive, simplifyItemPostReceive],
|
||||
},
|
||||
},
|
||||
action: 'Get an item',
|
||||
},
|
||||
{
|
||||
name: 'Get Many',
|
||||
value: 'getAll',
|
||||
description: 'Get specific items in a list or list many items',
|
||||
routing: {
|
||||
request: {
|
||||
method: 'GET',
|
||||
url: '=/sites/{{ $parameter["site"] }}/lists/{{ $parameter["list"] }}/items',
|
||||
},
|
||||
output: {
|
||||
postReceive: [
|
||||
handleErrorPostReceive,
|
||||
{
|
||||
type: 'rootProperty',
|
||||
properties: {
|
||||
property: 'value',
|
||||
},
|
||||
},
|
||||
simplifyItemPostReceive,
|
||||
],
|
||||
},
|
||||
},
|
||||
action: 'Get many items',
|
||||
},
|
||||
{
|
||||
name: 'Update',
|
||||
value: 'update',
|
||||
description: 'Update an item in an existing list',
|
||||
routing: {
|
||||
request: {
|
||||
method: 'PATCH',
|
||||
url: '=/sites/{{ $parameter["site"] }}/lists/{{ $parameter["list"] }}/items',
|
||||
},
|
||||
output: {
|
||||
postReceive: [handleErrorPostReceive],
|
||||
},
|
||||
},
|
||||
action: 'Update item in a list',
|
||||
},
|
||||
],
|
||||
default: 'getAll',
|
||||
},
|
||||
|
||||
...create.description,
|
||||
...del.description,
|
||||
...get.description,
|
||||
...getAll.description,
|
||||
...update.description,
|
||||
...upsert.description,
|
||||
];
|
||||
@@ -0,0 +1,77 @@
|
||||
import { updateDisplayOptions, type INodeProperties } from 'n8n-workflow';
|
||||
|
||||
import { itemColumnsPreSend } from '../../helpers/utils';
|
||||
import { listRLC, siteRLC, untilListSelected, untilSiteSelected } from '../common.descriptions';
|
||||
|
||||
const properties: INodeProperties[] = [
|
||||
{
|
||||
...siteRLC,
|
||||
description: 'Select the site to retrieve lists from',
|
||||
},
|
||||
{
|
||||
...listRLC,
|
||||
description: 'Select the list you want to create an item in',
|
||||
displayOptions: {
|
||||
hide: {
|
||||
...untilSiteSelected,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName:
|
||||
'Due to API restrictions, the following column types cannot be updated: Hyperlink, Location, Metadata',
|
||||
name: 'noticeUnsupportedFields',
|
||||
displayOptions: {
|
||||
hide: {
|
||||
...untilSiteSelected,
|
||||
...untilListSelected,
|
||||
},
|
||||
},
|
||||
type: 'notice',
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'Columns',
|
||||
name: 'columns',
|
||||
default: {
|
||||
mappingMode: 'defineBelow',
|
||||
value: null,
|
||||
},
|
||||
displayOptions: {
|
||||
hide: {
|
||||
...untilSiteSelected,
|
||||
...untilListSelected,
|
||||
},
|
||||
},
|
||||
noDataExpression: true,
|
||||
required: true,
|
||||
routing: {
|
||||
send: {
|
||||
preSend: [itemColumnsPreSend],
|
||||
},
|
||||
},
|
||||
type: 'resourceMapper',
|
||||
typeOptions: {
|
||||
loadOptionsDependsOn: ['site.value', 'list.value'],
|
||||
resourceMapper: {
|
||||
resourceMapperMethod: 'getMappingColumns',
|
||||
mode: 'add',
|
||||
fieldWords: {
|
||||
singular: 'column',
|
||||
plural: 'columns',
|
||||
},
|
||||
addAllFields: true,
|
||||
multiKeyMatch: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
const displayOptions = {
|
||||
show: {
|
||||
resource: ['item'],
|
||||
operation: ['create'],
|
||||
},
|
||||
};
|
||||
|
||||
export const description = updateDisplayOptions(displayOptions, properties);
|
||||
@@ -0,0 +1,44 @@
|
||||
import { updateDisplayOptions, type INodeProperties } from 'n8n-workflow';
|
||||
|
||||
import {
|
||||
itemRLC,
|
||||
listRLC,
|
||||
siteRLC,
|
||||
untilListSelected,
|
||||
untilSiteSelected,
|
||||
} from '../common.descriptions';
|
||||
|
||||
const properties: INodeProperties[] = [
|
||||
{
|
||||
...siteRLC,
|
||||
description: 'Select the site to retrieve lists from',
|
||||
},
|
||||
{
|
||||
...listRLC,
|
||||
description: 'Select the list you want to delete an item in',
|
||||
displayOptions: {
|
||||
hide: {
|
||||
...untilSiteSelected,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
...itemRLC,
|
||||
description: 'Select the item you want to delete',
|
||||
displayOptions: {
|
||||
hide: {
|
||||
...untilSiteSelected,
|
||||
...untilListSelected,
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
const displayOptions = {
|
||||
show: {
|
||||
resource: ['item'],
|
||||
operation: ['delete'],
|
||||
},
|
||||
};
|
||||
|
||||
export const description = updateDisplayOptions(displayOptions, properties);
|
||||
@@ -0,0 +1,69 @@
|
||||
import type { IExecuteSingleFunctions, IHttpRequestOptions, INodeProperties } from 'n8n-workflow';
|
||||
import { updateDisplayOptions } from 'n8n-workflow';
|
||||
|
||||
import {
|
||||
itemRLC,
|
||||
listRLC,
|
||||
siteRLC,
|
||||
untilListSelected,
|
||||
untilSiteSelected,
|
||||
} from '../common.descriptions';
|
||||
|
||||
const properties: INodeProperties[] = [
|
||||
{
|
||||
...siteRLC,
|
||||
description: 'Select the site to retrieve lists from',
|
||||
},
|
||||
{
|
||||
...listRLC,
|
||||
description: 'Select the list you want to retrieve an item from',
|
||||
displayOptions: {
|
||||
hide: {
|
||||
...untilSiteSelected,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
...itemRLC,
|
||||
description: 'Select the item you want to get',
|
||||
displayOptions: {
|
||||
hide: {
|
||||
...untilSiteSelected,
|
||||
...untilListSelected,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Simplify',
|
||||
name: 'simplify',
|
||||
default: true,
|
||||
routing: {
|
||||
send: {
|
||||
preSend: [
|
||||
async function (
|
||||
this: IExecuteSingleFunctions,
|
||||
requestOptions: IHttpRequestOptions,
|
||||
): Promise<IHttpRequestOptions> {
|
||||
const simplify = this.getNodeParameter('simplify', false) as boolean;
|
||||
if (simplify) {
|
||||
requestOptions.qs ??= {};
|
||||
requestOptions.qs.$select = 'id,createdDateTime,lastModifiedDateTime,webUrl';
|
||||
requestOptions.qs.$expand = 'fields(select=Title)';
|
||||
}
|
||||
return requestOptions;
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
type: 'boolean',
|
||||
},
|
||||
];
|
||||
|
||||
const displayOptions = {
|
||||
show: {
|
||||
resource: ['item'],
|
||||
operation: ['get'],
|
||||
},
|
||||
};
|
||||
|
||||
export const description = updateDisplayOptions(displayOptions, properties);
|
||||
@@ -0,0 +1,186 @@
|
||||
import type { IExecuteSingleFunctions, IHttpRequestOptions, INodeProperties } from 'n8n-workflow';
|
||||
import { updateDisplayOptions } from 'n8n-workflow';
|
||||
|
||||
import { itemGetAllFieldsPreSend } from '../../helpers/utils';
|
||||
import { listRLC, siteRLC, untilSiteSelected } from '../common.descriptions';
|
||||
|
||||
const properties: INodeProperties[] = [
|
||||
{
|
||||
...siteRLC,
|
||||
description: 'Select the site to retrieve lists from',
|
||||
},
|
||||
{
|
||||
...listRLC,
|
||||
description: 'Select the list you want to search for items in',
|
||||
displayOptions: {
|
||||
hide: {
|
||||
...untilSiteSelected,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Filter by Formula',
|
||||
name: 'filter',
|
||||
default: '',
|
||||
description:
|
||||
'The formula will be evaluated for each record. <a href="https://learn.microsoft.com/en-us/graph/filter-query-parameter">More info</a>.',
|
||||
hint: 'If empty, all the items will be returned',
|
||||
placeholder: "e.g. fields/Title eq 'item1'",
|
||||
routing: {
|
||||
send: {
|
||||
property: '$filter',
|
||||
type: 'query',
|
||||
value: '={{ $value ? $value : undefined }}',
|
||||
},
|
||||
},
|
||||
type: 'string',
|
||||
},
|
||||
{
|
||||
displayName: 'Return All',
|
||||
name: 'returnAll',
|
||||
default: false,
|
||||
description: 'Whether to return all results or only up to a given limit',
|
||||
routing: {
|
||||
send: {
|
||||
paginate: '={{ $value }}',
|
||||
},
|
||||
operations: {
|
||||
pagination: {
|
||||
type: 'generic',
|
||||
properties: {
|
||||
continue: '={{ !!$response.body?.["@odata.nextLink"] }}',
|
||||
request: {
|
||||
url: '={{ $response.body?.["@odata.nextLink"] ?? $request.url }}',
|
||||
qs: {
|
||||
$select:
|
||||
'={{ !!$response.body?.["@odata.nextLink"] ? undefined : $request.qs?.$select }}',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
type: 'boolean',
|
||||
},
|
||||
{
|
||||
displayName: 'Limit',
|
||||
name: 'limit',
|
||||
default: 50,
|
||||
description: 'Max number of results to return',
|
||||
displayOptions: {
|
||||
show: {
|
||||
returnAll: [false],
|
||||
},
|
||||
},
|
||||
routing: {
|
||||
send: {
|
||||
property: '$top',
|
||||
type: 'query',
|
||||
value: '={{ $value }}',
|
||||
},
|
||||
},
|
||||
type: 'number',
|
||||
typeOptions: {
|
||||
minValue: 1,
|
||||
},
|
||||
validateType: 'number',
|
||||
},
|
||||
{
|
||||
displayName: 'Options',
|
||||
name: 'options',
|
||||
default: {},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Fields',
|
||||
name: 'fields',
|
||||
default: [],
|
||||
description: 'The fields you want to include in the output',
|
||||
displayOptions: {
|
||||
hide: {
|
||||
'/simplify': [true],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: 'Content Type',
|
||||
value: 'contentType',
|
||||
},
|
||||
{
|
||||
name: 'Created At',
|
||||
value: 'createdDateTime',
|
||||
},
|
||||
{
|
||||
name: 'Created By',
|
||||
value: 'createdBy',
|
||||
},
|
||||
{
|
||||
name: 'Fields',
|
||||
value: 'fields',
|
||||
},
|
||||
{
|
||||
name: 'ID',
|
||||
value: 'id',
|
||||
},
|
||||
{
|
||||
name: 'Last Modified At',
|
||||
value: 'lastModifiedDateTime',
|
||||
},
|
||||
{
|
||||
name: 'Last Modified By',
|
||||
value: 'lastModifiedBy',
|
||||
},
|
||||
|
||||
{
|
||||
name: 'Parent Reference',
|
||||
value: 'parentReference',
|
||||
},
|
||||
{
|
||||
name: 'Web URL',
|
||||
value: 'webUrl',
|
||||
},
|
||||
],
|
||||
routing: {
|
||||
send: {
|
||||
preSend: [itemGetAllFieldsPreSend],
|
||||
},
|
||||
},
|
||||
type: 'multiOptions',
|
||||
},
|
||||
],
|
||||
placeholder: 'Add option',
|
||||
type: 'collection',
|
||||
},
|
||||
{
|
||||
displayName: 'Simplify',
|
||||
name: 'simplify',
|
||||
default: true,
|
||||
routing: {
|
||||
send: {
|
||||
preSend: [
|
||||
async function (
|
||||
this: IExecuteSingleFunctions,
|
||||
requestOptions: IHttpRequestOptions,
|
||||
): Promise<IHttpRequestOptions> {
|
||||
const simplify = this.getNodeParameter('simplify', false) as boolean;
|
||||
if (simplify) {
|
||||
requestOptions.qs ??= {};
|
||||
requestOptions.qs.$select = 'id,createdDateTime,lastModifiedDateTime,webUrl';
|
||||
requestOptions.qs.$expand = 'fields(select=Title)';
|
||||
}
|
||||
return requestOptions;
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
type: 'boolean',
|
||||
},
|
||||
];
|
||||
|
||||
const displayOptions = {
|
||||
show: {
|
||||
resource: ['item'],
|
||||
operation: ['getAll'],
|
||||
},
|
||||
};
|
||||
|
||||
export const description = updateDisplayOptions(displayOptions, properties);
|
||||
@@ -0,0 +1,77 @@
|
||||
import { updateDisplayOptions, type INodeProperties } from 'n8n-workflow';
|
||||
|
||||
import { itemColumnsPreSend } from '../../helpers/utils';
|
||||
import { listRLC, siteRLC, untilListSelected, untilSiteSelected } from '../common.descriptions';
|
||||
|
||||
const properties: INodeProperties[] = [
|
||||
{
|
||||
...siteRLC,
|
||||
description: 'Select the site to retrieve lists from',
|
||||
},
|
||||
{
|
||||
...listRLC,
|
||||
description: 'Select the list you want to update an item in',
|
||||
displayOptions: {
|
||||
hide: {
|
||||
...untilSiteSelected,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName:
|
||||
'Due to API restrictions, the following column types cannot be updated: Hyperlink, Location, Metadata',
|
||||
name: 'noticeUnsupportedFields',
|
||||
displayOptions: {
|
||||
hide: {
|
||||
...untilSiteSelected,
|
||||
...untilListSelected,
|
||||
},
|
||||
},
|
||||
type: 'notice',
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'Columns',
|
||||
name: 'columns',
|
||||
default: {
|
||||
mappingMode: 'defineBelow',
|
||||
value: null,
|
||||
},
|
||||
displayOptions: {
|
||||
hide: {
|
||||
...untilSiteSelected,
|
||||
...untilListSelected,
|
||||
},
|
||||
},
|
||||
noDataExpression: true,
|
||||
required: true,
|
||||
routing: {
|
||||
send: {
|
||||
preSend: [itemColumnsPreSend],
|
||||
},
|
||||
},
|
||||
type: 'resourceMapper',
|
||||
typeOptions: {
|
||||
loadOptionsDependsOn: ['site.value', 'list.value'],
|
||||
resourceMapper: {
|
||||
resourceMapperMethod: 'getMappingColumns',
|
||||
mode: 'update',
|
||||
fieldWords: {
|
||||
singular: 'column',
|
||||
plural: 'columns',
|
||||
},
|
||||
addAllFields: true,
|
||||
multiKeyMatch: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
const displayOptions = {
|
||||
show: {
|
||||
resource: ['item'],
|
||||
operation: ['update'],
|
||||
},
|
||||
};
|
||||
|
||||
export const description = updateDisplayOptions(displayOptions, properties);
|
||||
@@ -0,0 +1,77 @@
|
||||
import { updateDisplayOptions, type INodeProperties } from 'n8n-workflow';
|
||||
|
||||
import { itemColumnsPreSend } from '../../helpers/utils';
|
||||
import { listRLC, siteRLC, untilListSelected, untilSiteSelected } from '../common.descriptions';
|
||||
|
||||
const properties: INodeProperties[] = [
|
||||
{
|
||||
...siteRLC,
|
||||
description: 'Select the site to retrieve lists from',
|
||||
},
|
||||
{
|
||||
...listRLC,
|
||||
description: 'Select the list you want to create or update an item in',
|
||||
displayOptions: {
|
||||
hide: {
|
||||
...untilSiteSelected,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName:
|
||||
'Due to API restrictions, the following column types cannot be updated: Hyperlink, Location, Metadata',
|
||||
name: 'noticeUnsupportedFields',
|
||||
displayOptions: {
|
||||
hide: {
|
||||
...untilSiteSelected,
|
||||
...untilListSelected,
|
||||
},
|
||||
},
|
||||
type: 'notice',
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'Columns',
|
||||
name: 'columns',
|
||||
default: {
|
||||
mappingMode: 'defineBelow',
|
||||
value: null,
|
||||
},
|
||||
displayOptions: {
|
||||
hide: {
|
||||
...untilSiteSelected,
|
||||
...untilListSelected,
|
||||
},
|
||||
},
|
||||
noDataExpression: true,
|
||||
required: true,
|
||||
routing: {
|
||||
send: {
|
||||
preSend: [itemColumnsPreSend],
|
||||
},
|
||||
},
|
||||
type: 'resourceMapper',
|
||||
typeOptions: {
|
||||
loadOptionsDependsOn: ['site.value', 'list.value'],
|
||||
resourceMapper: {
|
||||
resourceMapperMethod: 'getMappingColumns',
|
||||
mode: 'upsert',
|
||||
fieldWords: {
|
||||
singular: 'column',
|
||||
plural: 'columns',
|
||||
},
|
||||
addAllFields: true,
|
||||
multiKeyMatch: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
const displayOptions = {
|
||||
show: {
|
||||
resource: ['item'],
|
||||
operation: ['upsert'],
|
||||
},
|
||||
};
|
||||
|
||||
export const description = updateDisplayOptions(displayOptions, properties);
|
||||
Reference in New Issue
Block a user