Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions lib/storage/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -178,7 +178,7 @@ class Client extends CryptoConsumer {
* @returns {Promise<Record>}
*/
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 = []
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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: {
Expand All @@ -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',
}
Expand Down Expand Up @@ -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: {
Expand All @@ -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',
}
Expand Down Expand Up @@ -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: {
Expand All @@ -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',
}
Expand Down