feat: add path argument to ListFilesByPath operation

- Added listFilesByPathPath parameter specifically for listFilesByPath operation
- Updated implementation to use the new parameter instead of directoryPath
- Maintains backward compatibility and follows existing patterns
This commit is contained in:
2025-12-23 14:59:45 +01:00
parent bdb185443c
commit 72e78b003e

View File

@@ -232,6 +232,19 @@ export class KDrive implements INodeType {
},
description: 'The path to the directory (use "root" for root, e.g., "documents/project")',
},
{
displayName: 'Directory Path',
name: 'listFilesByPathPath',
type: 'string',
default: 'root',
displayOptions: {
show: {
resource: ['file'],
operation: ['listFilesByPath'],
},
},
description: 'The path to the directory to list files from (use "root" for root, e.g., "documents/project")',
},
{
displayName: 'Upload Path',
name: 'uploadPath',
@@ -411,7 +424,7 @@ export class KDrive implements INodeType {
const response = await kdriveApiRequest.call(this, 'GET', endpoint, {}, credentials);
returnData.push({ json: response });
} else if (operation === 'listFilesByPath') {
const directoryPath = this.getNodeParameter('directoryPath', i) as string;
const directoryPath = this.getNodeParameter('listFilesByPathPath', i) as string;
const parentDirectoryId = await resolvePathToId.call(this, directoryPath, driveId, credentials);
const endpoint = parentDirectoryId === 'root'