diff --git a/package.json b/package.json index a992ff46..1b86162e 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "node": ">=16.0.0 <17.0.0" }, "dependencies": { - "@akord/crypto": "0.7.1", + "@akord/crypto": "0.7.2", "@akord/ts-cacheable": "1.0.11", "amazon-cognito-identity-js": "^5.2.8", "axios": "^0.24.0", diff --git a/src/types/node.ts b/src/types/node.ts index 1046d1f2..aaf22629 100644 --- a/src/types/node.ts +++ b/src/types/node.ts @@ -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 { @@ -181,3 +187,8 @@ export class NodeFactory { return new nodeLike(data, keys); } } + +export enum StorageType { + S3 = "s3:", + ARWEAVE = "arweave:" +}