@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,123 +0,0 @@
|
|
|
1
|
-
#include "Utils.h"
|
|
2
|
-
|
|
3
|
-
#include <Identity.h>
|
|
4
|
-
|
|
5
|
-
namespace sharedjsi
|
|
6
|
-
{
|
|
7
|
-
|
|
8
|
-
Object convertConfigResultToJSIObject(Runtime &runtime, IdentityConfigResult_t result) {
|
|
9
|
-
Object obj(runtime);
|
|
10
|
-
obj.setProperty(runtime, "status_code", (double)result.status_code);
|
|
11
|
-
obj.setProperty(runtime, "identity_config", cPointerToJSPointerObject(runtime, result.identity_config));
|
|
12
|
-
return obj;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
Function ditto_identity_config_make_online_playground(Runtime &runtime)
|
|
16
|
-
{
|
|
17
|
-
return Function::createFromHostFunction(runtime,
|
|
18
|
-
PropNameID::forAscii(runtime,
|
|
19
|
-
STRINGIFIED_FUNC_NAME()),
|
|
20
|
-
0,
|
|
21
|
-
[](Runtime &runtime,
|
|
22
|
-
const Value &thisValue,
|
|
23
|
-
const Value *arguments,
|
|
24
|
-
size_t count) -> Value
|
|
25
|
-
{
|
|
26
|
-
std::string app_id_str = jsTypedArrayToCString(runtime, arguments[0]);
|
|
27
|
-
std::string shared_token_str = jsTypedArrayToCString(runtime, arguments[1]);
|
|
28
|
-
std::string base_url_str = jsTypedArrayToCString(runtime, arguments[2]);
|
|
29
|
-
|
|
30
|
-
const char *app_id = app_id_str.c_str();
|
|
31
|
-
const char *shared_token = shared_token_str.c_str();
|
|
32
|
-
const char *base_url = base_url_str.c_str();
|
|
33
|
-
|
|
34
|
-
IdentityConfigResult_t config_result = ::ditto_identity_config_make_online_playground(app_id, shared_token, base_url);
|
|
35
|
-
return convertConfigResultToJSIObject(runtime, config_result);
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
Function ditto_identity_config_make_offline_playground(Runtime &runtime)
|
|
40
|
-
{
|
|
41
|
-
return Function::createFromHostFunction(runtime,
|
|
42
|
-
PropNameID::forAscii(runtime,
|
|
43
|
-
STRINGIFIED_FUNC_NAME()),
|
|
44
|
-
0,
|
|
45
|
-
[](Runtime &runtime,
|
|
46
|
-
const Value &thisValue,
|
|
47
|
-
const Value *arguments,
|
|
48
|
-
size_t count) -> Value
|
|
49
|
-
{
|
|
50
|
-
std::string app_id_str = jsTypedArrayToCString(runtime, arguments[0]);
|
|
51
|
-
const char *app_id = app_id_str.c_str();
|
|
52
|
-
uint64_t site_id = arguments[1].asNumber();
|
|
53
|
-
|
|
54
|
-
IdentityConfigResult_t config_result = ::ditto_identity_config_make_offline_playground(app_id, site_id);
|
|
55
|
-
return convertConfigResultToJSIObject(runtime, config_result);
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
Function ditto_identity_config_make_manual_v0(Runtime &runtime)
|
|
60
|
-
{
|
|
61
|
-
return Function::createFromHostFunction(runtime,
|
|
62
|
-
PropNameID::forAscii(runtime,
|
|
63
|
-
STRINGIFIED_FUNC_NAME()),
|
|
64
|
-
0,
|
|
65
|
-
[](Runtime &runtime,
|
|
66
|
-
const Value &thisValue,
|
|
67
|
-
const Value *arguments,
|
|
68
|
-
size_t count) -> Value
|
|
69
|
-
{
|
|
70
|
-
std::string config_cbor_b64_str = jsTypedArrayToCString(runtime, arguments[0]);
|
|
71
|
-
const char *config_cbor_b64 = config_cbor_b64_str.c_str();
|
|
72
|
-
|
|
73
|
-
IdentityConfigResult_t config_result = ::ditto_identity_config_make_manual_v0(config_cbor_b64);
|
|
74
|
-
return convertConfigResultToJSIObject(runtime, config_result);
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
Function ditto_identity_config_make_shared_key(Runtime &runtime)
|
|
79
|
-
{
|
|
80
|
-
return Function::createFromHostFunction(runtime,
|
|
81
|
-
PropNameID::forAscii(runtime,
|
|
82
|
-
STRINGIFIED_FUNC_NAME()),
|
|
83
|
-
0,
|
|
84
|
-
[](Runtime &runtime,
|
|
85
|
-
const Value &thisValue,
|
|
86
|
-
const Value *arguments,
|
|
87
|
-
size_t count) -> Value
|
|
88
|
-
{
|
|
89
|
-
std::string app_id_str = jsTypedArrayToCString(runtime, arguments[0]);
|
|
90
|
-
const char *app_id = app_id_str.c_str();
|
|
91
|
-
|
|
92
|
-
std::string shared_key_str = jsTypedArrayToCString(runtime, arguments[1]);
|
|
93
|
-
const char *shared_key = shared_key_str.c_str();
|
|
94
|
-
|
|
95
|
-
uint64_t site_id = arguments[2].asNumber();
|
|
96
|
-
|
|
97
|
-
IdentityConfigResult_t config_result = ::ditto_identity_config_make_shared_key(app_id, shared_key, site_id);
|
|
98
|
-
return convertConfigResultToJSIObject(runtime, config_result);
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
Function ditto_identity_config_make_online_with_authentication(Runtime &runtime)
|
|
103
|
-
{
|
|
104
|
-
return Function::createFromHostFunction(runtime,
|
|
105
|
-
PropNameID::forAscii(runtime,
|
|
106
|
-
STRINGIFIED_FUNC_NAME()),
|
|
107
|
-
0,
|
|
108
|
-
[](Runtime &runtime,
|
|
109
|
-
const Value &thisValue,
|
|
110
|
-
const Value *arguments,
|
|
111
|
-
size_t count) -> Value
|
|
112
|
-
{
|
|
113
|
-
std::string app_id_str = jsTypedArrayToCString(runtime, arguments[0]);
|
|
114
|
-
std::string baseURLVector = jsTypedArrayToCString(runtime, arguments[1]);
|
|
115
|
-
|
|
116
|
-
const char *app_id = app_id_str.c_str();
|
|
117
|
-
const char *base_url = baseURLVector.c_str();
|
|
118
|
-
|
|
119
|
-
IdentityConfigResult_t config_result = ::ditto_identity_config_make_online_with_authentication(app_id, base_url);
|
|
120
|
-
return convertConfigResultToJSIObject(runtime, config_result);
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
#include "Utils.h"
|
|
2
|
-
|
|
3
|
-
#include <Lifecycle.h>
|
|
4
|
-
|
|
5
|
-
namespace sharedjsi
|
|
6
|
-
{
|
|
7
|
-
Function uninitialized_ditto_make(Runtime &runtime)
|
|
8
|
-
{
|
|
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
|
-
std::string path = jsTypedArrayToCString(runtime, arguments[0]);
|
|
19
|
-
UninitializedDitto_t *pointer = ::uninitialized_ditto_make(path.c_str());
|
|
20
|
-
return cPointerToJSPointerObject(runtime, pointer);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
Function ditto_shutdown(Runtime &runtime)
|
|
25
|
-
{
|
|
26
|
-
return Function::createFromHostFunction(runtime,
|
|
27
|
-
PropNameID::forAscii(runtime,
|
|
28
|
-
STRINGIFIED_FUNC_NAME()),
|
|
29
|
-
0,
|
|
30
|
-
[](Runtime &runtime,
|
|
31
|
-
const Value &thisValue,
|
|
32
|
-
const Value *arguments,
|
|
33
|
-
size_t count) -> Value
|
|
34
|
-
{
|
|
35
|
-
::ditto_shutdown(jsPointerObjectToCPointer<CDitto_t>(runtime, arguments[0]));
|
|
36
|
-
return Value();
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
Function ditto_free(Runtime &runtime)
|
|
41
|
-
{
|
|
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
|
-
::ditto_free(jsPointerObjectToCPointer<CDitto_t>(runtime, arguments[0]));
|
|
52
|
-
return Value();
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
Function ditto_make(Runtime &runtime)
|
|
57
|
-
{
|
|
58
|
-
return Function::createFromHostFunction(runtime,
|
|
59
|
-
PropNameID::forAscii(runtime,
|
|
60
|
-
STRINGIFIED_FUNC_NAME()),
|
|
61
|
-
0,
|
|
62
|
-
[](Runtime &runtime,
|
|
63
|
-
const Value &thisValue,
|
|
64
|
-
const Value *arguments,
|
|
65
|
-
size_t count) -> Value
|
|
66
|
-
{
|
|
67
|
-
UninitializedDitto_t *uninit_ditto = jsPointerObjectToCPointer<UninitializedDitto_t>(runtime, arguments[0]);
|
|
68
|
-
CIdentityConfig_t *identity_config = jsPointerObjectToCPointer<CIdentityConfig_t>(runtime, arguments[1]);
|
|
69
|
-
HistoryTracking_t history_tracking = HISTORY_TRACKING_DISABLED;
|
|
70
|
-
|
|
71
|
-
CDitto_t *pointer = ::ditto_make(uninit_ditto, identity_config, history_tracking);
|
|
72
|
-
return cPointerToJSPointerObject(runtime, pointer);
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
#include "Utils.h"
|
|
2
|
-
#include "RetainableState.h"
|
|
3
|
-
|
|
4
|
-
namespace sharedjsi
|
|
5
|
-
{
|
|
6
|
-
|
|
7
|
-
// TODO: Bridge int64_t! When we'll actually reach a number as big as int64, it will crash.
|
|
8
|
-
|
|
9
|
-
Function ditto_live_query_signal_available_next(Runtime &runtime)
|
|
10
|
-
{
|
|
11
|
-
return Function::createFromHostFunction(runtime,
|
|
12
|
-
PropNameID::forAscii(runtime,
|
|
13
|
-
STRINGIFIED_FUNC_NAME()),
|
|
14
|
-
0,
|
|
15
|
-
[](Runtime &runtime,
|
|
16
|
-
const Value &thisValue,
|
|
17
|
-
const Value *arguments,
|
|
18
|
-
size_t count) -> Value
|
|
19
|
-
{
|
|
20
|
-
CDitto_t *ditto = jsPointerObjectToCPointer<CDitto_t>(runtime, arguments[0]);
|
|
21
|
-
int64_t liveQueryId = arguments[1].asNumber();
|
|
22
|
-
|
|
23
|
-
::ditto_live_query_signal_available_next(ditto, liveQueryId);
|
|
24
|
-
return Value();
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
Function ditto_live_query_start(Runtime &runtime)
|
|
29
|
-
{
|
|
30
|
-
return Function::createFromHostFunction(runtime,
|
|
31
|
-
PropNameID::forAscii(runtime,
|
|
32
|
-
STRINGIFIED_FUNC_NAME()),
|
|
33
|
-
0,
|
|
34
|
-
[](Runtime &runtime,
|
|
35
|
-
const Value &thisValue,
|
|
36
|
-
const Value *arguments,
|
|
37
|
-
size_t count) -> Value
|
|
38
|
-
{
|
|
39
|
-
CDitto_t *ditto = jsPointerObjectToCPointer<CDitto_t>(runtime, arguments[0]);
|
|
40
|
-
int64_t liveQueryId = arguments[1].asNumber();
|
|
41
|
-
int32_t res = ::ditto_live_query_start(ditto, liveQueryId);
|
|
42
|
-
return static_cast<double>(res);
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
Function ditto_live_query_stop(Runtime &runtime)
|
|
47
|
-
{
|
|
48
|
-
return Function::createFromHostFunction(runtime,
|
|
49
|
-
PropNameID::forAscii(runtime,
|
|
50
|
-
STRINGIFIED_FUNC_NAME()),
|
|
51
|
-
0,
|
|
52
|
-
[](Runtime &runtime,
|
|
53
|
-
const Value &thisValue,
|
|
54
|
-
const Value *arguments,
|
|
55
|
-
size_t count) -> Value
|
|
56
|
-
{
|
|
57
|
-
CDitto_t *ditto = jsPointerObjectToCPointer<CDitto_t>(runtime, arguments[0]);
|
|
58
|
-
int64_t liveQueryId = arguments[1].asNumber();
|
|
59
|
-
|
|
60
|
-
::ditto_live_query_stop(ditto, liveQueryId);
|
|
61
|
-
return Value();
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
}
|
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
#include "Logger.h"
|
|
3
|
-
#include "Utils.h"
|
|
4
|
-
|
|
5
|
-
#include <unordered_map>
|
|
6
|
-
|
|
7
|
-
namespace sharedjsi
|
|
8
|
-
{
|
|
9
|
-
|
|
10
|
-
CLogLevel_t jsLogLevelStringToCLogLevel(std::string log_level)
|
|
11
|
-
{
|
|
12
|
-
static const std::unordered_map<std::string, CLogLevel_t> lookup = {
|
|
13
|
-
{"Error", C_LOG_LEVEL_ERROR},
|
|
14
|
-
{"Warning", C_LOG_LEVEL_WARNING},
|
|
15
|
-
{"Info", C_LOG_LEVEL_INFO},
|
|
16
|
-
{"Debug", C_LOG_LEVEL_DEBUG},
|
|
17
|
-
{"Verbose", C_LOG_LEVEL_VERBOSE},
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
auto it = lookup.find(log_level.c_str());
|
|
21
|
-
if (it != lookup.end())
|
|
22
|
-
{
|
|
23
|
-
return it->second;
|
|
24
|
-
}
|
|
25
|
-
else
|
|
26
|
-
{
|
|
27
|
-
throw std::invalid_argument("Invalid log level");
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
std::string cLogLevelToJSLogLevelString(CLogLevel_t log_level)
|
|
32
|
-
{
|
|
33
|
-
static const std::unordered_map<CLogLevel_t, std::string> lookup = {
|
|
34
|
-
{C_LOG_LEVEL_ERROR, "Error"},
|
|
35
|
-
{C_LOG_LEVEL_WARNING, "Warning"},
|
|
36
|
-
{C_LOG_LEVEL_INFO, "Info"},
|
|
37
|
-
{C_LOG_LEVEL_DEBUG, "Debug"},
|
|
38
|
-
{C_LOG_LEVEL_VERBOSE, "Verbose"},
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
auto it = lookup.find(log_level);
|
|
42
|
-
if (it != lookup.end())
|
|
43
|
-
{
|
|
44
|
-
return it->second;
|
|
45
|
-
}
|
|
46
|
-
else
|
|
47
|
-
{
|
|
48
|
-
throw std::invalid_argument("Invalid log level");
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
Function ditto_log(Runtime &runtime)
|
|
53
|
-
{
|
|
54
|
-
return Function::createFromHostFunction(runtime,
|
|
55
|
-
PropNameID::forAscii(runtime,
|
|
56
|
-
STRINGIFIED_FUNC_NAME()),
|
|
57
|
-
0,
|
|
58
|
-
[](Runtime &runtime,
|
|
59
|
-
const Value &thisValue,
|
|
60
|
-
const Value *arguments,
|
|
61
|
-
size_t count) -> Value
|
|
62
|
-
{
|
|
63
|
-
std::string log_level_str = arguments[0].toString(runtime).utf8(runtime);
|
|
64
|
-
CLogLevel_t log_level = jsLogLevelStringToCLogLevel(log_level_str);
|
|
65
|
-
|
|
66
|
-
std::string message_str = jsTypedArrayToCString(runtime, arguments[1]);
|
|
67
|
-
const char *message = message_str.c_str();
|
|
68
|
-
|
|
69
|
-
::ditto_log(log_level, message);
|
|
70
|
-
return Value();
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
Function ditto_logger_minimum_log_level_get(Runtime &runtime)
|
|
75
|
-
{
|
|
76
|
-
return Function::createFromHostFunction(runtime,
|
|
77
|
-
PropNameID::forAscii(runtime,
|
|
78
|
-
STRINGIFIED_FUNC_NAME()),
|
|
79
|
-
0,
|
|
80
|
-
[](Runtime &runtime,
|
|
81
|
-
const Value &thisValue,
|
|
82
|
-
const Value *arguments,
|
|
83
|
-
size_t count) -> Value
|
|
84
|
-
{
|
|
85
|
-
CLogLevel_t res = ::ditto_logger_minimum_log_level_get();
|
|
86
|
-
std::string log_level = cLogLevelToJSLogLevelString(res);
|
|
87
|
-
return String::createFromUtf8(runtime, log_level);
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
Function ditto_logger_minimum_log_level(Runtime &runtime)
|
|
92
|
-
{
|
|
93
|
-
return Function::createFromHostFunction(runtime,
|
|
94
|
-
PropNameID::forAscii(runtime,
|
|
95
|
-
STRINGIFIED_FUNC_NAME()),
|
|
96
|
-
0,
|
|
97
|
-
[](Runtime &runtime,
|
|
98
|
-
const Value &thisValue,
|
|
99
|
-
const Value *arguments,
|
|
100
|
-
size_t count) -> Value
|
|
101
|
-
{
|
|
102
|
-
std::string log_level_str = arguments[0].toString(runtime).utf8(runtime);
|
|
103
|
-
CLogLevel_t log_level = jsLogLevelStringToCLogLevel(log_level_str);
|
|
104
|
-
|
|
105
|
-
::ditto_logger_minimum_log_level(log_level);
|
|
106
|
-
return Value();
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
Function ditto_logger_set_log_file(Runtime &runtime)
|
|
111
|
-
{
|
|
112
|
-
return Function::createFromHostFunction(runtime,
|
|
113
|
-
PropNameID::forAscii(runtime,
|
|
114
|
-
STRINGIFIED_FUNC_NAME()),
|
|
115
|
-
0,
|
|
116
|
-
[](Runtime &runtime,
|
|
117
|
-
const Value &thisValue,
|
|
118
|
-
const Value *arguments,
|
|
119
|
-
size_t count) -> Value
|
|
120
|
-
{
|
|
121
|
-
::ditto_logger_set_log_file(arguments[0].toString(runtime).utf8(runtime).c_str());
|
|
122
|
-
return Value();
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
Function ditto_logger_emoji_headings_enabled(Runtime &runtime)
|
|
127
|
-
{
|
|
128
|
-
return Function::createFromHostFunction(runtime,
|
|
129
|
-
PropNameID::forAscii(runtime,
|
|
130
|
-
STRINGIFIED_FUNC_NAME()),
|
|
131
|
-
0,
|
|
132
|
-
[](Runtime &runtime,
|
|
133
|
-
const Value &thisValue,
|
|
134
|
-
const Value *arguments,
|
|
135
|
-
size_t count) -> Value
|
|
136
|
-
{
|
|
137
|
-
::ditto_logger_emoji_headings_enabled(arguments[0].asBool());
|
|
138
|
-
return Value();
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
Function ditto_logger_emoji_headings_enabled_get(Runtime &runtime)
|
|
143
|
-
{
|
|
144
|
-
return Function::createFromHostFunction(runtime,
|
|
145
|
-
PropNameID::forAscii(runtime,
|
|
146
|
-
STRINGIFIED_FUNC_NAME()),
|
|
147
|
-
0,
|
|
148
|
-
[](Runtime &runtime,
|
|
149
|
-
const Value &thisValue,
|
|
150
|
-
const Value *arguments,
|
|
151
|
-
size_t count) -> Value
|
|
152
|
-
{
|
|
153
|
-
return ::ditto_logger_emoji_headings_enabled_get();
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
Function ditto_logger_enabled_get(Runtime &runtime)
|
|
158
|
-
{
|
|
159
|
-
return Function::createFromHostFunction(runtime,
|
|
160
|
-
PropNameID::forAscii(runtime,
|
|
161
|
-
STRINGIFIED_FUNC_NAME()),
|
|
162
|
-
0,
|
|
163
|
-
[](Runtime &runtime,
|
|
164
|
-
const Value &thisValue,
|
|
165
|
-
const Value *arguments,
|
|
166
|
-
size_t count) -> Value
|
|
167
|
-
{
|
|
168
|
-
return ::ditto_logger_enabled_get();
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
Function ditto_logger_enabled(Runtime &runtime)
|
|
173
|
-
{
|
|
174
|
-
return Function::createFromHostFunction(runtime,
|
|
175
|
-
PropNameID::forAscii(runtime,
|
|
176
|
-
STRINGIFIED_FUNC_NAME()),
|
|
177
|
-
0,
|
|
178
|
-
[](Runtime &runtime,
|
|
179
|
-
const Value &thisValue,
|
|
180
|
-
const Value *arguments,
|
|
181
|
-
size_t count) -> Value
|
|
182
|
-
{
|
|
183
|
-
::ditto_logger_enabled(arguments[0].asBool());
|
|
184
|
-
return Value();
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
std::function<void(CLogLevel_t, const char *)> global_js_callback;
|
|
189
|
-
|
|
190
|
-
extern "C"
|
|
191
|
-
{
|
|
192
|
-
void custom_log_callback(CLogLevel_t log_level, const char *message)
|
|
193
|
-
{
|
|
194
|
-
if (global_js_callback)
|
|
195
|
-
{
|
|
196
|
-
global_js_callback(log_level, message);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
}
|