@dittolive/ditto 4.12.0 → 5.0.0-experimental.js-cocoapods-publishing.3

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.
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dittolive/ditto",
3
- "version": "4.12.0",
3
+ "version": "5.0.0-experimental.js-cocoapods-publishing.3",
4
4
  "description": "Ditto is a cross-platform SDK that allows apps to sync with and even without internet connectivity.",
5
5
  "homepage": "https://ditto.com",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -0,0 +1,33 @@
1
+ // Here we use a typemap to say that for functions that return `char *` and are
2
+ // marked with the `%newobject` directive we have custom behaviour for freeing
3
+ // the returned value. This ensures all strings get cleaned up.
4
+ %typemap(newfree) char * {
5
+ if ($1 != NULL) {
6
+ ditto_c_string_free($1);
7
+ }
8
+ }
9
+
10
+ %newobject ditto_auth_client_get_app_id;
11
+ %newobject ditto_auth_client_user_id;
12
+ %newobject ditto_document_id_query_compatible;
13
+ %newobject ditto_error_message;
14
+ %newobject ditto_error_message_peek;
15
+ %newobject ditto_get_complete_attachment_path;
16
+ %newobject ditto_get_sdk_version;
17
+ %newobject ditto_presence_v1;
18
+ %newobject ditto_presence_v2;
19
+ %newobject ditto_presence_v3;
20
+ %newobject ditto_sdk_transports_android_missing_permissions;
21
+ %newobject ditto_set_device_name;
22
+ %newobject ditto_small_peer_info_get_metadata;
23
+ %newobject ditto_transports_diagnostics;
24
+ %newobject dittoffi_authentication_status_user_id;
25
+ %newobject dittoffi_base64_encode;
26
+ %newobject dittoffi_crypto_generate_secure_random_token;
27
+ %newobject dittoffi_ditto_capture_stack_trace_string_internal;
28
+ %newobject dittoffi_error_description;
29
+ %newobject dittoffi_get_sdk_semver;
30
+ %newobject dittoffi_panic_message;
31
+ %newobject dittoffi_panic_stack_trace_string;
32
+ %newobject dittoffi_query_result_item_json;
33
+ %newobject dittoffi_sync_subscription_query_string;
@@ -1027,20 +1027,6 @@ void
1027
1027
  /* fn */ ditto_clear_presence_callback (
1028
1028
  CDitto_t const * ditto);
1029
1029
 
1030
- /** \brief
1031
- * Deregister v1 presence callback, releasing the receiver on the SDK side.
1032
- */
1033
- void
1034
- /* fn */ ditto_clear_presence_v1_callback (
1035
- CDitto_t const * ditto);
1036
-
1037
- /** \brief
1038
- * Deregister v2 presence callback, releasing the receiver on the SDK side.
1039
- */
1040
- void
1041
- /* fn */ ditto_clear_presence_v2_callback (
1042
- CDitto_t const * ditto);
1043
-
1044
1030
  /** \brief
1045
1031
  * Deregister v3 presence callback, releasing the receiver on the SDK side.
1046
1032
  */
@@ -2253,20 +2239,6 @@ uint32_t
2253
2239
  AttachmentFileOperation_t file_operation,
2254
2240
  CAttachment_t * out_attachment);
2255
2241
 
2256
- /** \brief
2257
- * Request data showing who we are connected to in a user-friendly way.
2258
- */
2259
- char *
2260
- /* fn */ ditto_presence_v1 (
2261
- CDitto_t const * ditto);
2262
-
2263
- /** \brief
2264
- * Request data showing who we are connected to in a user-friendly way.
2265
- */
2266
- char *
2267
- /* fn */ ditto_presence_v2 (
2268
- CDitto_t const * ditto);
2269
-
2270
2242
  /** \brief
2271
2243
  * Request data showing who we are connected to in a user-friendly way.
2272
2244
  */
@@ -2382,32 +2354,6 @@ void
2382
2354
  void (*release)(void *),
2383
2355
  void (*c_cb)(void *, char *));
2384
2356
 
2385
- /** \brief
2386
- * Register a function that will be called every time the connection state
2387
- * of remote peers changes.
2388
- * REMOVE THIS IN V4
2389
- */
2390
- void
2391
- /* fn */ ditto_register_presence_v1_callback (
2392
- CDitto_t const * ditto,
2393
- void * ctx,
2394
- void (*retain)(void *),
2395
- void (*release)(void *),
2396
- void (*c_cb)(void *, char const *));
2397
-
2398
- /** \brief
2399
- * Register a function that will be called every time the connection state
2400
- * of remote peers changes.
2401
- * REMOVE THIS IN V4
2402
- */
2403
- void
2404
- /* fn */ ditto_register_presence_v2_callback (
2405
- CDitto_t const * ditto,
2406
- void * ctx,
2407
- void (*retain)(void *),
2408
- void (*release)(void *),
2409
- void (*c_cb)(void *, char const *));
2410
-
2411
2357
  /** \brief
2412
2358
  * User-friendly categories describing where condition events arose
2413
2359
  */
@@ -4257,27 +4203,6 @@ void
4257
4203
  /* fn */ dittoffi_store_observer_free (
4258
4204
  dittoffi_store_observer_t * _observer);
4259
4205
 
4260
- /** \brief
4261
- * Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
4262
- */
4263
- typedef struct Vec_dittoffi_store_observer_ptr {
4264
- /** <No documentation available> */
4265
- dittoffi_store_observer_t * * ptr;
4266
-
4267
- /** <No documentation available> */
4268
- size_t len;
4269
-
4270
- /** <No documentation available> */
4271
- size_t cap;
4272
- } Vec_dittoffi_store_observer_ptr_t;
4273
-
4274
- /** \brief
4275
- * Free a Vec of [`FfiStoreObserver`]
4276
- */
4277
- void
4278
- /* fn */ dittoffi_store_observer_free_sparse (
4279
- Vec_dittoffi_store_observer_ptr_t _vec);
4280
-
4281
4206
  /** \brief
4282
4207
  * Returns the inner ID of the given observer.
4283
4208
  *
@@ -4295,12 +4220,26 @@ bool
4295
4220
  dittoffi_store_observer_t const * observer);
4296
4221
 
4297
4222
  /** \brief
4298
- * Returns the DQL query arguments of the given observer, if any were given.
4223
+ * Returns the CBOR-serialized DQL query arguments of the given observer, if any were given.
4299
4224
  */
4300
4225
  slice_boxed_uint8_t
4301
4226
  /* fn */ dittoffi_store_observer_query_arguments (
4302
4227
  dittoffi_store_observer_t const * observer);
4303
4228
 
4229
+ /** \brief
4230
+ * Returns the CBOR-serialized DQL query arguments of the given observer, if any were given.
4231
+ */
4232
+ slice_boxed_uint8_t
4233
+ /* fn */ dittoffi_store_observer_query_arguments_cbor (
4234
+ dittoffi_store_observer_t const * observer);
4235
+
4236
+ /** \brief
4237
+ * Returns the JSON-serialized DQL query arguments of the given observer, if any were given.
4238
+ */
4239
+ slice_boxed_uint8_t
4240
+ /* fn */ dittoffi_store_observer_query_arguments_json (
4241
+ dittoffi_store_observer_t const * observer);
4242
+
4304
4243
  /** \brief
4305
4244
  * Returns the DQL query string of the given observer.
4306
4245
  */
@@ -4308,6 +4247,20 @@ char *
4308
4247
  /* fn */ dittoffi_store_observer_query_string (
4309
4248
  dittoffi_store_observer_t const * observer);
4310
4249
 
4250
+ /** \brief
4251
+ * Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
4252
+ */
4253
+ typedef struct Vec_dittoffi_store_observer_ptr {
4254
+ /** <No documentation available> */
4255
+ dittoffi_store_observer_t * * ptr;
4256
+
4257
+ /** <No documentation available> */
4258
+ size_t len;
4259
+
4260
+ /** <No documentation available> */
4261
+ size_t cap;
4262
+ } Vec_dittoffi_store_observer_ptr_t;
4263
+
4311
4264
  /** \brief
4312
4265
  * Returns a list of all registered observers.
4313
4266
  */
@@ -4315,6 +4268,22 @@ Vec_dittoffi_store_observer_ptr_t
4315
4268
  /* fn */ dittoffi_store_observers (
4316
4269
  CDitto_t const * ditto);
4317
4270
 
4271
+ /** \brief
4272
+ * Free a Vec of [`FfiStoreObserver`]s.
4273
+ *
4274
+ * # IMPORTANT
4275
+ *
4276
+ * This freeing function ignores the given `.len` and treats it as if `.len = 0` (to avoid
4277
+ * double-freeing).
4278
+ *
4279
+ * SDK callers should have taken ownership of each individual `FfiStoreObserver` (either by having
4280
+ * freed each, or by having wrapped them in some SDK class that eventually will), in order to avoid
4281
+ * memory leaks.
4282
+ */
4283
+ void
4284
+ /* fn */ dittoffi_store_observers_free_sparse (
4285
+ Vec_dittoffi_store_observer_ptr_t vec);
4286
+
4318
4287
  /** \brief
4319
4288
  * `Arc<dyn Send + Sync + Fn() -> Ret>`
4320
4289
  */
@@ -4346,6 +4315,16 @@ typedef struct BoxDynFnMut2_void_dittoffi_query_result_ptr_ArcDynFn0_void {
4346
4315
  void (*free)(void *);
4347
4316
  } BoxDynFnMut2_void_dittoffi_query_result_ptr_ArcDynFn0_void_t;
4348
4317
 
4318
+ /** \brief
4319
+ * Ffi-compatible callback wrapper for store observers.
4320
+ *
4321
+ * # Notes
4322
+ *
4323
+ * - SDK clients construct this callback and we call it sequentially (non-overlapping), hence
4324
+ * `FnMut`.
4325
+ */
4326
+ typedef BoxDynFnMut2_void_dittoffi_query_result_ptr_ArcDynFn0_void_t dittoffi_store_observation_handler_with_signal_next_t;
4327
+
4349
4328
  /** <No documentation available> */
4350
4329
  typedef struct dittoffi_result_dittoffi_store_observer_ptr {
4351
4330
  /** \brief
@@ -4371,7 +4350,7 @@ dittoffi_result_dittoffi_store_observer_ptr_t
4371
4350
  CDitto_t const * ditto,
4372
4351
  char const * query,
4373
4352
  slice_ref_uint8_t query_args_cbor,
4374
- BoxDynFnMut2_void_dittoffi_query_result_ptr_ArcDynFn0_void_t callback);
4353
+ dittoffi_store_observation_handler_with_signal_next_t handler);
4375
4354
 
4376
4355
  /** \brief
4377
4356
  * Returns all transactions currently in flight.
@@ -4442,10 +4421,19 @@ bool
4442
4421
  dittoffi_sync_subscription_t const * sync_subscription);
4443
4422
 
4444
4423
  /** \brief
4445
- * Returns the DQL arguments object associated with the given sync subscription, if one exists.
4424
+ * Returns the CBOR-serialized DQL arguments object associated with the given sync subscription, if
4425
+ * one exists.
4426
+ */
4427
+ slice_boxed_uint8_t
4428
+ /* fn */ dittoffi_sync_subscription_query_arguments_cbor (
4429
+ dittoffi_sync_subscription_t const * sync_subscription);
4430
+
4431
+ /** \brief
4432
+ * Returns the JSON-serialized DQL arguments object associated with the given sync subscription, if
4433
+ * one exists.
4446
4434
  */
4447
4435
  slice_boxed_uint8_t
4448
- /* fn */ dittoffi_sync_subscription_query_arguments (
4436
+ /* fn */ dittoffi_sync_subscription_query_arguments_json (
4449
4437
  dittoffi_sync_subscription_t const * sync_subscription);
4450
4438
 
4451
4439
  /** \brief
@@ -4490,7 +4478,7 @@ Vec_dittoffi_sync_subscription_ptr_t
4490
4478
  */
4491
4479
  void
4492
4480
  /* fn */ dittoffi_sync_subscriptions_free_sparse (
4493
- Vec_dittoffi_sync_subscription_ptr_t v);
4481
+ Vec_dittoffi_sync_subscription_ptr_t vec);
4494
4482
 
4495
4483
  /** \brief
4496
4484
  * The action to take when completing a transaction.