0.5.3 • Published 2 years ago
@blackglory/estore-js v0.5.3
estore-js
Install
npm install --save @blackglory/estore-js
# or
yarn add @blackglory/estore-js
API
EStoreClient
interface INamespaceStats {
items: number
}
export interface IEStoreClientOptions {
server: string
timeout?: number
retryIntervalForReconnection?: number
}
export class EStoreClient {
static create(options: IEStoreClientOptions): Promise<EStoreClient>
close(): Promise<void>
getNamespaceStats(namespace: string, timeout?: number): Promise<INamespaceStats>
getAllNamespaces(timeout?: number): Promise<string[]>
getAllItemIds(namespace: string, timeout?: number): Promise<string[]>
getAllEvents(
namespace: string
, itemId: string
, timeout?: number
): Promise<JSONValue[]>
clearItemsByNamespace(namespace: string, timeout?: number): Promise<void>
removeItem(namespace: string, itemId: string, timeout?: number): Promise<void>
getItemSize(namespace: string, itemId: string, timeout?: number): Promise<number>
/**
* @param nextEventIndex 如果指定, 则会在eventIndex不等于下一个index时抛出EventIndexConflict错误.
* @throws {EventIndexConflict}
*/
appendEvent(
namespace: string
, itemId: string
, event: JSONValue
, nextEventIndex?: number
, timeout?: number
): Promise<void>
getEvent(
namespace: string
, itemId: string
, index: number
, timeout?: number
): Promise<JSONValue | null>
}
0.5.3
2 years ago
0.5.0
2 years ago
0.4.1
2 years ago
0.5.2
2 years ago
0.5.1
2 years ago
0.3.0
2 years ago
0.4.0
2 years ago
0.2.1
3 years ago
0.2.0
3 years ago
0.1.7
3 years ago
0.2.3
3 years ago
0.2.2
3 years ago
0.1.6
3 years ago
0.2.4
3 years ago
0.1.5
3 years ago
0.1.4
3 years ago
0.1.3
3 years ago
0.1.2
3 years ago
0.1.1
3 years ago
0.1.0
3 years ago