diff --git a/packages/client-sdk-nodejs/package.json b/packages/client-sdk-nodejs/package.json index f1eea3c27..cea65a69f 100644 --- a/packages/client-sdk-nodejs/package.json +++ b/packages/client-sdk-nodejs/package.json @@ -18,7 +18,6 @@ "integration-test-auth": "jest auth-client.test.ts --maxWorkers 1", "unit-test": "jest unit", "integration-test-leaderboard": "jest leaderboard --maxWorkers 1", - "integration-test-store": "jest storage.test.ts --maxWorkers 1", "integration-test": "jest integration --testPathIgnorePatterns \"auth-client.test.ts|leaderboard.test.ts\" --maxWorkers 1", "build-deps": "cd ../core && npm run build && cd - && cd ../common-integration-tests && npm run build && cd -", "build-and-run-tests": "npm run build-deps && jest --testPathIgnorePatterns auth-client.test.ts --maxWorkers 1", diff --git a/packages/client-sdk-nodejs/src/internal/storage-data-client.ts b/packages/client-sdk-nodejs/src/internal/storage-data-client.ts index 6ed7235e8..931d3acbe 100644 --- a/packages/client-sdk-nodejs/src/internal/storage-data-client.ts +++ b/packages/client-sdk-nodejs/src/internal/storage-data-client.ts @@ -7,6 +7,7 @@ import { StoragePut, StorageDelete, UnknownError, + SdkError, } from '@gomomento/sdk-core'; import {validateStoreName} from '@gomomento/sdk-core/dist/src/internal/utils'; import {store} from '@gomomento/generated-types/dist/store'; @@ -210,7 +211,7 @@ export class StorageDataClient implements IStorageDataClient { } else { this.cacheServiceErrorMapper.resolveOrRejectError({ err: err, - errorResponseFactoryFn: e => new StorageGet.Error(e), + errorResponseFactoryFn: (e: SdkError) => new StorageGet.Error(e), resolveFn: resolve, rejectFn: reject, }); @@ -234,7 +235,7 @@ export class StorageDataClient implements IStorageDataClient { ); } this.logger.trace( - `Issuing 'get' request; store: ${storeName}, key: ${key}` + `Issuing 'put' request; store: ${storeName}, key: ${key}` ); return await this.sendPut(storeName, key, value); } @@ -274,7 +275,7 @@ export class StorageDataClient implements IStorageDataClient { } else { this.cacheServiceErrorMapper.resolveOrRejectError({ err: err, - errorResponseFactoryFn: e => new StoragePut.Error(e), + errorResponseFactoryFn: (e: SdkError) => new StoragePut.Error(e), resolveFn: resolve, rejectFn: reject, }); @@ -323,7 +324,8 @@ export class StorageDataClient implements IStorageDataClient { } else { this.cacheServiceErrorMapper.resolveOrRejectError({ err: err, - errorResponseFactoryFn: e => new StorageDelete.Error(e), + errorResponseFactoryFn: (e: SdkError) => + new StorageDelete.Error(e), resolveFn: resolve, rejectFn: reject, }); diff --git a/packages/client-sdk-web/package.json b/packages/client-sdk-web/package.json index dac5390d8..ba0b40bf0 100644 --- a/packages/client-sdk-web/package.json +++ b/packages/client-sdk-web/package.json @@ -16,7 +16,6 @@ "prebuild": "eslint . --ext .ts", "test": "jest --testPathIgnorePatterns auth-client.test.ts --maxWorkers 1", "unit-test": "jest unit", - "integration-test-store": "jest storage.test.ts --maxWorkers 1", "integration-test-auth": "jest --env=jsdom auth-client.test.ts --maxWorkers 1", "integration-test-leaderboard": "jest --env=jsdom leaderboard --maxWorkers 1", "integration-test-jsdom": "jest integration --env=jsdom --testMatch \"**/dictionary.test.ts|**/ping.test.ts|*/topic-client.test.ts|leaderboard.test.ts\" --maxWorkers 1", diff --git a/packages/client-sdk-web/src/internal/storage-data-client.ts b/packages/client-sdk-web/src/internal/storage-data-client.ts index a9a8e85ef..057551f65 100644 --- a/packages/client-sdk-web/src/internal/storage-data-client.ts +++ b/packages/client-sdk-web/src/internal/storage-data-client.ts @@ -25,6 +25,7 @@ import { import {ClientMetadataProvider} from './client-metadata-provider'; import ValueCase = _StoreValue.ValueCase; import {StorageConfiguration} from '../config/storage-configuration'; +import {SdkError} from '@gomomento/sdk-core'; export interface StorageDataClientProps { configuration: StorageConfiguration; @@ -144,7 +145,7 @@ export class StorageDataClient< } else { this.cacheServiceErrorMapper.resolveOrRejectError({ err: err, - errorResponseFactoryFn: e => new StorageGet.Error(e), + errorResponseFactoryFn: (e: SdkError) => new StorageGet.Error(e), resolveFn: resolve, rejectFn: reject, }); @@ -159,7 +160,6 @@ export class StorageDataClient< key: string, value: string | number | Uint8Array ): Promise { - console.log('put called'); try { validateStoreName(storeName); } catch (err) { @@ -168,13 +168,13 @@ export class StorageDataClient< err => new StoragePut.Error(err) ); } - this.logger.trace(`Issuing 'set' request; key: ${key.toString()}`); + this.logger.trace(`Issuing 'put' request; key: ${key.toString()}`); const result = await this.sendPut( storeName, convertToB64String(key), value ); - this.logger.trace(`'set' request result: ${result.toString()}`); + this.logger.trace(`'put' request result: ${result.toString()}`); return result; } @@ -183,7 +183,6 @@ export class StorageDataClient< key: string, passedInVal: string | number | Uint8Array ): Promise { - console.log('sendPut called'); console.log( `storeName: ${storeName} key: ${key} passedInVal: ${ passedInVal as string @@ -205,7 +204,7 @@ export class StorageDataClient< } else { value.setBytesValue(passedInVal); } - + request.setValue(value); return await new Promise((resolve, reject) => { this.clientWrapper.put( request, @@ -217,7 +216,7 @@ export class StorageDataClient< if (err) { this.cacheServiceErrorMapper.resolveOrRejectError({ err: err, - errorResponseFactoryFn: e => new StoragePut.Error(e), + errorResponseFactoryFn: (e: SdkError) => new StoragePut.Error(e), resolveFn: resolve, rejectFn: reject, }); @@ -265,7 +264,8 @@ export class StorageDataClient< if (err) { this.cacheServiceErrorMapper.resolveOrRejectError({ err: err, - errorResponseFactoryFn: e => new StorageDelete.Error(e), + errorResponseFactoryFn: (e: SdkError) => + new StorageDelete.Error(e), resolveFn: resolve, rejectFn: reject, });