Skip to content

Commit

Permalink
feat: get file uri by storage type
Browse files Browse the repository at this point in the history
  • Loading branch information
jarrvis committed Jan 18, 2023
1 parent 6e000b9 commit cf65a5e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/types/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ export class FileVersion extends Encryptable {
this.name = name;
this.status = status;
}

getUri(type: StorageType) {
return this.resourceUri
?.find(uri => uri.startsWith(type))
?.replace(type, "");
}
}

export class MemoVersion extends Encryptable {
Expand Down Expand Up @@ -181,3 +187,8 @@ export class NodeFactory {
return new nodeLike(data, keys);
}
}

export enum StorageType {
S3 = "s3:",
ARWEAVE = "arweave:"
}

0 comments on commit cf65a5e

Please sign in to comment.