@ray-js/api 1.4.33 → 1.4.35

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.
@@ -0,0 +1,16 @@
1
+ export declare const getUiConfig: (productId: any, productConfigTimestamp?: string, productPanelPowerTimestamp?: string) => void;
2
+ export declare const getUserRegion: () => void;
3
+ export declare const getLatestLog: (params: {
4
+ devId: string;
5
+ }) => void;
6
+ export declare const getDeviceInitDate: ({ devId }: {
7
+ devId: string;
8
+ }) => void;
9
+ export declare const getUserInfo: ({ devId, userId }: {
10
+ devId: string;
11
+ userId: string;
12
+ }) => void;
13
+ export declare const remoteOpen: ({ devId, open }: {
14
+ devId: string;
15
+ open: boolean;
16
+ }) => void;
@@ -0,0 +1,77 @@
1
+ // 门锁模版中涉及到的atop接口,暂时封装,后续会根据实际情况进行封装。
2
+ import { THING } from '../constants';
3
+ import requestCloud from '../requestCloud';
4
+
5
+ // 获取云能力
6
+ export const getUiConfig = function (productId) {
7
+ let productConfigTimestamp = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '0';
8
+ let productPanelPowerTimestamp = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '0';
9
+ return requestCloud({
10
+ api: `${THING}.m.app.panel.info.get`,
11
+ version: '2.0',
12
+ data: {
13
+ productId,
14
+ productConfigTimestamp,
15
+ productPanelPowerTimestamp,
16
+ options: 'uiContent,cloudDp,powerCode'
17
+ }
18
+ });
19
+ };
20
+
21
+ // 获取当前帐号所属地区
22
+ export const getUserRegion = () => {
23
+ return requestCloud({
24
+ api: `${THING}.m.user.region.get`,
25
+ version: '1.0',
26
+ data: {}
27
+ });
28
+ };
29
+ export const getLatestLog = params => {
30
+ return requestCloud({
31
+ api: `${THING}.m.device.lock.log.latest`,
32
+ version: '1.0',
33
+ data: {
34
+ devId: params.devId
35
+ }
36
+ });
37
+ };
38
+ export const getDeviceInitDate = _ref => {
39
+ let {
40
+ devId
41
+ } = _ref;
42
+ return requestCloud({
43
+ api: `${THING}.m.device.lock.active.period`,
44
+ version: '1.0',
45
+ data: {
46
+ devId
47
+ }
48
+ });
49
+ };
50
+ export const getUserInfo = _ref2 => {
51
+ let {
52
+ devId,
53
+ userId
54
+ } = _ref2;
55
+ return requestCloud({
56
+ api: `${THING}.m.device.member.panel.get`,
57
+ version: '1.0',
58
+ data: {
59
+ devId: devId,
60
+ userId: userId
61
+ }
62
+ });
63
+ };
64
+ export const remoteOpen = _ref3 => {
65
+ let {
66
+ devId,
67
+ open
68
+ } = _ref3;
69
+ return requestCloud({
70
+ api: `${THING}.m.zigbee.lock.remotepwd.execute`,
71
+ version: '1.0',
72
+ data: {
73
+ devId: devId,
74
+ open
75
+ }
76
+ });
77
+ };
@@ -4,3 +4,4 @@ export * from './alarm';
4
4
  export * from './statistic';
5
5
  export * from './device';
6
6
  export * from './linkage';
7
+ export * from './doorlock';
@@ -3,4 +3,7 @@ export * from './timer';
3
3
  export * from './alarm';
4
4
  export * from './statistic';
5
5
  export * from './device';
6
- export * from './linkage';
6
+ export * from './linkage';
7
+
8
+ // 仅用于门锁模版,在门锁未OpenAPI时使用。
9
+ export * from './doorlock';
@@ -4,7 +4,6 @@ const _excluded = ["success", "fail", "complete"],
4
4
  _excluded3 = ["success", "fail", "complete"],
5
5
  _excluded4 = ["success", "fail", "complete"],
6
6
  _excluded5 = ["success", "fail", "complete"];
7
- import { isAndroid } from '@ray-js/env';
8
7
  import { stringifyUrl } from '../utils';
9
8
  export function openSceneCreate(params) {
10
9
  const _ref = params || {},
@@ -45,7 +44,7 @@ export function openUniversalCreateScene(params) {
45
44
  complete
46
45
  } = _ref2,
47
46
  rest = _objectWithoutProperties(_ref2, _excluded2);
48
- const url = isAndroid ? 'createSmartScene' : 'createScene';
47
+ const url = ty.getSystemInfoSync().platform === 'android' ? 'createSmartScene' : 'createScene';
49
48
  return new Promise((resolve, reject) => {
50
49
  ty.router({
51
50
  url: stringifyUrl({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/api",
3
- "version": "1.4.33",
3
+ "version": "1.4.35",
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",
33
- "@ray-js/router": "1.4.33",
32
+ "@ray-js/framework": "1.4.35",
33
+ "@ray-js/router": "1.4.35",
34
34
  "@ray-js/wechat": "^0.0.33",
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.33",
39
+ "@ray-js/cli": "1.4.35",
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": "04fc26f4934f4deef7a711d9a9ade026ec265eca"
49
+ "gitHead": "32c9788fbddcdf7e998b217999ba79b0f4d1d120"
50
50
  }