This commit is contained in:
feelgood-interface 2025-03-06 00:32:36 +01:00 committed by GitHub
commit 56e5de3da8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 440 additions and 2 deletions

View file

@ -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],

View file

@ -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: {},
};
}

View file

@ -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/"
}
]
}
}

View file

@ -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,
];

View file

@ -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,
];

View file

@ -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,
];

View file

@ -0,0 +1,3 @@
export * from './FileDescription';
export * from './ItemDescription';
export * from './ListDescription';

View file

@ -641,6 +641,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/Storage/AzureStorage.node.js",
"dist/nodes/Microsoft/Teams/MicrosoftTeams.node.js",