mindwire 0.1.28 → 0.1.29
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/dist/{chunk-5WYSGXFN.js → chunk-QPZMGVY7.js} +14 -6
- package/dist/chunk-QPZMGVY7.js.map +1 -0
- package/dist/cli.js +76 -82
- package/dist/cli.js.map +1 -1
- package/dist/computer/connection-flow.d.ts +13 -3
- package/dist/computer.d.ts +14 -1
- package/dist/{controller-5ZTNIHUV.js → controller-MNMIJHH5.js} +3 -3
- package/dist/{controller-5ZTNIHUV.js.map → controller-MNMIJHH5.js.map} +1 -1
- package/dist/index.cjs +11 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-5WYSGXFN.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -786,11 +786,19 @@ var ComputerApi = class {
|
|
|
786
786
|
pairing(id) {
|
|
787
787
|
return this.client.http.request("GET", `/computer/pairings/${encodeURIComponent(id)}`);
|
|
788
788
|
}
|
|
789
|
+
/** pairingVersion >= 2. Releases an unused QR when a saved phone reconnects.
|
|
790
|
+
* Returns false if a phone already submitted a request, which must be handled. */
|
|
791
|
+
closeUnusedPairing(id) {
|
|
792
|
+
return this.client.http.request("DELETE", `/computer/pairings/${encodeURIComponent(id)}`);
|
|
793
|
+
}
|
|
789
794
|
completePairing(id, requestId) {
|
|
790
795
|
return this.client.http.request("POST", `/computer/pairings/${encodeURIComponent(id)}/complete`, { body: { requestId } });
|
|
791
796
|
}
|
|
792
|
-
decide(id, requestId, approve) {
|
|
793
|
-
|
|
797
|
+
async decide(id, requestId, approve, options = {}) {
|
|
798
|
+
if (options.replaceDeviceIds?.length && ((await this.info()).pairingVersion ?? 0) < 2) {
|
|
799
|
+
throw new Error("Update the Mindwire service before replacing saved phone approvals.");
|
|
800
|
+
}
|
|
801
|
+
return this.client.http.request("POST", `/computer/pairings/${encodeURIComponent(id)}/decision`, { body: { requestId, approve, ...options } });
|
|
794
802
|
}
|
|
795
803
|
devices() {
|
|
796
804
|
return this.client.http.request("GET", "/computer/devices");
|
|
@@ -823,7 +831,7 @@ function computerPairingURI(invitation) {
|
|
|
823
831
|
}
|
|
824
832
|
|
|
825
833
|
// src/version.ts
|
|
826
|
-
var SDK_VERSION = "0.1.
|
|
834
|
+
var SDK_VERSION = "0.1.29" ;
|
|
827
835
|
|
|
828
836
|
// src/daemon-binary.ts
|
|
829
837
|
function supported(platform, arch) {
|