MCPcopy Create free account
hub / github.com/ProtonDriveApps/sdk / getPaths

Method getPaths

cli/src/cli/paths.ts:66–87  ·  view source on GitHub ↗
(pathStrings: string[], supportedTypes?: PathType[], unsupportedTypeMessage?: string)

Source from the content-addressed store, hash-verified

64 }
65
66 getPaths(pathStrings: string[], supportedTypes?: PathType[], unsupportedTypeMessage?: string): Path[] {
67 let pathType: PathType | undefined;
68
69 if (pathStrings.length === 0) {
70 throw new ValidationError('At least one path is required');
71 }
72
73 const paths = [];
74 for (const pathString of pathStrings) {
75 const path = this.getPath(pathString, supportedTypes, unsupportedTypeMessage);
76
77 if (pathType === undefined) {
78 pathType = path.type;
79 } else if (pathType !== path.type) {
80 throw new ValidationError(`Operation across Drive and Photos is not supported`);
81 }
82
83 paths.push(path);
84 }
85
86 return paths;
87 }
88
89 async getNode(pathString: string, supportedTypes?: PathType[]): Promise<NodeEntity> {
90 const path = this.getPath(pathString, supportedTypes);

Callers 4

getNodesMethod · 0.95
actionMethod · 0.80
actionMethod · 0.80
actionMethod · 0.80

Calls 1

getPathMethod · 0.95

Tested by

no test coverage detected