@vowifi-rs/vowifi 0.1.10 → 0.1.12
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 +471 -27
- package/index.d.ts +12 -3
- package/native.d.ts +9 -2
- package/native.js +54 -54
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,47 +1,491 @@
|
|
|
1
1
|
# @vowifi-rs/vowifi
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Hardware-independent VoWiFi SMS sessions for Node.js.
|
|
4
|
+
|
|
5
|
+
`@vowifi-rs/vowifi` connects a SIM subscription to its operator's ePDG, establishes an
|
|
6
|
+
IKEv2/EAP-AKA/IPsec tunnel, registers with IMS, and sends or receives SMS over Wi-Fi. The package
|
|
7
|
+
exposes a small session API and delegates only SIM authentication to the host application.
|
|
8
|
+
|
|
9
|
+
> **Project status:** experimental. Mobile-originated and mobile-terminated SMS have completed an
|
|
10
|
+
> end-to-end commercial-network verification. Interoperability still depends on the operator,
|
|
11
|
+
> subscription, provisioning, ePDG availability, and carrier profile.
|
|
12
|
+
|
|
13
|
+
## Implementation Status
|
|
14
|
+
|
|
15
|
+
### Implemented
|
|
16
|
+
|
|
17
|
+
**Carrier and network setup**
|
|
18
|
+
|
|
19
|
+
- Deterministic built-in carrier-profile selection from home MCC/MNC and optional IMSI, SPN, GID,
|
|
20
|
+
and ICCID matchers.
|
|
21
|
+
- Application-provided carrier profiles and explicit ePDG hostname overrides.
|
|
22
|
+
- Standard 3GPP ePDG FQDN discovery from the home PLMN.
|
|
23
|
+
- Direct UDP egress with optional local-address binding.
|
|
24
|
+
- SOCKS5 UDP egress with optional username/password authentication. A local Clash/Mihomo SOCKS
|
|
25
|
+
listener can bridge this to VLESS, AnyTLS, or another upstream protocol.
|
|
26
|
+
|
|
27
|
+
**IKEv2 and IPsec**
|
|
28
|
+
|
|
29
|
+
- IKE_SA_INIT, NAT detection, UDP/4500 NAT traversal, and retransmission handling.
|
|
30
|
+
- RFC 5998 EAP-only authentication with EAP-AKA and UICC synchronization-failure handling.
|
|
31
|
+
- Child SA negotiation and configuration-payload processing for tunnel address, DNS, and P-CSCF.
|
|
32
|
+
- Userspace ESP encryption/decryption, integrity verification, sequence handling, and anti-replay
|
|
33
|
+
protection.
|
|
34
|
+
- Userspace raw-IP data plane with DNS, ICMP, UDP, TCP, and inbound IP fragment reassembly.
|
|
35
|
+
- IKE INFORMATIONAL, DPD, peer/local Delete handling, and bounded session shutdown.
|
|
36
|
+
|
|
37
|
+
**IMS and SMS**
|
|
38
|
+
|
|
39
|
+
- IMS registration with IMS AKA and `ipsec-3gpp` security agreement.
|
|
40
|
+
- SIP over TCP and UDP as selected by the carrier profile.
|
|
41
|
+
- Registration refresh, explicit deregistration, `Retry-After` handling, and bounded recovery.
|
|
42
|
+
- Mobile-originated SMS with SIP transaction tracking and RP acknowledgement correlation.
|
|
43
|
+
- Mobile-terminated SMS with SIP 200, RP-ACK, retransmission deduplication, and delayed application
|
|
44
|
+
delivery until protocol acknowledgement is complete.
|
|
45
|
+
- GSM 7-bit and UCS-2 text encoding/decoding.
|
|
46
|
+
- Automatic outgoing multipart segmentation.
|
|
47
|
+
- Incoming 8-bit and 16-bit concatenated SMS reassembly, including duplicate and out-of-order
|
|
48
|
+
segment handling.
|
|
49
|
+
- Text and binary incoming SMS events.
|
|
50
|
+
- International numbers, national numbers, and operator short codes.
|
|
51
|
+
|
|
52
|
+
**Node.js API**
|
|
53
|
+
|
|
54
|
+
- Hardware-independent async AKA callback; the addon does not own a modem or serial port.
|
|
55
|
+
- Pull-based event delivery backed by a bounded queue.
|
|
56
|
+
- Structured session states and stable JavaScript error codes.
|
|
57
|
+
- Built-in carrier-profile inspection through `resolveCarrierProfile()`.
|
|
58
|
+
- Optional Rust `tracing` subscriber through `initLogging()`.
|
|
59
|
+
- TypeScript declarations and platform-specific prebuilt native packages.
|
|
60
|
+
|
|
61
|
+
### Implemented but awaiting broader real-network validation
|
|
62
|
+
|
|
63
|
+
- Automatic IMS registration refresh across a full operator-issued registration lifetime.
|
|
64
|
+
- Recovery from transport, IKE, and IMS failures under real network outages and address changes.
|
|
65
|
+
- Long outgoing and incoming SMS against a real operator; multipart behavior currently has protocol
|
|
66
|
+
fixtures and local tests but no stable carrier regression source.
|
|
67
|
+
- RP-ACK/RP-ERROR terminal-result differences across operators. The verified deployment accepts MO
|
|
68
|
+
SMS at the SIP layer and returns the requested service response, but this does not cover every
|
|
69
|
+
operator's RP behavior.
|
|
70
|
+
- IPv6-only ePDG, Child SA, and IMS deployments. Current built-in profiles use IPv4.
|
|
71
|
+
|
|
72
|
+
### Not implemented
|
|
73
|
+
|
|
74
|
+
- Emergency calling, supplementary services, USSD, MMS, RCS, or video calling.
|
|
75
|
+
- VoLTE or access through a cellular packet core; this package targets untrusted Wi-Fi access via
|
|
76
|
+
ePDG.
|
|
77
|
+
- EAP-AKA' and operator deployments that require it.
|
|
78
|
+
- Production-ready certificate-authenticated ePDG profiles, carrier trust-root distribution, OCSP,
|
|
79
|
+
and revocation caching. The currently verified path uses RFC 5998 EAP-only authentication.
|
|
80
|
+
- Full long-lived IKE/Child-SA rekey and every optional IPsec cipher suite, transform, or ESN mode.
|
|
81
|
+
- Automatic modem discovery, serial-port management, SIM identity reads, UICC APDU transport, or
|
|
82
|
+
SMSC discovery. These remain host responsibilities.
|
|
83
|
+
- Persistent SMS storage, offline queues, scheduled sending, cross-process deduplication, HTTP APIs,
|
|
84
|
+
authentication, or a user interface.
|
|
85
|
+
- Remote carrier-profile updates or a comprehensive carrier configuration database.
|
|
86
|
+
- Native binaries outside the platforms listed below.
|
|
87
|
+
|
|
88
|
+
### Planned or possible future work
|
|
89
|
+
|
|
90
|
+
- MMTel voice calling, SIP call control, RTP/RTCP media, and host-provided audio-device bridging.
|
|
91
|
+
- Additional carrier profiles and real-network interoperability coverage.
|
|
92
|
+
- EAP-AKA', certificate-authenticated ePDG deployments, and broader IPsec transform support as
|
|
93
|
+
required by verified carrier configurations.
|
|
94
|
+
- Additional native platforms and higher-level integrations.
|
|
95
|
+
|
|
96
|
+
Voice is not part of the current API, but it is a potential extension of the existing ePDG, IPsec,
|
|
97
|
+
IMS registration, and session-lifecycle foundation rather than a permanently excluded feature.
|
|
98
|
+
|
|
99
|
+
## Interoperability
|
|
100
|
+
|
|
101
|
+
The complete SMS path has been verified with a real UICC and a commercial Wi-Fi Calling network:
|
|
102
|
+
ePDG discovery, IKEv2/NAT-T, EAP-AKA, Child SA, P-CSCF communication, protected IMS registration,
|
|
103
|
+
MO SMS, MT SMS, protocol acknowledgements, recovery injection, and explicit deregistration.
|
|
104
|
+
|
|
105
|
+
This is evidence for one tested configuration, not a compatibility claim for every carrier, plan,
|
|
106
|
+
SIM generation, or roaming location. Carrier-specific test details are intentionally maintained
|
|
107
|
+
separately from the npm package overview.
|
|
108
|
+
|
|
109
|
+
## Requirements
|
|
110
|
+
|
|
111
|
+
- Node.js 20 or newer.
|
|
112
|
+
- A SIM/eSIM subscription provisioned by its operator for Wi-Fi Calling.
|
|
113
|
+
- Access to the subscription identity: at minimum IMSI and home MCC/MNC.
|
|
114
|
+
- A host implementation capable of passing `RAND` and `AUTN` to the UICC and returning the AKA
|
|
115
|
+
result.
|
|
116
|
+
- Network access to the operator's ePDG. Some operators restrict access by source network or
|
|
117
|
+
geography.
|
|
118
|
+
|
|
119
|
+
Prebuilt packages are currently published for:
|
|
120
|
+
|
|
121
|
+
| Platform | Architecture | Runtime |
|
|
122
|
+
| --- | --- | --- |
|
|
123
|
+
| Windows | x64 | MSVC |
|
|
124
|
+
| Linux | x64 | glibc |
|
|
125
|
+
| Linux | arm64 | glibc |
|
|
126
|
+
|
|
127
|
+
Alpine/musl, macOS, Windows ARM64, and other targets are not currently published.
|
|
128
|
+
|
|
129
|
+
## Installation
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
npm install @vowifi-rs/vowifi
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
pnpm add @vowifi-rs/vowifi
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
The root package selects and installs the matching native package through npm optional
|
|
140
|
+
dependencies. A Rust toolchain is not required for supported prebuilt targets.
|
|
141
|
+
|
|
142
|
+
## Quick Start
|
|
4
143
|
|
|
5
144
|
```js
|
|
6
|
-
const { VowifiSession } = require('@vowifi-rs/vowifi')
|
|
145
|
+
const { VowifiSession, initLogging } = require('@vowifi-rs/vowifi')
|
|
146
|
+
|
|
147
|
+
initLogging(process.env.VOWIFI_LOG)
|
|
7
148
|
|
|
8
149
|
const session = await VowifiSession.connect({
|
|
9
|
-
subscription: {
|
|
10
|
-
|
|
150
|
+
subscription: {
|
|
151
|
+
imsi: '00101...',
|
|
152
|
+
mcc: '001',
|
|
153
|
+
mnc: '01',
|
|
154
|
+
imei: '...',
|
|
155
|
+
imeisv: '...',
|
|
156
|
+
},
|
|
157
|
+
|
|
158
|
+
// Forward the challenge to your modem, smart-card reader, Android UICC API,
|
|
159
|
+
// or another trusted hardware adapter.
|
|
160
|
+
aka: async ({ rand, autn }) => {
|
|
161
|
+
return uicc.authenticateAka(rand, autn)
|
|
162
|
+
},
|
|
11
163
|
})
|
|
12
164
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
165
|
+
try {
|
|
166
|
+
console.log('online using carrier profile:', session.carrierProfileId)
|
|
167
|
+
|
|
168
|
+
const result = await session.sendSms({
|
|
169
|
+
recipient: '+1555...',
|
|
170
|
+
text: 'Hello over VoWiFi',
|
|
171
|
+
// smsc: '+15550000000', // Optional RP destination address.
|
|
172
|
+
})
|
|
173
|
+
|
|
174
|
+
console.log('send result:', result)
|
|
175
|
+
|
|
176
|
+
for (;;) {
|
|
177
|
+
const event = await session.nextEvent()
|
|
178
|
+
if (!event) break
|
|
179
|
+
|
|
180
|
+
if (event.kind === 'incomingSms') {
|
|
181
|
+
const { sender, content } = event.message
|
|
182
|
+
if (content.kind === 'text') {
|
|
183
|
+
console.log(`SMS from ${sender}: ${content.text}`)
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
} finally {
|
|
188
|
+
await session.shutdown()
|
|
189
|
+
}
|
|
16
190
|
```
|
|
17
191
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
using the `serialport` dev dependency; it is not part of the production API.
|
|
192
|
+
`VowifiSession.connect()` resolves only after IMS registration succeeds. Call `shutdown()` during
|
|
193
|
+
normal application shutdown so the library can deregister IMS and release network resources.
|
|
21
194
|
|
|
22
|
-
|
|
195
|
+
## Supplying AKA Authentication
|
|
23
196
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
197
|
+
The package deliberately does not depend on a serial-port library or own a modem. The host supplies
|
|
198
|
+
one asynchronous AKA callback:
|
|
199
|
+
|
|
200
|
+
```ts
|
|
201
|
+
interface AkaRequest {
|
|
202
|
+
rand: Buffer
|
|
203
|
+
autn: Buffer
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
type AkaResult =
|
|
207
|
+
| { kind: 'success'; res: Buffer; ck: Buffer; ik: Buffer; kc?: Buffer }
|
|
208
|
+
| { kind: 'synchronizationFailure'; auts: Buffer }
|
|
209
|
+
| { kind: 'rejected'; sw1: number; sw2: number }
|
|
28
210
|
```
|
|
29
211
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
212
|
+
The callback should perform a 3GPP USIM authentication operation and return:
|
|
213
|
+
|
|
214
|
+
- `success` when the UICC returns `RES`, `CK`, and `IK`.
|
|
215
|
+
- `synchronizationFailure` when the UICC returns `AUTS` for sequence-number resynchronization.
|
|
216
|
+
- `rejected` when the UICC rejects the command with status words.
|
|
217
|
+
|
|
218
|
+
Transport failures should reject the Promise with an `Error`. Calls may occur during initial tunnel
|
|
219
|
+
authentication, IMS authentication, or session recovery, so the adapter must remain available for
|
|
220
|
+
the full session lifetime and serialize access if the underlying UICC transport requires it.
|
|
221
|
+
|
|
222
|
+
The repository contains a development-only serial implementation in
|
|
223
|
+
[`examples/serial-uicc-aka.js`](examples/serial-uicc-aka.js). It uses `serialport` and AT/APDU
|
|
224
|
+
commands as an example; it is not required by or bundled into the production API.
|
|
225
|
+
|
|
226
|
+
## Subscription Identity
|
|
227
|
+
|
|
228
|
+
```ts
|
|
229
|
+
interface SubscriptionIdentity {
|
|
230
|
+
imsi: string
|
|
231
|
+
mcc: string
|
|
232
|
+
mnc: string
|
|
233
|
+
imei?: string
|
|
234
|
+
imeisv?: string
|
|
235
|
+
spn?: string
|
|
236
|
+
gid1?: string
|
|
237
|
+
gid2?: string
|
|
238
|
+
iccid?: string
|
|
239
|
+
}
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
`imsi`, `mcc`, and `mnc` are required. MCC/MNC must describe the **home subscription**, not the
|
|
243
|
+
currently visited cellular network. Optional SPN, GID, ICCID, and IMSI-prefix data can disambiguate
|
|
244
|
+
MVNO or carrier-specific profiles. IMEI/IMEISV may be used in IMS identity headers where required.
|
|
245
|
+
|
|
246
|
+
Create a new session after changing the physical SIM or active eSIM profile.
|
|
247
|
+
|
|
248
|
+
## Carrier Profiles
|
|
249
|
+
|
|
250
|
+
By default, the package selects a built-in profile from the subscription identity:
|
|
251
|
+
|
|
252
|
+
```js
|
|
253
|
+
const session = await VowifiSession.connect({
|
|
254
|
+
subscription,
|
|
255
|
+
carrierProfile: 'auto',
|
|
256
|
+
aka,
|
|
257
|
+
})
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
The registry includes a generic 3GPP fallback and carrier-specific profiles. Automatic matching
|
|
261
|
+
uses deterministic priority and specificity rules. Unknown operators fall back to the conservative
|
|
262
|
+
generic profile, which does not guarantee interoperability.
|
|
263
|
+
|
|
264
|
+
Inspect the selected profile before connecting:
|
|
265
|
+
|
|
266
|
+
```js
|
|
267
|
+
const { resolveCarrierProfile } = require('@vowifi-rs/vowifi')
|
|
268
|
+
|
|
269
|
+
const resolved = resolveCarrierProfile({
|
|
270
|
+
subscription,
|
|
271
|
+
carrierProfile: 'auto',
|
|
272
|
+
})
|
|
273
|
+
|
|
274
|
+
console.log(resolved.profile.id)
|
|
275
|
+
console.log(resolved.source) // builtin, override, custom, or fallback
|
|
276
|
+
console.log(resolved.matchedBy) // fields responsible for the match
|
|
277
|
+
```
|
|
33
278
|
|
|
34
|
-
|
|
279
|
+
Applications may select a profile by ID or pass versioned profile objects through
|
|
280
|
+
`carrierOverrides`. Carrier profiles describe protocol policy, not subscriber secrets or live
|
|
281
|
+
session state.
|
|
35
282
|
|
|
36
|
-
|
|
37
|
-
|
|
283
|
+
## ePDG Discovery and Network Egress
|
|
284
|
+
|
|
285
|
+
The library normally derives standard 3GPP ePDG hostnames from the home MCC/MNC. Override discovery
|
|
286
|
+
when testing or when an operator publishes a non-standard hostname:
|
|
287
|
+
|
|
288
|
+
```js
|
|
289
|
+
const session = await VowifiSession.connect({
|
|
290
|
+
subscription,
|
|
291
|
+
explicitEpdgHostnames: ['epdg.example.operator'],
|
|
292
|
+
aka,
|
|
293
|
+
})
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
Direct egress is the default. A local source address can be selected when the host already has the
|
|
297
|
+
required routing configuration:
|
|
298
|
+
|
|
299
|
+
```js
|
|
300
|
+
egress: {
|
|
301
|
+
kind: 'direct',
|
|
302
|
+
localAddress: '192.0.2.10',
|
|
303
|
+
}
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
SOCKS5 egress is useful when the operator's ePDG must be reached through a specific network exit.
|
|
307
|
+
It can point to a local Clash/Mihomo SOCKS listener even when the upstream proxy uses VLESS,
|
|
308
|
+
AnyTLS, or another protocol:
|
|
309
|
+
|
|
310
|
+
```js
|
|
311
|
+
egress: {
|
|
312
|
+
kind: 'socks5',
|
|
313
|
+
proxy: '127.0.0.1:7891',
|
|
314
|
+
username: 'optional',
|
|
315
|
+
password: 'optional',
|
|
316
|
+
}
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
The proxy must support the SOCKS5 UDP association needed by IKE/IPsec traffic.
|
|
320
|
+
|
|
321
|
+
## Receiving Events
|
|
322
|
+
|
|
323
|
+
`nextEvent()` waits for the next event and returns `null` after the event stream closes:
|
|
324
|
+
|
|
325
|
+
```ts
|
|
326
|
+
type VowifiEvent =
|
|
327
|
+
| { kind: 'registered'; expiresSeconds: number }
|
|
328
|
+
| { kind: 'refreshed'; expiresSeconds: number; securityReplaced: boolean }
|
|
329
|
+
| { kind: 'deregistered' }
|
|
330
|
+
| { kind: 'incomingSms'; message: SmsMessage }
|
|
331
|
+
| { kind: 'outgoingSmsRpConfirmed'; transactionId: string }
|
|
332
|
+
| { kind: 'outgoingSmsFailed'; transactionId: string; rpCause: number; rpDiagnostic: Buffer }
|
|
333
|
+
| { kind: 'outgoingSmsReportTimeout'; transactionId: string }
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
Incoming SMS messages contain the sender, PID, DCS, the raw service-centre timestamp, and either
|
|
337
|
+
decoded text or binary content:
|
|
338
|
+
|
|
339
|
+
```ts
|
|
340
|
+
interface SmsMessage {
|
|
341
|
+
sender: string
|
|
342
|
+
protocolIdentifier: number
|
|
343
|
+
dataCodingScheme: number
|
|
344
|
+
serviceCentreTimestamp: Buffer
|
|
345
|
+
content:
|
|
346
|
+
| { kind: 'text'; text: string }
|
|
347
|
+
| { kind: 'binary'; data: Buffer }
|
|
348
|
+
}
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
Multipart incoming messages are reassembled before `incomingSms` is emitted. Consume events
|
|
352
|
+
continuously while the session is online so application processing does not fill the bounded event
|
|
353
|
+
queue.
|
|
354
|
+
|
|
355
|
+
## Sending SMS
|
|
356
|
+
|
|
357
|
+
```js
|
|
358
|
+
const result = await session.sendSms({
|
|
359
|
+
recipient: '12345',
|
|
360
|
+
text: 'STATUS',
|
|
361
|
+
smsc: '+1234567890', // Optional; operator dependent.
|
|
362
|
+
})
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
International numbers, national numbers, and operator short codes are accepted. Long text is split
|
|
366
|
+
into multipart SMS automatically.
|
|
367
|
+
|
|
368
|
+
`sendSms()` completes as soon as every part receives a final SIP `2xx` response. RP-level reports
|
|
369
|
+
arrive later through `nextEvent()` and never keep the send promise pending:
|
|
370
|
+
|
|
371
|
+
```ts
|
|
372
|
+
interface SmsSendResult {
|
|
373
|
+
kind: 'accepted'
|
|
374
|
+
parts: Array<{
|
|
375
|
+
transactionId: string
|
|
376
|
+
sipStatus: number
|
|
377
|
+
}>
|
|
378
|
+
}
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
Match each part's `transactionId` against outgoing status events. `outgoingSmsRpConfirmed` records
|
|
382
|
+
an RP-layer acknowledgement; it does not mean the recipient read the message.
|
|
383
|
+
`outgoingSmsFailed` reports a later RP-ERROR. If no matching RP report arrives within the protocol
|
|
384
|
+
window, `outgoingSmsReportTimeout` is emitted while the original submission remains accepted.
|
|
385
|
+
|
|
386
|
+
## Session State and Recovery
|
|
387
|
+
|
|
388
|
+
```js
|
|
389
|
+
const state = session.status()
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
Possible states are `stopped`, `connecting`, `online`, `recovering`, `stopping`, and `failed`.
|
|
393
|
+
Failures may include a diagnostic `message`.
|
|
394
|
+
|
|
395
|
+
The session automatically refreshes IMS registration and can recover from transient transport or
|
|
396
|
+
protocol failures. Timing and recovery behavior can be tuned with `operational`:
|
|
397
|
+
|
|
398
|
+
```js
|
|
399
|
+
operational: {
|
|
400
|
+
ioTimeoutMs: 10_000,
|
|
401
|
+
ikeInitialTimeoutMs: 1_000,
|
|
402
|
+
ikeAttempts: 3,
|
|
403
|
+
registrationTimeoutMs: 120_000,
|
|
404
|
+
refreshAtPercent: 80,
|
|
405
|
+
recoveryAttempts: 3,
|
|
406
|
+
recoveryInitialDelayMs: 1_000,
|
|
407
|
+
recoveryMaxDelayMs: 30_000,
|
|
408
|
+
}
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
Most applications should keep the defaults. Use overrides primarily for diagnostics or known
|
|
412
|
+
operator behavior.
|
|
413
|
+
|
|
414
|
+
## Logging
|
|
415
|
+
|
|
416
|
+
Logging is opt-in and backed by Rust `tracing`:
|
|
417
|
+
|
|
418
|
+
```js
|
|
419
|
+
const installed = initLogging(
|
|
420
|
+
'vowifi_client=debug,vowifi_runtime=info,vowifi_transport=info,vowifi_ipsec=warn,vowifi_ims=info',
|
|
421
|
+
)
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
If no argument is provided, `VOWIFI_LOG` is used, followed by the package default filter. The
|
|
425
|
+
function returns `true` when it installs the global subscriber and `false` when another subscriber
|
|
426
|
+
is already installed. Call it once, before connecting.
|
|
427
|
+
|
|
428
|
+
Do not enable verbose protocol logs in production without reviewing their contents. Authentication
|
|
429
|
+
material and subscriber identifiers require the same handling as other credentials.
|
|
430
|
+
|
|
431
|
+
## Errors
|
|
432
|
+
|
|
433
|
+
Rejected operations throw JavaScript `Error` objects with a stable `code` property:
|
|
434
|
+
|
|
435
|
+
```js
|
|
436
|
+
try {
|
|
437
|
+
await session.sendSms({ recipient, text })
|
|
438
|
+
} catch (error) {
|
|
439
|
+
if (error.code === 'SESSION_OFFLINE') {
|
|
440
|
+
// Decide whether to wait for recovery or report the failure.
|
|
441
|
+
}
|
|
442
|
+
throw error
|
|
443
|
+
}
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
Current error codes:
|
|
447
|
+
|
|
448
|
+
- `INVALID_CONFIG`
|
|
449
|
+
- `CARRIER_PROFILE_NOT_FOUND`
|
|
450
|
+
- `EPDG_DISCOVERY_FAILED`
|
|
451
|
+
- `AKA_FAILED`
|
|
452
|
+
- `SESSION_OFFLINE`
|
|
453
|
+
- `IMS_REGISTRATION_FAILED`
|
|
454
|
+
- `SMS_SEND_FAILED`
|
|
455
|
+
- `SHUTDOWN_FAILED`
|
|
456
|
+
|
|
457
|
+
Use `code` for program flow. Error messages are diagnostic text and may change between releases.
|
|
458
|
+
|
|
459
|
+
## API Summary
|
|
460
|
+
|
|
461
|
+
```ts
|
|
462
|
+
class VowifiSession {
|
|
463
|
+
static connect(options: ConnectOptions): Promise<VowifiSession>
|
|
464
|
+
readonly carrierProfileId: string
|
|
465
|
+
status(): SessionState
|
|
466
|
+
nextEvent(): Promise<VowifiEvent | null>
|
|
467
|
+
sendSms(message: SmsSendOptions): Promise<SmsSendResult>
|
|
468
|
+
shutdown(): Promise<void>
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
function resolveCarrierProfile(options: ResolveCarrierProfileOptions): ResolvedCarrierProfile
|
|
472
|
+
function initLogging(filter?: string): boolean
|
|
473
|
+
```
|
|
474
|
+
|
|
475
|
+
See the bundled [`index.d.ts`](index.d.ts) for the complete TypeScript contract.
|
|
476
|
+
|
|
477
|
+
## Local Development
|
|
38
478
|
|
|
39
479
|
```bash
|
|
40
|
-
|
|
41
|
-
|
|
480
|
+
pnpm install
|
|
481
|
+
pnpm run build
|
|
482
|
+
pnpm test
|
|
42
483
|
```
|
|
43
484
|
|
|
44
|
-
The repository
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
485
|
+
The repository also contains opt-in real-network regression examples. They require an eligible SIM,
|
|
486
|
+
explicit environment configuration, and deliberate execution; they are not part of the default test
|
|
487
|
+
suite.
|
|
488
|
+
|
|
489
|
+
## License
|
|
490
|
+
|
|
491
|
+
Licensed under either of Apache License 2.0 or the MIT license, at your option.
|
package/index.d.ts
CHANGED
|
@@ -74,6 +74,9 @@ export type VowifiEvent =
|
|
|
74
74
|
| { kind: 'refreshed'; expiresSeconds: number; securityReplaced: boolean }
|
|
75
75
|
| { kind: 'deregistered' }
|
|
76
76
|
| { kind: 'incomingSms'; message: SmsMessage }
|
|
77
|
+
| { kind: 'outgoingSmsRpConfirmed'; transactionId: string }
|
|
78
|
+
| { kind: 'outgoingSmsFailed'; transactionId: string; rpCause: number; rpDiagnostic: Buffer }
|
|
79
|
+
| { kind: 'outgoingSmsReportTimeout'; transactionId: string }
|
|
77
80
|
|
|
78
81
|
export interface SmsSendOptions {
|
|
79
82
|
recipient: string
|
|
@@ -81,9 +84,15 @@ export interface SmsSendOptions {
|
|
|
81
84
|
smsc?: string
|
|
82
85
|
}
|
|
83
86
|
|
|
84
|
-
export
|
|
85
|
-
|
|
86
|
-
|
|
87
|
+
export interface SmsPartSubmission {
|
|
88
|
+
transactionId: string
|
|
89
|
+
sipStatus: number
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface SmsSendResult {
|
|
93
|
+
kind: 'accepted'
|
|
94
|
+
parts: SmsPartSubmission[]
|
|
95
|
+
}
|
|
87
96
|
|
|
88
97
|
export interface ResolvedCarrierProfile {
|
|
89
98
|
profile: CarrierProfile
|
package/native.d.ts
CHANGED
|
@@ -86,6 +86,11 @@ export interface JsSmsMessage {
|
|
|
86
86
|
content: JsSmsContent
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
export interface JsSmsPartSubmission {
|
|
90
|
+
transactionId: string
|
|
91
|
+
sipStatus: number
|
|
92
|
+
}
|
|
93
|
+
|
|
89
94
|
export interface JsSmsSendOptions {
|
|
90
95
|
recipient: string
|
|
91
96
|
text: string
|
|
@@ -94,8 +99,7 @@ export interface JsSmsSendOptions {
|
|
|
94
99
|
|
|
95
100
|
export interface JsSmsSendResult {
|
|
96
101
|
kind: string
|
|
97
|
-
parts:
|
|
98
|
-
statuses: Array<number>
|
|
102
|
+
parts: Array<JsSmsPartSubmission>
|
|
99
103
|
}
|
|
100
104
|
|
|
101
105
|
export interface JsSubscriptionIdentity {
|
|
@@ -115,6 +119,9 @@ export interface JsVowifiEvent {
|
|
|
115
119
|
expiresSeconds?: number
|
|
116
120
|
securityReplaced?: boolean
|
|
117
121
|
message?: JsSmsMessage
|
|
122
|
+
transactionId?: string
|
|
123
|
+
rpCause?: number
|
|
124
|
+
rpDiagnostic?: Buffer
|
|
118
125
|
}
|
|
119
126
|
|
|
120
127
|
export declare function resolveCarrierProfile(options: JsResolveCarrierProfileOptions): JsResolvedCarrierProfile
|
package/native.js
CHANGED
|
@@ -77,8 +77,8 @@ function requireNative() {
|
|
|
77
77
|
try {
|
|
78
78
|
const binding = require('@vowifi-rs/vowifi-android-arm64')
|
|
79
79
|
const bindingPackageVersion = require('@vowifi-rs/vowifi-android-arm64/package.json').version
|
|
80
|
-
if (bindingPackageVersion !== '0.1.
|
|
81
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
80
|
+
if (bindingPackageVersion !== '0.1.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
81
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
82
82
|
}
|
|
83
83
|
return binding
|
|
84
84
|
} catch (e) {
|
|
@@ -93,8 +93,8 @@ function requireNative() {
|
|
|
93
93
|
try {
|
|
94
94
|
const binding = require('@vowifi-rs/vowifi-android-arm-eabi')
|
|
95
95
|
const bindingPackageVersion = require('@vowifi-rs/vowifi-android-arm-eabi/package.json').version
|
|
96
|
-
if (bindingPackageVersion !== '0.1.
|
|
97
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
96
|
+
if (bindingPackageVersion !== '0.1.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
97
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
98
98
|
}
|
|
99
99
|
return binding
|
|
100
100
|
} catch (e) {
|
|
@@ -114,8 +114,8 @@ function requireNative() {
|
|
|
114
114
|
try {
|
|
115
115
|
const binding = require('@vowifi-rs/vowifi-win32-x64-gnu')
|
|
116
116
|
const bindingPackageVersion = require('@vowifi-rs/vowifi-win32-x64-gnu/package.json').version
|
|
117
|
-
if (bindingPackageVersion !== '0.1.
|
|
118
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
117
|
+
if (bindingPackageVersion !== '0.1.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
118
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
119
119
|
}
|
|
120
120
|
return binding
|
|
121
121
|
} catch (e) {
|
|
@@ -130,8 +130,8 @@ function requireNative() {
|
|
|
130
130
|
try {
|
|
131
131
|
const binding = require('@vowifi-rs/vowifi-win32-x64-msvc')
|
|
132
132
|
const bindingPackageVersion = require('@vowifi-rs/vowifi-win32-x64-msvc/package.json').version
|
|
133
|
-
if (bindingPackageVersion !== '0.1.
|
|
134
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
133
|
+
if (bindingPackageVersion !== '0.1.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
134
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
135
135
|
}
|
|
136
136
|
return binding
|
|
137
137
|
} catch (e) {
|
|
@@ -147,8 +147,8 @@ function requireNative() {
|
|
|
147
147
|
try {
|
|
148
148
|
const binding = require('@vowifi-rs/vowifi-win32-ia32-msvc')
|
|
149
149
|
const bindingPackageVersion = require('@vowifi-rs/vowifi-win32-ia32-msvc/package.json').version
|
|
150
|
-
if (bindingPackageVersion !== '0.1.
|
|
151
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
150
|
+
if (bindingPackageVersion !== '0.1.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
151
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
152
152
|
}
|
|
153
153
|
return binding
|
|
154
154
|
} catch (e) {
|
|
@@ -163,8 +163,8 @@ function requireNative() {
|
|
|
163
163
|
try {
|
|
164
164
|
const binding = require('@vowifi-rs/vowifi-win32-arm64-msvc')
|
|
165
165
|
const bindingPackageVersion = require('@vowifi-rs/vowifi-win32-arm64-msvc/package.json').version
|
|
166
|
-
if (bindingPackageVersion !== '0.1.
|
|
167
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
166
|
+
if (bindingPackageVersion !== '0.1.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
167
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
168
168
|
}
|
|
169
169
|
return binding
|
|
170
170
|
} catch (e) {
|
|
@@ -182,8 +182,8 @@ function requireNative() {
|
|
|
182
182
|
try {
|
|
183
183
|
const binding = require('@vowifi-rs/vowifi-darwin-universal')
|
|
184
184
|
const bindingPackageVersion = require('@vowifi-rs/vowifi-darwin-universal/package.json').version
|
|
185
|
-
if (bindingPackageVersion !== '0.1.
|
|
186
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
185
|
+
if (bindingPackageVersion !== '0.1.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
186
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
187
187
|
}
|
|
188
188
|
return binding
|
|
189
189
|
} catch (e) {
|
|
@@ -198,8 +198,8 @@ function requireNative() {
|
|
|
198
198
|
try {
|
|
199
199
|
const binding = require('@vowifi-rs/vowifi-darwin-x64')
|
|
200
200
|
const bindingPackageVersion = require('@vowifi-rs/vowifi-darwin-x64/package.json').version
|
|
201
|
-
if (bindingPackageVersion !== '0.1.
|
|
202
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
201
|
+
if (bindingPackageVersion !== '0.1.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
202
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
203
203
|
}
|
|
204
204
|
return binding
|
|
205
205
|
} catch (e) {
|
|
@@ -214,8 +214,8 @@ function requireNative() {
|
|
|
214
214
|
try {
|
|
215
215
|
const binding = require('@vowifi-rs/vowifi-darwin-arm64')
|
|
216
216
|
const bindingPackageVersion = require('@vowifi-rs/vowifi-darwin-arm64/package.json').version
|
|
217
|
-
if (bindingPackageVersion !== '0.1.
|
|
218
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
217
|
+
if (bindingPackageVersion !== '0.1.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
218
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
219
219
|
}
|
|
220
220
|
return binding
|
|
221
221
|
} catch (e) {
|
|
@@ -234,8 +234,8 @@ function requireNative() {
|
|
|
234
234
|
try {
|
|
235
235
|
const binding = require('@vowifi-rs/vowifi-freebsd-x64')
|
|
236
236
|
const bindingPackageVersion = require('@vowifi-rs/vowifi-freebsd-x64/package.json').version
|
|
237
|
-
if (bindingPackageVersion !== '0.1.
|
|
238
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
237
|
+
if (bindingPackageVersion !== '0.1.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
238
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
239
239
|
}
|
|
240
240
|
return binding
|
|
241
241
|
} catch (e) {
|
|
@@ -250,8 +250,8 @@ function requireNative() {
|
|
|
250
250
|
try {
|
|
251
251
|
const binding = require('@vowifi-rs/vowifi-freebsd-arm64')
|
|
252
252
|
const bindingPackageVersion = require('@vowifi-rs/vowifi-freebsd-arm64/package.json').version
|
|
253
|
-
if (bindingPackageVersion !== '0.1.
|
|
254
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
253
|
+
if (bindingPackageVersion !== '0.1.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
254
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
255
255
|
}
|
|
256
256
|
return binding
|
|
257
257
|
} catch (e) {
|
|
@@ -271,8 +271,8 @@ function requireNative() {
|
|
|
271
271
|
try {
|
|
272
272
|
const binding = require('@vowifi-rs/vowifi-linux-x64-musl')
|
|
273
273
|
const bindingPackageVersion = require('@vowifi-rs/vowifi-linux-x64-musl/package.json').version
|
|
274
|
-
if (bindingPackageVersion !== '0.1.
|
|
275
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
274
|
+
if (bindingPackageVersion !== '0.1.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
275
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
276
276
|
}
|
|
277
277
|
return binding
|
|
278
278
|
} catch (e) {
|
|
@@ -287,8 +287,8 @@ function requireNative() {
|
|
|
287
287
|
try {
|
|
288
288
|
const binding = require('@vowifi-rs/vowifi-linux-x64-gnu')
|
|
289
289
|
const bindingPackageVersion = require('@vowifi-rs/vowifi-linux-x64-gnu/package.json').version
|
|
290
|
-
if (bindingPackageVersion !== '0.1.
|
|
291
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
290
|
+
if (bindingPackageVersion !== '0.1.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
291
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
292
292
|
}
|
|
293
293
|
return binding
|
|
294
294
|
} catch (e) {
|
|
@@ -305,8 +305,8 @@ function requireNative() {
|
|
|
305
305
|
try {
|
|
306
306
|
const binding = require('@vowifi-rs/vowifi-linux-arm64-musl')
|
|
307
307
|
const bindingPackageVersion = require('@vowifi-rs/vowifi-linux-arm64-musl/package.json').version
|
|
308
|
-
if (bindingPackageVersion !== '0.1.
|
|
309
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
308
|
+
if (bindingPackageVersion !== '0.1.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
309
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
310
310
|
}
|
|
311
311
|
return binding
|
|
312
312
|
} catch (e) {
|
|
@@ -321,8 +321,8 @@ function requireNative() {
|
|
|
321
321
|
try {
|
|
322
322
|
const binding = require('@vowifi-rs/vowifi-linux-arm64-gnu')
|
|
323
323
|
const bindingPackageVersion = require('@vowifi-rs/vowifi-linux-arm64-gnu/package.json').version
|
|
324
|
-
if (bindingPackageVersion !== '0.1.
|
|
325
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
324
|
+
if (bindingPackageVersion !== '0.1.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
325
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
326
326
|
}
|
|
327
327
|
return binding
|
|
328
328
|
} catch (e) {
|
|
@@ -339,8 +339,8 @@ function requireNative() {
|
|
|
339
339
|
try {
|
|
340
340
|
const binding = require('@vowifi-rs/vowifi-linux-arm-musleabihf')
|
|
341
341
|
const bindingPackageVersion = require('@vowifi-rs/vowifi-linux-arm-musleabihf/package.json').version
|
|
342
|
-
if (bindingPackageVersion !== '0.1.
|
|
343
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
342
|
+
if (bindingPackageVersion !== '0.1.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
343
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
344
344
|
}
|
|
345
345
|
return binding
|
|
346
346
|
} catch (e) {
|
|
@@ -355,8 +355,8 @@ function requireNative() {
|
|
|
355
355
|
try {
|
|
356
356
|
const binding = require('@vowifi-rs/vowifi-linux-arm-gnueabihf')
|
|
357
357
|
const bindingPackageVersion = require('@vowifi-rs/vowifi-linux-arm-gnueabihf/package.json').version
|
|
358
|
-
if (bindingPackageVersion !== '0.1.
|
|
359
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
358
|
+
if (bindingPackageVersion !== '0.1.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
359
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
360
360
|
}
|
|
361
361
|
return binding
|
|
362
362
|
} catch (e) {
|
|
@@ -373,8 +373,8 @@ function requireNative() {
|
|
|
373
373
|
try {
|
|
374
374
|
const binding = require('@vowifi-rs/vowifi-linux-loong64-musl')
|
|
375
375
|
const bindingPackageVersion = require('@vowifi-rs/vowifi-linux-loong64-musl/package.json').version
|
|
376
|
-
if (bindingPackageVersion !== '0.1.
|
|
377
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
376
|
+
if (bindingPackageVersion !== '0.1.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
377
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
378
378
|
}
|
|
379
379
|
return binding
|
|
380
380
|
} catch (e) {
|
|
@@ -389,8 +389,8 @@ function requireNative() {
|
|
|
389
389
|
try {
|
|
390
390
|
const binding = require('@vowifi-rs/vowifi-linux-loong64-gnu')
|
|
391
391
|
const bindingPackageVersion = require('@vowifi-rs/vowifi-linux-loong64-gnu/package.json').version
|
|
392
|
-
if (bindingPackageVersion !== '0.1.
|
|
393
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
392
|
+
if (bindingPackageVersion !== '0.1.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
393
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
394
394
|
}
|
|
395
395
|
return binding
|
|
396
396
|
} catch (e) {
|
|
@@ -407,8 +407,8 @@ function requireNative() {
|
|
|
407
407
|
try {
|
|
408
408
|
const binding = require('@vowifi-rs/vowifi-linux-riscv64-musl')
|
|
409
409
|
const bindingPackageVersion = require('@vowifi-rs/vowifi-linux-riscv64-musl/package.json').version
|
|
410
|
-
if (bindingPackageVersion !== '0.1.
|
|
411
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
410
|
+
if (bindingPackageVersion !== '0.1.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
411
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
412
412
|
}
|
|
413
413
|
return binding
|
|
414
414
|
} catch (e) {
|
|
@@ -423,8 +423,8 @@ function requireNative() {
|
|
|
423
423
|
try {
|
|
424
424
|
const binding = require('@vowifi-rs/vowifi-linux-riscv64-gnu')
|
|
425
425
|
const bindingPackageVersion = require('@vowifi-rs/vowifi-linux-riscv64-gnu/package.json').version
|
|
426
|
-
if (bindingPackageVersion !== '0.1.
|
|
427
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
426
|
+
if (bindingPackageVersion !== '0.1.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
427
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
428
428
|
}
|
|
429
429
|
return binding
|
|
430
430
|
} catch (e) {
|
|
@@ -440,8 +440,8 @@ function requireNative() {
|
|
|
440
440
|
try {
|
|
441
441
|
const binding = require('@vowifi-rs/vowifi-linux-ppc64-gnu')
|
|
442
442
|
const bindingPackageVersion = require('@vowifi-rs/vowifi-linux-ppc64-gnu/package.json').version
|
|
443
|
-
if (bindingPackageVersion !== '0.1.
|
|
444
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
443
|
+
if (bindingPackageVersion !== '0.1.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
444
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
445
445
|
}
|
|
446
446
|
return binding
|
|
447
447
|
} catch (e) {
|
|
@@ -456,8 +456,8 @@ function requireNative() {
|
|
|
456
456
|
try {
|
|
457
457
|
const binding = require('@vowifi-rs/vowifi-linux-s390x-gnu')
|
|
458
458
|
const bindingPackageVersion = require('@vowifi-rs/vowifi-linux-s390x-gnu/package.json').version
|
|
459
|
-
if (bindingPackageVersion !== '0.1.
|
|
460
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
459
|
+
if (bindingPackageVersion !== '0.1.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
460
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
461
461
|
}
|
|
462
462
|
return binding
|
|
463
463
|
} catch (e) {
|
|
@@ -476,8 +476,8 @@ function requireNative() {
|
|
|
476
476
|
try {
|
|
477
477
|
const binding = require('@vowifi-rs/vowifi-openharmony-arm64')
|
|
478
478
|
const bindingPackageVersion = require('@vowifi-rs/vowifi-openharmony-arm64/package.json').version
|
|
479
|
-
if (bindingPackageVersion !== '0.1.
|
|
480
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
479
|
+
if (bindingPackageVersion !== '0.1.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
480
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
481
481
|
}
|
|
482
482
|
return binding
|
|
483
483
|
} catch (e) {
|
|
@@ -492,8 +492,8 @@ function requireNative() {
|
|
|
492
492
|
try {
|
|
493
493
|
const binding = require('@vowifi-rs/vowifi-openharmony-x64')
|
|
494
494
|
const bindingPackageVersion = require('@vowifi-rs/vowifi-openharmony-x64/package.json').version
|
|
495
|
-
if (bindingPackageVersion !== '0.1.
|
|
496
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
495
|
+
if (bindingPackageVersion !== '0.1.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
496
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
497
497
|
}
|
|
498
498
|
return binding
|
|
499
499
|
} catch (e) {
|
|
@@ -508,8 +508,8 @@ function requireNative() {
|
|
|
508
508
|
try {
|
|
509
509
|
const binding = require('@vowifi-rs/vowifi-openharmony-arm')
|
|
510
510
|
const bindingPackageVersion = require('@vowifi-rs/vowifi-openharmony-arm/package.json').version
|
|
511
|
-
if (bindingPackageVersion !== '0.1.
|
|
512
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
511
|
+
if (bindingPackageVersion !== '0.1.11' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
512
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
513
513
|
}
|
|
514
514
|
return binding
|
|
515
515
|
} catch (e) {
|
|
@@ -648,8 +648,8 @@ if (!nativeBinding || forceWasi) {
|
|
|
648
648
|
if (!candidateFailed) {
|
|
649
649
|
if (process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
650
650
|
const bindingPackageVersion = require('@vowifi-rs/vowifi-wasm32-wasi/package.json').version
|
|
651
|
-
if (bindingPackageVersion !== '0.1.
|
|
652
|
-
throw new Error(`WASI binding package version mismatch, expected 0.1.
|
|
651
|
+
if (bindingPackageVersion !== '0.1.11') {
|
|
652
|
+
throw new Error(`WASI binding package version mismatch, expected 0.1.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
653
653
|
}
|
|
654
654
|
}
|
|
655
655
|
wasiBinding = require('@vowifi-rs/vowifi-wasm32-wasi')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vowifi-rs/vowifi",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.12",
|
|
4
4
|
"description": "Hardware-independent VoWiFi SMS session for Node.js",
|
|
5
5
|
"license": "MIT OR Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
]
|
|
46
46
|
},
|
|
47
47
|
"optionalDependencies": {
|
|
48
|
-
"@vowifi-rs/vowifi-win32-x64-msvc": "0.1.
|
|
49
|
-
"@vowifi-rs/vowifi-linux-x64-gnu": "0.1.
|
|
50
|
-
"@vowifi-rs/vowifi-linux-arm64-gnu": "0.1.
|
|
48
|
+
"@vowifi-rs/vowifi-win32-x64-msvc": "0.1.12",
|
|
49
|
+
"@vowifi-rs/vowifi-linux-x64-gnu": "0.1.12",
|
|
50
|
+
"@vowifi-rs/vowifi-linux-arm64-gnu": "0.1.12"
|
|
51
51
|
}
|
|
52
52
|
}
|