@lazycatcloud/sdk 0.1.144 → 0.1.146
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/common/media_meta.js +2 -2
- package/dist/common/media_meta.js.map +1 -1
- package/dist/extentions/app_common.d.ts.map +1 -1
- package/dist/extentions/app_common.js +43 -18
- package/dist/extentions/app_common.js.map +1 -1
- package/dist/extentions/base.d.ts +2 -2
- package/dist/extentions/base.d.ts.map +1 -1
- package/dist/extentions/base.js +3 -3
- package/dist/extentions/base.js.map +1 -1
- package/dist/package.json +10 -2
- package/package.json +10 -2
- 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/localdevice/network.ts
DELETED
|
@@ -1,273 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
import { grpc } from "@improbable-eng/grpc-web";
|
|
3
|
-
import { BrowserHeaders } from "browser-headers";
|
|
4
|
-
import _m0 from "protobufjs/minimal";
|
|
5
|
-
import { Empty } from "../google/protobuf/empty";
|
|
6
|
-
|
|
7
|
-
export enum ConnectionType {
|
|
8
|
-
Unknown = 0,
|
|
9
|
-
CELL_NONE = 1,
|
|
10
|
-
ETHERNET = 2,
|
|
11
|
-
WIFI = 3,
|
|
12
|
-
CELL = 4,
|
|
13
|
-
CELL_2G = 5,
|
|
14
|
-
CELL_3G = 6,
|
|
15
|
-
CELL_4G = 7,
|
|
16
|
-
CELL_5G = 8,
|
|
17
|
-
UNRECOGNIZED = -1,
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export function connectionTypeFromJSON(object: any): ConnectionType {
|
|
21
|
-
switch (object) {
|
|
22
|
-
case 0:
|
|
23
|
-
case "Unknown":
|
|
24
|
-
return ConnectionType.Unknown;
|
|
25
|
-
case 1:
|
|
26
|
-
case "CELL_NONE":
|
|
27
|
-
return ConnectionType.CELL_NONE;
|
|
28
|
-
case 2:
|
|
29
|
-
case "ETHERNET":
|
|
30
|
-
return ConnectionType.ETHERNET;
|
|
31
|
-
case 3:
|
|
32
|
-
case "WIFI":
|
|
33
|
-
return ConnectionType.WIFI;
|
|
34
|
-
case 4:
|
|
35
|
-
case "CELL":
|
|
36
|
-
return ConnectionType.CELL;
|
|
37
|
-
case 5:
|
|
38
|
-
case "CELL_2G":
|
|
39
|
-
return ConnectionType.CELL_2G;
|
|
40
|
-
case 6:
|
|
41
|
-
case "CELL_3G":
|
|
42
|
-
return ConnectionType.CELL_3G;
|
|
43
|
-
case 7:
|
|
44
|
-
case "CELL_4G":
|
|
45
|
-
return ConnectionType.CELL_4G;
|
|
46
|
-
case 8:
|
|
47
|
-
case "CELL_5G":
|
|
48
|
-
return ConnectionType.CELL_5G;
|
|
49
|
-
case -1:
|
|
50
|
-
case "UNRECOGNIZED":
|
|
51
|
-
default:
|
|
52
|
-
return ConnectionType.UNRECOGNIZED;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export function connectionTypeToJSON(object: ConnectionType): string {
|
|
57
|
-
switch (object) {
|
|
58
|
-
case ConnectionType.Unknown:
|
|
59
|
-
return "Unknown";
|
|
60
|
-
case ConnectionType.CELL_NONE:
|
|
61
|
-
return "CELL_NONE";
|
|
62
|
-
case ConnectionType.ETHERNET:
|
|
63
|
-
return "ETHERNET";
|
|
64
|
-
case ConnectionType.WIFI:
|
|
65
|
-
return "WIFI";
|
|
66
|
-
case ConnectionType.CELL:
|
|
67
|
-
return "CELL";
|
|
68
|
-
case ConnectionType.CELL_2G:
|
|
69
|
-
return "CELL_2G";
|
|
70
|
-
case ConnectionType.CELL_3G:
|
|
71
|
-
return "CELL_3G";
|
|
72
|
-
case ConnectionType.CELL_4G:
|
|
73
|
-
return "CELL_4G";
|
|
74
|
-
case ConnectionType.CELL_5G:
|
|
75
|
-
return "CELL_5G";
|
|
76
|
-
case ConnectionType.UNRECOGNIZED:
|
|
77
|
-
default:
|
|
78
|
-
return "UNRECOGNIZED";
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export interface NetworkInformation {
|
|
83
|
-
ctype: ConnectionType;
|
|
84
|
-
IsOnline: boolean;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
function createBaseNetworkInformation(): NetworkInformation {
|
|
88
|
-
return { ctype: 0, IsOnline: false };
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export const NetworkInformation = {
|
|
92
|
-
encode(message: NetworkInformation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
93
|
-
if (message.ctype !== 0) {
|
|
94
|
-
writer.uint32(8).int32(message.ctype);
|
|
95
|
-
}
|
|
96
|
-
if (message.IsOnline === true) {
|
|
97
|
-
writer.uint32(16).bool(message.IsOnline);
|
|
98
|
-
}
|
|
99
|
-
return writer;
|
|
100
|
-
},
|
|
101
|
-
|
|
102
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): NetworkInformation {
|
|
103
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
104
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
105
|
-
const message = createBaseNetworkInformation();
|
|
106
|
-
while (reader.pos < end) {
|
|
107
|
-
const tag = reader.uint32();
|
|
108
|
-
switch (tag >>> 3) {
|
|
109
|
-
case 1:
|
|
110
|
-
message.ctype = reader.int32() as any;
|
|
111
|
-
break;
|
|
112
|
-
case 2:
|
|
113
|
-
message.IsOnline = reader.bool();
|
|
114
|
-
break;
|
|
115
|
-
default:
|
|
116
|
-
reader.skipType(tag & 7);
|
|
117
|
-
break;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
return message;
|
|
121
|
-
},
|
|
122
|
-
|
|
123
|
-
fromJSON(object: any): NetworkInformation {
|
|
124
|
-
return {
|
|
125
|
-
ctype: isSet(object.ctype) ? connectionTypeFromJSON(object.ctype) : 0,
|
|
126
|
-
IsOnline: isSet(object.IsOnline) ? Boolean(object.IsOnline) : false,
|
|
127
|
-
};
|
|
128
|
-
},
|
|
129
|
-
|
|
130
|
-
toJSON(message: NetworkInformation): unknown {
|
|
131
|
-
const obj: any = {};
|
|
132
|
-
message.ctype !== undefined && (obj.ctype = connectionTypeToJSON(message.ctype));
|
|
133
|
-
message.IsOnline !== undefined && (obj.IsOnline = message.IsOnline);
|
|
134
|
-
return obj;
|
|
135
|
-
},
|
|
136
|
-
|
|
137
|
-
fromPartial<I extends Exact<DeepPartial<NetworkInformation>, I>>(object: I): NetworkInformation {
|
|
138
|
-
const message = createBaseNetworkInformation();
|
|
139
|
-
message.ctype = object.ctype ?? 0;
|
|
140
|
-
message.IsOnline = object.IsOnline ?? false;
|
|
141
|
-
return message;
|
|
142
|
-
},
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
export interface NetworkManager {
|
|
146
|
-
Query(request: DeepPartial<Empty>, metadata?: grpc.Metadata): Promise<NetworkInformation>;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
export class NetworkManagerClientImpl implements NetworkManager {
|
|
150
|
-
private readonly rpc: Rpc;
|
|
151
|
-
|
|
152
|
-
constructor(rpc: Rpc) {
|
|
153
|
-
this.rpc = rpc;
|
|
154
|
-
this.Query = this.Query.bind(this);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
Query(request: DeepPartial<Empty>, metadata?: grpc.Metadata): Promise<NetworkInformation> {
|
|
158
|
-
return this.rpc.unary(NetworkManagerQueryDesc, Empty.fromPartial(request), metadata);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
export const NetworkManagerDesc = { serviceName: "cloud.lazycat.apis.localdevice.NetworkManager" };
|
|
163
|
-
|
|
164
|
-
export const NetworkManagerQueryDesc: UnaryMethodDefinitionish = {
|
|
165
|
-
methodName: "Query",
|
|
166
|
-
service: NetworkManagerDesc,
|
|
167
|
-
requestStream: false,
|
|
168
|
-
responseStream: false,
|
|
169
|
-
requestType: {
|
|
170
|
-
serializeBinary() {
|
|
171
|
-
return Empty.encode(this).finish();
|
|
172
|
-
},
|
|
173
|
-
} as any,
|
|
174
|
-
responseType: {
|
|
175
|
-
deserializeBinary(data: Uint8Array) {
|
|
176
|
-
return {
|
|
177
|
-
...NetworkInformation.decode(data),
|
|
178
|
-
toObject() {
|
|
179
|
-
return this;
|
|
180
|
-
},
|
|
181
|
-
};
|
|
182
|
-
},
|
|
183
|
-
} as any,
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
interface UnaryMethodDefinitionishR extends grpc.UnaryMethodDefinition<any, any> {
|
|
187
|
-
requestStream: any;
|
|
188
|
-
responseStream: any;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
type UnaryMethodDefinitionish = UnaryMethodDefinitionishR;
|
|
192
|
-
|
|
193
|
-
interface Rpc {
|
|
194
|
-
unary<T extends UnaryMethodDefinitionish>(
|
|
195
|
-
methodDesc: T,
|
|
196
|
-
request: any,
|
|
197
|
-
metadata: grpc.Metadata | undefined,
|
|
198
|
-
): Promise<any>;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
export class GrpcWebImpl {
|
|
202
|
-
private host: string;
|
|
203
|
-
private options: {
|
|
204
|
-
transport?: grpc.TransportFactory;
|
|
205
|
-
|
|
206
|
-
debug?: boolean;
|
|
207
|
-
metadata?: grpc.Metadata;
|
|
208
|
-
upStreamRetryCodes?: number[];
|
|
209
|
-
};
|
|
210
|
-
|
|
211
|
-
constructor(
|
|
212
|
-
host: string,
|
|
213
|
-
options: {
|
|
214
|
-
transport?: grpc.TransportFactory;
|
|
215
|
-
|
|
216
|
-
debug?: boolean;
|
|
217
|
-
metadata?: grpc.Metadata;
|
|
218
|
-
upStreamRetryCodes?: number[];
|
|
219
|
-
},
|
|
220
|
-
) {
|
|
221
|
-
this.host = host;
|
|
222
|
-
this.options = options;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
unary<T extends UnaryMethodDefinitionish>(
|
|
226
|
-
methodDesc: T,
|
|
227
|
-
_request: any,
|
|
228
|
-
metadata: grpc.Metadata | undefined,
|
|
229
|
-
): Promise<any> {
|
|
230
|
-
const request = { ..._request, ...methodDesc.requestType };
|
|
231
|
-
const maybeCombinedMetadata = metadata && this.options.metadata
|
|
232
|
-
? new BrowserHeaders({ ...this.options?.metadata.headersMap, ...metadata?.headersMap })
|
|
233
|
-
: metadata || this.options.metadata;
|
|
234
|
-
return new Promise((resolve, reject) => {
|
|
235
|
-
grpc.unary(methodDesc, {
|
|
236
|
-
request,
|
|
237
|
-
host: this.host,
|
|
238
|
-
metadata: maybeCombinedMetadata,
|
|
239
|
-
transport: this.options.transport,
|
|
240
|
-
debug: this.options.debug,
|
|
241
|
-
onEnd: function (response) {
|
|
242
|
-
if (response.status === grpc.Code.OK) {
|
|
243
|
-
resolve(response.message);
|
|
244
|
-
} else {
|
|
245
|
-
const err = new GrpcWebError(response.statusMessage, response.status, response.trailers);
|
|
246
|
-
reject(err);
|
|
247
|
-
}
|
|
248
|
-
},
|
|
249
|
-
});
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
255
|
-
|
|
256
|
-
type DeepPartial<T> = T extends Builtin ? T
|
|
257
|
-
: T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
258
|
-
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
259
|
-
: Partial<T>;
|
|
260
|
-
|
|
261
|
-
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
262
|
-
type Exact<P, I extends P> = P extends Builtin ? P
|
|
263
|
-
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
264
|
-
|
|
265
|
-
function isSet(value: any): boolean {
|
|
266
|
-
return value !== null && value !== undefined;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
export class GrpcWebError extends Error {
|
|
270
|
-
constructor(message: string, public code: grpc.Code, public metadata: grpc.Metadata) {
|
|
271
|
-
super(message);
|
|
272
|
-
}
|
|
273
|
-
}
|