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:
@@ -232,6 +232,19 @@ export class KDrive implements INodeType {
|
|||||||
},
|
},
|
||||||
description: 'The path to the directory (use "root" for root, e.g., "documents/project")',
|
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',
|
displayName: 'Upload Path',
|
||||||
name: 'uploadPath',
|
name: 'uploadPath',
|
||||||
@@ -411,7 +424,7 @@ export class KDrive implements INodeType {
|
|||||||
const response = await kdriveApiRequest.call(this, 'GET', endpoint, {}, credentials);
|
const response = await kdriveApiRequest.call(this, 'GET', endpoint, {}, credentials);
|
||||||
returnData.push({ json: response });
|
returnData.push({ json: response });
|
||||||
} else if (operation === 'listFilesByPath') {
|
} 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 parentDirectoryId = await resolvePathToId.call(this, directoryPath, driveId, credentials);
|
||||||
|
|
||||||
const endpoint = parentDirectoryId === 'root'
|
const endpoint = parentDirectoryId === 'root'
|
||||||
|
|||||||
Reference in New Issue
Block a user