mini_program_gizwits_sdk 3.7.1-beta → 3.7.1-beta.1

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.
Files changed (75) hide show
  1. package/README.md +27 -0
  2. package/dist/index.js +4 -4
  3. package/dist/src/crc/calculators/crc16modbus.d.ts +2 -0
  4. package/dist/src/crc/calculators/crc32.d.ts +2 -0
  5. package/dist/src/crc/crc16modbus.d.ts +7 -0
  6. package/dist/src/crc/crc32.d.ts +7 -0
  7. package/dist/src/crc/create_buffer.d.ts +4 -0
  8. package/dist/src/crc/define_crc.d.ts +7 -0
  9. package/dist/src/crc/index.d.ts +19 -0
  10. package/dist/src/crc/types.d.ts +10 -0
  11. package/dist/src/handler/EventListener.d.ts +9 -0
  12. package/dist/src/handler/ble.d.ts +128 -0
  13. package/dist/src/handler/lan.d.ts +78 -0
  14. package/dist/src/handler/socket.d.ts +161 -0
  15. package/dist/src/protocol/Bind.d.ts +7 -0
  16. package/dist/src/protocol/DeviceInfo.d.ts +11 -0
  17. package/dist/src/protocol/DiscoverUDP.d.ts +17 -0
  18. package/dist/src/protocol/GetDeviceStatus.d.ts +5 -0
  19. package/dist/src/protocol/Login.d.ts +12 -0
  20. package/dist/src/protocol/Ntp.d.ts +5 -0
  21. package/dist/src/protocol/OTA/AwaitNoti.d.ts +7 -0
  22. package/dist/src/protocol/OTA/CheckCanOTA.d.ts +10 -0
  23. package/dist/src/protocol/OTA/OTAPackPackage.d.ts +8 -0
  24. package/dist/src/protocol/OTA/OtaComplete.d.ts +8 -0
  25. package/dist/src/protocol/OTA/PreOTA.d.ts +11 -0
  26. package/dist/src/protocol/OTA/ResetPosition.d.ts +6 -0
  27. package/dist/src/protocol/OffLineData.d.ts +23 -0
  28. package/dist/src/protocol/ProtocolBase.d.ts +12 -0
  29. package/dist/src/protocol/Reset.d.ts +8 -0
  30. package/dist/src/protocol/SetReset.d.ts +7 -0
  31. package/dist/src/protocol/WifiConfig.d.ts +11 -0
  32. package/dist/src/protocol/dataPoint.d.ts +34 -0
  33. package/dist/src/protocol/tool.d.ts +14 -0
  34. package/dist/src/sdk.d.ts +146 -0
  35. package/dist/src/services/devices.d.ts +52 -0
  36. package/dist/src/services/login.d.ts +4 -0
  37. package/dist/src/services/monitor.d.ts +12 -0
  38. package/dist/src/services/ota.d.ts +7 -0
  39. package/dist/src/services/tool.d.ts +4 -0
  40. package/dist/src/services/uploadP0.d.ts +14 -0
  41. package/dist/src/types/index.d.ts +398 -0
  42. package/dist/src/utils/GizLog.d.ts +18 -0
  43. package/dist/src/utils/bleConfigLog.d.ts +11 -0
  44. package/dist/src/utils/connectedBssid.d.ts +6 -0
  45. package/dist/src/utils/errorCode.d.ts +3 -0
  46. package/dist/src/utils/globalData.d.ts +2 -0
  47. package/dist/src/utils/openApiRequest.d.ts +27 -0
  48. package/dist/src/utils/productConfigFileManage.d.ts +15 -0
  49. package/dist/src/utils/randomCode.d.ts +3 -0
  50. package/dist/src/utils/request.d.ts +1 -0
  51. package/dist/src/utils/sentry.d.ts +2 -0
  52. package/dist/src/utils/sleep.d.ts +2 -0
  53. package/dist/src/utils/utils.d.ts +55 -0
  54. package/dist/src/utils/wechatApi.d.ts +23 -0
  55. package/dist/src/utils/wifiConfigLogReport.d.ts +28 -0
  56. package/dist/src/wifiConfig/ConfigBase.d.ts +30 -0
  57. package/dist/src/wifiConfig/ap.d.ts +11 -0
  58. package/dist/src/wifiConfig/ble.d.ts +43 -0
  59. package/dist/src/wifiConfig/nfc/disposeData.d.ts +2 -0
  60. package/dist/src/wifiConfig/nfc/formatData.d.ts +3 -0
  61. package/dist/src/wifiConfig/nfc/formatSSID.d.ts +6 -0
  62. package/dist/src/wifiConfig/nfc/index.d.ts +22 -0
  63. package/dist/src/wifiConfig/nfc/isIncludedCH.d.ts +1 -0
  64. package/dist/src/wifiConfig/nfc/nfcAConnect.d.ts +6 -0
  65. package/dist/src/wifiConfig/nfc/nfcATransceive.d.ts +5 -0
  66. package/dist/src/wifiConfig/nfc/ssIDToASC.d.ts +1 -0
  67. package/dist/src/wifiConfig/nfc/stringToGbk.d.ts +1 -0
  68. package/dist/src/wifiConfig/nfc/transceive.wx.d.ts +2 -0
  69. package/dist/src/wifiConfig/nfc/types.d.ts +15 -0
  70. package/package.json +4 -2
  71. package/.istanbul.yml +0 -4
  72. package/.travis.yml +0 -23
  73. package/.vscode/launch.json +0 -19
  74. package/.vscode/settings.json +0 -3
  75. package/yarn-error.log +0 -6901
@@ -0,0 +1,18 @@
1
+ export type TLogType = 'debug' | 'info' | 'warn' | 'error';
2
+ declare class Log {
3
+ logMap: {
4
+ id: string;
5
+ }[];
6
+ console: Console;
7
+ debug: (...data: any[]) => void;
8
+ info: (...data: any[]) => void;
9
+ log: (...data: any[]) => void;
10
+ warn: (...data: any[]) => void;
11
+ error: (info: string | null, error: Error, needUploadToSentry?: boolean) => void;
12
+ setLogLevel: (type: TLogType) => {
13
+ success: boolean;
14
+ err: import("../types").IError;
15
+ };
16
+ }
17
+ declare const _default: Log;
18
+ export default _default;
@@ -0,0 +1,11 @@
1
+ export declare function bleConfigLog(stage: string, fields: Record<string, unknown>): void;
2
+ export declare function wifiErrorFields(error: any): {
3
+ errCode?: string | number;
4
+ errno?: string | number;
5
+ };
6
+ export declare function configPacketMetadata(buffer: ArrayBuffer): {
7
+ packetBytes: number;
8
+ command?: string;
9
+ declaredBytes?: number;
10
+ state?: number;
11
+ };
@@ -0,0 +1,6 @@
1
+ export declare function normalizeBssid(value: unknown): string;
2
+ export interface BssidResult {
3
+ bssid: string;
4
+ reason: string;
5
+ }
6
+ export declare function resolveConnectedBssid(ssid: string, supplied?: string, timeoutMs?: number): Promise<BssidResult>;
@@ -0,0 +1,3 @@
1
+ import { IErrorCode } from "../types";
2
+ declare const errorCode: IErrorCode;
3
+ export default errorCode;
@@ -0,0 +1,2 @@
1
+ export declare function setGlobalData(key: any, value: any): void;
2
+ export declare function getGlobalData(key: any): any;
@@ -0,0 +1,27 @@
1
+ import { IServiceResult } from '../types';
2
+ declare const openApiRequest: <T>(url: string, options: any, needToken?: boolean) => Promise<IServiceResult<T>>;
3
+ interface IRequestOptions {
4
+ method: string;
5
+ body?: any;
6
+ mode?: string;
7
+ headers?: object;
8
+ timeout?: number;
9
+ notAppId?: boolean;
10
+ }
11
+ export declare function statisticRequest(url: string, options: IRequestOptions, withToken?: boolean): Promise<{
12
+ success: boolean;
13
+ data: any;
14
+ err?: undefined;
15
+ } | {
16
+ success: boolean;
17
+ err: {
18
+ errorCode: any;
19
+ errorMessage: any;
20
+ };
21
+ data?: undefined;
22
+ } | {
23
+ success: boolean;
24
+ data?: undefined;
25
+ err?: undefined;
26
+ }>;
27
+ export default openApiRequest;
@@ -0,0 +1,15 @@
1
+ import { IProductConfigData, IDataPointConfig } from '../types';
2
+ declare class ProductConfigFileManage {
3
+ data: IProductConfigData;
4
+ key: string;
5
+ retryTimes: number;
6
+ retryInterval: number;
7
+ init: () => Promise<void>;
8
+ getConfigFileMap: Record<string, Promise<IDataPointConfig | null>>;
9
+ private sleep;
10
+ private fetchConfigFileWithRetry;
11
+ getConfigFile: (pk: string) => Promise<IDataPointConfig | null>;
12
+ getAttrItem: (pk: string, key: string) => Promise<import("../types").IDataPointAttr>;
13
+ }
14
+ declare const productConfigFileManage: ProductConfigFileManage;
15
+ export default productConfigFileManage;
@@ -0,0 +1,3 @@
1
+ import { IGetRandomCodes } from '../types';
2
+ declare const getRandomCodes: ({ SSID, password, pks }: IGetRandomCodes) => string[];
3
+ export default getRandomCodes;
@@ -0,0 +1 @@
1
+ export default function request<T>(url: string, options: any): Promise<T>;
@@ -0,0 +1,2 @@
1
+ declare const _default: (err: Error, logInfo?: string | null) => void;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const sleep: (time: number) => Promise<void>;
2
+ export default sleep;
@@ -0,0 +1,55 @@
1
+ /// <reference types="crypto-js" />
2
+ import { lib } from "crypto-js/core";
3
+ import { IDevice, IError, IWXDevicesResult, TConnectType, IProductInfo, GizwitsWxBlueToothDevice } from "../types";
4
+ export declare function ab2hex(buffer: ArrayBuffer): any;
5
+ export declare function compareWXSDKVersion(v1: string, v2: string): 0 | 1 | -1;
6
+ export declare const isError: (err: unknown) => err is IError;
7
+ export declare const wrapErrorInfo: (errorMessage: string) => {
8
+ errorCode: string;
9
+ errorMessage: string;
10
+ };
11
+ export declare const unionBy: <T>(array: T[], key: string) => T[];
12
+ export declare function isWXDevicesResult(res: unknown): res is IWXDevicesResult;
13
+ export declare function str2Buf(arr: string): ArrayBuffer;
14
+ export declare const numberArray2Uint8Array: (numArr: number[]) => Uint8Array;
15
+ export declare const advertisData2PkAndMac: (advertisData: ArrayBuffer, pks: string[]) => {
16
+ bleWorkStatus: number;
17
+ mac: string;
18
+ productKey: string;
19
+ support5GConfig: boolean;
20
+ } | {
21
+ bleWorkStatus: number;
22
+ productKey: any;
23
+ mac: any;
24
+ };
25
+ export declare const isSameDevice: (deviceA: IDevice, deviceB: IDevice) => boolean;
26
+ export declare const getDeviceId: (deivce: IDevice) => string;
27
+ export declare const merageBleLocalDevices: (mainDevice: IDevice[], localDevice: IDevice[]) => IDevice[];
28
+ export declare const merageLanLocalDevices: (mainDevice: IDevice[], localDevice: IDevice[]) => IDevice[];
29
+ export declare const BTDevice2GDevice: (BTDevice: GizwitsWxBlueToothDevice, pks: string[]) => IDevice;
30
+ export declare const splitIntoChunks: (value: number[], chunkSize: number) => number[][];
31
+ export declare const getFirstConnectType: (device: IDevice, type?: TConnectType) => TConnectType;
32
+ export declare const getProductInfoThroughPK: (pk: string, productInfos: IProductInfo[]) => IProductInfo;
33
+ export declare const mergeObject: (obj1: any, obj2: any) => any;
34
+ export declare function hex2numbers(str: string): any[];
35
+ export declare function hex2ab(str: string): Uint8Array;
36
+ type BroadcastCmd = 0x19 | 0x94 | 0x9A | 0x98;
37
+ export type TBoradcastRes = {
38
+ mac: string;
39
+ cmd: BroadcastCmd;
40
+ data: string[];
41
+ };
42
+ export declare function parseBroadcastData(data: number[]): TBoradcastRes;
43
+ export declare function ab2numbers(buffer: ArrayBuffer): any;
44
+ export declare function encrypt(uuids: number[], key: number): string[];
45
+ export declare const convertToServiceUuids: ({ len, data, index, mac, cmd }: {
46
+ len?: any;
47
+ data?: any;
48
+ index?: number;
49
+ mac: any;
50
+ cmd?: number;
51
+ }) => any;
52
+ export declare function convertToUuids(mac: number, sn: number, data: number[]): string[];
53
+ export declare function arrayBufferToWordArray(arrayBuffer: any): lib.WordArray;
54
+ export declare function createUUID32(): string;
55
+ export {};
@@ -0,0 +1,23 @@
1
+ import { IBluetoothAdapterStateResult, IWechatResult, IBLEService, IBLECharacteristic } from "../types";
2
+ export declare function retryConnect(deviceId: string, timeout?: number): Promise<{
3
+ success: boolean;
4
+ error: any;
5
+ } | {
6
+ success: IWechatResult;
7
+ error: any;
8
+ }>;
9
+ export declare function openBluetoothAdapter(): Promise<IWechatResult>;
10
+ export declare function closeBluetoothAdapter(): Promise<IWechatResult>;
11
+ export declare function getBluetoothAdapterState(): Promise<IBluetoothAdapterStateResult>;
12
+ export declare function startBluetoothDevicesDiscovery(allowDuplicatesKey?: boolean): Promise<IWechatResult>;
13
+ export declare function getBluetoothDevices(): Promise<WechatMiniprogram.BlueToothDevice[]>;
14
+ export declare function createBLEConnection(deviceId: string, timeout: number): Promise<IWechatResult>;
15
+ export declare function getBLEDeviceServices(deviceId: string): Promise<IBLEService[]>;
16
+ export declare function getBLEDeviceCharacteristics(deviceId: string, serviceId: string): Promise<IBLECharacteristic[]>;
17
+ export declare function notifyBLECharacteristicValueChange(deviceId: string, serviceId: string, characteristicId: string, state?: boolean): Promise<IWechatResult>;
18
+ export declare function writeBLECharacteristicValue(deviceId: string, serviceId: string, characteristicId: string, value: ArrayBuffer): Promise<IWechatResult>;
19
+ export declare function unpackWriteBLECharacteristicValue(deviceId: string, serviceId: string, characteristicId: string, value: ArrayBuffer, mtu?: number): Promise<IWechatResult>;
20
+ export declare function downloadFile({ url }: {
21
+ url: any;
22
+ }): Promise<unknown>;
23
+ export declare function setMtu(mtu: number, deviceId: string): Promise<unknown>;
@@ -0,0 +1,28 @@
1
+ import { AppInfo, MobileInfo, WifiConfigLog } from "../types";
2
+ declare class WifiConfigLogReport {
3
+ isSuccess: boolean;
4
+ ssid: string;
5
+ mode: number;
6
+ timeout: number;
7
+ isBind: boolean;
8
+ mobileInfo: MobileInfo;
9
+ appInfo: AppInfo;
10
+ productKey: string;
11
+ logs: WifiConfigLog[];
12
+ constructor();
13
+ init: (data: {
14
+ productKey?: string;
15
+ ssid: string;
16
+ mode: number;
17
+ timeout: number;
18
+ isBind: boolean;
19
+ }) => void;
20
+ getEnv: () => void;
21
+ updateProductKey: (key: string) => void;
22
+ appendEvent: (log: WifiConfigLog) => void;
23
+ report: () => Promise<void>;
24
+ cancel: () => Promise<void>;
25
+ clean: () => void;
26
+ }
27
+ declare const _default: WifiConfigLogReport;
28
+ export default _default;
@@ -0,0 +1,30 @@
1
+ import { IRandomCodesResult, IRejectCallback, IResult, TimeoutHandle } from "../types";
2
+ import { ConfigEventData, ConfigStage, ConfigStatus, IDevice } from "../types";
3
+ declare class ConfigBase {
4
+ ssid: string;
5
+ bssid: string;
6
+ password: string;
7
+ specialProductKeys: string[];
8
+ disableSearchDevice: boolean;
9
+ specialProductKeySecrets: string[];
10
+ timeoutHandler: TimeoutHandle;
11
+ eventCallBack: (event: ConfigEventData) => void;
12
+ private readonly progressStartedAt;
13
+ protected emitConfigEvent(event: ConfigEventData, callback?: (event: ConfigEventData) => void): void;
14
+ protected progress(stage: ConfigStage, status: ConfigStatus, fields?: Partial<ConfigEventData>): void;
15
+ private setDeviceOnboardingDeployRej?;
16
+ constructor(ssid: string, bssid: string, password: string, specialProductKeys: string[], specialProductKeySecrets: string[]);
17
+ cleanTimeout: () => void;
18
+ stopDeviceOnboardingDeploy: () => void;
19
+ appendExtendData: (key: string) => string;
20
+ hasTimeoutHandler: (cb?: IRejectCallback) => boolean;
21
+ handleTimeout: () => void;
22
+ protected searchDevice: ({ ssid, password }: {
23
+ ssid: string;
24
+ password: string;
25
+ }) => Promise<IResult<IRandomCodesResult[]>>;
26
+ initDeviceOnboardingDeploy: (_res: any, rej: any) => void;
27
+ protected startTimeoutTimer: (timeout: number) => void;
28
+ protected bindDevices: (devices: IDevice[]) => Promise<IResult<IDevice[]>>;
29
+ }
30
+ export default ConfigBase;
@@ -0,0 +1,11 @@
1
+ import { IDevice, IRandomCodesResult, IResult, configDeviceParams, ISetDeviceOnboardingDeployProps } from "../types";
2
+ import ConfigBase from "./ConfigBase";
3
+ declare class ApConfig extends ConfigBase {
4
+ disableSendUDP: boolean;
5
+ private sendMessageInterval;
6
+ private UDPSocketHandler;
7
+ destroy: () => void;
8
+ configDevice: ({ ssid, password, softAPSSIDPrefix }: configDeviceParams) => Promise<IResult<IRandomCodesResult[]>>;
9
+ setDeviceOnboardingDeploy: ({ timeout, isBind, productKey, softAPSSIDPrefix, }: ISetDeviceOnboardingDeployProps) => Promise<IResult<IDevice[]>>;
10
+ }
11
+ export default ApConfig;
@@ -0,0 +1,43 @@
1
+ import { BleHandle } from "../handler/ble";
2
+ import ConfigBase from "./ConfigBase";
3
+ import { IDevice, IError, ConfigEventData, IRandomCodesResult, IResult, configBLEDeviceParams } from "../types";
4
+ type EnableAndGetBluetoothDevicesRes = Promise<{
5
+ success: false;
6
+ err: IError;
7
+ } | {
8
+ success: true;
9
+ bleDevices?: IDevice[];
10
+ }>;
11
+ interface IArgs {
12
+ bleDeviceId: string;
13
+ arrayBuffer: ArrayBuffer;
14
+ usesBssid?: boolean;
15
+ serviceUUIDSuffix?: string;
16
+ characteristicUUIDSuffix?: string;
17
+ bleHandle: BleHandle;
18
+ eventCallBack?: (event: ConfigEventData) => void;
19
+ }
20
+ interface ISetDeviceOnboardingDeployProps {
21
+ timeout: number;
22
+ isBind: boolean;
23
+ softAPSSIDPrefix: string;
24
+ productKey?: string;
25
+ eventCallBack?: (event: ConfigEventData) => void;
26
+ }
27
+ declare class BLEConfig extends ConfigBase {
28
+ bleHandle: BleHandle;
29
+ constructor(ssid: string, bssid: string, password: string, specialProductKeys: string[], specialProductKeySecrets: string[], bleHandle: BleHandle);
30
+ sendBLEConfigCmd: ({ bleDeviceId, arrayBuffer, usesBssid, serviceUUIDSuffix, characteristicUUIDSuffix, bleHandle, eventCallBack }: IArgs) => Promise<boolean | void>;
31
+ destroy: () => void;
32
+ isValidBleDevice: (device: IDevice, softAPSSIDPrefix?: string) => boolean;
33
+ enableBluetoothDevicesDescovery: () => Promise<{
34
+ success: false;
35
+ err: IError;
36
+ } | {
37
+ success: true;
38
+ }>;
39
+ enableAndGetBluetoothDevices: (softAPSSIDPrefix?: string) => EnableAndGetBluetoothDevicesRes;
40
+ setDeviceOnboardingDeploy: ({ timeout, isBind, softAPSSIDPrefix, productKey, eventCallBack, }: ISetDeviceOnboardingDeployProps) => Promise<IResult<IDevice[]>>;
41
+ configBLEDevice: ({ ssid, password, softAPSSIDPrefix, }: configBLEDeviceParams) => Promise<IResult<IRandomCodesResult[]>>;
42
+ }
43
+ export default BLEConfig;
@@ -0,0 +1,2 @@
1
+ import { IDATA } from './types';
2
+ export declare const disposeData: (SSID: Uint8Array, isSSIDincludeCH: boolean, pwd: Uint8Array, passIP: Uint8Array, BSSID: Uint8Array) => IDATA;
@@ -0,0 +1,3 @@
1
+ type IType = 'BSSID' | 'pwd' | 'address';
2
+ export declare const formatData: (data: string, type: IType) => Uint8Array;
3
+ export {};
@@ -0,0 +1,6 @@
1
+ interface IExport {
2
+ SSIDTLV: any;
3
+ isSSIDIncludedCH: boolean;
4
+ }
5
+ export declare const formatSSID: (SSID: string) => IExport;
6
+ export {};
@@ -0,0 +1,22 @@
1
+ import ConfigBase from "../ConfigBase";
2
+ import { IDevice, IResult } from '../../types';
3
+ interface configDeviceParams {
4
+ ssid: string;
5
+ password: string;
6
+ bssid: string;
7
+ address: string;
8
+ }
9
+ interface ISetDeviceOnboardingDeployProps {
10
+ timeout: number;
11
+ isBind: boolean;
12
+ BSSID: string;
13
+ softAPSSIDPrefix: string;
14
+ }
15
+ declare class NFCConfig extends ConfigBase {
16
+ address: string;
17
+ constructor(ssid: string, bssid: string, password: string, specialProductKeys: string[], specialProductKeySecrets: string[], address: string);
18
+ destroy: () => void;
19
+ configDevice: ({ ssid, password, bssid, address }: configDeviceParams) => Promise<IResult<import("../../types").IRandomCodesResult[]>>;
20
+ setDeviceOnboardingDeploy: ({ timeout, isBind, }: ISetDeviceOnboardingDeployProps) => Promise<IResult<IDevice[]>>;
21
+ }
22
+ export default NFCConfig;
@@ -0,0 +1 @@
1
+ export default function isIncludedCH(str: string): boolean;
@@ -0,0 +1,6 @@
1
+ type T = {
2
+ success: boolean;
3
+ nfcA: any;
4
+ };
5
+ export declare const nfcAConnect: (NFCAdapter: any) => Promise<T>;
6
+ export {};
@@ -0,0 +1,5 @@
1
+ type T = {
2
+ transceiveSuccess: boolean;
3
+ };
4
+ export declare const nfcATransceive: (nfcA: any, buffer: ArrayBuffer) => Promise<T>;
5
+ export {};
@@ -0,0 +1 @@
1
+ export declare const ssIDToASC: (SSID: string) => Uint8Array;
@@ -0,0 +1 @@
1
+ export default function stringToGbk(str: string): Uint8Array;
@@ -0,0 +1,2 @@
1
+ import { IDATA } from './types';
2
+ export declare const transceive: (DATA: IDATA) => void;
@@ -0,0 +1,15 @@
1
+ type PageStateProps = {
2
+ store: {};
3
+ };
4
+ interface WifiInfo {
5
+ SSID: string;
6
+ BSSID: string;
7
+ secure: boolean;
8
+ signalStrength: number;
9
+ frequency: number;
10
+ }
11
+ type IDATA = {
12
+ ArrayBuffer_sign: ArrayBuffer;
13
+ ArrayBuffer_others: ArrayBuffer;
14
+ };
15
+ export { PageStateProps, WifiInfo, IDATA };
package/package.json CHANGED
@@ -1,13 +1,15 @@
1
1
  {
2
2
  "name": "mini_program_gizwits_sdk",
3
- "version": "3.7.1-beta",
3
+ "version": "3.7.1-beta.1",
4
4
  "description": "mini_program_gizwits_sdk",
5
5
  "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "files": ["dist", "README.md", "global.d.ts", "docs"],
6
8
  "scripts": {
7
9
  "test:bssid": "mocha -r ts-node/register tests/bssid/*.spec.ts --timeout 5000",
8
10
  "test": "node_modules/mocha/bin/_mocha -r ts-node/register tests/**/*.spec.ts -file ./tests/setup-wx.js -timeout 60s",
9
11
  "testBle": "node_modules/mocha/bin/_mocha -r ts-node/register tests/utils/randomCode.spec.ts -file ./tests/setup-wx.js -timeout 60s",
10
- "build": "rm -rf ./dist && webpack",
12
+ "build": "rm -rf ./dist && tsc --emitDeclarationOnly && webpack",
11
13
  "release": "npm run build && release-it",
12
14
  "cover": "istanbul cover node_modules/mocha/bin/_mocha -- -r ts-node/register tests/**/*.spec.ts -file ./tests/setup-wx.js -timeout 60s",
13
15
  "coveralls": "npm run cover -- --report lcovonly && cat ./coverage/lcov.info | coveralls"
package/.istanbul.yml DELETED
@@ -1,4 +0,0 @@
1
- instrumentation:
2
- root: . # 执行的根目录
3
- extensions:
4
- - .ts # 检查覆盖率的文件扩张名
package/.travis.yml DELETED
@@ -1,23 +0,0 @@
1
- language: node_js
2
- node_js:
3
- - 10
4
- branches:
5
- only:
6
- - master
7
- install:
8
- - npm install
9
- script:
10
- - npm run test
11
- - npm run build
12
- after_success:
13
- - npm run coveralls
14
- deploy:
15
- provider: npm
16
- email: rbwang@gizwits.com
17
- api_key:
18
- secure: GrkNtVOo77beuB+ZyMWIeXQa2rYJtpstJYBX7aLQlg7Fb/yvlOywIARI+sW4RmvnrIOVYwVwhX24m9Jq2B/IU6ToiH5LNKeqLVeBaZmcYE2ribl3XkImzO6ZJLDEvMA7/cW8ZP6Pqm5rd1H5xHLYrwe6cwyp4S2LH8FF8scf3HVlDLlkpK+umMgep6nMgXSV0GVz0lrHfFEECvEY4UAuS/gZb9bPk8N8WMW8oqIZHP+yJ/floDopAAEJ+iCvl6SdykZjwmIQf0ZI/l6glgEUITGiai3CYkGcoyENm/itQC0y+wtZhjQmKyHI0zznwswnj33DE2kUla0BLu0P2mW78hlHEKwgdpvbZGlPnS94MTZ7qPkDtHwujJz7/oy54AiNR5LWYdUxLby7n495PKO+eJjYa/zuwjMRavLY86bZIsHTzHTjOVutD9IfsbyeAOSGeowuA3sw5n24R7CmG2oDCbGaQznXayWCcnZteJqLmFmY5B15v3QfcOM5dX/QqLUEZOy6l10bXXElnGqsWLs8Te2a6WeT5TmxqAKA+ljPMzcp7E2jIAiLny7EcRN7yxnTXVO8cVJ42MHlFX93TlFNJlWBi663dV2imb6xi2gK6m66OWgH7pfx32l8PhsAtv9mI43ADRWrRd7E5/jy1hgPbar6dDaDK4tR/gtunWh6KgQ=
19
- skip_cleanup: true
20
- on:
21
- branch: master
22
- tag: latest
23
- condition: "$TRAVIS_TAG =~ ^v[0-9]+.[0-9]+.[0-9]+$"
@@ -1,19 +0,0 @@
1
- {
2
- // 使用 IntelliSense 了解相关属性。
3
- // 悬停以查看现有属性的描述。
4
- // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
5
- "version": "0.2.0",
6
- "configurations": [
7
- {
8
- "type": "node",
9
- "request": "launch",
10
- "name": "Mocha Tests",
11
- "url": "http://localhost:8080",
12
- "webRoot": "${workspaceFolder}",
13
- "skipFiles": [
14
- "<node_internals>/**"
15
- ],
16
- "program":"${workspaceFolder}/node_modules/mocha/bin/_mocha -r ts-node/register tests/bleConfig/sdk.ble.spec.ts -file ./tests/setup-wx.js -timeout 60s"
17
- }
18
- ]
19
- }
@@ -1,3 +0,0 @@
1
- {
2
- "mocha.enabled": true
3
- }