n8n-nodes-evraz-sharepoint 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,88 @@
1
+ # n8n SharePoint Node
2
+
3
+ Custom n8n node for SharePoint file management integration. Enables workflows to list files, upload, download, and manage folders in SharePoint similar to the standard S3 node functionality.
4
+
5
+ ## Features
6
+
7
+ - **List Files** - Get files and folders from SharePoint locations
8
+ - **Upload File** - Upload files to SharePoint
9
+ - **Download File** - Download files from SharePoint
10
+ - **Delete File** - Remove files or folders
11
+ - **Copy File** - Copy files between locations
12
+ - **Move File** - Move files to different folders
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ cd components
18
+ npm install
19
+ ```
20
+
21
+ ## Development
22
+
23
+ Start n8n with automatic node reload:
24
+
25
+ ```bash
26
+ npm run dev
27
+ ```
28
+
29
+ The node will be available at http://localhost:5678
30
+
31
+ ## Building
32
+
33
+ Compile TypeScript to JavaScript:
34
+
35
+ ```bash
36
+ npm run build
37
+ ```
38
+
39
+ Output is placed in the `dist/` folder.
40
+
41
+ ## Structure
42
+
43
+ ```
44
+ components/
45
+ ├── nodes/SharepointFileManager/
46
+ │ ├── SharepointFileManager.node.ts # Main node implementation
47
+ │ ├── GenericFunctions.ts # Helper functions
48
+ │ └── types.ts # TypeScript interfaces
49
+ ├── credentials/
50
+ │ └── SharepointApi.credentials.ts # Authentication setup
51
+ ├── icons/
52
+ │ └── sharepoint.svg # Node icon
53
+ └── index.ts # Package exports
54
+ ```
55
+
56
+ ## Usage
57
+
58
+ 1. Create a new workflow in n8n
59
+ 2. Add the "SharePoint File Manager" node
60
+ 3. Configure credentials (Site URL, authentication type)
61
+ 4. Select operation (list, upload, download, delete, copy, move)
62
+ 5. Configure operation parameters
63
+ 6. Execute workflow
64
+
65
+ ## API Reference
66
+
67
+ Uses Microsoft Graph API v2.0 for SharePoint operations.
68
+
69
+ Key endpoints:
70
+ - `GET /me/drive/root/children` - List files
71
+ - `PUT /me/drive/root:/{path}:/content` - Upload file
72
+ - `GET /me/drive/root:/{path}:/content` - Download file
73
+ - `DELETE /me/drive/root:/{path}:` - Delete file
74
+ - `POST /me/drive/root:/{path}:/copy` - Copy file
75
+ - `PATCH /me/drive/root:/{path}:` - Move file
76
+
77
+ ## Authentication
78
+
79
+ The node supports three authentication methods:
80
+ - OAuth 2.0 (recommended)
81
+ - Basic Auth
82
+ - API Key
83
+
84
+ ## Notes
85
+
86
+ - Requires SharePoint Online access
87
+ - File paths use forward slashes (e.g., `/Shared Documents/folder/file.pdf`)
88
+ - Large file uploads may require chunked upload API
@@ -0,0 +1,9 @@
1
+ import { IAuthenticateGeneric, ICredentialType, INodeProperties } from 'n8n-workflow';
2
+ export declare class SharepointApi implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ documentationUrl: string;
6
+ properties: INodeProperties[];
7
+ authenticate: IAuthenticateGeneric;
8
+ }
9
+ //# sourceMappingURL=SharepointApi.credentials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SharepointApi.credentials.d.ts","sourceRoot":"","sources":["../../components/credentials/SharepointApi.credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,oBAAoB,EACpB,eAAe,EACf,eAAe,EAEf,MAAM,cAAc,CAAC;AAEtB,qBAAa,aAAc,YAAW,eAAe;IACpD,IAAI,SAAmB;IACvB,WAAW,SAAoB;IAC/B,gBAAgB,SAAyD;IACzE,UAAU,EAAE,eAAe,EAAE,CAiI3B;IAEF,YAAY,EAAE,oBAAoB,CAGhC;CACF"}
@@ -0,0 +1,146 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SharepointApi = void 0;
4
+ class SharepointApi {
5
+ constructor() {
6
+ this.name = 'sharepointApi';
7
+ this.displayName = 'SharePoint API';
8
+ this.documentationUrl = 'https://docs.microsoft.com/en-us/graph/api/overview';
9
+ this.properties = [
10
+ {
11
+ displayName: 'Site URL',
12
+ name: 'siteUrl',
13
+ type: 'string',
14
+ required: true,
15
+ default: '',
16
+ placeholder: 'https://tenant.sharepoint.com/sites/sitename',
17
+ },
18
+ {
19
+ displayName: 'Authentication Type',
20
+ name: 'authType',
21
+ type: 'options',
22
+ options: [
23
+ {
24
+ name: 'OAuth 2.0',
25
+ value: 'oauth2',
26
+ },
27
+ {
28
+ name: 'Basic Auth',
29
+ value: 'basic',
30
+ },
31
+ {
32
+ name: 'NTLM',
33
+ value: 'ntlm',
34
+ },
35
+ {
36
+ name: 'API Key',
37
+ value: 'apiKey',
38
+ },
39
+ ],
40
+ default: 'oauth2',
41
+ },
42
+ {
43
+ displayName: 'Client ID',
44
+ name: 'clientId',
45
+ type: 'string',
46
+ required: true,
47
+ default: '',
48
+ displayOptions: {
49
+ show: {
50
+ authType: ['oauth2'],
51
+ },
52
+ },
53
+ },
54
+ {
55
+ displayName: 'Client Secret',
56
+ name: 'clientSecret',
57
+ type: 'string',
58
+ typeOptions: {
59
+ password: true,
60
+ },
61
+ required: true,
62
+ default: '',
63
+ displayOptions: {
64
+ show: {
65
+ authType: ['oauth2'],
66
+ },
67
+ },
68
+ },
69
+ {
70
+ displayName: 'Username',
71
+ name: 'username',
72
+ type: 'string',
73
+ required: true,
74
+ default: '',
75
+ displayOptions: {
76
+ show: {
77
+ authType: ['basic'],
78
+ },
79
+ },
80
+ },
81
+ {
82
+ displayName: 'Password',
83
+ name: 'password',
84
+ type: 'string',
85
+ typeOptions: {
86
+ password: true,
87
+ },
88
+ required: true,
89
+ default: '',
90
+ displayOptions: {
91
+ show: {
92
+ authType: ['basic'],
93
+ },
94
+ },
95
+ },
96
+ {
97
+ displayName: 'Username',
98
+ name: 'ntlmUsername',
99
+ type: 'string',
100
+ required: true,
101
+ default: '',
102
+ displayOptions: {
103
+ show: {
104
+ authType: ['ntlm'],
105
+ },
106
+ },
107
+ },
108
+ {
109
+ displayName: 'Password',
110
+ name: 'ntlmPassword',
111
+ type: 'string',
112
+ typeOptions: {
113
+ password: true,
114
+ },
115
+ required: true,
116
+ default: '',
117
+ displayOptions: {
118
+ show: {
119
+ authType: ['ntlm'],
120
+ },
121
+ },
122
+ },
123
+ {
124
+ displayName: 'API Key',
125
+ name: 'apiKey',
126
+ type: 'string',
127
+ typeOptions: {
128
+ password: true,
129
+ },
130
+ required: true,
131
+ default: '',
132
+ displayOptions: {
133
+ show: {
134
+ authType: ['apiKey'],
135
+ },
136
+ },
137
+ },
138
+ ];
139
+ this.authenticate = {
140
+ type: 'generic',
141
+ properties: {},
142
+ };
143
+ }
144
+ }
145
+ exports.SharepointApi = SharepointApi;
146
+ //# sourceMappingURL=SharepointApi.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SharepointApi.credentials.js","sourceRoot":"","sources":["../../components/credentials/SharepointApi.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAa,aAAa;IAA1B;QACC,SAAI,GAAG,eAAe,CAAC;QACvB,gBAAW,GAAG,gBAAgB,CAAC;QAC/B,qBAAgB,GAAG,qDAAqD,CAAC;QACzE,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAA6B;gBACnC,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,8CAA8C;aAC3D;YACD;gBACC,WAAW,EAAE,qBAAqB;gBAClC,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,SAA8B;gBACpC,OAAO,EAAE;oBACR;wBACC,IAAI,EAAE,WAAW;wBACjB,KAAK,EAAE,QAAQ;qBACf;oBACD;wBACC,IAAI,EAAE,YAAY;wBAClB,KAAK,EAAE,OAAO;qBACd;oBACD;wBACC,IAAI,EAAE,MAAM;wBACZ,KAAK,EAAE,MAAM;qBACb;oBACD;wBACC,IAAI,EAAE,SAAS;wBACf,KAAK,EAAE,QAAQ;qBACf;iBACD;gBACD,OAAO,EAAE,QAAQ;aACjB;YACD;gB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,UAAU;gBACvB,IAAI,EAAE,cAAc;gBACpB,IAAI,EAAE,QAA6B;gBACnC,WAAW,EAAE;oBACZ,QAAQ,EAAE,IAAI;iBACd;gBACD,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,EAAE;gBACX,cAAc,EAAE;oBACf,IAAI,EAAE;wBACL,QAAQ,EAAE,CAAC,MAAM,CAAC;qBAClB;iBACD;aACD;YACD;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAA6B;gBACnC,WAAW,EAAE;oBACZ,QAAQ,EAAE,IAAI;iBACd;gBACD,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,EAAE;gBACX,cAAc,EAAE;oBACf,IAAI,EAAE;wBACL,QAAQ,EAAE,CAAC,QAAQ,CAAC;qBACpB;iBACD;aACD;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE,EAAE;SACd,CAAC;IACH,CAAC;CAAA;AA3ID,sCA2IC"}
@@ -0,0 +1,4 @@
1
+ import { SharepointFileManager } from './nodes/SharepointFileManager/SharepointFileManager.node';
2
+ import { SharepointApi } from './credentials/SharepointApi.credentials';
3
+ export { SharepointFileManager, SharepointApi };
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,0DAA0D,CAAC;AACjG,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAExE,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SharepointApi = exports.SharepointFileManager = void 0;
4
+ const SharepointFileManager_node_1 = require("./nodes/SharepointFileManager/SharepointFileManager.node");
5
+ Object.defineProperty(exports, "SharepointFileManager", { enumerable: true, get: function () { return SharepointFileManager_node_1.SharepointFileManager; } });
6
+ const SharepointApi_credentials_1 = require("./credentials/SharepointApi.credentials");
7
+ Object.defineProperty(exports, "SharepointApi", { enumerable: true, get: function () { return SharepointApi_credentials_1.SharepointApi; } });
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../components/index.ts"],"names":[],"mappings":";;;AAAA,yGAAiG;AAGxF,sGAHA,kDAAqB,OAGA;AAF9B,uFAAwE;AAExC,8FAFvB,yCAAa,OAEuB"}
@@ -0,0 +1,4 @@
1
+ import { IExecuteFunctions, IDataObject, IHttpRequestMethods } from 'n8n-workflow';
2
+ export declare function sharepointApiRequest(this: IExecuteFunctions, method: IHttpRequestMethods, resource: string, body?: IDataObject, qs?: IDataObject): Promise<IDataObject>;
3
+ export declare function sharepointApiRequestAllItems(this: IExecuteFunctions, method: IHttpRequestMethods, resource: string, body?: IDataObject, qs?: IDataObject): Promise<IDataObject[]>;
4
+ //# sourceMappingURL=GenericFunctions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GenericFunctions.d.ts","sourceRoot":"","sources":["../../../components/nodes/SharepointFileManager/GenericFunctions.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,iBAAiB,EACjB,WAAW,EACX,mBAAmB,EAInB,MAAM,cAAc,CAAC;AAEtB,wBAAsB,oBAAoB,CACzC,IAAI,EAAE,iBAAiB,EACvB,MAAM,EAAE,mBAAmB,EAC3B,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE,WAAW,EAClB,EAAE,CAAC,EAAE,WAAW,GACd,OAAO,CAAC,WAAW,CAAC,CAmDtB;AAED,wBAAsB,4BAA4B,CACjD,IAAI,EAAE,iBAAiB,EACvB,MAAM,EAAE,mBAAmB,EAC3B,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE,WAAW,EAClB,EAAE,CAAC,EAAE,WAAW,GACd,OAAO,CAAC,WAAW,EAAE,CAAC,CAwBxB"}
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sharepointApiRequest = sharepointApiRequest;
4
+ exports.sharepointApiRequestAllItems = sharepointApiRequestAllItems;
5
+ const n8n_workflow_1 = require("n8n-workflow");
6
+ async function sharepointApiRequest(method, resource, body, qs) {
7
+ const credentials = await this.getCredentials('sharepointApi');
8
+ if (!credentials) {
9
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: 'Credentials not found' });
10
+ }
11
+ const siteUrl = credentials.siteUrl;
12
+ const authType = credentials.authType;
13
+ const options = {
14
+ method,
15
+ url: `${siteUrl}/_api/v2.0${resource}`,
16
+ json: true,
17
+ qs,
18
+ };
19
+ if (body && Object.keys(body).length > 0) {
20
+ options.data = body;
21
+ }
22
+ // Add authentication headers based on auth type
23
+ options.headers = {};
24
+ if (authType === 'oauth2') {
25
+ // Token should be fetched from OAuth flow - placeholder for now
26
+ const token = credentials.token;
27
+ options.headers.Authorization = `Bearer ${token}`;
28
+ }
29
+ else if (authType === 'basic') {
30
+ const username = credentials.username;
31
+ const password = credentials.password;
32
+ const buffer = Buffer.from(`${username}:${password}`);
33
+ options.headers.Authorization = `Basic ${buffer.toString('base64')}`;
34
+ }
35
+ else if (authType === 'ntlm') {
36
+ const username = credentials.ntlmUsername;
37
+ const password = credentials.ntlmPassword;
38
+ options.auth = {
39
+ username,
40
+ password,
41
+ sendImmediately: false,
42
+ };
43
+ }
44
+ else if (authType === 'apiKey') {
45
+ const apiKey = credentials.apiKey;
46
+ options.headers['X-API-Key'] = apiKey;
47
+ }
48
+ try {
49
+ return await this.helpers.httpRequest(options);
50
+ }
51
+ catch (error) {
52
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
53
+ }
54
+ }
55
+ async function sharepointApiRequestAllItems(method, resource, body, qs) {
56
+ const returnData = [];
57
+ let responseData;
58
+ const query = qs || {};
59
+ query.$top = query.$top || 200;
60
+ let url = resource;
61
+ do {
62
+ responseData = await sharepointApiRequest.call(this, method, url, body, query);
63
+ if (responseData.value && Array.isArray(responseData.value)) {
64
+ returnData.push(...responseData.value);
65
+ }
66
+ if (typeof responseData['@odata.nextLink'] === 'string') {
67
+ url = responseData['@odata.nextLink'];
68
+ }
69
+ else {
70
+ break;
71
+ }
72
+ } while (true);
73
+ return returnData;
74
+ }
75
+ //# sourceMappingURL=GenericFunctions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GenericFunctions.js","sourceRoot":"","sources":["../../../components/nodes/SharepointFileManager/GenericFunctions.ts"],"names":[],"mappings":";;AASA,oDAyDC;AAED,oEA8BC;AAlGD,+CAOsB;AAEf,KAAK,UAAU,oBAAoB,CAEzC,MAA2B,EAC3B,QAAgB,EAChB,IAAkB,EAClB,EAAgB;IAEhB,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;IAE/D,IAAI,CAAC,WAAW,EAAE,CAAC;QAClB,MAAM,IAAI,2BAAY,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,uBAAuB,EAAE,CAAC,CAAC;IAC9E,CAAC;IAED,MAAM,OAAO,GAAG,WAAW,CAAC,OAAiB,CAAC;IAC9C,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAkB,CAAC;IAEhD,MAAM,OAAO,GAAqE;QACjF,MAAM;QACN,GAAG,EAAE,GAAG,OAAO,aAAa,QAAQ,EAAE;QACtC,IAAI,EAAE,IAAI;QACV,EAAE;KACF,CAAC;IAEF,IAAI,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1C,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IACrB,CAAC;IAED,gDAAgD;IAChD,OAAO,CAAC,OAAO,GAAG,EAAE,CAAC;IAErB,IAAI,QAAQ,KA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ClB,EAAgB;IAEhB,MAAM,UAAU,GAAkB,EAAE,CAAC;IACrC,IAAI,YAAyB,CAAC;IAE9B,MAAM,KAAK,GAAgB,EAAE,IAAI,EAAE,CAAC;IACpC,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,GAAG,CAAC;IAE/B,IAAI,GAAG,GAAG,QAAQ,CAAC;IAEnB,GAAG,CAAC;QACH,YAAY,GAAG,MAAM,oBAAoB,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;QAE/E,IAAI,YAAY,CAAC,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;YAC7D,UAAU,CAAC,IAAI,CAAC,GAAI,YAAY,CAAC,KAAuB,CAAC,CAAC;QAC3D,CAAC;QAED,IAAI,OAAO,YAAY,CAAC,iBAAiB,CAAC,KAAK,QAAQ,EAAE,CAAC;YACzD,GAAG,GAAG,YAAY,CAAC,iBAAiB,CAAC,CAAC;QACvC,CAAC;aAAM,CAAC;YACP,MAAM;QACP,CAAC;IACF,CAAC,QAAQ,IAAI,EAAE;IAEf,OAAO,UAAU,CAAC;AACnB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ export declare class SharepointFileManager implements INodeType {
3
+ description: INodeTypeDescription;
4
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
+ private handleListOperation;
6
+ private handleUploadOperation;
7
+ private handleDownloadOperation;
8
+ private handleDeleteOperation;
9
+ private handleCopyOperation;
10
+ private handleMoveOperation;
11
+ }
12
+ //# sourceMappingURL=SharepointFileManager.node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SharepointFileManager.node.d.ts","sourceRoot":"","sources":["../../../components/nodes/SharepointFileManager/SharepointFileManager.node.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,oBAAoB,EAMpB,MAAM,cAAc,CAAC;AAItB,qBAAa,qBAAsB,YAAW,SAAS;IACtD,WAAW,EAAE,oBAAoB,CAiN/B;IAEI,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;YAmCzD,mBAAmB;YAyCnB,qBAAqB;YAmBrB,uBAAuB;YAiCvB,qBAAqB;YAerB,mBAAmB;YAoBnB,mBAAmB;CAmBjC"}
@@ -0,0 +1,356 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SharepointFileManager = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const GenericFunctions_1 = require("./GenericFunctions");
6
+ class SharepointFileManager {
7
+ constructor() {
8
+ this.description = {
9
+ displayName: 'SharePoint File Manager',
10
+ name: 'sharepointFileManager',
11
+ icon: 'file:../../icons/sharepoint.svg',
12
+ group: ['input'],
13
+ version: 1,
14
+ subtitle: '={{$parameter["operation"]}}',
15
+ description: 'Manage files and folders in SharePoint',
16
+ defaults: {
17
+ name: 'SharePoint File Manager',
18
+ },
19
+ inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
20
+ outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
21
+ credentials: [
22
+ {
23
+ name: 'sharepointApi',
24
+ required: true,
25
+ },
26
+ ],
27
+ properties: [
28
+ {
29
+ displayName: 'Operation',
30
+ name: 'operation',
31
+ type: 'options',
32
+ noDataExpression: true,
33
+ options: [
34
+ {
35
+ name: 'List Files',
36
+ value: 'list',
37
+ description: 'List all files and folders',
38
+ action: 'List files',
39
+ },
40
+ {
41
+ name: 'Upload File',
42
+ value: 'upload',
43
+ description: 'Upload a file to SharePoint',
44
+ action: 'Upload file',
45
+ },
46
+ {
47
+ name: 'Download File',
48
+ value: 'download',
49
+ description: 'Download a file from SharePoint',
50
+ action: 'Download file',
51
+ },
52
+ {
53
+ name: 'Delete File',
54
+ value: 'delete',
55
+ description: 'Delete a file or folder',
56
+ action: 'Delete file',
57
+ },
58
+ {
59
+ name: 'Copy File',
60
+ value: 'copy',
61
+ description: 'Copy a file to another location',
62
+ action: 'Copy file',
63
+ },
64
+ {
65
+ name: 'Move File',
66
+ value: 'move',
67
+ description: 'Move a file to another location',
68
+ action: 'Move file',
69
+ },
70
+ ],
71
+ default: 'list',
72
+ },
73
+ // List operation properties
74
+ {
75
+ displayName: 'Path',
76
+ name: 'path',
77
+ type: 'string',
78
+ default: '',
79
+ displayOptions: {
80
+ show: {
81
+ operation: ['list'],
82
+ },
83
+ },
84
+ placeholder: '/root or /Shared Documents',
85
+ description: 'Folder path in SharePoint',
86
+ },
87
+ // Upload operation properties
88
+ {
89
+ displayName: 'Folder Path',
90
+ name: 'uploadPath',
91
+ type: 'string',
92
+ default: '',
93
+ displayOptions: {
94
+ show: {
95
+ operation: ['upload'],
96
+ },
97
+ },
98
+ placeholder: '/root or /Shared Documents',
99
+ description: 'Folder path where file will be uploaded',
100
+ },
101
+ {
102
+ displayName: 'File Name',
103
+ name: 'fileName',
104
+ type: 'string',
105
+ default: '',
106
+ displayOptions: {
107
+ show: {
108
+ operation: ['upload'],
109
+ },
110
+ },
111
+ placeholder: 'file.pdf',
112
+ required: true,
113
+ description: 'Name for the uploaded file',
114
+ },
115
+ {
116
+ displayName: 'Data',
117
+ name: 'fileData',
118
+ type: 'string',
119
+ default: '',
120
+ displayOptions: {
121
+ show: {
122
+ operation: ['upload'],
123
+ },
124
+ },
125
+ required: true,
126
+ description: 'File data to upload',
127
+ },
128
+ // Download operation properties
129
+ {
130
+ displayName: 'File Path',
131
+ name: 'downloadPath',
132
+ type: 'string',
133
+ default: '',
134
+ displayOptions: {
135
+ show: {
136
+ operation: ['download'],
137
+ },
138
+ },
139
+ placeholder: '/root/file.pdf',
140
+ required: true,
141
+ description: 'Full path to the file to download',
142
+ },
143
+ // Delete operation properties
144
+ {
145
+ displayName: 'File Path',
146
+ name: 'deletePath',
147
+ type: 'string',
148
+ default: '',
149
+ displayOptions: {
150
+ show: {
151
+ operation: ['delete'],
152
+ },
153
+ },
154
+ placeholder: '/root/file.pdf',
155
+ required: true,
156
+ description: 'Full path to the file or folder to delete',
157
+ },
158
+ // Copy operation properties
159
+ {
160
+ displayName: 'File Path',
161
+ name: 'copyFromPath',
162
+ type: 'string',
163
+ default: '',
164
+ displayOptions: {
165
+ show: {
166
+ operation: ['copy'],
167
+ },
168
+ },
169
+ placeholder: '/root/file.pdf',
170
+ required: true,
171
+ description: 'Full path to the file to copy',
172
+ },
173
+ {
174
+ displayName: 'Destination Path',
175
+ name: 'copyToPath',
176
+ type: 'string',
177
+ default: '',
178
+ displayOptions: {
179
+ show: {
180
+ operation: ['copy'],
181
+ },
182
+ },
183
+ placeholder: '/root/copy/file.pdf',
184
+ required: true,
185
+ description: 'Destination path for the copied file',
186
+ },
187
+ // Move operation properties
188
+ {
189
+ displayName: 'File Path',
190
+ name: 'moveFromPath',
191
+ type: 'string',
192
+ default: '',
193
+ displayOptions: {
194
+ show: {
195
+ operation: ['move'],
196
+ },
197
+ },
198
+ placeholder: '/root/file.pdf',
199
+ required: true,
200
+ description: 'Full path to the file to move',
201
+ },
202
+ {
203
+ displayName: 'Destination Path',
204
+ name: 'moveToPath',
205
+ type: 'string',
206
+ default: '',
207
+ displayOptions: {
208
+ show: {
209
+ operation: ['move'],
210
+ },
211
+ },
212
+ placeholder: '/root/archive/file.pdf',
213
+ required: true,
214
+ description: 'Destination path for the moved file',
215
+ },
216
+ ],
217
+ };
218
+ }
219
+ async execute() {
220
+ const nodeOutput = [];
221
+ const operation = this.getNodeParameter('operation', 0);
222
+ const self = this;
223
+ try {
224
+ switch (operation) {
225
+ case 'list':
226
+ nodeOutput.push(await self.handleListOperation.call(this));
227
+ break;
228
+ case 'upload':
229
+ nodeOutput.push(await self.handleUploadOperation.call(this));
230
+ break;
231
+ case 'download':
232
+ nodeOutput.push(await self.handleDownloadOperation.call(this));
233
+ break;
234
+ case 'delete':
235
+ nodeOutput.push(await self.handleDeleteOperation.call(this));
236
+ break;
237
+ case 'copy':
238
+ nodeOutput.push(await self.handleCopyOperation.call(this));
239
+ break;
240
+ case 'move':
241
+ nodeOutput.push(await self.handleMoveOperation.call(this));
242
+ break;
243
+ default:
244
+ throw new Error(`Unknown operation: ${operation}`);
245
+ }
246
+ }
247
+ catch (error) {
248
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
249
+ }
250
+ return nodeOutput;
251
+ }
252
+ async handleListOperation() {
253
+ const path = this.getNodeParameter('path', 0, '');
254
+ // Use $select to get only needed fields and $orderby for sorting
255
+ const items = await GenericFunctions_1.sharepointApiRequestAllItems.call(this, 'GET', `/me/drive/root/children`, undefined, {
256
+ $select: 'id,name,size,createdDateTime,lastModifiedDateTime,webUrl,file,folder',
257
+ $orderby: 'name',
258
+ });
259
+ // Transform items to be more useful for workflows
260
+ const transformedItems = items.map((item) => {
261
+ const file = item.file;
262
+ return {
263
+ id: item.id,
264
+ name: item.name,
265
+ type: item.folder ? 'folder' : 'file',
266
+ size: item.size || 0,
267
+ createdDateTime: item.createdDateTime,
268
+ lastModifiedDateTime: item.lastModifiedDateTime,
269
+ webUrl: item.webUrl,
270
+ mimeType: file?.mimeType || null,
271
+ };
272
+ });
273
+ return [
274
+ {
275
+ json: {
276
+ items: transformedItems,
277
+ path,
278
+ count: transformedItems.length,
279
+ },
280
+ },
281
+ ];
282
+ }
283
+ async handleUploadOperation() {
284
+ const uploadPath = this.getNodeParameter('uploadPath', 0);
285
+ const fileName = this.getNodeParameter('fileName', 0);
286
+ const fileData = this.getNodeParameter('fileData', 0);
287
+ const response = await GenericFunctions_1.sharepointApiRequest.call(this, 'PUT', `/me/drive/root:${uploadPath}/${fileName}:/content`, fileData);
288
+ return [
289
+ {
290
+ json: response,
291
+ },
292
+ ];
293
+ }
294
+ async handleDownloadOperation() {
295
+ const downloadPath = this.getNodeParameter('downloadPath', 0);
296
+ const response = await GenericFunctions_1.sharepointApiRequest.call(this, 'GET', `/me/drive/root:${downloadPath}:/content`);
297
+ // Extract filename from path
298
+ const fileName = downloadPath.split('/').pop() || 'file';
299
+ const binaryData = {
300
+ data: Buffer.isBuffer(response)
301
+ ? response.toString('base64')
302
+ : Buffer.from(JSON.stringify(response)).toString('base64'),
303
+ fileName,
304
+ mimeType: 'application/octet-stream',
305
+ };
306
+ return [
307
+ {
308
+ json: {
309
+ fileName,
310
+ path: downloadPath,
311
+ },
312
+ binary: {
313
+ data: binaryData,
314
+ },
315
+ },
316
+ ];
317
+ }
318
+ async handleDeleteOperation() {
319
+ const deletePath = this.getNodeParameter('deletePath', 0);
320
+ await GenericFunctions_1.sharepointApiRequest.call(this, 'DELETE', `/me/drive/root:${deletePath}:`);
321
+ return [
322
+ {
323
+ json: {
324
+ success: true,
325
+ message: `File deleted: ${deletePath}`,
326
+ },
327
+ },
328
+ ];
329
+ }
330
+ async handleCopyOperation() {
331
+ const copyFromPath = this.getNodeParameter('copyFromPath', 0);
332
+ const copyToPath = this.getNodeParameter('copyToPath', 0);
333
+ const response = await GenericFunctions_1.sharepointApiRequest.call(this, 'POST', `/me/drive/root:${copyFromPath}:/copy`, {
334
+ parentReference: { path: copyToPath },
335
+ });
336
+ return [
337
+ {
338
+ json: response,
339
+ },
340
+ ];
341
+ }
342
+ async handleMoveOperation() {
343
+ const moveFromPath = this.getNodeParameter('moveFromPath', 0);
344
+ const moveToPath = this.getNodeParameter('moveToPath', 0);
345
+ const response = await GenericFunctions_1.sharepointApiRequest.call(this, 'PATCH', `/me/drive/root:${moveFromPath}:`, {
346
+ parentReference: { path: moveToPath },
347
+ });
348
+ return [
349
+ {
350
+ json: response,
351
+ },
352
+ ];
353
+ }
354
+ }
355
+ exports.SharepointFileManager = SharepointFileManager;
356
+ //# sourceMappingURL=SharepointFileManager.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SharepointFileManager.node.js","sourceRoot":"","sources":["../../../components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ACH,CAAC;IAEO,KAAK,CAAC,mBAAmB;QAChC,MAAM,YAAY,GAAG,IAAI,CAAC,gBAAgB,CAAC,cAAc,EAAE,CAAC,CAAW,CAAC;QACxE,MAAM,UAAU,GAAG,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,CAAC,CAAW,CAAC;QAEpE,MAAM,QAAQ,GAAG,MAAM,uCAAoB,CAAC,IAAI,CAC/C,IAAI,EACJ,OAAO,EACP,kBAAkB,YAAY,GAAG,EACjC;YACC,eAAe,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE;SACrC,CACD,CAAC;QAEF,OAAO;YACN;gBACC,IAAI,EAAE,QAAQ;aACd;SACD,CAAC;IACH,CAAC;CACD;AA1YD,sDA0YC"}
@@ -0,0 +1,64 @@
1
+ export interface SharepointFile {
2
+ id: string;
3
+ name: string;
4
+ size: number;
5
+ createdDateTime: string;
6
+ lastModifiedDateTime: string;
7
+ webUrl: string;
8
+ parentReference: {
9
+ driveId: string;
10
+ id: string;
11
+ path: string;
12
+ };
13
+ }
14
+ export interface SharepointFolder {
15
+ id: string;
16
+ name: string;
17
+ createdDateTime: string;
18
+ lastModifiedDateTime: string;
19
+ webUrl: string;
20
+ folder?: {
21
+ childCount: number;
22
+ };
23
+ parentReference: {
24
+ driveId: string;
25
+ id: string;
26
+ path: string;
27
+ };
28
+ }
29
+ export interface SharepointItem {
30
+ id: string;
31
+ name: string;
32
+ size?: number;
33
+ createdDateTime: string;
34
+ lastModifiedDateTime: string;
35
+ webUrl: string;
36
+ folder?: {
37
+ childCount: number;
38
+ };
39
+ file?: {
40
+ mimeType: string;
41
+ };
42
+ parentReference: {
43
+ driveId: string;
44
+ id: string;
45
+ path: string;
46
+ };
47
+ }
48
+ export interface SharepointListResponse {
49
+ value: SharepointItem[];
50
+ '@odata.nextLink'?: string;
51
+ }
52
+ export type OperationType = 'list' | 'upload' | 'download' | 'delete' | 'copy' | 'move';
53
+ export interface OperationOptions {
54
+ operation: OperationType;
55
+ path?: string;
56
+ fileName?: string;
57
+ data?: Buffer;
58
+ destination?: string;
59
+ options?: {
60
+ recursive?: boolean;
61
+ overwrite?: boolean;
62
+ };
63
+ }
64
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../components/nodes/SharepointFileManager/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;IACxB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;KACb,CAAC;CACF;AAED,MAAM,WAAW,gBAAgB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;IACxB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE;QACR,UAAU,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,eAAe,EAAE;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;KACb,CAAC;CACF;AAED,MAAM,WAAW,cAAc;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE;QACR,UAAU,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,IAAI,CAAC,EAAE;QACN,QAAQ,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,eAAe,EAAE;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;KACb,CAAC;CACF;AAED,MAAM,WAAW,sBAAsB;IACtC,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;AAExF,MAAM,WAAW,gBAAgB;IAChC,SAAS,EAAE,aAAa,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE;QACT,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,SAAS,CAAC,EAAE,OAAO,CAAC;KACpB,CAAC;CACF"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../components/nodes/SharepointFileManager/types.ts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "n8n-nodes-evraz-sharepoint",
3
+ "version": "0.2.0",
4
+ "description": "n8n community node for SharePoint integration - manage files and folders",
5
+ "author": "Evraz",
6
+ "license": "MIT",
7
+ "main": "dist/index.js",
8
+ "types": "dist/index.d.ts",
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "keywords": [
13
+ "n8n",
14
+ "workflow",
15
+ "sharepoint",
16
+ "file-manager",
17
+ "document-management"
18
+ ],
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "https://github.com/evraz/nlp-n8n-nodes-evraz-sharepoint"
22
+ },
23
+ "homepage": "https://github.com/evraz/nlp-n8n-nodes-evraz-sharepoint#readme",
24
+ "bugs": {
25
+ "url": "https://github.com/evraz/nlp-n8n-nodes-evraz-sharepoint/issues"
26
+ },
27
+ "scripts": {
28
+ "dev": "n8n start --tunnel",
29
+ "build": "tsc -p tsconfig.json",
30
+ "build:watch": "tsc -p tsconfig.json -w",
31
+ "lint": "eslint . --cache",
32
+ "lint:fix": "eslint . --cache --fix",
33
+ "release": "node scripts/release.js"
34
+ },
35
+ "n8n": {
36
+ "nodes": [
37
+ "dist/nodes/SharepointFileManager/SharepointFileManager.node.js"
38
+ ],
39
+ "credentials": [
40
+ "dist/credentials/SharepointApi.credentials.js"
41
+ ]
42
+ },
43
+ "dependencies": {
44
+ "n8n-core": "^1.0.0",
45
+ "n8n-workflow": "^1.0.0"
46
+ },
47
+ "devDependencies": {
48
+ "@types/node": "^18.0.0",
49
+ "@typescript-eslint/eslint-plugin": "^5.62.0",
50
+ "@typescript-eslint/parser": "^5.62.0",
51
+ "eslint": "^8.50.0",
52
+ "eslint-config-prettier": "^10.1.8",
53
+ "eslint-plugin-prettier": "^5.5.6",
54
+ "prettier": "^3.0.0",
55
+ "typescript": "^5.0.0"
56
+ }
57
+ }