@sockethub/client 5.0.0-beta.0 → 5.0.0-beta.2

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.
@@ -14,6 +14,13 @@ export interface SockethubClientOptions {
14
14
  initTimeoutMs?: number;
15
15
  maxQueuedOutbound?: number;
16
16
  maxQueuedAgeMs?: number;
17
+ /**
18
+ * Client-side schema validation. `"auto"` (default) validates with Ajv when
19
+ * the environment allows code generation; environments that forbid it (a
20
+ * browser-extension CSP) skip validation automatically. `"off"` always
21
+ * skips it. The server validates every message regardless.
22
+ */
23
+ validation?: "auto" | "off";
17
24
  }
18
25
  export interface ConnectOptions extends SockethubClientOptions, DiscoverOptions {
19
26
  /**
@@ -179,6 +186,7 @@ export default class SockethubClient {
179
186
  private readyWaiters;
180
187
  private outboundQueue;
181
188
  private outboundSequence;
189
+ private pendingScopedClears;
182
190
  private registryFingerprint?;
183
191
  private latestReadyInfo?;
184
192
  /**
@@ -208,7 +216,10 @@ export default class SockethubClient {
208
216
  /**
209
217
  * Clear stored credentials to prevent automatic replay on reconnection.
210
218
  *
211
- * This method removes all stored credentials from memory. Useful for
219
+ * Without a scope this removes all stored credentials from memory. Pass
220
+ * `{ platform, actorId }` to clear one account and its saved connection/join
221
+ * replay on a shared client. Matching queued credentials are cancelled too.
222
+ * Useful for
212
223
  * security-sensitive applications that want to prevent automatic credential
213
224
  * replay when the socket reconnects.
214
225
  *
@@ -220,7 +231,11 @@ export default class SockethubClient {
220
231
  * });
221
232
  * ```
222
233
  */
223
- clearCredentials(): void;
234
+ clearCredentials(scope?: {
235
+ platform: string;
236
+ actorId: string;
237
+ }): void;
238
+ private emitCancelled;
224
239
  /**
225
240
  * Return the platform registry discovered from the server.
226
241
  */