From eb3566723dca962ac9408cc6ca4295fff80b6eef Mon Sep 17 00:00:00 2001 From: Matthias Stallmann Date: Thu, 13 Feb 2025 11:22:59 +0100 Subject: [PATCH 1/2] fix typo --- .../nodes-base/nodes/Microsoft/Entra/MicrosoftEntra.node.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nodes-base/nodes/Microsoft/Entra/MicrosoftEntra.node.ts b/packages/nodes-base/nodes/Microsoft/Entra/MicrosoftEntra.node.ts index cf08c11f53..554bc1cee2 100644 --- a/packages/nodes-base/nodes/Microsoft/Entra/MicrosoftEntra.node.ts +++ b/packages/nodes-base/nodes/Microsoft/Entra/MicrosoftEntra.node.ts @@ -20,9 +20,9 @@ export class MicrosoftEntra implements INodeType { group: ['transform'], version: 1, subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}', - description: 'Interact with Micosoft Entra ID API', + description: 'Interact with Microsoft Entra ID API', defaults: { - name: 'Micosoft Entra ID', + name: 'Microsoft Entra ID', }, usableAsTool: true, inputs: [NodeConnectionType.Main], From 653bd83f6438bc76d3a17735a3ca348bdbad8c61 Mon Sep 17 00:00:00 2001 From: Matthias Stallmann Date: Thu, 13 Feb 2025 12:50:33 +0100 Subject: [PATCH 2/2] init --- .../Microsoft/SharePoint/GenericFunctions.ts | 0 .../SharePoint/MicrosoftSharePoint.node.ts | 80 +++++++++++++ .../SharePoint/MicrosoftSharepoint.node.json | 18 +++ .../descriptions/FileDescription.ts | 112 ++++++++++++++++++ .../descriptions/ItemDescription.ts | 112 ++++++++++++++++++ .../descriptions/ListDescription.ts | 112 ++++++++++++++++++ .../SharePoint/descriptions/index.ts | 3 + packages/nodes-base/package.json | 1 + 8 files changed, 438 insertions(+) create mode 100644 packages/nodes-base/nodes/Microsoft/SharePoint/GenericFunctions.ts create mode 100644 packages/nodes-base/nodes/Microsoft/SharePoint/MicrosoftSharePoint.node.ts create mode 100644 packages/nodes-base/nodes/Microsoft/SharePoint/MicrosoftSharepoint.node.json create mode 100644 packages/nodes-base/nodes/Microsoft/SharePoint/descriptions/FileDescription.ts create mode 100644 packages/nodes-base/nodes/Microsoft/SharePoint/descriptions/ItemDescription.ts create mode 100644 packages/nodes-base/nodes/Microsoft/SharePoint/descriptions/ListDescription.ts create mode 100644 packages/nodes-base/nodes/Microsoft/SharePoint/descriptions/index.ts diff --git a/packages/nodes-base/nodes/Microsoft/SharePoint/GenericFunctions.ts b/packages/nodes-base/nodes/Microsoft/SharePoint/GenericFunctions.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/nodes-base/nodes/Microsoft/SharePoint/MicrosoftSharePoint.node.ts b/packages/nodes-base/nodes/Microsoft/SharePoint/MicrosoftSharePoint.node.ts new file mode 100644 index 0000000000..2671b85eb3 --- /dev/null +++ b/packages/nodes-base/nodes/Microsoft/SharePoint/MicrosoftSharePoint.node.ts @@ -0,0 +1,80 @@ +import type { INodeType, INodeTypeDescription } from 'n8n-workflow'; +import { NodeConnectionType } from 'n8n-workflow'; + +import { + fileFields, + fileOperations, + itemFields, + itemOperations, + listFields, + listOperations, +} from './descriptions'; + +export class MicrosoftSharePoint implements INodeType { + description: INodeTypeDescription = { + displayName: 'Microsoft SharePoint', + name: 'microsoftSharePoint', + icon: { + light: 'file:icons/SharePoint.svg', + dark: 'file:icons/SharePoint.svg', + }, + group: ['transform'], + version: 1, + subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}', + description: 'Interact with Microsoft SharePoint API', + defaults: { + name: 'Microsoft SharePoint', + }, + usableAsTool: true, + inputs: [NodeConnectionType.Main], + outputs: [NodeConnectionType.Main], + credentials: [ + { + name: 'microsoftSharePointOAuth2Api', + required: true, + }, + ], + requestDefaults: { + baseURL: '=https://{{ $credentials.subdomain }}.sharepoint.com/_api/v2.0/', + headers: { + 'Content-Type': 'application/json', + }, + }, + properties: [ + { + displayName: 'Resource', + name: 'resource', + type: 'options', + noDataExpression: true, + options: [ + { + name: 'File', + value: 'file', + }, + { + name: 'Item', + value: 'item', + }, + { + name: 'List', + value: 'list', + }, + ], + default: 'file', + }, + + ...fileOperations, + ...fileFields, + ...itemOperations, + ...itemFields, + ...listOperations, + ...listFields, + ], + }; + + methods = { + loadOptions: {}, + + listSearch: {}, + }; +} diff --git a/packages/nodes-base/nodes/Microsoft/SharePoint/MicrosoftSharepoint.node.json b/packages/nodes-base/nodes/Microsoft/SharePoint/MicrosoftSharepoint.node.json new file mode 100644 index 0000000000..916b05164a --- /dev/null +++ b/packages/nodes-base/nodes/Microsoft/SharePoint/MicrosoftSharepoint.node.json @@ -0,0 +1,18 @@ +{ + "node": "n8n-nodes-base.microsoftSharePoint", + "nodeVersion": "1.0", + "codexVersion": "1.0", + "categories": ["ECM"], + "resources": { + "credentialDocumentation": [ + { + "url": "https://docs.n8n.io/integrations/builtin/credentials/microsoft/" + } + ], + "primaryDocumentation": [ + { + "url": "https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.microsoftsharepoint/" + } + ] + } +} diff --git a/packages/nodes-base/nodes/Microsoft/SharePoint/descriptions/FileDescription.ts b/packages/nodes-base/nodes/Microsoft/SharePoint/descriptions/FileDescription.ts new file mode 100644 index 0000000000..180a614535 --- /dev/null +++ b/packages/nodes-base/nodes/Microsoft/SharePoint/descriptions/FileDescription.ts @@ -0,0 +1,112 @@ +import type { INodeProperties } from 'n8n-workflow'; + +export const fileOperations: INodeProperties[] = [ + { + displayName: 'Operation', + name: 'operation', + type: 'options', + noDataExpression: true, + displayOptions: { + show: { + resource: ['file'], + }, + }, + options: [ + { + name: 'Create', + value: 'create', + description: 'Create', + routing: { + request: { + method: 'POST', + url: '/', + }, + output: { + postReceive: [], + }, + }, + action: 'Create file', + }, + { + name: 'Delete', + value: 'delete', + description: 'Delete', + routing: { + request: { + method: 'DELETE', + url: '', + }, + output: { + postReceive: [], + }, + }, + action: 'Delete', + }, + { + name: 'Get', + value: 'get', + description: 'Retrieve data for a specific file', + routing: { + request: { + ignoreHttpStatusErrors: true, + method: 'GET', + url: '', + }, + output: { + postReceive: [], + }, + }, + action: 'Get', + }, + { + name: 'Get Many', + value: 'getAll', + description: 'Retrieve a list of', + routing: { + request: { + method: 'GET', + url: '', + }, + output: { + postReceive: [], + }, + }, + action: 'Get many', + }, + { + name: 'Update', + value: 'update', + description: 'Update', + routing: { + request: { + method: 'PATCH', + url: '', + }, + output: { + postReceive: [], + }, + }, + action: 'Update', + }, + ], + default: 'getAll', + }, +]; + +const createFields: INodeProperties[] = []; + +const deleteFields: INodeProperties[] = []; + +const getFields: INodeProperties[] = []; + +const getAllFields: INodeProperties[] = []; + +const updateFields: INodeProperties[] = []; + +export const fileFields: INodeProperties[] = [ + ...createFields, + ...deleteFields, + ...getFields, + ...getAllFields, + ...updateFields, +]; diff --git a/packages/nodes-base/nodes/Microsoft/SharePoint/descriptions/ItemDescription.ts b/packages/nodes-base/nodes/Microsoft/SharePoint/descriptions/ItemDescription.ts new file mode 100644 index 0000000000..c38e3a1a88 --- /dev/null +++ b/packages/nodes-base/nodes/Microsoft/SharePoint/descriptions/ItemDescription.ts @@ -0,0 +1,112 @@ +import type { INodeProperties } from 'n8n-workflow'; + +export const itemOperations: INodeProperties[] = [ + { + displayName: 'Operation', + name: 'operation', + type: 'options', + noDataExpression: true, + displayOptions: { + show: { + resource: ['item'], + }, + }, + options: [ + { + name: 'Create', + value: 'create', + description: 'Create', + routing: { + request: { + method: 'POST', + url: '/', + }, + output: { + postReceive: [], + }, + }, + action: 'Create item', + }, + { + name: 'Delete', + value: 'delete', + description: 'Delete', + routing: { + request: { + method: 'DELETE', + url: '', + }, + output: { + postReceive: [], + }, + }, + action: 'Delete', + }, + { + name: 'Get', + value: 'get', + description: 'Retrieve data for a specific ', + routing: { + request: { + ignoreHttpStatusErrors: true, + method: 'GET', + url: '', + }, + output: { + postReceive: [], + }, + }, + action: 'Get', + }, + { + name: 'Get Many', + value: 'getAll', + description: 'Retrieve a list of', + routing: { + request: { + method: 'GET', + url: '', + }, + output: { + postReceive: [], + }, + }, + action: 'Get many', + }, + { + name: 'Update', + value: 'update', + description: 'Update', + routing: { + request: { + method: 'PATCH', + url: '', + }, + output: { + postReceive: [], + }, + }, + action: 'Update', + }, + ], + default: 'getAll', + }, +]; + +const createFields: INodeProperties[] = []; + +const deleteFields: INodeProperties[] = []; + +const getFields: INodeProperties[] = []; + +const getAllFields: INodeProperties[] = []; + +const updateFields: INodeProperties[] = []; + +export const itemFields: INodeProperties[] = [ + ...createFields, + ...deleteFields, + ...getFields, + ...getAllFields, + ...updateFields, +]; diff --git a/packages/nodes-base/nodes/Microsoft/SharePoint/descriptions/ListDescription.ts b/packages/nodes-base/nodes/Microsoft/SharePoint/descriptions/ListDescription.ts new file mode 100644 index 0000000000..6bc896d69e --- /dev/null +++ b/packages/nodes-base/nodes/Microsoft/SharePoint/descriptions/ListDescription.ts @@ -0,0 +1,112 @@ +import type { INodeProperties } from 'n8n-workflow'; + +export const listOperations: INodeProperties[] = [ + { + displayName: 'Operation', + name: 'operation', + type: 'options', + noDataExpression: true, + displayOptions: { + show: { + resource: ['list'], + }, + }, + options: [ + { + name: 'Create', + value: 'create', + description: 'Create', + routing: { + request: { + method: 'POST', + url: '/', + }, + output: { + postReceive: [], + }, + }, + action: 'Create list', + }, + { + name: 'Delete', + value: 'delete', + description: 'Delete', + routing: { + request: { + method: 'DELETE', + url: '', + }, + output: { + postReceive: [], + }, + }, + action: 'Delete', + }, + { + name: 'Get', + value: 'get', + description: 'Retrieve data for a specific ', + routing: { + request: { + ignoreHttpStatusErrors: true, + method: 'GET', + url: '', + }, + output: { + postReceive: [], + }, + }, + action: 'Get', + }, + { + name: 'Get Many', + value: 'getAll', + description: 'Retrieve a list of', + routing: { + request: { + method: 'GET', + url: '', + }, + output: { + postReceive: [], + }, + }, + action: 'Get many', + }, + { + name: 'Update', + value: 'update', + description: 'Update', + routing: { + request: { + method: 'PATCH', + url: '', + }, + output: { + postReceive: [], + }, + }, + action: 'Update', + }, + ], + default: 'getAll', + }, +]; + +const createFields: INodeProperties[] = []; + +const deleteFields: INodeProperties[] = []; + +const getFields: INodeProperties[] = []; + +const getAllFields: INodeProperties[] = []; + +const updateFields: INodeProperties[] = []; + +export const listFields: INodeProperties[] = [ + ...createFields, + ...deleteFields, + ...getFields, + ...getAllFields, + ...updateFields, +]; diff --git a/packages/nodes-base/nodes/Microsoft/SharePoint/descriptions/index.ts b/packages/nodes-base/nodes/Microsoft/SharePoint/descriptions/index.ts new file mode 100644 index 0000000000..351de4101f --- /dev/null +++ b/packages/nodes-base/nodes/Microsoft/SharePoint/descriptions/index.ts @@ -0,0 +1,3 @@ +export * from './FileDescription'; +export * from './ItemDescription'; +export * from './ListDescription'; diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 4583ebf4c6..804a91e590 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -638,6 +638,7 @@ "dist/nodes/Microsoft/OneDrive/MicrosoftOneDriveTrigger.node.js", "dist/nodes/Microsoft/Outlook/MicrosoftOutlook.node.js", "dist/nodes/Microsoft/Outlook/MicrosoftOutlookTrigger.node.js", + "dist/nodes/Microsoft/SharePoint/MicrosoftSharePoint.node.js", "dist/nodes/Microsoft/Sql/MicrosoftSql.node.js", "dist/nodes/Microsoft/Teams/MicrosoftTeams.node.js", "dist/nodes/Microsoft/ToDo/MicrosoftToDo.node.js",