@lazycatcloud/sdk 0.1.22 → 0.1.23

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.
Files changed (94) hide show
  1. package/dist/common/box.d.ts +6 -12
  2. package/dist/common/box.d.ts.map +1 -1
  3. package/dist/common/box.js +39 -22
  4. package/dist/common/box.js.map +1 -1
  5. package/dist/common/browseronly.d.ts +4 -10
  6. package/dist/common/browseronly.d.ts.map +1 -1
  7. package/dist/common/browseronly.js +37 -25
  8. package/dist/common/browseronly.js.map +1 -1
  9. package/dist/common/end_device.d.ts +28 -13
  10. package/dist/common/end_device.d.ts.map +1 -1
  11. package/dist/common/end_device.js +117 -27
  12. package/dist/common/end_device.js.map +1 -1
  13. package/dist/common/gateway.d.ts +6 -12
  14. package/dist/common/gateway.d.ts.map +1 -1
  15. package/dist/common/gateway.js +37 -23
  16. package/dist/common/gateway.js.map +1 -1
  17. package/dist/common/peripheral_device.d.ts +9 -15
  18. package/dist/common/peripheral_device.d.ts.map +1 -1
  19. package/dist/common/peripheral_device.js +39 -22
  20. package/dist/common/peripheral_device.js.map +1 -1
  21. package/dist/common/permissions.d.ts +93 -0
  22. package/dist/common/permissions.d.ts.map +1 -0
  23. package/dist/common/permissions.js +267 -0
  24. package/dist/common/permissions.js.map +1 -0
  25. package/dist/common/security_context.d.ts +9 -15
  26. package/dist/common/security_context.d.ts.map +1 -1
  27. package/dist/common/security_context.js +39 -25
  28. package/dist/common/security_context.js.map +1 -1
  29. package/dist/common/users.d.ts +12 -18
  30. package/dist/common/users.d.ts.map +1 -1
  31. package/dist/common/users.js +47 -33
  32. package/dist/common/users.js.map +1 -1
  33. package/dist/google/protobuf/descriptor.d.ts +1644 -1644
  34. package/dist/google/protobuf/descriptor.d.ts.map +1 -1
  35. package/dist/google/protobuf/descriptor.js +95 -78
  36. package/dist/google/protobuf/descriptor.js.map +1 -1
  37. package/dist/google/protobuf/empty.d.ts +2 -2
  38. package/dist/google/protobuf/empty.d.ts.map +1 -1
  39. package/dist/google/protobuf/empty.js +25 -5
  40. package/dist/google/protobuf/empty.js.map +1 -1
  41. package/dist/google/protobuf/timestamp.d.ts +2 -2
  42. package/dist/google/protobuf/timestamp.d.ts.map +1 -1
  43. package/dist/google/protobuf/timestamp.js +29 -6
  44. package/dist/google/protobuf/timestamp.js.map +1 -1
  45. package/dist/localdevice/clipboard.d.ts +5 -11
  46. package/dist/localdevice/clipboard.d.ts.map +1 -1
  47. package/dist/localdevice/clipboard.js +53 -47
  48. package/dist/localdevice/clipboard.js.map +1 -1
  49. package/dist/localdevice/device.d.ts +2 -8
  50. package/dist/localdevice/device.d.ts.map +1 -1
  51. package/dist/localdevice/device.js +29 -15
  52. package/dist/localdevice/device.js.map +1 -1
  53. package/dist/localdevice/dialog.d.ts +6 -12
  54. package/dist/localdevice/dialog.d.ts.map +1 -1
  55. package/dist/localdevice/dialog.js +37 -23
  56. package/dist/localdevice/dialog.js.map +1 -1
  57. package/dist/localdevice/network.d.ts +2 -8
  58. package/dist/localdevice/network.d.ts.map +1 -1
  59. package/dist/localdevice/network.js +29 -15
  60. package/dist/localdevice/network.js.map +1 -1
  61. package/dist/localdevice/photo.d.ts +19 -25
  62. package/dist/localdevice/photo.d.ts.map +1 -1
  63. package/dist/localdevice/photo.js +59 -44
  64. package/dist/localdevice/photo.js.map +1 -1
  65. package/dist/package.json +1 -1
  66. package/dist/sys/OS_snapshot.d.ts +20 -26
  67. package/dist/sys/OS_snapshot.d.ts.map +1 -1
  68. package/dist/sys/OS_snapshot.js +59 -42
  69. package/dist/sys/OS_snapshot.js.map +1 -1
  70. package/dist/sys/OS_upgrader.d.ts +7 -13
  71. package/dist/sys/OS_upgrader.d.ts.map +1 -1
  72. package/dist/sys/OS_upgrader.js +39 -22
  73. package/dist/sys/OS_upgrader.js.map +1 -1
  74. package/dist/sys/hc-core/hc-core.d.ts +29 -35
  75. package/dist/sys/hc-core/hc-core.d.ts.map +1 -1
  76. package/dist/sys/hc-core/hc-core.js +69 -61
  77. package/dist/sys/hc-core/hc-core.js.map +1 -1
  78. package/dist/sys/ingress.d.ts +11 -17
  79. package/dist/sys/ingress.d.ts.map +1 -1
  80. package/dist/sys/ingress.js +47 -30
  81. package/dist/sys/ingress.js.map +1 -1
  82. package/dist/sys/package_manager.d.ts +19 -25
  83. package/dist/sys/package_manager.d.ts.map +1 -1
  84. package/dist/sys/package_manager.js +55 -38
  85. package/dist/sys/package_manager.js.map +1 -1
  86. package/dist/sys/portal-server/portal-server.d.ts +64 -64
  87. package/dist/sys/portal-server/portal-server.d.ts.map +1 -1
  88. package/dist/sys/portal-server/portal-server.js +209 -110
  89. package/dist/sys/portal-server/portal-server.js.map +1 -1
  90. package/dist/sys/snapd.d.ts +324 -0
  91. package/dist/sys/snapd.d.ts.map +1 -0
  92. package/dist/sys/snapd.js +882 -0
  93. package/dist/sys/snapd.js.map +1 -0
  94. package/package.json +1 -1
@@ -0,0 +1,882 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.GrpcWebImpl = exports.SnapdServiceSnapdRestoreSnapDesc = exports.SnapdServiceSnapdDelSnapDesc = exports.SnapdServiceSnapdTakeSnapDesc = exports.SnapdServiceSnapdListSnapDesc = exports.SnapdServiceSnapdConfSetDesc = exports.SnapdServiceSnapdConfGetDesc = exports.SnapdServiceSnapdListPathDesc = exports.SnapdServiceSnapdDisableDesc = exports.SnapdServiceSnapdEnableDesc = exports.SnapdServiceDesc = exports.SnapdServiceClientImpl = exports.SnapdSnapRequest = exports.SnapdListSnapResponse = exports.SnapdListSnapRequest = exports.SnapdConfSetRequest = exports.SnapdConf = exports.SnapdListPathResponse = exports.SnapdListPathRequest = exports.SnapdTargetRequest = exports.SnapdEnableRequest = exports.snapdAutoStrategyToJSON = exports.snapdAutoStrategyFromJSON = exports.SnapdAutoStrategy = void 0;
27
+ /* eslint-disable */
28
+ const grpc_web_1 = require("@improbable-eng/grpc-web");
29
+ const empty_1 = require("../google/protobuf/empty");
30
+ const browser_headers_1 = require("browser-headers");
31
+ const OS_snapshot_1 = require("./OS_snapshot");
32
+ const _m0 = __importStar(require("protobufjs/minimal"));
33
+ var SnapdAutoStrategy;
34
+ (function (SnapdAutoStrategy) {
35
+ /** Default - 修改该配置项时,此值表示不改变当前配置值 */
36
+ SnapdAutoStrategy[SnapdAutoStrategy["Default"] = 0] = "Default";
37
+ /** Disabled - 不自动快照(但超过生命周期的历史快照仍会被清理) */
38
+ SnapdAutoStrategy[SnapdAutoStrategy["Disabled"] = 1] = "Disabled";
39
+ /** SnapOnly - 自动快照,但不自动备份 */
40
+ SnapdAutoStrategy[SnapdAutoStrategy["SnapOnly"] = 2] = "SnapOnly";
41
+ /** SnapAndBackup - 自动快照并备份 */
42
+ SnapdAutoStrategy[SnapdAutoStrategy["SnapAndBackup"] = 3] = "SnapAndBackup";
43
+ SnapdAutoStrategy[SnapdAutoStrategy["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
44
+ })(SnapdAutoStrategy = exports.SnapdAutoStrategy || (exports.SnapdAutoStrategy = {}));
45
+ function snapdAutoStrategyFromJSON(object) {
46
+ switch (object) {
47
+ case 0:
48
+ case "Default":
49
+ return SnapdAutoStrategy.Default;
50
+ case 1:
51
+ case "Disabled":
52
+ return SnapdAutoStrategy.Disabled;
53
+ case 2:
54
+ case "SnapOnly":
55
+ return SnapdAutoStrategy.SnapOnly;
56
+ case 3:
57
+ case "SnapAndBackup":
58
+ return SnapdAutoStrategy.SnapAndBackup;
59
+ case -1:
60
+ case "UNRECOGNIZED":
61
+ default:
62
+ return SnapdAutoStrategy.UNRECOGNIZED;
63
+ }
64
+ }
65
+ exports.snapdAutoStrategyFromJSON = snapdAutoStrategyFromJSON;
66
+ function snapdAutoStrategyToJSON(object) {
67
+ switch (object) {
68
+ case SnapdAutoStrategy.Default:
69
+ return "Default";
70
+ case SnapdAutoStrategy.Disabled:
71
+ return "Disabled";
72
+ case SnapdAutoStrategy.SnapOnly:
73
+ return "SnapOnly";
74
+ case SnapdAutoStrategy.SnapAndBackup:
75
+ return "SnapAndBackup";
76
+ case SnapdAutoStrategy.UNRECOGNIZED:
77
+ default:
78
+ return "UNRECOGNIZED";
79
+ }
80
+ }
81
+ exports.snapdAutoStrategyToJSON = snapdAutoStrategyToJSON;
82
+ function createBaseSnapdEnableRequest() {
83
+ return { TargetId: "", PathList: [] };
84
+ }
85
+ exports.SnapdEnableRequest = {
86
+ encode(message, writer = _m0.Writer.create()) {
87
+ if (message.TargetId !== "") {
88
+ writer.uint32(10).string(message.TargetId);
89
+ }
90
+ for (const v of message.PathList) {
91
+ writer.uint32(18).string(v);
92
+ }
93
+ return writer;
94
+ },
95
+ decode(input, length) {
96
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
97
+ let end = length === undefined ? reader.len : reader.pos + length;
98
+ const message = createBaseSnapdEnableRequest();
99
+ while (reader.pos < end) {
100
+ const tag = reader.uint32();
101
+ switch (tag >>> 3) {
102
+ case 1:
103
+ message.TargetId = reader.string();
104
+ break;
105
+ case 2:
106
+ message.PathList.push(reader.string());
107
+ break;
108
+ default:
109
+ reader.skipType(tag & 7);
110
+ break;
111
+ }
112
+ }
113
+ return message;
114
+ },
115
+ fromJSON(object) {
116
+ return {
117
+ TargetId: isSet(object.TargetId) ? String(object.TargetId) : "",
118
+ PathList: Array.isArray(object === null || object === void 0 ? void 0 : object.PathList)
119
+ ? object.PathList.map((e) => String(e))
120
+ : [],
121
+ };
122
+ },
123
+ toJSON(message) {
124
+ const obj = {};
125
+ message.TargetId !== undefined && (obj.TargetId = message.TargetId);
126
+ if (message.PathList) {
127
+ obj.PathList = message.PathList.map((e) => e);
128
+ }
129
+ else {
130
+ obj.PathList = [];
131
+ }
132
+ return obj;
133
+ },
134
+ fromPartial(object) {
135
+ var _a, _b;
136
+ const message = createBaseSnapdEnableRequest();
137
+ message.TargetId = (_a = object.TargetId) !== null && _a !== void 0 ? _a : "";
138
+ message.PathList = ((_b = object.PathList) === null || _b === void 0 ? void 0 : _b.map((e) => e)) || [];
139
+ return message;
140
+ },
141
+ };
142
+ function createBaseSnapdTargetRequest() {
143
+ return { TargetId: "" };
144
+ }
145
+ exports.SnapdTargetRequest = {
146
+ encode(message, writer = _m0.Writer.create()) {
147
+ if (message.TargetId !== "") {
148
+ writer.uint32(10).string(message.TargetId);
149
+ }
150
+ return writer;
151
+ },
152
+ decode(input, length) {
153
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
154
+ let end = length === undefined ? reader.len : reader.pos + length;
155
+ const message = createBaseSnapdTargetRequest();
156
+ while (reader.pos < end) {
157
+ const tag = reader.uint32();
158
+ switch (tag >>> 3) {
159
+ case 1:
160
+ message.TargetId = reader.string();
161
+ break;
162
+ default:
163
+ reader.skipType(tag & 7);
164
+ break;
165
+ }
166
+ }
167
+ return message;
168
+ },
169
+ fromJSON(object) {
170
+ return {
171
+ TargetId: isSet(object.TargetId) ? String(object.TargetId) : "",
172
+ };
173
+ },
174
+ toJSON(message) {
175
+ const obj = {};
176
+ message.TargetId !== undefined && (obj.TargetId = message.TargetId);
177
+ return obj;
178
+ },
179
+ fromPartial(object) {
180
+ var _a;
181
+ const message = createBaseSnapdTargetRequest();
182
+ message.TargetId = (_a = object.TargetId) !== null && _a !== void 0 ? _a : "";
183
+ return message;
184
+ },
185
+ };
186
+ function createBaseSnapdListPathRequest() {
187
+ return { TargetId: "", BackupPool: "" };
188
+ }
189
+ exports.SnapdListPathRequest = {
190
+ encode(message, writer = _m0.Writer.create()) {
191
+ if (message.TargetId !== "") {
192
+ writer.uint32(10).string(message.TargetId);
193
+ }
194
+ if (message.BackupPool !== "") {
195
+ writer.uint32(18).string(message.BackupPool);
196
+ }
197
+ return writer;
198
+ },
199
+ decode(input, length) {
200
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
201
+ let end = length === undefined ? reader.len : reader.pos + length;
202
+ const message = createBaseSnapdListPathRequest();
203
+ while (reader.pos < end) {
204
+ const tag = reader.uint32();
205
+ switch (tag >>> 3) {
206
+ case 1:
207
+ message.TargetId = reader.string();
208
+ break;
209
+ case 2:
210
+ message.BackupPool = reader.string();
211
+ break;
212
+ default:
213
+ reader.skipType(tag & 7);
214
+ break;
215
+ }
216
+ }
217
+ return message;
218
+ },
219
+ fromJSON(object) {
220
+ return {
221
+ TargetId: isSet(object.TargetId) ? String(object.TargetId) : "",
222
+ BackupPool: isSet(object.BackupPool) ? String(object.BackupPool) : "",
223
+ };
224
+ },
225
+ toJSON(message) {
226
+ const obj = {};
227
+ message.TargetId !== undefined && (obj.TargetId = message.TargetId);
228
+ message.BackupPool !== undefined && (obj.BackupPool = message.BackupPool);
229
+ return obj;
230
+ },
231
+ fromPartial(object) {
232
+ var _a, _b;
233
+ const message = createBaseSnapdListPathRequest();
234
+ message.TargetId = (_a = object.TargetId) !== null && _a !== void 0 ? _a : "";
235
+ message.BackupPool = (_b = object.BackupPool) !== null && _b !== void 0 ? _b : "";
236
+ return message;
237
+ },
238
+ };
239
+ function createBaseSnapdListPathResponse() {
240
+ return { PathList: [] };
241
+ }
242
+ exports.SnapdListPathResponse = {
243
+ encode(message, writer = _m0.Writer.create()) {
244
+ for (const v of message.PathList) {
245
+ OS_snapshot_1.SnapshotDatasetDesc.encode(v, writer.uint32(10).fork()).ldelim();
246
+ }
247
+ return writer;
248
+ },
249
+ decode(input, length) {
250
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
251
+ let end = length === undefined ? reader.len : reader.pos + length;
252
+ const message = createBaseSnapdListPathResponse();
253
+ while (reader.pos < end) {
254
+ const tag = reader.uint32();
255
+ switch (tag >>> 3) {
256
+ case 1:
257
+ message.PathList.push(OS_snapshot_1.SnapshotDatasetDesc.decode(reader, reader.uint32()));
258
+ break;
259
+ default:
260
+ reader.skipType(tag & 7);
261
+ break;
262
+ }
263
+ }
264
+ return message;
265
+ },
266
+ fromJSON(object) {
267
+ return {
268
+ PathList: Array.isArray(object === null || object === void 0 ? void 0 : object.PathList)
269
+ ? object.PathList.map((e) => OS_snapshot_1.SnapshotDatasetDesc.fromJSON(e))
270
+ : [],
271
+ };
272
+ },
273
+ toJSON(message) {
274
+ const obj = {};
275
+ if (message.PathList) {
276
+ obj.PathList = message.PathList.map((e) => e ? OS_snapshot_1.SnapshotDatasetDesc.toJSON(e) : undefined);
277
+ }
278
+ else {
279
+ obj.PathList = [];
280
+ }
281
+ return obj;
282
+ },
283
+ fromPartial(object) {
284
+ var _a;
285
+ const message = createBaseSnapdListPathResponse();
286
+ message.PathList =
287
+ ((_a = object.PathList) === null || _a === void 0 ? void 0 : _a.map((e) => OS_snapshot_1.SnapshotDatasetDesc.fromPartial(e))) || [];
288
+ return message;
289
+ },
290
+ };
291
+ function createBaseSnapdConf() {
292
+ return {
293
+ AutoStrategy: 0,
294
+ AutoSnapInterval: 0,
295
+ AutoSnapLifetime: 0,
296
+ AutoBackupInterval: 0,
297
+ AutoBackupLifetime: 0,
298
+ };
299
+ }
300
+ exports.SnapdConf = {
301
+ encode(message, writer = _m0.Writer.create()) {
302
+ if (message.AutoStrategy !== 0) {
303
+ writer.uint32(8).int32(message.AutoStrategy);
304
+ }
305
+ if (message.AutoSnapInterval !== 0) {
306
+ writer.uint32(16).uint32(message.AutoSnapInterval);
307
+ }
308
+ if (message.AutoSnapLifetime !== 0) {
309
+ writer.uint32(24).uint32(message.AutoSnapLifetime);
310
+ }
311
+ if (message.AutoBackupInterval !== 0) {
312
+ writer.uint32(32).uint32(message.AutoBackupInterval);
313
+ }
314
+ if (message.AutoBackupLifetime !== 0) {
315
+ writer.uint32(40).uint32(message.AutoBackupLifetime);
316
+ }
317
+ return writer;
318
+ },
319
+ decode(input, length) {
320
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
321
+ let end = length === undefined ? reader.len : reader.pos + length;
322
+ const message = createBaseSnapdConf();
323
+ while (reader.pos < end) {
324
+ const tag = reader.uint32();
325
+ switch (tag >>> 3) {
326
+ case 1:
327
+ message.AutoStrategy = reader.int32();
328
+ break;
329
+ case 2:
330
+ message.AutoSnapInterval = reader.uint32();
331
+ break;
332
+ case 3:
333
+ message.AutoSnapLifetime = reader.uint32();
334
+ break;
335
+ case 4:
336
+ message.AutoBackupInterval = reader.uint32();
337
+ break;
338
+ case 5:
339
+ message.AutoBackupLifetime = reader.uint32();
340
+ break;
341
+ default:
342
+ reader.skipType(tag & 7);
343
+ break;
344
+ }
345
+ }
346
+ return message;
347
+ },
348
+ fromJSON(object) {
349
+ return {
350
+ AutoStrategy: isSet(object.AutoStrategy)
351
+ ? snapdAutoStrategyFromJSON(object.AutoStrategy)
352
+ : 0,
353
+ AutoSnapInterval: isSet(object.AutoSnapInterval)
354
+ ? Number(object.AutoSnapInterval)
355
+ : 0,
356
+ AutoSnapLifetime: isSet(object.AutoSnapLifetime)
357
+ ? Number(object.AutoSnapLifetime)
358
+ : 0,
359
+ AutoBackupInterval: isSet(object.AutoBackupInterval)
360
+ ? Number(object.AutoBackupInterval)
361
+ : 0,
362
+ AutoBackupLifetime: isSet(object.AutoBackupLifetime)
363
+ ? Number(object.AutoBackupLifetime)
364
+ : 0,
365
+ };
366
+ },
367
+ toJSON(message) {
368
+ const obj = {};
369
+ message.AutoStrategy !== undefined &&
370
+ (obj.AutoStrategy = snapdAutoStrategyToJSON(message.AutoStrategy));
371
+ message.AutoSnapInterval !== undefined &&
372
+ (obj.AutoSnapInterval = Math.round(message.AutoSnapInterval));
373
+ message.AutoSnapLifetime !== undefined &&
374
+ (obj.AutoSnapLifetime = Math.round(message.AutoSnapLifetime));
375
+ message.AutoBackupInterval !== undefined &&
376
+ (obj.AutoBackupInterval = Math.round(message.AutoBackupInterval));
377
+ message.AutoBackupLifetime !== undefined &&
378
+ (obj.AutoBackupLifetime = Math.round(message.AutoBackupLifetime));
379
+ return obj;
380
+ },
381
+ fromPartial(object) {
382
+ var _a, _b, _c, _d, _e;
383
+ const message = createBaseSnapdConf();
384
+ message.AutoStrategy = (_a = object.AutoStrategy) !== null && _a !== void 0 ? _a : 0;
385
+ message.AutoSnapInterval = (_b = object.AutoSnapInterval) !== null && _b !== void 0 ? _b : 0;
386
+ message.AutoSnapLifetime = (_c = object.AutoSnapLifetime) !== null && _c !== void 0 ? _c : 0;
387
+ message.AutoBackupInterval = (_d = object.AutoBackupInterval) !== null && _d !== void 0 ? _d : 0;
388
+ message.AutoBackupLifetime = (_e = object.AutoBackupLifetime) !== null && _e !== void 0 ? _e : 0;
389
+ return message;
390
+ },
391
+ };
392
+ function createBaseSnapdConfSetRequest() {
393
+ return { TargetId: "", Config: undefined };
394
+ }
395
+ exports.SnapdConfSetRequest = {
396
+ encode(message, writer = _m0.Writer.create()) {
397
+ if (message.TargetId !== "") {
398
+ writer.uint32(10).string(message.TargetId);
399
+ }
400
+ if (message.Config !== undefined) {
401
+ exports.SnapdConf.encode(message.Config, writer.uint32(18).fork()).ldelim();
402
+ }
403
+ return writer;
404
+ },
405
+ decode(input, length) {
406
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
407
+ let end = length === undefined ? reader.len : reader.pos + length;
408
+ const message = createBaseSnapdConfSetRequest();
409
+ while (reader.pos < end) {
410
+ const tag = reader.uint32();
411
+ switch (tag >>> 3) {
412
+ case 1:
413
+ message.TargetId = reader.string();
414
+ break;
415
+ case 2:
416
+ message.Config = exports.SnapdConf.decode(reader, reader.uint32());
417
+ break;
418
+ default:
419
+ reader.skipType(tag & 7);
420
+ break;
421
+ }
422
+ }
423
+ return message;
424
+ },
425
+ fromJSON(object) {
426
+ return {
427
+ TargetId: isSet(object.TargetId) ? String(object.TargetId) : "",
428
+ Config: isSet(object.Config)
429
+ ? exports.SnapdConf.fromJSON(object.Config)
430
+ : undefined,
431
+ };
432
+ },
433
+ toJSON(message) {
434
+ const obj = {};
435
+ message.TargetId !== undefined && (obj.TargetId = message.TargetId);
436
+ message.Config !== undefined &&
437
+ (obj.Config = message.Config
438
+ ? exports.SnapdConf.toJSON(message.Config)
439
+ : undefined);
440
+ return obj;
441
+ },
442
+ fromPartial(object) {
443
+ var _a;
444
+ const message = createBaseSnapdConfSetRequest();
445
+ message.TargetId = (_a = object.TargetId) !== null && _a !== void 0 ? _a : "";
446
+ message.Config =
447
+ object.Config !== undefined && object.Config !== null
448
+ ? exports.SnapdConf.fromPartial(object.Config)
449
+ : undefined;
450
+ return message;
451
+ },
452
+ };
453
+ function createBaseSnapdListSnapRequest() {
454
+ return { TargetId: "", Path: "", BackupPool: "" };
455
+ }
456
+ exports.SnapdListSnapRequest = {
457
+ encode(message, writer = _m0.Writer.create()) {
458
+ if (message.TargetId !== "") {
459
+ writer.uint32(10).string(message.TargetId);
460
+ }
461
+ if (message.Path !== "") {
462
+ writer.uint32(18).string(message.Path);
463
+ }
464
+ if (message.BackupPool !== "") {
465
+ writer.uint32(26).string(message.BackupPool);
466
+ }
467
+ return writer;
468
+ },
469
+ decode(input, length) {
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 = createBaseSnapdListSnapRequest();
473
+ while (reader.pos < end) {
474
+ const tag = reader.uint32();
475
+ switch (tag >>> 3) {
476
+ case 1:
477
+ message.TargetId = reader.string();
478
+ break;
479
+ case 2:
480
+ message.Path = reader.string();
481
+ break;
482
+ case 3:
483
+ message.BackupPool = reader.string();
484
+ break;
485
+ default:
486
+ reader.skipType(tag & 7);
487
+ break;
488
+ }
489
+ }
490
+ return message;
491
+ },
492
+ fromJSON(object) {
493
+ return {
494
+ TargetId: isSet(object.TargetId) ? String(object.TargetId) : "",
495
+ Path: isSet(object.Path) ? String(object.Path) : "",
496
+ BackupPool: isSet(object.BackupPool) ? String(object.BackupPool) : "",
497
+ };
498
+ },
499
+ toJSON(message) {
500
+ const obj = {};
501
+ message.TargetId !== undefined && (obj.TargetId = message.TargetId);
502
+ message.Path !== undefined && (obj.Path = message.Path);
503
+ message.BackupPool !== undefined && (obj.BackupPool = message.BackupPool);
504
+ return obj;
505
+ },
506
+ fromPartial(object) {
507
+ var _a, _b, _c;
508
+ const message = createBaseSnapdListSnapRequest();
509
+ message.TargetId = (_a = object.TargetId) !== null && _a !== void 0 ? _a : "";
510
+ message.Path = (_b = object.Path) !== null && _b !== void 0 ? _b : "";
511
+ message.BackupPool = (_c = object.BackupPool) !== null && _c !== void 0 ? _c : "";
512
+ return message;
513
+ },
514
+ };
515
+ function createBaseSnapdListSnapResponse() {
516
+ return { SnapshotList: [] };
517
+ }
518
+ exports.SnapdListSnapResponse = {
519
+ encode(message, writer = _m0.Writer.create()) {
520
+ for (const v of message.SnapshotList) {
521
+ OS_snapshot_1.SnapshotDesc.encode(v, writer.uint32(10).fork()).ldelim();
522
+ }
523
+ return writer;
524
+ },
525
+ decode(input, length) {
526
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
527
+ let end = length === undefined ? reader.len : reader.pos + length;
528
+ const message = createBaseSnapdListSnapResponse();
529
+ while (reader.pos < end) {
530
+ const tag = reader.uint32();
531
+ switch (tag >>> 3) {
532
+ case 1:
533
+ message.SnapshotList.push(OS_snapshot_1.SnapshotDesc.decode(reader, reader.uint32()));
534
+ break;
535
+ default:
536
+ reader.skipType(tag & 7);
537
+ break;
538
+ }
539
+ }
540
+ return message;
541
+ },
542
+ fromJSON(object) {
543
+ return {
544
+ SnapshotList: Array.isArray(object === null || object === void 0 ? void 0 : object.SnapshotList)
545
+ ? object.SnapshotList.map((e) => OS_snapshot_1.SnapshotDesc.fromJSON(e))
546
+ : [],
547
+ };
548
+ },
549
+ toJSON(message) {
550
+ const obj = {};
551
+ if (message.SnapshotList) {
552
+ obj.SnapshotList = message.SnapshotList.map((e) => e ? OS_snapshot_1.SnapshotDesc.toJSON(e) : undefined);
553
+ }
554
+ else {
555
+ obj.SnapshotList = [];
556
+ }
557
+ return obj;
558
+ },
559
+ fromPartial(object) {
560
+ var _a;
561
+ const message = createBaseSnapdListSnapResponse();
562
+ message.SnapshotList =
563
+ ((_a = object.SnapshotList) === null || _a === void 0 ? void 0 : _a.map((e) => OS_snapshot_1.SnapshotDesc.fromPartial(e))) || [];
564
+ return message;
565
+ },
566
+ };
567
+ function createBaseSnapdSnapRequest() {
568
+ return { TargetId: "", Path: "", BackupPool: "", SnapName: "" };
569
+ }
570
+ exports.SnapdSnapRequest = {
571
+ encode(message, writer = _m0.Writer.create()) {
572
+ if (message.TargetId !== "") {
573
+ writer.uint32(10).string(message.TargetId);
574
+ }
575
+ if (message.Path !== "") {
576
+ writer.uint32(18).string(message.Path);
577
+ }
578
+ if (message.BackupPool !== "") {
579
+ writer.uint32(26).string(message.BackupPool);
580
+ }
581
+ if (message.SnapName !== "") {
582
+ writer.uint32(34).string(message.SnapName);
583
+ }
584
+ return writer;
585
+ },
586
+ decode(input, length) {
587
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
588
+ let end = length === undefined ? reader.len : reader.pos + length;
589
+ const message = createBaseSnapdSnapRequest();
590
+ while (reader.pos < end) {
591
+ const tag = reader.uint32();
592
+ switch (tag >>> 3) {
593
+ case 1:
594
+ message.TargetId = reader.string();
595
+ break;
596
+ case 2:
597
+ message.Path = reader.string();
598
+ break;
599
+ case 3:
600
+ message.BackupPool = reader.string();
601
+ break;
602
+ case 4:
603
+ message.SnapName = reader.string();
604
+ break;
605
+ default:
606
+ reader.skipType(tag & 7);
607
+ break;
608
+ }
609
+ }
610
+ return message;
611
+ },
612
+ fromJSON(object) {
613
+ return {
614
+ TargetId: isSet(object.TargetId) ? String(object.TargetId) : "",
615
+ Path: isSet(object.Path) ? String(object.Path) : "",
616
+ BackupPool: isSet(object.BackupPool) ? String(object.BackupPool) : "",
617
+ SnapName: isSet(object.SnapName) ? String(object.SnapName) : "",
618
+ };
619
+ },
620
+ toJSON(message) {
621
+ const obj = {};
622
+ message.TargetId !== undefined && (obj.TargetId = message.TargetId);
623
+ message.Path !== undefined && (obj.Path = message.Path);
624
+ message.BackupPool !== undefined && (obj.BackupPool = message.BackupPool);
625
+ message.SnapName !== undefined && (obj.SnapName = message.SnapName);
626
+ return obj;
627
+ },
628
+ fromPartial(object) {
629
+ var _a, _b, _c, _d;
630
+ const message = createBaseSnapdSnapRequest();
631
+ message.TargetId = (_a = object.TargetId) !== null && _a !== void 0 ? _a : "";
632
+ message.Path = (_b = object.Path) !== null && _b !== void 0 ? _b : "";
633
+ message.BackupPool = (_c = object.BackupPool) !== null && _c !== void 0 ? _c : "";
634
+ message.SnapName = (_d = object.SnapName) !== null && _d !== void 0 ? _d : "";
635
+ return message;
636
+ },
637
+ };
638
+ class SnapdServiceClientImpl {
639
+ constructor(rpc) {
640
+ this.rpc = rpc;
641
+ this.SnapdEnable = this.SnapdEnable.bind(this);
642
+ this.SnapdDisable = this.SnapdDisable.bind(this);
643
+ this.SnapdListPath = this.SnapdListPath.bind(this);
644
+ this.SnapdConfGet = this.SnapdConfGet.bind(this);
645
+ this.SnapdConfSet = this.SnapdConfSet.bind(this);
646
+ this.SnapdListSnap = this.SnapdListSnap.bind(this);
647
+ this.SnapdTakeSnap = this.SnapdTakeSnap.bind(this);
648
+ this.SnapdDelSnap = this.SnapdDelSnap.bind(this);
649
+ this.SnapdRestoreSnap = this.SnapdRestoreSnap.bind(this);
650
+ }
651
+ SnapdEnable(request, metadata) {
652
+ return this.rpc.unary(exports.SnapdServiceSnapdEnableDesc, exports.SnapdEnableRequest.fromPartial(request), metadata);
653
+ }
654
+ SnapdDisable(request, metadata) {
655
+ return this.rpc.unary(exports.SnapdServiceSnapdDisableDesc, exports.SnapdTargetRequest.fromPartial(request), metadata);
656
+ }
657
+ SnapdListPath(request, metadata) {
658
+ return this.rpc.unary(exports.SnapdServiceSnapdListPathDesc, exports.SnapdListPathRequest.fromPartial(request), metadata);
659
+ }
660
+ SnapdConfGet(request, metadata) {
661
+ return this.rpc.unary(exports.SnapdServiceSnapdConfGetDesc, exports.SnapdTargetRequest.fromPartial(request), metadata);
662
+ }
663
+ SnapdConfSet(request, metadata) {
664
+ return this.rpc.unary(exports.SnapdServiceSnapdConfSetDesc, exports.SnapdConfSetRequest.fromPartial(request), metadata);
665
+ }
666
+ SnapdListSnap(request, metadata) {
667
+ return this.rpc.unary(exports.SnapdServiceSnapdListSnapDesc, exports.SnapdListSnapRequest.fromPartial(request), metadata);
668
+ }
669
+ SnapdTakeSnap(request, metadata) {
670
+ return this.rpc.unary(exports.SnapdServiceSnapdTakeSnapDesc, exports.SnapdSnapRequest.fromPartial(request), metadata);
671
+ }
672
+ SnapdDelSnap(request, metadata) {
673
+ return this.rpc.unary(exports.SnapdServiceSnapdDelSnapDesc, exports.SnapdSnapRequest.fromPartial(request), metadata);
674
+ }
675
+ SnapdRestoreSnap(request, metadata) {
676
+ return this.rpc.unary(exports.SnapdServiceSnapdRestoreSnapDesc, exports.SnapdSnapRequest.fromPartial(request), metadata);
677
+ }
678
+ }
679
+ exports.SnapdServiceClientImpl = SnapdServiceClientImpl;
680
+ exports.SnapdServiceDesc = {
681
+ serviceName: "cloud.lazycat.apis.sys.SnapdService",
682
+ };
683
+ exports.SnapdServiceSnapdEnableDesc = {
684
+ methodName: "SnapdEnable",
685
+ service: exports.SnapdServiceDesc,
686
+ requestStream: false,
687
+ responseStream: false,
688
+ requestType: {
689
+ serializeBinary() {
690
+ return exports.SnapdEnableRequest.encode(this).finish();
691
+ },
692
+ },
693
+ responseType: {
694
+ deserializeBinary(data) {
695
+ return Object.assign(Object.assign({}, empty_1.Empty.decode(data)), { toObject() {
696
+ return this;
697
+ } });
698
+ },
699
+ },
700
+ };
701
+ exports.SnapdServiceSnapdDisableDesc = {
702
+ methodName: "SnapdDisable",
703
+ service: exports.SnapdServiceDesc,
704
+ requestStream: false,
705
+ responseStream: false,
706
+ requestType: {
707
+ serializeBinary() {
708
+ return exports.SnapdTargetRequest.encode(this).finish();
709
+ },
710
+ },
711
+ responseType: {
712
+ deserializeBinary(data) {
713
+ return Object.assign(Object.assign({}, empty_1.Empty.decode(data)), { toObject() {
714
+ return this;
715
+ } });
716
+ },
717
+ },
718
+ };
719
+ exports.SnapdServiceSnapdListPathDesc = {
720
+ methodName: "SnapdListPath",
721
+ service: exports.SnapdServiceDesc,
722
+ requestStream: false,
723
+ responseStream: false,
724
+ requestType: {
725
+ serializeBinary() {
726
+ return exports.SnapdListPathRequest.encode(this).finish();
727
+ },
728
+ },
729
+ responseType: {
730
+ deserializeBinary(data) {
731
+ return Object.assign(Object.assign({}, exports.SnapdListPathResponse.decode(data)), { toObject() {
732
+ return this;
733
+ } });
734
+ },
735
+ },
736
+ };
737
+ exports.SnapdServiceSnapdConfGetDesc = {
738
+ methodName: "SnapdConfGet",
739
+ service: exports.SnapdServiceDesc,
740
+ requestStream: false,
741
+ responseStream: false,
742
+ requestType: {
743
+ serializeBinary() {
744
+ return exports.SnapdTargetRequest.encode(this).finish();
745
+ },
746
+ },
747
+ responseType: {
748
+ deserializeBinary(data) {
749
+ return Object.assign(Object.assign({}, exports.SnapdConf.decode(data)), { toObject() {
750
+ return this;
751
+ } });
752
+ },
753
+ },
754
+ };
755
+ exports.SnapdServiceSnapdConfSetDesc = {
756
+ methodName: "SnapdConfSet",
757
+ service: exports.SnapdServiceDesc,
758
+ requestStream: false,
759
+ responseStream: false,
760
+ requestType: {
761
+ serializeBinary() {
762
+ return exports.SnapdConfSetRequest.encode(this).finish();
763
+ },
764
+ },
765
+ responseType: {
766
+ deserializeBinary(data) {
767
+ return Object.assign(Object.assign({}, empty_1.Empty.decode(data)), { toObject() {
768
+ return this;
769
+ } });
770
+ },
771
+ },
772
+ };
773
+ exports.SnapdServiceSnapdListSnapDesc = {
774
+ methodName: "SnapdListSnap",
775
+ service: exports.SnapdServiceDesc,
776
+ requestStream: false,
777
+ responseStream: false,
778
+ requestType: {
779
+ serializeBinary() {
780
+ return exports.SnapdListSnapRequest.encode(this).finish();
781
+ },
782
+ },
783
+ responseType: {
784
+ deserializeBinary(data) {
785
+ return Object.assign(Object.assign({}, exports.SnapdListSnapResponse.decode(data)), { toObject() {
786
+ return this;
787
+ } });
788
+ },
789
+ },
790
+ };
791
+ exports.SnapdServiceSnapdTakeSnapDesc = {
792
+ methodName: "SnapdTakeSnap",
793
+ service: exports.SnapdServiceDesc,
794
+ requestStream: false,
795
+ responseStream: false,
796
+ requestType: {
797
+ serializeBinary() {
798
+ return exports.SnapdSnapRequest.encode(this).finish();
799
+ },
800
+ },
801
+ responseType: {
802
+ deserializeBinary(data) {
803
+ return Object.assign(Object.assign({}, empty_1.Empty.decode(data)), { toObject() {
804
+ return this;
805
+ } });
806
+ },
807
+ },
808
+ };
809
+ exports.SnapdServiceSnapdDelSnapDesc = {
810
+ methodName: "SnapdDelSnap",
811
+ service: exports.SnapdServiceDesc,
812
+ requestStream: false,
813
+ responseStream: false,
814
+ requestType: {
815
+ serializeBinary() {
816
+ return exports.SnapdSnapRequest.encode(this).finish();
817
+ },
818
+ },
819
+ responseType: {
820
+ deserializeBinary(data) {
821
+ return Object.assign(Object.assign({}, empty_1.Empty.decode(data)), { toObject() {
822
+ return this;
823
+ } });
824
+ },
825
+ },
826
+ };
827
+ exports.SnapdServiceSnapdRestoreSnapDesc = {
828
+ methodName: "SnapdRestoreSnap",
829
+ service: exports.SnapdServiceDesc,
830
+ requestStream: false,
831
+ responseStream: false,
832
+ requestType: {
833
+ serializeBinary() {
834
+ return exports.SnapdSnapRequest.encode(this).finish();
835
+ },
836
+ },
837
+ responseType: {
838
+ deserializeBinary(data) {
839
+ return Object.assign(Object.assign({}, empty_1.Empty.decode(data)), { toObject() {
840
+ return this;
841
+ } });
842
+ },
843
+ },
844
+ };
845
+ class GrpcWebImpl {
846
+ constructor(host, options) {
847
+ this.host = host;
848
+ this.options = options;
849
+ }
850
+ unary(methodDesc, _request, metadata) {
851
+ var _a;
852
+ const request = Object.assign(Object.assign({}, _request), methodDesc.requestType);
853
+ const maybeCombinedMetadata = metadata && this.options.metadata
854
+ ? new browser_headers_1.BrowserHeaders(Object.assign(Object.assign({}, (_a = this.options) === null || _a === void 0 ? void 0 : _a.metadata.headersMap), metadata === null || metadata === void 0 ? void 0 : metadata.headersMap))
855
+ : metadata || this.options.metadata;
856
+ return new Promise((resolve, reject) => {
857
+ grpc_web_1.grpc.unary(methodDesc, {
858
+ request,
859
+ host: this.host,
860
+ metadata: maybeCombinedMetadata,
861
+ transport: this.options.transport,
862
+ debug: this.options.debug,
863
+ onEnd: function (response) {
864
+ if (response.status === grpc_web_1.grpc.Code.OK) {
865
+ resolve(response.message);
866
+ }
867
+ else {
868
+ const err = new Error(response.statusMessage);
869
+ err.code = response.status;
870
+ err.metadata = response.trailers;
871
+ reject(err);
872
+ }
873
+ },
874
+ });
875
+ });
876
+ }
877
+ }
878
+ exports.GrpcWebImpl = GrpcWebImpl;
879
+ function isSet(value) {
880
+ return value !== null && value !== undefined;
881
+ }
882
+ //# sourceMappingURL=snapd.js.map