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

Method getDevicesRootFolder

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

Source from the content-addressed store, hash-verified

274 }
275
276 private async getDevicesRootFolder(): Promise<NodeEntity> {
277 for await (const device of this.driveSdk.iterateDevices()) {
278 const name = device.name.ok ? device.name.value : device.name.error.name;
279 if (name === this.sectionRootNodeName) {
280 const [maybeMissingNode] = await Array.fromAsync(this.sdk.iterateNodes([device.rootFolderUid]));
281 if ('missingUid' in maybeMissingNode) {
282 throw new ValidationError(`Node not found`);
283 }
284 return maybeMissingNode;
285 }
286 }
287 throw new ValidationError('Device not found');
288 }
289
290 private async getNodeByPath(parentNode: NodeEntity, pathString: string) {
291 let node = parentNode;

Callers 1

getNodeInternalMethod · 0.95

Calls 2

iterateNodesMethod · 0.65
iterateDevicesMethod · 0.45

Tested by

no test coverage detected