@syncular/client 0.25.2 → 0.26.1

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.
@@ -34,7 +34,7 @@ import type {
34
34
  WindowState,
35
35
  } from './client';
36
36
  import type { SqlRow, SqlValue } from './database';
37
- import type { ClientDiagnosticsSnapshot } from './diagnostics';
37
+ import type { ClientDiagnosticsSnapshot, RealtimePolicy } from './diagnostics';
38
38
  import type { EncryptionKeyringConfig } from './encryption';
39
39
  import type { ClientChangeBatch, LocalRevision } from './invalidation';
40
40
  import type { LocalDataPurgeInput, LocalDataPurgeResult } from './local-purge';
@@ -102,12 +102,23 @@ export interface WorkerInitConfig {
102
102
  readonly schema: ClientSchema;
103
103
  readonly database: WorkerDatabaseInit;
104
104
  readonly endpoints: WorkerEndpoints;
105
+ /**
106
+ * Host auth headers for sync, segment, and blob requests. `setHeaders`
107
+ * replaces the whole set at runtime. WebSockets cannot carry headers, so
108
+ * realtime authenticates through `realtimeUrl` (cookie or ticket).
109
+ */
110
+ readonly headers?: Readonly<Record<string, string>>;
105
111
  /** Portable raw keyring installed inside the worker-owned client core. */
106
112
  readonly encryption?: EncryptionKeyringConfig;
107
113
  /** Open the worker-owned replica behind the fail-closed security gate. */
108
114
  readonly securityPreflight?: boolean;
109
115
  readonly clientId?: string;
110
116
  readonly limits?: SyncClientLimits;
117
+ /**
118
+ * SPEC §8.8 realtime policy for the worker-owned core; forwarded verbatim.
119
+ * Absent ⇒ `optional` (a connected socket, otherwise `POST /sync`).
120
+ */
121
+ readonly realtimePolicy?: RealtimePolicy;
111
122
  /**
112
123
  * RFC 0005 previous-version context, forwarded verbatim into the worker's
113
124
  * `SyncClientConfig`. Absent ⇒ the feature stays off (default-off).
@@ -190,6 +201,8 @@ export interface WorkerApi extends Omit<
190
201
  options?: { readonly mediaType?: string; readonly name?: string },
191
202
  ): Promise<BlobRef>;
192
203
  fetchBlob(blobIdOrRef: string): Promise<CachedBlob>;
204
+ /** Replace the host auth header set; the next HTTP request uses it. */
205
+ setHeaders(headers: Readonly<Record<string, string>>): void;
193
206
  /** Sever/restore the transport + realtime (offline simulation, demos). */
194
207
  setOffline(offline: boolean): void;
195
208
  close(): Promise<void>;