mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-22 12:19:09 +00:00
fix(next-cloud-node): Fix issue with credential verification and sharing file
This commit is contained in:
@@ -21,8 +21,7 @@ export async function nextCloudApiRequest(
|
|||||||
headers?: object,
|
headers?: object,
|
||||||
encoding?: null | undefined,
|
encoding?: null | undefined,
|
||||||
query?: object,
|
query?: object,
|
||||||
// tslint:disable-next-line:no-any
|
) {
|
||||||
): Promise<any> {
|
|
||||||
const resource = this.getNodeParameter('resource', 0);
|
const resource = this.getNodeParameter('resource', 0);
|
||||||
const operation = this.getNodeParameter('operation', 0);
|
const operation = this.getNodeParameter('operation', 0);
|
||||||
const authenticationMethod = this.getNodeParameter('authentication', 0);
|
const authenticationMethod = this.getNodeParameter('authentication', 0);
|
||||||
@@ -49,10 +48,15 @@ export async function nextCloudApiRequest(
|
|||||||
}
|
}
|
||||||
|
|
||||||
options.uri = `${credentials.webDavUrl}/${encodeURI(endpoint)}`;
|
options.uri = `${credentials.webDavUrl}/${encodeURI(endpoint)}`;
|
||||||
|
|
||||||
if (resource === 'user' && operation === 'create') {
|
if (resource === 'user' && operation === 'create') {
|
||||||
options.uri = options.uri.replace('/remote.php/webdav', '');
|
options.uri = options.uri.replace('/remote.php/webdav', '');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (resource === 'file' && operation === 'share') {
|
||||||
|
options.uri = options.uri.replace('/remote.php/webdav', '');
|
||||||
|
}
|
||||||
|
|
||||||
const credentialType =
|
const credentialType =
|
||||||
authenticationMethod === 'accessToken' ? 'nextCloudApi' : 'nextCloudOAuth2Api';
|
authenticationMethod === 'accessToken' ? 'nextCloudApi' : 'nextCloudOAuth2Api';
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { IExecuteFunctions } from 'n8n-core';
|
import { IExecuteFunctions } from 'n8n-core';
|
||||||
import { NodeApiError } from 'n8n-workflow';
|
import { IBinaryKeyData, NodeApiError } from 'n8n-workflow';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
IDataObject,
|
IDataObject,
|
||||||
@@ -1139,7 +1139,7 @@ export class NextCloud implements INodeType {
|
|||||||
// Create a shallow copy of the binary data so that the old
|
// Create a shallow copy of the binary data so that the old
|
||||||
// data references which do not get changed still stay behind
|
// data references which do not get changed still stay behind
|
||||||
// but the incoming data does not get changed.
|
// but the incoming data does not get changed.
|
||||||
Object.assign(newItem.binary, items[i].binary);
|
Object.assign(newItem.binary as IBinaryKeyData, items[i].binary);
|
||||||
}
|
}
|
||||||
|
|
||||||
items[i] = newItem;
|
items[i] = newItem;
|
||||||
|
|||||||
Reference in New Issue
Block a user