@dittolive/ditto 4.8.1 → 4.8.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.
@@ -1077,6 +1077,37 @@ int32_t
1077
1077
  int32_t limit,
1078
1078
  uint32_t offset);
1079
1079
 
1080
+ /** <No documentation available> */
1081
+ typedef struct LegacySubscriptionHandle LegacySubscriptionHandle_t;
1082
+
1083
+ /** <No documentation available> */
1084
+ typedef struct LegacySubscriptionHandleResult {
1085
+ /** <No documentation available> */
1086
+ int32_t status_code;
1087
+
1088
+ /** <No documentation available> */
1089
+ LegacySubscriptionHandle_t * handle;
1090
+ } LegacySubscriptionHandleResult_t;
1091
+
1092
+ /** \brief
1093
+ * Helper function for GC-sensitive SDKs to ensure proper unregistering of the subscription in the
1094
+ * future.
1095
+ *
1096
+ * Indeed, the state contained in the `LegacySubscriptionHandle` is otherwise difficult for the
1097
+ * SDK to keep alive once "finalizing the world" has started: some of this state (such as some of
1098
+ * the individual items of `order_by`) may have been disposed of already, which makes it impossible
1099
+ * to then properly call `ditto_remove_subscription()`.
1100
+ */
1101
+ LegacySubscriptionHandleResult_t
1102
+ /* fn */ ditto_add_subscription_with_easier_unregistering (
1103
+ CDitto_t const * ditto,
1104
+ char const * collection,
1105
+ char const * query,
1106
+ slice_ref_uint8_t query_args_cbor,
1107
+ slice_ref_COrderByParam_t order_bys,
1108
+ int32_t limit,
1109
+ uint32_t offset);
1110
+
1080
1111
  /** \brief
1081
1112
  * An opaque handle for each installed transport, heap-allocated and owned by
1082
1113
  * the SDK.
@@ -2486,6 +2517,8 @@ typedef enum Platform {
2486
2517
  /** <No documentation available> */
2487
2518
  PLATFORM_IOS,
2488
2519
  /** <No documentation available> */
2520
+ PLATFORM_TVOS,
2521
+ /** <No documentation available> */
2489
2522
  PLATFORM_ANDROID,
2490
2523
  /** <No documentation available> */
2491
2524
  PLATFORM_LINUX,
@@ -2511,6 +2544,8 @@ typedef enum Language {
2511
2544
  LANGUAGE_UNKNOWN,
2512
2545
  /** <No documentation available> */
2513
2546
  LANGUAGE_RUST,
2547
+ /** <No documentation available> */
2548
+ LANGUAGE_J_V_M_BASED,
2514
2549
  } Language_t;
2515
2550
 
2516
2551
  /** <No documentation available> */
@@ -2734,6 +2769,10 @@ bool
2734
2769
 
2735
2770
  /** \brief
2736
2771
  * Initializes and registers the global Ditto logger.
2772
+ *
2773
+ * This function shouldn't *need* to be called because all of the logging-related FFI calls
2774
+ * *should* start with a call that ensures that the logger is initialized. However, it also
2775
+ * shouldn't hurt to call this.
2737
2776
  */
2738
2777
  void
2739
2778
  /* fn */ ditto_logger_init (void);
@@ -3278,19 +3317,6 @@ void
3278
3317
  CDitto_t const * ditto,
3279
3318
  uint32_t count);
3280
3319
 
3281
- /** <No documentation available> */
3282
- uint32_t
3283
- /* fn */ ditto_set_priority_for_query_overlap_group (
3284
- CDitto_t const * ditto,
3285
- uint8_t prio,
3286
- uint8_t query_overlap_group);
3287
-
3288
- /** <No documentation available> */
3289
- uint32_t
3290
- /* fn */ ditto_set_query_overlap_group (
3291
- CDitto_t const * ditto,
3292
- uint8_t query_overlap_group);
3293
-
3294
3320
  /** <No documentation available> */
3295
3321
  void
3296
3322
  /* fn */ ditto_set_static_tcp_clients (
@@ -3341,9 +3367,7 @@ void
3341
3367
  * peers (including the big peer). This is controlled by [`SyncScope`]s. For
3342
3368
  * the FFI function to get the current sync scope, see
3343
3369
  * [`ditto_small_peer_info_get_sync_scope`]. By default, the small peer info
3344
- * document will not sync to any other peers. To sync this document with the
3345
- * big peer for dashboard and debugging purposes, set a sync scope of
3346
- * `BigPeerOnly`.
3370
+ * document will sync to the big peer.
3347
3371
  *
3348
3372
  * [`SyncScope`]: DittoSmallPeerInfoSyncScope
3349
3373
  */
@@ -3379,15 +3403,14 @@ char *
3379
3403
  *
3380
3404
  * The syncing behavior is dictated by internal [`SyncScope`]s.
3381
3405
  *
3382
- * By default, the small peer info does not sync to other peers as dictated by
3383
- * the default `LocalPeerOnly` scope. To enable syncing small peer info to the
3384
- * big peer, set the `BigPeerOnly` scope.
3406
+ * By default, the small peer info will sync with the big peer, as dictated by
3407
+ * the default `BigPeerOnly` scope.
3385
3408
  *
3386
- * NOTE: Currently SDKs can only set [`BigPeerOnly`] or [`LocalPeerOnly`]
3387
- * sync scopes. [`AllPeers`] and [`SmallPeersOnly`] sync scopes are currently
3388
- * unsupported. Support for `AllPeers` and `SmallPeersOnly` will be added in the
3389
- * future, but for that we will need an API for users to subscribe to the small
3390
- * peer info of other peers.
3409
+ * NOTE: Currently SDKs can only set [`BigPeerOnly`] or [`LocalPeerOnly`] sync
3410
+ * scopes. [`AllPeers`] and [`SmallPeersOnly`] sync scopes are currently
3411
+ * unsupported. Support for `AllPeers` and `SmallPeersOnly` will be added in
3412
+ * the future, but for that we will need an API for users to subscribe to the
3413
+ * small peer info of other peers.
3391
3414
  *
3392
3415
  * [`SyncScope`]: ::ditto_store::sync_scope::SyncScope
3393
3416
  * [`BigPeerOnly`]: ::ditto_store::sync_scope::SyncScope::BigPeerOnly
@@ -3439,9 +3462,7 @@ DittoSmallPeerInfoSyncScope_t
3439
3462
  * peers (including the big peer). This is controlled by [`SyncScope`]s. For
3440
3463
  * the FFI function to set sync scopes, see
3441
3464
  * [`ditto_small_peer_info_set_sync_scope`]. By default, the small peer info
3442
- * document will not sync to any other peers. To sync this document with the
3443
- * big peer for dashboard and debugging purposes, set a sync scope of
3444
- * `BigPeerOnly`.
3465
+ * document will sync to the big peer.
3445
3466
  *
3446
3467
  * [`SyncScope`]: DittoSmallPeerInfoSyncScope
3447
3468
  */
@@ -3579,6 +3600,14 @@ char *
3579
3600
  /* fn */ ditto_transports_diagnostics (
3580
3601
  CDitto_t const * ditto);
3581
3602
 
3603
+ /** \brief
3604
+ * The whole point
3605
+ */
3606
+ int32_t
3607
+ /* fn */ ditto_unregister_and_free_legacy_subscription (
3608
+ CDitto_t const * ditto,
3609
+ LegacySubscriptionHandle_t * handle);
3610
+
3582
3611
  /** <No documentation available> */
3583
3612
  void
3584
3613
  /* fn */ ditto_unregister_local_auth_server (
@@ -4180,7 +4209,7 @@ typedef struct BoxDynFnMut1_void_dittoffi_result_uint64 {
4180
4209
  * - [`FfiError::IoPermissionDenied`]
4181
4210
  * - [`FfiError::IoAlreadyExists`]
4182
4211
  * - [`FfiError::IoOperationFailed`]
4183
- * - [`FfiError::LoggingLogsUnsupported`]
4212
+ * - [`FfiError::Unsupported`]
4184
4213
  * - [`FfiError::Unknown`]
4185
4214
  */
4186
4215
  void
@@ -4791,6 +4820,13 @@ void
4791
4820
  /* fn */ mdns_server_free_handle (
4792
4821
  TransportHandle_MdnsServerPlatformEvent_t * handle);
4793
4822
 
4823
+ /** \brief
4824
+ * The platform advises Rust that the TCP listener will need to be restarted.
4825
+ */
4826
+ void
4827
+ /* fn */ mdns_server_invalidate_listener (
4828
+ TransportHandle_MdnsServerPlatformEvent_t const * handle);
4829
+
4794
4830
  /** \brief
4795
4831
  * The platform advises Rust that we failed to resolve a peer's hostname and
4796
4832
  * port
@@ -4814,140 +4850,6 @@ void
4814
4850
  Vec_char_ptr_t *
4815
4851
  /* fn */ new_c_string_vec (void);
4816
4852
 
4817
- /** \brief
4818
- * An FFI-safe `Poll<()>`.
4819
- */
4820
- /** \remark Has the same ABI as `int8_t` **/
4821
- #ifdef DOXYGEN
4822
- typedef
4823
- #endif
4824
- enum PollFuture {
4825
- /** <No documentation available> */
4826
- POLL_FUTURE_COMPLETED = 0,
4827
- /** <No documentation available> */
4828
- POLL_FUTURE_PENDING = -1,
4829
- }
4830
- #ifndef DOXYGEN
4831
- ; typedef int8_t
4832
- #endif
4833
- PollFuture_t;
4834
-
4835
- /** \brief
4836
- * The layout of `core::task::wake::Context` is opaque/subject to changes.
4837
- */
4838
- typedef struct Opaque_Context Opaque_Context_t;
4839
-
4840
- /** <No documentation available> */
4841
- typedef struct FfiFutureVTable {
4842
- /** <No documentation available> */
4843
- void (*release_vptr)(Erased_t *);
4844
-
4845
- /** <No documentation available> */
4846
- PollFuture_t (*dyn_poll)(Erased_t *, Opaque_Context_t *);
4847
- } FfiFutureVTable_t;
4848
-
4849
- /** <No documentation available> */
4850
- typedef struct VirtualPtr__Erased_ptr_FfiFutureVTable {
4851
- /** <No documentation available> */
4852
- Erased_t * ptr;
4853
-
4854
- /** <No documentation available> */
4855
- FfiFutureVTable_t vtable;
4856
- } VirtualPtr__Erased_ptr_FfiFutureVTable_t;
4857
-
4858
- /** \brief
4859
- * `Box<dyn 'static + Send + FnMut() -> Ret>`
4860
- */
4861
- typedef struct BoxDynFnMut0_void {
4862
- /** <No documentation available> */
4863
- void * env_ptr;
4864
-
4865
- /** <No documentation available> */
4866
- void (*call)(void *);
4867
-
4868
- /** <No documentation available> */
4869
- void (*free)(void *);
4870
- } BoxDynFnMut0_void_t;
4871
-
4872
- /** <No documentation available> */
4873
- typedef struct DropGlueVTable {
4874
- /** <No documentation available> */
4875
- void (*release_vptr)(Erased_t *);
4876
- } DropGlueVTable_t;
4877
-
4878
- /** <No documentation available> */
4879
- typedef struct VirtualPtr__Erased_ptr_DropGlueVTable {
4880
- /** <No documentation available> */
4881
- Erased_t * ptr;
4882
-
4883
- /** <No documentation available> */
4884
- DropGlueVTable_t vtable;
4885
- } VirtualPtr__Erased_ptr_DropGlueVTable_t;
4886
-
4887
- /** <No documentation available> */
4888
- typedef struct FfiFutureExecutorVTable {
4889
- /** <No documentation available> */
4890
- void (*release_vptr)(Erased_t *);
4891
-
4892
- /** <No documentation available> */
4893
- Erased_t * (*retain_vptr)(Erased_t const *);
4894
-
4895
- /** <No documentation available> */
4896
- VirtualPtr__Erased_ptr_FfiFutureVTable_t (*dyn_spawn)(Erased_t const *, VirtualPtr__Erased_ptr_FfiFutureVTable_t);
4897
-
4898
- /** <No documentation available> */
4899
- VirtualPtr__Erased_ptr_FfiFutureVTable_t (*dyn_spawn_blocking)(Erased_t const *, BoxDynFnMut0_void_t);
4900
-
4901
- /** <No documentation available> */
4902
- void (*dyn_block_on)(Erased_t const *, VirtualPtr__Erased_ptr_FfiFutureVTable_t);
4903
-
4904
- /** <No documentation available> */
4905
- VirtualPtr__Erased_ptr_DropGlueVTable_t (*dyn_enter)(Erased_t const *);
4906
- } FfiFutureExecutorVTable_t;
4907
-
4908
- /** <No documentation available> */
4909
- typedef struct VirtualPtr__Erased_ptr_FfiFutureExecutorVTable {
4910
- /** <No documentation available> */
4911
- Erased_t * ptr;
4912
-
4913
- /** <No documentation available> */
4914
- FfiFutureExecutorVTable_t vtable;
4915
- } VirtualPtr__Erased_ptr_FfiFutureExecutorVTable_t;
4916
-
4917
- /** <No documentation available> */
4918
- typedef struct FfiFnMutVTable {
4919
- /** <No documentation available> */
4920
- void (*release_vptr)(Erased_t *);
4921
-
4922
- /** <No documentation available> */
4923
- void (*call)(Erased_t *);
4924
- } FfiFnMutVTable_t;
4925
-
4926
- /** <No documentation available> */
4927
- typedef struct VirtualPtr__Erased_ptr_FfiFnMutVTable {
4928
- /** <No documentation available> */
4929
- Erased_t * ptr;
4930
-
4931
- /** <No documentation available> */
4932
- FfiFnMutVTable_t vtable;
4933
- } VirtualPtr__Erased_ptr_FfiFnMutVTable_t;
4934
-
4935
- /** \brief
4936
- * Keep in sync with `/rust/dittolive-ditto/dittoffi.rs`
4937
- */
4938
- typedef struct ExecutorFunctions {
4939
- /** <No documentation available> */
4940
- VirtualPtr__Erased_ptr_FfiFutureExecutorVTable_t (*get_current_handle)(void);
4941
-
4942
- /** <No documentation available> */
4943
- void (*block_in_place)(VirtualPtr__Erased_ptr_FfiFnMutVTable_t);
4944
- } ExecutorFunctions_t;
4945
-
4946
- /** <No documentation available> */
4947
- void
4948
- /* fn */ register_executor_functions (
4949
- ExecutorFunctions_t fns);
4950
-
4951
4853
  /** \brief
4952
4854
  * The SDK requests to drop its handle to this TCP Client transport
4953
4855
  */
package/types/ditto.d.ts CHANGED
@@ -821,6 +821,14 @@ declare class MutableDocumentPath {
821
821
  * The types of an {@link UpdateResult}.
822
822
  */
823
823
  type UpdateResultType = 'set' | 'incremented' | 'removed';
824
+ /**
825
+ * Provides information about a successful update operation on a document.
826
+ *
827
+ * The update result can be one of the following types:
828
+ * - `set`
829
+ * - `removed`
830
+ * - `incremented`
831
+ */
824
832
  declare class UpdateResult {
825
833
  /** The update result's type. */
826
834
  readonly type: UpdateResultType;