@ermis-network/ermis-chat-sdk 1.0.8 → 2.0.0
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/bin/init-call.js +9 -0
- package/dist/index.browser.cjs +778 -1628
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.full-bundle.min.js +16 -18
- package/dist/index.browser.full-bundle.min.js.map +1 -1
- package/dist/index.browser.mjs +780 -1630
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.cjs +778 -1628
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +173 -40
- package/dist/index.d.ts +173 -40
- package/dist/index.mjs +780 -1630
- package/dist/index.mjs.map +1 -1
- package/dist/wasm_worker.worker.mjs +1596 -0
- package/dist/wasm_worker.worker.mjs.map +1 -0
- package/package.json +2 -2
- package/public/ermis_call_node_wasm_bg.wasm +0 -0
- package/src/channel.ts +117 -44
- package/src/channel_state.ts +6 -1
- package/src/client.ts +198 -56
- package/src/ermis_call_node.ts +123 -55
- package/src/index.ts +2 -1
- package/src/media_stream_receiver.ts +103 -35
- package/src/media_stream_sender.ts +72 -7
- package/src/signal_message.ts +48 -23
- package/src/system_message.ts +169 -27
- package/src/types.ts +13 -0
- package/src/utils.ts +22 -3
- package/src/wasm/ermis_call_node_wasm.d.ts +80 -78
- package/src/wasm/ermis_call_node_wasm.js +1427 -1357
- package/src/wasm_worker.ts +219 -0
- package/src/wasm_worker_proxy.ts +244 -0
package/bin/init-call.js
CHANGED
|
@@ -6,12 +6,14 @@ const path = require('path');
|
|
|
6
6
|
const sourceWasm = path.join(__dirname, '../public/ermis_call_node_wasm_bg.wasm');
|
|
7
7
|
const sourceIncomingMp3 = path.join(__dirname, '../public/call_incoming.mp3');
|
|
8
8
|
const sourceOutgoingMp3 = path.join(__dirname, '../public/call_outgoing.mp3');
|
|
9
|
+
const sourceWorker = path.join(__dirname, '../dist/wasm_worker.worker.mjs');
|
|
9
10
|
|
|
10
11
|
// Execution directory (always the root of the consumer's project)
|
|
11
12
|
const targetDir = path.join(process.cwd(), 'public');
|
|
12
13
|
const targetWasm = path.join(targetDir, 'ermis_call_node_wasm_bg.wasm');
|
|
13
14
|
const targetIncomingMp3 = path.join(targetDir, 'call_incoming.mp3');
|
|
14
15
|
const targetOutgoingMp3 = path.join(targetDir, 'call_outgoing.mp3');
|
|
16
|
+
const targetWorker = path.join(targetDir, 'wasm_worker.worker.mjs');
|
|
15
17
|
|
|
16
18
|
console.log('🔄 Configuring WebAssembly & Audio files for Ermis Direct Call feature...');
|
|
17
19
|
|
|
@@ -45,6 +47,13 @@ try {
|
|
|
45
47
|
console.warn('⚠️ Warning: call_outgoing.mp3 not found in SDK, skipping copy.');
|
|
46
48
|
}
|
|
47
49
|
|
|
50
|
+
if (fs.existsSync(sourceWorker)) {
|
|
51
|
+
fs.copyFileSync(sourceWorker, targetWorker);
|
|
52
|
+
console.log('✅ Successfully copied wasm_worker.worker.mjs to your public/ directory!');
|
|
53
|
+
} else {
|
|
54
|
+
console.warn('⚠️ Warning: wasm_worker.worker.mjs not found in SDK dist/, skipping copy.');
|
|
55
|
+
}
|
|
56
|
+
|
|
48
57
|
console.log('You can now enable the Direct Call feature in your application.');
|
|
49
58
|
} catch (error) {
|
|
50
59
|
console.error('❌ An error occurred while copying the file:', error.message);
|