@dittolive/ditto 4.7.4-rc.2 → 4.7.4
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 +27 -0
- package/README.md +2 -2
- package/node/ditto.cjs.js +1 -1
- 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.linux-arm64.node +0 -0
- package/node/ditto.linux-x64.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/package.json +5 -2
- package/react-native/android/.gradle/8.9/checksums/checksums.lock +0 -0
- package/react-native/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
- package/react-native/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
- package/react-native/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
- package/react-native/android/.gradle/8.9/gc.properties +0 -0
- package/react-native/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/react-native/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/react-native/android/.gradle/vcs-1/gc.properties +0 -0
- package/react-native/android/CMakeLists.txt +36 -0
- package/react-native/android/build.gradle +190 -0
- package/react-native/android/cpp-adapter.cpp +259 -0
- package/react-native/android/gradle.properties +5 -0
- package/react-native/android/src/main/AndroidManifest.xml +4 -0
- package/react-native/android/src/main/java/com/dittolive/rnsdk/DittoRNSDKModule.java +120 -0
- package/react-native/android/src/main/java/com/dittolive/rnsdk/DittoRNSDKPackage.java +28 -0
- package/react-native/cpp/include/Arc.hpp +159 -0
- package/react-native/cpp/include/Attachment.h +20 -0
- package/react-native/cpp/include/Authentication.h +23 -0
- package/react-native/cpp/include/Collection.h +13 -0
- package/react-native/cpp/include/ConnectionRequest.h +18 -0
- package/react-native/cpp/include/DQL.h +21 -0
- package/react-native/cpp/include/Document.h +17 -0
- package/react-native/cpp/include/FFIUtils.h +16 -0
- package/react-native/cpp/include/IO.h +13 -0
- package/react-native/cpp/include/Identity.h +17 -0
- package/react-native/cpp/include/Lifecycle.h +16 -0
- package/react-native/cpp/include/LiveQuery.h +17 -0
- package/react-native/cpp/include/Logger.h +22 -0
- package/react-native/cpp/include/Misc.h +30 -0
- package/react-native/cpp/include/Presence.h +18 -0
- package/react-native/cpp/include/SmallPeerInfo.h +19 -0
- package/react-native/cpp/include/Transports.h +25 -0
- package/react-native/cpp/include/TypedArray.hpp +167 -0
- package/react-native/cpp/include/Utils.h +70 -0
- package/react-native/cpp/include/main.h +10 -0
- package/react-native/cpp/src/Attachment.cpp +272 -0
- package/react-native/cpp/src/Authentication.cpp +227 -0
- package/react-native/cpp/src/Collection.cpp +56 -0
- package/react-native/cpp/src/ConnectionRequest.cpp +123 -0
- package/react-native/cpp/src/DQL.cpp +256 -0
- package/react-native/cpp/src/Document.cpp +146 -0
- package/react-native/cpp/src/FFIUtils.cpp +122 -0
- package/react-native/cpp/src/IO.cpp +35 -0
- package/react-native/cpp/src/Identity.cpp +122 -0
- package/react-native/cpp/src/Lifecycle.cpp +93 -0
- package/react-native/cpp/src/LiveQuery.cpp +63 -0
- package/react-native/cpp/src/Logger.cpp +199 -0
- package/react-native/cpp/src/Misc.cpp +322 -0
- package/react-native/cpp/src/Presence.cpp +166 -0
- package/react-native/cpp/src/SmallPeerInfo.cpp +142 -0
- package/react-native/cpp/src/Transports.cpp +275 -0
- package/react-native/cpp/src/TypedArray.cpp +303 -0
- package/react-native/cpp/src/Utils.cpp +139 -0
- package/react-native/cpp/src/main.cpp +178 -0
- package/react-native/dittoffi/dittoffi.h +4873 -0
- package/react-native/dittoffi/ifaddrs.cpp +385 -0
- package/react-native/dittoffi/ifaddrs.h +206 -0
- package/react-native/ios/DittoRNSDK.h +7 -0
- package/react-native/ios/DittoRNSDK.mm +159 -0
- package/react-native/ios/YeetJSIUtils.h +60 -0
- package/react-native/ios/YeetJSIUtils.mm +196 -0
- package/react-native/lib/commonjs/ditto.rn.js +93 -0
- package/react-native/lib/commonjs/ditto.rn.js.map +1 -0
- package/react-native/lib/commonjs/index.js +61 -0
- package/react-native/lib/commonjs/index.js.map +1 -0
- package/react-native/lib/module/ditto.rn.js +89 -0
- package/react-native/lib/module/ditto.rn.js.map +1 -0
- package/react-native/lib/module/index.js +27 -0
- package/react-native/lib/module/index.js.map +1 -0
- package/react-native/lib/typescript/ditto.rn.d.ts +15 -0
- package/react-native/lib/typescript/ditto.rn.d.ts.map +1 -0
- package/react-native/lib/typescript/index.d.ts +1 -0
- package/react-native/lib/typescript/index.d.ts.map +1 -0
- package/react-native/src/ditto.rn.ts +123 -0
- package/react-native/src/environment/environment.fallback.ts +4 -0
- package/react-native/src/index.ts +29 -0
- package/react-native/src/sources/@cbor-redux.ts +2 -0
- package/react-native/src/sources/@ditto.core.ts +1 -0
- package/react-native/src/sources/@environment.ts +1 -0
- package/react-native/src/sources/attachment-fetch-event.ts +54 -0
- package/react-native/src/sources/attachment-fetcher-manager.ts +145 -0
- package/react-native/src/sources/attachment-fetcher.ts +265 -0
- package/react-native/src/sources/attachment-token.ts +129 -0
- package/react-native/src/sources/attachment.ts +121 -0
- package/react-native/src/sources/augment.ts +108 -0
- package/react-native/src/sources/authenticator.ts +314 -0
- package/react-native/src/sources/base-pending-cursor-operation.ts +255 -0
- package/react-native/src/sources/base-pending-id-specific-operation.ts +112 -0
- package/react-native/src/sources/bridge.ts +557 -0
- package/react-native/src/sources/build-time-constants.ts +8 -0
- package/react-native/src/sources/cbor.ts +20 -0
- package/react-native/src/sources/collection-interface.ts +73 -0
- package/react-native/src/sources/collection.ts +219 -0
- package/react-native/src/sources/collections-event.ts +99 -0
- package/react-native/src/sources/connection-request.ts +142 -0
- package/react-native/src/sources/counter.ts +82 -0
- package/react-native/src/sources/ditto.ts +991 -0
- package/react-native/src/sources/document-id.ts +163 -0
- package/react-native/src/sources/document-path.ts +308 -0
- package/react-native/src/sources/document.ts +237 -0
- package/react-native/src/sources/epilogue.ts +32 -0
- package/react-native/src/sources/error-codes.ts +114 -0
- package/react-native/src/sources/error.ts +256 -0
- package/react-native/src/sources/essentials.ts +81 -0
- package/react-native/src/sources/ffi-error.ts +134 -0
- package/react-native/src/sources/ffi.ts +2190 -0
- package/react-native/src/sources/identity.ts +163 -0
- package/react-native/src/sources/init.ts +71 -0
- package/react-native/src/sources/internal.ts +143 -0
- package/react-native/src/sources/keep-alive.ts +73 -0
- package/react-native/src/sources/key-path.ts +198 -0
- package/react-native/src/sources/live-query-event.ts +208 -0
- package/react-native/src/sources/live-query-manager.ts +110 -0
- package/react-native/src/sources/live-query.ts +167 -0
- package/react-native/src/sources/logger.ts +196 -0
- package/react-native/src/sources/main.ts +61 -0
- package/react-native/src/sources/observer-manager.ts +185 -0
- package/react-native/src/sources/observer.ts +79 -0
- package/react-native/src/sources/pending-collections-operation.ts +241 -0
- package/react-native/src/sources/pending-cursor-operation.ts +218 -0
- package/react-native/src/sources/pending-id-specific-operation.ts +218 -0
- package/react-native/src/sources/presence-manager.ts +170 -0
- package/react-native/src/sources/presence.ts +427 -0
- package/react-native/src/sources/query-result-item.ts +131 -0
- package/react-native/src/sources/query-result.ts +55 -0
- package/react-native/src/sources/register.ts +95 -0
- package/react-native/src/sources/small-peer-info.ts +166 -0
- package/react-native/src/sources/static-tcp-client.ts +8 -0
- package/react-native/src/sources/store-observer.ts +170 -0
- package/react-native/src/sources/store.ts +630 -0
- package/react-native/src/sources/subscription-manager.ts +99 -0
- package/react-native/src/sources/subscription.ts +89 -0
- package/react-native/src/sources/sync-subscription.ts +90 -0
- package/react-native/src/sources/sync.ts +561 -0
- package/react-native/src/sources/test-helpers.ts +24 -0
- package/react-native/src/sources/transport-conditions-manager.ts +104 -0
- package/react-native/src/sources/transport-config.ts +430 -0
- package/react-native/src/sources/update-result.ts +66 -0
- package/react-native/src/sources/update-results-map.ts +65 -0
- package/react-native/src/sources/websocket-client.ts +7 -0
- package/react-native/src/sources/write-transaction-collection.ts +122 -0
- package/react-native/src/sources/write-transaction-pending-cursor-operation.ts +101 -0
- package/react-native/src/sources/write-transaction-pending-id-specific-operation.ts +74 -0
- package/react-native/src/sources/write-transaction.ts +121 -0
- package/react-native.config.js +9 -0
- package/web/ditto.es6.js +1 -1
- package/web/ditto.umd.js +1 -1
- package/web/ditto.wasm +0 -0
|
@@ -0,0 +1,142 @@
|
|
|
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
|
+
|
|
109
|
+
Function ditto_small_peer_info_get_metadata(Runtime &runtime) {
|
|
110
|
+
return Function::createFromHostFunction(runtime,
|
|
111
|
+
PropNameID::forAscii(runtime,
|
|
112
|
+
STRINGIFIED_FUNC_NAME()),
|
|
113
|
+
0,
|
|
114
|
+
[](Runtime &runtime,
|
|
115
|
+
const Value &thisValue,
|
|
116
|
+
const Value *arguments,
|
|
117
|
+
size_t count) -> Value
|
|
118
|
+
{
|
|
119
|
+
char *metadata = ::ditto_small_peer_info_get_metadata(jsPointerObjectToCPointer<CDitto_t>(runtime, arguments[0]));
|
|
120
|
+
return cPointerToJSPointerObject<char>(runtime, metadata);
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
Function ditto_small_peer_info_set_metadata(Runtime &runtime) {
|
|
126
|
+
return Function::createFromHostFunction(runtime,
|
|
127
|
+
PropNameID::forAscii(runtime,
|
|
128
|
+
STRINGIFIED_FUNC_NAME()),
|
|
129
|
+
0,
|
|
130
|
+
[](Runtime &runtime,
|
|
131
|
+
const Value &thisValue,
|
|
132
|
+
const Value *arguments,
|
|
133
|
+
size_t count) -> Value
|
|
134
|
+
{
|
|
135
|
+
CDitto_t *ditto = jsPointerObjectToCPointer<CDitto_t>(runtime, arguments[0]);
|
|
136
|
+
std::string metadata_str = jsTypedArrayToCString(runtime, arguments[1]);
|
|
137
|
+
const char *metadata = metadata_str.c_str();
|
|
138
|
+
|
|
139
|
+
return ::ditto_small_peer_info_set_metadata(ditto, metadata);
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
}
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
#include "Utils.h"
|
|
2
|
+
|
|
3
|
+
#include <Transports.h>
|
|
4
|
+
#include <dittoffi.h>
|
|
5
|
+
|
|
6
|
+
namespace sharedjsi
|
|
7
|
+
{
|
|
8
|
+
|
|
9
|
+
Function ditto_sdk_transports_error_new(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
|
+
DittoSdkTransportsError_t *outError = ::ditto_sdk_transports_error_new();
|
|
21
|
+
return cPointerToJSPointerObject<DittoSdkTransportsError_t>(runtime, outError);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
Function ditto_sdk_transports_init(Runtime &runtime)
|
|
26
|
+
{
|
|
27
|
+
return Function::createFromHostFunction(runtime,
|
|
28
|
+
PropNameID::forAscii(runtime,
|
|
29
|
+
STRINGIFIED_FUNC_NAME()),
|
|
30
|
+
0,
|
|
31
|
+
[](Runtime &runtime,
|
|
32
|
+
const Value &thisValue,
|
|
33
|
+
const Value *arguments,
|
|
34
|
+
size_t count) -> Value
|
|
35
|
+
{
|
|
36
|
+
DittoSdkTransportsError_t *outError = jsPointerObjectToCPointer<DittoSdkTransportsError_t>(runtime, arguments[0]);
|
|
37
|
+
return ::ditto_sdk_transports_init(outError);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
Function ditto_sdk_transports_error_value(Runtime &runtime)
|
|
42
|
+
{
|
|
43
|
+
return Function::createFromHostFunction(runtime,
|
|
44
|
+
PropNameID::forAscii(runtime,
|
|
45
|
+
STRINGIFIED_FUNC_NAME()),
|
|
46
|
+
0,
|
|
47
|
+
[](Runtime &runtime,
|
|
48
|
+
const Value &thisValue,
|
|
49
|
+
const Value *arguments,
|
|
50
|
+
size_t count) -> Value
|
|
51
|
+
{
|
|
52
|
+
DittoSdkTransportsError_t *outError = jsPointerObjectToCPointer<DittoSdkTransportsError_t>(runtime, arguments[0]);
|
|
53
|
+
DittoSdkTransportsError_t error = ::ditto_sdk_transports_error_value(outError);
|
|
54
|
+
|
|
55
|
+
std::string error_string;
|
|
56
|
+
switch (error) {
|
|
57
|
+
case DITTO_SDK_TRANSPORTS_ERROR_NONE:
|
|
58
|
+
error_string = "None";
|
|
59
|
+
break;
|
|
60
|
+
case DITTO_SDK_TRANSPORTS_ERROR_GENERIC:
|
|
61
|
+
error_string = "Generic";
|
|
62
|
+
break;
|
|
63
|
+
case DITTO_SDK_TRANSPORTS_ERROR_UNAVAILABLE:
|
|
64
|
+
error_string = "Unavailable";
|
|
65
|
+
break;
|
|
66
|
+
default:
|
|
67
|
+
throw "Unimplemented error value";
|
|
68
|
+
}
|
|
69
|
+
return String::createFromUtf8(runtime, error_string);
|
|
70
|
+
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
Function ditto_sdk_transports_error_free(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
|
+
::ditto_sdk_transports_error_free(jsPointerObjectToCPointer<DittoSdkTransportsError_t>(runtime, arguments[0]));
|
|
86
|
+
return Value();
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
Function ditto_sdk_transports_ble_is_available(Runtime &runtime)
|
|
91
|
+
{
|
|
92
|
+
return Function::createFromHostFunction(runtime,
|
|
93
|
+
PropNameID::forAscii(runtime,
|
|
94
|
+
STRINGIFIED_FUNC_NAME()),
|
|
95
|
+
0,
|
|
96
|
+
[](Runtime &runtime,
|
|
97
|
+
const Value &thisValue,
|
|
98
|
+
const Value *arguments,
|
|
99
|
+
size_t count) -> Value
|
|
100
|
+
{
|
|
101
|
+
return ::ditto_sdk_transports_ble_is_available(jsPointerObjectToCPointer<CDitto_t>(runtime, arguments[0]));
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
Function ditto_sdk_transports_ble_create(Runtime &runtime)
|
|
106
|
+
{
|
|
107
|
+
return Function::createFromHostFunction(runtime,
|
|
108
|
+
PropNameID::forAscii(runtime,
|
|
109
|
+
STRINGIFIED_FUNC_NAME()),
|
|
110
|
+
0,
|
|
111
|
+
[](Runtime &runtime,
|
|
112
|
+
const Value &thisValue,
|
|
113
|
+
const Value *arguments,
|
|
114
|
+
size_t count) -> Value
|
|
115
|
+
{
|
|
116
|
+
CDitto_t *ditto = jsPointerObjectToCPointer<CDitto_t>(runtime, arguments[0]);
|
|
117
|
+
DittoSdkTransportsError_t *outError = jsPointerObjectToCPointer<DittoSdkTransportsError_t>(runtime, arguments[1]);
|
|
118
|
+
void *res = ::ditto_sdk_transports_ble_create(ditto, outError);
|
|
119
|
+
void *transports = static_cast<void *>(res);
|
|
120
|
+
return cPointerToJSPointerObject<void>(runtime, transports);
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
Function ditto_sdk_transports_ble_destroy(Runtime &runtime)
|
|
125
|
+
{
|
|
126
|
+
return Function::createFromHostFunction(runtime,
|
|
127
|
+
PropNameID::forAscii(runtime,
|
|
128
|
+
STRINGIFIED_FUNC_NAME()),
|
|
129
|
+
0,
|
|
130
|
+
[](Runtime &runtime,
|
|
131
|
+
const Value &thisValue,
|
|
132
|
+
const Value *arguments,
|
|
133
|
+
size_t count) -> Value
|
|
134
|
+
{
|
|
135
|
+
void *ble = jsPointerObjectToCPointer<void>(runtime, arguments[0]);
|
|
136
|
+
DittoSdkTransportsError_t *outError = jsPointerObjectToCPointer<DittoSdkTransportsError_t>(runtime, arguments[1]);
|
|
137
|
+
return ::ditto_sdk_transports_ble_destroy(ble, outError);
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
Function ditto_sdk_transports_lan_is_available(Runtime &runtime)
|
|
142
|
+
{
|
|
143
|
+
return Function::createFromHostFunction(runtime,
|
|
144
|
+
PropNameID::forAscii(runtime,
|
|
145
|
+
STRINGIFIED_FUNC_NAME()),
|
|
146
|
+
0,
|
|
147
|
+
[](Runtime &runtime,
|
|
148
|
+
const Value &thisValue,
|
|
149
|
+
const Value *arguments,
|
|
150
|
+
size_t count) -> Value
|
|
151
|
+
{
|
|
152
|
+
return ::ditto_sdk_transports_lan_is_available(jsPointerObjectToCPointer<CDitto_t>(runtime, arguments[0]));
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
Function ditto_sdk_transports_lan_create(Runtime &runtime)
|
|
157
|
+
{
|
|
158
|
+
return Function::createFromHostFunction(runtime,
|
|
159
|
+
PropNameID::forAscii(runtime,
|
|
160
|
+
STRINGIFIED_FUNC_NAME()),
|
|
161
|
+
0,
|
|
162
|
+
[](Runtime &runtime,
|
|
163
|
+
const Value &thisValue,
|
|
164
|
+
const Value *arguments,
|
|
165
|
+
size_t count) -> Value
|
|
166
|
+
{
|
|
167
|
+
CDitto_t *ditto = jsPointerObjectToCPointer<CDitto_t>(runtime, arguments[0]);
|
|
168
|
+
DittoSdkTransportsError_t *outError = jsPointerObjectToCPointer<DittoSdkTransportsError_t>(runtime, arguments[1]);
|
|
169
|
+
void *res = ::ditto_sdk_transports_lan_create(ditto, outError);
|
|
170
|
+
void *transports = static_cast<void *>(res);
|
|
171
|
+
return cPointerToJSPointerObject<void>(runtime, transports);
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
Function ditto_sdk_transports_lan_destroy(Runtime &runtime)
|
|
176
|
+
{
|
|
177
|
+
return Function::createFromHostFunction(runtime,
|
|
178
|
+
PropNameID::forAscii(runtime,
|
|
179
|
+
STRINGIFIED_FUNC_NAME()),
|
|
180
|
+
0,
|
|
181
|
+
[](Runtime &runtime,
|
|
182
|
+
const Value &thisValue,
|
|
183
|
+
const Value *arguments,
|
|
184
|
+
size_t count) -> Value
|
|
185
|
+
{
|
|
186
|
+
void *lan = jsPointerObjectToCPointer<void>(runtime, arguments[0]);
|
|
187
|
+
DittoSdkTransportsError_t *outError = jsPointerObjectToCPointer<DittoSdkTransportsError_t>(runtime, arguments[1]);
|
|
188
|
+
return ::ditto_sdk_transports_lan_destroy(lan, outError);
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
Function ditto_sdk_transports_awdl_is_available(Runtime &runtime)
|
|
193
|
+
{
|
|
194
|
+
return Function::createFromHostFunction(runtime,
|
|
195
|
+
PropNameID::forAscii(runtime,
|
|
196
|
+
STRINGIFIED_FUNC_NAME()),
|
|
197
|
+
0,
|
|
198
|
+
[](Runtime &runtime,
|
|
199
|
+
const Value &thisValue,
|
|
200
|
+
const Value *arguments,
|
|
201
|
+
size_t count) -> Value
|
|
202
|
+
{
|
|
203
|
+
return ::ditto_sdk_transports_awdl_is_available(jsPointerObjectToCPointer<CDitto_t>(runtime, arguments[0]));
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
Function ditto_sdk_transports_awdl_create(Runtime &runtime)
|
|
208
|
+
{
|
|
209
|
+
return Function::createFromHostFunction(runtime,
|
|
210
|
+
PropNameID::forAscii(runtime,
|
|
211
|
+
STRINGIFIED_FUNC_NAME()),
|
|
212
|
+
0,
|
|
213
|
+
[](Runtime &runtime,
|
|
214
|
+
const Value &thisValue,
|
|
215
|
+
const Value *arguments,
|
|
216
|
+
size_t count) -> Value
|
|
217
|
+
{
|
|
218
|
+
CDitto_t *ditto = jsPointerObjectToCPointer<CDitto_t>(runtime, arguments[0]);
|
|
219
|
+
DittoSdkTransportsError_t *outError = jsPointerObjectToCPointer<DittoSdkTransportsError_t>(runtime, arguments[1]);
|
|
220
|
+
void *res = ::ditto_sdk_transports_awdl_create(ditto, outError);
|
|
221
|
+
void *transports = static_cast<void *>(res);
|
|
222
|
+
return cPointerToJSPointerObject<void>(runtime, transports);
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
Function ditto_sdk_transports_awdl_destroy(Runtime &runtime)
|
|
227
|
+
{
|
|
228
|
+
return Function::createFromHostFunction(runtime,
|
|
229
|
+
PropNameID::forAscii(runtime,
|
|
230
|
+
STRINGIFIED_FUNC_NAME()),
|
|
231
|
+
0,
|
|
232
|
+
[](Runtime &runtime,
|
|
233
|
+
const Value &thisValue,
|
|
234
|
+
const Value *arguments,
|
|
235
|
+
size_t count) -> Value
|
|
236
|
+
{
|
|
237
|
+
void *awdl = jsPointerObjectToCPointer<void>(runtime, arguments[0]);
|
|
238
|
+
DittoSdkTransportsError_t *outError = jsPointerObjectToCPointer<DittoSdkTransportsError_t>(runtime, arguments[1]);
|
|
239
|
+
return ::ditto_sdk_transports_awdl_destroy(awdl, outError);
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
Function ditto_add_multicast_transport(Runtime &runtime)
|
|
244
|
+
{
|
|
245
|
+
return Function::createFromHostFunction(runtime,
|
|
246
|
+
PropNameID::forAscii(runtime,
|
|
247
|
+
STRINGIFIED_FUNC_NAME()),
|
|
248
|
+
0,
|
|
249
|
+
[](Runtime &runtime,
|
|
250
|
+
const Value &thisValue,
|
|
251
|
+
const Value *arguments,
|
|
252
|
+
size_t count) -> Value
|
|
253
|
+
{
|
|
254
|
+
::ditto_add_multicast_transport(jsPointerObjectToCPointer<CDitto_t>(runtime, arguments[0]));
|
|
255
|
+
return Value();
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
Function ditto_remove_multicast_transport(Runtime &runtime)
|
|
260
|
+
{
|
|
261
|
+
return Function::createFromHostFunction(runtime,
|
|
262
|
+
PropNameID::forAscii(runtime,
|
|
263
|
+
STRINGIFIED_FUNC_NAME()),
|
|
264
|
+
0,
|
|
265
|
+
[](Runtime &runtime,
|
|
266
|
+
const Value &thisValue,
|
|
267
|
+
const Value *arguments,
|
|
268
|
+
size_t count) -> Value
|
|
269
|
+
{
|
|
270
|
+
::ditto_remove_multicast_transport(jsPointerObjectToCPointer<CDitto_t>(runtime, arguments[0]));
|
|
271
|
+
return Value();
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
}
|