@dittolive/ditto 4.11.2-rc.1 → 4.12.0-experimental-untangle.0
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.
- package/DittoReactNative.podspec +9 -5
- package/README.md +3 -3
- package/node/ditto.cjs.js +1701 -371
- package/node/ditto.darwin-arm64.node +0 -0
- package/node/ditto.darwin-x64.node +0 -0
- package/node/ditto.linux-arm64.node +0 -0
- package/node/ditto.linux-x64.node +0 -0
- package/node/ditto.win32-x64.node +0 -0
- package/package.json +4 -4
- package/react-native/android/dittoffi/src/bus.h +44 -12
- package/react-native/android/dittoffi/src/dittoffi.h +183 -364
- package/react-native/android/dittoffi/src/dittoffi_java.cpp +7704 -8420
- package/react-native/android/dittoffi/src/dittostore_java.i +1 -0
- package/react-native/cpp/include/DQL.h +2 -0
- package/react-native/cpp/include/IO.h +2 -0
- package/react-native/cpp/include/Lifecycle.h +7 -0
- package/react-native/cpp/include/Platform.h +1 -1
- package/react-native/cpp/src/DQL.cpp +50 -4
- package/react-native/cpp/src/IO.cpp +40 -0
- package/react-native/cpp/src/Lifecycle.cpp +181 -1
- package/react-native/cpp/src/Logger.cpp +1 -1
- package/react-native/cpp/src/Misc.cpp +13 -2
- package/react-native/cpp/src/Presence.cpp +5 -1
- package/react-native/cpp/src/Sync.cpp +5 -1
- package/react-native/cpp/src/Transports.cpp +21 -16
- package/react-native/cpp/src/main.cpp +11 -1
- package/react-native/ditto.es6.js +1 -1
- package/react-native/ios/DittoRNSDK.mm +7 -2
- package/types/ditto.d.ts +4153 -3090
- package/web/ditto.es6.js +1 -1
- package/web/ditto.umd.js +1 -1
- package/web/ditto.wasm +0 -0
|
@@ -175,66 +175,7 @@ void
|
|
|
175
175
|
*
|
|
176
176
|
* The C interface of `TransportHandle` is thread-safe (`Send + Sync`).
|
|
177
177
|
*/
|
|
178
|
-
typedef struct
|
|
179
|
-
|
|
180
|
-
/** \brief
|
|
181
|
-
* Generic enum used by crate and platforms to indicate a connection status
|
|
182
|
-
*/
|
|
183
|
-
typedef enum ConnectState {
|
|
184
|
-
/** <No documentation available> */
|
|
185
|
-
CONNECT_STATE_DISCONNECTED,
|
|
186
|
-
/** <No documentation available> */
|
|
187
|
-
CONNECT_STATE_CONNECTED,
|
|
188
|
-
/** <No documentation available> */
|
|
189
|
-
CONNECT_STATE_CONNECTING,
|
|
190
|
-
/** <No documentation available> */
|
|
191
|
-
CONNECT_STATE_DISCONNECTING,
|
|
192
|
-
} ConnectState_t;
|
|
193
|
-
|
|
194
|
-
/** \brief
|
|
195
|
-
* The platform advises Rust that a peer has changed its current connection
|
|
196
|
-
* status
|
|
197
|
-
*/
|
|
198
|
-
void
|
|
199
|
-
/* fn */ awdl_client_connect_state_changed (
|
|
200
|
-
TransportHandle_AwdlPlatformEvent_t const * handle,
|
|
201
|
-
char const * announce,
|
|
202
|
-
ConnectState_t state);
|
|
203
|
-
|
|
204
|
-
/** \brief
|
|
205
|
-
* The platform advises Rust that a complete message has been received from a
|
|
206
|
-
* remote peer
|
|
207
|
-
*/
|
|
208
|
-
void
|
|
209
|
-
/* fn */ awdl_client_data_available (
|
|
210
|
-
TransportHandle_AwdlPlatformEvent_t const * handle,
|
|
211
|
-
char const * announce);
|
|
212
|
-
|
|
213
|
-
/** \brief
|
|
214
|
-
* The platform advises Rust that a peer has been identified. We know only its
|
|
215
|
-
* announce string.
|
|
216
|
-
*/
|
|
217
|
-
void
|
|
218
|
-
/* fn */ awdl_client_platform_peer_appeared (
|
|
219
|
-
TransportHandle_AwdlPlatformEvent_t const * handle,
|
|
220
|
-
char const * announce);
|
|
221
|
-
|
|
222
|
-
/** \brief
|
|
223
|
-
* The platform advises Rust that a peer has disappeared.
|
|
224
|
-
*/
|
|
225
|
-
void
|
|
226
|
-
/* fn */ awdl_client_platform_peer_disappeared (
|
|
227
|
-
TransportHandle_AwdlPlatformEvent_t const * handle,
|
|
228
|
-
char const * announce);
|
|
229
|
-
|
|
230
|
-
/** \brief
|
|
231
|
-
* The platform advises Rust that a given peer is now clear to queue up a new
|
|
232
|
-
* message whenever one is ready to go
|
|
233
|
-
*/
|
|
234
|
-
void
|
|
235
|
-
/* fn */ awdl_client_ready_to_send (
|
|
236
|
-
TransportHandle_AwdlPlatformEvent_t const * handle,
|
|
237
|
-
char const * announce);
|
|
178
|
+
typedef struct TransportHandle_BlePlatformEvent TransportHandle_BlePlatformEvent_t;
|
|
238
179
|
|
|
239
180
|
/** \brief
|
|
240
181
|
* Generic enum used by crate and platforms to indicate online-ness.
|
|
@@ -318,96 +259,6 @@ typedef enum TransportCondition {
|
|
|
318
259
|
TRANSPORT_CONDITION_TEMPORARILY_UNAVAILABLE,
|
|
319
260
|
} TransportCondition_t;
|
|
320
261
|
|
|
321
|
-
/** \brief
|
|
322
|
-
* The platform advises Rust that searching status changed
|
|
323
|
-
*/
|
|
324
|
-
void
|
|
325
|
-
/* fn */ awdl_client_scanning_state_changed (
|
|
326
|
-
TransportHandle_AwdlPlatformEvent_t const * handle,
|
|
327
|
-
OnlineState_t state,
|
|
328
|
-
TransportCondition_t condition);
|
|
329
|
-
|
|
330
|
-
/** \brief
|
|
331
|
-
* The platform advises Rust that advertising status changed
|
|
332
|
-
*/
|
|
333
|
-
void
|
|
334
|
-
/* fn */ awdl_server_advertising_state_changed (
|
|
335
|
-
TransportHandle_AwdlPlatformEvent_t const * handle,
|
|
336
|
-
OnlineState_t state,
|
|
337
|
-
TransportCondition_t condition);
|
|
338
|
-
|
|
339
|
-
/** \brief
|
|
340
|
-
* The platform advises Rust that a peer has changed its current connection
|
|
341
|
-
* status
|
|
342
|
-
*/
|
|
343
|
-
void
|
|
344
|
-
/* fn */ awdl_server_connect_state_changed (
|
|
345
|
-
TransportHandle_AwdlPlatformEvent_t const * handle,
|
|
346
|
-
int64_t platform_id,
|
|
347
|
-
ConnectState_t state);
|
|
348
|
-
|
|
349
|
-
/** \brief
|
|
350
|
-
* The platform advises Rust that a complete message has been received from a
|
|
351
|
-
* remote peer
|
|
352
|
-
*/
|
|
353
|
-
void
|
|
354
|
-
/* fn */ awdl_server_data_available (
|
|
355
|
-
TransportHandle_AwdlPlatformEvent_t const * handle,
|
|
356
|
-
int64_t platform_id);
|
|
357
|
-
|
|
358
|
-
/** \brief
|
|
359
|
-
* The platform advises Rust that a peer has been identified. We know only its
|
|
360
|
-
* announce string.
|
|
361
|
-
*/
|
|
362
|
-
void
|
|
363
|
-
/* fn */ awdl_server_platform_peer_appeared (
|
|
364
|
-
TransportHandle_AwdlPlatformEvent_t const * handle,
|
|
365
|
-
int64_t platform_id);
|
|
366
|
-
|
|
367
|
-
/** \brief
|
|
368
|
-
* The platform advises Rust that a peer has disappeared.
|
|
369
|
-
*/
|
|
370
|
-
void
|
|
371
|
-
/* fn */ awdl_server_platform_peer_disappeared (
|
|
372
|
-
TransportHandle_AwdlPlatformEvent_t const * handle,
|
|
373
|
-
int64_t platform_id);
|
|
374
|
-
|
|
375
|
-
/** \brief
|
|
376
|
-
* The platform advises Rust that a given peer is now clear to queue up a new
|
|
377
|
-
* message whenever one is ready to go
|
|
378
|
-
*/
|
|
379
|
-
void
|
|
380
|
-
/* fn */ awdl_server_ready_to_send (
|
|
381
|
-
TransportHandle_AwdlPlatformEvent_t const * handle,
|
|
382
|
-
int64_t platform_id);
|
|
383
|
-
|
|
384
|
-
/** \brief
|
|
385
|
-
* An opaque handle for each installed transport, heap-allocated and owned by
|
|
386
|
-
* the SDK.
|
|
387
|
-
*
|
|
388
|
-
* A pointer to this handle is used to send platform events over FFI. In the
|
|
389
|
-
* future this handle will be the SDK's only point of control over the
|
|
390
|
-
* transport once created. In particular, a transport will be removed by
|
|
391
|
-
* freeing the handle. The concept of online and offline will be eliminated.
|
|
392
|
-
* (i.e., if you don't want a transport, remove it.)
|
|
393
|
-
*
|
|
394
|
-
* For now, the `Peer` object holds the transports and provides an API based on
|
|
395
|
-
* a numeric id assigned to each transport instance. Until that is removed, the
|
|
396
|
-
* id still exists and the SDK can request it from the opaque handle over FFI.
|
|
397
|
-
*
|
|
398
|
-
* For each transport type, define an `extern "C"` function to free that
|
|
399
|
-
* specific monomorphisation of the `TransportHandle` using `Box::from_raw`,
|
|
400
|
-
* plus a function to retrieve the transport id, which will be removed later.
|
|
401
|
-
*
|
|
402
|
-
* Safety: The SDK owns the `TransportHandle`. It is responsible for ensuring
|
|
403
|
-
* that it does not use the pointer to the `TransportHandle` after freeing it
|
|
404
|
-
* with its respective function. In Rust we will assume it is okay to unsafely
|
|
405
|
-
* dereference a handle.
|
|
406
|
-
*
|
|
407
|
-
* The C interface of `TransportHandle` is thread-safe (`Send + Sync`).
|
|
408
|
-
*/
|
|
409
|
-
typedef struct TransportHandle_BlePlatformEvent TransportHandle_BlePlatformEvent_t;
|
|
410
|
-
|
|
411
262
|
/** <No documentation available> */
|
|
412
263
|
void
|
|
413
264
|
/* fn */ ble_advertising_state_changed (
|
|
@@ -459,6 +310,20 @@ void
|
|
|
459
310
|
TransportHandle_BlePlatformEvent_t const * handle,
|
|
460
311
|
uint8_16_array_t const * central_uuid);
|
|
461
312
|
|
|
313
|
+
/** \brief
|
|
314
|
+
* Generic enum used by crate and platforms to indicate a connection status
|
|
315
|
+
*/
|
|
316
|
+
typedef enum ConnectState {
|
|
317
|
+
/** <No documentation available> */
|
|
318
|
+
CONNECT_STATE_DISCONNECTED,
|
|
319
|
+
/** <No documentation available> */
|
|
320
|
+
CONNECT_STATE_CONNECTED,
|
|
321
|
+
/** <No documentation available> */
|
|
322
|
+
CONNECT_STATE_CONNECTING,
|
|
323
|
+
/** <No documentation available> */
|
|
324
|
+
CONNECT_STATE_DISCONNECTING,
|
|
325
|
+
} ConnectState_t;
|
|
326
|
+
|
|
462
327
|
/** <No documentation available> */
|
|
463
328
|
void
|
|
464
329
|
/* fn */ ble_connection_state_changed (
|
|
@@ -539,6 +404,21 @@ void
|
|
|
539
404
|
/** <No documentation available> */
|
|
540
405
|
typedef struct CDitto CDitto_t;
|
|
541
406
|
|
|
407
|
+
|
|
408
|
+
#include <stdbool.h>
|
|
409
|
+
|
|
410
|
+
/** \brief
|
|
411
|
+
* Rust-level representation of the result of a send operation, converted from
|
|
412
|
+
* a bitfield
|
|
413
|
+
*/
|
|
414
|
+
typedef struct SendResult {
|
|
415
|
+
/** <No documentation available> */
|
|
416
|
+
bool accepted;
|
|
417
|
+
|
|
418
|
+
/** <No documentation available> */
|
|
419
|
+
bool wait_for_ready;
|
|
420
|
+
} SendResult_t;
|
|
421
|
+
|
|
542
422
|
/** \brief
|
|
543
423
|
* `&'lt mut [T]` but with a guaranteed `#[repr(C)]` layout.
|
|
544
424
|
*
|
|
@@ -570,71 +450,6 @@ typedef struct slice_mut_uint8 {
|
|
|
570
450
|
size_t len;
|
|
571
451
|
} slice_mut_uint8_t;
|
|
572
452
|
|
|
573
|
-
/** <No documentation available> */
|
|
574
|
-
typedef struct AwdlClientCallbacks {
|
|
575
|
-
/** <No documentation available> */
|
|
576
|
-
void (*start_searching)(void *, char const *, char const *);
|
|
577
|
-
|
|
578
|
-
/** <No documentation available> */
|
|
579
|
-
void (*stop_searching)(void *);
|
|
580
|
-
|
|
581
|
-
/** <No documentation available> */
|
|
582
|
-
void (*request_connect)(void *, char const *);
|
|
583
|
-
|
|
584
|
-
/** <No documentation available> */
|
|
585
|
-
void (*request_disconnect)(void *, char const *);
|
|
586
|
-
|
|
587
|
-
/** <No documentation available> */
|
|
588
|
-
int32_t (*send_data)(void *, char const *, slice_ref_uint8_t);
|
|
589
|
-
|
|
590
|
-
/** <No documentation available> */
|
|
591
|
-
int32_t (*read_data)(void *, char const *, slice_mut_uint8_t);
|
|
592
|
-
} AwdlClientCallbacks_t;
|
|
593
|
-
|
|
594
|
-
/** <No documentation available> */
|
|
595
|
-
typedef struct AwdlServerCallbacks {
|
|
596
|
-
/** <No documentation available> */
|
|
597
|
-
void (*start_advertising)(void *, char const *, char const *);
|
|
598
|
-
|
|
599
|
-
/** <No documentation available> */
|
|
600
|
-
void (*stop_advertising)(void *);
|
|
601
|
-
|
|
602
|
-
/** <No documentation available> */
|
|
603
|
-
void (*request_disconnect)(void *, int64_t);
|
|
604
|
-
|
|
605
|
-
/** <No documentation available> */
|
|
606
|
-
int32_t (*send_data)(void *, int64_t, slice_ref_uint8_t);
|
|
607
|
-
|
|
608
|
-
/** <No documentation available> */
|
|
609
|
-
int32_t (*read_data)(void *, int64_t, slice_mut_uint8_t);
|
|
610
|
-
} AwdlServerCallbacks_t;
|
|
611
|
-
|
|
612
|
-
/** <No documentation available> */
|
|
613
|
-
TransportHandle_AwdlPlatformEvent_t *
|
|
614
|
-
/* fn */ ditto_add_awdl_transport (
|
|
615
|
-
CDitto_t const * ditto,
|
|
616
|
-
AwdlClientCallbacks_t client_callbacks,
|
|
617
|
-
void * client_ctx,
|
|
618
|
-
AwdlServerCallbacks_t server_callbacks,
|
|
619
|
-
void * server_ctx,
|
|
620
|
-
void (*retain)(void *),
|
|
621
|
-
void (*release)(void *));
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
#include <stdbool.h>
|
|
625
|
-
|
|
626
|
-
/** \brief
|
|
627
|
-
* Rust-level representation of the result of a send operation, converted from
|
|
628
|
-
* a bitfield
|
|
629
|
-
*/
|
|
630
|
-
typedef struct SendResult {
|
|
631
|
-
/** <No documentation available> */
|
|
632
|
-
bool accepted;
|
|
633
|
-
|
|
634
|
-
/** <No documentation available> */
|
|
635
|
-
bool wait_for_ready;
|
|
636
|
-
} SendResult_t;
|
|
637
|
-
|
|
638
453
|
/** <No documentation available> */
|
|
639
454
|
typedef struct BleClientCallbacks {
|
|
640
455
|
/** <No documentation available> */
|
|
@@ -694,64 +509,6 @@ TransportHandle_BlePlatformEvent_t *
|
|
|
694
509
|
void (*retain)(void *),
|
|
695
510
|
void (*release)(void *));
|
|
696
511
|
|
|
697
|
-
/** <No documentation available> */
|
|
698
|
-
typedef struct MdnsClientCallbacks {
|
|
699
|
-
/** <No documentation available> */
|
|
700
|
-
void (*start_searching)(void *, char const *);
|
|
701
|
-
|
|
702
|
-
/** <No documentation available> */
|
|
703
|
-
void (*stop_searching)(void *);
|
|
704
|
-
|
|
705
|
-
/** <No documentation available> */
|
|
706
|
-
void (*resolve_service)(void *, slice_ref_uint8_t);
|
|
707
|
-
} MdnsClientCallbacks_t;
|
|
708
|
-
|
|
709
|
-
/** <No documentation available> */
|
|
710
|
-
typedef struct MdnsServerCallbacks {
|
|
711
|
-
/** <No documentation available> */
|
|
712
|
-
void (*start_advertising)(void *, char const *, char const *, uint16_t);
|
|
713
|
-
|
|
714
|
-
/** <No documentation available> */
|
|
715
|
-
void (*stop_advertising)(void *);
|
|
716
|
-
} MdnsServerCallbacks_t;
|
|
717
|
-
|
|
718
|
-
/** \brief
|
|
719
|
-
* An opaque handle for each installed transport, heap-allocated and owned by
|
|
720
|
-
* the SDK.
|
|
721
|
-
*
|
|
722
|
-
* A pointer to this handle is used to send platform events over FFI. In the
|
|
723
|
-
* future this handle will be the SDK's only point of control over the
|
|
724
|
-
* transport once created. In particular, a transport will be removed by
|
|
725
|
-
* freeing the handle. The concept of online and offline will be eliminated.
|
|
726
|
-
* (i.e., if you don't want a transport, remove it.)
|
|
727
|
-
*
|
|
728
|
-
* For now, the `Peer` object holds the transports and provides an API based on
|
|
729
|
-
* a numeric id assigned to each transport instance. Until that is removed, the
|
|
730
|
-
* id still exists and the SDK can request it from the opaque handle over FFI.
|
|
731
|
-
*
|
|
732
|
-
* For each transport type, define an `extern "C"` function to free that
|
|
733
|
-
* specific monomorphisation of the `TransportHandle` using `Box::from_raw`,
|
|
734
|
-
* plus a function to retrieve the transport id, which will be removed later.
|
|
735
|
-
*
|
|
736
|
-
* Safety: The SDK owns the `TransportHandle`. It is responsible for ensuring
|
|
737
|
-
* that it does not use the pointer to the `TransportHandle` after freeing it
|
|
738
|
-
* with its respective function. In Rust we will assume it is okay to unsafely
|
|
739
|
-
* dereference a handle.
|
|
740
|
-
*
|
|
741
|
-
* The C interface of `TransportHandle` is thread-safe (`Send + Sync`).
|
|
742
|
-
*/
|
|
743
|
-
typedef struct TransportHandle_MdnsPlatformEvent TransportHandle_MdnsPlatformEvent_t;
|
|
744
|
-
|
|
745
|
-
/** <No documentation available> */
|
|
746
|
-
TransportHandle_MdnsPlatformEvent_t *
|
|
747
|
-
/* fn */ ditto_add_mdns_discovery (
|
|
748
|
-
CDitto_t const * ditto,
|
|
749
|
-
MdnsClientCallbacks_t client_callbacks,
|
|
750
|
-
MdnsServerCallbacks_t server_callbacks,
|
|
751
|
-
void * ctx,
|
|
752
|
-
void (*retain)(void *),
|
|
753
|
-
void (*release)(void *));
|
|
754
|
-
|
|
755
512
|
/** \brief
|
|
756
513
|
* The direction to sort the results of a query.
|
|
757
514
|
*/
|
|
@@ -1010,17 +767,6 @@ void
|
|
|
1010
767
|
CDitto_t const * ditto,
|
|
1011
768
|
CLoginProvider_t * login_provider);
|
|
1012
769
|
|
|
1013
|
-
/** \brief
|
|
1014
|
-
* The SDK requests to drop its handle to the AWDL Transport
|
|
1015
|
-
*
|
|
1016
|
-
* At some point dropping this events channel will effectively shut down and
|
|
1017
|
-
* remove the Transport. At time of writing, the Transport is still owned
|
|
1018
|
-
* within Peer.
|
|
1019
|
-
*/
|
|
1020
|
-
void
|
|
1021
|
-
/* fn */ ditto_awdl_transport_free_handle (
|
|
1022
|
-
TransportHandle_AwdlPlatformEvent_t * handle);
|
|
1023
|
-
|
|
1024
770
|
/** \brief
|
|
1025
771
|
* The SDK requests to drop its handle to the BLE Transport
|
|
1026
772
|
*
|
|
@@ -2443,17 +2189,6 @@ CDitto_t *
|
|
|
2443
2189
|
CIdentityConfig_t * identity_config,
|
|
2444
2190
|
HistoryTracking_t history_tracking);
|
|
2445
2191
|
|
|
2446
|
-
/** \brief
|
|
2447
|
-
* The SDK requests to drop its handle to the mDNS transport
|
|
2448
|
-
*
|
|
2449
|
-
* At some point dropping this events channel will effectively shut down and
|
|
2450
|
-
* remove the Transport. At time of writing, the Transport is still owned
|
|
2451
|
-
* within Peer.
|
|
2452
|
-
*/
|
|
2453
|
-
void
|
|
2454
|
-
/* fn */ ditto_mdns_transport_free_handle (
|
|
2455
|
-
TransportHandle_MdnsPlatformEvent_t * handle);
|
|
2456
|
-
|
|
2457
2192
|
/** <No documentation available> */
|
|
2458
2193
|
typedef struct CAttachment {
|
|
2459
2194
|
/** <No documentation available> */
|
|
@@ -2799,10 +2534,6 @@ typedef enum DittoSdkTransportsError {
|
|
|
2799
2534
|
DITTO_SDK_TRANSPORTS_ERROR_MISSING_BLUETOOTH_INFO_PLIST_ENTRY = 3,
|
|
2800
2535
|
/** <No documentation available> */
|
|
2801
2536
|
DITTO_SDK_TRANSPORTS_ERROR_MISSING_BLUETOOTH_U_I_BACKGROUND_MODES_INFO_PLIST_ENTRY = 4,
|
|
2802
|
-
/** <No documentation available> */
|
|
2803
|
-
DITTO_SDK_TRANSPORTS_ERROR_MISSING_LOCAL_NETWORK_INFO_PLIST_ENTRY = 5,
|
|
2804
|
-
/** <No documentation available> */
|
|
2805
|
-
DITTO_SDK_TRANSPORTS_ERROR_MISSING_BONJOUR_SERVICES_INFO_PLIST_ENTRY = 6,
|
|
2806
2537
|
} DittoSdkTransportsError_t;
|
|
2807
2538
|
|
|
2808
2539
|
/** <No documentation available> */
|
|
@@ -3299,6 +3030,13 @@ int32_t
|
|
|
3299
3030
|
CDitto_t const * _ditto,
|
|
3300
3031
|
CWriteTransaction_t * transaction);
|
|
3301
3032
|
|
|
3033
|
+
/** \brief
|
|
3034
|
+
* Default DittoConfig id value, used by SDKs to synthesize a (rough) DittoConfig after being
|
|
3035
|
+
* built by a legacy constructor.
|
|
3036
|
+
*/
|
|
3037
|
+
char const *
|
|
3038
|
+
/* fn */ dittoffi_DEFAULT_DATABASE_ID (void);
|
|
3039
|
+
|
|
3302
3040
|
/** \brief
|
|
3303
3041
|
* This is not meant to be part of the SDK surface: it's a shared secret that SDKs use when
|
|
3304
3042
|
* constructing a "login provider" for development (fka "online playground").
|
|
@@ -3587,6 +3325,16 @@ dittoffi_result_dittoffi_differ_ptr_t
|
|
|
3587
3325
|
/* fn */ dittoffi_differ_new_with_identity_key_paths_throws (
|
|
3588
3326
|
slice_ref_char_const_ptr_t identity_key_paths);
|
|
3589
3327
|
|
|
3328
|
+
/** \brief
|
|
3329
|
+
* Getter for `absolute_persistence_directory`, which is the *actual* data directory used by
|
|
3330
|
+
* Ditto (it will differ from config.persistence_directory when the latter is *relative* or *nil*.)
|
|
3331
|
+
*
|
|
3332
|
+
* The resulting string has to be freed with `::ditto_c_string_free`
|
|
3333
|
+
*/
|
|
3334
|
+
char *
|
|
3335
|
+
/* fn */ dittoffi_ditto_absolute_persistence_directory (
|
|
3336
|
+
CDitto_t const * ditto);
|
|
3337
|
+
|
|
3590
3338
|
/** \brief
|
|
3591
3339
|
* Internal helper function to do integration testing of stacktrace generation in the SDKs.
|
|
3592
3340
|
*/
|
|
@@ -3600,6 +3348,13 @@ slice_boxed_uint8_t
|
|
|
3600
3348
|
/* fn */ dittoffi_ditto_config (
|
|
3601
3349
|
CDitto_t const * ditto);
|
|
3602
3350
|
|
|
3351
|
+
/** \brief
|
|
3352
|
+
* Returns a sensible *default* `DittoConfig` serialized as CBOR, according to the
|
|
3353
|
+
* DittoConfig.schema.json schema.
|
|
3354
|
+
*/
|
|
3355
|
+
slice_boxed_uint8_t
|
|
3356
|
+
/* fn */ dittoffi_ditto_config_default (void);
|
|
3357
|
+
|
|
3603
3358
|
/** <No documentation available> */
|
|
3604
3359
|
typedef struct dittoffi_result_uint64 {
|
|
3605
3360
|
/** \brief
|
|
@@ -3701,6 +3456,9 @@ typedef BoxDynFnMut1_void_dittoffi_result_CDitto_ptr_t continuation_dittoffi_res
|
|
|
3701
3456
|
* * `config_cbor` - `DittoConfig` serialized as CBOR, according to the DittoConfig.schema.json
|
|
3702
3457
|
* schema
|
|
3703
3458
|
*
|
|
3459
|
+
* * `default_root_directory` - If the config.persistence_directory is nil or relative, this will
|
|
3460
|
+
* be used as the parent of the actual persistence directory.
|
|
3461
|
+
*
|
|
3704
3462
|
* Nothing interesting happens in this function: it simply calls `Ditto::new` after creating a
|
|
3705
3463
|
* `TaskRuntime`.
|
|
3706
3464
|
*
|
|
@@ -3710,6 +3468,7 @@ void
|
|
|
3710
3468
|
/* fn */ dittoffi_ditto_open_async_throws (
|
|
3711
3469
|
slice_ref_uint8_t config_cbor,
|
|
3712
3470
|
TransportConfigMode_t transport_config_mode,
|
|
3471
|
+
char const * default_root_directory,
|
|
3713
3472
|
continuation_dittoffi_result_CDitto_ptr_t continuation);
|
|
3714
3473
|
|
|
3715
3474
|
/** \brief
|
|
@@ -3718,6 +3477,9 @@ void
|
|
|
3718
3477
|
* * `config_cbor` - `DittoConfig` serialized as CBOR, according to the DittoConfig.schema.json
|
|
3719
3478
|
* schema
|
|
3720
3479
|
*
|
|
3480
|
+
* * `default_root_directory` - If the config.persistence_directory is nil or relative, this will
|
|
3481
|
+
* be used as the parent of the actual persistence directory.
|
|
3482
|
+
*
|
|
3721
3483
|
* Nothing interesting happens in this function: it simply calls *and blocks on* `Ditto::new` after
|
|
3722
3484
|
* creating a `TaskRuntime`.
|
|
3723
3485
|
*
|
|
@@ -3726,7 +3488,8 @@ void
|
|
|
3726
3488
|
dittoffi_result_CDitto_ptr_t
|
|
3727
3489
|
/* fn */ dittoffi_ditto_open_throws (
|
|
3728
3490
|
slice_ref_uint8_t config_cbor,
|
|
3729
|
-
TransportConfigMode_t transport_config_mode
|
|
3491
|
+
TransportConfigMode_t transport_config_mode,
|
|
3492
|
+
char const * default_root_directory);
|
|
3730
3493
|
|
|
3731
3494
|
/** \brief
|
|
3732
3495
|
* `Box<dyn 'static + Send + FnMut(A1) -> Ret>`
|
|
@@ -3912,6 +3675,10 @@ typedef enum dittoffi_error_code {
|
|
|
3912
3675
|
* Activation (via setting a valid license token) is unnecessary for the active identity type.
|
|
3913
3676
|
*/
|
|
3914
3677
|
DITTOFFI_ERROR_CODE_ACTIVATION_UNNECESSARY,
|
|
3678
|
+
/** \brief
|
|
3679
|
+
* The operation failed because an authentication expiration handler has not yet been set.
|
|
3680
|
+
*/
|
|
3681
|
+
DITTOFFI_ERROR_CODE_AUTHENTICATION_EXPIRATION_HANDLER_MISSING,
|
|
3915
3682
|
/** \brief
|
|
3916
3683
|
* Invalid input provided for base64 decoding.
|
|
3917
3684
|
*/
|
|
@@ -3940,7 +3707,7 @@ typedef enum dittoffi_error_code {
|
|
|
3940
3707
|
* Failed to compile the given query.
|
|
3941
3708
|
*
|
|
3942
3709
|
* For more information on Ditto's query language see:
|
|
3943
|
-
* <https://
|
|
3710
|
+
* <https://ditto.com/link/dql-guide>
|
|
3944
3711
|
*/
|
|
3945
3712
|
DITTOFFI_ERROR_CODE_DQL_QUERY_COMPILATION,
|
|
3946
3713
|
/** \brief
|
|
@@ -4030,6 +3797,10 @@ typedef enum dittoffi_error_code {
|
|
|
4030
3797
|
* Invalid TransportConfig.
|
|
4031
3798
|
*/
|
|
4032
3799
|
DITTOFFI_ERROR_CODE_VALIDATION_INVALID_TRANSPORT_CONFIG,
|
|
3800
|
+
/** \brief
|
|
3801
|
+
* Invalid DittoConfig.
|
|
3802
|
+
*/
|
|
3803
|
+
DITTOFFI_ERROR_CODE_VALIDATION_INVALID_DITTO_CONFIG,
|
|
4033
3804
|
/** \brief
|
|
4034
3805
|
* The value was not a map.
|
|
4035
3806
|
*/
|
|
@@ -4039,7 +3810,6 @@ typedef enum dittoffi_error_code {
|
|
|
4039
3810
|
*/
|
|
4040
3811
|
DITTOFFI_ERROR_CODE_VALIDATION_SIZE_LIMIT_EXCEEDED,
|
|
4041
3812
|
/** \brief
|
|
4042
|
-
* Attempted to use a Ditto feature after closing Ditto.
|
|
4043
3813
|
* An unknown error occurred.
|
|
4044
3814
|
*/
|
|
4045
3815
|
DITTOFFI_ERROR_CODE_UNKNOWN,
|
|
@@ -4152,6 +3922,49 @@ char *
|
|
|
4152
3922
|
/* fn */ dittoffi_panic_stack_trace_string (
|
|
4153
3923
|
dittoffi_panic_t const * panic);
|
|
4154
3924
|
|
|
3925
|
+
/** \brief
|
|
3926
|
+
* Returns the current presence graph as a JSON string in a UTF-8 encoded byte array.
|
|
3927
|
+
*/
|
|
3928
|
+
slice_boxed_uint8_t
|
|
3929
|
+
/* fn */ dittoffi_presence_graph (
|
|
3930
|
+
CDitto_t const * ditto);
|
|
3931
|
+
|
|
3932
|
+
/** \brief
|
|
3933
|
+
* An opaque handle to a presence observer.
|
|
3934
|
+
*
|
|
3935
|
+
* - Use [`dittoffi_presence_register_observer_throws`] to create a new observer.
|
|
3936
|
+
* - Use [`dittoffi_presence_observer_cancel`] to cancel an observer.
|
|
3937
|
+
*/
|
|
3938
|
+
typedef struct dittoffi_presence_observer dittoffi_presence_observer_t;
|
|
3939
|
+
|
|
3940
|
+
/** \brief
|
|
3941
|
+
* Cancels the presence observer.
|
|
3942
|
+
*/
|
|
3943
|
+
void
|
|
3944
|
+
/* fn */ dittoffi_presence_observer_cancel (
|
|
3945
|
+
dittoffi_presence_observer_t const * observer);
|
|
3946
|
+
|
|
3947
|
+
/** \brief
|
|
3948
|
+
* Free a boxed `FfiPresenceObserver`.
|
|
3949
|
+
*/
|
|
3950
|
+
void
|
|
3951
|
+
/* fn */ dittoffi_presence_observer_free (
|
|
3952
|
+
dittoffi_presence_observer_t * observer);
|
|
3953
|
+
|
|
3954
|
+
/** \brief
|
|
3955
|
+
* Returns the ID of the presence observer.
|
|
3956
|
+
*/
|
|
3957
|
+
slice_boxed_uint8_t
|
|
3958
|
+
/* fn */ dittoffi_presence_observer_id (
|
|
3959
|
+
dittoffi_presence_observer_t const * observer);
|
|
3960
|
+
|
|
3961
|
+
/** \brief
|
|
3962
|
+
* Checks whether the presence observer is cancelled.
|
|
3963
|
+
*/
|
|
3964
|
+
bool
|
|
3965
|
+
/* fn */ dittoffi_presence_observer_is_cancelled (
|
|
3966
|
+
dittoffi_presence_observer_t const * observer);
|
|
3967
|
+
|
|
4155
3968
|
/** \brief
|
|
4156
3969
|
* Getter for the `peer_metadata` as a JSON (string / UTF-8 data).
|
|
4157
3970
|
*/
|
|
@@ -4159,6 +3972,47 @@ slice_boxed_uint8_t
|
|
|
4159
3972
|
/* fn */ dittoffi_presence_peer_metadata_json (
|
|
4160
3973
|
CDitto_t const * ditto);
|
|
4161
3974
|
|
|
3975
|
+
/** \brief
|
|
3976
|
+
* `Box<dyn 'static + Send + FnMut(A1) -> Ret>`
|
|
3977
|
+
*/
|
|
3978
|
+
typedef struct BoxDynFnMut1_void_slice_boxed_uint8 {
|
|
3979
|
+
/** <No documentation available> */
|
|
3980
|
+
void * env_ptr;
|
|
3981
|
+
|
|
3982
|
+
/** <No documentation available> */
|
|
3983
|
+
void (*call)(void *, slice_boxed_uint8_t);
|
|
3984
|
+
|
|
3985
|
+
/** <No documentation available> */
|
|
3986
|
+
void (*free)(void *);
|
|
3987
|
+
} BoxDynFnMut1_void_slice_boxed_uint8_t;
|
|
3988
|
+
|
|
3989
|
+
/** <No documentation available> */
|
|
3990
|
+
typedef struct dittoffi_result_dittoffi_presence_observer_ptr {
|
|
3991
|
+
/** \brief
|
|
3992
|
+
* Non-`NULL` pointer to opaque object on error, `NULL` otherwise.
|
|
3993
|
+
*/
|
|
3994
|
+
dittoffi_error_t * error;
|
|
3995
|
+
|
|
3996
|
+
/** \brief
|
|
3997
|
+
* When no error occurred, the success value payload can be retrieved here.
|
|
3998
|
+
*
|
|
3999
|
+
* Otherwise, the value is to be ignored.
|
|
4000
|
+
*/
|
|
4001
|
+
dittoffi_presence_observer_t * success;
|
|
4002
|
+
} dittoffi_result_dittoffi_presence_observer_ptr_t;
|
|
4003
|
+
|
|
4004
|
+
/** \brief
|
|
4005
|
+
* Registers a new [`FfiPresenceObserver`].
|
|
4006
|
+
*
|
|
4007
|
+
* This will call the provided callback whenever the presence graph changes.
|
|
4008
|
+
*
|
|
4009
|
+
* To cancel the observer, use [`dittoffi_presence_observer_cancel`].
|
|
4010
|
+
*/
|
|
4011
|
+
dittoffi_result_dittoffi_presence_observer_ptr_t
|
|
4012
|
+
/* fn */ dittoffi_presence_register_observer_throws (
|
|
4013
|
+
CDitto_t const * ditto,
|
|
4014
|
+
BoxDynFnMut1_void_slice_boxed_uint8_t callback);
|
|
4015
|
+
|
|
4162
4016
|
/** <No documentation available> */
|
|
4163
4017
|
typedef struct Erased Erased_t;
|
|
4164
4018
|
|
|
@@ -4200,6 +4054,12 @@ void
|
|
|
4200
4054
|
* The `peer_info` is expected to represent the UTF-8 bytes of a serialized JSON instead of CBOR.
|
|
4201
4055
|
*/
|
|
4202
4056
|
dittoffi_result_void_t
|
|
4057
|
+
/* fn */ dittoffi_presence_set_peer_metadata_json_throws (
|
|
4058
|
+
CDitto_t const * ditto,
|
|
4059
|
+
slice_ref_uint8_t peer_info);
|
|
4060
|
+
|
|
4061
|
+
/** <No documentation available> */
|
|
4062
|
+
dittoffi_result_void_t
|
|
4203
4063
|
/* fn */ dittoffi_presence_try_set_peer_metadata_json (
|
|
4204
4064
|
CDitto_t const * ditto,
|
|
4205
4065
|
slice_ref_uint8_t peer_info);
|
|
@@ -4207,11 +4067,32 @@ dittoffi_result_void_t
|
|
|
4207
4067
|
/** <No documentation available> */
|
|
4208
4068
|
typedef struct dittoffi_query_result dittoffi_query_result_t;
|
|
4209
4069
|
|
|
4070
|
+
/** \brief
|
|
4071
|
+
* Returns the commit ID for this query result, or zero if there is none.
|
|
4072
|
+
*
|
|
4073
|
+
* SDK implementations should generally call [`dittoffi_query_result_has_commit_id()`] first, and
|
|
4074
|
+
* return the appropriate language specific "no value" value if that function returns false.
|
|
4075
|
+
*/
|
|
4076
|
+
uint64_t
|
|
4077
|
+
/* fn */ dittoffi_query_result_commit_id (
|
|
4078
|
+
dittoffi_query_result_t const * result);
|
|
4079
|
+
|
|
4210
4080
|
/** <No documentation available> */
|
|
4211
4081
|
void
|
|
4212
4082
|
/* fn */ dittoffi_query_result_free (
|
|
4213
4083
|
dittoffi_query_result_t * result);
|
|
4214
4084
|
|
|
4085
|
+
/** \brief
|
|
4086
|
+
* Indicates whether this query result has a commit ID.
|
|
4087
|
+
*
|
|
4088
|
+
* SDK implementations should generally call this function before calling
|
|
4089
|
+
* [`dittoffi_query_result_commit_id()`], and return the appropriate language specific
|
|
4090
|
+
* "no value" value if this function returns false.
|
|
4091
|
+
*/
|
|
4092
|
+
bool
|
|
4093
|
+
/* fn */ dittoffi_query_result_has_commit_id (
|
|
4094
|
+
dittoffi_query_result_t const * result);
|
|
4095
|
+
|
|
4215
4096
|
/** <No documentation available> */
|
|
4216
4097
|
dittoffi_query_result_item_t *
|
|
4217
4098
|
/* fn */ dittoffi_query_result_item_at (
|
|
@@ -5133,68 +5014,6 @@ dittoffi_result_void_t
|
|
|
5133
5014
|
CDitto_t const * ditto,
|
|
5134
5015
|
char const * license);
|
|
5135
5016
|
|
|
5136
|
-
/** \brief
|
|
5137
|
-
* The platform advises Rust that the status of publishing our service has
|
|
5138
|
-
* changed.
|
|
5139
|
-
*/
|
|
5140
|
-
void
|
|
5141
|
-
/* fn */ mdns_advertising_state_changed (
|
|
5142
|
-
TransportHandle_MdnsPlatformEvent_t const * handle,
|
|
5143
|
-
OnlineState_t state,
|
|
5144
|
-
TransportCondition_t condition);
|
|
5145
|
-
|
|
5146
|
-
/** \brief
|
|
5147
|
-
* The platform advises Rust that a peer has been identified.
|
|
5148
|
-
*/
|
|
5149
|
-
void
|
|
5150
|
-
/* fn */ mdns_platform_peer_appeared (
|
|
5151
|
-
TransportHandle_MdnsPlatformEvent_t const * handle,
|
|
5152
|
-
char const * announce_string);
|
|
5153
|
-
|
|
5154
|
-
/** \brief
|
|
5155
|
-
* The platform advises Rust that a peer's service has disappeared from mDNS.
|
|
5156
|
-
*/
|
|
5157
|
-
void
|
|
5158
|
-
/* fn */ mdns_platform_peer_disappeared (
|
|
5159
|
-
TransportHandle_MdnsPlatformEvent_t const * handle,
|
|
5160
|
-
char const * announce_string);
|
|
5161
|
-
|
|
5162
|
-
/** \brief
|
|
5163
|
-
* The platform advises Rust that the status of searching for services has
|
|
5164
|
-
* changed.
|
|
5165
|
-
*/
|
|
5166
|
-
void
|
|
5167
|
-
/* fn */ mdns_scanning_state_changed (
|
|
5168
|
-
TransportHandle_MdnsPlatformEvent_t const * handle,
|
|
5169
|
-
OnlineState_t state,
|
|
5170
|
-
TransportCondition_t condition);
|
|
5171
|
-
|
|
5172
|
-
/** \brief
|
|
5173
|
-
* The platform advises Rust that the TCP listener will need to be restarted.
|
|
5174
|
-
*/
|
|
5175
|
-
void
|
|
5176
|
-
/* fn */ mdns_server_invalidate_listener (
|
|
5177
|
-
TransportHandle_MdnsPlatformEvent_t const * handle);
|
|
5178
|
-
|
|
5179
|
-
/** \brief
|
|
5180
|
-
* The platform advises Rust that we failed to resolve a peer's hostname and
|
|
5181
|
-
* port
|
|
5182
|
-
*/
|
|
5183
|
-
void
|
|
5184
|
-
/* fn */ mdns_service_did_not_resolve (
|
|
5185
|
-
TransportHandle_MdnsPlatformEvent_t const * handle,
|
|
5186
|
-
char const * announce_string);
|
|
5187
|
-
|
|
5188
|
-
/** \brief
|
|
5189
|
-
* The platform advises Rust that we have resolved a peer's hostname and port
|
|
5190
|
-
*/
|
|
5191
|
-
void
|
|
5192
|
-
/* fn */ mdns_service_did_resolve (
|
|
5193
|
-
TransportHandle_MdnsPlatformEvent_t const * handle,
|
|
5194
|
-
char const * announce_string,
|
|
5195
|
-
char const * hostname,
|
|
5196
|
-
uint16_t port);
|
|
5197
|
-
|
|
5198
5017
|
|
|
5199
5018
|
#ifdef __cplusplus
|
|
5200
5019
|
} /* extern \"C\" */
|