Socket
Socket
Sign inDemoInstall

qcloud-iotexplorer-appdev-plugin-wificonf-blecombo

Package Overview
Dependencies
7
Maintainers
5
Versions
172
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.33 to 1.2.36

2

lib/index.js

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

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var tslib_1=require("tslib"),iotexplorer_ui_dev_config_1=require("iotexplorer-ui-dev-config"),qcloud_iotexplorer_appdev_plugin_wificonf_core_1=require("qcloud-iotexplorer-appdev-plugin-wificonf-core"),qcloud_iotexplorer_appdev_sdk_1=require("qcloud-iotexplorer-appdev-sdk"),protocols_1=require("./protocols"),delay=qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.delay,WifiConfStepCode=qcloud_iotexplorer_appdev_plugin_wificonf_core_1.constants.WifiConfStepCode,WifiConfStepDesp=qcloud_iotexplorer_appdev_plugin_wificonf_core_1.constants.WifiConfStepDesp,protocols_2=require("./protocols");Object.defineProperty(exports,"BleComboDualModeDeviceAdapter",{enumerable:!0,get:function(){return protocols_2.BleComboDualModeDeviceAdapter}}),Object.defineProperty(exports,"BleComboDualModeDeviceAdapter4H5",{enumerable:!0,get:function(){return protocols_2.BleComboDualModeDeviceAdapter4H5}}),Object.defineProperty(exports,"BleComboEspDeviceAdapter",{enumerable:!0,get:function(){return protocols_2.BleComboEspDeviceAdapter}}),Object.defineProperty(exports,"BleComboLLSyncDeviceAdapter",{enumerable:!0,get:function(){return protocols_2.BleComboLLSyncDeviceAdapter}});var getBleComboProtoHandler=function(e){switch(e.wifiConfType){case iotexplorer_ui_dev_config_1.WifiConfType.BLEComboEsp:return new protocols_1.BleComboEspTask(e);case iotexplorer_ui_dev_config_1.WifiConfType.BLEComboLLSync:case iotexplorer_ui_dev_config_1.WifiConfType.DualMode:return new protocols_1.BleComboLLSyncTask(e);default:console.warn("没有找到 wifiConfType 对应的 bleComboHandler:",e.wifiConfType)}},BleComboPlugin=function(){function e(){}return e.install=function(e){e.plugins.wifiConfBleCombo={start:function(o){return tslib_1.__awaiter(this,void 0,void 0,(function(){var t,r,i,n,s,c,d,a,l,_,p,u,f,C,b,v,S,T,m=this;return tslib_1.__generator(this,(function(E){switch(E.label){case 0:t=o.onError,r=o.onProgress,i=o.onComplete,n=o.wifiConfToken,s=o.familyId,c=o.roomId,d=void 0===c?"":c,a=function(e){return void 0===e&&(e=1e3),tslib_1.__awaiter(m,void 0,void 0,(function(){return tslib_1.__generator(this,(function(o){switch(o.label){case 0:return[4,delay(e)];case 1:return o.sent(),[2]}}))}))},r({code:WifiConfStepCode.PROTOCOL_START,reportEvents:["配网","发送wifi"]}),E.label=1;case 1:E.trys.push([1,22,,23]),l=Date.now(),_=getBleComboProtoHandler(tslib_1.__assign(tslib_1.__assign({},o),{reporter:{info:function(e,o){void 0===o&&(o={}),r({code:WifiConfStepCode.PROTOCOL_DETAIL,detail:{message:WifiConfStepCode.PROTOCOL_DETAIL+"("+WifiConfStepDesp[WifiConfStepCode.PROTOCOL_DETAIL]+": "+e+")",data:o}})},error:function(e){t({code:"PROTOCOL_FAIL",detail:{error:e}})}}})),E.label=2;case 2:return E.trys.push([2,4,,5]),[4,_.start()];case 3:return E.sent(),[3,5];case 4:throw p=E.sent(),console.error(p),tslib_1.__assign({code:"PROTOCOL_FAIL"},p);case 5:return r({code:WifiConfStepCode.PROTOCOL_SUCCESS,detail:{timeCost:Date.now()-l},reportEvents:["发送wifi"]}),[4,a()];case 6:E.sent(),r({code:WifiConfStepCode.BUSINESS_START}),r({code:"BLE_SEND_TOKEN_START",detail:{data:{wifiConfToken:n}},reportEvents:["bleSendToken"]}),u=Date.now(),f=void 0,E.label=7;case 7:return E.trys.push([7,9,,10]),[4,_.sendToken()];case 8:return f=E.sent(),[3,10];case 9:throw C=E.sent(),tslib_1.__assign({code:"BLE_SEND_TOKEN_ERROR"},C);case 10:return[4,r({code:"BLE_SEND_TOKEN_SUCCESS",detail:{timeCost:Date.now()-u,response:f},reportEvents:["bleSendToken"]})];case 11:if(E.sent(),b=f.productId,v=f.deviceName,o.wifiConfType!==iotexplorer_ui_dev_config_1.WifiConfType.DualMode)return[3,17];E.label=12;case 12:return E.trys.push([12,15,,16]),[4,qcloud_iotexplorer_appdev_plugin_wificonf_core_1.queryTokenStateAndBind({token:o.wifiConfToken,productId:b,deviceName:v,familyId:s,roomId:d,onProgress:r,sdk:e,skipBind:!0,newTokenVersion:!1})];case 13:return E.sent(),[4,o.deviceAdapter.bindDevice({familyId:s,roomId:d})];case 14:return E.sent(),[3,16];case 15:throw S=E.sent(),tslib_1.__assign({code:"BLE_BIND_DEVICE_ERROR"},S);case 16:return[3,19];case 17:return[4,qcloud_iotexplorer_appdev_plugin_wificonf_core_1.queryTokenStateAndBind({token:o.wifiConfToken,productId:b,deviceName:v,familyId:s,roomId:d,onProgress:r,sdk:e})];case 18:E.sent(),E.label=19;case 19:return[4,r({code:WifiConfStepCode.BUSINESS_QUERY_TOKEN_STATE_SUCCESS,detail:{timeCost:Date.now()-u,response:f}})];case 20:return E.sent(),[4,a()];case 21:return E.sent(),i({productId:b,deviceName:v}),_.interrupt(),r({code:WifiConfStepCode.WIFI_CONF_SUCCESS,detail:{timeCost:Date.now()-l},reportEvents:["配网"]}),[3,23];case 22:return T=E.sent(),t({code:"",detail:{error:T}}),[3,23];case 23:return[2]}}))}))}}},e}();exports.default=BleComboPlugin;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var tslib_1=require("tslib"),iotexplorer_ui_dev_config_1=require("iotexplorer-ui-dev-config"),qcloud_iotexplorer_appdev_plugin_wificonf_core_1=require("qcloud-iotexplorer-appdev-plugin-wificonf-core"),qcloud_iotexplorer_appdev_sdk_1=require("qcloud-iotexplorer-appdev-sdk"),protocols_1=require("./protocols"),delay=qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.delay,WifiConfStepCode=qcloud_iotexplorer_appdev_plugin_wificonf_core_1.constants.WifiConfStepCode,WifiConfStepDesp=qcloud_iotexplorer_appdev_plugin_wificonf_core_1.constants.WifiConfStepDesp,protocols_2=require("./protocols");Object.defineProperty(exports,"BleComboDualModeDeviceAdapter",{enumerable:!0,get:function(){return protocols_2.BleComboDualModeDeviceAdapter}}),Object.defineProperty(exports,"BleComboDualModeDeviceAdapter4H5",{enumerable:!0,get:function(){return protocols_2.BleComboDualModeDeviceAdapter4H5}}),Object.defineProperty(exports,"BleComboEspDeviceAdapter",{enumerable:!0,get:function(){return protocols_2.BleComboEspDeviceAdapter}}),Object.defineProperty(exports,"BleComboLLSyncDeviceAdapter",{enumerable:!0,get:function(){return protocols_2.BleComboLLSyncDeviceAdapter}});var getBleComboProtoHandler=function(e){switch(e.wifiConfType){case iotexplorer_ui_dev_config_1.WifiConfType.BLEComboEsp:return new protocols_1.BleComboEspTask(e);case iotexplorer_ui_dev_config_1.WifiConfType.BLEComboLLSync:case iotexplorer_ui_dev_config_1.WifiConfType.DualMode:return new protocols_1.BleComboLLSyncTask(e);default:console.warn("没有找到 wifiConfType 对应的 bleComboHandler:",e.wifiConfType)}},BleComboPlugin=function(){function e(){}return e.install=function(e){e.plugins.wifiConfBleCombo={start:function(o){return tslib_1.__awaiter(this,void 0,void 0,(function(){var r,t,i,n,s,c,d,a,l,_,p,u,f,C,b,v,S,T,m=this;return tslib_1.__generator(this,(function(E){switch(E.label){case 0:r=o.onError,t=o.onProgress,i=o.onComplete,n=o.wifiConfToken,s=o.familyId,c=o.roomId,d=void 0===c?"":c,a=function(e){return void 0===e&&(e=1e3),tslib_1.__awaiter(m,void 0,void 0,(function(){return tslib_1.__generator(this,(function(o){switch(o.label){case 0:return[4,delay(e)];case 1:return o.sent(),[2]}}))}))},t({code:WifiConfStepCode.PROTOCOL_START,reportEvents:["配网","发送wifi"]}),E.label=1;case 1:E.trys.push([1,22,,23]),l=Date.now(),_=getBleComboProtoHandler(tslib_1.__assign(tslib_1.__assign({},o),{reporter:{info:function(e,o){void 0===o&&(o={}),t({code:WifiConfStepCode.PROTOCOL_DETAIL,detail:{message:WifiConfStepCode.PROTOCOL_DETAIL+"("+WifiConfStepDesp[WifiConfStepCode.PROTOCOL_DETAIL]+": "+e+")",data:o}})},error:function(e){r({code:"PROTOCOL_FAIL",detail:{error:e}})}}})),E.label=2;case 2:return E.trys.push([2,4,,5]),[4,_.start()];case 3:return E.sent(),[3,5];case 4:throw p=E.sent(),console.error(p),tslib_1.__assign({code:"PROTOCOL_FAIL"},p);case 5:return t({code:WifiConfStepCode.PROTOCOL_SUCCESS,detail:{timeCost:Date.now()-l},reportEvents:["发送wifi"]}),[4,a()];case 6:E.sent(),t({code:WifiConfStepCode.BUSINESS_START}),t({code:"BLE_SEND_TOKEN_START",detail:{data:{wifiConfToken:n}},reportEvents:["bleSendToken"]}),u=Date.now(),f=void 0,E.label=7;case 7:return E.trys.push([7,9,,10]),[4,_.sendToken()];case 8:return f=E.sent(),[3,10];case 9:throw C=E.sent(),tslib_1.__assign({code:"BLE_SEND_TOKEN_ERROR"},C);case 10:return[4,t({code:"BLE_SEND_TOKEN_SUCCESS",detail:{timeCost:Date.now()-u,response:f},reportEvents:["bleSendToken"]})];case 11:if(E.sent(),b=f.productId,v=f.deviceName,o.wifiConfType!==iotexplorer_ui_dev_config_1.WifiConfType.DualMode)return[3,17];E.label=12;case 12:return E.trys.push([12,15,,16]),[4,qcloud_iotexplorer_appdev_plugin_wificonf_core_1.queryTokenStateAndBind({token:o.wifiConfToken,productId:b,deviceName:v,familyId:s,roomId:d,onProgress:t,sdk:e,skipBind:!0,newTokenVersion:!1})];case 13:return E.sent(),[4,o.deviceAdapter.bindDevice({familyId:s,roomId:d})];case 14:return E.sent(),[3,16];case 15:throw S=E.sent(),tslib_1.__assign({code:"BLE_BIND_DEVICE_ERROR"},S);case 16:return[3,19];case 17:return[4,qcloud_iotexplorer_appdev_plugin_wificonf_core_1.queryTokenStateAndBind({token:o.wifiConfToken,productId:b,deviceName:v,familyId:s,roomId:d,onProgress:t,sdk:e,newTokenVersion:o.newTokenVersion})];case 18:E.sent(),E.label=19;case 19:return[4,t({code:WifiConfStepCode.BUSINESS_QUERY_TOKEN_STATE_SUCCESS,detail:{timeCost:Date.now()-u,response:f}})];case 20:return E.sent(),[4,a()];case 21:return E.sent(),i({productId:b,deviceName:v}),_.interrupt(),t({code:WifiConfStepCode.WIFI_CONF_SUCCESS,detail:{timeCost:Date.now()-l},reportEvents:["配网"]}),[3,23];case 22:return T=E.sent(),r({code:"",detail:{error:T}}),[3,23];case 23:return[2]}}))}))}}},e}();exports.default=BleComboPlugin;
//# sourceMappingURL=index.js.map
{
"name": "qcloud-iotexplorer-appdev-plugin-wificonf-blecombo",
"version": "1.2.33",
"version": "1.2.36",
"description": "",

@@ -20,6 +20,6 @@ "main": "lib/index.js",

"iotexplorer-ui-dev-config": "^1.0.35",
"qcloud-iotexplorer-appdev-plugin-wificonf-core": "^1.1.42",
"qcloud-iotexplorer-appdev-sdk": "^1.1.23",
"qcloud-iotexplorer-bluetooth-adapter": "^0.3.23",
"qcloud-iotexplorer-bluetooth-adapter-llsync": "^1.3.26",
"qcloud-iotexplorer-appdev-plugin-wificonf-core": "^1.1.45",
"qcloud-iotexplorer-appdev-sdk": "^1.1.25",
"qcloud-iotexplorer-bluetooth-adapter": "^0.3.26",
"qcloud-iotexplorer-bluetooth-adapter-llsync": "^1.3.29",
"spark-md5": "^3.0.1",

@@ -33,3 +33,3 @@ "tslib": "^2.0.1"

},
"gitHead": "67043b31fceb68b27a99e13268f1267e43bff1af"
"gitHead": "7615dbc042f8f010c7d6fadf28449a656239059b"
}
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