@voipsdk/react-native-voipcloud 0.2.1 → 1.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/README.md +181 -117
- package/android/build.gradle +7 -7
- package/android/src/main/java/com/voipcloud/sdk/rn/VoipCloudModule.java +148 -204
- package/android/src/main/java/com/voipcloud/sdk/rn/internal/BridgeGuard.java +74 -0
- package/android/src/main/java/com/voipcloud/sdk/rn/internal/Events.java +7 -2
- package/android/src/main/libs/voipcloud-release.aar +0 -0
- package/ios/VoipCloud.mm +8 -8
- package/lib/commonjs/VoipCloud.js +29 -47
- package/lib/commonjs/VoipCloud.js.map +1 -1
- package/lib/commonjs/events.js +13 -7
- package/lib/commonjs/events.js.map +1 -1
- package/lib/commonjs/index.js +2 -3
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/nativeModule.js +18 -0
- package/lib/commonjs/nativeModule.js.map +1 -0
- package/lib/module/VoipCloud.js +30 -47
- package/lib/module/VoipCloud.js.map +1 -1
- package/lib/module/events.js +9 -8
- package/lib/module/events.js.map +1 -1
- package/lib/module/index.js +1 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/nativeModule.js +13 -0
- package/lib/module/nativeModule.js.map +1 -0
- package/lib/typescript/VoipCloud.d.ts +5 -30
- package/lib/typescript/events.d.ts +6 -2
- package/lib/typescript/index.d.ts +2 -3
- package/lib/typescript/nativeModule.d.ts +7 -0
- package/lib/typescript/types.d.ts +1 -17
- package/package.json +5 -4
- package/react-native-voipcloud.podspec +7 -5
- package/src/VoipCloud.ts +37 -48
- package/src/events.ts +9 -8
- package/src/index.ts +1 -3
- package/src/nativeModule.ts +17 -0
- package/src/types.ts +1 -18
- package/lib/commonjs/License.js +0 -51
- package/lib/commonjs/License.js.map +0 -1
- package/lib/module/License.js +0 -45
- package/lib/module/License.js.map +0 -1
- package/lib/typescript/License.d.ts +0 -31
- package/src/License.ts +0 -52
package/ios/VoipCloud.mm
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
// react-native-voipcloud — iOS placeholder.
|
|
1
|
+
// @voipsdk/react-native-voipcloud — iOS placeholder.
|
|
2
2
|
//
|
|
3
3
|
// The Android build of the SDK is complete (libvoipcloud.so + JNI
|
|
4
4
|
// bridge). iOS bindings need an xcframework build of PJSIP, which
|
|
5
5
|
// requires Xcode on macOS. Until then, every JS call from iOS rejects
|
|
6
6
|
// with NOT_IMPLEMENTED so consumer apps notice early.
|
|
7
|
+
//
|
|
8
|
+
// Native module name must match VoipCloudModule.getName() on Android
|
|
9
|
+
// and NATIVE_MODULE_NAME in src/nativeModule.ts.
|
|
7
10
|
|
|
8
11
|
#import <React/RCTBridgeModule.h>
|
|
9
12
|
|
|
10
|
-
@interface
|
|
13
|
+
@interface VoipsdkReactNativeVoipcloud : NSObject <RCTBridgeModule>
|
|
11
14
|
@end
|
|
12
15
|
|
|
13
|
-
@implementation
|
|
16
|
+
@implementation VoipsdkReactNativeVoipcloud
|
|
14
17
|
|
|
15
|
-
RCT_EXPORT_MODULE(
|
|
18
|
+
RCT_EXPORT_MODULE();
|
|
16
19
|
|
|
17
20
|
#define VC_STUB(name, ...) \
|
|
18
21
|
RCT_EXPORT_METHOD(name:(__VA_ARGS__) \
|
|
19
22
|
resolver:(RCTPromiseResolveBlock)resolve \
|
|
20
23
|
rejecter:(RCTPromiseRejectBlock)reject) \
|
|
21
|
-
{ reject(@"VC_NOT_IMPLEMENTED", @"
|
|
24
|
+
{ reject(@"VC_NOT_IMPLEMENTED", @"@voipsdk/react-native-voipcloud iOS bindings not yet shipped.", nil); }
|
|
22
25
|
|
|
23
|
-
VC_STUB(setLicense, NSString *token)
|
|
24
|
-
VC_STUB(getLicenseStatus)
|
|
25
|
-
VC_STUB(stopLicenseRefresh)
|
|
26
26
|
VC_STUB(init_, NSDictionary *config) // renamed because of init clash
|
|
27
27
|
VC_STUB(shutdown)
|
|
28
28
|
VC_STUB(register, NSDictionary *cfg)
|
|
@@ -4,86 +4,68 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.VoipCloud = void 0;
|
|
7
|
-
var
|
|
8
|
-
var _License = require("./License");
|
|
7
|
+
var _nativeModule = require("./nativeModule");
|
|
9
8
|
var _events = require("./events");
|
|
10
|
-
|
|
9
|
+
/** Thrown as Promise rejection — never crashes at import time. */
|
|
10
|
+
function rejectNotLinked() {
|
|
11
|
+
return Promise.reject(Object.assign(new Error('@voipsdk/react-native-voipcloud native module is not linked. ' + 'Install the package, rebuild the Android app ' + '(./gradlew clean assembleDebug), and ensure voipcloud-release.aar is packaged.'), {
|
|
12
|
+
code: 'VC_NOT_LINKED'
|
|
13
|
+
}));
|
|
14
|
+
}
|
|
15
|
+
function callNative(fn) {
|
|
16
|
+
if (!_nativeModule.NativeVoipCloud) return rejectNotLinked();
|
|
17
|
+
return fn();
|
|
18
|
+
}
|
|
11
19
|
|
|
12
20
|
/**
|
|
13
|
-
* Top-level VoIP SDK. Workflow:
|
|
21
|
+
* Top-level VoIP SDK for {@code @voipsdk/react-native-voipcloud}. Workflow:
|
|
14
22
|
*
|
|
15
|
-
* 1. {@link
|
|
16
|
-
* 2. {@link
|
|
17
|
-
* 3. {@link
|
|
18
|
-
* 4. {@link makeCall} / {@link answer} / {@link hangup}.
|
|
23
|
+
* 1. {@link init} — start the PJSIP endpoint.
|
|
24
|
+
* 2. {@link register} — get an `accountId` back.
|
|
25
|
+
* 3. {@link makeCall} / {@link answer} / {@link hangup}.
|
|
19
26
|
*
|
|
20
|
-
* Every method returns a Promise.
|
|
21
|
-
* Promise rejection with `code = "VC_<NAME>"` matching the
|
|
22
|
-
* `PJ_EVOIPCLOUD_*` enum from `voipcloud_errno.h`.
|
|
27
|
+
* Every method returns a Promise. Failures reject with a `VC_*` code.
|
|
23
28
|
*/
|
|
24
29
|
const VoipCloud = exports.VoipCloud = {
|
|
25
|
-
// ---------------------- License ---------------------------------
|
|
26
|
-
License: _License.License,
|
|
27
|
-
// ---------------------- Lifecycle -------------------------------
|
|
28
30
|
init(cfg = {}) {
|
|
29
|
-
return
|
|
31
|
+
return callNative(() => _nativeModule.NativeVoipCloud.init(cfg ?? {}));
|
|
30
32
|
},
|
|
31
33
|
shutdown() {
|
|
32
|
-
return
|
|
34
|
+
return callNative(() => _nativeModule.NativeVoipCloud.shutdown());
|
|
33
35
|
},
|
|
34
|
-
// ---------------------- Accounts --------------------------------
|
|
35
|
-
/** Register a new SIP account. Resolves with the account id. */
|
|
36
36
|
register(account) {
|
|
37
|
-
return
|
|
37
|
+
return callNative(() => _nativeModule.NativeVoipCloud.register(account));
|
|
38
38
|
},
|
|
39
39
|
unregister(accountId) {
|
|
40
|
-
return
|
|
40
|
+
return callNative(() => _nativeModule.NativeVoipCloud.unregister(accountId));
|
|
41
41
|
},
|
|
42
|
-
// ---------------------- Calls -----------------------------------
|
|
43
|
-
/** Place an outbound call. Resolves with the new callId. */
|
|
44
42
|
makeCall(accountId, destinationUri) {
|
|
45
|
-
return
|
|
43
|
+
return callNative(() => _nativeModule.NativeVoipCloud.makeCall(accountId, destinationUri));
|
|
46
44
|
},
|
|
47
45
|
answer(callId) {
|
|
48
|
-
return
|
|
46
|
+
return callNative(() => _nativeModule.NativeVoipCloud.answer(callId));
|
|
49
47
|
},
|
|
50
48
|
hangup(callId) {
|
|
51
|
-
return
|
|
49
|
+
return callNative(() => _nativeModule.NativeVoipCloud.hangup(callId));
|
|
52
50
|
},
|
|
53
51
|
hold(callId) {
|
|
54
|
-
return
|
|
52
|
+
return callNative(() => _nativeModule.NativeVoipCloud.hold(callId));
|
|
55
53
|
},
|
|
56
54
|
unhold(callId) {
|
|
57
|
-
return
|
|
55
|
+
return callNative(() => _nativeModule.NativeVoipCloud.unhold(callId));
|
|
58
56
|
},
|
|
59
|
-
/**
|
|
60
|
-
* Mute / unmute the local microphone for a call. Implemented by
|
|
61
|
-
* stopping / starting the capture device's transmission to the
|
|
62
|
-
* call's active audio media — independent of `hold`. A
|
|
63
|
-
* `callMediaState` event fires after the toggle so the UI can
|
|
64
|
-
* mirror the new `isMuted` flag without polling.
|
|
65
|
-
*/
|
|
66
57
|
mute(callId, on) {
|
|
67
|
-
return
|
|
58
|
+
return callNative(() => _nativeModule.NativeVoipCloud.mute(callId, on));
|
|
68
59
|
},
|
|
69
60
|
sendDtmf(callId, digits) {
|
|
70
|
-
return
|
|
61
|
+
return callNative(() => _nativeModule.NativeVoipCloud.sendDtmf(callId, digits));
|
|
71
62
|
},
|
|
72
|
-
/**
|
|
73
|
-
* Blind-transfer a call (SIP REFER) to a new destination. The
|
|
74
|
-
* local leg moves to DISCONNECTED once the remote party accepts.
|
|
75
|
-
*/
|
|
76
63
|
transferCall(callId, destinationUri) {
|
|
77
|
-
return
|
|
64
|
+
return callNative(() => _nativeModule.NativeVoipCloud.transferCall(callId, destinationUri));
|
|
78
65
|
},
|
|
79
|
-
/**
|
|
80
|
-
* End every active call. Each call still emits its own
|
|
81
|
-
* `callState` event with state=DISCONNECTED.
|
|
82
|
-
*/
|
|
83
66
|
hangupAllCalls() {
|
|
84
|
-
return
|
|
67
|
+
return callNative(() => _nativeModule.NativeVoipCloud.hangupAllCalls());
|
|
85
68
|
},
|
|
86
|
-
// ---------------------- Events ----------------------------------
|
|
87
69
|
on: _events.on
|
|
88
70
|
};
|
|
89
71
|
//# sourceMappingURL=VoipCloud.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_nativeModule","require","_events","rejectNotLinked","Promise","reject","Object","assign","Error","code","callNative","fn","NativeVoipCloud","VoipCloud","exports","init","cfg","shutdown","register","account","unregister","accountId","makeCall","destinationUri","answer","callId","hangup","hold","unhold","mute","on","sendDtmf","digits","transferCall","hangupAllCalls"],"sourceRoot":"../../src","sources":["VoipCloud.ts"],"mappings":";;;;;;AACA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA;AACA,SAASE,eAAeA,CAAA,EAAmB;EACvC,OAAOC,OAAO,CAACC,MAAM,CACjBC,MAAM,CAACC,MAAM,CACT,IAAIC,KAAK,CACL,+DAA+D,GAC/D,+CAA+C,GAC/C,gFACJ,CAAC,EACD;IAAEC,IAAI,EAAE;EAAgB,CAC5B,CACJ,CAAC;AACL;AAEA,SAASC,UAAUA,CAAIC,EAAoB,EAAc;EACrD,IAAI,CAACC,6BAAe,EAAE,OAAOT,eAAe,CAAC,CAAC;EAC9C,OAAOQ,EAAE,CAAC,CAAC;AACf;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAME,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG;EACrBE,IAAIA,CAACC,GAAe,GAAG,CAAC,CAAC,EAAiB;IACtC,OAAON,UAAU,CAAC,MAAME,6BAAe,CAACG,IAAI,CAACC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;EAC5D,CAAC;EAEDC,QAAQA,CAAA,EAAkB;IACtB,OAAOP,UAAU,CAAC,MAAME,6BAAe,CAACK,QAAQ,CAAC,CAAC,CAAC;EACvD,CAAC;EAEDC,QAAQA,CAACC,OAAsB,EAAmB;IAC9C,OAAOT,UAAU,CAAC,MAAME,6BAAe,CAACM,QAAQ,CAACC,OAAO,CAAC,CAAC;EAC9D,CAAC;EAEDC,UAAUA,CAACC,SAAiB,EAAiB;IACzC,OAAOX,UAAU,CAAC,MAAME,6BAAe,CAACQ,UAAU,CAACC,SAAS,CAAC,CAAC;EAClE,CAAC;EAEDC,QAAQA,CAACD,SAAiB,EAAEE,cAAsB,EAAmB;IACjE,OAAOb,UAAU,CAAC,MAAME,6BAAe,CAACU,QAAQ,CAACD,SAAS,EAAEE,cAAc,CAAC,CAAC;EAChF,CAAC;EAEDC,MAAMA,CAACC,MAAc,EAAiB;IAClC,OAAOf,UAAU,CAAC,MAAME,6BAAe,CAACY,MAAM,CAACC,MAAM,CAAC,CAAC;EAC3D,CAAC;EAEDC,MAAMA,CAACD,MAAc,EAAiB;IAClC,OAAOf,UAAU,CAAC,MAAME,6BAAe,CAACc,MAAM,CAACD,MAAM,CAAC,CAAC;EAC3D,CAAC;EAEDE,IAAIA,CAACF,MAAc,EAAiB;IAChC,OAAOf,UAAU,CAAC,MAAME,6BAAe,CAACe,IAAI,CAACF,MAAM,CAAC,CAAC;EACzD,CAAC;EAEDG,MAAMA,CAACH,MAAc,EAAiB;IAClC,OAAOf,UAAU,CAAC,MAAME,6BAAe,CAACgB,MAAM,CAACH,MAAM,CAAC,CAAC;EAC3D,CAAC;EAEDI,IAAIA,CAACJ,MAAc,EAAEK,EAAW,EAAiB;IAC7C,OAAOpB,UAAU,CAAC,MAAME,6BAAe,CAACiB,IAAI,CAACJ,MAAM,EAAEK,EAAE,CAAC,CAAC;EAC7D,CAAC;EAEDC,QAAQA,CAACN,MAAc,EAAEO,MAAc,EAAiB;IACpD,OAAOtB,UAAU,CAAC,MAAME,6BAAe,CAACmB,QAAQ,CAACN,MAAM,EAAEO,MAAM,CAAC,CAAC;EACrE,CAAC;EAEDC,YAAYA,CAACR,MAAc,EAAEF,cAAsB,EAAiB;IAChE,OAAOb,UAAU,CAAC,MAAME,6BAAe,CAACqB,YAAY,CAACR,MAAM,EAAEF,cAAc,CAAC,CAAC;EACjF,CAAC;EAEDW,cAAcA,CAAA,EAAkB;IAC5B,OAAOxB,UAAU,CAAC,MAAME,6BAAe,CAACsB,cAAc,CAAC,CAAC,CAAC;EAC7D,CAAC;EAEDJ,EAAE,EAAFA;AACJ,CAAC","ignoreList":[]}
|
package/lib/commonjs/events.js
CHANGED
|
@@ -3,17 +3,21 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
Object.defineProperty(exports, "NATIVE_MODULE_NAME", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _nativeModule.NATIVE_MODULE_NAME;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
6
12
|
exports.on = on;
|
|
7
13
|
var _reactNative = require("react-native");
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
// Lazy emitter — must point at the module to satisfy the contract
|
|
11
|
-
// NativeEventEmitter expects on RN 0.65+.
|
|
12
|
-
const emitter = Native ? new _reactNative.NativeEventEmitter(Native) : null;
|
|
14
|
+
var _nativeModule = require("./nativeModule");
|
|
15
|
+
const emitter = _nativeModule.NativeVoipCloud ? new _reactNative.NativeEventEmitter(_nativeModule.NativeVoipCloud) : null;
|
|
13
16
|
|
|
14
17
|
/**
|
|
15
|
-
* Subscribe to a typed event
|
|
16
|
-
* be called from a React `useEffect`
|
|
18
|
+
* Subscribe to a typed event from {@code @voipsdk/react-native-voipcloud}.
|
|
19
|
+
* Returns a handle whose `remove()` must be called from a React `useEffect`
|
|
20
|
+
* cleanup to avoid leaks.
|
|
17
21
|
*/
|
|
18
22
|
function on(name, callback) {
|
|
19
23
|
if (!emitter) {
|
|
@@ -26,4 +30,6 @@ function on(name, callback) {
|
|
|
26
30
|
remove: () => sub.remove()
|
|
27
31
|
};
|
|
28
32
|
}
|
|
33
|
+
|
|
34
|
+
/** Native module name registered with React Native (for debugging). */
|
|
29
35
|
//# sourceMappingURL=events.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_nativeModule","emitter","NativeVoipCloud","NativeEventEmitter","on","name","callback","remove","sub","addListener"],"sourceRoot":"../../src","sources":["events.ts"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,aAAA,GAAAD,OAAA;AAEA,MAAME,OAAO,GAAGC,6BAAe,GAAG,IAAIC,+BAAkB,CAACD,6BAAe,CAAC,GAAG,IAAI;;AAEhF;AACA;AACA;AACA;AACA;AACO,SAASE,EAAEA,CACdC,IAAO,EACPC,QAAsC,EAC1B;EACZ,IAAI,CAACL,OAAO,EAAE;IACV,OAAO;MAAEM,MAAM,EAAEA,CAAA,KAAM,CAAC;IAAE,CAAC;EAC/B;EACA,MAAMC,GAAG,GAAGP,OAAO,CAACQ,WAAW,CAACJ,IAAI,EAAEC,QAAgC,CAAC;EACvE,OAAO;IAAEC,MAAM,EAAEA,CAAA,KAAMC,GAAG,CAACD,MAAM,CAAC;EAAE,CAAC;AACzC;;AAEA","ignoreList":[]}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
Object.defineProperty(exports, "
|
|
6
|
+
Object.defineProperty(exports, "NATIVE_MODULE_NAME", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function () {
|
|
9
|
-
return
|
|
9
|
+
return _events.NATIVE_MODULE_NAME;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "VoipCloud", {
|
|
@@ -22,6 +22,5 @@ Object.defineProperty(exports, "addEventListener", {
|
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
var _VoipCloud = require("./VoipCloud");
|
|
25
|
-
var _License = require("./License");
|
|
26
25
|
var _events = require("./events");
|
|
27
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_VoipCloud","require","
|
|
1
|
+
{"version":3,"names":["_VoipCloud","require","_events"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.NativeVoipCloud = exports.NATIVE_MODULE_NAME = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
/**
|
|
9
|
+
* Native module name — must match {@code VoipCloudModule.getName()} on Android
|
|
10
|
+
* and the future iOS RCT export. Derived from npm package
|
|
11
|
+
* {@code @voipsdk/react-native-voipcloud}.
|
|
12
|
+
*/
|
|
13
|
+
const NATIVE_MODULE_NAME = exports.NATIVE_MODULE_NAME = 'VoipsdkReactNativeVoipcloud';
|
|
14
|
+
const NativeVoipCloud = exports.NativeVoipCloud = _reactNative.NativeModules[NATIVE_MODULE_NAME];
|
|
15
|
+
if (!NativeVoipCloud) {
|
|
16
|
+
console.warn('[@voipsdk/react-native-voipcloud] Native module not linked. ' + 'Methods will reject with VC_NOT_LINKED until the app is rebuilt.');
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=nativeModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","NATIVE_MODULE_NAME","exports","NativeVoipCloud","NativeModules","console","warn"],"sourceRoot":"../../src","sources":["nativeModule.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACA;AACO,MAAMC,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG,6BAA6B;AAExD,MAAME,eAAe,GAAAD,OAAA,CAAAC,eAAA,GAAGC,0BAAa,CAACH,kBAAkB,CAAC;AAEhE,IAAI,CAACE,eAAe,EAAE;EAClBE,OAAO,CAACC,IAAI,CACR,8DAA8D,GAC9D,kEACJ,CAAC;AACL","ignoreList":[]}
|
package/lib/module/VoipCloud.js
CHANGED
|
@@ -1,83 +1,66 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { License } from './License';
|
|
1
|
+
import { NativeVoipCloud } from './nativeModule';
|
|
3
2
|
import { on } from './events';
|
|
4
|
-
|
|
3
|
+
|
|
4
|
+
/** Thrown as Promise rejection — never crashes at import time. */
|
|
5
|
+
function rejectNotLinked() {
|
|
6
|
+
return Promise.reject(Object.assign(new Error('@voipsdk/react-native-voipcloud native module is not linked. ' + 'Install the package, rebuild the Android app ' + '(./gradlew clean assembleDebug), and ensure voipcloud-release.aar is packaged.'), {
|
|
7
|
+
code: 'VC_NOT_LINKED'
|
|
8
|
+
}));
|
|
9
|
+
}
|
|
10
|
+
function callNative(fn) {
|
|
11
|
+
if (!NativeVoipCloud) return rejectNotLinked();
|
|
12
|
+
return fn();
|
|
13
|
+
}
|
|
5
14
|
|
|
6
15
|
/**
|
|
7
|
-
* Top-level VoIP SDK. Workflow:
|
|
16
|
+
* Top-level VoIP SDK for {@code @voipsdk/react-native-voipcloud}. Workflow:
|
|
8
17
|
*
|
|
9
|
-
* 1. {@link
|
|
10
|
-
* 2. {@link
|
|
11
|
-
* 3. {@link
|
|
12
|
-
* 4. {@link makeCall} / {@link answer} / {@link hangup}.
|
|
18
|
+
* 1. {@link init} — start the PJSIP endpoint.
|
|
19
|
+
* 2. {@link register} — get an `accountId` back.
|
|
20
|
+
* 3. {@link makeCall} / {@link answer} / {@link hangup}.
|
|
13
21
|
*
|
|
14
|
-
* Every method returns a Promise.
|
|
15
|
-
* Promise rejection with `code = "VC_<NAME>"` matching the
|
|
16
|
-
* `PJ_EVOIPCLOUD_*` enum from `voipcloud_errno.h`.
|
|
22
|
+
* Every method returns a Promise. Failures reject with a `VC_*` code.
|
|
17
23
|
*/
|
|
18
24
|
export const VoipCloud = {
|
|
19
|
-
// ---------------------- License ---------------------------------
|
|
20
|
-
License,
|
|
21
|
-
// ---------------------- Lifecycle -------------------------------
|
|
22
25
|
init(cfg = {}) {
|
|
23
|
-
return
|
|
26
|
+
return callNative(() => NativeVoipCloud.init(cfg ?? {}));
|
|
24
27
|
},
|
|
25
28
|
shutdown() {
|
|
26
|
-
return
|
|
29
|
+
return callNative(() => NativeVoipCloud.shutdown());
|
|
27
30
|
},
|
|
28
|
-
// ---------------------- Accounts --------------------------------
|
|
29
|
-
/** Register a new SIP account. Resolves with the account id. */
|
|
30
31
|
register(account) {
|
|
31
|
-
return
|
|
32
|
+
return callNative(() => NativeVoipCloud.register(account));
|
|
32
33
|
},
|
|
33
34
|
unregister(accountId) {
|
|
34
|
-
return
|
|
35
|
+
return callNative(() => NativeVoipCloud.unregister(accountId));
|
|
35
36
|
},
|
|
36
|
-
// ---------------------- Calls -----------------------------------
|
|
37
|
-
/** Place an outbound call. Resolves with the new callId. */
|
|
38
37
|
makeCall(accountId, destinationUri) {
|
|
39
|
-
return
|
|
38
|
+
return callNative(() => NativeVoipCloud.makeCall(accountId, destinationUri));
|
|
40
39
|
},
|
|
41
40
|
answer(callId) {
|
|
42
|
-
return
|
|
41
|
+
return callNative(() => NativeVoipCloud.answer(callId));
|
|
43
42
|
},
|
|
44
43
|
hangup(callId) {
|
|
45
|
-
return
|
|
44
|
+
return callNative(() => NativeVoipCloud.hangup(callId));
|
|
46
45
|
},
|
|
47
46
|
hold(callId) {
|
|
48
|
-
return
|
|
47
|
+
return callNative(() => NativeVoipCloud.hold(callId));
|
|
49
48
|
},
|
|
50
49
|
unhold(callId) {
|
|
51
|
-
return
|
|
50
|
+
return callNative(() => NativeVoipCloud.unhold(callId));
|
|
52
51
|
},
|
|
53
|
-
/**
|
|
54
|
-
* Mute / unmute the local microphone for a call. Implemented by
|
|
55
|
-
* stopping / starting the capture device's transmission to the
|
|
56
|
-
* call's active audio media — independent of `hold`. A
|
|
57
|
-
* `callMediaState` event fires after the toggle so the UI can
|
|
58
|
-
* mirror the new `isMuted` flag without polling.
|
|
59
|
-
*/
|
|
60
52
|
mute(callId, on) {
|
|
61
|
-
return
|
|
53
|
+
return callNative(() => NativeVoipCloud.mute(callId, on));
|
|
62
54
|
},
|
|
63
55
|
sendDtmf(callId, digits) {
|
|
64
|
-
return
|
|
56
|
+
return callNative(() => NativeVoipCloud.sendDtmf(callId, digits));
|
|
65
57
|
},
|
|
66
|
-
/**
|
|
67
|
-
* Blind-transfer a call (SIP REFER) to a new destination. The
|
|
68
|
-
* local leg moves to DISCONNECTED once the remote party accepts.
|
|
69
|
-
*/
|
|
70
58
|
transferCall(callId, destinationUri) {
|
|
71
|
-
return
|
|
59
|
+
return callNative(() => NativeVoipCloud.transferCall(callId, destinationUri));
|
|
72
60
|
},
|
|
73
|
-
/**
|
|
74
|
-
* End every active call. Each call still emits its own
|
|
75
|
-
* `callState` event with state=DISCONNECTED.
|
|
76
|
-
*/
|
|
77
61
|
hangupAllCalls() {
|
|
78
|
-
return
|
|
62
|
+
return callNative(() => NativeVoipCloud.hangupAllCalls());
|
|
79
63
|
},
|
|
80
|
-
// ---------------------- Events ----------------------------------
|
|
81
64
|
on
|
|
82
65
|
};
|
|
83
66
|
//# sourceMappingURL=VoipCloud.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["NativeVoipCloud","on","rejectNotLinked","Promise","reject","Object","assign","Error","code","callNative","fn","VoipCloud","init","cfg","shutdown","register","account","unregister","accountId","makeCall","destinationUri","answer","callId","hangup","hold","unhold","mute","sendDtmf","digits","transferCall","hangupAllCalls"],"sourceRoot":"../../src","sources":["VoipCloud.ts"],"mappings":"AACA,SAASA,eAAe,QAAQ,gBAAgB;AAChD,SAASC,EAAE,QAAQ,UAAU;;AAE7B;AACA,SAASC,eAAeA,CAAA,EAAmB;EACvC,OAAOC,OAAO,CAACC,MAAM,CACjBC,MAAM,CAACC,MAAM,CACT,IAAIC,KAAK,CACL,+DAA+D,GAC/D,+CAA+C,GAC/C,gFACJ,CAAC,EACD;IAAEC,IAAI,EAAE;EAAgB,CAC5B,CACJ,CAAC;AACL;AAEA,SAASC,UAAUA,CAAIC,EAAoB,EAAc;EACrD,IAAI,CAACV,eAAe,EAAE,OAAOE,eAAe,CAAC,CAAC;EAC9C,OAAOQ,EAAE,CAAC,CAAC;AACf;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,SAAS,GAAG;EACrBC,IAAIA,CAACC,GAAe,GAAG,CAAC,CAAC,EAAiB;IACtC,OAAOJ,UAAU,CAAC,MAAMT,eAAe,CAACY,IAAI,CAACC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;EAC5D,CAAC;EAEDC,QAAQA,CAAA,EAAkB;IACtB,OAAOL,UAAU,CAAC,MAAMT,eAAe,CAACc,QAAQ,CAAC,CAAC,CAAC;EACvD,CAAC;EAEDC,QAAQA,CAACC,OAAsB,EAAmB;IAC9C,OAAOP,UAAU,CAAC,MAAMT,eAAe,CAACe,QAAQ,CAACC,OAAO,CAAC,CAAC;EAC9D,CAAC;EAEDC,UAAUA,CAACC,SAAiB,EAAiB;IACzC,OAAOT,UAAU,CAAC,MAAMT,eAAe,CAACiB,UAAU,CAACC,SAAS,CAAC,CAAC;EAClE,CAAC;EAEDC,QAAQA,CAACD,SAAiB,EAAEE,cAAsB,EAAmB;IACjE,OAAOX,UAAU,CAAC,MAAMT,eAAe,CAACmB,QAAQ,CAACD,SAAS,EAAEE,cAAc,CAAC,CAAC;EAChF,CAAC;EAEDC,MAAMA,CAACC,MAAc,EAAiB;IAClC,OAAOb,UAAU,CAAC,MAAMT,eAAe,CAACqB,MAAM,CAACC,MAAM,CAAC,CAAC;EAC3D,CAAC;EAEDC,MAAMA,CAACD,MAAc,EAAiB;IAClC,OAAOb,UAAU,CAAC,MAAMT,eAAe,CAACuB,MAAM,CAACD,MAAM,CAAC,CAAC;EAC3D,CAAC;EAEDE,IAAIA,CAACF,MAAc,EAAiB;IAChC,OAAOb,UAAU,CAAC,MAAMT,eAAe,CAACwB,IAAI,CAACF,MAAM,CAAC,CAAC;EACzD,CAAC;EAEDG,MAAMA,CAACH,MAAc,EAAiB;IAClC,OAAOb,UAAU,CAAC,MAAMT,eAAe,CAACyB,MAAM,CAACH,MAAM,CAAC,CAAC;EAC3D,CAAC;EAEDI,IAAIA,CAACJ,MAAc,EAAErB,EAAW,EAAiB;IAC7C,OAAOQ,UAAU,CAAC,MAAMT,eAAe,CAAC0B,IAAI,CAACJ,MAAM,EAAErB,EAAE,CAAC,CAAC;EAC7D,CAAC;EAED0B,QAAQA,CAACL,MAAc,EAAEM,MAAc,EAAiB;IACpD,OAAOnB,UAAU,CAAC,MAAMT,eAAe,CAAC2B,QAAQ,CAACL,MAAM,EAAEM,MAAM,CAAC,CAAC;EACrE,CAAC;EAEDC,YAAYA,CAACP,MAAc,EAAEF,cAAsB,EAAiB;IAChE,OAAOX,UAAU,CAAC,MAAMT,eAAe,CAAC6B,YAAY,CAACP,MAAM,EAAEF,cAAc,CAAC,CAAC;EACjF,CAAC;EAEDU,cAAcA,CAAA,EAAkB;IAC5B,OAAOrB,UAAU,CAAC,MAAMT,eAAe,CAAC8B,cAAc,CAAC,CAAC,CAAC;EAC7D,CAAC;EAED7B;AACJ,CAAC","ignoreList":[]}
|
package/lib/module/events.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { NativeEventEmitter
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
// Lazy emitter — must point at the module to satisfy the contract
|
|
5
|
-
// NativeEventEmitter expects on RN 0.65+.
|
|
6
|
-
const emitter = Native ? new NativeEventEmitter(Native) : null;
|
|
1
|
+
import { NativeEventEmitter } from 'react-native';
|
|
2
|
+
import { NATIVE_MODULE_NAME, NativeVoipCloud } from './nativeModule';
|
|
3
|
+
const emitter = NativeVoipCloud ? new NativeEventEmitter(NativeVoipCloud) : null;
|
|
7
4
|
|
|
8
5
|
/**
|
|
9
|
-
* Subscribe to a typed event
|
|
10
|
-
* be called from a React `useEffect`
|
|
6
|
+
* Subscribe to a typed event from {@code @voipsdk/react-native-voipcloud}.
|
|
7
|
+
* Returns a handle whose `remove()` must be called from a React `useEffect`
|
|
8
|
+
* cleanup to avoid leaks.
|
|
11
9
|
*/
|
|
12
10
|
export function on(name, callback) {
|
|
13
11
|
if (!emitter) {
|
|
@@ -20,4 +18,7 @@ export function on(name, callback) {
|
|
|
20
18
|
remove: () => sub.remove()
|
|
21
19
|
};
|
|
22
20
|
}
|
|
21
|
+
|
|
22
|
+
/** Native module name registered with React Native (for debugging). */
|
|
23
|
+
export { NATIVE_MODULE_NAME };
|
|
23
24
|
//# sourceMappingURL=events.js.map
|
package/lib/module/events.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeEventEmitter","
|
|
1
|
+
{"version":3,"names":["NativeEventEmitter","NATIVE_MODULE_NAME","NativeVoipCloud","emitter","on","name","callback","remove","sub","addListener"],"sourceRoot":"../../src","sources":["events.ts"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,cAAc;AAEjD,SAASC,kBAAkB,EAAEC,eAAe,QAAQ,gBAAgB;AAEpE,MAAMC,OAAO,GAAGD,eAAe,GAAG,IAAIF,kBAAkB,CAACE,eAAe,CAAC,GAAG,IAAI;;AAEhF;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,EAAEA,CACdC,IAAO,EACPC,QAAsC,EAC1B;EACZ,IAAI,CAACH,OAAO,EAAE;IACV,OAAO;MAAEI,MAAM,EAAEA,CAAA,KAAM,CAAC;IAAE,CAAC;EAC/B;EACA,MAAMC,GAAG,GAAGL,OAAO,CAACM,WAAW,CAACJ,IAAI,EAAEC,QAAgC,CAAC;EACvE,OAAO;IAAEC,MAAM,EAAEA,CAAA,KAAMC,GAAG,CAACD,MAAM,CAAC;EAAE,CAAC;AACzC;;AAEA;AACA,SAASN,kBAAkB","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["VoipCloud","
|
|
1
|
+
{"version":3,"names":["VoipCloud","on","addEventListener","NATIVE_MODULE_NAME"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAAA,SAASA,SAAS,QAAQ,aAAa;AACvC,SAASC,EAAE,IAAIC,gBAAgB,EAAEC,kBAAkB,QAAQ,UAAU","ignoreList":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { NativeModules } from 'react-native';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Native module name — must match {@code VoipCloudModule.getName()} on Android
|
|
5
|
+
* and the future iOS RCT export. Derived from npm package
|
|
6
|
+
* {@code @voipsdk/react-native-voipcloud}.
|
|
7
|
+
*/
|
|
8
|
+
export const NATIVE_MODULE_NAME = 'VoipsdkReactNativeVoipcloud';
|
|
9
|
+
export const NativeVoipCloud = NativeModules[NATIVE_MODULE_NAME];
|
|
10
|
+
if (!NativeVoipCloud) {
|
|
11
|
+
console.warn('[@voipsdk/react-native-voipcloud] Native module not linked. ' + 'Methods will reject with VC_NOT_LINKED until the app is rebuilt.');
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=nativeModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["NativeModules","NATIVE_MODULE_NAME","NativeVoipCloud","console","warn"],"sourceRoot":"../../src","sources":["nativeModule.ts"],"mappings":"AAAA,SAASA,aAAa,QAAQ,cAAc;;AAE5C;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,kBAAkB,GAAG,6BAA6B;AAE/D,OAAO,MAAMC,eAAe,GAAGF,aAAa,CAACC,kBAAkB,CAAC;AAEhE,IAAI,CAACC,eAAe,EAAE;EAClBC,OAAO,CAACC,IAAI,CACR,8DAA8D,GAC9D,kEACJ,CAAC;AACL","ignoreList":[]}
|
|
@@ -1,52 +1,27 @@
|
|
|
1
1
|
import type { AccountConfig, InitConfig } from './types';
|
|
2
2
|
import { on } from './events';
|
|
3
3
|
/**
|
|
4
|
-
* Top-level VoIP SDK. Workflow:
|
|
4
|
+
* Top-level VoIP SDK for {@code @voipsdk/react-native-voipcloud}. Workflow:
|
|
5
5
|
*
|
|
6
|
-
* 1. {@link
|
|
7
|
-
* 2. {@link
|
|
8
|
-
* 3. {@link
|
|
9
|
-
* 4. {@link makeCall} / {@link answer} / {@link hangup}.
|
|
6
|
+
* 1. {@link init} — start the PJSIP endpoint.
|
|
7
|
+
* 2. {@link register} — get an `accountId` back.
|
|
8
|
+
* 3. {@link makeCall} / {@link answer} / {@link hangup}.
|
|
10
9
|
*
|
|
11
|
-
* Every method returns a Promise.
|
|
12
|
-
* Promise rejection with `code = "VC_<NAME>"` matching the
|
|
13
|
-
* `PJ_EVOIPCLOUD_*` enum from `voipcloud_errno.h`.
|
|
10
|
+
* Every method returns a Promise. Failures reject with a `VC_*` code.
|
|
14
11
|
*/
|
|
15
12
|
export declare const VoipCloud: {
|
|
16
|
-
License: {
|
|
17
|
-
set(token: string): Promise<void>;
|
|
18
|
-
status(): Promise<import("./types").LicenseStatus>;
|
|
19
|
-
stopRefresh(): Promise<void>;
|
|
20
|
-
};
|
|
21
13
|
init(cfg?: InitConfig): Promise<void>;
|
|
22
14
|
shutdown(): Promise<void>;
|
|
23
|
-
/** Register a new SIP account. Resolves with the account id. */
|
|
24
15
|
register(account: AccountConfig): Promise<number>;
|
|
25
16
|
unregister(accountId: number): Promise<void>;
|
|
26
|
-
/** Place an outbound call. Resolves with the new callId. */
|
|
27
17
|
makeCall(accountId: number, destinationUri: string): Promise<number>;
|
|
28
18
|
answer(callId: number): Promise<void>;
|
|
29
19
|
hangup(callId: number): Promise<void>;
|
|
30
20
|
hold(callId: number): Promise<void>;
|
|
31
21
|
unhold(callId: number): Promise<void>;
|
|
32
|
-
/**
|
|
33
|
-
* Mute / unmute the local microphone for a call. Implemented by
|
|
34
|
-
* stopping / starting the capture device's transmission to the
|
|
35
|
-
* call's active audio media — independent of `hold`. A
|
|
36
|
-
* `callMediaState` event fires after the toggle so the UI can
|
|
37
|
-
* mirror the new `isMuted` flag without polling.
|
|
38
|
-
*/
|
|
39
22
|
mute(callId: number, on: boolean): Promise<void>;
|
|
40
23
|
sendDtmf(callId: number, digits: string): Promise<void>;
|
|
41
|
-
/**
|
|
42
|
-
* Blind-transfer a call (SIP REFER) to a new destination. The
|
|
43
|
-
* local leg moves to DISCONNECTED once the remote party accepts.
|
|
44
|
-
*/
|
|
45
24
|
transferCall(callId: number, destinationUri: string): Promise<void>;
|
|
46
|
-
/**
|
|
47
|
-
* End every active call. Each call still emits its own
|
|
48
|
-
* `callState` event with state=DISCONNECTED.
|
|
49
|
-
*/
|
|
50
25
|
hangupAllCalls(): Promise<void>;
|
|
51
26
|
on: typeof on;
|
|
52
27
|
};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { EventMap, Subscription } from './types';
|
|
2
|
+
import { NATIVE_MODULE_NAME } from './nativeModule';
|
|
2
3
|
/**
|
|
3
|
-
* Subscribe to a typed event
|
|
4
|
-
* be called from a React `useEffect`
|
|
4
|
+
* Subscribe to a typed event from {@code @voipsdk/react-native-voipcloud}.
|
|
5
|
+
* Returns a handle whose `remove()` must be called from a React `useEffect`
|
|
6
|
+
* cleanup to avoid leaks.
|
|
5
7
|
*/
|
|
6
8
|
export declare function on<K extends keyof EventMap>(name: K, callback: (event: EventMap[K]) => void): Subscription;
|
|
9
|
+
/** Native module name registered with React Native (for debugging). */
|
|
10
|
+
export { NATIVE_MODULE_NAME };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export { VoipCloud } from './VoipCloud';
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export type { Transport, InitConfig, AccountConfig, LicenseStatus, RegistrationStateEvent, IncomingCallEvent, CallState, CallStateEvent, CallMediaStateEvent, CallHoldEvent, CallUnholdEvent, CallMuteEvent, CallDtmfSentEvent, CallTransferEvent, CallTransferStatusEvent, IncomingDtmfEvent, EventMap, Subscription, } from './types';
|
|
2
|
+
export { on as addEventListener, NATIVE_MODULE_NAME } from './events';
|
|
3
|
+
export type { Transport, InitConfig, AccountConfig, RegistrationStateEvent, IncomingCallEvent, CallState, CallStateEvent, CallMediaStateEvent, CallHoldEvent, CallUnholdEvent, CallMuteEvent, CallDtmfSentEvent, CallTransferEvent, CallTransferStatusEvent, IncomingDtmfEvent, EventMap, Subscription, } from './types';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Native module name — must match {@code VoipCloudModule.getName()} on Android
|
|
3
|
+
* and the future iOS RCT export. Derived from npm package
|
|
4
|
+
* {@code @voipsdk/react-native-voipcloud}.
|
|
5
|
+
*/
|
|
6
|
+
export declare const NATIVE_MODULE_NAME = "VoipsdkReactNativeVoipcloud";
|
|
7
|
+
export declare const NativeVoipCloud: any;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Public types for react-native-voipcloud.
|
|
2
|
+
* Public types for @voipsdk/react-native-voipcloud.
|
|
3
3
|
* Keep these stable across versions — they form the API contract.
|
|
4
4
|
*/
|
|
5
5
|
export type Transport = 'UDP' | 'TCP' | 'TLS';
|
|
@@ -32,22 +32,6 @@ export interface AccountConfig {
|
|
|
32
32
|
*/
|
|
33
33
|
transport: Transport;
|
|
34
34
|
}
|
|
35
|
-
export interface LicenseStatus {
|
|
36
|
-
/** True if voipcloud_license_is_valid() returned 1 at call time. */
|
|
37
|
-
valid: boolean;
|
|
38
|
-
/** Server-side label: "active" | "trial" | "suspended" | "expired" | "unset". */
|
|
39
|
-
status: string;
|
|
40
|
-
/** Customer identifier embedded in the token. */
|
|
41
|
-
customerId: string;
|
|
42
|
-
/** Concurrent-call ceiling allowed by the license. */
|
|
43
|
-
ccu: number;
|
|
44
|
-
/** Current count of active calls held by the gate. */
|
|
45
|
-
currentCalls: number;
|
|
46
|
-
/** Token expiry (unix seconds). 0 if unbounded. */
|
|
47
|
-
expiry: number;
|
|
48
|
-
/** Last clock-skew anchor pushed by the refresher (unix seconds). 0 if none yet. */
|
|
49
|
-
serverTime: number;
|
|
50
|
-
}
|
|
51
35
|
export interface RegistrationStateEvent {
|
|
52
36
|
accountId: number;
|
|
53
37
|
/** SIP response code (200 = registered, 401/407 = auth, etc.). */
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voipsdk/react-native-voipcloud",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "React Native VoIP SDK backed by PJSIP
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Public React Native VoIP SDK backed by PJSIP (VoipCloud).",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
7
7
|
"react-native": "src/index.ts",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"!**/.*"
|
|
19
19
|
],
|
|
20
20
|
"scripts": {
|
|
21
|
-
"prepare": "bob build &&
|
|
21
|
+
"prepare": "bob build && tsc --project tsconfig.build.json --outDir lib/typescript --emitDeclarationOnly --declaration",
|
|
22
22
|
"build:types": "tsc --project tsconfig.build.json --outDir lib/typescript --emitDeclarationOnly --declaration",
|
|
23
23
|
"clean": "rm -rf lib",
|
|
24
24
|
"pack:tgz": "yarn pack --out ./%s-%v.tgz"
|
|
@@ -72,5 +72,6 @@
|
|
|
72
72
|
},
|
|
73
73
|
"publishConfig": {
|
|
74
74
|
"access": "public"
|
|
75
|
-
}
|
|
75
|
+
},
|
|
76
|
+
"packageManager": "yarn@4.17.0+sha512.c2957de2f9025ab14d63b24d0d8be1f1655810e22c341042c27f7ecd017b180ec12db73d69ac366d71b304ef9f069349ce462de96f04f8f1da317f4f762c95ae"
|
|
76
77
|
}
|