@only-chat/in-memory-user-store 0.2.0-beta.27 → 0.2.0-beta.28

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
@@ -1,2 +1,23 @@
1
1
  # only-chat
2
- This is an in-memory user store implementation for only-chat.
2
+ This is an in-memory user store implementation for only-chat.
3
+
4
+ # Get started
5
+
6
+ ```shell
7
+ npm i --save @only-chat/in-memory-user-store
8
+ ```
9
+
10
+ ```typescript
11
+ import { initialize as initializeUserStore } from '@only-chat/in-memory-user-store'
12
+ import { initialize as initializeClient, WsClient } from '@only-chat/client'
13
+
14
+ ...
15
+
16
+ const userStore = await initializeUserStore();
17
+
18
+ initializeClient({queue, store, userStore, instanceId}, logger)
19
+
20
+ const ws = new WebSocketServer({ host, port })
21
+
22
+ ws.on('connection', s => new WsClient(s))
23
+ ```
package/dist/index.d.ts CHANGED
@@ -3,4 +3,5 @@ export interface StoreAuthenticationInfo extends AuthenticationInfo {
3
3
  name: string;
4
4
  password: string;
5
5
  }
6
+ export declare const users: Map<string, string>;
6
7
  export declare function initialize(): Promise<UserStore>;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- let users = new Map();
1
+ export const users = new Map();
2
2
  export async function initialize() {
3
3
  users.clear();
4
4
  return {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,IAAI,KAAK,GAAG,IAAI,GAAG,EAAkB,CAAC;AAEtC,MAAM,CAAC,KAAK,UAAU,UAAU;IAC5B,KAAK,CAAC,KAAK,EAAE,CAAC;IAEd,OAAO;QACH,KAAK,CAAC,YAAY,CAAC,IAA6B;YAC5C,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;gBACZ,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;gBAE5C,IAAI,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBAE/B,IAAI,QAAQ,EAAE,CAAC;oBACX,IAAI,QAAQ,KAAK,IAAI,CAAC,QAAQ,EAAE,CAAC;wBAC7B,OAAO;oBACX,CAAC;gBACL,CAAC;qBAAM,CAAC;oBACJ,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACnC,CAAC;gBAED,OAAO,IAAI,CAAC;YAChB,CAAC;QACL,CAAC;KACJ,CAAA;AACL,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,MAAM,KAAK,GAAG,IAAI,GAAG,EAAkB,CAAC;AAE/C,MAAM,CAAC,KAAK,UAAU,UAAU;IAC5B,KAAK,CAAC,KAAK,EAAE,CAAC;IAEd,OAAO;QACH,KAAK,CAAC,YAAY,CAAC,IAA6B;YAC5C,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;gBACZ,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;gBAE5C,IAAI,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBAE/B,IAAI,QAAQ,EAAE,CAAC;oBACX,IAAI,QAAQ,KAAK,IAAI,CAAC,QAAQ,EAAE,CAAC;wBAC7B,OAAO;oBACX,CAAC;gBACL,CAAC;qBAAM,CAAC;oBACJ,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACnC,CAAC;gBAED,OAAO,IAAI,CAAC;YAChB,CAAC;QACL,CAAC;KACJ,CAAA;AACL,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@only-chat/in-memory-user-store",
3
- "version": "0.2.0-beta.27",
3
+ "version": "0.2.0-beta.28",
4
4
  "description": "In memory users storage for only-chat",
5
5
  "homepage": "https://github.com/only-chat/node-backend/packages/user-stores/memory",
6
6
  "main": "dist/index.js",
@@ -18,14 +18,14 @@
18
18
  "author": "only-chat",
19
19
  "license": "MIT",
20
20
  "devDependencies": {
21
- "@jest/globals": "^29.7.0",
22
- "@only-chat/types": "0.2.0-beta.27",
23
- "@types/jest": "^29.5.12",
24
- "jest": "^29.7.0",
25
- "jest-ts-webcompat-resolver": "^1.0.0",
26
- "ts-jest": "^29.1.4",
21
+ "@jest/globals": "^30.2.0",
22
+ "@only-chat/types": "0.2.0-beta.28",
23
+ "@types/jest": "^30.0.0",
24
+ "jest": "^30.2.0",
25
+ "jest-ts-webcompat-resolver": "^1.0.1",
26
+ "ts-jest": "^29.4.6",
27
27
  "ts-node": "^10.9.2",
28
- "typescript": "^5.9.2"
28
+ "typescript": "^5.9.3"
29
29
  },
30
30
  "files": [
31
31
  "dist/"