@ray-js/api 1.4.56 → 1.4.57
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/BaseKit-3.3.10.js +2 -1
- package/lib/BizKit-3.2.7.js +2 -1
- package/lib/DeviceKit-3.3.1.js +2 -1
- package/lib/HomeKit-3.1.4.js +2 -1
- package/lib/MapKit-3.4.13.js +2 -1
- package/lib/MiniKit-3.1.0.js +2 -1
- package/lib/OutdoorKit-1.0.4.js +2 -1
- package/lib/P2PKit-2.0.3.js +2 -1
- package/lib/PlayNetKit-1.1.3.js +2 -1
- package/lib/constants.js +1 -1
- package/lib/nativeRouters/playnet.d.ts +23 -0
- package/lib/nativeRouters/playnet.js +27 -0
- package/lib/utils.d.ts +2 -1
- package/lib/utils.js +30 -8
- package/lib/viewAPI.js +2 -2
- package/package.json +5 -5
package/lib/BaseKit-3.3.10.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
/// <reference path="../@types/BaseKit.d.ts" />
|
2
2
|
|
3
|
-
import {
|
3
|
+
import { createFactory } from './utils';
|
4
|
+
const factory = createFactory('BaseKit');
|
4
5
|
export const stopAccelerometer = factory('stopAccelerometer');
|
5
6
|
export const startAccelerometer = factory('startAccelerometer');
|
6
7
|
export const getAudioFileDuration = factory('getAudioFileDuration');
|
package/lib/BizKit-3.2.7.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
/// <reference path="../@types/BizKit.d.ts" />
|
2
2
|
|
3
|
-
import {
|
3
|
+
import { createFactory } from './utils';
|
4
|
+
const factory = createFactory('BizKit');
|
4
5
|
export const apiRequestByAtop = factory('apiRequestByAtop');
|
5
6
|
export const event = factory('event');
|
6
7
|
export const beginEvent = factory('beginEvent');
|
package/lib/DeviceKit-3.3.1.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
/// <reference path="../@types/DeviceKit.d.ts" />
|
2
2
|
|
3
|
-
import {
|
3
|
+
import { createFactory } from './utils';
|
4
|
+
const factory = createFactory('DeviceKit');
|
4
5
|
export const unregisterLeaveBeaconFenceEvent = factory('unregisterLeaveBeaconFenceEvent', {
|
5
6
|
"namespace": "device"
|
6
7
|
});
|
package/lib/HomeKit-3.1.4.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
/// <reference path="../@types/HomeKit.d.ts" />
|
2
2
|
|
3
|
-
import {
|
3
|
+
import { createFactory } from './utils';
|
4
|
+
const factory = createFactory('HomeKit');
|
4
5
|
export const home = {
|
5
6
|
getCurrentHomeInfo: factory('getCurrentHomeInfo', {
|
6
7
|
"namespace": "home"
|
package/lib/MapKit-3.4.13.js
CHANGED
package/lib/MiniKit-3.1.0.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
/// <reference path="../@types/MiniKit.d.ts" />
|
2
2
|
|
3
|
-
import {
|
3
|
+
import { createFactory } from './utils';
|
4
|
+
const factory = createFactory('MiniKit');
|
4
5
|
export const nativeDisabled = factory('nativeDisabled');
|
5
6
|
export const nativeInovke = factory('nativeInovke');
|
6
7
|
export const getPermissionConfig = factory('getPermissionConfig');
|
package/lib/OutdoorKit-1.0.4.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
/// <reference path="../@types/OutdoorKit.d.ts" />
|
2
2
|
|
3
|
-
import {
|
3
|
+
import { createFactory } from './utils';
|
4
|
+
const factory = createFactory('OutdoorKit');
|
4
5
|
export const outdoor = {
|
5
6
|
bindSlaveDevice: factory('bindSlaveDevice', {
|
6
7
|
"namespace": "outdoor"
|
package/lib/P2PKit-2.0.3.js
CHANGED
package/lib/PlayNetKit-1.1.3.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
/// <reference path="../@types/PlayNetKit.d.ts" />
|
2
2
|
|
3
|
-
import {
|
3
|
+
import { createFactory } from './utils';
|
4
|
+
const factory = createFactory('PlayNetKit');
|
4
5
|
export const playnet = {
|
5
6
|
autoConnectToAp: factory('autoConnectToAp', {
|
6
7
|
"namespace": "playnet"
|
package/lib/constants.js
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
import { ICommon } from './common';
|
2
|
+
type GwIdParams = {
|
3
|
+
gwId?: string;
|
4
|
+
} & ICommon;
|
5
|
+
/**
|
6
|
+
* 打开 ZigBee 网关面板配网子设备(旧版)
|
7
|
+
* @param params { gwId?: string }
|
8
|
+
* @returns
|
9
|
+
*/
|
10
|
+
export declare function openPresentGatewayCategroy(params?: GwIdParams): Promise<void>;
|
11
|
+
/**
|
12
|
+
* 打开网关面板配网子设备 - 搜索配网(新版)
|
13
|
+
* @param params { gwId?: string }
|
14
|
+
* @returns
|
15
|
+
*/
|
16
|
+
export declare function openDeviceOnlySearchConfigGwSub(params?: GwIdParams): Promise<void>;
|
17
|
+
/**
|
18
|
+
* 打开网关面板配网子设备 - 配网帮助列表(新版)
|
19
|
+
* @param params { gwId?: string }
|
20
|
+
* @returns
|
21
|
+
*/
|
22
|
+
export declare function openDeviceGWSubDeviceHelpList(params?: GwIdParams): Promise<void>;
|
23
|
+
export {};
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { nativeRouter } from './common';
|
2
|
+
/**
|
3
|
+
* 打开 ZigBee 网关面板配网子设备(旧版)
|
4
|
+
* @param params { gwId?: string }
|
5
|
+
* @returns
|
6
|
+
*/
|
7
|
+
export function openPresentGatewayCategroy(params) {
|
8
|
+
return nativeRouter('presentGatewayCategroy', params);
|
9
|
+
}
|
10
|
+
|
11
|
+
/**
|
12
|
+
* 打开网关面板配网子设备 - 搜索配网(新版)
|
13
|
+
* @param params { gwId?: string }
|
14
|
+
* @returns
|
15
|
+
*/
|
16
|
+
export function openDeviceOnlySearchConfigGwSub(params) {
|
17
|
+
return nativeRouter('device_only_search_config_gw_sub', params);
|
18
|
+
}
|
19
|
+
|
20
|
+
/**
|
21
|
+
* 打开网关面板配网子设备 - 配网帮助列表(新版)
|
22
|
+
* @param params { gwId?: string }
|
23
|
+
* @returns
|
24
|
+
*/
|
25
|
+
export function openDeviceGWSubDeviceHelpList(params) {
|
26
|
+
return nativeRouter('device_gw_sub_device_help_list', params);
|
27
|
+
}
|
package/lib/utils.d.ts
CHANGED
@@ -3,8 +3,9 @@ type Opts = {
|
|
3
3
|
deprecated?: boolean;
|
4
4
|
namespace?: string;
|
5
5
|
};
|
6
|
+
export declare function createFactory(kitName: string): (name: string, opts?: Opts) => () => any;
|
6
7
|
export declare function factory(name: string, opts?: Opts): () => any;
|
7
|
-
export declare function
|
8
|
+
export declare function factoryConstants(name: string, opts?: Opts): any;
|
8
9
|
export declare const parseUrl: (url: string) => import("query-string").ParsedUrl;
|
9
10
|
export declare const stringifyUrl: (object: UrlObject) => string;
|
10
11
|
export {};
|
package/lib/utils.js
CHANGED
@@ -1,29 +1,51 @@
|
|
1
|
-
import {
|
1
|
+
import { parseUrl as _parseUrl, stringifyUrl as _stringifyUrl } from 'query-string';
|
2
|
+
export function createFactory(kitName) {
|
3
|
+
return function (name) {
|
4
|
+
let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
5
|
+
return function () {
|
6
|
+
var _inst$opts$namespace;
|
7
|
+
const methodName = "ty.".concat(opts.namespace ? opts.namespace + '.' : '').concat(name);
|
8
|
+
if (opts.deprecated) {
|
9
|
+
console.warn("\"".concat(methodName, "\" method has been deprecated."));
|
10
|
+
}
|
11
|
+
const inst = typeof ty === 'undefined' ? {} : ty;
|
12
|
+
const method = opts.namespace ? ((_inst$opts$namespace = inst[opts.namespace]) !== null && _inst$opts$namespace !== void 0 ? _inst$opts$namespace : {})[name] : inst[name];
|
13
|
+
if (!method) {
|
14
|
+
console.warn('tips:', "\"".concat(methodName, "\" method not exits."));
|
15
|
+
console.warn('tips:', "Please check kit \"".concat(kitName, "\" dependency is enabled."));
|
16
|
+
return;
|
17
|
+
}
|
18
|
+
// eslint-disable-next-line prefer-rest-params
|
19
|
+
return method.apply(this, arguments);
|
20
|
+
};
|
21
|
+
};
|
22
|
+
}
|
2
23
|
export function factory(name) {
|
3
24
|
let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
4
25
|
return function () {
|
5
|
-
var _inst$opts$
|
26
|
+
var _inst$opts$namespace2;
|
27
|
+
const methodName = "ty.".concat(opts.namespace ? opts.namespace + '.' : '').concat(name);
|
6
28
|
if (opts.deprecated) {
|
7
|
-
console.warn("\
|
29
|
+
console.warn("\"".concat(methodName, "\" method has been deprecated."));
|
8
30
|
}
|
9
31
|
const inst = typeof ty === 'undefined' ? {} : ty;
|
10
|
-
const method = opts.namespace ? ((_inst$opts$
|
32
|
+
const method = opts.namespace ? ((_inst$opts$namespace2 = inst[opts.namespace]) !== null && _inst$opts$namespace2 !== void 0 ? _inst$opts$namespace2 : {})[name] : inst[name];
|
11
33
|
if (!method) {
|
12
|
-
console.warn("
|
34
|
+
console.warn('tips:', "\"".concat(methodName, "\" method not exits."));
|
13
35
|
return;
|
14
36
|
}
|
15
37
|
// eslint-disable-next-line prefer-rest-params
|
16
38
|
return method.apply(this, arguments);
|
17
39
|
};
|
18
40
|
}
|
19
|
-
export function
|
41
|
+
export function factoryConstants(name) {
|
20
42
|
let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
21
43
|
if (opts.deprecated) {
|
22
|
-
console.warn("\
|
44
|
+
console.warn("\"ty.".concat(name, "\" constant has been deprecated."));
|
23
45
|
}
|
24
46
|
const inst = typeof ty === 'undefined' ? {} : ty;
|
25
47
|
if (!inst[name]) {
|
26
|
-
console.warn("
|
48
|
+
console.warn('tips', "\"ty.".concat(name, "\" constant not exits."));
|
27
49
|
return;
|
28
50
|
}
|
29
51
|
return inst[name];
|
package/lib/viewAPI.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
/// <reference path="../@types/api.d.ts" />
|
2
2
|
|
3
|
-
import { factory,
|
4
|
-
export const env =
|
3
|
+
import { factory, factoryConstants } from './utils';
|
4
|
+
export const env = factoryConstants('env');
|
5
5
|
export const createAnimation = factory('createAnimation');
|
6
6
|
export const pageScrollTo = factory('pageScrollTo');
|
7
7
|
export const createSelectorQuery = factory('createSelectorQuery');
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ray-js/api",
|
3
|
-
"version": "1.4.
|
3
|
+
"version": "1.4.57",
|
4
4
|
"description": "Ray universal api",
|
5
5
|
"keywords": [
|
6
6
|
"ray"
|
@@ -29,14 +29,14 @@
|
|
29
29
|
"watch": "ray start --type=component"
|
30
30
|
},
|
31
31
|
"dependencies": {
|
32
|
-
"@ray-js/framework": "1.4.
|
33
|
-
"@ray-js/router": "1.4.
|
32
|
+
"@ray-js/framework": "1.4.57",
|
33
|
+
"@ray-js/router": "1.4.57",
|
34
34
|
"@ray-js/wechat": "^0.2.8",
|
35
35
|
"base64-browser": "^1.0.1",
|
36
36
|
"query-string": "^7.1.3"
|
37
37
|
},
|
38
38
|
"devDependencies": {
|
39
|
-
"@ray-js/cli": "1.4.
|
39
|
+
"@ray-js/cli": "1.4.57",
|
40
40
|
"art-template": "^4.13.2",
|
41
41
|
"fs-extra": "^10.1.0",
|
42
42
|
"miniprogram-api-typings": "^3.12.2",
|
@@ -46,5 +46,5 @@
|
|
46
46
|
"access": "public",
|
47
47
|
"registry": "https://registry.npmjs.org"
|
48
48
|
},
|
49
|
-
"gitHead": "
|
49
|
+
"gitHead": "fd1b5fa91e00c6b215fc941d3afd0708eeed6566"
|
50
50
|
}
|