@lazycatcloud/sdk 0.1.141 → 0.1.144
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/common/box.ts +545 -0
- package/common/browseronly.ts +520 -0
- package/common/end_device.ts +635 -0
- package/common/file_handler.ts +485 -0
- package/common/filetrans.ts +1936 -0
- package/common/gateway.ts +663 -0
- package/common/media_meta.ts +319 -0
- package/common/message.ts +242 -0
- package/common/peripheral_device.ts +783 -0
- package/common/security_context.ts +729 -0
- package/common/users.ts +1044 -0
- package/dist/common/box.d.ts +1 -1
- package/dist/common/box.d.ts.map +1 -1
- package/dist/common/box.js +21 -37
- package/dist/common/box.js.map +1 -1
- package/dist/common/browseronly.d.ts +2 -2
- package/dist/common/browseronly.d.ts.map +1 -1
- package/dist/common/browseronly.js +12 -23
- package/dist/common/browseronly.js.map +1 -1
- package/dist/common/end_device.d.ts +2 -2
- package/dist/common/end_device.d.ts.map +1 -1
- package/dist/common/end_device.js +18 -41
- package/dist/common/end_device.js.map +1 -1
- package/dist/common/file_handler.d.ts.map +1 -1
- package/dist/common/file_handler.js +5 -15
- package/dist/common/file_handler.js.map +1 -1
- package/dist/common/filetrans.d.ts +2 -2
- package/dist/common/filetrans.d.ts.map +1 -1
- package/dist/common/filetrans.js +94 -221
- package/dist/common/filetrans.js.map +1 -1
- package/dist/common/gateway.d.ts +1 -1
- package/dist/common/gateway.d.ts.map +1 -1
- package/dist/common/gateway.js +14 -33
- package/dist/common/gateway.js.map +1 -1
- package/dist/common/media_meta.d.ts +85 -0
- package/dist/common/media_meta.d.ts.map +1 -0
- package/dist/common/media_meta.js +233 -0
- package/dist/common/media_meta.js.map +1 -0
- package/dist/common/message.d.ts.map +1 -1
- package/dist/common/message.js +13 -23
- package/dist/common/message.js.map +1 -1
- package/dist/common/peripheral_device.d.ts +2 -2
- package/dist/common/peripheral_device.d.ts.map +1 -1
- package/dist/common/peripheral_device.js +22 -39
- package/dist/common/peripheral_device.js.map +1 -1
- package/dist/common/security_context.d.ts.map +1 -1
- package/dist/common/security_context.js +11 -33
- package/dist/common/security_context.js.map +1 -1
- package/dist/common/users.d.ts +2 -2
- package/dist/common/users.d.ts.map +1 -1
- package/dist/common/users.js +10 -24
- package/dist/common/users.js.map +1 -1
- package/dist/dlna/dlna.d.ts +2 -2
- package/dist/dlna/dlna.d.ts.map +1 -1
- package/dist/dlna/dlna.js +23 -58
- package/dist/dlna/dlna.js.map +1 -1
- package/dist/extentions/app_common.d.ts +1 -1
- package/dist/extentions/app_common.d.ts.map +1 -1
- package/dist/extentions/app_common.js +21 -8
- package/dist/extentions/app_common.js.map +1 -1
- package/dist/extentions/index.d.ts +1 -1
- package/dist/extentions/index.d.ts.map +1 -1
- package/dist/extentions/unsafe_app.d.ts +3 -0
- package/dist/extentions/unsafe_app.d.ts.map +1 -1
- package/dist/extentions/unsafe_app.js +21 -0
- package/dist/extentions/unsafe_app.js.map +1 -1
- package/dist/google/protobuf/descriptor.d.ts +0 -1
- package/dist/google/protobuf/descriptor.d.ts.map +1 -1
- package/dist/google/protobuf/descriptor.js +176 -406
- package/dist/google/protobuf/descriptor.js.map +1 -1
- package/dist/google/protobuf/empty.d.ts.map +1 -1
- package/dist/google/protobuf/empty.js.map +1 -1
- package/dist/google/protobuf/timestamp.d.ts +0 -2
- package/dist/google/protobuf/timestamp.d.ts.map +1 -1
- package/dist/google/protobuf/timestamp.js +9 -6
- package/dist/google/protobuf/timestamp.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -10
- package/dist/index.js.map +1 -1
- package/dist/lanforward/lanforward.d.ts +1 -1
- package/dist/lanforward/lanforward.d.ts.map +1 -1
- package/dist/lanforward/lanforward.js +7 -12
- package/dist/lanforward/lanforward.js.map +1 -1
- package/dist/localdevice/clipboard.d.ts +1 -1
- package/dist/localdevice/clipboard.d.ts.map +1 -1
- package/dist/localdevice/clipboard.js +17 -25
- package/dist/localdevice/clipboard.js.map +1 -1
- package/dist/localdevice/config.d.ts.map +1 -1
- package/dist/localdevice/config.js +3 -8
- package/dist/localdevice/config.js.map +1 -1
- package/dist/localdevice/device.d.ts +1 -1
- package/dist/localdevice/device.d.ts.map +1 -1
- package/dist/localdevice/device.js +4 -9
- package/dist/localdevice/device.js.map +1 -1
- package/dist/localdevice/dialog.d.ts +1 -1
- package/dist/localdevice/dialog.d.ts.map +1 -1
- package/dist/localdevice/dialog.js +8 -22
- package/dist/localdevice/dialog.js.map +1 -1
- package/dist/localdevice/local-launch.d.ts.map +1 -1
- package/dist/localdevice/local-launch.js +9 -32
- package/dist/localdevice/local-launch.js.map +1 -1
- package/dist/localdevice/network.d.ts +1 -1
- package/dist/localdevice/network.d.ts.map +1 -1
- package/dist/localdevice/network.js +3 -6
- package/dist/localdevice/network.js.map +1 -1
- package/dist/localdevice/permission.d.ts +1 -1
- package/dist/localdevice/permission.d.ts.map +1 -1
- package/dist/localdevice/permission.js +18 -35
- package/dist/localdevice/permission.js.map +1 -1
- package/dist/localdevice/photo.d.ts +1 -1
- package/dist/localdevice/photo.d.ts.map +1 -1
- package/dist/localdevice/photo.js +64 -156
- package/dist/localdevice/photo.js.map +1 -1
- package/dist/package.json +1 -5
- package/dist/ssdp/ssdp.d.ts +1 -1
- package/dist/ssdp/ssdp.d.ts.map +1 -1
- package/dist/ssdp/ssdp.js +6 -9
- package/dist/ssdp/ssdp.js.map +1 -1
- package/dist/sys/OS_daemon.d.ts +1 -1
- package/dist/sys/OS_daemon.d.ts.map +1 -1
- package/dist/sys/OS_daemon.js +5 -14
- package/dist/sys/OS_daemon.js.map +1 -1
- package/dist/sys/OS_snapshot.d.ts +1 -1
- package/dist/sys/OS_snapshot.d.ts.map +1 -1
- package/dist/sys/OS_snapshot.js +41 -81
- package/dist/sys/OS_snapshot.js.map +1 -1
- package/dist/sys/OS_upgrader.d.ts +1 -1
- package/dist/sys/OS_upgrader.d.ts.map +1 -1
- package/dist/sys/OS_upgrader.js +22 -39
- package/dist/sys/OS_upgrader.js.map +1 -1
- package/dist/sys/btrfs.d.ts +1 -1
- package/dist/sys/btrfs.d.ts.map +1 -1
- package/dist/sys/btrfs.js +14 -22
- package/dist/sys/btrfs.js.map +1 -1
- package/dist/sys/devopt.d.ts +1 -1
- package/dist/sys/devopt.d.ts.map +1 -1
- package/dist/sys/devopt.js +9 -25
- package/dist/sys/devopt.js.map +1 -1
- package/dist/sys/event.d.ts +2 -2
- package/dist/sys/event.d.ts.map +1 -1
- package/dist/sys/event.js +15 -30
- package/dist/sys/event.js.map +1 -1
- package/dist/sys/hc-core/hc-core.d.ts +2 -2
- package/dist/sys/hc-core/hc-core.d.ts.map +1 -1
- package/dist/sys/hc-core/hc-core.js +32 -65
- package/dist/sys/hc-core/hc-core.js.map +1 -1
- package/dist/sys/ingress.d.ts +1 -1
- package/dist/sys/ingress.d.ts.map +1 -1
- package/dist/sys/ingress.js +19 -36
- package/dist/sys/ingress.js.map +1 -1
- package/dist/sys/network_manager.d.ts +1 -1
- package/dist/sys/network_manager.d.ts.map +1 -1
- package/dist/sys/network_manager.js +22 -66
- package/dist/sys/network_manager.js.map +1 -1
- package/dist/sys/package_manager.d.ts +1 -1
- package/dist/sys/package_manager.d.ts.map +1 -1
- package/dist/sys/package_manager.js +36 -73
- package/dist/sys/package_manager.js.map +1 -1
- package/dist/sys/portal-server/portal-server.d.ts +2 -2
- package/dist/sys/portal-server/portal-server.d.ts.map +1 -1
- package/dist/sys/portal-server/portal-server.js +62 -157
- package/dist/sys/portal-server/portal-server.js.map +1 -1
- package/dist/sys/snapd.d.ts +1 -1
- package/dist/sys/snapd.d.ts.map +1 -1
- package/dist/sys/snapd.js +20 -50
- package/dist/sys/snapd.js.map +1 -1
- package/dlna/dlna.ts +895 -0
- package/docs/contribute.md +40 -0
- package/docs/extentions/AppCommon.md +30 -0
- package/extentions/app_common.ts +63 -0
- package/extentions/base.ts +459 -0
- package/extentions/index.ts +27 -0
- package/extentions/safe_app.ts +60 -0
- package/extentions/unsafe_app.ts +107 -0
- package/google/protobuf/descriptor.ts +3778 -0
- package/google/protobuf/empty.ts +64 -0
- package/google/protobuf/timestamp.ts +214 -0
- package/grpcweb.ts +106 -0
- package/index.ts +204 -0
- package/lanforward/lanforward.ts +301 -0
- package/localdevice/clipboard.ts +499 -0
- package/localdevice/config.ts +268 -0
- package/localdevice/device.ts +218 -0
- package/localdevice/dialog.ts +707 -0
- package/localdevice/local-launch.ts +954 -0
- package/localdevice/network.ts +273 -0
- package/localdevice/permission.ts +733 -0
- package/localdevice/photo.ts +1497 -0
- package/package.json +1 -5
- package/ssdp/ssdp.ts +332 -0
- package/sys/OS_daemon.ts +325 -0
- package/sys/OS_snapshot.ts +1714 -0
- package/sys/OS_upgrader.ts +782 -0
- package/sys/btrfs.ts +530 -0
- package/sys/devopt.ts +250 -0
- package/sys/event.ts +787 -0
- package/sys/hc-core/hc-core.ts +1582 -0
- package/sys/ingress.ts +953 -0
- package/sys/network_manager.ts +874 -0
- package/sys/package_manager.ts +1931 -0
- package/sys/portal-server/portal-server.ts +2934 -0
- package/sys/snapd.ts +861 -0
- package/tsconfig.json +15 -0
- package/dist/API.d.ts +0 -24
- package/dist/API.d.ts.map +0 -1
- package/dist/API.js +0 -117
- package/dist/API.js.map +0 -1
- package/dist/google/protobuf/wrappers.d.ts +0 -182
- package/dist/google/protobuf/wrappers.d.ts.map +0 -1
- package/dist/google/protobuf/wrappers.js +0 -458
- package/dist/google/protobuf/wrappers.js.map +0 -1
- package/dist/sys/message.d.ts +0 -186
- package/dist/sys/message.d.ts.map +0 -1
- package/dist/sys/message.js +0 -493
- package/dist/sys/message.js.map +0 -1
- package/dist/sys/settings.d.ts +0 -68
- package/dist/sys/settings.d.ts.map +0 -1
- package/dist/sys/settings.js +0 -183
- package/dist/sys/settings.js.map +0 -1
|
@@ -0,0 +1,954 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import { grpc } from "@improbable-eng/grpc-web";
|
|
3
|
+
import { BrowserHeaders } from "browser-headers";
|
|
4
|
+
import _m0 from "protobufjs/minimal";
|
|
5
|
+
|
|
6
|
+
export interface PinAppRequest {
|
|
7
|
+
url: string;
|
|
8
|
+
appName: string;
|
|
9
|
+
/** icon地址允许是http类型或者base64类型,如果为空将尝试获取网站的favicon.ico */
|
|
10
|
+
iconUrl: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface PinAppReply {
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface UnPinAppRequest {
|
|
17
|
+
url: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface UnPinAppReply {
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface OpenAppRequest {
|
|
24
|
+
url: string;
|
|
25
|
+
isFullScreen: boolean;
|
|
26
|
+
appid: string;
|
|
27
|
+
version: string;
|
|
28
|
+
title: string;
|
|
29
|
+
icon: string;
|
|
30
|
+
/**
|
|
31
|
+
* 当已经存在当前地址的窗口的时候,是否要求使用该地址强制打开。
|
|
32
|
+
* 使用场景,比如播放器存在已经存在,这个时候需要使用过新的链接打开,然后覆盖上一次的播放界面,然后指定forceOpen=true即可.
|
|
33
|
+
*/
|
|
34
|
+
forceOpen: boolean;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface OpenAppReply {
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface OpenUnsafeAppRequest {
|
|
41
|
+
/** control-view的地址 */
|
|
42
|
+
url: string;
|
|
43
|
+
/** control-view的位置 */
|
|
44
|
+
position: OpenUnsafeAppRequest_Position;
|
|
45
|
+
/** control-view的高度(当control-view 在左右的时候表示宽度, 上下表示高度) */
|
|
46
|
+
height: string;
|
|
47
|
+
/**
|
|
48
|
+
* 此外control-view会接收以下特殊事件, 所有事件均统一以post-message形式发送, msg格式为`{ type: string, msg: string }`
|
|
49
|
+
* control-view需要自行调用addEventListener('message'), 并过滤type==lzc_control_api类型的message.
|
|
50
|
+
*
|
|
51
|
+
* 1. OnURLChange(new_url)
|
|
52
|
+
* 2. OnNewLinkClick(url)
|
|
53
|
+
* 3. OnDownloadLinkRequest(url)
|
|
54
|
+
* 4. OnNewResourceLink(url) 将所有的content-view请求的url通知给control-view
|
|
55
|
+
* 5. OnContentMessage(msg string) //在content-view中调用post-message发送的任何消息
|
|
56
|
+
*/
|
|
57
|
+
features: OpenUnsafeAppRequest_Feature[];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export enum OpenUnsafeAppRequest_Position {
|
|
61
|
+
Left = 0,
|
|
62
|
+
Right = 1,
|
|
63
|
+
Top = 2,
|
|
64
|
+
Bottom = 3,
|
|
65
|
+
UNRECOGNIZED = -1,
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function openUnsafeAppRequest_PositionFromJSON(object: any): OpenUnsafeAppRequest_Position {
|
|
69
|
+
switch (object) {
|
|
70
|
+
case 0:
|
|
71
|
+
case "Left":
|
|
72
|
+
return OpenUnsafeAppRequest_Position.Left;
|
|
73
|
+
case 1:
|
|
74
|
+
case "Right":
|
|
75
|
+
return OpenUnsafeAppRequest_Position.Right;
|
|
76
|
+
case 2:
|
|
77
|
+
case "Top":
|
|
78
|
+
return OpenUnsafeAppRequest_Position.Top;
|
|
79
|
+
case 3:
|
|
80
|
+
case "Bottom":
|
|
81
|
+
return OpenUnsafeAppRequest_Position.Bottom;
|
|
82
|
+
case -1:
|
|
83
|
+
case "UNRECOGNIZED":
|
|
84
|
+
default:
|
|
85
|
+
return OpenUnsafeAppRequest_Position.UNRECOGNIZED;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function openUnsafeAppRequest_PositionToJSON(object: OpenUnsafeAppRequest_Position): string {
|
|
90
|
+
switch (object) {
|
|
91
|
+
case OpenUnsafeAppRequest_Position.Left:
|
|
92
|
+
return "Left";
|
|
93
|
+
case OpenUnsafeAppRequest_Position.Right:
|
|
94
|
+
return "Right";
|
|
95
|
+
case OpenUnsafeAppRequest_Position.Top:
|
|
96
|
+
return "Top";
|
|
97
|
+
case OpenUnsafeAppRequest_Position.Bottom:
|
|
98
|
+
return "Bottom";
|
|
99
|
+
case OpenUnsafeAppRequest_Position.UNRECOGNIZED:
|
|
100
|
+
default:
|
|
101
|
+
return "UNRECOGNIZED";
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** 所有的功能都通过 window.lzc_control_api对象注入. (后面以$API代指) */
|
|
106
|
+
export enum OpenUnsafeAppRequest_Feature {
|
|
107
|
+
/** InjectJS - $API.InjectContentJS(jscontent,callback) content-view 执行的jscontent, 如果有结果,会将结果通过callback(result:Boolean): 通知给control-view */
|
|
108
|
+
InjectJS = 0,
|
|
109
|
+
/** ReadCookie - $API.ReadCookie(domain) -> string 读取content-view cookie */
|
|
110
|
+
ReadCookie = 1,
|
|
111
|
+
UNRECOGNIZED = -1,
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export function openUnsafeAppRequest_FeatureFromJSON(object: any): OpenUnsafeAppRequest_Feature {
|
|
115
|
+
switch (object) {
|
|
116
|
+
case 0:
|
|
117
|
+
case "InjectJS":
|
|
118
|
+
return OpenUnsafeAppRequest_Feature.InjectJS;
|
|
119
|
+
case 1:
|
|
120
|
+
case "ReadCookie":
|
|
121
|
+
return OpenUnsafeAppRequest_Feature.ReadCookie;
|
|
122
|
+
case -1:
|
|
123
|
+
case "UNRECOGNIZED":
|
|
124
|
+
default:
|
|
125
|
+
return OpenUnsafeAppRequest_Feature.UNRECOGNIZED;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export function openUnsafeAppRequest_FeatureToJSON(object: OpenUnsafeAppRequest_Feature): string {
|
|
130
|
+
switch (object) {
|
|
131
|
+
case OpenUnsafeAppRequest_Feature.InjectJS:
|
|
132
|
+
return "InjectJS";
|
|
133
|
+
case OpenUnsafeAppRequest_Feature.ReadCookie:
|
|
134
|
+
return "ReadCookie";
|
|
135
|
+
case OpenUnsafeAppRequest_Feature.UNRECOGNIZED:
|
|
136
|
+
default:
|
|
137
|
+
return "UNRECOGNIZED";
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export interface OpenAppMethodRequest {
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export interface OpenAppMethodReply {
|
|
145
|
+
/** 当前设备支持的应用打开方式 */
|
|
146
|
+
support: OpenAppMethodReply_Mode;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export enum OpenAppMethodReply_Mode {
|
|
150
|
+
All = 0,
|
|
151
|
+
AllNot = 1,
|
|
152
|
+
Browser = 2,
|
|
153
|
+
Client = 3,
|
|
154
|
+
UNRECOGNIZED = -1,
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export function openAppMethodReply_ModeFromJSON(object: any): OpenAppMethodReply_Mode {
|
|
158
|
+
switch (object) {
|
|
159
|
+
case 0:
|
|
160
|
+
case "All":
|
|
161
|
+
return OpenAppMethodReply_Mode.All;
|
|
162
|
+
case 1:
|
|
163
|
+
case "AllNot":
|
|
164
|
+
return OpenAppMethodReply_Mode.AllNot;
|
|
165
|
+
case 2:
|
|
166
|
+
case "Browser":
|
|
167
|
+
return OpenAppMethodReply_Mode.Browser;
|
|
168
|
+
case 3:
|
|
169
|
+
case "Client":
|
|
170
|
+
return OpenAppMethodReply_Mode.Client;
|
|
171
|
+
case -1:
|
|
172
|
+
case "UNRECOGNIZED":
|
|
173
|
+
default:
|
|
174
|
+
return OpenAppMethodReply_Mode.UNRECOGNIZED;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export function openAppMethodReply_ModeToJSON(object: OpenAppMethodReply_Mode): string {
|
|
179
|
+
switch (object) {
|
|
180
|
+
case OpenAppMethodReply_Mode.All:
|
|
181
|
+
return "All";
|
|
182
|
+
case OpenAppMethodReply_Mode.AllNot:
|
|
183
|
+
return "AllNot";
|
|
184
|
+
case OpenAppMethodReply_Mode.Browser:
|
|
185
|
+
return "Browser";
|
|
186
|
+
case OpenAppMethodReply_Mode.Client:
|
|
187
|
+
return "Client";
|
|
188
|
+
case OpenAppMethodReply_Mode.UNRECOGNIZED:
|
|
189
|
+
default:
|
|
190
|
+
return "UNRECOGNIZED";
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function createBasePinAppRequest(): PinAppRequest {
|
|
195
|
+
return { url: "", appName: "", iconUrl: "" };
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export const PinAppRequest = {
|
|
199
|
+
encode(message: PinAppRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
200
|
+
if (message.url !== "") {
|
|
201
|
+
writer.uint32(10).string(message.url);
|
|
202
|
+
}
|
|
203
|
+
if (message.appName !== "") {
|
|
204
|
+
writer.uint32(18).string(message.appName);
|
|
205
|
+
}
|
|
206
|
+
if (message.iconUrl !== "") {
|
|
207
|
+
writer.uint32(26).string(message.iconUrl);
|
|
208
|
+
}
|
|
209
|
+
return writer;
|
|
210
|
+
},
|
|
211
|
+
|
|
212
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): PinAppRequest {
|
|
213
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
214
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
215
|
+
const message = createBasePinAppRequest();
|
|
216
|
+
while (reader.pos < end) {
|
|
217
|
+
const tag = reader.uint32();
|
|
218
|
+
switch (tag >>> 3) {
|
|
219
|
+
case 1:
|
|
220
|
+
message.url = reader.string();
|
|
221
|
+
break;
|
|
222
|
+
case 2:
|
|
223
|
+
message.appName = reader.string();
|
|
224
|
+
break;
|
|
225
|
+
case 3:
|
|
226
|
+
message.iconUrl = reader.string();
|
|
227
|
+
break;
|
|
228
|
+
default:
|
|
229
|
+
reader.skipType(tag & 7);
|
|
230
|
+
break;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
return message;
|
|
234
|
+
},
|
|
235
|
+
|
|
236
|
+
fromJSON(object: any): PinAppRequest {
|
|
237
|
+
return {
|
|
238
|
+
url: isSet(object.url) ? String(object.url) : "",
|
|
239
|
+
appName: isSet(object.appName) ? String(object.appName) : "",
|
|
240
|
+
iconUrl: isSet(object.iconUrl) ? String(object.iconUrl) : "",
|
|
241
|
+
};
|
|
242
|
+
},
|
|
243
|
+
|
|
244
|
+
toJSON(message: PinAppRequest): unknown {
|
|
245
|
+
const obj: any = {};
|
|
246
|
+
message.url !== undefined && (obj.url = message.url);
|
|
247
|
+
message.appName !== undefined && (obj.appName = message.appName);
|
|
248
|
+
message.iconUrl !== undefined && (obj.iconUrl = message.iconUrl);
|
|
249
|
+
return obj;
|
|
250
|
+
},
|
|
251
|
+
|
|
252
|
+
fromPartial<I extends Exact<DeepPartial<PinAppRequest>, I>>(object: I): PinAppRequest {
|
|
253
|
+
const message = createBasePinAppRequest();
|
|
254
|
+
message.url = object.url ?? "";
|
|
255
|
+
message.appName = object.appName ?? "";
|
|
256
|
+
message.iconUrl = object.iconUrl ?? "";
|
|
257
|
+
return message;
|
|
258
|
+
},
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
function createBasePinAppReply(): PinAppReply {
|
|
262
|
+
return {};
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export const PinAppReply = {
|
|
266
|
+
encode(_: PinAppReply, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
267
|
+
return writer;
|
|
268
|
+
},
|
|
269
|
+
|
|
270
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): PinAppReply {
|
|
271
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
272
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
273
|
+
const message = createBasePinAppReply();
|
|
274
|
+
while (reader.pos < end) {
|
|
275
|
+
const tag = reader.uint32();
|
|
276
|
+
switch (tag >>> 3) {
|
|
277
|
+
default:
|
|
278
|
+
reader.skipType(tag & 7);
|
|
279
|
+
break;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
return message;
|
|
283
|
+
},
|
|
284
|
+
|
|
285
|
+
fromJSON(_: any): PinAppReply {
|
|
286
|
+
return {};
|
|
287
|
+
},
|
|
288
|
+
|
|
289
|
+
toJSON(_: PinAppReply): unknown {
|
|
290
|
+
const obj: any = {};
|
|
291
|
+
return obj;
|
|
292
|
+
},
|
|
293
|
+
|
|
294
|
+
fromPartial<I extends Exact<DeepPartial<PinAppReply>, I>>(_: I): PinAppReply {
|
|
295
|
+
const message = createBasePinAppReply();
|
|
296
|
+
return message;
|
|
297
|
+
},
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
function createBaseUnPinAppRequest(): UnPinAppRequest {
|
|
301
|
+
return { url: "" };
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
export const UnPinAppRequest = {
|
|
305
|
+
encode(message: UnPinAppRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
306
|
+
if (message.url !== "") {
|
|
307
|
+
writer.uint32(10).string(message.url);
|
|
308
|
+
}
|
|
309
|
+
return writer;
|
|
310
|
+
},
|
|
311
|
+
|
|
312
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): UnPinAppRequest {
|
|
313
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
314
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
315
|
+
const message = createBaseUnPinAppRequest();
|
|
316
|
+
while (reader.pos < end) {
|
|
317
|
+
const tag = reader.uint32();
|
|
318
|
+
switch (tag >>> 3) {
|
|
319
|
+
case 1:
|
|
320
|
+
message.url = reader.string();
|
|
321
|
+
break;
|
|
322
|
+
default:
|
|
323
|
+
reader.skipType(tag & 7);
|
|
324
|
+
break;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
return message;
|
|
328
|
+
},
|
|
329
|
+
|
|
330
|
+
fromJSON(object: any): UnPinAppRequest {
|
|
331
|
+
return { url: isSet(object.url) ? String(object.url) : "" };
|
|
332
|
+
},
|
|
333
|
+
|
|
334
|
+
toJSON(message: UnPinAppRequest): unknown {
|
|
335
|
+
const obj: any = {};
|
|
336
|
+
message.url !== undefined && (obj.url = message.url);
|
|
337
|
+
return obj;
|
|
338
|
+
},
|
|
339
|
+
|
|
340
|
+
fromPartial<I extends Exact<DeepPartial<UnPinAppRequest>, I>>(object: I): UnPinAppRequest {
|
|
341
|
+
const message = createBaseUnPinAppRequest();
|
|
342
|
+
message.url = object.url ?? "";
|
|
343
|
+
return message;
|
|
344
|
+
},
|
|
345
|
+
};
|
|
346
|
+
|
|
347
|
+
function createBaseUnPinAppReply(): UnPinAppReply {
|
|
348
|
+
return {};
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
export const UnPinAppReply = {
|
|
352
|
+
encode(_: UnPinAppReply, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
353
|
+
return writer;
|
|
354
|
+
},
|
|
355
|
+
|
|
356
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): UnPinAppReply {
|
|
357
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
358
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
359
|
+
const message = createBaseUnPinAppReply();
|
|
360
|
+
while (reader.pos < end) {
|
|
361
|
+
const tag = reader.uint32();
|
|
362
|
+
switch (tag >>> 3) {
|
|
363
|
+
default:
|
|
364
|
+
reader.skipType(tag & 7);
|
|
365
|
+
break;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
return message;
|
|
369
|
+
},
|
|
370
|
+
|
|
371
|
+
fromJSON(_: any): UnPinAppReply {
|
|
372
|
+
return {};
|
|
373
|
+
},
|
|
374
|
+
|
|
375
|
+
toJSON(_: UnPinAppReply): unknown {
|
|
376
|
+
const obj: any = {};
|
|
377
|
+
return obj;
|
|
378
|
+
},
|
|
379
|
+
|
|
380
|
+
fromPartial<I extends Exact<DeepPartial<UnPinAppReply>, I>>(_: I): UnPinAppReply {
|
|
381
|
+
const message = createBaseUnPinAppReply();
|
|
382
|
+
return message;
|
|
383
|
+
},
|
|
384
|
+
};
|
|
385
|
+
|
|
386
|
+
function createBaseOpenAppRequest(): OpenAppRequest {
|
|
387
|
+
return { url: "", isFullScreen: false, appid: "", version: "", title: "", icon: "", forceOpen: false };
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
export const OpenAppRequest = {
|
|
391
|
+
encode(message: OpenAppRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
392
|
+
if (message.url !== "") {
|
|
393
|
+
writer.uint32(10).string(message.url);
|
|
394
|
+
}
|
|
395
|
+
if (message.isFullScreen === true) {
|
|
396
|
+
writer.uint32(16).bool(message.isFullScreen);
|
|
397
|
+
}
|
|
398
|
+
if (message.appid !== "") {
|
|
399
|
+
writer.uint32(26).string(message.appid);
|
|
400
|
+
}
|
|
401
|
+
if (message.version !== "") {
|
|
402
|
+
writer.uint32(34).string(message.version);
|
|
403
|
+
}
|
|
404
|
+
if (message.title !== "") {
|
|
405
|
+
writer.uint32(42).string(message.title);
|
|
406
|
+
}
|
|
407
|
+
if (message.icon !== "") {
|
|
408
|
+
writer.uint32(50).string(message.icon);
|
|
409
|
+
}
|
|
410
|
+
if (message.forceOpen === true) {
|
|
411
|
+
writer.uint32(56).bool(message.forceOpen);
|
|
412
|
+
}
|
|
413
|
+
return writer;
|
|
414
|
+
},
|
|
415
|
+
|
|
416
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): OpenAppRequest {
|
|
417
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
418
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
419
|
+
const message = createBaseOpenAppRequest();
|
|
420
|
+
while (reader.pos < end) {
|
|
421
|
+
const tag = reader.uint32();
|
|
422
|
+
switch (tag >>> 3) {
|
|
423
|
+
case 1:
|
|
424
|
+
message.url = reader.string();
|
|
425
|
+
break;
|
|
426
|
+
case 2:
|
|
427
|
+
message.isFullScreen = reader.bool();
|
|
428
|
+
break;
|
|
429
|
+
case 3:
|
|
430
|
+
message.appid = reader.string();
|
|
431
|
+
break;
|
|
432
|
+
case 4:
|
|
433
|
+
message.version = reader.string();
|
|
434
|
+
break;
|
|
435
|
+
case 5:
|
|
436
|
+
message.title = reader.string();
|
|
437
|
+
break;
|
|
438
|
+
case 6:
|
|
439
|
+
message.icon = reader.string();
|
|
440
|
+
break;
|
|
441
|
+
case 7:
|
|
442
|
+
message.forceOpen = reader.bool();
|
|
443
|
+
break;
|
|
444
|
+
default:
|
|
445
|
+
reader.skipType(tag & 7);
|
|
446
|
+
break;
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
return message;
|
|
450
|
+
},
|
|
451
|
+
|
|
452
|
+
fromJSON(object: any): OpenAppRequest {
|
|
453
|
+
return {
|
|
454
|
+
url: isSet(object.url) ? String(object.url) : "",
|
|
455
|
+
isFullScreen: isSet(object.isFullScreen) ? Boolean(object.isFullScreen) : false,
|
|
456
|
+
appid: isSet(object.appid) ? String(object.appid) : "",
|
|
457
|
+
version: isSet(object.version) ? String(object.version) : "",
|
|
458
|
+
title: isSet(object.title) ? String(object.title) : "",
|
|
459
|
+
icon: isSet(object.icon) ? String(object.icon) : "",
|
|
460
|
+
forceOpen: isSet(object.forceOpen) ? Boolean(object.forceOpen) : false,
|
|
461
|
+
};
|
|
462
|
+
},
|
|
463
|
+
|
|
464
|
+
toJSON(message: OpenAppRequest): unknown {
|
|
465
|
+
const obj: any = {};
|
|
466
|
+
message.url !== undefined && (obj.url = message.url);
|
|
467
|
+
message.isFullScreen !== undefined && (obj.isFullScreen = message.isFullScreen);
|
|
468
|
+
message.appid !== undefined && (obj.appid = message.appid);
|
|
469
|
+
message.version !== undefined && (obj.version = message.version);
|
|
470
|
+
message.title !== undefined && (obj.title = message.title);
|
|
471
|
+
message.icon !== undefined && (obj.icon = message.icon);
|
|
472
|
+
message.forceOpen !== undefined && (obj.forceOpen = message.forceOpen);
|
|
473
|
+
return obj;
|
|
474
|
+
},
|
|
475
|
+
|
|
476
|
+
fromPartial<I extends Exact<DeepPartial<OpenAppRequest>, I>>(object: I): OpenAppRequest {
|
|
477
|
+
const message = createBaseOpenAppRequest();
|
|
478
|
+
message.url = object.url ?? "";
|
|
479
|
+
message.isFullScreen = object.isFullScreen ?? false;
|
|
480
|
+
message.appid = object.appid ?? "";
|
|
481
|
+
message.version = object.version ?? "";
|
|
482
|
+
message.title = object.title ?? "";
|
|
483
|
+
message.icon = object.icon ?? "";
|
|
484
|
+
message.forceOpen = object.forceOpen ?? false;
|
|
485
|
+
return message;
|
|
486
|
+
},
|
|
487
|
+
};
|
|
488
|
+
|
|
489
|
+
function createBaseOpenAppReply(): OpenAppReply {
|
|
490
|
+
return {};
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
export const OpenAppReply = {
|
|
494
|
+
encode(_: OpenAppReply, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
495
|
+
return writer;
|
|
496
|
+
},
|
|
497
|
+
|
|
498
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): OpenAppReply {
|
|
499
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
500
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
501
|
+
const message = createBaseOpenAppReply();
|
|
502
|
+
while (reader.pos < end) {
|
|
503
|
+
const tag = reader.uint32();
|
|
504
|
+
switch (tag >>> 3) {
|
|
505
|
+
default:
|
|
506
|
+
reader.skipType(tag & 7);
|
|
507
|
+
break;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
return message;
|
|
511
|
+
},
|
|
512
|
+
|
|
513
|
+
fromJSON(_: any): OpenAppReply {
|
|
514
|
+
return {};
|
|
515
|
+
},
|
|
516
|
+
|
|
517
|
+
toJSON(_: OpenAppReply): unknown {
|
|
518
|
+
const obj: any = {};
|
|
519
|
+
return obj;
|
|
520
|
+
},
|
|
521
|
+
|
|
522
|
+
fromPartial<I extends Exact<DeepPartial<OpenAppReply>, I>>(_: I): OpenAppReply {
|
|
523
|
+
const message = createBaseOpenAppReply();
|
|
524
|
+
return message;
|
|
525
|
+
},
|
|
526
|
+
};
|
|
527
|
+
|
|
528
|
+
function createBaseOpenUnsafeAppRequest(): OpenUnsafeAppRequest {
|
|
529
|
+
return { url: "", position: 0, height: "", features: [] };
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
export const OpenUnsafeAppRequest = {
|
|
533
|
+
encode(message: OpenUnsafeAppRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
534
|
+
if (message.url !== "") {
|
|
535
|
+
writer.uint32(10).string(message.url);
|
|
536
|
+
}
|
|
537
|
+
if (message.position !== 0) {
|
|
538
|
+
writer.uint32(16).int32(message.position);
|
|
539
|
+
}
|
|
540
|
+
if (message.height !== "") {
|
|
541
|
+
writer.uint32(26).string(message.height);
|
|
542
|
+
}
|
|
543
|
+
writer.uint32(34).fork();
|
|
544
|
+
for (const v of message.features) {
|
|
545
|
+
writer.int32(v);
|
|
546
|
+
}
|
|
547
|
+
writer.ldelim();
|
|
548
|
+
return writer;
|
|
549
|
+
},
|
|
550
|
+
|
|
551
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): OpenUnsafeAppRequest {
|
|
552
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
553
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
554
|
+
const message = createBaseOpenUnsafeAppRequest();
|
|
555
|
+
while (reader.pos < end) {
|
|
556
|
+
const tag = reader.uint32();
|
|
557
|
+
switch (tag >>> 3) {
|
|
558
|
+
case 1:
|
|
559
|
+
message.url = reader.string();
|
|
560
|
+
break;
|
|
561
|
+
case 2:
|
|
562
|
+
message.position = reader.int32() as any;
|
|
563
|
+
break;
|
|
564
|
+
case 3:
|
|
565
|
+
message.height = reader.string();
|
|
566
|
+
break;
|
|
567
|
+
case 4:
|
|
568
|
+
if ((tag & 7) === 2) {
|
|
569
|
+
const end2 = reader.uint32() + reader.pos;
|
|
570
|
+
while (reader.pos < end2) {
|
|
571
|
+
message.features.push(reader.int32() as any);
|
|
572
|
+
}
|
|
573
|
+
} else {
|
|
574
|
+
message.features.push(reader.int32() as any);
|
|
575
|
+
}
|
|
576
|
+
break;
|
|
577
|
+
default:
|
|
578
|
+
reader.skipType(tag & 7);
|
|
579
|
+
break;
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
return message;
|
|
583
|
+
},
|
|
584
|
+
|
|
585
|
+
fromJSON(object: any): OpenUnsafeAppRequest {
|
|
586
|
+
return {
|
|
587
|
+
url: isSet(object.url) ? String(object.url) : "",
|
|
588
|
+
position: isSet(object.position) ? openUnsafeAppRequest_PositionFromJSON(object.position) : 0,
|
|
589
|
+
height: isSet(object.height) ? String(object.height) : "",
|
|
590
|
+
features: Array.isArray(object?.features)
|
|
591
|
+
? object.features.map((e: any) => openUnsafeAppRequest_FeatureFromJSON(e))
|
|
592
|
+
: [],
|
|
593
|
+
};
|
|
594
|
+
},
|
|
595
|
+
|
|
596
|
+
toJSON(message: OpenUnsafeAppRequest): unknown {
|
|
597
|
+
const obj: any = {};
|
|
598
|
+
message.url !== undefined && (obj.url = message.url);
|
|
599
|
+
message.position !== undefined && (obj.position = openUnsafeAppRequest_PositionToJSON(message.position));
|
|
600
|
+
message.height !== undefined && (obj.height = message.height);
|
|
601
|
+
if (message.features) {
|
|
602
|
+
obj.features = message.features.map((e) => openUnsafeAppRequest_FeatureToJSON(e));
|
|
603
|
+
} else {
|
|
604
|
+
obj.features = [];
|
|
605
|
+
}
|
|
606
|
+
return obj;
|
|
607
|
+
},
|
|
608
|
+
|
|
609
|
+
fromPartial<I extends Exact<DeepPartial<OpenUnsafeAppRequest>, I>>(object: I): OpenUnsafeAppRequest {
|
|
610
|
+
const message = createBaseOpenUnsafeAppRequest();
|
|
611
|
+
message.url = object.url ?? "";
|
|
612
|
+
message.position = object.position ?? 0;
|
|
613
|
+
message.height = object.height ?? "";
|
|
614
|
+
message.features = object.features?.map((e) => e) || [];
|
|
615
|
+
return message;
|
|
616
|
+
},
|
|
617
|
+
};
|
|
618
|
+
|
|
619
|
+
function createBaseOpenAppMethodRequest(): OpenAppMethodRequest {
|
|
620
|
+
return {};
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
export const OpenAppMethodRequest = {
|
|
624
|
+
encode(_: OpenAppMethodRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
625
|
+
return writer;
|
|
626
|
+
},
|
|
627
|
+
|
|
628
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): OpenAppMethodRequest {
|
|
629
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
630
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
631
|
+
const message = createBaseOpenAppMethodRequest();
|
|
632
|
+
while (reader.pos < end) {
|
|
633
|
+
const tag = reader.uint32();
|
|
634
|
+
switch (tag >>> 3) {
|
|
635
|
+
default:
|
|
636
|
+
reader.skipType(tag & 7);
|
|
637
|
+
break;
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
return message;
|
|
641
|
+
},
|
|
642
|
+
|
|
643
|
+
fromJSON(_: any): OpenAppMethodRequest {
|
|
644
|
+
return {};
|
|
645
|
+
},
|
|
646
|
+
|
|
647
|
+
toJSON(_: OpenAppMethodRequest): unknown {
|
|
648
|
+
const obj: any = {};
|
|
649
|
+
return obj;
|
|
650
|
+
},
|
|
651
|
+
|
|
652
|
+
fromPartial<I extends Exact<DeepPartial<OpenAppMethodRequest>, I>>(_: I): OpenAppMethodRequest {
|
|
653
|
+
const message = createBaseOpenAppMethodRequest();
|
|
654
|
+
return message;
|
|
655
|
+
},
|
|
656
|
+
};
|
|
657
|
+
|
|
658
|
+
function createBaseOpenAppMethodReply(): OpenAppMethodReply {
|
|
659
|
+
return { support: 0 };
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
export const OpenAppMethodReply = {
|
|
663
|
+
encode(message: OpenAppMethodReply, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
664
|
+
if (message.support !== 0) {
|
|
665
|
+
writer.uint32(8).int32(message.support);
|
|
666
|
+
}
|
|
667
|
+
return writer;
|
|
668
|
+
},
|
|
669
|
+
|
|
670
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): OpenAppMethodReply {
|
|
671
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
672
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
673
|
+
const message = createBaseOpenAppMethodReply();
|
|
674
|
+
while (reader.pos < end) {
|
|
675
|
+
const tag = reader.uint32();
|
|
676
|
+
switch (tag >>> 3) {
|
|
677
|
+
case 1:
|
|
678
|
+
message.support = reader.int32() as any;
|
|
679
|
+
break;
|
|
680
|
+
default:
|
|
681
|
+
reader.skipType(tag & 7);
|
|
682
|
+
break;
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
return message;
|
|
686
|
+
},
|
|
687
|
+
|
|
688
|
+
fromJSON(object: any): OpenAppMethodReply {
|
|
689
|
+
return { support: isSet(object.support) ? openAppMethodReply_ModeFromJSON(object.support) : 0 };
|
|
690
|
+
},
|
|
691
|
+
|
|
692
|
+
toJSON(message: OpenAppMethodReply): unknown {
|
|
693
|
+
const obj: any = {};
|
|
694
|
+
message.support !== undefined && (obj.support = openAppMethodReply_ModeToJSON(message.support));
|
|
695
|
+
return obj;
|
|
696
|
+
},
|
|
697
|
+
|
|
698
|
+
fromPartial<I extends Exact<DeepPartial<OpenAppMethodReply>, I>>(object: I): OpenAppMethodReply {
|
|
699
|
+
const message = createBaseOpenAppMethodReply();
|
|
700
|
+
message.support = object.support ?? 0;
|
|
701
|
+
return message;
|
|
702
|
+
},
|
|
703
|
+
};
|
|
704
|
+
|
|
705
|
+
export interface LocalLaunchService {
|
|
706
|
+
/** 创建快捷方式 */
|
|
707
|
+
PinApp(request: DeepPartial<PinAppRequest>, metadata?: grpc.Metadata): Promise<PinAppReply>;
|
|
708
|
+
/** 删除快捷方式 */
|
|
709
|
+
UnPinApp(request: DeepPartial<UnPinAppRequest>, metadata?: grpc.Metadata): Promise<UnPinAppReply>;
|
|
710
|
+
/** 打开指定的懒猫云应用 */
|
|
711
|
+
OpenApp(request: DeepPartial<OpenAppRequest>, metadata?: grpc.Metadata): Promise<OpenAppReply>;
|
|
712
|
+
/**
|
|
713
|
+
* 使用不安全模式打开指定APP
|
|
714
|
+
* App页面由两个webview组成:一个control-view,一个content-view
|
|
715
|
+
* 其中app渲染在control-view中,content-view的内容由App代码控制
|
|
716
|
+
*/
|
|
717
|
+
OpenUnsafeApp(request: DeepPartial<OpenUnsafeAppRequest>, metadata?: grpc.Metadata): Promise<OpenAppReply>;
|
|
718
|
+
/** 当前设备支持的应用打开方式 */
|
|
719
|
+
OpenAppMethod(request: DeepPartial<OpenAppMethodRequest>, metadata?: grpc.Metadata): Promise<OpenAppMethodReply>;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
export class LocalLaunchServiceClientImpl implements LocalLaunchService {
|
|
723
|
+
private readonly rpc: Rpc;
|
|
724
|
+
|
|
725
|
+
constructor(rpc: Rpc) {
|
|
726
|
+
this.rpc = rpc;
|
|
727
|
+
this.PinApp = this.PinApp.bind(this);
|
|
728
|
+
this.UnPinApp = this.UnPinApp.bind(this);
|
|
729
|
+
this.OpenApp = this.OpenApp.bind(this);
|
|
730
|
+
this.OpenUnsafeApp = this.OpenUnsafeApp.bind(this);
|
|
731
|
+
this.OpenAppMethod = this.OpenAppMethod.bind(this);
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
PinApp(request: DeepPartial<PinAppRequest>, metadata?: grpc.Metadata): Promise<PinAppReply> {
|
|
735
|
+
return this.rpc.unary(LocalLaunchServicePinAppDesc, PinAppRequest.fromPartial(request), metadata);
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
UnPinApp(request: DeepPartial<UnPinAppRequest>, metadata?: grpc.Metadata): Promise<UnPinAppReply> {
|
|
739
|
+
return this.rpc.unary(LocalLaunchServiceUnPinAppDesc, UnPinAppRequest.fromPartial(request), metadata);
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
OpenApp(request: DeepPartial<OpenAppRequest>, metadata?: grpc.Metadata): Promise<OpenAppReply> {
|
|
743
|
+
return this.rpc.unary(LocalLaunchServiceOpenAppDesc, OpenAppRequest.fromPartial(request), metadata);
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
OpenUnsafeApp(request: DeepPartial<OpenUnsafeAppRequest>, metadata?: grpc.Metadata): Promise<OpenAppReply> {
|
|
747
|
+
return this.rpc.unary(LocalLaunchServiceOpenUnsafeAppDesc, OpenUnsafeAppRequest.fromPartial(request), metadata);
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
OpenAppMethod(request: DeepPartial<OpenAppMethodRequest>, metadata?: grpc.Metadata): Promise<OpenAppMethodReply> {
|
|
751
|
+
return this.rpc.unary(LocalLaunchServiceOpenAppMethodDesc, OpenAppMethodRequest.fromPartial(request), metadata);
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
export const LocalLaunchServiceDesc = { serviceName: "cloud.lazycat.apis.localdevice.LocalLaunchService" };
|
|
756
|
+
|
|
757
|
+
export const LocalLaunchServicePinAppDesc: UnaryMethodDefinitionish = {
|
|
758
|
+
methodName: "PinApp",
|
|
759
|
+
service: LocalLaunchServiceDesc,
|
|
760
|
+
requestStream: false,
|
|
761
|
+
responseStream: false,
|
|
762
|
+
requestType: {
|
|
763
|
+
serializeBinary() {
|
|
764
|
+
return PinAppRequest.encode(this).finish();
|
|
765
|
+
},
|
|
766
|
+
} as any,
|
|
767
|
+
responseType: {
|
|
768
|
+
deserializeBinary(data: Uint8Array) {
|
|
769
|
+
return {
|
|
770
|
+
...PinAppReply.decode(data),
|
|
771
|
+
toObject() {
|
|
772
|
+
return this;
|
|
773
|
+
},
|
|
774
|
+
};
|
|
775
|
+
},
|
|
776
|
+
} as any,
|
|
777
|
+
};
|
|
778
|
+
|
|
779
|
+
export const LocalLaunchServiceUnPinAppDesc: UnaryMethodDefinitionish = {
|
|
780
|
+
methodName: "UnPinApp",
|
|
781
|
+
service: LocalLaunchServiceDesc,
|
|
782
|
+
requestStream: false,
|
|
783
|
+
responseStream: false,
|
|
784
|
+
requestType: {
|
|
785
|
+
serializeBinary() {
|
|
786
|
+
return UnPinAppRequest.encode(this).finish();
|
|
787
|
+
},
|
|
788
|
+
} as any,
|
|
789
|
+
responseType: {
|
|
790
|
+
deserializeBinary(data: Uint8Array) {
|
|
791
|
+
return {
|
|
792
|
+
...UnPinAppReply.decode(data),
|
|
793
|
+
toObject() {
|
|
794
|
+
return this;
|
|
795
|
+
},
|
|
796
|
+
};
|
|
797
|
+
},
|
|
798
|
+
} as any,
|
|
799
|
+
};
|
|
800
|
+
|
|
801
|
+
export const LocalLaunchServiceOpenAppDesc: UnaryMethodDefinitionish = {
|
|
802
|
+
methodName: "OpenApp",
|
|
803
|
+
service: LocalLaunchServiceDesc,
|
|
804
|
+
requestStream: false,
|
|
805
|
+
responseStream: false,
|
|
806
|
+
requestType: {
|
|
807
|
+
serializeBinary() {
|
|
808
|
+
return OpenAppRequest.encode(this).finish();
|
|
809
|
+
},
|
|
810
|
+
} as any,
|
|
811
|
+
responseType: {
|
|
812
|
+
deserializeBinary(data: Uint8Array) {
|
|
813
|
+
return {
|
|
814
|
+
...OpenAppReply.decode(data),
|
|
815
|
+
toObject() {
|
|
816
|
+
return this;
|
|
817
|
+
},
|
|
818
|
+
};
|
|
819
|
+
},
|
|
820
|
+
} as any,
|
|
821
|
+
};
|
|
822
|
+
|
|
823
|
+
export const LocalLaunchServiceOpenUnsafeAppDesc: UnaryMethodDefinitionish = {
|
|
824
|
+
methodName: "OpenUnsafeApp",
|
|
825
|
+
service: LocalLaunchServiceDesc,
|
|
826
|
+
requestStream: false,
|
|
827
|
+
responseStream: false,
|
|
828
|
+
requestType: {
|
|
829
|
+
serializeBinary() {
|
|
830
|
+
return OpenUnsafeAppRequest.encode(this).finish();
|
|
831
|
+
},
|
|
832
|
+
} as any,
|
|
833
|
+
responseType: {
|
|
834
|
+
deserializeBinary(data: Uint8Array) {
|
|
835
|
+
return {
|
|
836
|
+
...OpenAppReply.decode(data),
|
|
837
|
+
toObject() {
|
|
838
|
+
return this;
|
|
839
|
+
},
|
|
840
|
+
};
|
|
841
|
+
},
|
|
842
|
+
} as any,
|
|
843
|
+
};
|
|
844
|
+
|
|
845
|
+
export const LocalLaunchServiceOpenAppMethodDesc: UnaryMethodDefinitionish = {
|
|
846
|
+
methodName: "OpenAppMethod",
|
|
847
|
+
service: LocalLaunchServiceDesc,
|
|
848
|
+
requestStream: false,
|
|
849
|
+
responseStream: false,
|
|
850
|
+
requestType: {
|
|
851
|
+
serializeBinary() {
|
|
852
|
+
return OpenAppMethodRequest.encode(this).finish();
|
|
853
|
+
},
|
|
854
|
+
} as any,
|
|
855
|
+
responseType: {
|
|
856
|
+
deserializeBinary(data: Uint8Array) {
|
|
857
|
+
return {
|
|
858
|
+
...OpenAppMethodReply.decode(data),
|
|
859
|
+
toObject() {
|
|
860
|
+
return this;
|
|
861
|
+
},
|
|
862
|
+
};
|
|
863
|
+
},
|
|
864
|
+
} as any,
|
|
865
|
+
};
|
|
866
|
+
|
|
867
|
+
interface UnaryMethodDefinitionishR extends grpc.UnaryMethodDefinition<any, any> {
|
|
868
|
+
requestStream: any;
|
|
869
|
+
responseStream: any;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
type UnaryMethodDefinitionish = UnaryMethodDefinitionishR;
|
|
873
|
+
|
|
874
|
+
interface Rpc {
|
|
875
|
+
unary<T extends UnaryMethodDefinitionish>(
|
|
876
|
+
methodDesc: T,
|
|
877
|
+
request: any,
|
|
878
|
+
metadata: grpc.Metadata | undefined,
|
|
879
|
+
): Promise<any>;
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
export class GrpcWebImpl {
|
|
883
|
+
private host: string;
|
|
884
|
+
private options: {
|
|
885
|
+
transport?: grpc.TransportFactory;
|
|
886
|
+
|
|
887
|
+
debug?: boolean;
|
|
888
|
+
metadata?: grpc.Metadata;
|
|
889
|
+
upStreamRetryCodes?: number[];
|
|
890
|
+
};
|
|
891
|
+
|
|
892
|
+
constructor(
|
|
893
|
+
host: string,
|
|
894
|
+
options: {
|
|
895
|
+
transport?: grpc.TransportFactory;
|
|
896
|
+
|
|
897
|
+
debug?: boolean;
|
|
898
|
+
metadata?: grpc.Metadata;
|
|
899
|
+
upStreamRetryCodes?: number[];
|
|
900
|
+
},
|
|
901
|
+
) {
|
|
902
|
+
this.host = host;
|
|
903
|
+
this.options = options;
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
unary<T extends UnaryMethodDefinitionish>(
|
|
907
|
+
methodDesc: T,
|
|
908
|
+
_request: any,
|
|
909
|
+
metadata: grpc.Metadata | undefined,
|
|
910
|
+
): Promise<any> {
|
|
911
|
+
const request = { ..._request, ...methodDesc.requestType };
|
|
912
|
+
const maybeCombinedMetadata = metadata && this.options.metadata
|
|
913
|
+
? new BrowserHeaders({ ...this.options?.metadata.headersMap, ...metadata?.headersMap })
|
|
914
|
+
: metadata || this.options.metadata;
|
|
915
|
+
return new Promise((resolve, reject) => {
|
|
916
|
+
grpc.unary(methodDesc, {
|
|
917
|
+
request,
|
|
918
|
+
host: this.host,
|
|
919
|
+
metadata: maybeCombinedMetadata,
|
|
920
|
+
transport: this.options.transport,
|
|
921
|
+
debug: this.options.debug,
|
|
922
|
+
onEnd: function (response) {
|
|
923
|
+
if (response.status === grpc.Code.OK) {
|
|
924
|
+
resolve(response.message);
|
|
925
|
+
} else {
|
|
926
|
+
const err = new GrpcWebError(response.statusMessage, response.status, response.trailers);
|
|
927
|
+
reject(err);
|
|
928
|
+
}
|
|
929
|
+
},
|
|
930
|
+
});
|
|
931
|
+
});
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
936
|
+
|
|
937
|
+
type DeepPartial<T> = T extends Builtin ? T
|
|
938
|
+
: T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
939
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
940
|
+
: Partial<T>;
|
|
941
|
+
|
|
942
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
943
|
+
type Exact<P, I extends P> = P extends Builtin ? P
|
|
944
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
945
|
+
|
|
946
|
+
function isSet(value: any): boolean {
|
|
947
|
+
return value !== null && value !== undefined;
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
export class GrpcWebError extends Error {
|
|
951
|
+
constructor(message: string, public code: grpc.Code, public metadata: grpc.Metadata) {
|
|
952
|
+
super(message);
|
|
953
|
+
}
|
|
954
|
+
}
|