@chitchat/sdk-react-native 0.3.0-dev.0 → 0.3.0-dev.1
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/android/.gradle/8.9/checksums/checksums.lock +0 -0
- package/android/.gradle/8.9/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/8.9/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.9/gc.properties +0 -0
- package/android/.gradle/9.2.0/checksums/checksums.lock +0 -0
- package/android/.gradle/9.2.0/fileChanges/last-build.bin +0 -0
- package/android/.gradle/9.2.0/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/9.2.0/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/9.2.0/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/package.json +4 -4
- package/src/index.js +13 -4
- package/src/protobuf-bridge.js +1 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chitchat/sdk-react-native",
|
|
3
|
-
"version": "0.3.0-dev.
|
|
3
|
+
"version": "0.3.0-dev.1",
|
|
4
4
|
"description": "React Native TLS transport adapter for the ChitChat Developer Platform",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"test": "node test/transport.test.js"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@chitchat/sdk-core": "0.3.0-dev.
|
|
46
|
-
"@chitchat/sdk-protocol": "0.3.0-dev.
|
|
47
|
-
"@chitchat/sdk-web": "0.3.0-dev.
|
|
45
|
+
"@chitchat/sdk-core": "0.3.0-dev.1",
|
|
46
|
+
"@chitchat/sdk-protocol": "0.3.0-dev.1",
|
|
47
|
+
"@chitchat/sdk-web": "0.3.0-dev.1"
|
|
48
48
|
},
|
|
49
49
|
"keywords": [
|
|
50
50
|
"chitchat",
|
package/src/index.js
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
let ReliableRealtimeClient;
|
|
4
|
-
try {
|
|
4
|
+
try {
|
|
5
|
+
({ ReliableRealtimeClient } = require('@chitchat/sdk-core'));
|
|
6
|
+
} catch (_) {
|
|
7
|
+
// Monorepo dev fallback — constructed dynamically so Metro never statically
|
|
8
|
+
// bundles a dead relative path when the scoped package is present.
|
|
9
|
+
const monorepoCore = ['..', '..', 'chitchat-core', 'src'].join('/');
|
|
10
|
+
({ ReliableRealtimeClient } = require(monorepoCore));
|
|
11
|
+
}
|
|
5
12
|
|
|
6
13
|
const validateNativeTlsEndpoint = (endpoint) => {
|
|
7
14
|
if (typeof endpoint !== 'string' || !endpoint.trim() || /\s/.test(endpoint)) throw new Error('A TLS host endpoint is required');
|
|
@@ -59,14 +66,16 @@ const createChitChatNativeClient = ({ endpoint, tokenProvider, nativeModule, pro
|
|
|
59
66
|
if (!module) throw new Error('ChitChatTcp is not linked. Install pods and rebuild the native app; Expo Go is unsupported.');
|
|
60
67
|
idFactory = idFactory || (typeof module.randomUUID === 'function' ? () => module.randomUUID() : undefined);
|
|
61
68
|
let codecs;
|
|
62
|
-
try { codecs = require('@chitchat/sdk-protocol'); } catch (_) { codecs = require('
|
|
69
|
+
try { codecs = require('@chitchat/sdk-protocol'); } catch (_) { codecs = require(monorepoPath('protocol')); }
|
|
63
70
|
bridge = require('./protobuf-bridge').createChitChatNativeBridge({ nativeModule: module, eventEmitter: new NativeEventEmitter(module), protobuf: protobuf || codecs.createRealtimeEnvelopeCodec({ deviceId, platform: Platform.OS, idFactory }) });
|
|
64
71
|
}
|
|
65
72
|
return new ReliableRealtimeClient({ endpoint, tokenProvider, runtime: 'native', idFactory, nativeTransportFactory: createNativeTcpTransportFactory({ nativeModule: bridge, pinnedPublicKeyHashes, minimumTlsVersion }), ...options });
|
|
66
73
|
};
|
|
67
74
|
|
|
68
|
-
const
|
|
69
|
-
|
|
75
|
+
const monorepoPath = (name) => ['..', '..', `chitchat-${name}`, 'src'].join('/');
|
|
76
|
+
// Dynamic monorepo fallback so Metro never statically bundles dead relative paths.
|
|
77
|
+
const core = () => { try { return require('@chitchat/sdk-core'); } catch (_) { return require(monorepoPath('core')); } };
|
|
78
|
+
const web = () => { try { return require('@chitchat/sdk-web'); } catch (_) { return require(monorepoPath('web')); } };
|
|
70
79
|
// React Native ships WebSocket; using WSS removes the private TCP bridge requirement.
|
|
71
80
|
const createChitChatNativeWssClient = (options) => web().createChitChatWebClient(options);
|
|
72
81
|
const createChitChatNativeCalls = ({ rtc, ...options } = {}) => new (core().CallsClient)({ ...options, rtc: rtc || require('react-native-webrtc') });
|
package/src/protobuf-bridge.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Adapts the existing iOS/Android TLS byte-stream module. The public codec,
|
|
4
4
|
// handshake and frame limits live in JS; native code never sees a token string.
|
|
5
5
|
let protocol;
|
|
6
|
-
try { protocol = require('@chitchat/sdk-protocol'); } catch (_) { protocol = require('
|
|
6
|
+
try { protocol = require('@chitchat/sdk-protocol'); } catch (_) { protocol = require(['..', '..', 'chitchat-protocol', 'src'].join('/')); }
|
|
7
7
|
const leased = new WeakSet();
|
|
8
8
|
const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
|
9
9
|
const toBase64 = (bytes) => {
|