()
| 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; |
no test coverage detected