Socket
Socket
Sign inDemoInstall

qcloud-iotexplorer-appdev-plugin-wificonf-softap

Package Overview
Dependencies
13
Maintainers
5
Versions
167
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.3.19 to 2.3.20

2

lib/softap/index.js

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SoftAp=void 0;var tslib_1=require("tslib"),qcloud_iotexplorer_appdev_plugin_wificonf_core_1=require("qcloud-iotexplorer-appdev-plugin-wificonf-core"),qcloud_iotexplorer_appdev_sdk_1=require("qcloud-iotexplorer-appdev-sdk"),WifiConfErrorMsg=qcloud_iotexplorer_appdev_plugin_wificonf_core_1.constants.WifiConfErrorMsg,WifiConfStepCode=qcloud_iotexplorer_appdev_plugin_wificonf_core_1.constants.WifiConfStepCode,UdpServer=qcloud_iotexplorer_appdev_plugin_wificonf_core_1.utils.UdpServer,reconnectWifi=qcloud_iotexplorer_appdev_plugin_wificonf_core_1.utils.reconnectWifi,tryRequest=qcloud_iotexplorer_appdev_plugin_wificonf_core_1.utils.tryRequest,connectWifi=qcloud_iotexplorer_appdev_plugin_wificonf_core_1.utils.connectWifi,checkIsTargetWifi=qcloud_iotexplorer_appdev_plugin_wificonf_core_1.utils.checkIsTargetWifi,SoftAp=function(e){function o(o,t){var i=e.call(this,o,t)||this;return i.udpAddress="192.168.4.1",i.udpPort=8266,i.connectAborted=!1,i.udpAddress=i.options.udpAddress||i.udpAddress,i.udpPort=i.options.udpPort||i.udpPort,i}return tslib_1.__extends(o,e),o.prototype.start=function(e){var o=void 0===e?{}:e,t=o.doNotRetry,i=void 0!==t&&t,r=o.isUdpRetry,s=void 0!==r&&r;return tslib_1.__awaiter(this,void 0,void 0,(function(){var e,o,t,r=this;return tslib_1.__generator(this,(function(n){switch(n.label){case 0:s||(this.onProgress({code:WifiConfStepCode.WIFI_CONF_START}),this.onProgress({code:WifiConfStepCode.PROTOCOL_START,reportEvents:["配网"]})),e=Date.now(),console.log("come new softAp,options:",this.options),n.label=1;case 1:return n.trys.push([1,5,,8]),this.options.softAPInfo?[4,connectWifi(this.options.softAPInfo,{onProgress:function(e){r.onProgress.call(r,e)}})]:[3,3];case 2:n.sent(),n.label=3;case 3:return[4,this.doBusiness()];case 4:return o=n.sent(),this.onProgress({code:WifiConfStepCode.WIFI_CONF_SUCCESS,detail:tslib_1.__assign({timeCost:Date.now()-e},o)}),this.onComplete(o),[3,8];case 5:return t=n.sent(),console.error(t),t&&t.code in WifiConfErrorMsg&&(t.uiMsg=WifiConfErrorMsg[t.code]),i||!this.options.autoRetry?[3,7]:[4,qcloud_iotexplorer_appdev_plugin_wificonf_core_1.issueHandler({error:t,targetWifiInfo:this.options.targetWifiInfo,softAPInfo:this.options.softAPInfo,wifiConfType:this.options.wifiConfType,onProgress:function(e){r.onProgress.call(r,e)}})];case 6:if(n.sent())return this.onProgress({code:WifiConfStepCode.WIFI_CONF_AUTO_RETRY}),[2,this.start({doNotRetry:!0,isUdpRetry:!0})];n.label=7;case 7:return this.connectAborted=!0,this.onProgress({code:WifiConfStepCode.WIFI_CONF_FAIL,detail:{error:t},reportEvents:["配网"]}),this.onError({code:"WIFI_CONF_FAIL",detail:{error:t}}),[3,8];case 8:return[2]}}))}))},o.prototype.doBusiness=function(){return tslib_1.__awaiter(this,void 0,void 0,(function(){var e,o,t,i,r,s,n,d=this;return tslib_1.__generator(this,(function(c){switch(c.label){case 0:this.onProgress({code:WifiConfStepCode.CREATE_UDP_CONNECTION_START,reportEvents:["udp"]}),e=Date.now(),o=new UdpServer({address:this.udpAddress,port:this.udpPort,sdk:this.sdk,retryTime:10,retryWhenFail:!0}),t=qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.genPromise(),i=qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.genPromise(),o.onError((function(e){return t.reject(tslib_1.__assign(tslib_1.__assign({},e),{code:"UDP_ERROR"}))})),o.onProgressError((function(e){return i.reject({code:"BUSINESS_DEVICE_ERROR",message:e})})),r=function(){return tslib_1.__awaiter(d,void 0,void 0,(function(){var t,i,r,s,n,d,c,_,a,u,p,l,f,S,v,h,I=this;return tslib_1.__generator(this,(function(C){switch(C.label){case 0:return t=function(e){return void 0===e&&(e=1e3),tslib_1.__awaiter(I,void 0,void 0,(function(){return tslib_1.__generator(this,(function(o){switch(o.label){case 0:return[4,qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.delay(e||this.options.stepInterval)];case 1:return o.sent(),this.connectAborted&&qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.logger.debug("connection aborted"),[2]}}))}))},[4,t()];case 1:return C.sent(),this.onProgress({code:WifiConfStepCode.CREATE_UDP_CONNECTION_SUCCESS,detail:{timeCost:Date.now()-e},reportEvents:["udp"]}),this.onProgress({code:WifiConfStepCode.SOFTAP_SEND_TARGET_WIFIINFO_START,reportEvents:["ap发送wifi"]}),i=Date.now(),[4,o.send({cmdType:1,ssid:this.options.targetWifiInfo.SSID,password:this.options.targetWifiInfo.password,token:this.options.wifiConfToken})];case 2:switch(r=C.sent(),s=r.protoVersion,n=tslib_1.__rest(r,["protoVersion"]),s||(s="1.0"),console.log(s,"protoVersion"),this.onProgress({code:WifiConfStepCode.SOFTAP_SEND_TARGET_WIFIINFO_SUCCESS,detail:{data:n,timeCost:Date.now()-i,protoVersion:s},reportEvents:["ap发送wifi"]}),d=function(e){var o=e.useTargetWifi,t=void 0!==o&&o;return tslib_1.__awaiter(I,void 0,void 0,(function(){var e=this;return tslib_1.__generator(this,(function(o){switch(o.label){case 0:return[4,reconnectWifi(this.options.targetWifiInfo,{onProgress:function(o){e.onProgress.call(e,o)},ignoreError:!0,useTargetWifi:t})];case 1:return o.sent(),this.onProgress({code:WifiConfStepCode.PROTOCOL_SUCCESS,detail:{timeCost:Date.now()-i,protoVersion:s}}),this.onProgress({code:WifiConfStepCode.BUSINESS_START}),[2]}}))}))},c=function(){return tslib_1.__awaiter(I,void 0,void 0,(function(){var e,t,i,r,s=this;return tslib_1.__generator(this,(function(c){switch(c.label){case 0:return[4,d({useTargetWifi:!0})];case 1:c.sent(),e=!1,t=function(){return tslib_1.__awaiter(s,void 0,void 0,(function(){var t,i,r,s=this;return tslib_1.__generator(this,(function(n){switch(n.label){case 0:return[4,checkIsTargetWifi(null===(t=this.options)||void 0===t?void 0:t.targetWifiInfo)];case 1:return n.sent()&&(null===(r=null===(i=null==this?void 0:this.sdk)||void 0===i?void 0:i.reporter)||void 0===r||r.info("Start_Check_Device_Connect_Target_Wifi_By_UDP"),o.onMessage((function(t){return tslib_1.__awaiter(s,void 0,void 0,(function(){var i,r;return tslib_1.__generator(this,(function(s){return 7===t.cmdType&&(e=!0,null===(r=null===(i=null==this?void 0:this.sdk)||void 0===i?void 0:i.reporter)||void 0===r||r.info("Device_Connect_Target_Wifi_Success"),o.destroy()),[2]}))}))}))),[2]}}))}))},i=function(){return tslib_1.__awaiter(s,void 0,void 0,(function(){var e,t,i,r=this;return tslib_1.__generator(this,(function(s){switch(s.label){case 0:return[4,qcloud_iotexplorer_appdev_plugin_wificonf_core_1.queryTokenStateAndBind({token:this.options.wifiConfToken,productId:null==n?void 0:n.productId,deviceName:null==n?void 0:n.deviceName,familyId:this.options.familyId,roomId:this.options.roomId,onProgress:function(e){r.onProgress.call(r,e)},sdk:this.sdk,newTokenVersion:this.options.newTokenVersion})];case 1:return e=s.sent(),t=e.productId,i=e.deviceName,o.destroy(),_={productId:t,deviceName:i},[2]}}))}))},t(),c.label=2;case 2:return c.trys.push([2,4,,8]),[4,i()];case 3:return c.sent(),[3,8];case 4:return(r=c.sent())&&"BUSINESS_QUERY_BIND_TOKEN_TIMEOUT"===r.code&&!0===e?(e=!1,[4,i()]):[3,6];case 5:return c.sent(),[3,7];case 6:throw r;case 7:return[3,8];case 8:return[2]}}))}))},_={},s){case"1.0":return[3,3];case"2.0":return[3,13];case"3.0":return[3,17]}return[3,19];case 3:if("dataRecived"!==n.deviceReply)throw{code:"BUSINESS_INVALID_RESPONSE",detail:n};return[4,t(1e4)];case 4:return C.sent(),this.onProgress({code:WifiConfStepCode.SOFTAP_GET_DEVICE_SIGNATURE_START}),[4,o.send({cmdType:0,timestamp:parseInt(String(Date.now()/1e3),10)})];case 5:if(a=C.sent(),u=a.mqttState,p=a.wifiState,l=tslib_1.__rest(a,["mqttState","wifiState"]),"connected"!==u)throw{code:"BUSINESS_DEVICE_CONNECT_MQTT_FAIL"};if("connected"!==p)throw{code:"BUSINESS_DEVICE_CONNECT_WIFI_FAIL"};return this.onProgress({code:WifiConfStepCode.SOFTAP_GET_DEVICE_SIGNATURE_SUCCESS}),o.destroy(),[4,t()];case 6:return C.sent(),[4,reconnectWifi(this.options.targetWifiInfo,{onProgress:function(e){I.onProgress.call(I,e)}})];case 7:return C.sent(),[4,t()];case 8:C.sent(),this.onProgress({code:WifiConfStepCode.PROTOCOL_SUCCESS,detail:{timeCost:Date.now()-i,protoVersion:s}}),this.onProgress({code:WifiConfStepCode.BUSINESS_START}),this.onProgress({code:WifiConfStepCode.BUSINESS_ADD_DEVICE_START,detail:{data:{Signature:l.signature,DeviceTimestamp:l.timestamp,ProductId:l.productId,DeviceName:l.deviceName,ConnId:l.connId,FamilyId:this.options.familyId}}}),C.label=9;case 9:return C.trys.push([9,11,,12]),[4,tryRequest((function(){return I.sdk.requestApi("addDeviceBySigInFamily",{Signature:l.signature,DeviceTimestamp:l.timestamp,ProductId:l.productId,DeviceName:l.deviceName,ConnId:l.connId,FamilyId:I.options.familyId},{isTokenApi:!0})}),{reporter:this.sdk.reporter})];case 10:return C.sent(),[3,12];case 11:throw f=C.sent(),tslib_1.__assign(tslib_1.__assign({},f),{code:"BUSINESS_ADD_DEVICE_FAIL"});case 12:return _={productId:l.productId,deviceName:l.deviceName},[3,20];case 13:return o.destroy(),[4,d({useTargetWifi:!1})];case 14:return C.sent(),[4,t()];case 15:return C.sent(),[4,qcloud_iotexplorer_appdev_plugin_wificonf_core_1.queryTokenStateAndBind({token:this.options.wifiConfToken,productId:null==n?void 0:n.productId,deviceName:null==n?void 0:n.deviceName,familyId:this.options.familyId,roomId:this.options.roomId,onProgress:function(e){I.onProgress.call(I,e)},sdk:this.sdk,newTokenVersion:this.options.newTokenVersion})];case 16:return S=C.sent(),v=S.productId,h=S.deviceName,_={productId:v,deviceName:h},[3,20];case 17:return[4,c()];case 18:return C.sent(),[3,20];case 19:throw{code:"SOFTAP_MODULE_VERSION_ERROR"};case 20:return console.log("come to return,outDeviceInfo:",_),[2,{productId:_.productId,deviceName:_.deviceName}]}}))}))},c.label=1;case 1:return c.trys.push([1,3,4,5]),[4,Promise.race([r(),t.promise,i.promise])];case 2:return s=c.sent(),[3,5];case 3:throw n=c.sent(),console.log(n),o.destroy(),n;case 4:return console.log("come udp server destroy"),o.destroy(),[7];case 5:return this.onProgress({code:WifiConfStepCode.BUSINESS_SUCCESS,detail:{response:s},reportEvents:["addDevice"]}),[2,s]}}))}))},o}(qcloud_iotexplorer_appdev_plugin_wificonf_core_1.WifiConfProtocolBase);exports.SoftAp=SoftAp;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SoftAp=void 0;var tslib_1=require("tslib"),qcloud_iotexplorer_appdev_plugin_wificonf_core_1=require("qcloud-iotexplorer-appdev-plugin-wificonf-core"),qcloud_iotexplorer_appdev_sdk_1=require("qcloud-iotexplorer-appdev-sdk"),WifiConfErrorMsg=qcloud_iotexplorer_appdev_plugin_wificonf_core_1.constants.WifiConfErrorMsg,WifiConfStepCode=qcloud_iotexplorer_appdev_plugin_wificonf_core_1.constants.WifiConfStepCode,UdpServer=qcloud_iotexplorer_appdev_plugin_wificonf_core_1.utils.UdpServer,reconnectWifi=qcloud_iotexplorer_appdev_plugin_wificonf_core_1.utils.reconnectWifi,tryRequest=qcloud_iotexplorer_appdev_plugin_wificonf_core_1.utils.tryRequest,connectWifi=qcloud_iotexplorer_appdev_plugin_wificonf_core_1.utils.connectWifi,checkIsTargetWifi=qcloud_iotexplorer_appdev_plugin_wificonf_core_1.utils.checkIsTargetWifi,SoftAp=function(e){function o(o,t){var i=e.call(this,o,t)||this;return i.udpAddress="192.168.4.1",i.udpPort=8266,i.connectAborted=!1,i.udpAddress=i.options.udpAddress||i.udpAddress,i.udpPort=i.options.udpPort||i.udpPort,i}return tslib_1.__extends(o,e),o.prototype.start=function(e){var o=void 0===e?{}:e,t=o.doNotRetry,i=void 0!==t&&t,r=o.isUdpRetry,s=void 0!==r&&r;return tslib_1.__awaiter(this,void 0,void 0,(function(){var e,o,t,r=this;return tslib_1.__generator(this,(function(n){switch(n.label){case 0:s||(this.onProgress({code:WifiConfStepCode.WIFI_CONF_START}),this.onProgress({code:WifiConfStepCode.PROTOCOL_START,reportEvents:["配网"]})),e=Date.now(),console.log("come new softAp,options:",this.options),n.label=1;case 1:return n.trys.push([1,5,,8]),this.options.softAPInfo?[4,connectWifi(this.options.softAPInfo,{onProgress:function(e){r.onProgress.call(r,e)}})]:[3,3];case 2:n.sent(),n.label=3;case 3:return[4,this.doBusiness()];case 4:return o=n.sent(),this.onProgress({code:WifiConfStepCode.WIFI_CONF_SUCCESS,detail:tslib_1.__assign({timeCost:Date.now()-e},o)}),this.onComplete(o),[3,8];case 5:return t=n.sent(),console.error(t),t&&t.code in WifiConfErrorMsg&&(t.uiMsg=WifiConfErrorMsg[t.code]),i||!this.options.autoRetry?[3,7]:[4,qcloud_iotexplorer_appdev_plugin_wificonf_core_1.issueHandler({error:t,targetWifiInfo:this.options.targetWifiInfo,softAPInfo:this.options.softAPInfo,wifiConfType:this.options.wifiConfType,onProgress:function(e){r.onProgress.call(r,e)}})];case 6:if(n.sent())return this.onProgress({code:WifiConfStepCode.WIFI_CONF_AUTO_RETRY}),[2,this.start({doNotRetry:!0,isUdpRetry:!0})];n.label=7;case 7:return this.connectAborted=!0,this.onProgress({code:WifiConfStepCode.WIFI_CONF_FAIL,detail:{error:t},reportEvents:["配网"]}),this.onError({code:"WIFI_CONF_FAIL",detail:{error:t}}),[3,8];case 8:return[2]}}))}))},o.prototype.doBusiness=function(){return tslib_1.__awaiter(this,void 0,void 0,(function(){var e,o,t,i,r,s,n,d=this;return tslib_1.__generator(this,(function(c){switch(c.label){case 0:this.onProgress({code:WifiConfStepCode.CREATE_UDP_CONNECTION_START,reportEvents:["udp"]}),e=Date.now(),o=new UdpServer({address:this.udpAddress,port:this.udpPort,sdk:this.sdk,retryTime:10,retryWhenFail:!0}),t=qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.genPromise(),i=qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.genPromise(),o.onError((function(e){return t.reject(tslib_1.__assign(tslib_1.__assign({},e),{code:"UDP_ERROR"}))})),o.onProgressError((function(e){return i.reject({code:"BUSINESS_DEVICE_ERROR",message:e})})),r=function(){return tslib_1.__awaiter(d,void 0,void 0,(function(){var t,i,r,s,n,d,c,_,a,u,p,l,f,S,v,h,I=this;return tslib_1.__generator(this,(function(C){switch(C.label){case 0:return t=function(e){return void 0===e&&(e=1e3),tslib_1.__awaiter(I,void 0,void 0,(function(){return tslib_1.__generator(this,(function(o){switch(o.label){case 0:return[4,qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.delay(e||this.options.stepInterval)];case 1:return o.sent(),this.connectAborted&&qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.logger.debug("connection aborted"),[2]}}))}))},[4,t()];case 1:return C.sent(),this.onProgress({code:WifiConfStepCode.CREATE_UDP_CONNECTION_SUCCESS,detail:{timeCost:Date.now()-e},reportEvents:["udp"]}),this.onProgress({code:WifiConfStepCode.SOFTAP_SEND_TARGET_WIFIINFO_START,reportEvents:["ap发送wifi"]}),i=Date.now(),[4,o.send({cmdType:1,ssid:this.options.targetWifiInfo.SSID,password:this.options.targetWifiInfo.password,token:this.options.wifiConfToken})];case 2:switch(r=C.sent(),s=r.protoVersion,n=tslib_1.__rest(r,["protoVersion"]),s||(s="1.0"),console.log(s,"protoVersion"),this.onProgress({code:WifiConfStepCode.SOFTAP_SEND_TARGET_WIFIINFO_SUCCESS,detail:{data:n,timeCost:Date.now()-i,protoVersion:s},reportEvents:["ap发送wifi"]}),d=function(e){var o=e.useTargetWifi,t=void 0!==o&&o;return tslib_1.__awaiter(I,void 0,void 0,(function(){var e=this;return tslib_1.__generator(this,(function(o){switch(o.label){case 0:return[4,reconnectWifi(this.options.targetWifiInfo,{onProgress:function(o){e.onProgress.call(e,o)},ignoreError:!0,useTargetWifi:t})];case 1:return o.sent(),this.onProgress({code:WifiConfStepCode.PROTOCOL_SUCCESS,detail:{timeCost:Date.now()-i,protoVersion:s}}),this.onProgress({code:WifiConfStepCode.BUSINESS_START}),[2]}}))}))},c=function(){return tslib_1.__awaiter(I,void 0,void 0,(function(){var e,t,i,r,s=this;return tslib_1.__generator(this,(function(c){switch(c.label){case 0:return[4,d({useTargetWifi:!0})];case 1:c.sent(),e=!1,t=function(){return tslib_1.__awaiter(s,void 0,void 0,(function(){var t,i,r,s=this;return tslib_1.__generator(this,(function(n){switch(n.label){case 0:return[4,checkIsTargetWifi(null===(t=this.options)||void 0===t?void 0:t.targetWifiInfo)];case 1:return n.sent()&&(null===(r=null===(i=null==this?void 0:this.sdk)||void 0===i?void 0:i.reporter)||void 0===r||r.info("Start_Check_Device_Connect_Target_Wifi_By_UDP"),o.onMessage((function(t){return tslib_1.__awaiter(s,void 0,void 0,(function(){var i,r;return tslib_1.__generator(this,(function(s){return 7===t.cmdType&&(e=!0,null===(r=null===(i=null==this?void 0:this.sdk)||void 0===i?void 0:i.reporter)||void 0===r||r.info("Device_Connect_Target_Wifi_Success"),o.destroy()),[2]}))}))}))),[2]}}))}))},i=function(){return tslib_1.__awaiter(s,void 0,void 0,(function(){var e,t,i,r=this;return tslib_1.__generator(this,(function(s){switch(s.label){case 0:return[4,qcloud_iotexplorer_appdev_plugin_wificonf_core_1.queryTokenStateAndBind({token:this.options.wifiConfToken,productId:null==n?void 0:n.productId,deviceName:null==n?void 0:n.deviceName,familyId:this.options.familyId,roomId:this.options.roomId,onProgress:function(e){r.onProgress.call(r,e)},sdk:this.sdk,newTokenVersion:this.options.newTokenVersion})];case 1:return e=s.sent(),t=e.productId,i=e.deviceName,o.destroy(),_={productId:t,deviceName:i},[2]}}))}))},t(),c.label=2;case 2:return c.trys.push([2,4,,8]),[4,i()];case 3:return c.sent(),[3,8];case 4:return(r=c.sent())&&"BUSINESS_QUERY_BIND_TOKEN_TIMEOUT"===r.code&&!0===e?(e=!1,[4,i()]):[3,6];case 5:return c.sent(),[3,7];case 6:throw r;case 7:return[3,8];case 8:return[2]}}))}))},_={},s){case"1.0":return[3,3];case"2.0":return[3,13];case"3.0":return[3,17]}return[3,19];case 3:if("dataRecived"!==n.deviceReply)throw{code:"BUSINESS_INVALID_RESPONSE",detail:n};return[4,t(1e4)];case 4:return C.sent(),this.onProgress({code:WifiConfStepCode.SOFTAP_GET_DEVICE_SIGNATURE_START}),[4,o.send({cmdType:0,timestamp:parseInt(String(Date.now()/1e3),10)})];case 5:if(a=C.sent(),u=a.mqttState,p=a.wifiState,l=tslib_1.__rest(a,["mqttState","wifiState"]),"connected"!==u)throw{code:"BUSINESS_DEVICE_CONNECT_MQTT_FAIL"};if("connected"!==p)throw{code:"BUSINESS_DEVICE_CONNECT_WIFI_FAIL"};return this.onProgress({code:WifiConfStepCode.SOFTAP_GET_DEVICE_SIGNATURE_SUCCESS}),o.destroy(),[4,t()];case 6:return C.sent(),[4,reconnectWifi(this.options.targetWifiInfo,{onProgress:function(e){I.onProgress.call(I,e)}})];case 7:return C.sent(),[4,t()];case 8:C.sent(),this.onProgress({code:WifiConfStepCode.PROTOCOL_SUCCESS,detail:{timeCost:Date.now()-i,protoVersion:s}}),this.onProgress({code:WifiConfStepCode.BUSINESS_START}),this.onProgress({code:WifiConfStepCode.BUSINESS_ADD_DEVICE_START,detail:{data:{Signature:l.signature,DeviceTimestamp:l.timestamp,ProductId:l.productId,DeviceName:l.deviceName,ConnId:l.connId,FamilyId:this.options.familyId}}}),C.label=9;case 9:return C.trys.push([9,11,,12]),[4,tryRequest((function(){return I.sdk.requestApi("AppSigBindDeviceInFamily",{Signature:l.signature,DeviceTimestamp:l.timestamp,ProductId:l.productId,DeviceName:l.deviceName,ConnId:l.connId,FamilyId:I.options.familyId},{isTokenApi:!0})}),{reporter:this.sdk.reporter})];case 10:return C.sent(),[3,12];case 11:throw f=C.sent(),tslib_1.__assign(tslib_1.__assign({},f),{code:"BUSINESS_ADD_DEVICE_FAIL"});case 12:return _={productId:l.productId,deviceName:l.deviceName},[3,20];case 13:return o.destroy(),[4,d({useTargetWifi:!1})];case 14:return C.sent(),[4,t()];case 15:return C.sent(),[4,qcloud_iotexplorer_appdev_plugin_wificonf_core_1.queryTokenStateAndBind({token:this.options.wifiConfToken,productId:null==n?void 0:n.productId,deviceName:null==n?void 0:n.deviceName,familyId:this.options.familyId,roomId:this.options.roomId,onProgress:function(e){I.onProgress.call(I,e)},sdk:this.sdk,newTokenVersion:this.options.newTokenVersion})];case 16:return S=C.sent(),v=S.productId,h=S.deviceName,_={productId:v,deviceName:h},[3,20];case 17:return[4,c()];case 18:return C.sent(),[3,20];case 19:throw{code:"SOFTAP_MODULE_VERSION_ERROR"};case 20:return console.log("come to return,outDeviceInfo:",_),[2,{productId:_.productId,deviceName:_.deviceName}]}}))}))},c.label=1;case 1:return c.trys.push([1,3,4,5]),[4,Promise.race([r(),t.promise,i.promise])];case 2:return s=c.sent(),[3,5];case 3:throw n=c.sent(),console.log(n),o.destroy(),n;case 4:return console.log("come udp server destroy"),o.destroy(),[7];case 5:return this.onProgress({code:WifiConfStepCode.BUSINESS_SUCCESS,detail:{response:s},reportEvents:["addDevice"]}),[2,s]}}))}))},o}(qcloud_iotexplorer_appdev_plugin_wificonf_core_1.WifiConfProtocolBase);exports.SoftAp=SoftAp;
//# sourceMappingURL=index.js.map
{
"name": "qcloud-iotexplorer-appdev-plugin-wificonf-softap",
"version": "2.3.19",
"version": "2.3.20",
"description": "",

@@ -24,3 +24,3 @@ "main": "lib/index.js",

},
"gitHead": "4b4f69174010b60d484f08efd80f616ffcf0ffd6"
"gitHead": "fdd3f0aa7c964e02040a6e00a692a55fac3db7d2"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc