@squidcloud/client 1.0.101 → 1.0.103

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.
@@ -13,6 +13,7 @@ export declare class ClientIdService {
13
13
  private readonly destructManager;
14
14
  private readonly clientTooOldSubject;
15
15
  private readonly clientIdSubject;
16
+ private readonly isTenant;
16
17
  constructor(destructManager: DestructManager);
17
18
  observeClientId(): Observable<ClientId>;
18
19
  observeClientTooOld(): Observable<void>;
@@ -22,4 +23,5 @@ export declare class ClientIdService {
22
23
  observeClientReadyToBeRegenerated(): Observable<void>;
23
24
  getClientId(): ClientId;
24
25
  isClientTooOld(): boolean;
26
+ private generateClientId;
25
27
  }
@@ -114,7 +114,6 @@ export declare class DataManager {
114
114
  * documents.
115
115
  */
116
116
  private applyIncomingUpdates;
117
- private addPendingIncomingUpdate;
118
117
  private maybeApplyIncomingUpdate;
119
118
  private destruct;
120
119
  private stopDeleteExpiredTimestampsJob;
@@ -1,11 +1,8 @@
1
1
  import { Observable } from 'rxjs';
2
2
  /** A handler for a distributed lock that can be released. */
3
3
  export interface DistributedLock {
4
- /**
5
- * Releases the lock.
6
- * @returns A promise that resolves when the lock is released.
7
- */
8
- release(): Promise<void>;
4
+ /** Releases the lock. */
5
+ release(): void;
9
6
  /**
10
7
  * Whether the lock has been released.
11
8
  * @returns True if the lock has been released.
@@ -8,12 +8,11 @@ export declare class RpcManager {
8
8
  private readonly appId;
9
9
  private readonly socketManager;
10
10
  private readonly destructManager;
11
- private readonly headers;
12
11
  private readonly authManager;
13
12
  private readonly clientIdService;
14
13
  private readonly staticHeaders;
15
14
  private readonly onGoingRpcCounter;
16
- constructor(region: SupportedSquidRegion, appId: string, socketManager: SocketManager, destructManager: DestructManager, headers: Record<string, string>, authManager: AuthManager, clientIdService: ClientIdService);
15
+ constructor(region: SupportedSquidRegion, appId: string, socketManager: SocketManager, destructManager: DestructManager, headers: Record<string, string> | undefined, authManager: AuthManager, clientIdService: ClientIdService);
17
16
  awaitAllSettled(): Promise<void>;
18
17
  setStaticHeader(key: string, value: string): void;
19
18
  deleteStaticHeader(key: string): void;
@@ -16,6 +16,7 @@ export declare class SocketManager {
16
16
  private readonly seenMessageIds;
17
17
  private socket;
18
18
  private firstConnection;
19
+ private destructSubject;
19
20
  /**
20
21
  * On a client disconnecting, we wait for a bit to see if the client reconnects,
21
22
  * if no reconnect happens within the timeout, we consider the client to be too old.
@@ -23,11 +24,13 @@ export declare class SocketManager {
23
24
  * Note: we make this a function so that we can easily override it in tests.
24
25
  */
25
26
  private clientTooOldThreshold;
26
- constructor(clientIdService: ClientIdService, region: SupportedSquidRegion, appId: string, messageNotificationWrapper: (fn: () => any) => any, destructManager: DestructManager, extraHeaders: Record<string, string> | undefined, authManager: AuthManager);
27
+ constructor(clientIdService: ClientIdService, region: SupportedSquidRegion, appId: string, messageNotificationWrapper: (fn: () => any) => any, destructManager: DestructManager, authManager: AuthManager);
27
28
  observeNotifications<T extends MessageToClient>(): Observable<T>;
28
29
  observeConnectionReady(): Observable<boolean>;
29
30
  sendMessage(message: MessageFromClient): void;
30
31
  private connect;
32
+ private onConnectionReady;
33
+ private onMessage;
31
34
  private setupMessageAcknowledgments;
32
35
  private destruct;
33
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squidcloud/client",
3
- "version": "1.0.101",
3
+ "version": "1.0.103",
4
4
  "description": "A typescript implementation of the Squid client",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -37,7 +37,7 @@
37
37
  "@supercharge/promise-pool": "^2.3.2",
38
38
  "cross-fetch": "^3.1.5",
39
39
  "lodash": "^4.17.21",
40
- "socket.io-client": "^4.5.2"
40
+ "ws": "^8.13.0"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "rxjs": ">=7.5.7 <8.0.0"
@@ -1,10 +0,0 @@
1
- /**
2
- * @license
3
- * Lodash <https://lodash.com/>
4
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
5
- * Released under MIT license <https://lodash.com/license>
6
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
7
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
8
- */
9
-
10
- /** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
@@ -1,10 +0,0 @@
1
- /**
2
- * @license
3
- * Lodash <https://lodash.com/>
4
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
5
- * Released under MIT license <https://lodash.com/license>
6
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
7
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
8
- */
9
-
10
- /** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */