n8n-nodes-nextcloud-ext 1.0.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/LICENSE +21 -0
- package/README.md +357 -0
- package/dist/credentials/NextCloudApi.credentials.d.ts +9 -0
- package/dist/credentials/NextCloudApi.credentials.js +57 -0
- package/dist/credentials/NextCloudApi.credentials.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/nodes/NextCloud/NextCloud.node.d.ts +10 -0
- package/dist/nodes/NextCloud/NextCloud.node.js +601 -0
- package/dist/nodes/NextCloud/NextCloud.node.js.map +1 -0
- package/dist/nodes/NextCloud/nextcloud.svg +13 -0
- package/dist/nodes/NextCloudSpreadsheet/NextCloudSpreadsheet.node.d.ts +12 -0
- package/dist/nodes/NextCloudSpreadsheet/NextCloudSpreadsheet.node.js +820 -0
- package/dist/nodes/NextCloudSpreadsheet/NextCloudSpreadsheet.node.js.map +1 -0
- package/dist/nodes/NextCloudSpreadsheet/nextcloud.svg +13 -0
- package/dist/nodes/shared/GenericFunctions.d.ts +55 -0
- package/dist/nodes/shared/GenericFunctions.js +523 -0
- package/dist/nodes/shared/GenericFunctions.js.map +1 -0
- package/package.json +72 -0
|
@@ -0,0 +1,601 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NextCloud = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const GenericFunctions_1 = require("../shared/GenericFunctions");
|
|
6
|
+
function makeAuthHeader(user, password) {
|
|
7
|
+
return 'Basic ' + Buffer.from(`${user}:${password}`).toString('base64');
|
|
8
|
+
}
|
|
9
|
+
class NextCloud {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.description = {
|
|
12
|
+
displayName: 'Nextcloud',
|
|
13
|
+
name: 'nextCloud',
|
|
14
|
+
icon: 'file:nextcloud.svg',
|
|
15
|
+
group: ['input'],
|
|
16
|
+
version: 1,
|
|
17
|
+
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
18
|
+
description: 'Manage files and folders on Nextcloud (WebDAV)',
|
|
19
|
+
defaults: {
|
|
20
|
+
name: 'Nextcloud',
|
|
21
|
+
},
|
|
22
|
+
inputs: ['main'],
|
|
23
|
+
outputs: ['main'],
|
|
24
|
+
credentials: [
|
|
25
|
+
{
|
|
26
|
+
name: 'nextCloudApi',
|
|
27
|
+
required: true,
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
properties: [
|
|
31
|
+
// ------------------------------------------------------------------
|
|
32
|
+
// Resource
|
|
33
|
+
// ------------------------------------------------------------------
|
|
34
|
+
{
|
|
35
|
+
displayName: 'Resource',
|
|
36
|
+
name: 'resource',
|
|
37
|
+
type: 'options',
|
|
38
|
+
noDataExpression: true,
|
|
39
|
+
options: [
|
|
40
|
+
{ name: 'File', value: 'file' },
|
|
41
|
+
{ name: 'Folder', value: 'folder' },
|
|
42
|
+
{ name: 'Share', value: 'share' },
|
|
43
|
+
],
|
|
44
|
+
default: 'file',
|
|
45
|
+
},
|
|
46
|
+
// ==================================================================
|
|
47
|
+
// FILE operations
|
|
48
|
+
// ==================================================================
|
|
49
|
+
{
|
|
50
|
+
displayName: 'Operation',
|
|
51
|
+
name: 'operation',
|
|
52
|
+
type: 'options',
|
|
53
|
+
noDataExpression: true,
|
|
54
|
+
displayOptions: { show: { resource: ['file'] } },
|
|
55
|
+
options: [
|
|
56
|
+
{
|
|
57
|
+
name: 'Copy',
|
|
58
|
+
value: 'copy',
|
|
59
|
+
description: 'Copy a file to another path',
|
|
60
|
+
action: 'Copy a file',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: 'Delete',
|
|
64
|
+
value: 'delete',
|
|
65
|
+
description: 'Delete a file',
|
|
66
|
+
action: 'Delete a file',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: 'Download',
|
|
70
|
+
value: 'download',
|
|
71
|
+
description: 'Download a file',
|
|
72
|
+
action: 'Download a file',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: 'List',
|
|
76
|
+
value: 'list',
|
|
77
|
+
description: 'List files inside a folder',
|
|
78
|
+
action: 'List files in a folder',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: 'Move',
|
|
82
|
+
value: 'move',
|
|
83
|
+
description: 'Move / rename a file',
|
|
84
|
+
action: 'Move a file',
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: 'Upload',
|
|
88
|
+
value: 'upload',
|
|
89
|
+
description: 'Upload a file',
|
|
90
|
+
action: 'Upload a file',
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
default: 'list',
|
|
94
|
+
},
|
|
95
|
+
// ==================================================================
|
|
96
|
+
// FOLDER operations
|
|
97
|
+
// ==================================================================
|
|
98
|
+
{
|
|
99
|
+
displayName: 'Operation',
|
|
100
|
+
name: 'operation',
|
|
101
|
+
type: 'options',
|
|
102
|
+
noDataExpression: true,
|
|
103
|
+
displayOptions: { show: { resource: ['folder'] } },
|
|
104
|
+
options: [
|
|
105
|
+
{
|
|
106
|
+
name: 'Create',
|
|
107
|
+
value: 'create',
|
|
108
|
+
description: 'Create a folder',
|
|
109
|
+
action: 'Create a folder',
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
name: 'Delete',
|
|
113
|
+
value: 'delete',
|
|
114
|
+
description: 'Delete a folder',
|
|
115
|
+
action: 'Delete a folder',
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: 'List',
|
|
119
|
+
value: 'list',
|
|
120
|
+
description: 'List folder contents',
|
|
121
|
+
action: 'List folder contents',
|
|
122
|
+
},
|
|
123
|
+
],
|
|
124
|
+
default: 'list',
|
|
125
|
+
},
|
|
126
|
+
// ==================================================================
|
|
127
|
+
// SHARE operations
|
|
128
|
+
// ==================================================================
|
|
129
|
+
{
|
|
130
|
+
displayName: 'Operation',
|
|
131
|
+
name: 'operation',
|
|
132
|
+
type: 'options',
|
|
133
|
+
noDataExpression: true,
|
|
134
|
+
displayOptions: { show: { resource: ['share'] } },
|
|
135
|
+
options: [
|
|
136
|
+
{
|
|
137
|
+
name: 'Create',
|
|
138
|
+
value: 'create',
|
|
139
|
+
description: 'Create a public share link',
|
|
140
|
+
action: 'Create a share link',
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
name: 'Delete',
|
|
144
|
+
value: 'delete',
|
|
145
|
+
description: 'Delete a share',
|
|
146
|
+
action: 'Delete a share',
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: 'Get All',
|
|
150
|
+
value: 'getAll',
|
|
151
|
+
description: 'Get all shares',
|
|
152
|
+
action: 'Get all shares',
|
|
153
|
+
},
|
|
154
|
+
],
|
|
155
|
+
default: 'create',
|
|
156
|
+
},
|
|
157
|
+
// ------------------------------------------------------------------
|
|
158
|
+
// FILE: List + Folder: List
|
|
159
|
+
// ------------------------------------------------------------------
|
|
160
|
+
{
|
|
161
|
+
displayName: 'Folder Path',
|
|
162
|
+
name: 'path',
|
|
163
|
+
type: 'string',
|
|
164
|
+
default: '/',
|
|
165
|
+
placeholder: '/Documents',
|
|
166
|
+
description: 'Path of the folder to list (relative to your Nextcloud root)',
|
|
167
|
+
displayOptions: {
|
|
168
|
+
show: {
|
|
169
|
+
operation: ['list'],
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
// ------------------------------------------------------------------
|
|
174
|
+
// FILE: Download
|
|
175
|
+
// ------------------------------------------------------------------
|
|
176
|
+
{
|
|
177
|
+
displayName: 'File Path',
|
|
178
|
+
name: 'path',
|
|
179
|
+
type: 'string',
|
|
180
|
+
default: '',
|
|
181
|
+
placeholder: '/Documents/report.xlsx',
|
|
182
|
+
required: true,
|
|
183
|
+
description: 'Path of the file to download',
|
|
184
|
+
displayOptions: {
|
|
185
|
+
show: {
|
|
186
|
+
resource: ['file'],
|
|
187
|
+
operation: ['download'],
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
displayName: 'Binary Property Name',
|
|
193
|
+
name: 'binaryPropertyName',
|
|
194
|
+
type: 'string',
|
|
195
|
+
default: 'data',
|
|
196
|
+
description: 'Name of the binary property to write the file to',
|
|
197
|
+
displayOptions: {
|
|
198
|
+
show: {
|
|
199
|
+
resource: ['file'],
|
|
200
|
+
operation: ['download'],
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
// ------------------------------------------------------------------
|
|
205
|
+
// FILE: Upload
|
|
206
|
+
// ------------------------------------------------------------------
|
|
207
|
+
{
|
|
208
|
+
displayName: 'File Path',
|
|
209
|
+
name: 'path',
|
|
210
|
+
type: 'string',
|
|
211
|
+
default: '',
|
|
212
|
+
placeholder: '/Documents/report.xlsx',
|
|
213
|
+
required: true,
|
|
214
|
+
description: 'Destination path on Nextcloud (including filename)',
|
|
215
|
+
displayOptions: {
|
|
216
|
+
show: {
|
|
217
|
+
resource: ['file'],
|
|
218
|
+
operation: ['upload'],
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
displayName: 'Binary Property Name',
|
|
224
|
+
name: 'binaryPropertyName',
|
|
225
|
+
type: 'string',
|
|
226
|
+
default: 'data',
|
|
227
|
+
description: 'Name of the binary property that contains the file data',
|
|
228
|
+
displayOptions: {
|
|
229
|
+
show: {
|
|
230
|
+
resource: ['file'],
|
|
231
|
+
operation: ['upload'],
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
// ------------------------------------------------------------------
|
|
236
|
+
// FILE: Delete + Folder: Delete
|
|
237
|
+
// ------------------------------------------------------------------
|
|
238
|
+
{
|
|
239
|
+
displayName: 'Path',
|
|
240
|
+
name: 'path',
|
|
241
|
+
type: 'string',
|
|
242
|
+
default: '',
|
|
243
|
+
placeholder: '/Documents/old-file.txt',
|
|
244
|
+
required: true,
|
|
245
|
+
description: 'Path of the file or folder to delete',
|
|
246
|
+
displayOptions: {
|
|
247
|
+
show: {
|
|
248
|
+
operation: ['delete'],
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
// ------------------------------------------------------------------
|
|
253
|
+
// FILE: Move / Copy
|
|
254
|
+
// ------------------------------------------------------------------
|
|
255
|
+
{
|
|
256
|
+
displayName: 'Source Path',
|
|
257
|
+
name: 'path',
|
|
258
|
+
type: 'string',
|
|
259
|
+
default: '',
|
|
260
|
+
placeholder: '/Documents/file.txt',
|
|
261
|
+
required: true,
|
|
262
|
+
description: 'Current path of the file',
|
|
263
|
+
displayOptions: {
|
|
264
|
+
show: {
|
|
265
|
+
resource: ['file'],
|
|
266
|
+
operation: ['move', 'copy'],
|
|
267
|
+
},
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
displayName: 'Destination Path',
|
|
272
|
+
name: 'destinationPath',
|
|
273
|
+
type: 'string',
|
|
274
|
+
default: '',
|
|
275
|
+
placeholder: '/Archive/file.txt',
|
|
276
|
+
required: true,
|
|
277
|
+
description: 'New path / name for the file',
|
|
278
|
+
displayOptions: {
|
|
279
|
+
show: {
|
|
280
|
+
resource: ['file'],
|
|
281
|
+
operation: ['move', 'copy'],
|
|
282
|
+
},
|
|
283
|
+
},
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
displayName: 'Overwrite',
|
|
287
|
+
name: 'overwrite',
|
|
288
|
+
type: 'boolean',
|
|
289
|
+
default: false,
|
|
290
|
+
description: 'Whether to overwrite the destination if it exists',
|
|
291
|
+
displayOptions: {
|
|
292
|
+
show: {
|
|
293
|
+
resource: ['file'],
|
|
294
|
+
operation: ['move', 'copy'],
|
|
295
|
+
},
|
|
296
|
+
},
|
|
297
|
+
},
|
|
298
|
+
// ------------------------------------------------------------------
|
|
299
|
+
// FOLDER: Create
|
|
300
|
+
// ------------------------------------------------------------------
|
|
301
|
+
{
|
|
302
|
+
displayName: 'Folder Path',
|
|
303
|
+
name: 'path',
|
|
304
|
+
type: 'string',
|
|
305
|
+
default: '',
|
|
306
|
+
placeholder: '/Documents/NewFolder',
|
|
307
|
+
required: true,
|
|
308
|
+
description: 'Path of the folder to create',
|
|
309
|
+
displayOptions: {
|
|
310
|
+
show: {
|
|
311
|
+
resource: ['folder'],
|
|
312
|
+
operation: ['create'],
|
|
313
|
+
},
|
|
314
|
+
},
|
|
315
|
+
},
|
|
316
|
+
// ------------------------------------------------------------------
|
|
317
|
+
// SHARE
|
|
318
|
+
// ------------------------------------------------------------------
|
|
319
|
+
{
|
|
320
|
+
displayName: 'Path',
|
|
321
|
+
name: 'path',
|
|
322
|
+
type: 'string',
|
|
323
|
+
default: '',
|
|
324
|
+
placeholder: '/Documents/report.xlsx',
|
|
325
|
+
required: true,
|
|
326
|
+
description: 'Path of the file or folder to share',
|
|
327
|
+
displayOptions: {
|
|
328
|
+
show: {
|
|
329
|
+
resource: ['share'],
|
|
330
|
+
operation: ['create'],
|
|
331
|
+
},
|
|
332
|
+
},
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
displayName: 'Share Type',
|
|
336
|
+
name: 'shareType',
|
|
337
|
+
type: 'options',
|
|
338
|
+
options: [
|
|
339
|
+
{ name: 'Public Link', value: 3 },
|
|
340
|
+
{ name: 'User', value: 0 },
|
|
341
|
+
{ name: 'Group', value: 1 },
|
|
342
|
+
],
|
|
343
|
+
default: 3,
|
|
344
|
+
displayOptions: {
|
|
345
|
+
show: {
|
|
346
|
+
resource: ['share'],
|
|
347
|
+
operation: ['create'],
|
|
348
|
+
},
|
|
349
|
+
},
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
displayName: 'Share With',
|
|
353
|
+
name: 'shareWith',
|
|
354
|
+
type: 'string',
|
|
355
|
+
default: '',
|
|
356
|
+
description: 'Username or group name to share with (required for User/Group share type)',
|
|
357
|
+
displayOptions: {
|
|
358
|
+
show: {
|
|
359
|
+
resource: ['share'],
|
|
360
|
+
operation: ['create'],
|
|
361
|
+
},
|
|
362
|
+
},
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
displayName: 'Permissions',
|
|
366
|
+
name: 'permissions',
|
|
367
|
+
type: 'options',
|
|
368
|
+
options: [
|
|
369
|
+
{ name: 'Read Only (1)', value: 1 },
|
|
370
|
+
{ name: 'Read + Update (3)', value: 3 },
|
|
371
|
+
{ name: 'Read + Create (5)', value: 5 },
|
|
372
|
+
{ name: 'Read + Update + Create (7)', value: 7 },
|
|
373
|
+
{ name: 'All (31)', value: 31 },
|
|
374
|
+
],
|
|
375
|
+
default: 1,
|
|
376
|
+
displayOptions: {
|
|
377
|
+
show: {
|
|
378
|
+
resource: ['share'],
|
|
379
|
+
operation: ['create'],
|
|
380
|
+
},
|
|
381
|
+
},
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
displayName: 'Password',
|
|
385
|
+
name: 'sharePassword',
|
|
386
|
+
type: 'string',
|
|
387
|
+
typeOptions: { password: true },
|
|
388
|
+
default: '',
|
|
389
|
+
description: 'Optional password for the share',
|
|
390
|
+
displayOptions: {
|
|
391
|
+
show: {
|
|
392
|
+
resource: ['share'],
|
|
393
|
+
operation: ['create'],
|
|
394
|
+
},
|
|
395
|
+
},
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
displayName: 'Expiry Date',
|
|
399
|
+
name: 'expireDate',
|
|
400
|
+
type: 'string',
|
|
401
|
+
default: '',
|
|
402
|
+
placeholder: 'YYYY-MM-DD',
|
|
403
|
+
description: 'Optional expiry date for the share (format: YYYY-MM-DD)',
|
|
404
|
+
displayOptions: {
|
|
405
|
+
show: {
|
|
406
|
+
resource: ['share'],
|
|
407
|
+
operation: ['create'],
|
|
408
|
+
},
|
|
409
|
+
},
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
displayName: 'Share ID',
|
|
413
|
+
name: 'shareId',
|
|
414
|
+
type: 'string',
|
|
415
|
+
default: '',
|
|
416
|
+
required: true,
|
|
417
|
+
description: 'ID of the share to delete',
|
|
418
|
+
displayOptions: {
|
|
419
|
+
show: {
|
|
420
|
+
resource: ['share'],
|
|
421
|
+
operation: ['delete'],
|
|
422
|
+
},
|
|
423
|
+
},
|
|
424
|
+
},
|
|
425
|
+
],
|
|
426
|
+
};
|
|
427
|
+
this.methods = {
|
|
428
|
+
loadOptions: {
|
|
429
|
+
async getFolderFiles() {
|
|
430
|
+
const creds = await (0, GenericFunctions_1.getCredentials)(this);
|
|
431
|
+
const entries = await (0, GenericFunctions_1.listDirectory)(this, creds, '/', '1');
|
|
432
|
+
const options = [{ name: '/ (root)', value: '/' }];
|
|
433
|
+
for (const e of entries) {
|
|
434
|
+
if (e.isDirectory) {
|
|
435
|
+
options.push({ name: e.name, value: `/${e.name}` });
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
return options;
|
|
439
|
+
},
|
|
440
|
+
},
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
async execute() {
|
|
444
|
+
var _a, _b, _c;
|
|
445
|
+
const items = this.getInputData();
|
|
446
|
+
const returnData = [];
|
|
447
|
+
const resource = this.getNodeParameter('resource', 0);
|
|
448
|
+
const operation = this.getNodeParameter('operation', 0);
|
|
449
|
+
const creds = await (0, GenericFunctions_1.getCredentials)(this);
|
|
450
|
+
for (let i = 0; i < items.length; i++) {
|
|
451
|
+
try {
|
|
452
|
+
// ----------------------------------------------------------------
|
|
453
|
+
// FILE operations
|
|
454
|
+
// ----------------------------------------------------------------
|
|
455
|
+
if (resource === 'file' || resource === 'folder') {
|
|
456
|
+
if (operation === 'list') {
|
|
457
|
+
const path = this.getNodeParameter('path', i, '/');
|
|
458
|
+
const entries = await (0, GenericFunctions_1.listDirectory)(this, creds, path, '1');
|
|
459
|
+
for (const entry of entries) {
|
|
460
|
+
const rel = entry.href.replace(`/remote.php/dav/files/${encodeURIComponent(creds.user)}/`, '/');
|
|
461
|
+
if (rel === path || rel === path + '/')
|
|
462
|
+
continue; // skip the folder itself
|
|
463
|
+
returnData.push({
|
|
464
|
+
json: {
|
|
465
|
+
name: entry.name,
|
|
466
|
+
path: rel,
|
|
467
|
+
isDirectory: entry.isDirectory,
|
|
468
|
+
size: entry.size,
|
|
469
|
+
contentType: entry.contentType,
|
|
470
|
+
lastModified: entry.lastModified,
|
|
471
|
+
fileId: entry.fileId,
|
|
472
|
+
},
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
else if (operation === 'download') {
|
|
477
|
+
const path = this.getNodeParameter('path', i);
|
|
478
|
+
const binaryProp = this.getNodeParameter('binaryPropertyName', i, 'data');
|
|
479
|
+
const buffer = await (0, GenericFunctions_1.downloadFile)(this, creds, path);
|
|
480
|
+
const fileName = (_a = path.split('/').pop()) !== null && _a !== void 0 ? _a : 'file';
|
|
481
|
+
const binaryData = await this.helpers.prepareBinaryData(buffer, fileName);
|
|
482
|
+
returnData.push({ json: { path, fileName }, binary: { [binaryProp]: binaryData } });
|
|
483
|
+
}
|
|
484
|
+
else if (operation === 'upload') {
|
|
485
|
+
const path = this.getNodeParameter('path', i);
|
|
486
|
+
const binaryProp = this.getNodeParameter('binaryPropertyName', i, 'data');
|
|
487
|
+
const binaryData = this.helpers.assertBinaryData(i, binaryProp);
|
|
488
|
+
const buffer = await this.helpers.getBinaryDataBuffer(i, binaryProp);
|
|
489
|
+
await (0, GenericFunctions_1.uploadFile)(this, creds, path, buffer, binaryData.mimeType);
|
|
490
|
+
returnData.push({ json: { success: true, path, size: buffer.length } });
|
|
491
|
+
}
|
|
492
|
+
else if (operation === 'delete') {
|
|
493
|
+
const path = this.getNodeParameter('path', i);
|
|
494
|
+
const url = (0, GenericFunctions_1.davUrl)(creds.serverUrl, creds.user, path);
|
|
495
|
+
const res = await (0, GenericFunctions_1.webdavRequest)(this, 'DELETE', url, creds);
|
|
496
|
+
if (res.statusCode >= 400) {
|
|
497
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: `Delete failed: ${res.statusCode}` });
|
|
498
|
+
}
|
|
499
|
+
returnData.push({ json: { success: true, path } });
|
|
500
|
+
}
|
|
501
|
+
else if (operation === 'move' || operation === 'copy') {
|
|
502
|
+
const path = this.getNodeParameter('path', i);
|
|
503
|
+
const dest = this.getNodeParameter('destinationPath', i);
|
|
504
|
+
const overwrite = this.getNodeParameter('overwrite', i, false);
|
|
505
|
+
const method = operation === 'move' ? 'MOVE' : 'COPY';
|
|
506
|
+
const sourceUrl = (0, GenericFunctions_1.davUrl)(creds.serverUrl, creds.user, path);
|
|
507
|
+
const destUrl = (0, GenericFunctions_1.davUrl)(creds.serverUrl, creds.user, dest);
|
|
508
|
+
const res = await (0, GenericFunctions_1.webdavRequest)(this, method, sourceUrl, creds, {
|
|
509
|
+
Destination: destUrl,
|
|
510
|
+
Overwrite: overwrite ? 'T' : 'F',
|
|
511
|
+
});
|
|
512
|
+
if (res.statusCode >= 400) {
|
|
513
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), {
|
|
514
|
+
message: `${method} failed: ${res.statusCode}`,
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
returnData.push({ json: { success: true, from: path, to: dest } });
|
|
518
|
+
}
|
|
519
|
+
else if (operation === 'create' && resource === 'folder') {
|
|
520
|
+
const path = this.getNodeParameter('path', i);
|
|
521
|
+
const url = (0, GenericFunctions_1.davUrl)(creds.serverUrl, creds.user, path);
|
|
522
|
+
const res = await (0, GenericFunctions_1.webdavRequest)(this, 'MKCOL', url, creds);
|
|
523
|
+
if (res.statusCode >= 400 && res.statusCode !== 405) {
|
|
524
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), {
|
|
525
|
+
message: `Create folder failed: ${res.statusCode}`,
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
returnData.push({ json: { success: true, path } });
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
// ----------------------------------------------------------------
|
|
532
|
+
// SHARE operations (OCS Share API)
|
|
533
|
+
// ----------------------------------------------------------------
|
|
534
|
+
if (resource === 'share') {
|
|
535
|
+
const baseOcs = `${creds.serverUrl}/ocs/v2.php/apps/files_sharing/api/v1/shares`;
|
|
536
|
+
const ocsHeaders = {
|
|
537
|
+
Authorization: makeAuthHeader(creds.user, creds.password),
|
|
538
|
+
'OCS-APIREQUEST': 'true',
|
|
539
|
+
Accept: 'application/json',
|
|
540
|
+
};
|
|
541
|
+
if (operation === 'create') {
|
|
542
|
+
const path = this.getNodeParameter('path', i);
|
|
543
|
+
const shareType = this.getNodeParameter('shareType', i, 3);
|
|
544
|
+
const shareWith = this.getNodeParameter('shareWith', i, '');
|
|
545
|
+
const permissions = this.getNodeParameter('permissions', i, 1);
|
|
546
|
+
const sharePassword = this.getNodeParameter('sharePassword', i, '');
|
|
547
|
+
const expireDate = this.getNodeParameter('expireDate', i, '');
|
|
548
|
+
const body = { path, shareType, permissions };
|
|
549
|
+
if (shareWith)
|
|
550
|
+
body.shareWith = shareWith;
|
|
551
|
+
if (sharePassword)
|
|
552
|
+
body.password = sharePassword;
|
|
553
|
+
if (expireDate)
|
|
554
|
+
body.expireDate = expireDate;
|
|
555
|
+
const res = await this.helpers.httpRequest({
|
|
556
|
+
method: 'POST',
|
|
557
|
+
url: baseOcs,
|
|
558
|
+
headers: { ...ocsHeaders, 'Content-Type': 'application/x-www-form-urlencoded' },
|
|
559
|
+
body: new URLSearchParams(Object.fromEntries(Object.entries(body).map(([k, v]) => [k, String(v)]))).toString(),
|
|
560
|
+
returnFullResponse: true,
|
|
561
|
+
ignoreHttpStatusErrors: true,
|
|
562
|
+
});
|
|
563
|
+
const data = (_b = res.body) === null || _b === void 0 ? void 0 : _b.ocs;
|
|
564
|
+
returnData.push({ json: data !== null && data !== void 0 ? data : res.body });
|
|
565
|
+
}
|
|
566
|
+
else if (operation === 'delete') {
|
|
567
|
+
const shareId = this.getNodeParameter('shareId', i);
|
|
568
|
+
await this.helpers.httpRequest({
|
|
569
|
+
method: 'DELETE',
|
|
570
|
+
url: `${baseOcs}/${shareId}`,
|
|
571
|
+
headers: ocsHeaders,
|
|
572
|
+
});
|
|
573
|
+
returnData.push({ json: { success: true, shareId } });
|
|
574
|
+
}
|
|
575
|
+
else if (operation === 'getAll') {
|
|
576
|
+
const res = await this.helpers.httpRequest({
|
|
577
|
+
method: 'GET',
|
|
578
|
+
url: baseOcs,
|
|
579
|
+
headers: ocsHeaders,
|
|
580
|
+
});
|
|
581
|
+
const shares = res === null || res === void 0 ? void 0 : res.ocs;
|
|
582
|
+
const list = (_c = shares === null || shares === void 0 ? void 0 : shares.data) !== null && _c !== void 0 ? _c : [];
|
|
583
|
+
for (const s of list) {
|
|
584
|
+
returnData.push({ json: s });
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
catch (error) {
|
|
590
|
+
if (this.continueOnFail()) {
|
|
591
|
+
returnData.push({ json: { error: error.message }, pairedItem: i });
|
|
592
|
+
continue;
|
|
593
|
+
}
|
|
594
|
+
throw error;
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
return [returnData];
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
exports.NextCloud = NextCloud;
|
|
601
|
+
//# sourceMappingURL=NextCloud.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NextCloud.node.js","sourceRoot":"","sources":["../../../nodes/NextCloud/NextCloud.node.ts"],"names":[],"mappings":";;;AAAA,+CASsB;AAEtB,iEAOoC;AAEpC,SAAS,cAAc,CAAC,IAAY,EAAE,QAAgB;IACrD,OAAO,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACzE,CAAC;AAED,MAAa,SAAS;IAAtB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,WAAW;YAC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cx="30" cy="55" r="14" fill="#fff"/>
|
|
5
|
+
<circle cx="50" cy="42" r="20" fill="#fff"/>
|
|
6
|
+
<circle cx="70" cy="55" r="14" fill="#fff"/>
|
|
7
|
+
<!-- inner overlap cutouts to create the cloud shape -->
|
|
8
|
+
<circle cx="50" cy="42" r="14" fill="#0082c9"/>
|
|
9
|
+
<circle cx="30" cy="55" r="8" fill="#0082c9"/>
|
|
10
|
+
<circle cx="70" cy="55" r="8" fill="#0082c9"/>
|
|
11
|
+
<!-- bottom bar -->
|
|
12
|
+
<rect x="16" y="55" width="68" height="14" fill="#fff" rx="7"/>
|
|
13
|
+
</svg>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IExecuteFunctions, ILoadOptionsFunctions, INodeExecutionData, INodePropertyOptions, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
export declare class NextCloudSpreadsheet implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
methods: {
|
|
5
|
+
loadOptions: {
|
|
6
|
+
getSpreadsheetFiles(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
7
|
+
getSheetsForFile(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
8
|
+
getTablesForFile(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
12
|
+
}
|