@tuya-sat/sdf-main-sdk 6.2.2 → 6.2.4-authDisabled.0
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/README.md +62 -0
- package/dist/{364.2d1ca926.chunk.js → 364.1c48403a.chunk.js} +1 -1
- package/dist/{364.2d1ca926.chunk.js.map → 364.1c48403a.chunk.js.map} +1 -1
- package/dist/en.json +2 -0
- package/dist/main.bundle.js +1 -1
- package/dist/main.bundle.js.map +1 -1
- package/dist/main.css +2 -2
- package/dist/main.css.map +1 -1
- package/dist/manifest.json +2 -2
- package/dist/mqtt/index.d.ts +13 -0
- package/dist/utils/common.d.ts +8 -0
- package/dist/zh.json +2 -0
- package/package.json +1 -1
package/dist/manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"main.css": "auto/main.css",
|
|
3
3
|
"main.js": "auto/main.bundle.js",
|
|
4
|
-
"364.
|
|
4
|
+
"364.1c48403a.chunk.js": "auto/364.1c48403a.chunk.js",
|
|
5
5
|
"static/img/login3.png": "auto/static/img/dd06d35d98047203e715.png",
|
|
6
6
|
"static/img/reLogin.png": "auto/static/img/294142da390c5af23324.png",
|
|
7
7
|
"static/img/login2.png": "auto/static/img/47a523d0027c7b5af83f.png",
|
|
@@ -23,5 +23,5 @@
|
|
|
23
23
|
"static/img/tuya.png": "auto/static/img/328d8b5c342b13933c5c.png",
|
|
24
24
|
"main.css.map": "auto/main.css.map",
|
|
25
25
|
"main.bundle.js.map": "auto/main.bundle.js.map",
|
|
26
|
-
"364.
|
|
26
|
+
"364.1c48403a.chunk.js.map": "auto/364.1c48403a.chunk.js.map"
|
|
27
27
|
}
|
package/dist/mqtt/index.d.ts
CHANGED
|
@@ -19,11 +19,24 @@ export interface PublishTopicOption {
|
|
|
19
19
|
isRaw?: boolean;
|
|
20
20
|
}
|
|
21
21
|
export type MqttTopic = string | ((uid: string) => string);
|
|
22
|
+
export type MqttStatus = 'connected' | 'reconnecting' | 'reconnect_failed' | 'offline' | 'close' | 'error';
|
|
23
|
+
export interface MqttStatusEvent {
|
|
24
|
+
status: MqttStatus;
|
|
25
|
+
remainingRetries?: number;
|
|
26
|
+
maxRetries?: number;
|
|
27
|
+
error?: any;
|
|
28
|
+
}
|
|
29
|
+
export interface MqttStatusChangeOption {
|
|
30
|
+
/** 为 false 时记入子应用作用域,卸载微应用时会随 unsubscribeMicTopics 一起取消 */
|
|
31
|
+
isGlobal?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export type MqttStatusListener = (event: MqttStatusEvent) => void;
|
|
22
34
|
declare const mqtt: {
|
|
23
35
|
init: (cb?: () => void, force?: boolean) => Promise<void>;
|
|
24
36
|
subscribeTopic: (topic: MqttTopic, cbFn?: (msg: any) => void, option?: SubscribeTopicOption) => void;
|
|
25
37
|
publishTopic: (topic: MqttTopic, data: any, option?: PublishTopicOption) => Promise<void>;
|
|
26
38
|
unsubscribeMicTopics: () => void;
|
|
27
39
|
unsubscribeTopic: (topic?: MqttTopic) => void;
|
|
40
|
+
onStatusChange: (listener: MqttStatusListener, option?: MqttStatusChangeOption) => () => void;
|
|
28
41
|
};
|
|
29
42
|
export default mqtt;
|
package/dist/utils/common.d.ts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
export declare const AUTH_SYNC_KEY = "SAAS_AUTH_SYNC_EVENT";
|
|
2
|
+
export declare const MAIN_APP_AUTH_MODE_KEY = "sdf.main-app.auth.mode";
|
|
2
3
|
type AuthSyncType = 'login' | 'logout';
|
|
4
|
+
/**
|
|
5
|
+
* @brief 判断主应用是否关闭 SDK 前端鉴权
|
|
6
|
+
* @return true 表示 SDK 不主动跳登录、不做前端 403 类路由拦截
|
|
7
|
+
* @note 配置来源为主应用 manifest.json 的 annotations: { "sdf.main-app.auth.mode": "none" }。
|
|
8
|
+
* 该开关只影响浏览器侧 SDK 行为,不绕过网关 LoginGuard、SaaS API 权限或后端接口鉴权。
|
|
9
|
+
*/
|
|
10
|
+
export declare const isMainAppAuthDisabled: () => boolean;
|
|
3
11
|
export declare const emitAuthSyncEvent: (type: AuthSyncType) => void;
|
|
4
12
|
export declare const findEntry: (menus: any, pathname: any) => any;
|
|
5
13
|
export declare const getDeepestPath: (menu: any) => any;
|
package/dist/zh.json
CHANGED
|
@@ -51,6 +51,8 @@
|
|
|
51
51
|
"login.qrLogin.refresh": "刷新",
|
|
52
52
|
"login.qrLogin.scanTip": "请使用 {{scanText}} 扫码登录",
|
|
53
53
|
"login.qrLogin.expiredText": "二维码已过期",
|
|
54
|
+
"login.qrLogin.saasExpired": "Saas 已过期,暂无法使用",
|
|
55
|
+
"login.qrLogin.unboundApp": "Saas 未关联App,暂无法使用",
|
|
54
56
|
"menu.title.default": "SaaS开发框架Demo",
|
|
55
57
|
"menu.title.assets": "资产管理",
|
|
56
58
|
"menu.title.devices": "设备管理",
|