Skip to content

Commit

Permalink
fix(sdk): AlwatrStorage class name
Browse files Browse the repository at this point in the history
  • Loading branch information
alimd committed Nov 27, 2023
1 parent 1da2a32 commit 7e0d238
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions packages/sdk/src/storage-sdk.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import {type FetchOptions, serviceRequest} from '@alwatr/fetch';
import {createLogger, definePackage} from '@alwatr/logger';

import type {AlwatrStorageClientConfig} from './type.js';
import type {AlwatrStorageConfig} from './type.js';
import type {
AlwatrDocumentObject,
AlwatrDocumentStorage,
AlwatrServiceResponseSuccess,
StringifyableRecord,
} from '@alwatr/type';

export {type AlwatrStorageClientConfig};
export {type AlwatrStorageConfig};

definePackage('@alwatr/storage-sdk', '4.*');

Expand All @@ -19,7 +19,7 @@ definePackage('@alwatr/storage-sdk', '4.*');
* Example:
*
* ```ts
* import {type AlwatrDocumentObject, AlwatrStorageClient} from '@alwatr/storage-sdk';
* import {type AlwatrDocumentObject, AlwatrStorage} from '@alwatr/storage-sdk';
*
* interface User extends AlwatrDocumentObject {
* fname: string;
Expand All @@ -28,7 +28,7 @@ definePackage('@alwatr/storage-sdk', '4.*');
* token?: string;
* }
*
* const db = new AlwatrStorageClient<User>({
* const db = new AlwatrStorage<User>({
* name: 'user-list',
* host: 'http://127.0.0.1:80',
* token: 'YOUR_SECRET_TOKEN',
Expand Down Expand Up @@ -61,7 +61,7 @@ definePackage('@alwatr/storage-sdk', '4.*');
* console.log('delete 404: %o', (err as Error).message);
* }
*/
export class AlwatrStorageClient<DocumentType extends AlwatrDocumentObject = AlwatrDocumentObject> {
export class AlwatrStorage<DocumentType extends AlwatrDocumentObject = AlwatrDocumentObject> {
protected _logger = createLogger(
'alwatr/storage-sdk' + (this.config.name == null ? '' : ':' + this.config.name),
this.config.devMode,
Expand All @@ -81,7 +81,7 @@ export class AlwatrStorageClient<DocumentType extends AlwatrDocumentObject = Alw
token: this.config.token,
};

constructor(public readonly config: AlwatrStorageClientConfig) {
constructor(public readonly config: AlwatrStorageConfig) {
this._logger.logMethodArgs?.('constructor', config);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/type.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export interface AlwatrStorageClientConfig {
export interface AlwatrStorageConfig {
/**
* Storage name (like database name).
*/
Expand Down

0 comments on commit 7e0d238

Please sign in to comment.