| 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); |