qcloud-iotexplorer-appdev-plugin-wificonf-blecombo
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BleComboLLSyncDeviceAdapter=exports.BleComboEspDeviceAdapter=void 0;var tslib_1=require("tslib"),qcloud_iotexplorer_appdev_plugin_wificonf_core_1=require("qcloud-iotexplorer-appdev-plugin-wificonf-core"),protocols_1=require("./protocols");Object.defineProperty(exports,"BleComboEspDeviceAdapter",{enumerable:!0,get:function(){return protocols_1.BleComboEspDeviceAdapter}}),Object.defineProperty(exports,"BleComboLLSyncDeviceAdapter",{enumerable:!0,get:function(){return protocols_1.BleComboLLSyncDeviceAdapter}});var BleComboTask_1=require("./protocols/BleComboTask"),qcloud_iotexplorer_appdev_sdk_1=require("qcloud-iotexplorer-appdev-sdk"),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,getBleComboProtoHandler=function(e){switch(e.bleComboProto){case BleComboTask_1.BleComboType.BLE_COMBO_ESP:return new protocols_1.BleComboEspTask(e);case BleComboTask_1.BleComboType.BLE_COMBO_LLSYNC:return new protocols_1.BleComboLLSyncTask(e);default:console.warn("没有找到 bleComboProto 对应的 bleComboHandler:",e.bleComboProto)}},BleComboPlugin=function(){function e(){}return e.install=function(e){e.plugins.wifiConfBleCombo={start:function(e){return tslib_1.__awaiter(this,void 0,void 0,(function(){var o,t,r,i,n,s,l,a,c,_,d,p,u,C,f=this;return tslib_1.__generator(this,(function(b){switch(b.label){case 0:o=e.onError,t=e.onProgress,r=e.onComplete,i=e.wifiConfToken,n=function(e){return void 0===e&&(e=1e3),tslib_1.__awaiter(f,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}),b.label=1;case 1:b.trys.push([1,13,,14]),s=Date.now(),l=getBleComboProtoHandler(tslib_1.__assign(tslib_1.__assign({},e),{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){o({code:"PROTOCOL_FAIL",detail:{error:e}})}}})),b.label=2;case 2:return b.trys.push([2,4,,5]),[4,l.start()];case 3:return b.sent(),[3,5];case 4:throw a=b.sent(),console.error(a),tslib_1.__assign({code:"PROTOCOL_FAIL"},a);case 5:return t({code:WifiConfStepCode.PROTOCOL_SUCCESS,detail:{timeCost:Date.now()-s}}),[4,n()];case 6:b.sent(),t({code:WifiConfStepCode.BUSINESS_START}),t({code:"BLE_SEND_TOKEN_START",detail:{data:{wifiConfToken:i}}}),c=Date.now(),_=void 0,b.label=7;case 7:return b.trys.push([7,9,,10]),[4,l.sendToken()];case 8:return _=b.sent(),[3,10];case 9:throw d=b.sent(),tslib_1.__assign({code:"BLE_SEND_TOKEN_ERROR"},d);case 10:return[4,t({code:"BLE_SEND_TOKEN_SUCCESS",detail:{timeCost:Date.now()-c,response:_}})];case 11:return b.sent(),[4,n()];case 12:return b.sent(),p=_.productId,u=_.deviceName,r({productId:p,deviceName:u}),l.interrupt(),t({code:WifiConfStepCode.WIFI_CONF_SUCCESS,detail:{timeCost:Date.now()-s}}),[3,14];case 13:return C=b.sent(),o({code:"",detail:{error:C}}),[3,14];case 14:return[2]}}))}))}}},e}();exports.default=BleComboPlugin; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BleComboLLSyncDeviceAdapter=exports.BleComboEspDeviceAdapter=void 0;var tslib_1=require("tslib"),qcloud_iotexplorer_appdev_plugin_wificonf_core_1=require("qcloud-iotexplorer-appdev-plugin-wificonf-core"),protocols_1=require("./protocols");Object.defineProperty(exports,"BleComboEspDeviceAdapter",{enumerable:!0,get:function(){return protocols_1.BleComboEspDeviceAdapter}}),Object.defineProperty(exports,"BleComboLLSyncDeviceAdapter",{enumerable:!0,get:function(){return protocols_1.BleComboLLSyncDeviceAdapter}});var BleComboTask_1=require("./protocols/BleComboTask"),qcloud_iotexplorer_appdev_sdk_1=require("qcloud-iotexplorer-appdev-sdk"),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,getBleComboProtoHandler=function(e){switch(e.wifiConfType){case BleComboTask_1.BleComboType.BLE_COMBO_ESP:return new protocols_1.BleComboEspTask(e);case BleComboTask_1.BleComboType.BLE_COMBO_LLSYNC: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(e){return tslib_1.__awaiter(this,void 0,void 0,(function(){var o,t,r,i,n,s,l,a,c,_,p,d,u,C,f=this;return tslib_1.__generator(this,(function(b){switch(b.label){case 0:o=e.onError,t=e.onProgress,r=e.onComplete,i=e.wifiConfToken,n=function(e){return void 0===e&&(e=1e3),tslib_1.__awaiter(f,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}),b.label=1;case 1:b.trys.push([1,13,,14]),s=Date.now(),l=getBleComboProtoHandler(tslib_1.__assign(tslib_1.__assign({},e),{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){o({code:"PROTOCOL_FAIL",detail:{error:e}})}}})),b.label=2;case 2:return b.trys.push([2,4,,5]),[4,l.start()];case 3:return b.sent(),[3,5];case 4:throw a=b.sent(),console.error(a),tslib_1.__assign({code:"PROTOCOL_FAIL"},a);case 5:return t({code:WifiConfStepCode.PROTOCOL_SUCCESS,detail:{timeCost:Date.now()-s}}),[4,n()];case 6:b.sent(),t({code:WifiConfStepCode.BUSINESS_START}),t({code:"BLE_SEND_TOKEN_START",detail:{data:{wifiConfToken:i}}}),c=Date.now(),_=void 0,b.label=7;case 7:return b.trys.push([7,9,,10]),[4,l.sendToken()];case 8:return _=b.sent(),[3,10];case 9:throw p=b.sent(),tslib_1.__assign({code:"BLE_SEND_TOKEN_ERROR"},p);case 10:return[4,t({code:"BLE_SEND_TOKEN_SUCCESS",detail:{timeCost:Date.now()-c,response:_}})];case 11:return b.sent(),[4,n()];case 12:return b.sent(),d=_.productId,u=_.deviceName,r({productId:d,deviceName:u}),l.interrupt(),t({code:WifiConfStepCode.WIFI_CONF_SUCCESS,detail:{timeCost:Date.now()-s}}),[3,14];case 13:return C=b.sent(),o({code:"",detail:{error:C}}),[3,14];case 14:return[2]}}))}))}}},e}();exports.default=BleComboPlugin; | ||
//# sourceMappingURL=index.js.map |
@@ -5,3 +5,3 @@ import { BleComboTask, BleComboTaskOptions, BleComboType } from '../BleComboTask'; | ||
deviceAdapter: BleComboEspDeviceAdapter; | ||
bleComboProto: BleComboType.BLE_COMBO_ESP; | ||
wifiConfType: BleComboType.BLE_COMBO_ESP; | ||
} | ||
@@ -8,0 +8,0 @@ export declare class BleComboEspTask extends BleComboTask<BleComboEspDeviceAdapter> { |
@@ -6,3 +6,3 @@ import { BleComboLLSyncDeviceAdapter } from './BleComboLLSyncDeviceAdapter'; | ||
deviceAdapter: LLSyncComboDeviceAdapterType; | ||
bleComboProto: BleComboType.BLE_COMBO_LLSYNC; | ||
wifiConfType: BleComboType.BLE_COMBO_LLSYNC; | ||
} | ||
@@ -9,0 +9,0 @@ export declare class BleComboLLSyncTask extends BleComboTask<LLSyncComboDeviceAdapterType> { |
@@ -10,3 +10,3 @@ import { AppDevSdk, Reporter } from 'qcloud-iotexplorer-appdev-sdk'; | ||
deviceAdapter: T; | ||
bleComboProto: BleComboType; | ||
wifiConfType: BleComboType; | ||
reporter: Reporter; | ||
@@ -13,0 +13,0 @@ } |
{ | ||
"name": "qcloud-iotexplorer-appdev-plugin-wificonf-blecombo", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -140,3 +140,3 @@ # qcloud-iotexplorer-appdev-plugin-wificonf-blecombo | ||
}, | ||
bleComboProto: 'BLE_COMBO_ESP' // 可传 'BLE_COMBO_ESP' | 'BLE_COMBO_LLSYNC' | ||
wifiConfType: 'BLE_COMBO_ESP' // 可传 'BLE_COMBO_ESP' | 'BLE_COMBO_LLSYNC' | ||
deviceAdapter, // 由连接设备之后获得 | ||
@@ -143,0 +143,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
57928