@korajs/core 1.0.0-beta.6 → 1.0.0-beta.9

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.
@@ -1,9 +1,10 @@
1
- import { p as KoraEventEmitter } from '../events-CT9y24ht.cjs';
2
- import { S as ScopeMap } from '../build-scope-map-Bm6Lqo9F.cjs';
1
+ import { p as KoraEventEmitter } from '../events-3z0Tema3.cjs';
2
+ import { S as ScopeMap } from '../build-scope-map-B8dpCt6P.cjs';
3
3
 
4
4
  /** Sync status shape consumed by framework binding hooks (matches {@link SyncStatusInfo} in `@korajs/sync`). */
5
5
  interface KoraBindingSyncStatus {
6
- status: 'connected' | 'syncing' | 'synced' | 'offline' | 'error' | 'schema-mismatch' | 'clock-error';
6
+ status: 'connected' | 'reconnecting' | 'syncing' | 'synced' | 'offline' | 'error' | 'schema-mismatch' | 'clock-error';
7
+ reconnecting: boolean;
7
8
  pendingOperations: number;
8
9
  lastSyncedAt: number | null;
9
10
  lastSuccessfulPush: number | null;
@@ -72,6 +73,8 @@ interface AuthSyncBinding {
72
73
  * Separate from the user id (`sub`).
73
74
  */
74
75
  resolveNodeId?: () => Promise<string | undefined>;
76
+ /** Returns the authenticated user id used for local store namespacing. */
77
+ resolveUserId?: () => Promise<string | undefined>;
75
78
  /** Notifies when auth state changes so sync can refresh scope or reconnect. */
76
79
  subscribe?: (listener: () => void) => () => void;
77
80
  }
@@ -1,9 +1,10 @@
1
- import { p as KoraEventEmitter } from '../events-CT9y24ht.js';
2
- import { S as ScopeMap } from '../build-scope-map-C60lT-4I.js';
1
+ import { p as KoraEventEmitter } from '../events-3z0Tema3.js';
2
+ import { S as ScopeMap } from '../build-scope-map-CDpIGOsf.js';
3
3
 
4
4
  /** Sync status shape consumed by framework binding hooks (matches {@link SyncStatusInfo} in `@korajs/sync`). */
5
5
  interface KoraBindingSyncStatus {
6
- status: 'connected' | 'syncing' | 'synced' | 'offline' | 'error' | 'schema-mismatch' | 'clock-error';
6
+ status: 'connected' | 'reconnecting' | 'syncing' | 'synced' | 'offline' | 'error' | 'schema-mismatch' | 'clock-error';
7
+ reconnecting: boolean;
7
8
  pendingOperations: number;
8
9
  lastSyncedAt: number | null;
9
10
  lastSuccessfulPush: number | null;
@@ -72,6 +73,8 @@ interface AuthSyncBinding {
72
73
  * Separate from the user id (`sub`).
73
74
  */
74
75
  resolveNodeId?: () => Promise<string | undefined>;
76
+ /** Returns the authenticated user id used for local store namespacing. */
77
+ resolveUserId?: () => Promise<string | undefined>;
75
78
  /** Notifies when auth state changes so sync can refresh scope or reconnect. */
76
79
  subscribe?: (listener: () => void) => () => void;
77
80
  }
@@ -1,4 +1,4 @@
1
- import { S as SchemaDefinition } from './events-CT9y24ht.cjs';
1
+ import { S as SchemaDefinition } from './events-3z0Tema3.cjs';
2
2
 
3
3
  /**
4
4
  * Per-collection scope map: `{ collectionName: { field: value, ... } }`
@@ -1,4 +1,4 @@
1
- import { S as SchemaDefinition } from './events-CT9y24ht.js';
1
+ import { S as SchemaDefinition } from './events-3z0Tema3.js';
2
2
 
3
3
  /**
4
4
  * Per-collection scope map: `{ collectionName: { field: value, ... } }`
@@ -486,7 +486,7 @@ interface BlobRef {
486
486
  */
487
487
  interface SyncDiagnosticsSnapshot {
488
488
  /** Current developer-facing sync status */
489
- status: 'connected' | 'syncing' | 'synced' | 'offline' | 'error' | 'schema-mismatch' | 'clock-error';
489
+ status: 'connected' | 'reconnecting' | 'syncing' | 'synced' | 'offline' | 'error' | 'schema-mismatch' | 'clock-error';
490
490
  /** Timestamp when the current connection was established, or null if disconnected */
491
491
  connectedAt: number | null;
492
492
  /** Timestamp when the last disconnection occurred, or null if never disconnected */
@@ -841,6 +841,18 @@ type KoraEvent = {
841
841
  code: string;
842
842
  message: string;
843
843
  retriable: boolean;
844
+ } | {
845
+ type: 'sync:delivery-gap';
846
+ expectedBase: number;
847
+ receivedBase: number;
848
+ currentWatermark: number;
849
+ messageId: string;
850
+ repeatCount: number;
851
+ } | {
852
+ type: 'sync:delivery-stalled';
853
+ sessionId: string;
854
+ watermark: number;
855
+ repeatCount: number;
844
856
  } | {
845
857
  type: 'query:subscribed';
846
858
  queryId: string;
@@ -486,7 +486,7 @@ interface BlobRef {
486
486
  */
487
487
  interface SyncDiagnosticsSnapshot {
488
488
  /** Current developer-facing sync status */
489
- status: 'connected' | 'syncing' | 'synced' | 'offline' | 'error' | 'schema-mismatch' | 'clock-error';
489
+ status: 'connected' | 'reconnecting' | 'syncing' | 'synced' | 'offline' | 'error' | 'schema-mismatch' | 'clock-error';
490
490
  /** Timestamp when the current connection was established, or null if disconnected */
491
491
  connectedAt: number | null;
492
492
  /** Timestamp when the last disconnection occurred, or null if never disconnected */
@@ -841,6 +841,18 @@ type KoraEvent = {
841
841
  code: string;
842
842
  message: string;
843
843
  retriable: boolean;
844
+ } | {
845
+ type: 'sync:delivery-gap';
846
+ expectedBase: number;
847
+ receivedBase: number;
848
+ currentWatermark: number;
849
+ messageId: string;
850
+ repeatCount: number;
851
+ } | {
852
+ type: 'sync:delivery-stalled';
853
+ sessionId: string;
854
+ watermark: number;
855
+ repeatCount: number;
844
856
  } | {
845
857
  type: 'query:subscribed';
846
858
  queryId: string;