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

Method getNodeInternal

cli/src/cli/paths.ts:209–236  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

207 }
208
209 private async getNodeInternal(): Promise<NodeEntity> {
210 if (this.type === PathType.MyFiles) {
211 const rootNode = await this.driveSdk.getMyFilesRootFolder();
212 return this.getNodeByPath(rootNode, this.sectionPath);
213 }
214 if (this.type === PathType.SharedWithMe || this.type === PathType.PhotosSharedWithMe) {
215 const rootNode = await this.getSharedWithMeRootFolder();
216 return this.getNodeByPath(rootNode, this.sectionPathWithoutRoot);
217 }
218 if (this.type === PathType.Trash || this.type === PathType.PhotosTrash) {
219 const parts = splitPathSegments(this.sectionPath);
220 if (parts.length > 1) {
221 throw new ValidationError('Browsing trashed folders is not supported');
222 }
223 return this.getTrashedNode(parts[0]);
224 }
225 if (this.type === PathType.Devices) {
226 const rootNode = await this.getDevicesRootFolder();
227 return this.getNodeByPath(rootNode, this.sectionPathWithoutRoot);
228 }
229 if (this.type === PathType.Photos) {
230 return this.getPhotoNodeByPath(this.sectionPath);
231 }
232 if (this.type === PathType.Albums) {
233 return this.getAlbumNodeByPath(this.sectionPath);
234 }
235 throw new ValidationError('Not implemented');
236 }
237
238 async getChild(name: string) {
239 const node = await this.getNode();

Callers 1

getNodeMethod · 0.95

Calls 8

getNodeByPathMethod · 0.95
getTrashedNodeMethod · 0.95
getDevicesRootFolderMethod · 0.95
getPhotoNodeByPathMethod · 0.95
getAlbumNodeByPathMethod · 0.95
splitPathSegmentsFunction · 0.85
getMyFilesRootFolderMethod · 0.80

Tested by

no test coverage detected