@dittolive/ditto 4.6.0 → 4.7.0-rc.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.
Files changed (69) hide show
  1. package/README.md +2 -2
  2. package/node/ditto.cjs.js +479 -128
  3. package/node/ditto.darwin-arm64.node +0 -0
  4. package/node/ditto.darwin-x64.node +0 -0
  5. package/node/ditto.linux-arm.node +0 -0
  6. package/node/ditto.linux-arm64.node +0 -0
  7. package/node/ditto.linux-x64.node +0 -0
  8. package/node/ditto.win32-x64.node +0 -0
  9. package/node/transports.darwin-arm64.node +0 -0
  10. package/node/transports.darwin-x64.node +0 -0
  11. package/package.json +1 -1
  12. package/react-native/android/.project +34 -0
  13. package/react-native/android/bin/.project +34 -0
  14. package/react-native/android/bin/src/main/java/com/dittolive/rnsdk/DittoRNSDKModule.class +0 -0
  15. package/react-native/android/bin/src/main/java/com/dittolive/rnsdk/DittoRNSDKPackage.class +0 -0
  16. package/react-native/android/build/intermediates/cxx/abi_configuration_4i3a4k2a.json +14 -0
  17. package/react-native/android/build/intermediates/cxx/abi_configuration_4i3a4k2a.log +1 -0
  18. package/react-native/android/build/intermediates/cxx/abi_configuration_4i3a4k2a_key.json +23 -0
  19. package/react-native/android/build/intermediates/cxx/create_cxx_tasks_371_timing.txt +5 -0
  20. package/react-native/android/build/intermediates/cxx/ndk_locator_record_4q2c3f1f.json +11 -0
  21. package/react-native/android/build/intermediates/cxx/ndk_locator_record_4q2c3f1f.log +72 -0
  22. package/react-native/android/build/intermediates/cxx/ndk_locator_record_4q2c3f1f_key.json +10 -0
  23. package/react-native/android/build.gradle +1 -1
  24. package/react-native/android/cpp-adapter.cpp +39 -43
  25. package/react-native/android/src/main/java/com/dittolive/rnsdk/DittoRNSDKModule.java +1 -1
  26. package/react-native/cpp/include/Arc.hpp +18 -0
  27. package/react-native/cpp/include/ConnectionRequest.h +18 -0
  28. package/react-native/cpp/include/FFIUtils.h +2 -0
  29. package/react-native/cpp/include/Misc.h +1 -1
  30. package/react-native/cpp/include/Presence.h +4 -0
  31. package/react-native/cpp/include/Utils.h +14 -3
  32. package/react-native/cpp/src/Attachment.cpp +5 -6
  33. package/react-native/cpp/src/Authentication.cpp +1 -1
  34. package/react-native/cpp/src/Collection.cpp +2 -0
  35. package/react-native/cpp/src/ConnectionRequest.cpp +123 -0
  36. package/react-native/cpp/src/DQL.cpp +1 -1
  37. package/react-native/cpp/src/FFIUtils.cpp +58 -0
  38. package/react-native/cpp/src/Identity.cpp +2 -3
  39. package/react-native/cpp/src/LiveQuery.cpp +3 -3
  40. package/react-native/cpp/src/Misc.cpp +14 -23
  41. package/react-native/cpp/src/Presence.cpp +87 -0
  42. package/react-native/cpp/src/Utils.cpp +104 -99
  43. package/react-native/cpp/src/main.cpp +15 -2
  44. package/react-native/dittoffi/dittoffi.h +375 -252
  45. package/react-native/ios/DittoRNSDK.mm +3 -3
  46. package/react-native/src/ditto.rn.ts +12 -4
  47. package/react-native/src/index.ts +2 -2
  48. package/react-native/src/sources/bridge.ts +6 -2
  49. package/react-native/src/sources/connection-request.ts +139 -0
  50. package/react-native/src/sources/ditto.ts +31 -28
  51. package/react-native/src/sources/epilogue.ts +4 -2
  52. package/react-native/src/sources/error-codes.ts +37 -3
  53. package/react-native/src/sources/error.ts +30 -1
  54. package/react-native/src/sources/essentials.ts +6 -0
  55. package/react-native/src/sources/ffi-error.ts +20 -9
  56. package/react-native/src/sources/ffi.ts +206 -111
  57. package/react-native/src/sources/main.ts +1 -0
  58. package/react-native/src/sources/pending-collections-operation.ts +1 -1
  59. package/react-native/src/sources/presence.ts +189 -0
  60. package/react-native/src/sources/query-result-item.ts +4 -4
  61. package/react-native/src/sources/query-result.ts +6 -6
  62. package/react-native/src/sources/small-peer-info.ts +1 -12
  63. package/react-native/src/sources/store-observer.ts +6 -15
  64. package/react-native/src/sources/store.ts +5 -13
  65. package/react-native/src/sources/sync.ts +2 -3
  66. package/types/ditto.d.ts +265 -28
  67. package/web/ditto.es6.js +1 -1
  68. package/web/ditto.umd.js +1 -1
  69. package/web/ditto.wasm +0 -0
@@ -18,6 +18,7 @@
18
18
  #include "Transports.h"
19
19
  #include "IO.h"
20
20
  #include "FFIUtils.h"
21
+ #include "ConnectionRequest.h"
21
22
 
22
23
  // Note: `runtime` variable must exist in scope.
23
24
  #define REGISTER_JS_FUNCTION(fname) runtime.global().setProperty(runtime, STRINGIFY(fname), fname(runtime));
@@ -46,8 +47,9 @@ namespace sharedjsi
46
47
  // FFI Utils
47
48
  REGISTER_JS_FUNCTION(refCStringToString);
48
49
  REGISTER_JS_FUNCTION(boxCStringIntoString);
49
- REGISTER_JS_FUNCTION(withOutBoxCBytes);
50
+ REGISTER_JS_FUNCTION(sliceRefToUInt8Array);
50
51
  REGISTER_JS_FUNCTION(sliceBoxedToUInt8Array);
52
+ REGISTER_JS_FUNCTION(withOutBoxCBytes);
51
53
 
52
54
  // Authentication
53
55
  REGISTER_JS_FUNCTION(ditto_auth_client_get_app_id);
@@ -85,6 +87,9 @@ namespace sharedjsi
85
87
  REGISTER_JS_FUNCTION(ditto_presence_v3);
86
88
  REGISTER_JS_FUNCTION(ditto_register_presence_v3_callback);
87
89
  REGISTER_JS_FUNCTION(ditto_clear_presence_v3_callback);
90
+ REGISTER_JS_FUNCTION(dittoffi_presence_peer_metadata_json);
91
+ REGISTER_JS_FUNCTION(dittoffi_presence_try_set_peer_metadata_json);
92
+ REGISTER_JS_FUNCTION(dittoffi_presence_set_connection_request_handler);
88
93
 
89
94
  // Attachment
90
95
  REGISTER_JS_FUNCTION(ditto_new_attachment_from_file);
@@ -140,6 +145,14 @@ namespace sharedjsi
140
145
  REGISTER_JS_FUNCTION(ditto_add_multicast_transport);
141
146
  REGISTER_JS_FUNCTION(ditto_remove_multicast_transport);
142
147
 
148
+ // Connection Request
149
+ REGISTER_JS_FUNCTION(dittoffi_connection_request_peer_key_string);
150
+ REGISTER_JS_FUNCTION(dittoffi_connection_request_peer_metadata_json);
151
+ REGISTER_JS_FUNCTION(dittoffi_connection_request_identity_service_json);
152
+ REGISTER_JS_FUNCTION(dittoffi_connection_request_authorize);
153
+ REGISTER_JS_FUNCTION(dittoffi_connection_request_free);
154
+ REGISTER_JS_FUNCTION(dittoffi_connection_request_connection_type);
155
+
143
156
  // Misc
144
157
  REGISTER_JS_FUNCTION(ditto_tick);
145
158
  REGISTER_JS_FUNCTION(ditto_set_connect_retry_interval);
@@ -150,7 +163,7 @@ namespace sharedjsi
150
163
  REGISTER_JS_FUNCTION(dittoffi_error_code);
151
164
  REGISTER_JS_FUNCTION(dittoffi_error_description);
152
165
  REGISTER_JS_FUNCTION(dittoffi_error_free);
153
- REGISTER_JS_FUNCTION(ditto_verify_license);
166
+ REGISTER_JS_FUNCTION(dittoffi_try_verify_license);
154
167
  REGISTER_JS_FUNCTION(ditto_run_garbage_collection);
155
168
  REGISTER_JS_FUNCTION(ditto_set_static_websocket_clients);
156
169
  REGISTER_JS_FUNCTION(ditto_set_sync_group);