diff --git a/lib/storage/client.js b/lib/storage/client.js index 6b6acbe..d435a63 100644 --- a/lib/storage/client.js +++ b/lib/storage/client.js @@ -90,7 +90,7 @@ class Client extends CryptoConsumer { */ async clientInfo(clientId) { let request = await this.authenticator.tokenFetch( - this.config.apiUrl + '/v1/storage/clients/' + clientId, + this.config.apiUrl + '/v2/storage/clients/' + clientId, { method: 'GET', headers: { @@ -178,7 +178,7 @@ class Client extends CryptoConsumer { * @returns {Promise} */ async readRecord(recordId, fields = null) { - let path = this.config.apiUrl + '/v1/storage/records/' + recordId + let path = this.config.apiUrl + '/v2/storage/records/' + recordId if (fields !== null) { let mapped = [] @@ -238,7 +238,7 @@ class Client extends CryptoConsumer { ) } let request = await this.authenticator.tokenFetch( - this.config.apiUrl + '/v1/storage/records', + this.config.apiUrl + '/v2/storage/records', { method: 'POST', headers: { @@ -273,7 +273,7 @@ class Client extends CryptoConsumer { return this.authenticator .tokenFetch( this.config.apiUrl + - '/v1/storage/records/safe/' + + '/v2/storage/records/safe/' + recordId + '/' + version, @@ -307,7 +307,7 @@ class Client extends CryptoConsumer { return this.authenticator .tokenFetch( this.config.apiUrl + - '/v1/storage/records/safe/edit/' + + '/v2/storage/records/safe/edit/' + recordId + '/' + version, @@ -354,7 +354,7 @@ class Client extends CryptoConsumer { return this.authenticator .tokenFetch( this.config.apiUrl + - '/v1/storage/files/record/safe/' + + '/v2/storage/files/record/safe/' + recordId + '/' + version, @@ -426,7 +426,7 @@ class Client extends CryptoConsumer { */ async deleteRecord(recordId, version) { const response = await this.authenticator.tokenFetch( - `${this.config.apiUrl}/v1/storage/records/safe/${recordId}/${version}`, + `${this.config.apiUrl}/v2/storage/records/safe/${recordId}/${version}`, { method: 'DELETE', headers: { @@ -486,7 +486,7 @@ class Client extends CryptoConsumer { record = new Record(meta, new RecordData(), signature) } const pendingResponse = await this.authenticator.tokenFetch( - `${this.config.apiUrl}/v1/storage/files/${recordId}/${version}`, + `${this.config.apiUrl}/v2/storage/files/${recordId}/${version}`, { method: 'PUT', headers: { @@ -500,7 +500,7 @@ class Client extends CryptoConsumer { await ops.upload(pendingFile.file_url, uploadFile, checksum, size) tempFile.remove() const finalizeResponse = await this.authenticator.tokenFetch( - `${this.config.apiUrl}/v1/storage/files/${pendingFile.id}`, + `${this.config.apiUrl}/v2/storage/files/${pendingFile.id}`, { method: 'PATCH', } @@ -551,7 +551,7 @@ class Client extends CryptoConsumer { record = new Record(meta, new RecordData(), signature) } const pendingResponse = await this.authenticator.tokenFetch( - `${this.config.apiUrl}/v1/storage/files/edit/${recordId}/${version}`, + `${this.config.apiUrl}/v2/storage/files/edit/${recordId}/${version}`, { method: 'PUT', headers: { @@ -565,7 +565,7 @@ class Client extends CryptoConsumer { await ops.upload(pendingFile.file_url, uploadFile, checksum, size) tempFile.remove() const finalizeResponse = await this.authenticator.tokenFetch( - `${this.config.apiUrl}/v1/storage/files/edit/${recordId}/${version}/${pendingFile.id}`, + `${this.config.apiUrl}/v2/storage/files/edit/${recordId}/${version}/${pendingFile.id}`, { method: 'PATCH', } @@ -639,7 +639,7 @@ class Client extends CryptoConsumer { record = new Record(meta, new RecordData(), signature) } const pendingResponse = await this.authenticator.tokenFetch( - `${this.config.apiUrl}/v1/storage/files`, + `${this.config.apiUrl}/v2/storage/files`, { method: 'POST', headers: { @@ -653,7 +653,7 @@ class Client extends CryptoConsumer { await ops.upload(pendingFile.file_url, uploadFile, checksum, size) tempFile.remove() const finalizeResponse = await this.authenticator.tokenFetch( - `${this.config.apiUrl}/v1/storage/files/${pendingFile.id}`, + `${this.config.apiUrl}/v2/storage/files/${pendingFile.id}`, { method: 'PATCH', }