@lazycatcloud/sdk 0.1.144 → 0.1.145
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/dist/package.json +5 -1
- package/package.json +5 -1
- package/common/box.ts +0 -545
- package/common/browseronly.ts +0 -520
- package/common/end_device.ts +0 -635
- package/common/file_handler.ts +0 -485
- package/common/filetrans.ts +0 -1936
- package/common/gateway.ts +0 -663
- package/common/media_meta.ts +0 -319
- package/common/message.ts +0 -242
- package/common/peripheral_device.ts +0 -783
- package/common/security_context.ts +0 -729
- package/common/users.ts +0 -1044
- package/dlna/dlna.ts +0 -895
- package/docs/contribute.md +0 -40
- package/docs/extentions/AppCommon.md +0 -30
- package/extentions/app_common.ts +0 -63
- package/extentions/base.ts +0 -459
- package/extentions/index.ts +0 -27
- package/extentions/safe_app.ts +0 -60
- package/extentions/unsafe_app.ts +0 -107
- package/google/protobuf/descriptor.ts +0 -3778
- package/google/protobuf/empty.ts +0 -64
- package/google/protobuf/timestamp.ts +0 -214
- package/grpcweb.ts +0 -106
- package/index.ts +0 -204
- package/lanforward/lanforward.ts +0 -301
- package/localdevice/clipboard.ts +0 -499
- package/localdevice/config.ts +0 -268
- package/localdevice/device.ts +0 -218
- package/localdevice/dialog.ts +0 -707
- package/localdevice/local-launch.ts +0 -954
- package/localdevice/network.ts +0 -273
- package/localdevice/permission.ts +0 -733
- package/localdevice/photo.ts +0 -1497
- package/ssdp/ssdp.ts +0 -332
- package/sys/OS_daemon.ts +0 -325
- package/sys/OS_snapshot.ts +0 -1714
- package/sys/OS_upgrader.ts +0 -782
- package/sys/btrfs.ts +0 -530
- package/sys/devopt.ts +0 -250
- package/sys/event.ts +0 -787
- package/sys/hc-core/hc-core.ts +0 -1582
- package/sys/ingress.ts +0 -953
- package/sys/network_manager.ts +0 -874
- package/sys/package_manager.ts +0 -1931
- package/sys/portal-server/portal-server.ts +0 -2934
- package/sys/snapd.ts +0 -861
- package/tsconfig.json +0 -15
package/sys/package_manager.ts
DELETED
|
@@ -1,1931 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
import { grpc } from "@improbable-eng/grpc-web";
|
|
3
|
-
import { BrowserHeaders } from "browser-headers";
|
|
4
|
-
import Long from "long";
|
|
5
|
-
import _m0 from "protobufjs/minimal";
|
|
6
|
-
import { Empty } from "../google/protobuf/empty";
|
|
7
|
-
|
|
8
|
-
export enum AppStatus {
|
|
9
|
-
NotInstalled = 0,
|
|
10
|
-
Downloading = 1,
|
|
11
|
-
Paused = 2,
|
|
12
|
-
Installing = 3,
|
|
13
|
-
Installed = 4,
|
|
14
|
-
Failed = 5,
|
|
15
|
-
UNRECOGNIZED = -1,
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function appStatusFromJSON(object: any): AppStatus {
|
|
19
|
-
switch (object) {
|
|
20
|
-
case 0:
|
|
21
|
-
case "NotInstalled":
|
|
22
|
-
return AppStatus.NotInstalled;
|
|
23
|
-
case 1:
|
|
24
|
-
case "Downloading":
|
|
25
|
-
return AppStatus.Downloading;
|
|
26
|
-
case 2:
|
|
27
|
-
case "Paused":
|
|
28
|
-
return AppStatus.Paused;
|
|
29
|
-
case 3:
|
|
30
|
-
case "Installing":
|
|
31
|
-
return AppStatus.Installing;
|
|
32
|
-
case 4:
|
|
33
|
-
case "Installed":
|
|
34
|
-
return AppStatus.Installed;
|
|
35
|
-
case 5:
|
|
36
|
-
case "Failed":
|
|
37
|
-
return AppStatus.Failed;
|
|
38
|
-
case -1:
|
|
39
|
-
case "UNRECOGNIZED":
|
|
40
|
-
default:
|
|
41
|
-
return AppStatus.UNRECOGNIZED;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export function appStatusToJSON(object: AppStatus): string {
|
|
46
|
-
switch (object) {
|
|
47
|
-
case AppStatus.NotInstalled:
|
|
48
|
-
return "NotInstalled";
|
|
49
|
-
case AppStatus.Downloading:
|
|
50
|
-
return "Downloading";
|
|
51
|
-
case AppStatus.Paused:
|
|
52
|
-
return "Paused";
|
|
53
|
-
case AppStatus.Installing:
|
|
54
|
-
return "Installing";
|
|
55
|
-
case AppStatus.Installed:
|
|
56
|
-
return "Installed";
|
|
57
|
-
case AppStatus.Failed:
|
|
58
|
-
return "Failed";
|
|
59
|
-
case AppStatus.UNRECOGNIZED:
|
|
60
|
-
default:
|
|
61
|
-
return "UNRECOGNIZED";
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export enum Action {
|
|
66
|
-
Open = 0,
|
|
67
|
-
New = 1,
|
|
68
|
-
Download = 2,
|
|
69
|
-
UNRECOGNIZED = -1,
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export function actionFromJSON(object: any): Action {
|
|
73
|
-
switch (object) {
|
|
74
|
-
case 0:
|
|
75
|
-
case "Open":
|
|
76
|
-
return Action.Open;
|
|
77
|
-
case 1:
|
|
78
|
-
case "New":
|
|
79
|
-
return Action.New;
|
|
80
|
-
case 2:
|
|
81
|
-
case "Download":
|
|
82
|
-
return Action.Download;
|
|
83
|
-
case -1:
|
|
84
|
-
case "UNRECOGNIZED":
|
|
85
|
-
default:
|
|
86
|
-
return Action.UNRECOGNIZED;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export function actionToJSON(object: Action): string {
|
|
91
|
-
switch (object) {
|
|
92
|
-
case Action.Open:
|
|
93
|
-
return "Open";
|
|
94
|
-
case Action.New:
|
|
95
|
-
return "New";
|
|
96
|
-
case Action.Download:
|
|
97
|
-
return "Download";
|
|
98
|
-
case Action.UNRECOGNIZED:
|
|
99
|
-
default:
|
|
100
|
-
return "UNRECOGNIZED";
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export interface PkgURL {
|
|
105
|
-
/**
|
|
106
|
-
* 内部地址
|
|
107
|
-
* http://pkgm.api-server.lzcapp/tmp/xxxx-0.2.1.lpk
|
|
108
|
-
* 或外网地址
|
|
109
|
-
* https://repo.lazycat.cloud/a/c/accc-0.2.1.lpk
|
|
110
|
-
*/
|
|
111
|
-
url: string;
|
|
112
|
-
/**
|
|
113
|
-
* pkg对应的sha256值,若不为空,
|
|
114
|
-
* 1. 本地有对应包的缓存,则会直接使用缓存
|
|
115
|
-
* 2. 本地若没有缓存,则会从 url 下载包,并校验包的 sha256 值
|
|
116
|
-
*/
|
|
117
|
-
sha256: string;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export interface InstallRequest {
|
|
121
|
-
/** 应用的 appid */
|
|
122
|
-
appid: string;
|
|
123
|
-
/**
|
|
124
|
-
* 内部地址
|
|
125
|
-
* http://pkgm.api-server.lzcapp/tmp/xxxx-0.2.1.lpk
|
|
126
|
-
* 或外网地址
|
|
127
|
-
* https://repo.lazycat.cloud/a/c/accc-0.2.1.lpk
|
|
128
|
-
*/
|
|
129
|
-
url: string;
|
|
130
|
-
/**
|
|
131
|
-
* pkg对应的sha256值,若不为空,
|
|
132
|
-
* 1. 本地有对应包的缓存,则会直接使用缓存
|
|
133
|
-
* 2. 本地若没有缓存,则会从 url 下载包,并校验包的 sha256 值
|
|
134
|
-
*/
|
|
135
|
-
sha256: string;
|
|
136
|
-
subdomain?: string | undefined;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
export interface UninstallRequest {
|
|
140
|
-
appid: string;
|
|
141
|
-
/** 卸载后是否清空 data 目录 (/lzcapp/var) */
|
|
142
|
-
clearData: boolean;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
export interface AppDownloadProgress {
|
|
146
|
-
/** 当前下载了的字节 */
|
|
147
|
-
current: number;
|
|
148
|
-
/** LPK文件大小总字节 */
|
|
149
|
-
total: number;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
export interface AppInfo {
|
|
153
|
-
appid: string;
|
|
154
|
-
/** 应用当前的状态 */
|
|
155
|
-
status: AppStatus;
|
|
156
|
-
version?: string | undefined;
|
|
157
|
-
title?: string | undefined;
|
|
158
|
-
description?:
|
|
159
|
-
| string
|
|
160
|
-
| undefined;
|
|
161
|
-
/**
|
|
162
|
-
* 应用图标所在的 url,如 https://apis.$boxdomain/icons/$appid.png
|
|
163
|
-
* 若应用无图标,则为空
|
|
164
|
-
*/
|
|
165
|
-
icon?:
|
|
166
|
-
| string
|
|
167
|
-
| undefined;
|
|
168
|
-
/** 应用所在的域名,如 app.box.heiyu.space */
|
|
169
|
-
domain?:
|
|
170
|
-
| string
|
|
171
|
-
| undefined;
|
|
172
|
-
/** 应用下载的进度(如果不是正在下载应用,则为空) */
|
|
173
|
-
downloadProgress?:
|
|
174
|
-
| AppDownloadProgress
|
|
175
|
-
| undefined;
|
|
176
|
-
/** 应用是否是预装应用(预装应用不可卸载) */
|
|
177
|
-
builtin?:
|
|
178
|
-
| boolean
|
|
179
|
-
| undefined;
|
|
180
|
-
/** 如果应用状态为安装失败,失败的原因(如果状态不是失败则为空) */
|
|
181
|
-
errorReason?: string | undefined;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
export interface QueryApplicationRequest {
|
|
185
|
-
/** 需要查询的 AppId 的列表,如果列表为空,则查询所有的应用 */
|
|
186
|
-
appidList: string[];
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
export interface QueryApplicationResponse {
|
|
190
|
-
infoList: AppInfo[];
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
export interface QueryAppStorageUsageRequest {
|
|
194
|
-
appid: string;
|
|
195
|
-
needPkg: boolean;
|
|
196
|
-
needData: boolean;
|
|
197
|
-
needCache: boolean;
|
|
198
|
-
needTmp: boolean;
|
|
199
|
-
needUserdata: boolean;
|
|
200
|
-
needImage: boolean;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
export interface AppStorageUsage {
|
|
204
|
-
/** 应用本身占用的大小 (/lzcapp/pkg) */
|
|
205
|
-
pkg: number;
|
|
206
|
-
/** 应用数据的大小 (所有用户产生的应用数据大小) (/lzcapp/var) */
|
|
207
|
-
data: number;
|
|
208
|
-
/** 应用缓存的大小 (/lzcapp/cache) */
|
|
209
|
-
cache: number;
|
|
210
|
-
/** 应用临时文件的大小 (/tmp) */
|
|
211
|
-
tmp: number;
|
|
212
|
-
/** 各个用户产生的应用数据大小 (/lzcapp/var/userdata/$uid) */
|
|
213
|
-
userdata: { [key: string]: number };
|
|
214
|
-
image: number;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
export interface AppStorageUsage_UserdataEntry {
|
|
218
|
-
key: string;
|
|
219
|
-
value: number;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
export interface UserPermission {
|
|
223
|
-
/** 用户的 uid */
|
|
224
|
-
uid: string;
|
|
225
|
-
/** 是否允许 uid 安装应用 */
|
|
226
|
-
allowInstallApp: boolean;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
export interface GetUserPermissionsRequest {
|
|
230
|
-
/** 用户的 uid */
|
|
231
|
-
uid: string;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
export interface Appid {
|
|
235
|
-
appid: string;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
export interface GetActionURLRequest {
|
|
239
|
-
path: string;
|
|
240
|
-
appid: string;
|
|
241
|
-
action: Action;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
export interface GetActionURLResponse {
|
|
245
|
-
url: string;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
export interface ListFileHandlerRequest {
|
|
249
|
-
mimetype: string;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
export interface FileHandlerInfo {
|
|
253
|
-
appid: string;
|
|
254
|
-
title: string;
|
|
255
|
-
icon: string;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
export interface ListFileHandlerResponse {
|
|
259
|
-
infoList: FileHandlerInfo[];
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
function createBasePkgURL(): PkgURL {
|
|
263
|
-
return { url: "", sha256: "" };
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
export const PkgURL = {
|
|
267
|
-
encode(message: PkgURL, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
268
|
-
if (message.url !== "") {
|
|
269
|
-
writer.uint32(10).string(message.url);
|
|
270
|
-
}
|
|
271
|
-
if (message.sha256 !== "") {
|
|
272
|
-
writer.uint32(18).string(message.sha256);
|
|
273
|
-
}
|
|
274
|
-
return writer;
|
|
275
|
-
},
|
|
276
|
-
|
|
277
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): PkgURL {
|
|
278
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
279
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
280
|
-
const message = createBasePkgURL();
|
|
281
|
-
while (reader.pos < end) {
|
|
282
|
-
const tag = reader.uint32();
|
|
283
|
-
switch (tag >>> 3) {
|
|
284
|
-
case 1:
|
|
285
|
-
message.url = reader.string();
|
|
286
|
-
break;
|
|
287
|
-
case 2:
|
|
288
|
-
message.sha256 = reader.string();
|
|
289
|
-
break;
|
|
290
|
-
default:
|
|
291
|
-
reader.skipType(tag & 7);
|
|
292
|
-
break;
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
return message;
|
|
296
|
-
},
|
|
297
|
-
|
|
298
|
-
fromJSON(object: any): PkgURL {
|
|
299
|
-
return {
|
|
300
|
-
url: isSet(object.url) ? String(object.url) : "",
|
|
301
|
-
sha256: isSet(object.sha256) ? String(object.sha256) : "",
|
|
302
|
-
};
|
|
303
|
-
},
|
|
304
|
-
|
|
305
|
-
toJSON(message: PkgURL): unknown {
|
|
306
|
-
const obj: any = {};
|
|
307
|
-
message.url !== undefined && (obj.url = message.url);
|
|
308
|
-
message.sha256 !== undefined && (obj.sha256 = message.sha256);
|
|
309
|
-
return obj;
|
|
310
|
-
},
|
|
311
|
-
|
|
312
|
-
fromPartial<I extends Exact<DeepPartial<PkgURL>, I>>(object: I): PkgURL {
|
|
313
|
-
const message = createBasePkgURL();
|
|
314
|
-
message.url = object.url ?? "";
|
|
315
|
-
message.sha256 = object.sha256 ?? "";
|
|
316
|
-
return message;
|
|
317
|
-
},
|
|
318
|
-
};
|
|
319
|
-
|
|
320
|
-
function createBaseInstallRequest(): InstallRequest {
|
|
321
|
-
return { appid: "", url: "", sha256: "", subdomain: undefined };
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
export const InstallRequest = {
|
|
325
|
-
encode(message: InstallRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
326
|
-
if (message.appid !== "") {
|
|
327
|
-
writer.uint32(10).string(message.appid);
|
|
328
|
-
}
|
|
329
|
-
if (message.url !== "") {
|
|
330
|
-
writer.uint32(18).string(message.url);
|
|
331
|
-
}
|
|
332
|
-
if (message.sha256 !== "") {
|
|
333
|
-
writer.uint32(26).string(message.sha256);
|
|
334
|
-
}
|
|
335
|
-
if (message.subdomain !== undefined) {
|
|
336
|
-
writer.uint32(34).string(message.subdomain);
|
|
337
|
-
}
|
|
338
|
-
return writer;
|
|
339
|
-
},
|
|
340
|
-
|
|
341
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): InstallRequest {
|
|
342
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
343
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
344
|
-
const message = createBaseInstallRequest();
|
|
345
|
-
while (reader.pos < end) {
|
|
346
|
-
const tag = reader.uint32();
|
|
347
|
-
switch (tag >>> 3) {
|
|
348
|
-
case 1:
|
|
349
|
-
message.appid = reader.string();
|
|
350
|
-
break;
|
|
351
|
-
case 2:
|
|
352
|
-
message.url = reader.string();
|
|
353
|
-
break;
|
|
354
|
-
case 3:
|
|
355
|
-
message.sha256 = reader.string();
|
|
356
|
-
break;
|
|
357
|
-
case 4:
|
|
358
|
-
message.subdomain = reader.string();
|
|
359
|
-
break;
|
|
360
|
-
default:
|
|
361
|
-
reader.skipType(tag & 7);
|
|
362
|
-
break;
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
return message;
|
|
366
|
-
},
|
|
367
|
-
|
|
368
|
-
fromJSON(object: any): InstallRequest {
|
|
369
|
-
return {
|
|
370
|
-
appid: isSet(object.appid) ? String(object.appid) : "",
|
|
371
|
-
url: isSet(object.url) ? String(object.url) : "",
|
|
372
|
-
sha256: isSet(object.sha256) ? String(object.sha256) : "",
|
|
373
|
-
subdomain: isSet(object.subdomain) ? String(object.subdomain) : undefined,
|
|
374
|
-
};
|
|
375
|
-
},
|
|
376
|
-
|
|
377
|
-
toJSON(message: InstallRequest): unknown {
|
|
378
|
-
const obj: any = {};
|
|
379
|
-
message.appid !== undefined && (obj.appid = message.appid);
|
|
380
|
-
message.url !== undefined && (obj.url = message.url);
|
|
381
|
-
message.sha256 !== undefined && (obj.sha256 = message.sha256);
|
|
382
|
-
message.subdomain !== undefined && (obj.subdomain = message.subdomain);
|
|
383
|
-
return obj;
|
|
384
|
-
},
|
|
385
|
-
|
|
386
|
-
fromPartial<I extends Exact<DeepPartial<InstallRequest>, I>>(object: I): InstallRequest {
|
|
387
|
-
const message = createBaseInstallRequest();
|
|
388
|
-
message.appid = object.appid ?? "";
|
|
389
|
-
message.url = object.url ?? "";
|
|
390
|
-
message.sha256 = object.sha256 ?? "";
|
|
391
|
-
message.subdomain = object.subdomain ?? undefined;
|
|
392
|
-
return message;
|
|
393
|
-
},
|
|
394
|
-
};
|
|
395
|
-
|
|
396
|
-
function createBaseUninstallRequest(): UninstallRequest {
|
|
397
|
-
return { appid: "", clearData: false };
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
export const UninstallRequest = {
|
|
401
|
-
encode(message: UninstallRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
402
|
-
if (message.appid !== "") {
|
|
403
|
-
writer.uint32(10).string(message.appid);
|
|
404
|
-
}
|
|
405
|
-
if (message.clearData === true) {
|
|
406
|
-
writer.uint32(16).bool(message.clearData);
|
|
407
|
-
}
|
|
408
|
-
return writer;
|
|
409
|
-
},
|
|
410
|
-
|
|
411
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): UninstallRequest {
|
|
412
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
413
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
414
|
-
const message = createBaseUninstallRequest();
|
|
415
|
-
while (reader.pos < end) {
|
|
416
|
-
const tag = reader.uint32();
|
|
417
|
-
switch (tag >>> 3) {
|
|
418
|
-
case 1:
|
|
419
|
-
message.appid = reader.string();
|
|
420
|
-
break;
|
|
421
|
-
case 2:
|
|
422
|
-
message.clearData = reader.bool();
|
|
423
|
-
break;
|
|
424
|
-
default:
|
|
425
|
-
reader.skipType(tag & 7);
|
|
426
|
-
break;
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
return message;
|
|
430
|
-
},
|
|
431
|
-
|
|
432
|
-
fromJSON(object: any): UninstallRequest {
|
|
433
|
-
return {
|
|
434
|
-
appid: isSet(object.appid) ? String(object.appid) : "",
|
|
435
|
-
clearData: isSet(object.clearData) ? Boolean(object.clearData) : false,
|
|
436
|
-
};
|
|
437
|
-
},
|
|
438
|
-
|
|
439
|
-
toJSON(message: UninstallRequest): unknown {
|
|
440
|
-
const obj: any = {};
|
|
441
|
-
message.appid !== undefined && (obj.appid = message.appid);
|
|
442
|
-
message.clearData !== undefined && (obj.clearData = message.clearData);
|
|
443
|
-
return obj;
|
|
444
|
-
},
|
|
445
|
-
|
|
446
|
-
fromPartial<I extends Exact<DeepPartial<UninstallRequest>, I>>(object: I): UninstallRequest {
|
|
447
|
-
const message = createBaseUninstallRequest();
|
|
448
|
-
message.appid = object.appid ?? "";
|
|
449
|
-
message.clearData = object.clearData ?? false;
|
|
450
|
-
return message;
|
|
451
|
-
},
|
|
452
|
-
};
|
|
453
|
-
|
|
454
|
-
function createBaseAppDownloadProgress(): AppDownloadProgress {
|
|
455
|
-
return { current: 0, total: 0 };
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
export const AppDownloadProgress = {
|
|
459
|
-
encode(message: AppDownloadProgress, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
460
|
-
if (message.current !== 0) {
|
|
461
|
-
writer.uint32(8).uint64(message.current);
|
|
462
|
-
}
|
|
463
|
-
if (message.total !== 0) {
|
|
464
|
-
writer.uint32(16).uint64(message.total);
|
|
465
|
-
}
|
|
466
|
-
return writer;
|
|
467
|
-
},
|
|
468
|
-
|
|
469
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): AppDownloadProgress {
|
|
470
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
471
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
472
|
-
const message = createBaseAppDownloadProgress();
|
|
473
|
-
while (reader.pos < end) {
|
|
474
|
-
const tag = reader.uint32();
|
|
475
|
-
switch (tag >>> 3) {
|
|
476
|
-
case 1:
|
|
477
|
-
message.current = longToNumber(reader.uint64() as Long);
|
|
478
|
-
break;
|
|
479
|
-
case 2:
|
|
480
|
-
message.total = longToNumber(reader.uint64() as Long);
|
|
481
|
-
break;
|
|
482
|
-
default:
|
|
483
|
-
reader.skipType(tag & 7);
|
|
484
|
-
break;
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
return message;
|
|
488
|
-
},
|
|
489
|
-
|
|
490
|
-
fromJSON(object: any): AppDownloadProgress {
|
|
491
|
-
return {
|
|
492
|
-
current: isSet(object.current) ? Number(object.current) : 0,
|
|
493
|
-
total: isSet(object.total) ? Number(object.total) : 0,
|
|
494
|
-
};
|
|
495
|
-
},
|
|
496
|
-
|
|
497
|
-
toJSON(message: AppDownloadProgress): unknown {
|
|
498
|
-
const obj: any = {};
|
|
499
|
-
message.current !== undefined && (obj.current = Math.round(message.current));
|
|
500
|
-
message.total !== undefined && (obj.total = Math.round(message.total));
|
|
501
|
-
return obj;
|
|
502
|
-
},
|
|
503
|
-
|
|
504
|
-
fromPartial<I extends Exact<DeepPartial<AppDownloadProgress>, I>>(object: I): AppDownloadProgress {
|
|
505
|
-
const message = createBaseAppDownloadProgress();
|
|
506
|
-
message.current = object.current ?? 0;
|
|
507
|
-
message.total = object.total ?? 0;
|
|
508
|
-
return message;
|
|
509
|
-
},
|
|
510
|
-
};
|
|
511
|
-
|
|
512
|
-
function createBaseAppInfo(): AppInfo {
|
|
513
|
-
return {
|
|
514
|
-
appid: "",
|
|
515
|
-
status: 0,
|
|
516
|
-
version: undefined,
|
|
517
|
-
title: undefined,
|
|
518
|
-
description: undefined,
|
|
519
|
-
icon: undefined,
|
|
520
|
-
domain: undefined,
|
|
521
|
-
downloadProgress: undefined,
|
|
522
|
-
builtin: undefined,
|
|
523
|
-
errorReason: undefined,
|
|
524
|
-
};
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
export const AppInfo = {
|
|
528
|
-
encode(message: AppInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
529
|
-
if (message.appid !== "") {
|
|
530
|
-
writer.uint32(10).string(message.appid);
|
|
531
|
-
}
|
|
532
|
-
if (message.status !== 0) {
|
|
533
|
-
writer.uint32(16).int32(message.status);
|
|
534
|
-
}
|
|
535
|
-
if (message.version !== undefined) {
|
|
536
|
-
writer.uint32(26).string(message.version);
|
|
537
|
-
}
|
|
538
|
-
if (message.title !== undefined) {
|
|
539
|
-
writer.uint32(34).string(message.title);
|
|
540
|
-
}
|
|
541
|
-
if (message.description !== undefined) {
|
|
542
|
-
writer.uint32(42).string(message.description);
|
|
543
|
-
}
|
|
544
|
-
if (message.icon !== undefined) {
|
|
545
|
-
writer.uint32(50).string(message.icon);
|
|
546
|
-
}
|
|
547
|
-
if (message.domain !== undefined) {
|
|
548
|
-
writer.uint32(58).string(message.domain);
|
|
549
|
-
}
|
|
550
|
-
if (message.downloadProgress !== undefined) {
|
|
551
|
-
AppDownloadProgress.encode(message.downloadProgress, writer.uint32(66).fork()).ldelim();
|
|
552
|
-
}
|
|
553
|
-
if (message.builtin !== undefined) {
|
|
554
|
-
writer.uint32(72).bool(message.builtin);
|
|
555
|
-
}
|
|
556
|
-
if (message.errorReason !== undefined) {
|
|
557
|
-
writer.uint32(82).string(message.errorReason);
|
|
558
|
-
}
|
|
559
|
-
return writer;
|
|
560
|
-
},
|
|
561
|
-
|
|
562
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): AppInfo {
|
|
563
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
564
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
565
|
-
const message = createBaseAppInfo();
|
|
566
|
-
while (reader.pos < end) {
|
|
567
|
-
const tag = reader.uint32();
|
|
568
|
-
switch (tag >>> 3) {
|
|
569
|
-
case 1:
|
|
570
|
-
message.appid = reader.string();
|
|
571
|
-
break;
|
|
572
|
-
case 2:
|
|
573
|
-
message.status = reader.int32() as any;
|
|
574
|
-
break;
|
|
575
|
-
case 3:
|
|
576
|
-
message.version = reader.string();
|
|
577
|
-
break;
|
|
578
|
-
case 4:
|
|
579
|
-
message.title = reader.string();
|
|
580
|
-
break;
|
|
581
|
-
case 5:
|
|
582
|
-
message.description = reader.string();
|
|
583
|
-
break;
|
|
584
|
-
case 6:
|
|
585
|
-
message.icon = reader.string();
|
|
586
|
-
break;
|
|
587
|
-
case 7:
|
|
588
|
-
message.domain = reader.string();
|
|
589
|
-
break;
|
|
590
|
-
case 8:
|
|
591
|
-
message.downloadProgress = AppDownloadProgress.decode(reader, reader.uint32());
|
|
592
|
-
break;
|
|
593
|
-
case 9:
|
|
594
|
-
message.builtin = reader.bool();
|
|
595
|
-
break;
|
|
596
|
-
case 10:
|
|
597
|
-
message.errorReason = reader.string();
|
|
598
|
-
break;
|
|
599
|
-
default:
|
|
600
|
-
reader.skipType(tag & 7);
|
|
601
|
-
break;
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
|
-
return message;
|
|
605
|
-
},
|
|
606
|
-
|
|
607
|
-
fromJSON(object: any): AppInfo {
|
|
608
|
-
return {
|
|
609
|
-
appid: isSet(object.appid) ? String(object.appid) : "",
|
|
610
|
-
status: isSet(object.status) ? appStatusFromJSON(object.status) : 0,
|
|
611
|
-
version: isSet(object.version) ? String(object.version) : undefined,
|
|
612
|
-
title: isSet(object.title) ? String(object.title) : undefined,
|
|
613
|
-
description: isSet(object.description) ? String(object.description) : undefined,
|
|
614
|
-
icon: isSet(object.icon) ? String(object.icon) : undefined,
|
|
615
|
-
domain: isSet(object.domain) ? String(object.domain) : undefined,
|
|
616
|
-
downloadProgress: isSet(object.downloadProgress)
|
|
617
|
-
? AppDownloadProgress.fromJSON(object.downloadProgress)
|
|
618
|
-
: undefined,
|
|
619
|
-
builtin: isSet(object.builtin) ? Boolean(object.builtin) : undefined,
|
|
620
|
-
errorReason: isSet(object.errorReason) ? String(object.errorReason) : undefined,
|
|
621
|
-
};
|
|
622
|
-
},
|
|
623
|
-
|
|
624
|
-
toJSON(message: AppInfo): unknown {
|
|
625
|
-
const obj: any = {};
|
|
626
|
-
message.appid !== undefined && (obj.appid = message.appid);
|
|
627
|
-
message.status !== undefined && (obj.status = appStatusToJSON(message.status));
|
|
628
|
-
message.version !== undefined && (obj.version = message.version);
|
|
629
|
-
message.title !== undefined && (obj.title = message.title);
|
|
630
|
-
message.description !== undefined && (obj.description = message.description);
|
|
631
|
-
message.icon !== undefined && (obj.icon = message.icon);
|
|
632
|
-
message.domain !== undefined && (obj.domain = message.domain);
|
|
633
|
-
message.downloadProgress !== undefined && (obj.downloadProgress = message.downloadProgress
|
|
634
|
-
? AppDownloadProgress.toJSON(message.downloadProgress)
|
|
635
|
-
: undefined);
|
|
636
|
-
message.builtin !== undefined && (obj.builtin = message.builtin);
|
|
637
|
-
message.errorReason !== undefined && (obj.errorReason = message.errorReason);
|
|
638
|
-
return obj;
|
|
639
|
-
},
|
|
640
|
-
|
|
641
|
-
fromPartial<I extends Exact<DeepPartial<AppInfo>, I>>(object: I): AppInfo {
|
|
642
|
-
const message = createBaseAppInfo();
|
|
643
|
-
message.appid = object.appid ?? "";
|
|
644
|
-
message.status = object.status ?? 0;
|
|
645
|
-
message.version = object.version ?? undefined;
|
|
646
|
-
message.title = object.title ?? undefined;
|
|
647
|
-
message.description = object.description ?? undefined;
|
|
648
|
-
message.icon = object.icon ?? undefined;
|
|
649
|
-
message.domain = object.domain ?? undefined;
|
|
650
|
-
message.downloadProgress = (object.downloadProgress !== undefined && object.downloadProgress !== null)
|
|
651
|
-
? AppDownloadProgress.fromPartial(object.downloadProgress)
|
|
652
|
-
: undefined;
|
|
653
|
-
message.builtin = object.builtin ?? undefined;
|
|
654
|
-
message.errorReason = object.errorReason ?? undefined;
|
|
655
|
-
return message;
|
|
656
|
-
},
|
|
657
|
-
};
|
|
658
|
-
|
|
659
|
-
function createBaseQueryApplicationRequest(): QueryApplicationRequest {
|
|
660
|
-
return { appidList: [] };
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
export const QueryApplicationRequest = {
|
|
664
|
-
encode(message: QueryApplicationRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
665
|
-
for (const v of message.appidList) {
|
|
666
|
-
writer.uint32(10).string(v!);
|
|
667
|
-
}
|
|
668
|
-
return writer;
|
|
669
|
-
},
|
|
670
|
-
|
|
671
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): QueryApplicationRequest {
|
|
672
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
673
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
674
|
-
const message = createBaseQueryApplicationRequest();
|
|
675
|
-
while (reader.pos < end) {
|
|
676
|
-
const tag = reader.uint32();
|
|
677
|
-
switch (tag >>> 3) {
|
|
678
|
-
case 1:
|
|
679
|
-
message.appidList.push(reader.string());
|
|
680
|
-
break;
|
|
681
|
-
default:
|
|
682
|
-
reader.skipType(tag & 7);
|
|
683
|
-
break;
|
|
684
|
-
}
|
|
685
|
-
}
|
|
686
|
-
return message;
|
|
687
|
-
},
|
|
688
|
-
|
|
689
|
-
fromJSON(object: any): QueryApplicationRequest {
|
|
690
|
-
return { appidList: Array.isArray(object?.appidList) ? object.appidList.map((e: any) => String(e)) : [] };
|
|
691
|
-
},
|
|
692
|
-
|
|
693
|
-
toJSON(message: QueryApplicationRequest): unknown {
|
|
694
|
-
const obj: any = {};
|
|
695
|
-
if (message.appidList) {
|
|
696
|
-
obj.appidList = message.appidList.map((e) => e);
|
|
697
|
-
} else {
|
|
698
|
-
obj.appidList = [];
|
|
699
|
-
}
|
|
700
|
-
return obj;
|
|
701
|
-
},
|
|
702
|
-
|
|
703
|
-
fromPartial<I extends Exact<DeepPartial<QueryApplicationRequest>, I>>(object: I): QueryApplicationRequest {
|
|
704
|
-
const message = createBaseQueryApplicationRequest();
|
|
705
|
-
message.appidList = object.appidList?.map((e) => e) || [];
|
|
706
|
-
return message;
|
|
707
|
-
},
|
|
708
|
-
};
|
|
709
|
-
|
|
710
|
-
function createBaseQueryApplicationResponse(): QueryApplicationResponse {
|
|
711
|
-
return { infoList: [] };
|
|
712
|
-
}
|
|
713
|
-
|
|
714
|
-
export const QueryApplicationResponse = {
|
|
715
|
-
encode(message: QueryApplicationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
716
|
-
for (const v of message.infoList) {
|
|
717
|
-
AppInfo.encode(v!, writer.uint32(10).fork()).ldelim();
|
|
718
|
-
}
|
|
719
|
-
return writer;
|
|
720
|
-
},
|
|
721
|
-
|
|
722
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): QueryApplicationResponse {
|
|
723
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
724
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
725
|
-
const message = createBaseQueryApplicationResponse();
|
|
726
|
-
while (reader.pos < end) {
|
|
727
|
-
const tag = reader.uint32();
|
|
728
|
-
switch (tag >>> 3) {
|
|
729
|
-
case 1:
|
|
730
|
-
message.infoList.push(AppInfo.decode(reader, reader.uint32()));
|
|
731
|
-
break;
|
|
732
|
-
default:
|
|
733
|
-
reader.skipType(tag & 7);
|
|
734
|
-
break;
|
|
735
|
-
}
|
|
736
|
-
}
|
|
737
|
-
return message;
|
|
738
|
-
},
|
|
739
|
-
|
|
740
|
-
fromJSON(object: any): QueryApplicationResponse {
|
|
741
|
-
return { infoList: Array.isArray(object?.infoList) ? object.infoList.map((e: any) => AppInfo.fromJSON(e)) : [] };
|
|
742
|
-
},
|
|
743
|
-
|
|
744
|
-
toJSON(message: QueryApplicationResponse): unknown {
|
|
745
|
-
const obj: any = {};
|
|
746
|
-
if (message.infoList) {
|
|
747
|
-
obj.infoList = message.infoList.map((e) => e ? AppInfo.toJSON(e) : undefined);
|
|
748
|
-
} else {
|
|
749
|
-
obj.infoList = [];
|
|
750
|
-
}
|
|
751
|
-
return obj;
|
|
752
|
-
},
|
|
753
|
-
|
|
754
|
-
fromPartial<I extends Exact<DeepPartial<QueryApplicationResponse>, I>>(object: I): QueryApplicationResponse {
|
|
755
|
-
const message = createBaseQueryApplicationResponse();
|
|
756
|
-
message.infoList = object.infoList?.map((e) => AppInfo.fromPartial(e)) || [];
|
|
757
|
-
return message;
|
|
758
|
-
},
|
|
759
|
-
};
|
|
760
|
-
|
|
761
|
-
function createBaseQueryAppStorageUsageRequest(): QueryAppStorageUsageRequest {
|
|
762
|
-
return {
|
|
763
|
-
appid: "",
|
|
764
|
-
needPkg: false,
|
|
765
|
-
needData: false,
|
|
766
|
-
needCache: false,
|
|
767
|
-
needTmp: false,
|
|
768
|
-
needUserdata: false,
|
|
769
|
-
needImage: false,
|
|
770
|
-
};
|
|
771
|
-
}
|
|
772
|
-
|
|
773
|
-
export const QueryAppStorageUsageRequest = {
|
|
774
|
-
encode(message: QueryAppStorageUsageRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
775
|
-
if (message.appid !== "") {
|
|
776
|
-
writer.uint32(10).string(message.appid);
|
|
777
|
-
}
|
|
778
|
-
if (message.needPkg === true) {
|
|
779
|
-
writer.uint32(16).bool(message.needPkg);
|
|
780
|
-
}
|
|
781
|
-
if (message.needData === true) {
|
|
782
|
-
writer.uint32(24).bool(message.needData);
|
|
783
|
-
}
|
|
784
|
-
if (message.needCache === true) {
|
|
785
|
-
writer.uint32(32).bool(message.needCache);
|
|
786
|
-
}
|
|
787
|
-
if (message.needTmp === true) {
|
|
788
|
-
writer.uint32(40).bool(message.needTmp);
|
|
789
|
-
}
|
|
790
|
-
if (message.needUserdata === true) {
|
|
791
|
-
writer.uint32(48).bool(message.needUserdata);
|
|
792
|
-
}
|
|
793
|
-
if (message.needImage === true) {
|
|
794
|
-
writer.uint32(56).bool(message.needImage);
|
|
795
|
-
}
|
|
796
|
-
return writer;
|
|
797
|
-
},
|
|
798
|
-
|
|
799
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): QueryAppStorageUsageRequest {
|
|
800
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
801
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
802
|
-
const message = createBaseQueryAppStorageUsageRequest();
|
|
803
|
-
while (reader.pos < end) {
|
|
804
|
-
const tag = reader.uint32();
|
|
805
|
-
switch (tag >>> 3) {
|
|
806
|
-
case 1:
|
|
807
|
-
message.appid = reader.string();
|
|
808
|
-
break;
|
|
809
|
-
case 2:
|
|
810
|
-
message.needPkg = reader.bool();
|
|
811
|
-
break;
|
|
812
|
-
case 3:
|
|
813
|
-
message.needData = reader.bool();
|
|
814
|
-
break;
|
|
815
|
-
case 4:
|
|
816
|
-
message.needCache = reader.bool();
|
|
817
|
-
break;
|
|
818
|
-
case 5:
|
|
819
|
-
message.needTmp = reader.bool();
|
|
820
|
-
break;
|
|
821
|
-
case 6:
|
|
822
|
-
message.needUserdata = reader.bool();
|
|
823
|
-
break;
|
|
824
|
-
case 7:
|
|
825
|
-
message.needImage = reader.bool();
|
|
826
|
-
break;
|
|
827
|
-
default:
|
|
828
|
-
reader.skipType(tag & 7);
|
|
829
|
-
break;
|
|
830
|
-
}
|
|
831
|
-
}
|
|
832
|
-
return message;
|
|
833
|
-
},
|
|
834
|
-
|
|
835
|
-
fromJSON(object: any): QueryAppStorageUsageRequest {
|
|
836
|
-
return {
|
|
837
|
-
appid: isSet(object.appid) ? String(object.appid) : "",
|
|
838
|
-
needPkg: isSet(object.needPkg) ? Boolean(object.needPkg) : false,
|
|
839
|
-
needData: isSet(object.needData) ? Boolean(object.needData) : false,
|
|
840
|
-
needCache: isSet(object.needCache) ? Boolean(object.needCache) : false,
|
|
841
|
-
needTmp: isSet(object.needTmp) ? Boolean(object.needTmp) : false,
|
|
842
|
-
needUserdata: isSet(object.needUserdata) ? Boolean(object.needUserdata) : false,
|
|
843
|
-
needImage: isSet(object.needImage) ? Boolean(object.needImage) : false,
|
|
844
|
-
};
|
|
845
|
-
},
|
|
846
|
-
|
|
847
|
-
toJSON(message: QueryAppStorageUsageRequest): unknown {
|
|
848
|
-
const obj: any = {};
|
|
849
|
-
message.appid !== undefined && (obj.appid = message.appid);
|
|
850
|
-
message.needPkg !== undefined && (obj.needPkg = message.needPkg);
|
|
851
|
-
message.needData !== undefined && (obj.needData = message.needData);
|
|
852
|
-
message.needCache !== undefined && (obj.needCache = message.needCache);
|
|
853
|
-
message.needTmp !== undefined && (obj.needTmp = message.needTmp);
|
|
854
|
-
message.needUserdata !== undefined && (obj.needUserdata = message.needUserdata);
|
|
855
|
-
message.needImage !== undefined && (obj.needImage = message.needImage);
|
|
856
|
-
return obj;
|
|
857
|
-
},
|
|
858
|
-
|
|
859
|
-
fromPartial<I extends Exact<DeepPartial<QueryAppStorageUsageRequest>, I>>(object: I): QueryAppStorageUsageRequest {
|
|
860
|
-
const message = createBaseQueryAppStorageUsageRequest();
|
|
861
|
-
message.appid = object.appid ?? "";
|
|
862
|
-
message.needPkg = object.needPkg ?? false;
|
|
863
|
-
message.needData = object.needData ?? false;
|
|
864
|
-
message.needCache = object.needCache ?? false;
|
|
865
|
-
message.needTmp = object.needTmp ?? false;
|
|
866
|
-
message.needUserdata = object.needUserdata ?? false;
|
|
867
|
-
message.needImage = object.needImage ?? false;
|
|
868
|
-
return message;
|
|
869
|
-
},
|
|
870
|
-
};
|
|
871
|
-
|
|
872
|
-
function createBaseAppStorageUsage(): AppStorageUsage {
|
|
873
|
-
return { pkg: 0, data: 0, cache: 0, tmp: 0, userdata: {}, image: 0 };
|
|
874
|
-
}
|
|
875
|
-
|
|
876
|
-
export const AppStorageUsage = {
|
|
877
|
-
encode(message: AppStorageUsage, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
878
|
-
if (message.pkg !== 0) {
|
|
879
|
-
writer.uint32(8).uint64(message.pkg);
|
|
880
|
-
}
|
|
881
|
-
if (message.data !== 0) {
|
|
882
|
-
writer.uint32(16).uint64(message.data);
|
|
883
|
-
}
|
|
884
|
-
if (message.cache !== 0) {
|
|
885
|
-
writer.uint32(24).uint64(message.cache);
|
|
886
|
-
}
|
|
887
|
-
if (message.tmp !== 0) {
|
|
888
|
-
writer.uint32(32).uint64(message.tmp);
|
|
889
|
-
}
|
|
890
|
-
Object.entries(message.userdata).forEach(([key, value]) => {
|
|
891
|
-
AppStorageUsage_UserdataEntry.encode({ key: key as any, value }, writer.uint32(42).fork()).ldelim();
|
|
892
|
-
});
|
|
893
|
-
if (message.image !== 0) {
|
|
894
|
-
writer.uint32(48).uint64(message.image);
|
|
895
|
-
}
|
|
896
|
-
return writer;
|
|
897
|
-
},
|
|
898
|
-
|
|
899
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): AppStorageUsage {
|
|
900
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
901
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
902
|
-
const message = createBaseAppStorageUsage();
|
|
903
|
-
while (reader.pos < end) {
|
|
904
|
-
const tag = reader.uint32();
|
|
905
|
-
switch (tag >>> 3) {
|
|
906
|
-
case 1:
|
|
907
|
-
message.pkg = longToNumber(reader.uint64() as Long);
|
|
908
|
-
break;
|
|
909
|
-
case 2:
|
|
910
|
-
message.data = longToNumber(reader.uint64() as Long);
|
|
911
|
-
break;
|
|
912
|
-
case 3:
|
|
913
|
-
message.cache = longToNumber(reader.uint64() as Long);
|
|
914
|
-
break;
|
|
915
|
-
case 4:
|
|
916
|
-
message.tmp = longToNumber(reader.uint64() as Long);
|
|
917
|
-
break;
|
|
918
|
-
case 5:
|
|
919
|
-
const entry5 = AppStorageUsage_UserdataEntry.decode(reader, reader.uint32());
|
|
920
|
-
if (entry5.value !== undefined) {
|
|
921
|
-
message.userdata[entry5.key] = entry5.value;
|
|
922
|
-
}
|
|
923
|
-
break;
|
|
924
|
-
case 6:
|
|
925
|
-
message.image = longToNumber(reader.uint64() as Long);
|
|
926
|
-
break;
|
|
927
|
-
default:
|
|
928
|
-
reader.skipType(tag & 7);
|
|
929
|
-
break;
|
|
930
|
-
}
|
|
931
|
-
}
|
|
932
|
-
return message;
|
|
933
|
-
},
|
|
934
|
-
|
|
935
|
-
fromJSON(object: any): AppStorageUsage {
|
|
936
|
-
return {
|
|
937
|
-
pkg: isSet(object.pkg) ? Number(object.pkg) : 0,
|
|
938
|
-
data: isSet(object.data) ? Number(object.data) : 0,
|
|
939
|
-
cache: isSet(object.cache) ? Number(object.cache) : 0,
|
|
940
|
-
tmp: isSet(object.tmp) ? Number(object.tmp) : 0,
|
|
941
|
-
userdata: isObject(object.userdata)
|
|
942
|
-
? Object.entries(object.userdata).reduce<{ [key: string]: number }>((acc, [key, value]) => {
|
|
943
|
-
acc[key] = Number(value);
|
|
944
|
-
return acc;
|
|
945
|
-
}, {})
|
|
946
|
-
: {},
|
|
947
|
-
image: isSet(object.image) ? Number(object.image) : 0,
|
|
948
|
-
};
|
|
949
|
-
},
|
|
950
|
-
|
|
951
|
-
toJSON(message: AppStorageUsage): unknown {
|
|
952
|
-
const obj: any = {};
|
|
953
|
-
message.pkg !== undefined && (obj.pkg = Math.round(message.pkg));
|
|
954
|
-
message.data !== undefined && (obj.data = Math.round(message.data));
|
|
955
|
-
message.cache !== undefined && (obj.cache = Math.round(message.cache));
|
|
956
|
-
message.tmp !== undefined && (obj.tmp = Math.round(message.tmp));
|
|
957
|
-
obj.userdata = {};
|
|
958
|
-
if (message.userdata) {
|
|
959
|
-
Object.entries(message.userdata).forEach(([k, v]) => {
|
|
960
|
-
obj.userdata[k] = Math.round(v);
|
|
961
|
-
});
|
|
962
|
-
}
|
|
963
|
-
message.image !== undefined && (obj.image = Math.round(message.image));
|
|
964
|
-
return obj;
|
|
965
|
-
},
|
|
966
|
-
|
|
967
|
-
fromPartial<I extends Exact<DeepPartial<AppStorageUsage>, I>>(object: I): AppStorageUsage {
|
|
968
|
-
const message = createBaseAppStorageUsage();
|
|
969
|
-
message.pkg = object.pkg ?? 0;
|
|
970
|
-
message.data = object.data ?? 0;
|
|
971
|
-
message.cache = object.cache ?? 0;
|
|
972
|
-
message.tmp = object.tmp ?? 0;
|
|
973
|
-
message.userdata = Object.entries(object.userdata ?? {}).reduce<{ [key: string]: number }>((acc, [key, value]) => {
|
|
974
|
-
if (value !== undefined) {
|
|
975
|
-
acc[key] = Number(value);
|
|
976
|
-
}
|
|
977
|
-
return acc;
|
|
978
|
-
}, {});
|
|
979
|
-
message.image = object.image ?? 0;
|
|
980
|
-
return message;
|
|
981
|
-
},
|
|
982
|
-
};
|
|
983
|
-
|
|
984
|
-
function createBaseAppStorageUsage_UserdataEntry(): AppStorageUsage_UserdataEntry {
|
|
985
|
-
return { key: "", value: 0 };
|
|
986
|
-
}
|
|
987
|
-
|
|
988
|
-
export const AppStorageUsage_UserdataEntry = {
|
|
989
|
-
encode(message: AppStorageUsage_UserdataEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
990
|
-
if (message.key !== "") {
|
|
991
|
-
writer.uint32(10).string(message.key);
|
|
992
|
-
}
|
|
993
|
-
if (message.value !== 0) {
|
|
994
|
-
writer.uint32(16).uint64(message.value);
|
|
995
|
-
}
|
|
996
|
-
return writer;
|
|
997
|
-
},
|
|
998
|
-
|
|
999
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): AppStorageUsage_UserdataEntry {
|
|
1000
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
1001
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1002
|
-
const message = createBaseAppStorageUsage_UserdataEntry();
|
|
1003
|
-
while (reader.pos < end) {
|
|
1004
|
-
const tag = reader.uint32();
|
|
1005
|
-
switch (tag >>> 3) {
|
|
1006
|
-
case 1:
|
|
1007
|
-
message.key = reader.string();
|
|
1008
|
-
break;
|
|
1009
|
-
case 2:
|
|
1010
|
-
message.value = longToNumber(reader.uint64() as Long);
|
|
1011
|
-
break;
|
|
1012
|
-
default:
|
|
1013
|
-
reader.skipType(tag & 7);
|
|
1014
|
-
break;
|
|
1015
|
-
}
|
|
1016
|
-
}
|
|
1017
|
-
return message;
|
|
1018
|
-
},
|
|
1019
|
-
|
|
1020
|
-
fromJSON(object: any): AppStorageUsage_UserdataEntry {
|
|
1021
|
-
return { key: isSet(object.key) ? String(object.key) : "", value: isSet(object.value) ? Number(object.value) : 0 };
|
|
1022
|
-
},
|
|
1023
|
-
|
|
1024
|
-
toJSON(message: AppStorageUsage_UserdataEntry): unknown {
|
|
1025
|
-
const obj: any = {};
|
|
1026
|
-
message.key !== undefined && (obj.key = message.key);
|
|
1027
|
-
message.value !== undefined && (obj.value = Math.round(message.value));
|
|
1028
|
-
return obj;
|
|
1029
|
-
},
|
|
1030
|
-
|
|
1031
|
-
fromPartial<I extends Exact<DeepPartial<AppStorageUsage_UserdataEntry>, I>>(
|
|
1032
|
-
object: I,
|
|
1033
|
-
): AppStorageUsage_UserdataEntry {
|
|
1034
|
-
const message = createBaseAppStorageUsage_UserdataEntry();
|
|
1035
|
-
message.key = object.key ?? "";
|
|
1036
|
-
message.value = object.value ?? 0;
|
|
1037
|
-
return message;
|
|
1038
|
-
},
|
|
1039
|
-
};
|
|
1040
|
-
|
|
1041
|
-
function createBaseUserPermission(): UserPermission {
|
|
1042
|
-
return { uid: "", allowInstallApp: false };
|
|
1043
|
-
}
|
|
1044
|
-
|
|
1045
|
-
export const UserPermission = {
|
|
1046
|
-
encode(message: UserPermission, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
1047
|
-
if (message.uid !== "") {
|
|
1048
|
-
writer.uint32(10).string(message.uid);
|
|
1049
|
-
}
|
|
1050
|
-
if (message.allowInstallApp === true) {
|
|
1051
|
-
writer.uint32(16).bool(message.allowInstallApp);
|
|
1052
|
-
}
|
|
1053
|
-
return writer;
|
|
1054
|
-
},
|
|
1055
|
-
|
|
1056
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): UserPermission {
|
|
1057
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
1058
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1059
|
-
const message = createBaseUserPermission();
|
|
1060
|
-
while (reader.pos < end) {
|
|
1061
|
-
const tag = reader.uint32();
|
|
1062
|
-
switch (tag >>> 3) {
|
|
1063
|
-
case 1:
|
|
1064
|
-
message.uid = reader.string();
|
|
1065
|
-
break;
|
|
1066
|
-
case 2:
|
|
1067
|
-
message.allowInstallApp = reader.bool();
|
|
1068
|
-
break;
|
|
1069
|
-
default:
|
|
1070
|
-
reader.skipType(tag & 7);
|
|
1071
|
-
break;
|
|
1072
|
-
}
|
|
1073
|
-
}
|
|
1074
|
-
return message;
|
|
1075
|
-
},
|
|
1076
|
-
|
|
1077
|
-
fromJSON(object: any): UserPermission {
|
|
1078
|
-
return {
|
|
1079
|
-
uid: isSet(object.uid) ? String(object.uid) : "",
|
|
1080
|
-
allowInstallApp: isSet(object.allowInstallApp) ? Boolean(object.allowInstallApp) : false,
|
|
1081
|
-
};
|
|
1082
|
-
},
|
|
1083
|
-
|
|
1084
|
-
toJSON(message: UserPermission): unknown {
|
|
1085
|
-
const obj: any = {};
|
|
1086
|
-
message.uid !== undefined && (obj.uid = message.uid);
|
|
1087
|
-
message.allowInstallApp !== undefined && (obj.allowInstallApp = message.allowInstallApp);
|
|
1088
|
-
return obj;
|
|
1089
|
-
},
|
|
1090
|
-
|
|
1091
|
-
fromPartial<I extends Exact<DeepPartial<UserPermission>, I>>(object: I): UserPermission {
|
|
1092
|
-
const message = createBaseUserPermission();
|
|
1093
|
-
message.uid = object.uid ?? "";
|
|
1094
|
-
message.allowInstallApp = object.allowInstallApp ?? false;
|
|
1095
|
-
return message;
|
|
1096
|
-
},
|
|
1097
|
-
};
|
|
1098
|
-
|
|
1099
|
-
function createBaseGetUserPermissionsRequest(): GetUserPermissionsRequest {
|
|
1100
|
-
return { uid: "" };
|
|
1101
|
-
}
|
|
1102
|
-
|
|
1103
|
-
export const GetUserPermissionsRequest = {
|
|
1104
|
-
encode(message: GetUserPermissionsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
1105
|
-
if (message.uid !== "") {
|
|
1106
|
-
writer.uint32(10).string(message.uid);
|
|
1107
|
-
}
|
|
1108
|
-
return writer;
|
|
1109
|
-
},
|
|
1110
|
-
|
|
1111
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): GetUserPermissionsRequest {
|
|
1112
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
1113
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1114
|
-
const message = createBaseGetUserPermissionsRequest();
|
|
1115
|
-
while (reader.pos < end) {
|
|
1116
|
-
const tag = reader.uint32();
|
|
1117
|
-
switch (tag >>> 3) {
|
|
1118
|
-
case 1:
|
|
1119
|
-
message.uid = reader.string();
|
|
1120
|
-
break;
|
|
1121
|
-
default:
|
|
1122
|
-
reader.skipType(tag & 7);
|
|
1123
|
-
break;
|
|
1124
|
-
}
|
|
1125
|
-
}
|
|
1126
|
-
return message;
|
|
1127
|
-
},
|
|
1128
|
-
|
|
1129
|
-
fromJSON(object: any): GetUserPermissionsRequest {
|
|
1130
|
-
return { uid: isSet(object.uid) ? String(object.uid) : "" };
|
|
1131
|
-
},
|
|
1132
|
-
|
|
1133
|
-
toJSON(message: GetUserPermissionsRequest): unknown {
|
|
1134
|
-
const obj: any = {};
|
|
1135
|
-
message.uid !== undefined && (obj.uid = message.uid);
|
|
1136
|
-
return obj;
|
|
1137
|
-
},
|
|
1138
|
-
|
|
1139
|
-
fromPartial<I extends Exact<DeepPartial<GetUserPermissionsRequest>, I>>(object: I): GetUserPermissionsRequest {
|
|
1140
|
-
const message = createBaseGetUserPermissionsRequest();
|
|
1141
|
-
message.uid = object.uid ?? "";
|
|
1142
|
-
return message;
|
|
1143
|
-
},
|
|
1144
|
-
};
|
|
1145
|
-
|
|
1146
|
-
function createBaseAppid(): Appid {
|
|
1147
|
-
return { appid: "" };
|
|
1148
|
-
}
|
|
1149
|
-
|
|
1150
|
-
export const Appid = {
|
|
1151
|
-
encode(message: Appid, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
1152
|
-
if (message.appid !== "") {
|
|
1153
|
-
writer.uint32(10).string(message.appid);
|
|
1154
|
-
}
|
|
1155
|
-
return writer;
|
|
1156
|
-
},
|
|
1157
|
-
|
|
1158
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): Appid {
|
|
1159
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
1160
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1161
|
-
const message = createBaseAppid();
|
|
1162
|
-
while (reader.pos < end) {
|
|
1163
|
-
const tag = reader.uint32();
|
|
1164
|
-
switch (tag >>> 3) {
|
|
1165
|
-
case 1:
|
|
1166
|
-
message.appid = reader.string();
|
|
1167
|
-
break;
|
|
1168
|
-
default:
|
|
1169
|
-
reader.skipType(tag & 7);
|
|
1170
|
-
break;
|
|
1171
|
-
}
|
|
1172
|
-
}
|
|
1173
|
-
return message;
|
|
1174
|
-
},
|
|
1175
|
-
|
|
1176
|
-
fromJSON(object: any): Appid {
|
|
1177
|
-
return { appid: isSet(object.appid) ? String(object.appid) : "" };
|
|
1178
|
-
},
|
|
1179
|
-
|
|
1180
|
-
toJSON(message: Appid): unknown {
|
|
1181
|
-
const obj: any = {};
|
|
1182
|
-
message.appid !== undefined && (obj.appid = message.appid);
|
|
1183
|
-
return obj;
|
|
1184
|
-
},
|
|
1185
|
-
|
|
1186
|
-
fromPartial<I extends Exact<DeepPartial<Appid>, I>>(object: I): Appid {
|
|
1187
|
-
const message = createBaseAppid();
|
|
1188
|
-
message.appid = object.appid ?? "";
|
|
1189
|
-
return message;
|
|
1190
|
-
},
|
|
1191
|
-
};
|
|
1192
|
-
|
|
1193
|
-
function createBaseGetActionURLRequest(): GetActionURLRequest {
|
|
1194
|
-
return { path: "", appid: "", action: 0 };
|
|
1195
|
-
}
|
|
1196
|
-
|
|
1197
|
-
export const GetActionURLRequest = {
|
|
1198
|
-
encode(message: GetActionURLRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
1199
|
-
if (message.path !== "") {
|
|
1200
|
-
writer.uint32(10).string(message.path);
|
|
1201
|
-
}
|
|
1202
|
-
if (message.appid !== "") {
|
|
1203
|
-
writer.uint32(18).string(message.appid);
|
|
1204
|
-
}
|
|
1205
|
-
if (message.action !== 0) {
|
|
1206
|
-
writer.uint32(24).int32(message.action);
|
|
1207
|
-
}
|
|
1208
|
-
return writer;
|
|
1209
|
-
},
|
|
1210
|
-
|
|
1211
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): GetActionURLRequest {
|
|
1212
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
1213
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1214
|
-
const message = createBaseGetActionURLRequest();
|
|
1215
|
-
while (reader.pos < end) {
|
|
1216
|
-
const tag = reader.uint32();
|
|
1217
|
-
switch (tag >>> 3) {
|
|
1218
|
-
case 1:
|
|
1219
|
-
message.path = reader.string();
|
|
1220
|
-
break;
|
|
1221
|
-
case 2:
|
|
1222
|
-
message.appid = reader.string();
|
|
1223
|
-
break;
|
|
1224
|
-
case 3:
|
|
1225
|
-
message.action = reader.int32() as any;
|
|
1226
|
-
break;
|
|
1227
|
-
default:
|
|
1228
|
-
reader.skipType(tag & 7);
|
|
1229
|
-
break;
|
|
1230
|
-
}
|
|
1231
|
-
}
|
|
1232
|
-
return message;
|
|
1233
|
-
},
|
|
1234
|
-
|
|
1235
|
-
fromJSON(object: any): GetActionURLRequest {
|
|
1236
|
-
return {
|
|
1237
|
-
path: isSet(object.path) ? String(object.path) : "",
|
|
1238
|
-
appid: isSet(object.appid) ? String(object.appid) : "",
|
|
1239
|
-
action: isSet(object.action) ? actionFromJSON(object.action) : 0,
|
|
1240
|
-
};
|
|
1241
|
-
},
|
|
1242
|
-
|
|
1243
|
-
toJSON(message: GetActionURLRequest): unknown {
|
|
1244
|
-
const obj: any = {};
|
|
1245
|
-
message.path !== undefined && (obj.path = message.path);
|
|
1246
|
-
message.appid !== undefined && (obj.appid = message.appid);
|
|
1247
|
-
message.action !== undefined && (obj.action = actionToJSON(message.action));
|
|
1248
|
-
return obj;
|
|
1249
|
-
},
|
|
1250
|
-
|
|
1251
|
-
fromPartial<I extends Exact<DeepPartial<GetActionURLRequest>, I>>(object: I): GetActionURLRequest {
|
|
1252
|
-
const message = createBaseGetActionURLRequest();
|
|
1253
|
-
message.path = object.path ?? "";
|
|
1254
|
-
message.appid = object.appid ?? "";
|
|
1255
|
-
message.action = object.action ?? 0;
|
|
1256
|
-
return message;
|
|
1257
|
-
},
|
|
1258
|
-
};
|
|
1259
|
-
|
|
1260
|
-
function createBaseGetActionURLResponse(): GetActionURLResponse {
|
|
1261
|
-
return { url: "" };
|
|
1262
|
-
}
|
|
1263
|
-
|
|
1264
|
-
export const GetActionURLResponse = {
|
|
1265
|
-
encode(message: GetActionURLResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
1266
|
-
if (message.url !== "") {
|
|
1267
|
-
writer.uint32(10).string(message.url);
|
|
1268
|
-
}
|
|
1269
|
-
return writer;
|
|
1270
|
-
},
|
|
1271
|
-
|
|
1272
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): GetActionURLResponse {
|
|
1273
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
1274
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1275
|
-
const message = createBaseGetActionURLResponse();
|
|
1276
|
-
while (reader.pos < end) {
|
|
1277
|
-
const tag = reader.uint32();
|
|
1278
|
-
switch (tag >>> 3) {
|
|
1279
|
-
case 1:
|
|
1280
|
-
message.url = reader.string();
|
|
1281
|
-
break;
|
|
1282
|
-
default:
|
|
1283
|
-
reader.skipType(tag & 7);
|
|
1284
|
-
break;
|
|
1285
|
-
}
|
|
1286
|
-
}
|
|
1287
|
-
return message;
|
|
1288
|
-
},
|
|
1289
|
-
|
|
1290
|
-
fromJSON(object: any): GetActionURLResponse {
|
|
1291
|
-
return { url: isSet(object.url) ? String(object.url) : "" };
|
|
1292
|
-
},
|
|
1293
|
-
|
|
1294
|
-
toJSON(message: GetActionURLResponse): unknown {
|
|
1295
|
-
const obj: any = {};
|
|
1296
|
-
message.url !== undefined && (obj.url = message.url);
|
|
1297
|
-
return obj;
|
|
1298
|
-
},
|
|
1299
|
-
|
|
1300
|
-
fromPartial<I extends Exact<DeepPartial<GetActionURLResponse>, I>>(object: I): GetActionURLResponse {
|
|
1301
|
-
const message = createBaseGetActionURLResponse();
|
|
1302
|
-
message.url = object.url ?? "";
|
|
1303
|
-
return message;
|
|
1304
|
-
},
|
|
1305
|
-
};
|
|
1306
|
-
|
|
1307
|
-
function createBaseListFileHandlerRequest(): ListFileHandlerRequest {
|
|
1308
|
-
return { mimetype: "" };
|
|
1309
|
-
}
|
|
1310
|
-
|
|
1311
|
-
export const ListFileHandlerRequest = {
|
|
1312
|
-
encode(message: ListFileHandlerRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
1313
|
-
if (message.mimetype !== "") {
|
|
1314
|
-
writer.uint32(10).string(message.mimetype);
|
|
1315
|
-
}
|
|
1316
|
-
return writer;
|
|
1317
|
-
},
|
|
1318
|
-
|
|
1319
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): ListFileHandlerRequest {
|
|
1320
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
1321
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1322
|
-
const message = createBaseListFileHandlerRequest();
|
|
1323
|
-
while (reader.pos < end) {
|
|
1324
|
-
const tag = reader.uint32();
|
|
1325
|
-
switch (tag >>> 3) {
|
|
1326
|
-
case 1:
|
|
1327
|
-
message.mimetype = reader.string();
|
|
1328
|
-
break;
|
|
1329
|
-
default:
|
|
1330
|
-
reader.skipType(tag & 7);
|
|
1331
|
-
break;
|
|
1332
|
-
}
|
|
1333
|
-
}
|
|
1334
|
-
return message;
|
|
1335
|
-
},
|
|
1336
|
-
|
|
1337
|
-
fromJSON(object: any): ListFileHandlerRequest {
|
|
1338
|
-
return { mimetype: isSet(object.mimetype) ? String(object.mimetype) : "" };
|
|
1339
|
-
},
|
|
1340
|
-
|
|
1341
|
-
toJSON(message: ListFileHandlerRequest): unknown {
|
|
1342
|
-
const obj: any = {};
|
|
1343
|
-
message.mimetype !== undefined && (obj.mimetype = message.mimetype);
|
|
1344
|
-
return obj;
|
|
1345
|
-
},
|
|
1346
|
-
|
|
1347
|
-
fromPartial<I extends Exact<DeepPartial<ListFileHandlerRequest>, I>>(object: I): ListFileHandlerRequest {
|
|
1348
|
-
const message = createBaseListFileHandlerRequest();
|
|
1349
|
-
message.mimetype = object.mimetype ?? "";
|
|
1350
|
-
return message;
|
|
1351
|
-
},
|
|
1352
|
-
};
|
|
1353
|
-
|
|
1354
|
-
function createBaseFileHandlerInfo(): FileHandlerInfo {
|
|
1355
|
-
return { appid: "", title: "", icon: "" };
|
|
1356
|
-
}
|
|
1357
|
-
|
|
1358
|
-
export const FileHandlerInfo = {
|
|
1359
|
-
encode(message: FileHandlerInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
1360
|
-
if (message.appid !== "") {
|
|
1361
|
-
writer.uint32(10).string(message.appid);
|
|
1362
|
-
}
|
|
1363
|
-
if (message.title !== "") {
|
|
1364
|
-
writer.uint32(18).string(message.title);
|
|
1365
|
-
}
|
|
1366
|
-
if (message.icon !== "") {
|
|
1367
|
-
writer.uint32(26).string(message.icon);
|
|
1368
|
-
}
|
|
1369
|
-
return writer;
|
|
1370
|
-
},
|
|
1371
|
-
|
|
1372
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): FileHandlerInfo {
|
|
1373
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
1374
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1375
|
-
const message = createBaseFileHandlerInfo();
|
|
1376
|
-
while (reader.pos < end) {
|
|
1377
|
-
const tag = reader.uint32();
|
|
1378
|
-
switch (tag >>> 3) {
|
|
1379
|
-
case 1:
|
|
1380
|
-
message.appid = reader.string();
|
|
1381
|
-
break;
|
|
1382
|
-
case 2:
|
|
1383
|
-
message.title = reader.string();
|
|
1384
|
-
break;
|
|
1385
|
-
case 3:
|
|
1386
|
-
message.icon = reader.string();
|
|
1387
|
-
break;
|
|
1388
|
-
default:
|
|
1389
|
-
reader.skipType(tag & 7);
|
|
1390
|
-
break;
|
|
1391
|
-
}
|
|
1392
|
-
}
|
|
1393
|
-
return message;
|
|
1394
|
-
},
|
|
1395
|
-
|
|
1396
|
-
fromJSON(object: any): FileHandlerInfo {
|
|
1397
|
-
return {
|
|
1398
|
-
appid: isSet(object.appid) ? String(object.appid) : "",
|
|
1399
|
-
title: isSet(object.title) ? String(object.title) : "",
|
|
1400
|
-
icon: isSet(object.icon) ? String(object.icon) : "",
|
|
1401
|
-
};
|
|
1402
|
-
},
|
|
1403
|
-
|
|
1404
|
-
toJSON(message: FileHandlerInfo): unknown {
|
|
1405
|
-
const obj: any = {};
|
|
1406
|
-
message.appid !== undefined && (obj.appid = message.appid);
|
|
1407
|
-
message.title !== undefined && (obj.title = message.title);
|
|
1408
|
-
message.icon !== undefined && (obj.icon = message.icon);
|
|
1409
|
-
return obj;
|
|
1410
|
-
},
|
|
1411
|
-
|
|
1412
|
-
fromPartial<I extends Exact<DeepPartial<FileHandlerInfo>, I>>(object: I): FileHandlerInfo {
|
|
1413
|
-
const message = createBaseFileHandlerInfo();
|
|
1414
|
-
message.appid = object.appid ?? "";
|
|
1415
|
-
message.title = object.title ?? "";
|
|
1416
|
-
message.icon = object.icon ?? "";
|
|
1417
|
-
return message;
|
|
1418
|
-
},
|
|
1419
|
-
};
|
|
1420
|
-
|
|
1421
|
-
function createBaseListFileHandlerResponse(): ListFileHandlerResponse {
|
|
1422
|
-
return { infoList: [] };
|
|
1423
|
-
}
|
|
1424
|
-
|
|
1425
|
-
export const ListFileHandlerResponse = {
|
|
1426
|
-
encode(message: ListFileHandlerResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
1427
|
-
for (const v of message.infoList) {
|
|
1428
|
-
FileHandlerInfo.encode(v!, writer.uint32(10).fork()).ldelim();
|
|
1429
|
-
}
|
|
1430
|
-
return writer;
|
|
1431
|
-
},
|
|
1432
|
-
|
|
1433
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): ListFileHandlerResponse {
|
|
1434
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
1435
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1436
|
-
const message = createBaseListFileHandlerResponse();
|
|
1437
|
-
while (reader.pos < end) {
|
|
1438
|
-
const tag = reader.uint32();
|
|
1439
|
-
switch (tag >>> 3) {
|
|
1440
|
-
case 1:
|
|
1441
|
-
message.infoList.push(FileHandlerInfo.decode(reader, reader.uint32()));
|
|
1442
|
-
break;
|
|
1443
|
-
default:
|
|
1444
|
-
reader.skipType(tag & 7);
|
|
1445
|
-
break;
|
|
1446
|
-
}
|
|
1447
|
-
}
|
|
1448
|
-
return message;
|
|
1449
|
-
},
|
|
1450
|
-
|
|
1451
|
-
fromJSON(object: any): ListFileHandlerResponse {
|
|
1452
|
-
return {
|
|
1453
|
-
infoList: Array.isArray(object?.infoList) ? object.infoList.map((e: any) => FileHandlerInfo.fromJSON(e)) : [],
|
|
1454
|
-
};
|
|
1455
|
-
},
|
|
1456
|
-
|
|
1457
|
-
toJSON(message: ListFileHandlerResponse): unknown {
|
|
1458
|
-
const obj: any = {};
|
|
1459
|
-
if (message.infoList) {
|
|
1460
|
-
obj.infoList = message.infoList.map((e) => e ? FileHandlerInfo.toJSON(e) : undefined);
|
|
1461
|
-
} else {
|
|
1462
|
-
obj.infoList = [];
|
|
1463
|
-
}
|
|
1464
|
-
return obj;
|
|
1465
|
-
},
|
|
1466
|
-
|
|
1467
|
-
fromPartial<I extends Exact<DeepPartial<ListFileHandlerResponse>, I>>(object: I): ListFileHandlerResponse {
|
|
1468
|
-
const message = createBaseListFileHandlerResponse();
|
|
1469
|
-
message.infoList = object.infoList?.map((e) => FileHandlerInfo.fromPartial(e)) || [];
|
|
1470
|
-
return message;
|
|
1471
|
-
},
|
|
1472
|
-
};
|
|
1473
|
-
|
|
1474
|
-
export interface PackageManager {
|
|
1475
|
-
/** 根据 URL 和 校验码(可选),安装应用 */
|
|
1476
|
-
Install(request: DeepPartial<InstallRequest>, metadata?: grpc.Metadata): Promise<Empty>;
|
|
1477
|
-
/** 根据 AppId 卸载应用 */
|
|
1478
|
-
Uninstall(request: DeepPartial<UninstallRequest>, metadata?: grpc.Metadata): Promise<Empty>;
|
|
1479
|
-
/** 根据 AppId 清除缓存 */
|
|
1480
|
-
ClearCache(request: DeepPartial<Appid>, metadata?: grpc.Metadata): Promise<Empty>;
|
|
1481
|
-
/** 查询用户安装的特定应用的详情 */
|
|
1482
|
-
QueryApplication(
|
|
1483
|
-
request: DeepPartial<QueryApplicationRequest>,
|
|
1484
|
-
metadata?: grpc.Metadata,
|
|
1485
|
-
): Promise<QueryApplicationResponse>;
|
|
1486
|
-
/** 获取应用占用的存储空间详情 */
|
|
1487
|
-
QueryAppStorageUsage(
|
|
1488
|
-
request: DeepPartial<QueryAppStorageUsageRequest>,
|
|
1489
|
-
metadata?: grpc.Metadata,
|
|
1490
|
-
): Promise<AppStorageUsage>;
|
|
1491
|
-
/** 设置某个用户是否可以安装应用 */
|
|
1492
|
-
SetUserPermissions(request: DeepPartial<UserPermission>, metadata?: grpc.Metadata): Promise<Empty>;
|
|
1493
|
-
/** 获取某个用户安装应用的权限 */
|
|
1494
|
-
GetUserPermissions(
|
|
1495
|
-
request: DeepPartial<GetUserPermissionsRequest>,
|
|
1496
|
-
metadata?: grpc.Metadata,
|
|
1497
|
-
): Promise<UserPermission>;
|
|
1498
|
-
/** 暂停下载特定应用 */
|
|
1499
|
-
PauseAppDownload(request: DeepPartial<Appid>, metadata?: grpc.Metadata): Promise<Empty>;
|
|
1500
|
-
/** 获取用某个应用打开某个文件的链接 */
|
|
1501
|
-
GetActionURL(request: DeepPartial<GetActionURLRequest>, metadata?: grpc.Metadata): Promise<GetActionURLResponse>;
|
|
1502
|
-
/** 列出可以打开指定 MIME 类型的应用 */
|
|
1503
|
-
ListFileHandler(
|
|
1504
|
-
request: DeepPartial<ListFileHandlerRequest>,
|
|
1505
|
-
metadata?: grpc.Metadata,
|
|
1506
|
-
): Promise<ListFileHandlerResponse>;
|
|
1507
|
-
}
|
|
1508
|
-
|
|
1509
|
-
export class PackageManagerClientImpl implements PackageManager {
|
|
1510
|
-
private readonly rpc: Rpc;
|
|
1511
|
-
|
|
1512
|
-
constructor(rpc: Rpc) {
|
|
1513
|
-
this.rpc = rpc;
|
|
1514
|
-
this.Install = this.Install.bind(this);
|
|
1515
|
-
this.Uninstall = this.Uninstall.bind(this);
|
|
1516
|
-
this.ClearCache = this.ClearCache.bind(this);
|
|
1517
|
-
this.QueryApplication = this.QueryApplication.bind(this);
|
|
1518
|
-
this.QueryAppStorageUsage = this.QueryAppStorageUsage.bind(this);
|
|
1519
|
-
this.SetUserPermissions = this.SetUserPermissions.bind(this);
|
|
1520
|
-
this.GetUserPermissions = this.GetUserPermissions.bind(this);
|
|
1521
|
-
this.PauseAppDownload = this.PauseAppDownload.bind(this);
|
|
1522
|
-
this.GetActionURL = this.GetActionURL.bind(this);
|
|
1523
|
-
this.ListFileHandler = this.ListFileHandler.bind(this);
|
|
1524
|
-
}
|
|
1525
|
-
|
|
1526
|
-
Install(request: DeepPartial<InstallRequest>, metadata?: grpc.Metadata): Promise<Empty> {
|
|
1527
|
-
return this.rpc.unary(PackageManagerInstallDesc, InstallRequest.fromPartial(request), metadata);
|
|
1528
|
-
}
|
|
1529
|
-
|
|
1530
|
-
Uninstall(request: DeepPartial<UninstallRequest>, metadata?: grpc.Metadata): Promise<Empty> {
|
|
1531
|
-
return this.rpc.unary(PackageManagerUninstallDesc, UninstallRequest.fromPartial(request), metadata);
|
|
1532
|
-
}
|
|
1533
|
-
|
|
1534
|
-
ClearCache(request: DeepPartial<Appid>, metadata?: grpc.Metadata): Promise<Empty> {
|
|
1535
|
-
return this.rpc.unary(PackageManagerClearCacheDesc, Appid.fromPartial(request), metadata);
|
|
1536
|
-
}
|
|
1537
|
-
|
|
1538
|
-
QueryApplication(
|
|
1539
|
-
request: DeepPartial<QueryApplicationRequest>,
|
|
1540
|
-
metadata?: grpc.Metadata,
|
|
1541
|
-
): Promise<QueryApplicationResponse> {
|
|
1542
|
-
return this.rpc.unary(PackageManagerQueryApplicationDesc, QueryApplicationRequest.fromPartial(request), metadata);
|
|
1543
|
-
}
|
|
1544
|
-
|
|
1545
|
-
QueryAppStorageUsage(
|
|
1546
|
-
request: DeepPartial<QueryAppStorageUsageRequest>,
|
|
1547
|
-
metadata?: grpc.Metadata,
|
|
1548
|
-
): Promise<AppStorageUsage> {
|
|
1549
|
-
return this.rpc.unary(
|
|
1550
|
-
PackageManagerQueryAppStorageUsageDesc,
|
|
1551
|
-
QueryAppStorageUsageRequest.fromPartial(request),
|
|
1552
|
-
metadata,
|
|
1553
|
-
);
|
|
1554
|
-
}
|
|
1555
|
-
|
|
1556
|
-
SetUserPermissions(request: DeepPartial<UserPermission>, metadata?: grpc.Metadata): Promise<Empty> {
|
|
1557
|
-
return this.rpc.unary(PackageManagerSetUserPermissionsDesc, UserPermission.fromPartial(request), metadata);
|
|
1558
|
-
}
|
|
1559
|
-
|
|
1560
|
-
GetUserPermissions(
|
|
1561
|
-
request: DeepPartial<GetUserPermissionsRequest>,
|
|
1562
|
-
metadata?: grpc.Metadata,
|
|
1563
|
-
): Promise<UserPermission> {
|
|
1564
|
-
return this.rpc.unary(
|
|
1565
|
-
PackageManagerGetUserPermissionsDesc,
|
|
1566
|
-
GetUserPermissionsRequest.fromPartial(request),
|
|
1567
|
-
metadata,
|
|
1568
|
-
);
|
|
1569
|
-
}
|
|
1570
|
-
|
|
1571
|
-
PauseAppDownload(request: DeepPartial<Appid>, metadata?: grpc.Metadata): Promise<Empty> {
|
|
1572
|
-
return this.rpc.unary(PackageManagerPauseAppDownloadDesc, Appid.fromPartial(request), metadata);
|
|
1573
|
-
}
|
|
1574
|
-
|
|
1575
|
-
GetActionURL(request: DeepPartial<GetActionURLRequest>, metadata?: grpc.Metadata): Promise<GetActionURLResponse> {
|
|
1576
|
-
return this.rpc.unary(PackageManagerGetActionURLDesc, GetActionURLRequest.fromPartial(request), metadata);
|
|
1577
|
-
}
|
|
1578
|
-
|
|
1579
|
-
ListFileHandler(
|
|
1580
|
-
request: DeepPartial<ListFileHandlerRequest>,
|
|
1581
|
-
metadata?: grpc.Metadata,
|
|
1582
|
-
): Promise<ListFileHandlerResponse> {
|
|
1583
|
-
return this.rpc.unary(PackageManagerListFileHandlerDesc, ListFileHandlerRequest.fromPartial(request), metadata);
|
|
1584
|
-
}
|
|
1585
|
-
}
|
|
1586
|
-
|
|
1587
|
-
export const PackageManagerDesc = { serviceName: "cloud.lazycat.apis.sys.PackageManager" };
|
|
1588
|
-
|
|
1589
|
-
export const PackageManagerInstallDesc: UnaryMethodDefinitionish = {
|
|
1590
|
-
methodName: "Install",
|
|
1591
|
-
service: PackageManagerDesc,
|
|
1592
|
-
requestStream: false,
|
|
1593
|
-
responseStream: false,
|
|
1594
|
-
requestType: {
|
|
1595
|
-
serializeBinary() {
|
|
1596
|
-
return InstallRequest.encode(this).finish();
|
|
1597
|
-
},
|
|
1598
|
-
} as any,
|
|
1599
|
-
responseType: {
|
|
1600
|
-
deserializeBinary(data: Uint8Array) {
|
|
1601
|
-
return {
|
|
1602
|
-
...Empty.decode(data),
|
|
1603
|
-
toObject() {
|
|
1604
|
-
return this;
|
|
1605
|
-
},
|
|
1606
|
-
};
|
|
1607
|
-
},
|
|
1608
|
-
} as any,
|
|
1609
|
-
};
|
|
1610
|
-
|
|
1611
|
-
export const PackageManagerUninstallDesc: UnaryMethodDefinitionish = {
|
|
1612
|
-
methodName: "Uninstall",
|
|
1613
|
-
service: PackageManagerDesc,
|
|
1614
|
-
requestStream: false,
|
|
1615
|
-
responseStream: false,
|
|
1616
|
-
requestType: {
|
|
1617
|
-
serializeBinary() {
|
|
1618
|
-
return UninstallRequest.encode(this).finish();
|
|
1619
|
-
},
|
|
1620
|
-
} as any,
|
|
1621
|
-
responseType: {
|
|
1622
|
-
deserializeBinary(data: Uint8Array) {
|
|
1623
|
-
return {
|
|
1624
|
-
...Empty.decode(data),
|
|
1625
|
-
toObject() {
|
|
1626
|
-
return this;
|
|
1627
|
-
},
|
|
1628
|
-
};
|
|
1629
|
-
},
|
|
1630
|
-
} as any,
|
|
1631
|
-
};
|
|
1632
|
-
|
|
1633
|
-
export const PackageManagerClearCacheDesc: UnaryMethodDefinitionish = {
|
|
1634
|
-
methodName: "ClearCache",
|
|
1635
|
-
service: PackageManagerDesc,
|
|
1636
|
-
requestStream: false,
|
|
1637
|
-
responseStream: false,
|
|
1638
|
-
requestType: {
|
|
1639
|
-
serializeBinary() {
|
|
1640
|
-
return Appid.encode(this).finish();
|
|
1641
|
-
},
|
|
1642
|
-
} as any,
|
|
1643
|
-
responseType: {
|
|
1644
|
-
deserializeBinary(data: Uint8Array) {
|
|
1645
|
-
return {
|
|
1646
|
-
...Empty.decode(data),
|
|
1647
|
-
toObject() {
|
|
1648
|
-
return this;
|
|
1649
|
-
},
|
|
1650
|
-
};
|
|
1651
|
-
},
|
|
1652
|
-
} as any,
|
|
1653
|
-
};
|
|
1654
|
-
|
|
1655
|
-
export const PackageManagerQueryApplicationDesc: UnaryMethodDefinitionish = {
|
|
1656
|
-
methodName: "QueryApplication",
|
|
1657
|
-
service: PackageManagerDesc,
|
|
1658
|
-
requestStream: false,
|
|
1659
|
-
responseStream: false,
|
|
1660
|
-
requestType: {
|
|
1661
|
-
serializeBinary() {
|
|
1662
|
-
return QueryApplicationRequest.encode(this).finish();
|
|
1663
|
-
},
|
|
1664
|
-
} as any,
|
|
1665
|
-
responseType: {
|
|
1666
|
-
deserializeBinary(data: Uint8Array) {
|
|
1667
|
-
return {
|
|
1668
|
-
...QueryApplicationResponse.decode(data),
|
|
1669
|
-
toObject() {
|
|
1670
|
-
return this;
|
|
1671
|
-
},
|
|
1672
|
-
};
|
|
1673
|
-
},
|
|
1674
|
-
} as any,
|
|
1675
|
-
};
|
|
1676
|
-
|
|
1677
|
-
export const PackageManagerQueryAppStorageUsageDesc: UnaryMethodDefinitionish = {
|
|
1678
|
-
methodName: "QueryAppStorageUsage",
|
|
1679
|
-
service: PackageManagerDesc,
|
|
1680
|
-
requestStream: false,
|
|
1681
|
-
responseStream: false,
|
|
1682
|
-
requestType: {
|
|
1683
|
-
serializeBinary() {
|
|
1684
|
-
return QueryAppStorageUsageRequest.encode(this).finish();
|
|
1685
|
-
},
|
|
1686
|
-
} as any,
|
|
1687
|
-
responseType: {
|
|
1688
|
-
deserializeBinary(data: Uint8Array) {
|
|
1689
|
-
return {
|
|
1690
|
-
...AppStorageUsage.decode(data),
|
|
1691
|
-
toObject() {
|
|
1692
|
-
return this;
|
|
1693
|
-
},
|
|
1694
|
-
};
|
|
1695
|
-
},
|
|
1696
|
-
} as any,
|
|
1697
|
-
};
|
|
1698
|
-
|
|
1699
|
-
export const PackageManagerSetUserPermissionsDesc: UnaryMethodDefinitionish = {
|
|
1700
|
-
methodName: "SetUserPermissions",
|
|
1701
|
-
service: PackageManagerDesc,
|
|
1702
|
-
requestStream: false,
|
|
1703
|
-
responseStream: false,
|
|
1704
|
-
requestType: {
|
|
1705
|
-
serializeBinary() {
|
|
1706
|
-
return UserPermission.encode(this).finish();
|
|
1707
|
-
},
|
|
1708
|
-
} as any,
|
|
1709
|
-
responseType: {
|
|
1710
|
-
deserializeBinary(data: Uint8Array) {
|
|
1711
|
-
return {
|
|
1712
|
-
...Empty.decode(data),
|
|
1713
|
-
toObject() {
|
|
1714
|
-
return this;
|
|
1715
|
-
},
|
|
1716
|
-
};
|
|
1717
|
-
},
|
|
1718
|
-
} as any,
|
|
1719
|
-
};
|
|
1720
|
-
|
|
1721
|
-
export const PackageManagerGetUserPermissionsDesc: UnaryMethodDefinitionish = {
|
|
1722
|
-
methodName: "GetUserPermissions",
|
|
1723
|
-
service: PackageManagerDesc,
|
|
1724
|
-
requestStream: false,
|
|
1725
|
-
responseStream: false,
|
|
1726
|
-
requestType: {
|
|
1727
|
-
serializeBinary() {
|
|
1728
|
-
return GetUserPermissionsRequest.encode(this).finish();
|
|
1729
|
-
},
|
|
1730
|
-
} as any,
|
|
1731
|
-
responseType: {
|
|
1732
|
-
deserializeBinary(data: Uint8Array) {
|
|
1733
|
-
return {
|
|
1734
|
-
...UserPermission.decode(data),
|
|
1735
|
-
toObject() {
|
|
1736
|
-
return this;
|
|
1737
|
-
},
|
|
1738
|
-
};
|
|
1739
|
-
},
|
|
1740
|
-
} as any,
|
|
1741
|
-
};
|
|
1742
|
-
|
|
1743
|
-
export const PackageManagerPauseAppDownloadDesc: UnaryMethodDefinitionish = {
|
|
1744
|
-
methodName: "PauseAppDownload",
|
|
1745
|
-
service: PackageManagerDesc,
|
|
1746
|
-
requestStream: false,
|
|
1747
|
-
responseStream: false,
|
|
1748
|
-
requestType: {
|
|
1749
|
-
serializeBinary() {
|
|
1750
|
-
return Appid.encode(this).finish();
|
|
1751
|
-
},
|
|
1752
|
-
} as any,
|
|
1753
|
-
responseType: {
|
|
1754
|
-
deserializeBinary(data: Uint8Array) {
|
|
1755
|
-
return {
|
|
1756
|
-
...Empty.decode(data),
|
|
1757
|
-
toObject() {
|
|
1758
|
-
return this;
|
|
1759
|
-
},
|
|
1760
|
-
};
|
|
1761
|
-
},
|
|
1762
|
-
} as any,
|
|
1763
|
-
};
|
|
1764
|
-
|
|
1765
|
-
export const PackageManagerGetActionURLDesc: UnaryMethodDefinitionish = {
|
|
1766
|
-
methodName: "GetActionURL",
|
|
1767
|
-
service: PackageManagerDesc,
|
|
1768
|
-
requestStream: false,
|
|
1769
|
-
responseStream: false,
|
|
1770
|
-
requestType: {
|
|
1771
|
-
serializeBinary() {
|
|
1772
|
-
return GetActionURLRequest.encode(this).finish();
|
|
1773
|
-
},
|
|
1774
|
-
} as any,
|
|
1775
|
-
responseType: {
|
|
1776
|
-
deserializeBinary(data: Uint8Array) {
|
|
1777
|
-
return {
|
|
1778
|
-
...GetActionURLResponse.decode(data),
|
|
1779
|
-
toObject() {
|
|
1780
|
-
return this;
|
|
1781
|
-
},
|
|
1782
|
-
};
|
|
1783
|
-
},
|
|
1784
|
-
} as any,
|
|
1785
|
-
};
|
|
1786
|
-
|
|
1787
|
-
export const PackageManagerListFileHandlerDesc: UnaryMethodDefinitionish = {
|
|
1788
|
-
methodName: "ListFileHandler",
|
|
1789
|
-
service: PackageManagerDesc,
|
|
1790
|
-
requestStream: false,
|
|
1791
|
-
responseStream: false,
|
|
1792
|
-
requestType: {
|
|
1793
|
-
serializeBinary() {
|
|
1794
|
-
return ListFileHandlerRequest.encode(this).finish();
|
|
1795
|
-
},
|
|
1796
|
-
} as any,
|
|
1797
|
-
responseType: {
|
|
1798
|
-
deserializeBinary(data: Uint8Array) {
|
|
1799
|
-
return {
|
|
1800
|
-
...ListFileHandlerResponse.decode(data),
|
|
1801
|
-
toObject() {
|
|
1802
|
-
return this;
|
|
1803
|
-
},
|
|
1804
|
-
};
|
|
1805
|
-
},
|
|
1806
|
-
} as any,
|
|
1807
|
-
};
|
|
1808
|
-
|
|
1809
|
-
interface UnaryMethodDefinitionishR extends grpc.UnaryMethodDefinition<any, any> {
|
|
1810
|
-
requestStream: any;
|
|
1811
|
-
responseStream: any;
|
|
1812
|
-
}
|
|
1813
|
-
|
|
1814
|
-
type UnaryMethodDefinitionish = UnaryMethodDefinitionishR;
|
|
1815
|
-
|
|
1816
|
-
interface Rpc {
|
|
1817
|
-
unary<T extends UnaryMethodDefinitionish>(
|
|
1818
|
-
methodDesc: T,
|
|
1819
|
-
request: any,
|
|
1820
|
-
metadata: grpc.Metadata | undefined,
|
|
1821
|
-
): Promise<any>;
|
|
1822
|
-
}
|
|
1823
|
-
|
|
1824
|
-
export class GrpcWebImpl {
|
|
1825
|
-
private host: string;
|
|
1826
|
-
private options: {
|
|
1827
|
-
transport?: grpc.TransportFactory;
|
|
1828
|
-
|
|
1829
|
-
debug?: boolean;
|
|
1830
|
-
metadata?: grpc.Metadata;
|
|
1831
|
-
upStreamRetryCodes?: number[];
|
|
1832
|
-
};
|
|
1833
|
-
|
|
1834
|
-
constructor(
|
|
1835
|
-
host: string,
|
|
1836
|
-
options: {
|
|
1837
|
-
transport?: grpc.TransportFactory;
|
|
1838
|
-
|
|
1839
|
-
debug?: boolean;
|
|
1840
|
-
metadata?: grpc.Metadata;
|
|
1841
|
-
upStreamRetryCodes?: number[];
|
|
1842
|
-
},
|
|
1843
|
-
) {
|
|
1844
|
-
this.host = host;
|
|
1845
|
-
this.options = options;
|
|
1846
|
-
}
|
|
1847
|
-
|
|
1848
|
-
unary<T extends UnaryMethodDefinitionish>(
|
|
1849
|
-
methodDesc: T,
|
|
1850
|
-
_request: any,
|
|
1851
|
-
metadata: grpc.Metadata | undefined,
|
|
1852
|
-
): Promise<any> {
|
|
1853
|
-
const request = { ..._request, ...methodDesc.requestType };
|
|
1854
|
-
const maybeCombinedMetadata = metadata && this.options.metadata
|
|
1855
|
-
? new BrowserHeaders({ ...this.options?.metadata.headersMap, ...metadata?.headersMap })
|
|
1856
|
-
: metadata || this.options.metadata;
|
|
1857
|
-
return new Promise((resolve, reject) => {
|
|
1858
|
-
grpc.unary(methodDesc, {
|
|
1859
|
-
request,
|
|
1860
|
-
host: this.host,
|
|
1861
|
-
metadata: maybeCombinedMetadata,
|
|
1862
|
-
transport: this.options.transport,
|
|
1863
|
-
debug: this.options.debug,
|
|
1864
|
-
onEnd: function (response) {
|
|
1865
|
-
if (response.status === grpc.Code.OK) {
|
|
1866
|
-
resolve(response.message);
|
|
1867
|
-
} else {
|
|
1868
|
-
const err = new GrpcWebError(response.statusMessage, response.status, response.trailers);
|
|
1869
|
-
reject(err);
|
|
1870
|
-
}
|
|
1871
|
-
},
|
|
1872
|
-
});
|
|
1873
|
-
});
|
|
1874
|
-
}
|
|
1875
|
-
}
|
|
1876
|
-
|
|
1877
|
-
declare var self: any | undefined;
|
|
1878
|
-
declare var window: any | undefined;
|
|
1879
|
-
declare var global: any | undefined;
|
|
1880
|
-
var globalThis: any = (() => {
|
|
1881
|
-
if (typeof globalThis !== "undefined") {
|
|
1882
|
-
return globalThis;
|
|
1883
|
-
}
|
|
1884
|
-
if (typeof self !== "undefined") {
|
|
1885
|
-
return self;
|
|
1886
|
-
}
|
|
1887
|
-
if (typeof window !== "undefined") {
|
|
1888
|
-
return window;
|
|
1889
|
-
}
|
|
1890
|
-
if (typeof global !== "undefined") {
|
|
1891
|
-
return global;
|
|
1892
|
-
}
|
|
1893
|
-
throw "Unable to locate global object";
|
|
1894
|
-
})();
|
|
1895
|
-
|
|
1896
|
-
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
1897
|
-
|
|
1898
|
-
type DeepPartial<T> = T extends Builtin ? T
|
|
1899
|
-
: T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
1900
|
-
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
1901
|
-
: Partial<T>;
|
|
1902
|
-
|
|
1903
|
-
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
1904
|
-
type Exact<P, I extends P> = P extends Builtin ? P
|
|
1905
|
-
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
1906
|
-
|
|
1907
|
-
function longToNumber(long: Long): number {
|
|
1908
|
-
if (long.gt(Number.MAX_SAFE_INTEGER)) {
|
|
1909
|
-
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
1910
|
-
}
|
|
1911
|
-
return long.toNumber();
|
|
1912
|
-
}
|
|
1913
|
-
|
|
1914
|
-
if (_m0.util.Long !== Long) {
|
|
1915
|
-
_m0.util.Long = Long as any;
|
|
1916
|
-
_m0.configure();
|
|
1917
|
-
}
|
|
1918
|
-
|
|
1919
|
-
function isObject(value: any): boolean {
|
|
1920
|
-
return typeof value === "object" && value !== null;
|
|
1921
|
-
}
|
|
1922
|
-
|
|
1923
|
-
function isSet(value: any): boolean {
|
|
1924
|
-
return value !== null && value !== undefined;
|
|
1925
|
-
}
|
|
1926
|
-
|
|
1927
|
-
export class GrpcWebError extends Error {
|
|
1928
|
-
constructor(message: string, public code: grpc.Code, public metadata: grpc.Metadata) {
|
|
1929
|
-
super(message);
|
|
1930
|
-
}
|
|
1931
|
-
}
|