@blackglory/estore-js 0.4.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -9,35 +9,37 @@ yarn add @blackglory/estore-js
9
9
  ## API
10
10
  ### EStoreClient
11
11
  ```ts
12
- interface IStats {
13
- namespace: string
12
+ interface INamespaceStats {
14
13
  items: number
15
14
  }
16
15
 
17
- interface IEStoreClientOptions {
16
+ export interface IEStoreClientOptions {
18
17
  server: string
19
18
  timeout?: number
20
19
  retryIntervalForReconnection?: number
21
20
  }
22
21
 
23
- class EventIndexConflict extends CustomError {}
24
-
25
- class EStoreClient {
22
+ export class EStoreClient {
26
23
  static create(options: IEStoreClientOptions): Promise<EStoreClient>
27
24
 
28
25
  close(): Promise<void>
29
26
 
30
- stats(namespace: string, timeout?: number): Promise<IStats>
27
+ getNamespaceStats(namespace: string, timeout?: number): Promise<INamespaceStats>
28
+
31
29
  getAllNamespaces(timeout?: number): Promise<string[]>
30
+
32
31
  getAllItemIds(namespace: string, timeout?: number): Promise<string[]>
32
+
33
33
  getAllEvents(
34
34
  namespace: string
35
35
  , itemId: string
36
36
  , timeout?: number
37
- ): Promise<string[]>
37
+ ): Promise<JSONValue[]>
38
38
 
39
39
  clearItemsByNamespace(namespace: string, timeout?: number): Promise<void>
40
- removeItem(namespace: string, itemId: string, timeout?: number): Promise<void>
40
+
41
+ removeItem(namespace: string, itemId: string, timeout?: number): Promise<void>
42
+
41
43
  getItemSize(namespace: string, itemId: string, timeout?: number): Promise<number>
42
44
 
43
45
  /**
@@ -47,7 +49,7 @@ class EStoreClient {
47
49
  appendEvent(
48
50
  namespace: string
49
51
  , itemId: string
50
- , event: string
52
+ , event: JSONValue
51
53
  , nextEventIndex?: number
52
54
  , timeout?: number
53
55
  ): Promise<void>
@@ -57,6 +59,6 @@ class EStoreClient {
57
59
  , itemId: string
58
60
  , index: number
59
61
  , timeout?: number
60
- ): Promise<string | null>
62
+ ): Promise<JSONValue | null>
61
63
  }
62
64
  ```
package/lib/contract.d.ts CHANGED
@@ -1,19 +1,19 @@
1
1
  import { CustomError } from '@blackglory/errors';
2
- export declare const expectedVersion = "^0.3.0";
3
- export interface IStats {
4
- namespace: string;
2
+ import { JSONValue } from 'justypes';
3
+ export declare const expectedVersion = "^0.4.0";
4
+ export interface INamespaceStats {
5
5
  items: number;
6
6
  }
7
7
  export interface IAPI {
8
- stats(namespace: string): IStats;
9
8
  getAllNamespaces(): string[];
10
9
  getAllItemIds(namespace: string): string[];
11
- getAllEvents(namespace: string, itemId: string): string[];
10
+ getAllEvents(namespace: string, itemId: string): JSONValue[];
11
+ getNamespaceStats(namespace: string): INamespaceStats;
12
12
  clearItemsByNamespace(namespace: string): null;
13
13
  removeItem(namespace: string, itemId: string): null;
14
14
  getItemSize(namespace: string, itemId: string): number;
15
- appendEvent(namespace: string, itemId: string, event: string, nextEventIndex?: number): null;
16
- getEvent(namespace: string, itemId: string, eventIndex: number): string | null;
15
+ appendEvent(namespace: string, itemId: string, event: JSONValue, nextEventIndex?: number): null;
16
+ getEvent(namespace: string, itemId: string, eventIndex: number): JSONValue | null;
17
17
  }
18
18
  export declare class EventIndexConflict extends CustomError {
19
19
  }
package/lib/contract.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { CustomError } from '@blackglory/errors';
2
- export const expectedVersion = '^0.3.0';
2
+ export const expectedVersion = '^0.4.0';
3
3
  export class EventIndexConflict extends CustomError {
4
4
  }
5
5
  //# sourceMappingURL=contract.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAEhD,MAAM,CAAC,MAAM,eAAe,GAAG,QAAQ,CAAA;AA0CvC,MAAM,OAAO,kBAAmB,SAAQ,WAAW;CAAG"}
1
+ {"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAGhD,MAAM,CAAC,MAAM,eAAe,GAAG,QAAQ,CAAA;AAyCvC,MAAM,OAAO,kBAAmB,SAAQ,WAAW;CAAG"}
@@ -1,5 +1,6 @@
1
- import { IStats } from './contract.js';
2
- export { IStats } from './contract.js';
1
+ import { INamespaceStats } from './contract.js';
2
+ import { JSONValue } from '@blackglory/prelude';
3
+ export { INamespaceStats } from './contract.js';
3
4
  export { EventIndexConflict } from './contract.js';
4
5
  export interface IEStoreClientOptions {
5
6
  server: string;
@@ -8,21 +9,19 @@ export interface IEStoreClientOptions {
8
9
  }
9
10
  export declare class EStoreClient {
10
11
  private client;
11
- private batchClient;
12
- private batchProxy;
13
12
  private closeClients;
14
13
  private timeout?;
15
14
  static create(options: IEStoreClientOptions): Promise<EStoreClient>;
16
15
  private constructor();
17
16
  close(): Promise<void>;
18
- stats(namespace: string, timeout?: number): Promise<IStats>;
17
+ getNamespaceStats(namespace: string, timeout?: number): Promise<INamespaceStats>;
19
18
  getAllNamespaces(timeout?: number): Promise<string[]>;
20
19
  getAllItemIds(namespace: string, timeout?: number): Promise<string[]>;
21
- getAllEvents(namespace: string, itemId: string, timeout?: number): Promise<string[]>;
20
+ getAllEvents(namespace: string, itemId: string, timeout?: number): Promise<JSONValue[]>;
22
21
  clearItemsByNamespace(namespace: string, timeout?: number): Promise<void>;
23
22
  removeItem(namespace: string, itemId: string, timeout?: number): Promise<void>;
24
23
  getItemSize(namespace: string, itemId: string, timeout?: number): Promise<number>;
25
- appendEvent(namespace: string, itemId: string, event: string, nextEventIndex?: number, timeout?: number): Promise<void>;
26
- getEvent(namespace: string, itemId: string, index: number, timeout?: number): Promise<string | null>;
24
+ appendEvent(namespace: string, itemId: string, event: JSONValue, nextEventIndex?: number, timeout?: number): Promise<void>;
25
+ getEvent(namespace: string, itemId: string, index: number, timeout?: number): Promise<JSONValue | null>;
27
26
  private withTimeout;
28
27
  }
@@ -3,22 +3,20 @@ import { timeoutSignal, withAbortSignal } from 'extra-abort';
3
3
  import { isUndefined } from '@blackglory/prelude';
4
4
  export { EventIndexConflict } from './contract.js';
5
5
  export class EStoreClient {
6
- constructor(client, batchClient, batchProxy, closeClients, timeout) {
6
+ constructor(client, closeClients, timeout) {
7
7
  this.client = client;
8
- this.batchClient = batchClient;
9
- this.batchProxy = batchProxy;
10
8
  this.closeClients = closeClients;
11
9
  this.timeout = timeout;
12
10
  }
13
11
  static async create(options) {
14
- const { client, batchClient, proxy, close } = await createRPCClient(options.server);
15
- return new EStoreClient(client, batchClient, proxy, close, options.timeout);
12
+ const { client, close } = await createRPCClient(options.server);
13
+ return new EStoreClient(client, close);
16
14
  }
17
15
  async close() {
18
16
  await this.closeClients();
19
17
  }
20
- async stats(namespace, timeout) {
21
- return await this.withTimeout(() => this.client.stats(namespace), timeout !== null && timeout !== void 0 ? timeout : this.timeout);
18
+ async getNamespaceStats(namespace, timeout) {
19
+ return await this.withTimeout(() => this.client.getNamespaceStats(namespace), timeout !== null && timeout !== void 0 ? timeout : this.timeout);
22
20
  }
23
21
  async getAllNamespaces(timeout) {
24
22
  return await this.withTimeout(() => this.client.getAllNamespaces(), timeout !== null && timeout !== void 0 ? timeout : this.timeout);
@@ -1 +1 @@
1
- {"version":3,"file":"estore-client.js","sourceRoot":"","sources":["../src/estore-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,8BAA4B;AAGtD,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAEjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAQlD,MAAM,OAAO,YAAY;IAMvB,YACU,MAAyB,EACzB,WAAwB,EACxB,UAA2C,EAC3C,YAAiC,EACjC,OAAgB;QAJhB,WAAM,GAAN,MAAM,CAAmB;QACzB,gBAAW,GAAX,WAAW,CAAa;QACxB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AAI,IAAI,CAAC,OAAO,CACxB,CAAA;IACH,CAAC;IAED,KAAK,CAAC,QAAQ,CACZ,SAAiB,EACjB,MAAc,EACd,KAAa,EACb,OAAgB;QAEhB,OAAO,MAAM,IAAI,CAAC,WAAW,CAC3B,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,EACpD,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,IAAI,CAAC,OAAO,CACxB,CAAA;IACH,CAAC;IAEO,KAAK,CAAC,WAAW,CACvB,EAAwB,EACxB,UAA8B,IAAI,CAAC,OAAO;QAE1C,IAAI,OAAO,EAAE;YACX,OAAO,MAAM,eAAe,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAA;SACzD;aAAM;YACL,OAAO,MAAM,EAAE,EAAE,CAAA;SAClB;IACH,CAAC;CACF"}
@@ -1,8 +1,6 @@
1
1
  import { IAPI } from "../contract.js";
2
- import { ClientProxy, BatchClient, BatchClientProxy } from 'delight-rpc';
2
+ import { ClientProxy } from 'delight-rpc';
3
3
  export declare function createRPCClient(url: string, retryIntervalForReconnection?: number): Promise<{
4
4
  client: ClientProxy<IAPI>;
5
- batchClient: BatchClient<IAPI>;
6
- proxy: BatchClientProxy<IAPI, unknown>;
7
5
  close: () => Promise<void>;
8
6
  }>;
@@ -1,6 +1,5 @@
1
1
  import { expectedVersion } from "../contract.js";
2
- import { createBatchProxy } from 'delight-rpc';
3
- import { createClient, createBatchClient } from '@delight-rpc/extra-websocket';
2
+ import { createClient } from '@delight-rpc/extra-websocket';
4
3
  import { WebSocket } from 'ws';
5
4
  import { ExtraWebSocket, autoReconnect } from 'extra-websocket';
6
5
  export async function createRPCClient(url, retryIntervalForReconnection) {
@@ -8,15 +7,10 @@ export async function createRPCClient(url, retryIntervalForReconnection) {
8
7
  const cancelAutoReconnect = autoReconnect(ws, retryIntervalForReconnection);
9
8
  await ws.connect();
10
9
  const [client, closeClient] = createClient(ws, { expectedVersion });
11
- const [batchClient, closeBatchClient] = createBatchClient(ws, { expectedVersion });
12
- const proxy = createBatchProxy();
13
10
  return {
14
11
  client,
15
- batchClient,
16
- proxy,
17
12
  close: async () => {
18
13
  closeClient();
19
- closeBatchClient();
20
14
  cancelAutoReconnect();
21
15
  await ws.close();
22
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"rpc-client.js","sourceRoot":"","sources":["../../src/utils/rpc-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,eAAe,EAAE,uBAAwB;AACxD,OAAO,EAA8C,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC1F,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAC9E,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAA;AAC9B,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE/D,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,GAAW,EACX,4BAAqC;IAOrC,MAAM,EAAE,GAAG,IAAI,cAAc,CAAC,GAAG,EAAE,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC,CAAC,CAAA;IACvD,MAAM,mBAAmB,GAAG,aAAa,CAAC,EAAE,EAAE,4BAA4B,CAAC,CAAA;IAC3E,MAAM,EAAE,CAAC,OAAO,EAAE,CAAA;IAElB,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GAAG,YAAY,CAAO,EAAE,EAAE,EAAE,eAAe,EAAE,CAAC,CAAA;IACzE,MAAM,CAAC,WAAW,EAAE,gBAAgB,CAAC,GAAG,iBAAiB,CAAC,EAAE,EAAE,EAAE,eAAe,EAAE,CAAC,CAAA;IAClF,MAAM,KAAK,GAAG,gBAAgB,EAAQ,CAAA;IAEtC,OAAO;QACL,MAAM;QACN,WAAW;QACX,KAAK;QACL,KAAK,EAAE,KAAK,IAAI,EAAE;YAChB,WAAW,EAAE,CAAA;YACb,gBAAgB,EAAE,CAAA;YAClB,mBAAmB,EAAE,CAAA;YACrB,MAAM,EAAE,CAAC,KAAK,EAAE,CAAA;QAClB,CAAC;KACF,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"rpc-client.js","sourceRoot":"","sources":["../../src/utils/rpc-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,eAAe,EAAE,uBAAwB;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAA;AAC9B,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE/D,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,GAAW,EACX,4BAAqC;IAKrC,MAAM,EAAE,GAAG,IAAI,cAAc,CAAC,GAAG,EAAE,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC,CAAC,CAAA;IACvD,MAAM,mBAAmB,GAAG,aAAa,CAAC,EAAE,EAAE,4BAA4B,CAAC,CAAA;IAC3E,MAAM,EAAE,CAAC,OAAO,EAAE,CAAA;IAElB,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GAAG,YAAY,CAAO,EAAE,EAAE,EAAE,eAAe,EAAE,CAAC,CAAA;IAEzE,OAAO;QACL,MAAM;QACN,KAAK,EAAE,KAAK,IAAI,EAAE;YAChB,WAAW,EAAE,CAAA;YACb,mBAAmB,EAAE,CAAA;YACrB,MAAM,EAAE,CAAC,KAAK,EAAE,CAAA;QAClB,CAAC;KACF,CAAA;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blackglory/estore-js",
3
- "version": "0.4.1",
3
+ "version": "0.5.0",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "files": [
@@ -43,15 +43,15 @@
43
43
  },
44
44
  "devDependencies": {
45
45
  "@blackglory/jest-resolver": "^0.3.0",
46
- "@commitlint/cli": "^17.4.4",
46
+ "@commitlint/cli": "^17.5.1",
47
47
  "@commitlint/config-conventional": "^17.4.4",
48
- "@types/jest": "^29.4.0",
48
+ "@types/jest": "^29.5.0",
49
49
  "@types/ws": "^8.5.4",
50
- "@typescript-eslint/eslint-plugin": "^5.54.1",
51
- "@typescript-eslint/parser": "^5.54.1",
50
+ "@typescript-eslint/eslint-plugin": "^5.57.0",
51
+ "@typescript-eslint/parser": "^5.57.0",
52
52
  "cross-env": "^7.0.3",
53
53
  "eslint": "^8.36.0",
54
- "extra-utils": "^5.1.0",
54
+ "extra-utils": "^5.1.1",
55
55
  "husky": "4",
56
56
  "jest": "^29.5.0",
57
57
  "jest-resolve": "^29.5.0",
@@ -67,10 +67,10 @@
67
67
  "dependencies": {
68
68
  "@blackglory/errors": "^3.0.0",
69
69
  "@blackglory/prelude": "^0.3.1",
70
- "@delight-rpc/extra-native-websocket": "^0.4.3",
71
- "@delight-rpc/extra-websocket": "^0.4.0",
72
- "delight-rpc": "^5.1.0",
73
- "extra-abort": "^0.3.2",
70
+ "@delight-rpc/extra-native-websocket": "^0.5.1",
71
+ "@delight-rpc/extra-websocket": "^0.6.1",
72
+ "delight-rpc": "^6.0.1",
73
+ "extra-abort": "^0.3.4",
74
74
  "extra-native-websocket": "^0.3.1",
75
75
  "extra-websocket": "^0.3.1",
76
76
  "justypes": "^4.2.0",