0.5.3 • Published 11 months ago

@blackglory/estore-js v0.5.3

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

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

11 months ago

0.5.0

1 year ago

0.4.1

1 year ago

0.5.2

1 year ago

0.5.1

1 year ago

0.3.0

1 year ago

0.4.0

1 year ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.7

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.1.6

2 years ago

0.2.4

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago