From 5a347b316408c53ed3f5947fed9c1fff41c0c13c Mon Sep 17 00:00:00 2001 From: Ali Mihandoost Date: Sun, 7 May 2023 18:06:21 +0330 Subject: [PATCH] feat(storage-client): add touch method Co-authored-by: Mohammad Honarvar --- core/storage-client/src/storage-client.ts | 29 ++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/core/storage-client/src/storage-client.ts b/core/storage-client/src/storage-client.ts index 24e2bf1e6..0bd89e4da 100644 --- a/core/storage-client/src/storage-client.ts +++ b/core/storage-client/src/storage-client.ts @@ -181,7 +181,7 @@ export class AlwatrStorageClient { - this._logger.logMethodArgs?.('set', {documentId: documentObject.id}); + this._logger.logMethodArgs?.('set', {storage, documentId: documentObject.id}); if (storage == null) throw new Error('storage_not_defined'); const responseJson = await serviceRequest>({ @@ -201,6 +201,29 @@ export class AlwatrStorageClient { + this._logger.logMethodArgs?.('touch', {storage}); + if (storage == null) throw new Error('storage_not_defined'); + + await serviceRequest({ + ...this.fetchOption, + method: 'GET', + url: this.fetchOption.url + 'touch', + queryParameters: { + storage, + }, + }); + } + /** * Delete a document object from the storage. * @@ -236,7 +259,7 @@ export class AlwatrStorageClient( name: string | undefined = this.config.name, ): Promise> { - this._logger.logMethod?.('getStorage'); + this._logger.logMethodArgs?.('getStorage', {name}); if (name == null) throw new Error('storage_not_defined'); const responseJson = (await serviceRequest({ @@ -269,7 +292,7 @@ export class AlwatrStorageClient> { - this._logger.logMethod?.('keys'); + this._logger.logMethodArgs?.('keys', {storage}); if (storage == null) throw new Error('storage_not_defined'); const responseJson = await serviceRequest({