@dittolive/ditto 4.5.0 → 4.5.1-experimental.aarch64-linux.1.aarch64
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/README.md +2 -2
- package/node/ditto.cjs.js +2 -9620
- package/node/{ditto.linux-x64.node → ditto.linux-arm64.node} +0 -0
- package/package.json +38 -34
- package/types/ditto.d.ts +0 -2
- package/web/ditto.es6.js +1 -1
- package/web/ditto.umd.js +1 -1
- package/web/ditto.wasm +0 -0
- package/DittoReactNative.podspec +0 -27
- package/node/ditto.darwin-arm64.node +0 -0
- package/node/ditto.darwin-x64.node +0 -0
- package/node/ditto.linux-arm.node +0 -0
- package/node/ditto.win32-x64.node +0 -0
- package/node/transports.darwin-arm64.node +0 -0
- package/node/transports.darwin-x64.node +0 -0
- package/react-native/android/CMakeLists.txt +0 -37
- package/react-native/android/build.gradle +0 -203
- package/react-native/android/cpp-adapter.cpp +0 -254
- package/react-native/android/gradle.properties +0 -5
- package/react-native/android/src/main/AndroidManifest.xml +0 -4
- package/react-native/android/src/main/java/com/dittolive/rnsdk/DittoRNSDKModule.java +0 -85
- package/react-native/android/src/main/java/com/dittolive/rnsdk/DittoRNSDKPackage.java +0 -28
- package/react-native/boost/boost/assert.hpp +0 -85
- package/react-native/boost/boost/config/abi/borland_prefix.hpp +0 -27
- package/react-native/boost/boost/config/abi/borland_suffix.hpp +0 -12
- package/react-native/boost/boost/config/abi/msvc_prefix.hpp +0 -22
- package/react-native/boost/boost/config/abi/msvc_suffix.hpp +0 -8
- package/react-native/boost/boost/config/abi_prefix.hpp +0 -25
- package/react-native/boost/boost/config/abi_suffix.hpp +0 -25
- package/react-native/boost/boost/config/assert_cxx03.hpp +0 -211
- package/react-native/boost/boost/config/assert_cxx11.hpp +0 -209
- package/react-native/boost/boost/config/assert_cxx14.hpp +0 -47
- package/react-native/boost/boost/config/assert_cxx17.hpp +0 -62
- package/react-native/boost/boost/config/assert_cxx20.hpp +0 -59
- package/react-native/boost/boost/config/assert_cxx98.hpp +0 -23
- package/react-native/boost/boost/config/auto_link.hpp +0 -525
- package/react-native/boost/boost/config/compiler/borland.hpp +0 -339
- package/react-native/boost/boost/config/compiler/clang.hpp +0 -366
- package/react-native/boost/boost/config/compiler/clang_version.hpp +0 -83
- package/react-native/boost/boost/config/compiler/codegear.hpp +0 -385
- package/react-native/boost/boost/config/compiler/comeau.hpp +0 -59
- package/react-native/boost/boost/config/compiler/common_edg.hpp +0 -183
- package/react-native/boost/boost/config/compiler/compaq_cxx.hpp +0 -19
- package/react-native/boost/boost/config/compiler/cray.hpp +0 -446
- package/react-native/boost/boost/config/compiler/diab.hpp +0 -26
- package/react-native/boost/boost/config/compiler/digitalmars.hpp +0 -143
- package/react-native/boost/boost/config/compiler/gcc.hpp +0 -383
- package/react-native/boost/boost/config/compiler/gcc_xml.hpp +0 -114
- package/react-native/boost/boost/config/compiler/greenhills.hpp +0 -28
- package/react-native/boost/boost/config/compiler/hp_acc.hpp +0 -149
- package/react-native/boost/boost/config/compiler/intel.hpp +0 -577
- package/react-native/boost/boost/config/compiler/kai.hpp +0 -33
- package/react-native/boost/boost/config/compiler/metrowerks.hpp +0 -198
- package/react-native/boost/boost/config/compiler/mpw.hpp +0 -140
- package/react-native/boost/boost/config/compiler/nvcc.hpp +0 -61
- package/react-native/boost/boost/config/compiler/pathscale.hpp +0 -138
- package/react-native/boost/boost/config/compiler/pgi.hpp +0 -23
- package/react-native/boost/boost/config/compiler/sgi_mipspro.hpp +0 -29
- package/react-native/boost/boost/config/compiler/sunpro_cc.hpp +0 -222
- package/react-native/boost/boost/config/compiler/vacpp.hpp +0 -186
- package/react-native/boost/boost/config/compiler/visualc.hpp +0 -391
- package/react-native/boost/boost/config/compiler/xlcpp.hpp +0 -299
- package/react-native/boost/boost/config/compiler/xlcpp_zos.hpp +0 -173
- package/react-native/boost/boost/config/detail/cxx_composite.hpp +0 -203
- package/react-native/boost/boost/config/detail/posix_features.hpp +0 -95
- package/react-native/boost/boost/config/detail/select_compiler_config.hpp +0 -157
- package/react-native/boost/boost/config/detail/select_platform_config.hpp +0 -147
- package/react-native/boost/boost/config/detail/select_stdlib_config.hpp +0 -121
- package/react-native/boost/boost/config/detail/suffix.hpp +0 -1294
- package/react-native/boost/boost/config/header_deprecated.hpp +0 -26
- package/react-native/boost/boost/config/helper_macros.hpp +0 -37
- package/react-native/boost/boost/config/no_tr1/cmath.hpp +0 -28
- package/react-native/boost/boost/config/no_tr1/complex.hpp +0 -28
- package/react-native/boost/boost/config/no_tr1/functional.hpp +0 -28
- package/react-native/boost/boost/config/no_tr1/memory.hpp +0 -28
- package/react-native/boost/boost/config/no_tr1/utility.hpp +0 -28
- package/react-native/boost/boost/config/platform/aix.hpp +0 -33
- package/react-native/boost/boost/config/platform/amigaos.hpp +0 -15
- package/react-native/boost/boost/config/platform/beos.hpp +0 -26
- package/react-native/boost/boost/config/platform/bsd.hpp +0 -83
- package/react-native/boost/boost/config/platform/cloudabi.hpp +0 -18
- package/react-native/boost/boost/config/platform/cray.hpp +0 -18
- package/react-native/boost/boost/config/platform/cygwin.hpp +0 -71
- package/react-native/boost/boost/config/platform/haiku.hpp +0 -31
- package/react-native/boost/boost/config/platform/hpux.hpp +0 -87
- package/react-native/boost/boost/config/platform/irix.hpp +0 -31
- package/react-native/boost/boost/config/platform/linux.hpp +0 -106
- package/react-native/boost/boost/config/platform/macos.hpp +0 -87
- package/react-native/boost/boost/config/platform/qnxnto.hpp +0 -31
- package/react-native/boost/boost/config/platform/solaris.hpp +0 -31
- package/react-native/boost/boost/config/platform/symbian.hpp +0 -97
- package/react-native/boost/boost/config/platform/vms.hpp +0 -25
- package/react-native/boost/boost/config/platform/vxworks.hpp +0 -422
- package/react-native/boost/boost/config/platform/wasm.hpp +0 -23
- package/react-native/boost/boost/config/platform/win32.hpp +0 -90
- package/react-native/boost/boost/config/platform/zos.hpp +0 -32
- package/react-native/boost/boost/config/pragma_message.hpp +0 -31
- package/react-native/boost/boost/config/requires_threads.hpp +0 -92
- package/react-native/boost/boost/config/stdlib/dinkumware.hpp +0 -324
- package/react-native/boost/boost/config/stdlib/libcomo.hpp +0 -93
- package/react-native/boost/boost/config/stdlib/libcpp.hpp +0 -180
- package/react-native/boost/boost/config/stdlib/libstdcpp3.hpp +0 -482
- package/react-native/boost/boost/config/stdlib/modena.hpp +0 -79
- package/react-native/boost/boost/config/stdlib/msl.hpp +0 -98
- package/react-native/boost/boost/config/stdlib/roguewave.hpp +0 -208
- package/react-native/boost/boost/config/stdlib/sgi.hpp +0 -168
- package/react-native/boost/boost/config/stdlib/stlport.hpp +0 -258
- package/react-native/boost/boost/config/stdlib/vacpp.hpp +0 -74
- package/react-native/boost/boost/config/stdlib/xlcpp_zos.hpp +0 -61
- package/react-native/boost/boost/config/user.hpp +0 -133
- package/react-native/boost/boost/config/warning_disable.hpp +0 -47
- package/react-native/boost/boost/config/workaround.hpp +0 -305
- package/react-native/boost/boost/config.hpp +0 -67
- package/react-native/boost/boost/cstdint.hpp +0 -556
- package/react-native/boost/boost/intrusive_ptr.hpp +0 -18
- package/react-native/boost/boost/smart_ptr/detail/atomic_count.hpp +0 -103
- package/react-native/boost/boost/smart_ptr/detail/atomic_count_gcc.hpp +0 -79
- package/react-native/boost/boost/smart_ptr/detail/atomic_count_gcc_atomic.hpp +0 -63
- package/react-native/boost/boost/smart_ptr/detail/atomic_count_gcc_x86.hpp +0 -88
- package/react-native/boost/boost/smart_ptr/detail/atomic_count_nt.hpp +0 -66
- package/react-native/boost/boost/smart_ptr/detail/atomic_count_pt.hpp +0 -104
- package/react-native/boost/boost/smart_ptr/detail/atomic_count_spin.hpp +0 -69
- package/react-native/boost/boost/smart_ptr/detail/atomic_count_std_atomic.hpp +0 -67
- package/react-native/boost/boost/smart_ptr/detail/atomic_count_sync.hpp +0 -72
- package/react-native/boost/boost/smart_ptr/detail/atomic_count_win32.hpp +0 -70
- package/react-native/boost/boost/smart_ptr/detail/local_counted_base.hpp +0 -148
- package/react-native/boost/boost/smart_ptr/detail/local_sp_deleter.hpp +0 -91
- package/react-native/boost/boost/smart_ptr/detail/operator_bool.hpp +0 -64
- package/react-native/boost/boost/smart_ptr/detail/requires_cxx11.hpp +0 -23
- package/react-native/boost/boost/smart_ptr/detail/shared_count.hpp +0 -707
- package/react-native/boost/boost/smart_ptr/detail/sp_convertible.hpp +0 -92
- package/react-native/boost/boost/smart_ptr/detail/sp_counted_base.hpp +0 -92
- package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_acc_ia64.hpp +0 -163
- package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_aix.hpp +0 -152
- package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp +0 -185
- package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_gcc_atomic.hpp +0 -148
- package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_gcc_ia64.hpp +0 -170
- package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp +0 -200
- package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp +0 -194
- package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp +0 -179
- package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp +0 -186
- package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_nt.hpp +0 -119
- package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_pt.hpp +0 -147
- package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_snc_ps3.hpp +0 -174
- package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_spin.hpp +0 -141
- package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_std_atomic.hpp +0 -147
- package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_sync.hpp +0 -165
- package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_vacpp_ppc.hpp +0 -163
- package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_w32.hpp +0 -140
- package/react-native/boost/boost/smart_ptr/detail/sp_counted_impl.hpp +0 -309
- package/react-native/boost/boost/smart_ptr/detail/sp_disable_deprecated.hpp +0 -40
- package/react-native/boost/boost/smart_ptr/detail/sp_forward.hpp +0 -52
- package/react-native/boost/boost/smart_ptr/detail/sp_has_gcc_intrinsics.hpp +0 -27
- package/react-native/boost/boost/smart_ptr/detail/sp_has_sync_intrinsics.hpp +0 -69
- package/react-native/boost/boost/smart_ptr/detail/sp_interlocked.hpp +0 -173
- package/react-native/boost/boost/smart_ptr/detail/sp_noexcept.hpp +0 -48
- package/react-native/boost/boost/smart_ptr/detail/sp_nullptr_t.hpp +0 -45
- package/react-native/boost/boost/smart_ptr/detail/sp_obsolete.hpp +0 -32
- package/react-native/boost/boost/smart_ptr/detail/sp_thread_pause.hpp +0 -51
- package/react-native/boost/boost/smart_ptr/detail/sp_thread_sleep.hpp +0 -104
- package/react-native/boost/boost/smart_ptr/detail/sp_thread_yield.hpp +0 -100
- package/react-native/boost/boost/smart_ptr/detail/sp_typeinfo_.hpp +0 -58
- package/react-native/boost/boost/smart_ptr/detail/sp_win32_sleep.hpp +0 -49
- package/react-native/boost/boost/smart_ptr/intrusive_ptr.hpp +0 -409
- package/react-native/boost/boost/smart_ptr/intrusive_ref_counter.hpp +0 -188
- package/react-native/cpp/include/Attachment.h +0 -16
- package/react-native/cpp/include/Authentication.h +0 -23
- package/react-native/cpp/include/Collection.h +0 -13
- package/react-native/cpp/include/DQL.h +0 -21
- package/react-native/cpp/include/Document.h +0 -17
- package/react-native/cpp/include/Identity.h +0 -17
- package/react-native/cpp/include/Lifecycle.h +0 -16
- package/react-native/cpp/include/LiveQuery.h +0 -17
- package/react-native/cpp/include/Logger.h +0 -22
- package/react-native/cpp/include/Misc.h +0 -26
- package/react-native/cpp/include/Presence.h +0 -14
- package/react-native/cpp/include/RetainableState.h +0 -24
- package/react-native/cpp/include/SmallPeerInfo.h +0 -17
- package/react-native/cpp/include/Transports.h +0 -25
- package/react-native/cpp/include/TypedArray.hpp +0 -167
- package/react-native/cpp/include/Utils.h +0 -61
- package/react-native/cpp/include/main.h +0 -10
- package/react-native/cpp/src/Attachment.cpp +0 -86
- package/react-native/cpp/src/Authentication.cpp +0 -224
- package/react-native/cpp/src/Collection.cpp +0 -54
- package/react-native/cpp/src/DQL.cpp +0 -254
- package/react-native/cpp/src/Document.cpp +0 -146
- package/react-native/cpp/src/Identity.cpp +0 -123
- package/react-native/cpp/src/Lifecycle.cpp +0 -75
- package/react-native/cpp/src/LiveQuery.cpp +0 -64
- package/react-native/cpp/src/Logger.cpp +0 -200
- package/react-native/cpp/src/Misc.cpp +0 -271
- package/react-native/cpp/src/Presence.cpp +0 -77
- package/react-native/cpp/src/RetainableState.cpp +0 -15
- package/react-native/cpp/src/SmallPeerInfo.cpp +0 -108
- package/react-native/cpp/src/Transports.cpp +0 -270
- package/react-native/cpp/src/TypedArray.cpp +0 -303
- package/react-native/cpp/src/Utils.cpp +0 -138
- package/react-native/cpp/src/main.cpp +0 -149
- package/react-native/dittoffi/dittoffi.h +0 -4698
- package/react-native/dittoffi/ifaddrs.cpp +0 -385
- package/react-native/dittoffi/ifaddrs.h +0 -206
- package/react-native/ios/DittoRNSDK.h +0 -7
- package/react-native/ios/DittoRNSDK.mm +0 -107
- package/react-native/ios/YeetJSIUtils.h +0 -60
- package/react-native/ios/YeetJSIUtils.mm +0 -196
- package/react-native/lib/commonjs/ditto.rn.js +0 -93
- package/react-native/lib/commonjs/ditto.rn.js.map +0 -1
- package/react-native/lib/commonjs/index.js +0 -14
- package/react-native/lib/commonjs/index.js.map +0 -1
- package/react-native/lib/module/ditto.rn.js +0 -83
- package/react-native/lib/module/ditto.rn.js.map +0 -1
- package/react-native/lib/module/index.js +0 -13
- package/react-native/lib/module/index.js.map +0 -1
- package/react-native/lib/typescript/ditto.rn.d.ts +0 -15
- package/react-native/lib/typescript/ditto.rn.d.ts.map +0 -1
- package/react-native/lib/typescript/index.d.ts +0 -1
- package/react-native/lib/typescript/index.d.ts.map +0 -1
- package/react-native/scripts/ruby/include_local_boost.rb +0 -78
- package/react-native/src/ditto.rn.ts +0 -91
- package/react-native/src/environment/environment.fallback.ts +0 -4
- package/react-native/src/index.ts +0 -26
- package/react-native/src/sources/@cbor-redux.ts +0 -2
- package/react-native/src/sources/@ditto.core.ts +0 -1
- package/react-native/src/sources/@environment.ts +0 -2
- package/react-native/src/sources/attachment-fetch-event.ts +0 -54
- package/react-native/src/sources/attachment-fetcher-manager.ts +0 -129
- package/react-native/src/sources/attachment-fetcher.ts +0 -124
- package/react-native/src/sources/attachment-token.ts +0 -48
- package/react-native/src/sources/attachment.ts +0 -59
- package/react-native/src/sources/augment.ts +0 -89
- package/react-native/src/sources/authenticator.ts +0 -314
- package/react-native/src/sources/base-pending-cursor-operation.ts +0 -237
- package/react-native/src/sources/base-pending-id-specific-operation.ts +0 -109
- package/react-native/src/sources/bridge.ts +0 -549
- package/react-native/src/sources/build-time-constants.ts +0 -4
- package/react-native/src/sources/cbor.ts +0 -35
- package/react-native/src/sources/collection-interface.ts +0 -67
- package/react-native/src/sources/collection.ts +0 -212
- package/react-native/src/sources/collections-event.ts +0 -99
- package/react-native/src/sources/counter.ts +0 -77
- package/react-native/src/sources/ditto.ts +0 -945
- package/react-native/src/sources/document-id.ts +0 -159
- package/react-native/src/sources/document-path.ts +0 -303
- package/react-native/src/sources/document.ts +0 -192
- package/react-native/src/sources/epilogue.ts +0 -24
- package/react-native/src/sources/error-codes.ts +0 -52
- package/react-native/src/sources/error.ts +0 -203
- package/react-native/src/sources/essentials.ts +0 -53
- package/react-native/src/sources/ffi-error.ts +0 -117
- package/react-native/src/sources/ffi.ts +0 -1972
- package/react-native/src/sources/identity.ts +0 -163
- package/react-native/src/sources/init.ts +0 -70
- package/react-native/src/sources/internal.ts +0 -113
- package/react-native/src/sources/keep-alive.ts +0 -69
- package/react-native/src/sources/key-path.ts +0 -195
- package/react-native/src/sources/live-query-event.ts +0 -208
- package/react-native/src/sources/live-query-manager.ts +0 -101
- package/react-native/src/sources/live-query.ts +0 -164
- package/react-native/src/sources/logger.ts +0 -196
- package/react-native/src/sources/observer-manager.ts +0 -175
- package/react-native/src/sources/observer.ts +0 -77
- package/react-native/src/sources/pending-collections-operation.ts +0 -232
- package/react-native/src/sources/pending-cursor-operation.ts +0 -218
- package/react-native/src/sources/pending-id-specific-operation.ts +0 -216
- package/react-native/src/sources/presence-manager.ts +0 -160
- package/react-native/src/sources/presence.ts +0 -238
- package/react-native/src/sources/query-result-item.ts +0 -116
- package/react-native/src/sources/query-result.ts +0 -55
- package/react-native/src/sources/register.ts +0 -92
- package/react-native/src/sources/small-peer-info.ts +0 -176
- package/react-native/src/sources/static-tcp-client.ts +0 -6
- package/react-native/src/sources/store-observer.ts +0 -176
- package/react-native/src/sources/store.ts +0 -365
- package/react-native/src/sources/subscription-manager.ts +0 -98
- package/react-native/src/sources/subscription.ts +0 -88
- package/react-native/src/sources/sync-subscription.ts +0 -90
- package/react-native/src/sources/sync.ts +0 -495
- package/react-native/src/sources/test-helpers.ts +0 -24
- package/react-native/src/sources/transport-conditions-manager.ts +0 -104
- package/react-native/src/sources/transport-config.ts +0 -428
- package/react-native/src/sources/update-result.ts +0 -66
- package/react-native/src/sources/update-results-map.ts +0 -57
- package/react-native/src/sources/websocket-client.ts +0 -6
- package/react-native/src/sources/write-transaction-collection.ts +0 -122
- package/react-native/src/sources/write-transaction-pending-cursor-operation.ts +0 -101
- package/react-native/src/sources/write-transaction-pending-id-specific-operation.ts +0 -72
- package/react-native/src/sources/write-transaction.ts +0 -119
- package/react-native.config.js +0 -9
|
@@ -1,271 +0,0 @@
|
|
|
1
|
-
#include "Utils.h"
|
|
2
|
-
|
|
3
|
-
#include <Misc.h>
|
|
4
|
-
#include <unordered_map>
|
|
5
|
-
|
|
6
|
-
namespace sharedjsi
|
|
7
|
-
{
|
|
8
|
-
Function ditto_tick(Runtime &runtime) {
|
|
9
|
-
return Function::createFromHostFunction(
|
|
10
|
-
runtime,
|
|
11
|
-
PropNameID::forAscii(runtime, STRINGIFIED_FUNC_NAME()),
|
|
12
|
-
0,
|
|
13
|
-
[](Runtime &runtime, const Value &thisValue, const Value *arguments, size_t count) -> Value
|
|
14
|
-
{
|
|
15
|
-
ditto_tick(&runtime);
|
|
16
|
-
return Value();
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
Function ditto_set_device_name(Runtime &runtime) {
|
|
21
|
-
return Function::createFromHostFunction(runtime,
|
|
22
|
-
PropNameID::forAscii(runtime,
|
|
23
|
-
STRINGIFIED_FUNC_NAME()),
|
|
24
|
-
0,
|
|
25
|
-
[](Runtime &runtime,
|
|
26
|
-
const Value &thisValue,
|
|
27
|
-
const Value *arguments,
|
|
28
|
-
size_t count) -> Value
|
|
29
|
-
{
|
|
30
|
-
CDitto_t *ditto = jsPointerObjectToCPointer<CDitto_t>(runtime, arguments[0]);
|
|
31
|
-
std::string device_name_str = jsTypedArrayToCString(runtime, arguments[1]);
|
|
32
|
-
const char *device_name = device_name_str.c_str();
|
|
33
|
-
|
|
34
|
-
::ditto_set_device_name(ditto, device_name);
|
|
35
|
-
return Value();
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
Function ditto_error_message(Runtime &runtime) {
|
|
40
|
-
return Function::createFromHostFunction(runtime,
|
|
41
|
-
PropNameID::forAscii(runtime,
|
|
42
|
-
STRINGIFIED_FUNC_NAME()),
|
|
43
|
-
0,
|
|
44
|
-
[](Runtime &runtime,
|
|
45
|
-
const Value &thisValue,
|
|
46
|
-
const Value *arguments,
|
|
47
|
-
size_t count) -> Value
|
|
48
|
-
{
|
|
49
|
-
char *str = ::ditto_error_message();
|
|
50
|
-
return String::createFromUtf8(runtime, str ? str : "");
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
Function dittoffi_error_code(Runtime &runtime) {
|
|
55
|
-
return Function::createFromHostFunction(runtime,
|
|
56
|
-
PropNameID::forAscii(runtime,
|
|
57
|
-
STRINGIFIED_FUNC_NAME()),
|
|
58
|
-
0,
|
|
59
|
-
[](Runtime &runtime,
|
|
60
|
-
const Value &thisValue,
|
|
61
|
-
const Value *arguments,
|
|
62
|
-
size_t count) -> Value
|
|
63
|
-
{
|
|
64
|
-
dittoffi_error_t *error = jsPointerObjectToCPointer<dittoffi_error_t>(runtime, arguments[0]);
|
|
65
|
-
dittoffi_error_code_t error_code = ::dittoffi_error_code(error);
|
|
66
|
-
|
|
67
|
-
static const std::unordered_map<dittoffi_error_code_t, std::string> lookup = {
|
|
68
|
-
{DITTOFFI_ERROR_CODE_STORE_DOCUMENT_NOT_FOUND, "StoreDocumentNotFound"},
|
|
69
|
-
{DITTOFFI_ERROR_CODE_STORE_DATABASE, "StoreDatabase"},
|
|
70
|
-
{DITTOFFI_ERROR_CODE_STORE_QUERY, "StoreQuery"},
|
|
71
|
-
{DITTOFFI_ERROR_CODE_CRDT, "Crdt"},
|
|
72
|
-
{DITTOFFI_ERROR_CODE_JS_FLOATING_STORE_OPERATION, "JsFloatingStoreOperation"},
|
|
73
|
-
{DITTOFFI_ERROR_CODE_DQL_QUERY_COMPILATION, "DqlQueryCompilation"},
|
|
74
|
-
{DITTOFFI_ERROR_CODE_DQL_INVALID_QUERY_ARGS, "DqlInvalidQueryArgs"},
|
|
75
|
-
{DITTOFFI_ERROR_CODE_DQL_UNSUPPORTED, "DqlUnsupported"},
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
auto it = lookup.find(error_code);
|
|
79
|
-
if (it != lookup.end()) {
|
|
80
|
-
return String::createFromUtf8(runtime, it->second);
|
|
81
|
-
} else {
|
|
82
|
-
throw std::invalid_argument("Invalid error code");
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
Function dittoffi_error_description(Runtime &runtime) {
|
|
88
|
-
return Function::createFromHostFunction(runtime,
|
|
89
|
-
PropNameID::forAscii(runtime,
|
|
90
|
-
STRINGIFIED_FUNC_NAME()),
|
|
91
|
-
0,
|
|
92
|
-
[](Runtime &runtime,
|
|
93
|
-
const Value &thisValue,
|
|
94
|
-
const Value *arguments,
|
|
95
|
-
size_t count) -> Value
|
|
96
|
-
{
|
|
97
|
-
char *res = ::dittoffi_error_description(jsPointerObjectToCPointer<dittoffi_error_t>(runtime, arguments[0]));
|
|
98
|
-
return String::createFromUtf8(runtime, res);
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
Function dittoffi_error_free(Runtime &runtime) {
|
|
103
|
-
return Function::createFromHostFunction(runtime,
|
|
104
|
-
PropNameID::forAscii(runtime,
|
|
105
|
-
STRINGIFIED_FUNC_NAME()),
|
|
106
|
-
0,
|
|
107
|
-
[](Runtime &runtime,
|
|
108
|
-
const Value &thisValue,
|
|
109
|
-
const Value *arguments,
|
|
110
|
-
size_t count) -> Value
|
|
111
|
-
{
|
|
112
|
-
::dittoffi_error_free(jsPointerObjectToCPointer<dittoffi_error_t>(runtime, arguments[0]));
|
|
113
|
-
return Value();
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
Function ditto_set_connect_retry_interval(Runtime &runtime) {
|
|
118
|
-
return Function::createFromHostFunction(runtime,
|
|
119
|
-
PropNameID::forAscii(runtime,
|
|
120
|
-
STRINGIFIED_FUNC_NAME()),
|
|
121
|
-
0,
|
|
122
|
-
[](Runtime &runtime,
|
|
123
|
-
const Value &thisValue,
|
|
124
|
-
const Value *arguments,
|
|
125
|
-
size_t count) -> Value
|
|
126
|
-
{
|
|
127
|
-
CDitto_t *ditto = jsPointerObjectToCPointer<CDitto_t>(runtime, arguments[0]);
|
|
128
|
-
uint32_t sync_group = static_cast<uint32_t>(arguments[1].asNumber());
|
|
129
|
-
::ditto_set_connect_retry_interval(ditto, sync_group);
|
|
130
|
-
return Value();
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
Function ditto_get_sdk_version(Runtime &runtime) {
|
|
135
|
-
return Function::createFromHostFunction(runtime,
|
|
136
|
-
PropNameID::forAscii(runtime,
|
|
137
|
-
STRINGIFIED_FUNC_NAME()),
|
|
138
|
-
0,
|
|
139
|
-
[](Runtime &runtime,
|
|
140
|
-
const Value &thisValue,
|
|
141
|
-
const Value *arguments,
|
|
142
|
-
size_t count) -> Value
|
|
143
|
-
{
|
|
144
|
-
return cPointerToJSPointerObject<char>(runtime, ::ditto_get_sdk_version());
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
Function verify_license(Runtime &runtime) {
|
|
151
|
-
return Function::createFromHostFunction(runtime,
|
|
152
|
-
PropNameID::forAscii(runtime,
|
|
153
|
-
STRINGIFIED_FUNC_NAME()),
|
|
154
|
-
0,
|
|
155
|
-
[](Runtime &runtime,
|
|
156
|
-
const Value &thisValue,
|
|
157
|
-
const Value *arguments,
|
|
158
|
-
size_t count) -> Value
|
|
159
|
-
{
|
|
160
|
-
std::string license = arguments[0].toString(runtime).utf8(runtime);
|
|
161
|
-
char **out_err_msg = NULL;
|
|
162
|
-
LicenseVerificationResult_t res = ::verify_license(license.c_str(), out_err_msg);
|
|
163
|
-
|
|
164
|
-
std::string result;
|
|
165
|
-
switch (res) {
|
|
166
|
-
case LICENSE_VERIFICATION_RESULT_LICENSE_OK:
|
|
167
|
-
result = "LicenseOk";
|
|
168
|
-
break;
|
|
169
|
-
case LICENSE_VERIFICATION_RESULT_VERIFICATION_FAILED:
|
|
170
|
-
result = "VerificationFailed";
|
|
171
|
-
break;
|
|
172
|
-
case LICENSE_VERIFICATION_RESULT_LICENSE_EXPIRED:
|
|
173
|
-
result = "LicenseExpired";
|
|
174
|
-
break;
|
|
175
|
-
case LICENSE_VERIFICATION_RESULT_UNSUPPORTED_FUTURE_VERSION:
|
|
176
|
-
result = "UnsupportedFutureVersion";
|
|
177
|
-
break;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
Object obj(runtime);
|
|
181
|
-
obj.setProperty(runtime, "result", String::createFromUtf8(runtime, result));
|
|
182
|
-
obj.setProperty(runtime, "errorMessage", String::createFromUtf8(runtime, *out_err_msg));
|
|
183
|
-
return obj;
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
Function ditto_run_garbage_collection(Runtime &runtime) {
|
|
188
|
-
return Function::createFromHostFunction(runtime,
|
|
189
|
-
PropNameID::forAscii(runtime,
|
|
190
|
-
STRINGIFIED_FUNC_NAME()),
|
|
191
|
-
0,
|
|
192
|
-
[](Runtime &runtime,
|
|
193
|
-
const Value &thisValue,
|
|
194
|
-
const Value *arguments,
|
|
195
|
-
size_t count) -> Value
|
|
196
|
-
{
|
|
197
|
-
::ditto_run_garbage_collection(jsPointerObjectToCPointer<CDitto_t>(runtime, arguments[0]));
|
|
198
|
-
return Value();
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
Function ditto_set_static_websocket_clients(Runtime &runtime) {
|
|
203
|
-
|
|
204
|
-
return Function::createFromHostFunction(runtime,
|
|
205
|
-
PropNameID::forAscii(runtime,
|
|
206
|
-
STRINGIFIED_FUNC_NAME()),
|
|
207
|
-
0,
|
|
208
|
-
[](Runtime &runtime,
|
|
209
|
-
const Value &thisValue,
|
|
210
|
-
const Value *arguments,
|
|
211
|
-
size_t count) -> Value
|
|
212
|
-
{
|
|
213
|
-
CDitto_t *ditto = jsPointerObjectToCPointer<CDitto_t>(runtime, arguments[0]);
|
|
214
|
-
Array array = arguments[1].asObject(runtime).asArray(runtime);
|
|
215
|
-
|
|
216
|
-
std::vector<std::string> string_storage;
|
|
217
|
-
string_storage.reserve(array.length(runtime));
|
|
218
|
-
|
|
219
|
-
std::vector<const char *> cstring_pointers;
|
|
220
|
-
cstring_pointers.reserve(array.length(runtime));
|
|
221
|
-
|
|
222
|
-
for (size_t i = 0; i < array.length(runtime); ++i) {
|
|
223
|
-
Value element = array.getValueAtIndex(runtime, i);
|
|
224
|
-
string_storage.emplace_back(jsTypedArrayToCString(runtime, element));
|
|
225
|
-
cstring_pointers.push_back(string_storage.back().c_str());
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
slice_ref_char_const_ptr_t slice = { .ptr = cstring_pointers.data(), .len = cstring_pointers.size() };
|
|
229
|
-
|
|
230
|
-
uint32_t routing_hint = static_cast<uint32_t>(arguments[2].asNumber());
|
|
231
|
-
|
|
232
|
-
::ditto_set_static_websocket_clients(ditto, slice, routing_hint);
|
|
233
|
-
|
|
234
|
-
return Value();
|
|
235
|
-
});
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
Function ditto_set_sync_group(Runtime &runtime) {
|
|
239
|
-
return Function::createFromHostFunction(runtime,
|
|
240
|
-
PropNameID::forAscii(runtime,
|
|
241
|
-
STRINGIFIED_FUNC_NAME()),
|
|
242
|
-
0,
|
|
243
|
-
[](Runtime &runtime,
|
|
244
|
-
const Value &thisValue,
|
|
245
|
-
const Value *arguments,
|
|
246
|
-
size_t count) -> Value
|
|
247
|
-
{
|
|
248
|
-
CDitto_t *ditto = jsPointerObjectToCPointer<CDitto_t>(runtime, arguments[0]);
|
|
249
|
-
uint32_t sync_group = static_cast<uint32_t>(arguments[1].asNumber());
|
|
250
|
-
::ditto_set_sync_group(ditto, sync_group);
|
|
251
|
-
return Value();
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
Function refCStringToString(Runtime &runtime)
|
|
256
|
-
{
|
|
257
|
-
return Function::createFromHostFunction(runtime,
|
|
258
|
-
PropNameID::forAscii(runtime,
|
|
259
|
-
STRINGIFIED_FUNC_NAME()),
|
|
260
|
-
0,
|
|
261
|
-
[](Runtime &runtime,
|
|
262
|
-
const Value &thisValue,
|
|
263
|
-
const Value *arguments,
|
|
264
|
-
size_t count) -> Value
|
|
265
|
-
{
|
|
266
|
-
return String::createFromUtf8(runtime, jsPointerObjectToCPointer<char>(runtime, arguments[0]));
|
|
267
|
-
});
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
#include "Utils.h"
|
|
2
|
-
#include "RetainableState.h"
|
|
3
|
-
|
|
4
|
-
#include <Presence.h>
|
|
5
|
-
|
|
6
|
-
namespace sharedjsi
|
|
7
|
-
{
|
|
8
|
-
|
|
9
|
-
extern "C"
|
|
10
|
-
{
|
|
11
|
-
void v_presence_callback(void *ctx, char const *str)
|
|
12
|
-
{
|
|
13
|
-
boost::intrusive_ptr<RetainableState> const wrapped_state {static_cast<RetainableState *>(ctx), true};
|
|
14
|
-
ditto_enqueue_call([=, wrapped_state=std::move(wrapped_state), cpp_string = std::string(str)](Runtime *jsi) {
|
|
15
|
-
Runtime &runtime = *jsi;
|
|
16
|
-
wrapped_state->jsCallback.call(runtime, cPointerToJSPointerObject<char>(runtime, cpp_string.c_str()));
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
Function ditto_presence_v3(Runtime &runtime)
|
|
22
|
-
{
|
|
23
|
-
return Function::createFromHostFunction(runtime,
|
|
24
|
-
PropNameID::forAscii(runtime,
|
|
25
|
-
STRINGIFIED_FUNC_NAME()),
|
|
26
|
-
0,
|
|
27
|
-
[](Runtime &runtime,
|
|
28
|
-
const Value &thisValue,
|
|
29
|
-
const Value *arguments,
|
|
30
|
-
size_t count) -> Value
|
|
31
|
-
{
|
|
32
|
-
char *res = ::ditto_presence_v3(jsPointerObjectToCPointer<CDitto_t>(runtime, arguments[0]));
|
|
33
|
-
return String::createFromUtf8(runtime, res);
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
Function ditto_register_presence_v3_callback(Runtime &runtime)
|
|
38
|
-
{
|
|
39
|
-
return Function::createFromHostFunction(runtime,
|
|
40
|
-
PropNameID::forAscii(runtime,
|
|
41
|
-
STRINGIFIED_FUNC_NAME()),
|
|
42
|
-
0,
|
|
43
|
-
[](Runtime &runtime,
|
|
44
|
-
const Value &thisValue,
|
|
45
|
-
const Value *arguments,
|
|
46
|
-
size_t count) -> Value
|
|
47
|
-
{
|
|
48
|
-
CDitto_t *ditto = jsPointerObjectToCPointer<CDitto_t>(runtime, arguments[0]);
|
|
49
|
-
Function presence_callback = arguments[1].getObject(runtime).getFunction(runtime);
|
|
50
|
-
auto wrappedStateFfiWrapper = boost::intrusive_ptr<RetainableState>(new RetainableState(std::move(presence_callback)));
|
|
51
|
-
|
|
52
|
-
::ditto_register_presence_callback_v3(ditto,
|
|
53
|
-
wrappedStateFfiWrapper.get(),
|
|
54
|
-
v_retain,
|
|
55
|
-
v_release,
|
|
56
|
-
v_presence_callback);
|
|
57
|
-
return Value();
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
Function ditto_clear_presence_v3_callback(Runtime &runtime)
|
|
62
|
-
{
|
|
63
|
-
return Function::createFromHostFunction(runtime,
|
|
64
|
-
PropNameID::forAscii(runtime,
|
|
65
|
-
STRINGIFIED_FUNC_NAME()),
|
|
66
|
-
0,
|
|
67
|
-
[](Runtime &runtime,
|
|
68
|
-
const Value &thisValue,
|
|
69
|
-
const Value *arguments,
|
|
70
|
-
size_t count) -> Value
|
|
71
|
-
{
|
|
72
|
-
::ditto_clear_presence_v3_callback(jsPointerObjectToCPointer<CDitto_t>(runtime, arguments[0]));
|
|
73
|
-
return Value();
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#include "RetainableState.h"
|
|
2
|
-
|
|
3
|
-
RetainableState::RetainableState(Function jsCallback)
|
|
4
|
-
: jsCallback(std::move(jsCallback)) { }
|
|
5
|
-
|
|
6
|
-
extern "C" {
|
|
7
|
-
void v_retain(void *ctx) {
|
|
8
|
-
auto clone = boost::intrusive_ptr<RetainableState>(static_cast<RetainableState *>(ctx), true);
|
|
9
|
-
clone.detach();
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
void v_release(void *ctx) {
|
|
13
|
-
auto _owned = boost::intrusive_ptr<RetainableState>(static_cast<RetainableState *>(ctx), false);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
#include "Utils.h"
|
|
2
|
-
|
|
3
|
-
#include <Misc.h>
|
|
4
|
-
|
|
5
|
-
namespace sharedjsi
|
|
6
|
-
{
|
|
7
|
-
|
|
8
|
-
Function ditto_small_peer_info_set_transport_config_data(Runtime &runtime) {
|
|
9
|
-
return Function::createFromHostFunction(runtime,
|
|
10
|
-
PropNameID::forAscii(runtime,
|
|
11
|
-
STRINGIFIED_FUNC_NAME()),
|
|
12
|
-
0,
|
|
13
|
-
[](Runtime &runtime,
|
|
14
|
-
const Value &thisValue,
|
|
15
|
-
const Value *arguments,
|
|
16
|
-
size_t count) -> Value
|
|
17
|
-
{
|
|
18
|
-
CDitto_t *ditto = jsPointerObjectToCPointer<CDitto_t>(runtime, arguments[0]);
|
|
19
|
-
std::vector<uint8_t> query_args_cbor_vec = jsTypedArrayToCVector(runtime, arguments[1]);
|
|
20
|
-
slice_ref_uint8_t query_args_cbor = borrowVecAsRefSlice(query_args_cbor_vec);
|
|
21
|
-
|
|
22
|
-
::ditto_small_peer_info_set_transport_config_data(ditto, query_args_cbor);
|
|
23
|
-
return Value();
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
Function ditto_small_peer_info_get_is_enabled(Runtime &runtime) {
|
|
28
|
-
return Function::createFromHostFunction(runtime,
|
|
29
|
-
PropNameID::forAscii(runtime,
|
|
30
|
-
STRINGIFIED_FUNC_NAME()),
|
|
31
|
-
0,
|
|
32
|
-
[](Runtime &runtime,
|
|
33
|
-
const Value &thisValue,
|
|
34
|
-
const Value *arguments,
|
|
35
|
-
size_t count) -> Value
|
|
36
|
-
{
|
|
37
|
-
return ::ditto_small_peer_info_get_is_enabled(jsPointerObjectToCPointer<CDitto_t>(runtime, arguments[0]));
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
Function ditto_small_peer_info_set_enabled(Runtime &runtime) {
|
|
42
|
-
return Function::createFromHostFunction(runtime,
|
|
43
|
-
PropNameID::forAscii(runtime,
|
|
44
|
-
STRINGIFIED_FUNC_NAME()),
|
|
45
|
-
0,
|
|
46
|
-
[](Runtime &runtime,
|
|
47
|
-
const Value &thisValue,
|
|
48
|
-
const Value *arguments,
|
|
49
|
-
size_t count) -> Value
|
|
50
|
-
{
|
|
51
|
-
|
|
52
|
-
CDitto_t *ditto = jsPointerObjectToCPointer<CDitto_t>(runtime, arguments[0]);
|
|
53
|
-
bool is_enabled = arguments[1].asBool();
|
|
54
|
-
::ditto_small_peer_info_set_enabled(ditto, is_enabled);
|
|
55
|
-
return Value();
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
Function ditto_small_peer_info_get_sync_scope(Runtime &runtime) {
|
|
60
|
-
return Function::createFromHostFunction(runtime,
|
|
61
|
-
PropNameID::forAscii(runtime,
|
|
62
|
-
STRINGIFIED_FUNC_NAME()),
|
|
63
|
-
0,
|
|
64
|
-
[](Runtime &runtime,
|
|
65
|
-
const Value &thisValue,
|
|
66
|
-
const Value *arguments,
|
|
67
|
-
size_t count) -> Value
|
|
68
|
-
{
|
|
69
|
-
DittoSmallPeerInfoSyncScope_t sync_scope = ::ditto_small_peer_info_get_sync_scope(jsPointerObjectToCPointer<CDitto_t>(runtime, arguments[0]));
|
|
70
|
-
switch (sync_scope) {
|
|
71
|
-
case DITTO_SMALL_PEER_INFO_SYNC_SCOPE_LOCAL_PEER_ONLY:
|
|
72
|
-
return String::createFromUtf8(runtime, "LocalPeerOnly");
|
|
73
|
-
break;
|
|
74
|
-
case DITTO_SMALL_PEER_INFO_SYNC_SCOPE_BIG_PEER_ONLY:
|
|
75
|
-
return String::createFromUtf8(runtime, "BigPeerOnly");
|
|
76
|
-
break;
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
Function ditto_small_peer_info_set_sync_scope(Runtime &runtime) {
|
|
82
|
-
return Function::createFromHostFunction(runtime,
|
|
83
|
-
PropNameID::forAscii(runtime,
|
|
84
|
-
STRINGIFIED_FUNC_NAME()),
|
|
85
|
-
0,
|
|
86
|
-
[](Runtime &runtime,
|
|
87
|
-
const Value &thisValue,
|
|
88
|
-
const Value *arguments,
|
|
89
|
-
size_t count) -> Value
|
|
90
|
-
{
|
|
91
|
-
|
|
92
|
-
CDitto_t *ditto = jsPointerObjectToCPointer<CDitto_t>(runtime, arguments[0]);
|
|
93
|
-
std::string sync_scope_str = arguments[1].toString(runtime).utf8(runtime);
|
|
94
|
-
|
|
95
|
-
DittoSmallPeerInfoSyncScope_t sync_scope;
|
|
96
|
-
if (sync_scope_str == "LocalPeerOnly") {
|
|
97
|
-
sync_scope = DITTO_SMALL_PEER_INFO_SYNC_SCOPE_LOCAL_PEER_ONLY;
|
|
98
|
-
} else if (sync_scope_str == "BigPeerOnly") {
|
|
99
|
-
sync_scope = DITTO_SMALL_PEER_INFO_SYNC_SCOPE_BIG_PEER_ONLY;
|
|
100
|
-
} else {
|
|
101
|
-
throw "The string provided for Sync Scope is incorrect. Please ensure it matches the expected format.";
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
::ditto_small_peer_info_set_sync_scope(ditto, sync_scope);
|
|
105
|
-
return Value();
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
}
|