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/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
- return this.client.http.request("POST", `/computer/pairings/${encodeURIComponent(id)}/decision`, { body: { requestId, approve } });
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.28" ;
834
+ var SDK_VERSION = "0.1.29" ;
827
835
 
828
836
  // src/daemon-binary.ts
829
837
  function supported(platform, arch) {