@korajs/core 1.0.0-beta.11 → 1.0.0-beta.12

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,5 +1,5 @@
1
- import { p as KoraEventEmitter } from '../events-BPbYUbrE.cjs';
2
- import { S as ScopeMap } from '../build-scope-map--0H8l6Tw.cjs';
1
+ import { p as KoraEventEmitter } from '../events-D7JCtQSD.cjs';
2
+ import { S as ScopeMap } from '../build-scope-map-CItP1gsz.cjs';
3
3
 
4
4
  /** Sync status shape consumed by framework binding hooks (matches {@link SyncStatusInfo} in `@korajs/sync`). */
5
5
  interface KoraBindingSyncStatus {
@@ -1,5 +1,5 @@
1
- import { p as KoraEventEmitter } from '../events-BPbYUbrE.js';
2
- import { S as ScopeMap } from '../build-scope-map-B3R_emUU.js';
1
+ import { p as KoraEventEmitter } from '../events-D7JCtQSD.js';
2
+ import { S as ScopeMap } from '../build-scope-map-Cv5HfCQP.js';
3
3
 
4
4
  /** Sync status shape consumed by framework binding hooks (matches {@link SyncStatusInfo} in `@korajs/sync`). */
5
5
  interface KoraBindingSyncStatus {
@@ -1,4 +1,4 @@
1
- import { S as SchemaDefinition } from './events-BPbYUbrE.cjs';
1
+ import { S as SchemaDefinition } from './events-D7JCtQSD.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-BPbYUbrE.js';
1
+ import { S as SchemaDefinition } from './events-D7JCtQSD.js';
2
2
 
3
3
  /**
4
4
  * Per-collection scope map: `{ collectionName: { field: value, ... } }`
@@ -840,9 +840,18 @@ type KoraEvent = {
840
840
  type: 'sync:received';
841
841
  operations: Operation[];
842
842
  batchSize: number;
843
+ /** Server-ingest outcomes. Omitted for ordinary client-side receive events. */
844
+ uniqueOperations?: number;
845
+ duplicateOperations?: number;
846
+ rejectedOperations?: number;
843
847
  } | {
844
848
  type: 'sync:acknowledged';
845
849
  sequenceNumber: number;
850
+ } | {
851
+ type: 'sync:scope-retracted';
852
+ collection: string;
853
+ recordId: string;
854
+ quarantinedOperationIds: string[];
846
855
  } | {
847
856
  type: 'sync:apply-failed';
848
857
  operationId: string;
@@ -877,7 +886,9 @@ type KoraEvent = {
877
886
  type: 'sync:delivery-stalled';
878
887
  sessionId: string;
879
888
  watermark: number;
889
+ outstandingMaxDeliverySequence: number;
880
890
  repeatCount: number;
891
+ reason: 'unacknowledged-delivery';
881
892
  } | {
882
893
  type: 'query:subscribed';
883
894
  queryId: string;
@@ -840,9 +840,18 @@ type KoraEvent = {
840
840
  type: 'sync:received';
841
841
  operations: Operation[];
842
842
  batchSize: number;
843
+ /** Server-ingest outcomes. Omitted for ordinary client-side receive events. */
844
+ uniqueOperations?: number;
845
+ duplicateOperations?: number;
846
+ rejectedOperations?: number;
843
847
  } | {
844
848
  type: 'sync:acknowledged';
845
849
  sequenceNumber: number;
850
+ } | {
851
+ type: 'sync:scope-retracted';
852
+ collection: string;
853
+ recordId: string;
854
+ quarantinedOperationIds: string[];
846
855
  } | {
847
856
  type: 'sync:apply-failed';
848
857
  operationId: string;
@@ -877,7 +886,9 @@ type KoraEvent = {
877
886
  type: 'sync:delivery-stalled';
878
887
  sessionId: string;
879
888
  watermark: number;
889
+ outstandingMaxDeliverySequence: number;
880
890
  repeatCount: number;
891
+ reason: 'unacknowledged-delivery';
881
892
  } | {
882
893
  type: 'query:subscribed';
883
894
  queryId: string;
package/dist/index.cjs CHANGED
@@ -3194,15 +3194,20 @@ var KORA_OPERATION_MESSAGE = `message KoraOperation {
3194
3194
  var OPERATION_BATCH_MESSAGE = `message OperationBatch {
3195
3195
  repeated KoraOperation operations = 1;
3196
3196
  bool is_final = 2;
3197
+ bytes retractions_json = 3;
3197
3198
  }`;
3198
3199
  var HANDSHAKE_MESSAGE = `message HandshakeMessage {
3199
3200
  map<string, int64> version_vector = 1;
3200
3201
  int32 schema_version = 2;
3201
3202
  string node_id = 3;
3203
+ string scope_exit_policy = 4;
3202
3204
  }`;
3203
3205
  var HANDSHAKE_RESPONSE_MESSAGE = `message HandshakeResponse {
3204
3206
  map<string, int64> version_vector = 1;
3205
3207
  int32 schema_version = 2;
3208
+ bytes accepted_scope_json = 3;
3209
+ bytes accepted_downlink_scopes_json = 4;
3210
+ bytes accepted_uplink_scopes_json = 5;
3206
3211
  }`;
3207
3212
  var ACKNOWLEDGMENT_MESSAGE = `message Acknowledgment {
3208
3213
  int64 sequence_number = 1;
@@ -3268,20 +3273,25 @@ function buildJsonDescriptor(schema) {
3268
3273
  nested.OperationBatch = {
3269
3274
  fields: {
3270
3275
  operations: { type: "KoraOperation", id: 1, rule: "repeated" },
3271
- is_final: { type: "bool", id: 2 }
3276
+ is_final: { type: "bool", id: 2 },
3277
+ retractions_json: { type: "bytes", id: 3 }
3272
3278
  }
3273
3279
  };
3274
3280
  nested.HandshakeMessage = {
3275
3281
  fields: {
3276
3282
  version_vector: { keyType: "string", type: "int64", id: 1 },
3277
3283
  schema_version: { type: "int32", id: 2 },
3278
- node_id: { type: "string", id: 3 }
3284
+ node_id: { type: "string", id: 3 },
3285
+ scope_exit_policy: { type: "string", id: 4 }
3279
3286
  }
3280
3287
  };
3281
3288
  nested.HandshakeResponse = {
3282
3289
  fields: {
3283
3290
  version_vector: { keyType: "string", type: "int64", id: 1 },
3284
- schema_version: { type: "int32", id: 2 }
3291
+ schema_version: { type: "int32", id: 2 },
3292
+ accepted_scope_json: { type: "bytes", id: 3 },
3293
+ accepted_downlink_scopes_json: { type: "bytes", id: 4 },
3294
+ accepted_uplink_scopes_json: { type: "bytes", id: 5 }
3285
3295
  }
3286
3296
  };
3287
3297
  nested.Acknowledgment = {