@ray-js/api 1.5.40 → 1.5.41
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.
- package/lib/BaseKit-3.14.3.d.ts +0 -1
- package/lib/BizKit-4.10.4.d.ts +0 -1
- package/lib/DeviceKit-4.9.0.d.ts +0 -1
- package/lib/HomeKit-3.1.4.d.ts +0 -1
- package/lib/MapKit-3.4.13.d.ts +0 -1
- package/lib/MiniKit-3.12.1.d.ts +0 -1
- package/lib/OutdoorKit-1.0.4.d.ts +0 -1
- package/lib/P2PKit-2.0.3.d.ts +0 -1
- package/lib/PlayNetKit-1.1.3.d.ts +24 -24
- package/lib/cloud/alarm.js +2 -2
- package/lib/cloud/core.js +1 -1
- package/lib/cloud/device.js +7 -7
- package/lib/cloud/doorlock/auth.js +8 -8
- package/lib/cloud/doorlock/device.js +7 -7
- package/lib/cloud/doorlock/log.js +4 -4
- package/lib/cloud/doorlock/member-opmode.js +7 -7
- package/lib/cloud/doorlock/member.js +7 -7
- package/lib/cloud/doorlock/offline-pwd.js +4 -4
- package/lib/cloud/doorlock/old.js +6 -6
- package/lib/cloud/doorlock/temp-pwd.js +8 -8
- package/lib/cloud/doorlock/unlock-method.js +3 -3
- package/lib/cloud/doorlock/unlock.js +5 -5
- package/lib/cloud/linkage.js +17 -17
- package/lib/cloud/outdoor.js +1 -1
- package/lib/cloud/recipe/basket.js +10 -10
- package/lib/cloud/recipe/category-list.js +2 -2
- package/lib/cloud/recipe/custom.js +4 -4
- package/lib/cloud/recipe/menu.js +3 -3
- package/lib/cloud/recipe/query.js +3 -3
- package/lib/cloud/recipe/record.js +3 -3
- package/lib/cloud/recipe/score.js +3 -3
- package/lib/cloud/recipe/star.js +5 -5
- package/lib/cloud/remoteGroup.js +2 -2
- package/lib/cloud/statistic.js +9 -9
- package/lib/cloud/timer.js +14 -14
- package/lib/getElementById/index.thing.js +1 -1
- package/lib/getElementById/index.wechat.js +1 -1
- package/lib/hideTabBar/index.d.ts +4 -5
- package/lib/index.d.ts +0 -1
- package/lib/navigateBack/index.d.ts +0 -1
- package/lib/navigateTo/index.d.ts +0 -1
- package/lib/panel/devInfo/index.js +2 -0
- package/lib/panel/i18n/index.js +13 -13
- package/lib/panel/i18n/index.wechat.js +13 -13
- package/lib/panel/publishDps.js +3 -1
- package/lib/reLaunch/index.d.ts +0 -1
- package/lib/redirectTo/index.d.ts +0 -1
- package/lib/redirectTo/index.js +0 -1
- package/lib/requestCloud/index.d.ts +0 -1
- package/lib/setNavigationBarColor/index.d.ts +0 -1
- package/lib/setNavigationBarTitle/index.d.ts +0 -1
- package/lib/showTabBar/index.d.ts +4 -5
- package/lib/switchTab/index.d.ts +0 -1
- package/lib/utils.js +9 -9
- package/lib/utils.wechat.js +5 -5
- package/lib/viewAPI.d.ts +0 -1
- package/package.json +7 -7
package/lib/cloud/timer.js
CHANGED
@@ -15,7 +15,7 @@ import { THING } from '../constants';
|
|
15
15
|
*/
|
16
16
|
const addSingleTimer = params => {
|
17
17
|
return requestCloud({
|
18
|
-
api:
|
18
|
+
api: `${THING}.m.clock.dps.add`,
|
19
19
|
version: '1.0',
|
20
20
|
data: _objectSpread({}, params)
|
21
21
|
});
|
@@ -29,7 +29,7 @@ const addSingleTimer = params => {
|
|
29
29
|
*/
|
30
30
|
const queryTimerTasks = params => {
|
31
31
|
return requestCloud({
|
32
|
-
api:
|
32
|
+
api: `${THING}.m.clock.dps.list`,
|
33
33
|
version: '1.0',
|
34
34
|
data: _objectSpread({}, params)
|
35
35
|
});
|
@@ -48,7 +48,7 @@ const queryTimerTasks = params => {
|
|
48
48
|
*/
|
49
49
|
const modifySingleTimer = params => {
|
50
50
|
return requestCloud({
|
51
|
-
api:
|
51
|
+
api: `${THING}.m.clock.dps.update`,
|
52
52
|
version: '1.0',
|
53
53
|
data: _objectSpread({}, params)
|
54
54
|
});
|
@@ -67,7 +67,7 @@ const modifySingleTimer = params => {
|
|
67
67
|
*/
|
68
68
|
const addGroupTimer = params => {
|
69
69
|
return requestCloud({
|
70
|
-
api:
|
70
|
+
api: `${THING}.m.clock.dps.group.add`,
|
71
71
|
version: '1.0',
|
72
72
|
data: _objectSpread({}, params)
|
73
73
|
});
|
@@ -81,7 +81,7 @@ const addGroupTimer = params => {
|
|
81
81
|
*/
|
82
82
|
const queryGroupTimerTasks = params => {
|
83
83
|
return requestCloud({
|
84
|
-
api:
|
84
|
+
api: `${THING}.m.clock.dps.group.list`,
|
85
85
|
version: '1.0',
|
86
86
|
data: _objectSpread({}, params)
|
87
87
|
});
|
@@ -99,7 +99,7 @@ const queryGroupTimerTasks = params => {
|
|
99
99
|
*/
|
100
100
|
const modifyGroupTimer = params => {
|
101
101
|
return requestCloud({
|
102
|
-
api:
|
102
|
+
api: `${THING}.m.clock.dps.group.update`,
|
103
103
|
version: '1.0',
|
104
104
|
data: _objectSpread({}, params)
|
105
105
|
});
|
@@ -114,7 +114,7 @@ const modifyGroupTimer = params => {
|
|
114
114
|
*/
|
115
115
|
const modDeleteTaskByIds = params => {
|
116
116
|
return requestCloud({
|
117
|
-
api:
|
117
|
+
api: `${THING}.m.clock.batch.status.update`,
|
118
118
|
version: '1.0',
|
119
119
|
data: _objectSpread({}, params)
|
120
120
|
});
|
@@ -129,7 +129,7 @@ const modDeleteTaskByIds = params => {
|
|
129
129
|
*/
|
130
130
|
const modDeleteTaskByCategory = params => {
|
131
131
|
return requestCloud({
|
132
|
-
api:
|
132
|
+
api: `${THING}.m.clock.category.status.update`,
|
133
133
|
version: '1.0',
|
134
134
|
data: _objectSpread({}, params)
|
135
135
|
});
|
@@ -170,7 +170,7 @@ const getDpsLastTimer = params => {
|
|
170
170
|
*/
|
171
171
|
const getLastTimerPeriod = params => {
|
172
172
|
return requestCloud({
|
173
|
-
api:
|
173
|
+
api: `${THING}.m.timer.nearest.get`,
|
174
174
|
version: '1.0',
|
175
175
|
data: _objectSpread({}, params)
|
176
176
|
});
|
@@ -181,7 +181,7 @@ const getLastTimerPeriod = params => {
|
|
181
181
|
*/
|
182
182
|
const getAstronomicalList = params => {
|
183
183
|
return requestCloud({
|
184
|
-
api:
|
184
|
+
api: `${THING}.m.timer.astronomical.list`,
|
185
185
|
version: '1.0',
|
186
186
|
data: _objectSpread({}, params)
|
187
187
|
});
|
@@ -203,7 +203,7 @@ const getAstronomicalList = params => {
|
|
203
203
|
*/
|
204
204
|
const addAstronomical = params => {
|
205
205
|
return requestCloud({
|
206
|
-
api:
|
206
|
+
api: `${THING}.m.timer.astronomical.add`,
|
207
207
|
version: '1.0',
|
208
208
|
data: _objectSpread({}, params)
|
209
209
|
});
|
@@ -225,7 +225,7 @@ const addAstronomical = params => {
|
|
225
225
|
*/
|
226
226
|
const updateAstronomical = params => {
|
227
227
|
return requestCloud({
|
228
|
-
api:
|
228
|
+
api: `${THING}.m.timer.astronomical.update`,
|
229
229
|
version: '1.0',
|
230
230
|
data: _objectSpread({}, params)
|
231
231
|
});
|
@@ -238,7 +238,7 @@ const updateAstronomical = params => {
|
|
238
238
|
*/
|
239
239
|
const updateAstronomicalStatus = params => {
|
240
240
|
return requestCloud({
|
241
|
-
api:
|
241
|
+
api: `${THING}.m.timer.astronomical.status.update`,
|
242
242
|
version: '1.0',
|
243
243
|
data: _objectSpread({}, params)
|
244
244
|
});
|
@@ -250,7 +250,7 @@ const updateAstronomicalStatus = params => {
|
|
250
250
|
*/
|
251
251
|
const removeAstronomical = params => {
|
252
252
|
return requestCloud({
|
253
|
-
api:
|
253
|
+
api: `${THING}.m.timer.astronomical.remove`,
|
254
254
|
version: '1.0',
|
255
255
|
data: _objectSpread({}, params)
|
256
256
|
});
|
@@ -1,9 +1,8 @@
|
|
1
|
-
/// <reference path="../../@types/api.d.ts" />
|
2
1
|
declare const _default: (arg?: {
|
3
|
-
animation?: boolean
|
2
|
+
animation?: boolean;
|
4
3
|
} & {
|
5
|
-
success?: (
|
6
|
-
fail?: (
|
7
|
-
complete?: (
|
4
|
+
success?: (S?: any) => void;
|
5
|
+
fail?: (F?: any) => void;
|
6
|
+
complete?: (C?: any) => void;
|
8
7
|
} & import("../core").PromisifyArgs<any, any>) => Promise<any>;
|
9
8
|
export default _default;
|
package/lib/index.d.ts
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
|
+
import "core-js/modules/esnext.iterator.constructor.js";
|
3
|
+
import "core-js/modules/esnext.iterator.for-each.js";
|
2
4
|
import { getDeviceInfo, getLaunchOptionsSync, getGroupInfo, registerDeviceListListener, registerGroupChange, exitMiniProgram, subscribeDeviceRemoved, onDeviceRemoved } from '../../all-kits';
|
3
5
|
import { useEffect } from 'react';
|
4
6
|
import getApp from '../../getApp';
|
package/lib/panel/i18n/index.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import "core-js/modules/
|
1
|
+
import "core-js/modules/esnext.iterator.map.js";
|
2
2
|
import { requestCloud, getSystemInfoSync, THING } from '../..';
|
3
3
|
import { getBitValue } from '../utils';
|
4
4
|
|
@@ -26,7 +26,7 @@ export default class I18N {
|
|
26
26
|
}
|
27
27
|
forceUpdateNetworkLang(productId) {
|
28
28
|
requestCloud({
|
29
|
-
api:
|
29
|
+
api: `${THING}.m.i18n.get`,
|
30
30
|
version: '1.0',
|
31
31
|
data: {
|
32
32
|
productId,
|
@@ -117,14 +117,14 @@ export default class I18N {
|
|
117
117
|
formatString(str) {
|
118
118
|
let res = str;
|
119
119
|
for (let i = 0; i < (arguments.length <= 1 ? 0 : arguments.length - 1); i++) {
|
120
|
-
res = this._replaceAll(
|
120
|
+
res = this._replaceAll(`{${i}}`, i + 1 < 1 || arguments.length <= i + 1 ? undefined : arguments[i + 1], res);
|
121
121
|
}
|
122
122
|
return res;
|
123
123
|
}
|
124
124
|
formatValue(key) {
|
125
125
|
let res = this.getLang(key);
|
126
126
|
for (let i = 0; i < (arguments.length <= 1 ? 0 : arguments.length - 1); i++) {
|
127
|
-
res = this._replaceAll(
|
127
|
+
res = this._replaceAll(`{${i}}`, i + 1 < 1 || arguments.length <= i + 1 ? undefined : arguments[i + 1], res);
|
128
128
|
}
|
129
129
|
return res;
|
130
130
|
}
|
@@ -137,17 +137,17 @@ export default class I18N {
|
|
137
137
|
getDpLang(code, value) {
|
138
138
|
let key;
|
139
139
|
if (typeof value === 'undefined') {
|
140
|
-
key =
|
140
|
+
key = `dp_${code}`.toLowerCase();
|
141
141
|
} else if (typeof value === 'boolean') {
|
142
142
|
const valStr = value ? 'on' : 'off';
|
143
|
-
key =
|
143
|
+
key = `dp_${code}_${valStr}`.toLowerCase();
|
144
144
|
} else {
|
145
|
-
key =
|
145
|
+
key = `dp_${code}_${value}`.toLowerCase();
|
146
146
|
}
|
147
147
|
return hasKey(key) ? I18n.t(key) : typeof this[key] !== 'undefined' ? this[key] : I18n.t(key);
|
148
148
|
}
|
149
149
|
getDpName(code, defaultName) {
|
150
|
-
const key =
|
150
|
+
const key = `dp_${code}`.toLowerCase();
|
151
151
|
return hasKey(key) ? I18n.t(key) : typeof this[key] !== 'undefined' ? this[key] : defaultName;
|
152
152
|
}
|
153
153
|
getDpsLang(key) {
|
@@ -179,7 +179,7 @@ export default class I18N {
|
|
179
179
|
if (typeof schema === 'undefined') return result;
|
180
180
|
const lists = schema.range;
|
181
181
|
lists.map(v => {
|
182
|
-
const key =
|
182
|
+
const key = `dp_${dpCode}_${v}`.toLowerCase();
|
183
183
|
result[v] = hasKey(key) ? I18n.t(key) : typeof this[key] !== 'undefined' ? this[key] : I18n.t(key);
|
184
184
|
return null;
|
185
185
|
});
|
@@ -193,12 +193,12 @@ export default class I18N {
|
|
193
193
|
* @param {*} power 设备当前的开关状态 (如果当前设备为开启状态, 则倒计时显示为关闭)
|
194
194
|
*/
|
195
195
|
parseCountdown(t, power) {
|
196
|
-
const h = parseFloat(
|
197
|
-
const m = parseFloat(
|
196
|
+
const h = parseFloat(`${t / 3600}`);
|
197
|
+
const m = parseFloat(`${t / 60 - h * 60}`);
|
198
198
|
const tHour = hasKey('t_hour') ? I18n.t('t_hour') : typeof this.t_hour !== 'undefined' ? this.t_hour : I18n.t('t_hour');
|
199
199
|
const tMinute = hasKey('t_minute') ? I18n.t('t_minute') : typeof this.t_minute !== 'undefined' ? this.t_minute : I18n.t('t_minute');
|
200
|
-
const time = h >= 1.0 ?
|
201
|
-
const key =
|
200
|
+
const time = h >= 1.0 ? `${Math.round(h)}${tHour}` : `${Math.round(m)}${tMinute}`;
|
201
|
+
const key = `countdown_${power ? 'on' : 'off'}`;
|
202
202
|
const str = hasKey(key) ? I18n.t(key) : typeof this[key] !== 'undefined' ? this[key] : I18n.t(key);
|
203
203
|
return this.formatString(str, time);
|
204
204
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import "core-js/modules/
|
1
|
+
import "core-js/modules/esnext.iterator.map.js";
|
2
2
|
import { requestCloud, getSystemInfoSync, THING } from '../..';
|
3
3
|
import { getBitValue } from '../utils';
|
4
4
|
|
@@ -16,7 +16,7 @@ export default class I18N {
|
|
16
16
|
}
|
17
17
|
forceUpdateNetworkLang(productId) {
|
18
18
|
requestCloud({
|
19
|
-
api:
|
19
|
+
api: `${THING}.m.i18n.get`,
|
20
20
|
version: '1.0',
|
21
21
|
data: {
|
22
22
|
productId,
|
@@ -107,14 +107,14 @@ export default class I18N {
|
|
107
107
|
formatString(str) {
|
108
108
|
let res = str;
|
109
109
|
for (let i = 0; i < (arguments.length <= 1 ? 0 : arguments.length - 1); i++) {
|
110
|
-
res = this._replaceAll(
|
110
|
+
res = this._replaceAll(`{${i}}`, i + 1 < 1 || arguments.length <= i + 1 ? undefined : arguments[i + 1], res);
|
111
111
|
}
|
112
112
|
return res;
|
113
113
|
}
|
114
114
|
formatValue(key) {
|
115
115
|
let res = typeof this[key] !== 'undefined' ? this[key] : I18n.t(key);
|
116
116
|
for (let i = 0; i < (arguments.length <= 1 ? 0 : arguments.length - 1); i++) {
|
117
|
-
res = this._replaceAll(
|
117
|
+
res = this._replaceAll(`{${i}}`, i + 1 < 1 || arguments.length <= i + 1 ? undefined : arguments[i + 1], res);
|
118
118
|
}
|
119
119
|
return res;
|
120
120
|
}
|
@@ -127,17 +127,17 @@ export default class I18N {
|
|
127
127
|
getDpLang(code, value) {
|
128
128
|
let key;
|
129
129
|
if (typeof value === 'undefined') {
|
130
|
-
key =
|
130
|
+
key = `dp_${code}`.toLowerCase();
|
131
131
|
} else if (typeof value === 'boolean') {
|
132
132
|
const valStr = value ? 'on' : 'off';
|
133
|
-
key =
|
133
|
+
key = `dp_${code}_${valStr}`.toLowerCase();
|
134
134
|
} else {
|
135
|
-
key =
|
135
|
+
key = `dp_${code}_${value}`.toLowerCase();
|
136
136
|
}
|
137
137
|
return I18n.t(key) !== key ? I18n.t(key) : typeof this[key] !== 'undefined' ? this[key] : I18n.t(key);
|
138
138
|
}
|
139
139
|
getDpName(code, defaultName) {
|
140
|
-
const key =
|
140
|
+
const key = `dp_${code}`.toLowerCase();
|
141
141
|
return I18n.t(key) !== key ? I18n.t(key) : typeof this[key] !== 'undefined' ? this[key] : defaultName;
|
142
142
|
}
|
143
143
|
getDpsLang(key) {
|
@@ -169,7 +169,7 @@ export default class I18N {
|
|
169
169
|
if (typeof schema === 'undefined') return result;
|
170
170
|
const lists = schema.range;
|
171
171
|
lists.map(v => {
|
172
|
-
const key =
|
172
|
+
const key = `dp_${dpCode}_${v}`.toLowerCase();
|
173
173
|
result[v] = I18n.t(key) !== key ? I18n.t(key) : typeof this[key] !== 'undefined' ? this[key] : I18n.t(key);
|
174
174
|
return null;
|
175
175
|
});
|
@@ -183,12 +183,12 @@ export default class I18N {
|
|
183
183
|
* @param {*} power 设备当前的开关状态 (如果当前设备为开启状态, 则倒计时显示为关闭)
|
184
184
|
*/
|
185
185
|
parseCountdown(t, power) {
|
186
|
-
const h = parseFloat(
|
187
|
-
const m = parseFloat(
|
186
|
+
const h = parseFloat(`${t / 3600}`);
|
187
|
+
const m = parseFloat(`${t / 60 - h * 60}`);
|
188
188
|
const tHour = I18n.t('t_hour') !== 't_hour' ? I18n.t('t_hour') : typeof this.t_hour !== 'undefined' ? this.t_hour : I18n.t('t_hour');
|
189
189
|
const tMinute = I18n.t('t_minute') !== 't_minute' ? I18n.t('t_minute') : typeof this.t_minute !== 'undefined' ? this.t_minute : I18n.t('t_minute');
|
190
|
-
const time = h >= 1.0 ?
|
191
|
-
const key =
|
190
|
+
const time = h >= 1.0 ? `${Math.round(h)}${tHour}` : `${Math.round(m)}${tMinute}`;
|
191
|
+
const key = `countdown_${power ? 'on' : 'off'}`;
|
192
192
|
const str = I18n.t(key) !== key ? I18n.t(key) : typeof this[key] !== 'undefined' ? this[key] : I18n.t(key);
|
193
193
|
return this.formatString(str, time);
|
194
194
|
}
|
package/lib/panel/publishDps.js
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
|
+
import "core-js/modules/esnext.iterator.constructor.js";
|
3
|
+
import "core-js/modules/esnext.iterator.for-each.js";
|
2
4
|
import { publishDpsBase } from '../..';
|
3
5
|
import { getDevInfo } from './devInfo';
|
4
6
|
const DEFAULT_OPTIONS = {
|
@@ -25,7 +27,7 @@ export function sendDps(data) {
|
|
25
27
|
const codeIds = (devInfo === null || devInfo === void 0 ? void 0 : devInfo.codeIds) || {};
|
26
28
|
Object.keys(data).forEach(code => {
|
27
29
|
if (codeIds[code] !== undefined) {
|
28
|
-
dps[
|
30
|
+
dps[`${codeIds[code]}`] = data[code];
|
29
31
|
} else {
|
30
32
|
dps[code] = data[code];
|
31
33
|
}
|
package/lib/reLaunch/index.d.ts
CHANGED
package/lib/redirectTo/index.js
CHANGED
@@ -1,9 +1,8 @@
|
|
1
|
-
/// <reference path="../../@types/api.d.ts" />
|
2
1
|
declare const _default: (arg?: {
|
3
|
-
animation?: boolean
|
2
|
+
animation?: boolean;
|
4
3
|
} & {
|
5
|
-
success?: (
|
6
|
-
fail?: (
|
7
|
-
complete?: (
|
4
|
+
success?: (S?: any) => void;
|
5
|
+
fail?: (F?: any) => void;
|
6
|
+
complete?: (C?: any) => void;
|
8
7
|
} & import("../core").PromisifyArgs<any, any>) => Promise<any>;
|
9
8
|
export default _default;
|
package/lib/switchTab/index.d.ts
CHANGED
package/lib/utils.js
CHANGED
@@ -4,15 +4,15 @@ export function createFactory(kitName) {
|
|
4
4
|
let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
5
5
|
return function () {
|
6
6
|
var _inst$opts$namespace;
|
7
|
-
const methodName =
|
7
|
+
const methodName = `ty.${opts.namespace ? opts.namespace + '.' : ''}${name}`;
|
8
8
|
if (opts.deprecated) {
|
9
|
-
console.warn("
|
9
|
+
console.warn(`"${methodName}" method has been deprecated.`);
|
10
10
|
}
|
11
11
|
const inst = typeof ty === 'undefined' ? {} : ty;
|
12
12
|
const method = opts.namespace ? ((_inst$opts$namespace = inst[opts.namespace]) !== null && _inst$opts$namespace !== void 0 ? _inst$opts$namespace : {})[name] : inst[name];
|
13
13
|
if (!method) {
|
14
|
-
console.warn('tips:', "
|
15
|
-
console.warn('tips:',
|
14
|
+
console.warn('tips:', `"${methodName}" method not exits.`);
|
15
|
+
console.warn('tips:', `Please check kit "${kitName}" dependency is enabled.`);
|
16
16
|
return;
|
17
17
|
}
|
18
18
|
// eslint-disable-next-line prefer-rest-params
|
@@ -24,14 +24,14 @@ export function factory(name) {
|
|
24
24
|
let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
25
25
|
return function () {
|
26
26
|
var _inst$opts$namespace2;
|
27
|
-
const methodName =
|
27
|
+
const methodName = `ty.${opts.namespace ? opts.namespace + '.' : ''}${name}`;
|
28
28
|
if (opts.deprecated) {
|
29
|
-
console.warn("
|
29
|
+
console.warn(`"${methodName}" method has been deprecated.`);
|
30
30
|
}
|
31
31
|
const inst = typeof ty === 'undefined' ? {} : ty;
|
32
32
|
const method = opts.namespace ? ((_inst$opts$namespace2 = inst[opts.namespace]) !== null && _inst$opts$namespace2 !== void 0 ? _inst$opts$namespace2 : {})[name] : inst[name];
|
33
33
|
if (!method) {
|
34
|
-
console.warn('tips:', "
|
34
|
+
console.warn('tips:', `"${methodName}" method not exits.`);
|
35
35
|
return;
|
36
36
|
}
|
37
37
|
// eslint-disable-next-line prefer-rest-params
|
@@ -41,11 +41,11 @@ export function factory(name) {
|
|
41
41
|
export function factoryConstants(name) {
|
42
42
|
let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
43
43
|
if (opts.deprecated) {
|
44
|
-
console.warn("
|
44
|
+
console.warn(`"ty.${name}" constant has been deprecated.`);
|
45
45
|
}
|
46
46
|
const inst = typeof ty === 'undefined' ? {} : ty;
|
47
47
|
if (!inst[name]) {
|
48
|
-
console.warn('tips', "
|
48
|
+
console.warn('tips', `"ty.${name}" constant not exits.`);
|
49
49
|
return;
|
50
50
|
}
|
51
51
|
return inst[name];
|
package/lib/utils.wechat.js
CHANGED
@@ -13,7 +13,7 @@ export function factory(name) {
|
|
13
13
|
if (/(set|get|remove|clear)+Storage(Sync)?$/.test(name)) {
|
14
14
|
return function (option) {
|
15
15
|
if (opts.deprecated) {
|
16
|
-
console.warn(
|
16
|
+
console.warn(`该方法 ${name} 已弃用`);
|
17
17
|
}
|
18
18
|
// eslint-disable-next-line prefer-rest-params
|
19
19
|
return wx[name].call(this, option.key, option.data);
|
@@ -21,10 +21,10 @@ export function factory(name) {
|
|
21
21
|
}
|
22
22
|
return function () {
|
23
23
|
if (opts.deprecated) {
|
24
|
-
console.warn(
|
24
|
+
console.warn(`该方法 ${name} 已弃用`);
|
25
25
|
}
|
26
26
|
if (!tyWx[name] && !wx[name]) {
|
27
|
-
console.warn(
|
27
|
+
console.warn(`// TODO 暂未实现方法 wx.${name}`);
|
28
28
|
return;
|
29
29
|
}
|
30
30
|
// 优先取得 TTT 能力的方法
|
@@ -38,11 +38,11 @@ export function factory(name) {
|
|
38
38
|
export function factoryConstants(name) {
|
39
39
|
let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
40
40
|
if (opts.deprecated) {
|
41
|
-
console.warn(
|
41
|
+
console.warn(`该变量 ${name} 已弃用`);
|
42
42
|
}
|
43
43
|
const inst = typeof wx === 'undefined' ? {} : wx;
|
44
44
|
if (!inst[name]) {
|
45
|
-
console.warn(
|
45
|
+
console.warn(`// TODO 暂未实现变量 ${name}`);
|
46
46
|
return;
|
47
47
|
}
|
48
48
|
return inst[name];
|
package/lib/viewAPI.d.ts
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ray-js/api",
|
3
|
-
"version": "1.5.
|
3
|
+
"version": "1.5.41",
|
4
4
|
"description": "Ray universal api",
|
5
5
|
"keywords": [
|
6
6
|
"ray"
|
@@ -29,22 +29,22 @@
|
|
29
29
|
"watch": "ray start --type=component"
|
30
30
|
},
|
31
31
|
"dependencies": {
|
32
|
-
"@ray-js/framework": "1.5.
|
33
|
-
"@ray-js/router": "1.5.
|
34
|
-
"@ray-js/wechat": "^0.2.
|
32
|
+
"@ray-js/framework": "1.5.41",
|
33
|
+
"@ray-js/router": "1.5.41",
|
34
|
+
"@ray-js/wechat": "^0.2.19",
|
35
35
|
"base64-browser": "^1.0.1",
|
36
36
|
"query-string": "^7.1.3"
|
37
37
|
},
|
38
38
|
"devDependencies": {
|
39
|
-
"@ray-js/cli": "1.5.
|
39
|
+
"@ray-js/cli": "1.5.41",
|
40
40
|
"art-template": "^4.13.2",
|
41
41
|
"fs-extra": "^10.1.0",
|
42
|
-
"miniprogram-api-typings": "^3.12.
|
42
|
+
"miniprogram-api-typings": "^3.12.3",
|
43
43
|
"react": "^17.0.2"
|
44
44
|
},
|
45
45
|
"publishConfig": {
|
46
46
|
"access": "public",
|
47
47
|
"registry": "https://registry.npmjs.com"
|
48
48
|
},
|
49
|
-
"gitHead": "
|
49
|
+
"gitHead": "08f9269589769f029e63b3835dfa92b48c6a6f15"
|
50
50
|
}
|