@ekhein/lamda-node-sdk 1.0.1 → 1.0.3

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 (114) hide show
  1. package/dist/chunk-3JBDAA2H.js +439 -0
  2. package/dist/chunk-4AHM55IO.js +1172 -0
  3. package/dist/chunk-4NKGYNMS.js +116 -0
  4. package/dist/chunk-6HD35RPW.js +5370 -0
  5. package/dist/chunk-76Y3OVVH.js +1602 -0
  6. package/dist/chunk-7XF22HAW.js +907 -0
  7. package/dist/chunk-7YGA6EOV.js +109 -0
  8. package/dist/chunk-ADS4GRIL.js +14 -0
  9. package/dist/chunk-FSLE4VGI.js +48 -0
  10. package/dist/chunk-H7Z6XFBF.js +134 -0
  11. package/dist/chunk-KJKSI2WL.js +62 -0
  12. package/dist/chunk-O52JGDU7.js +800 -0
  13. package/dist/chunk-ORXTTWPB.js +379 -0
  14. package/dist/chunk-OZJH6SR7.js +20 -0
  15. package/dist/chunk-P53F45YO.js +64 -0
  16. package/dist/chunk-QXMPY6EE.js +289 -0
  17. package/dist/chunk-SBFKX3ZY.js +1554 -0
  18. package/dist/chunk-WFQEBPE6.js +300 -0
  19. package/dist/chunk-X4LTH2UN.js +983 -0
  20. package/dist/chunk-XAX5BZL3.js +132 -0
  21. package/dist/chunk-ZXF5DGTC.js +45 -0
  22. package/dist/constants/activity.flag.cjs +92 -0
  23. package/dist/constants/activity.flag.d.cts +24 -0
  24. package/dist/constants/activity.flag.d.ts +24 -0
  25. package/dist/constants/activity.flag.js +49 -0
  26. package/dist/constants/android.intent.cjs +194 -0
  27. package/dist/constants/android.intent.d.cts +58 -0
  28. package/dist/constants/android.intent.d.ts +58 -0
  29. package/dist/constants/android.intent.js +117 -0
  30. package/dist/constants/android.permission.cjs +116 -0
  31. package/dist/constants/android.permission.d.cts +32 -0
  32. package/dist/constants/android.permission.d.ts +32 -0
  33. package/dist/constants/android.permission.js +65 -0
  34. package/dist/constants/index.cjs +356 -0
  35. package/dist/constants/index.d.cts +3 -0
  36. package/dist/constants/index.d.ts +3 -0
  37. package/dist/constants/index.js +225 -0
  38. package/dist/decorators/inject.decorator.cjs +43 -0
  39. package/dist/decorators/inject.decorator.d.cts +5 -0
  40. package/dist/decorators/inject.decorator.d.ts +5 -0
  41. package/dist/decorators/inject.decorator.js +7 -0
  42. package/dist/main.cjs +1 -2
  43. package/dist/main.d.cts +17 -1152
  44. package/dist/main.d.ts +17 -1152
  45. package/dist/main.js +36 -11873
  46. package/dist/rpc/application.cjs +2019 -0
  47. package/dist/rpc/application.d.cts +138 -0
  48. package/dist/rpc/application.d.ts +138 -0
  49. package/dist/rpc/application.js +50 -0
  50. package/dist/rpc/debug.cjs +86 -0
  51. package/dist/rpc/debug.d.cts +21 -0
  52. package/dist/rpc/debug.d.ts +21 -0
  53. package/dist/rpc/debug.js +9 -0
  54. package/dist/rpc/file.cjs +405 -0
  55. package/dist/rpc/file.d.cts +40 -0
  56. package/dist/rpc/file.d.ts +40 -0
  57. package/dist/rpc/file.js +13 -0
  58. package/dist/rpc/google/protobuf/any.cjs +126 -0
  59. package/dist/rpc/google/protobuf/any.d.cts +22 -0
  60. package/dist/rpc/google/protobuf/any.d.ts +22 -0
  61. package/dist/rpc/google/protobuf/any.js +103 -0
  62. package/dist/rpc/google/protobuf/empty.cjs +69 -0
  63. package/dist/rpc/google/protobuf/empty.d.cts +20 -0
  64. package/dist/rpc/google/protobuf/empty.d.ts +20 -0
  65. package/dist/rpc/google/protobuf/empty.js +9 -0
  66. package/dist/rpc/google/protobuf/struct.cjs +469 -0
  67. package/dist/rpc/google/protobuf/struct.d.cts +65 -0
  68. package/dist/rpc/google/protobuf/struct.d.ts +65 -0
  69. package/dist/rpc/google/protobuf/struct.js +21 -0
  70. package/dist/rpc/policy.cjs +133 -0
  71. package/dist/rpc/policy.d.cts +24 -0
  72. package/dist/rpc/policy.d.ts +24 -0
  73. package/dist/rpc/policy.js +9 -0
  74. package/dist/rpc/proxy.cjs +1109 -0
  75. package/dist/rpc/proxy.d.cts +108 -0
  76. package/dist/rpc/proxy.d.ts +108 -0
  77. package/dist/rpc/proxy.js +49 -0
  78. package/dist/rpc/services.cjs +11898 -0
  79. package/dist/rpc/services.d.cts +1920 -0
  80. package/dist/rpc/services.d.ts +1920 -0
  81. package/dist/rpc/services.js +48 -0
  82. package/dist/rpc/settings.cjs +161 -0
  83. package/dist/rpc/settings.d.cts +31 -0
  84. package/dist/rpc/settings.d.ts +31 -0
  85. package/dist/rpc/settings.js +15 -0
  86. package/dist/rpc/shell.cjs +326 -0
  87. package/dist/rpc/shell.d.cts +36 -0
  88. package/dist/rpc/shell.d.ts +36 -0
  89. package/dist/rpc/shell.js +13 -0
  90. package/dist/rpc/status.cjs +936 -0
  91. package/dist/rpc/status.d.cts +76 -0
  92. package/dist/rpc/status.d.ts +76 -0
  93. package/dist/rpc/status.js +19 -0
  94. package/dist/rpc/storage.cjs +156 -0
  95. package/dist/rpc/storage.d.cts +24 -0
  96. package/dist/rpc/storage.d.ts +24 -0
  97. package/dist/rpc/storage.js +9 -0
  98. package/dist/rpc/types.cjs +317 -0
  99. package/dist/rpc/types.d.cts +36 -0
  100. package/dist/rpc/types.d.ts +36 -0
  101. package/dist/rpc/types.js +17 -0
  102. package/dist/rpc/uiautomator.cjs +5446 -0
  103. package/dist/rpc/uiautomator.d.cts +618 -0
  104. package/dist/rpc/uiautomator.d.ts +618 -0
  105. package/dist/rpc/uiautomator.js +113 -0
  106. package/dist/rpc/util.cjs +1212 -0
  107. package/dist/rpc/util.d.cts +103 -0
  108. package/dist/rpc/util.d.ts +103 -0
  109. package/dist/rpc/util.js +41 -0
  110. package/dist/rpc/wifi.cjs +1015 -0
  111. package/dist/rpc/wifi.d.cts +84 -0
  112. package/dist/rpc/wifi.d.ts +84 -0
  113. package/dist/rpc/wifi.js +25 -0
  114. package/package.json +3 -4
@@ -0,0 +1,1172 @@
1
+ // src/rpc/util.ts
2
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
3
+ var protobufPackage = "lamda.rpc";
4
+ var ToastDuration = /* @__PURE__ */ ((ToastDuration2) => {
5
+ ToastDuration2[ToastDuration2["TD_SHORT"] = 0] = "TD_SHORT";
6
+ ToastDuration2[ToastDuration2["TD_LONG"] = 1] = "TD_LONG";
7
+ ToastDuration2[ToastDuration2["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
8
+ return ToastDuration2;
9
+ })(ToastDuration || {});
10
+ function toastDurationFromJSON(object) {
11
+ switch (object) {
12
+ case 0:
13
+ case "TD_SHORT":
14
+ return 0 /* TD_SHORT */;
15
+ case 1:
16
+ case "TD_LONG":
17
+ return 1 /* TD_LONG */;
18
+ case -1:
19
+ case "UNRECOGNIZED":
20
+ default:
21
+ return -1 /* UNRECOGNIZED */;
22
+ }
23
+ }
24
+ function toastDurationToJSON(object) {
25
+ switch (object) {
26
+ case 0 /* TD_SHORT */:
27
+ return "TD_SHORT";
28
+ case 1 /* TD_LONG */:
29
+ return "TD_LONG";
30
+ case -1 /* UNRECOGNIZED */:
31
+ default:
32
+ return "UNRECOGNIZED";
33
+ }
34
+ }
35
+ function createBaseTouchDown() {
36
+ return { tid: 0, x: 0, y: 0, pressure: 0 };
37
+ }
38
+ var TouchDown = {
39
+ encode(message, writer = new BinaryWriter()) {
40
+ if (message.tid !== 0) {
41
+ writer.uint32(8).int32(message.tid);
42
+ }
43
+ if (message.x !== 0) {
44
+ writer.uint32(16).int32(message.x);
45
+ }
46
+ if (message.y !== 0) {
47
+ writer.uint32(24).int32(message.y);
48
+ }
49
+ if (message.pressure !== 0) {
50
+ writer.uint32(32).int32(message.pressure);
51
+ }
52
+ return writer;
53
+ },
54
+ decode(input, length) {
55
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
56
+ let end = length === void 0 ? reader.len : reader.pos + length;
57
+ const message = createBaseTouchDown();
58
+ while (reader.pos < end) {
59
+ const tag = reader.uint32();
60
+ switch (tag >>> 3) {
61
+ case 1: {
62
+ if (tag !== 8) {
63
+ break;
64
+ }
65
+ message.tid = reader.int32();
66
+ continue;
67
+ }
68
+ case 2: {
69
+ if (tag !== 16) {
70
+ break;
71
+ }
72
+ message.x = reader.int32();
73
+ continue;
74
+ }
75
+ case 3: {
76
+ if (tag !== 24) {
77
+ break;
78
+ }
79
+ message.y = reader.int32();
80
+ continue;
81
+ }
82
+ case 4: {
83
+ if (tag !== 32) {
84
+ break;
85
+ }
86
+ message.pressure = reader.int32();
87
+ continue;
88
+ }
89
+ }
90
+ if ((tag & 7) === 4 || tag === 0) {
91
+ break;
92
+ }
93
+ reader.skip(tag & 7);
94
+ }
95
+ return message;
96
+ },
97
+ fromJSON(object) {
98
+ return {
99
+ tid: isSet(object.tid) ? globalThis.Number(object.tid) : 0,
100
+ x: isSet(object.x) ? globalThis.Number(object.x) : 0,
101
+ y: isSet(object.y) ? globalThis.Number(object.y) : 0,
102
+ pressure: isSet(object.pressure) ? globalThis.Number(object.pressure) : 0
103
+ };
104
+ },
105
+ toJSON(message) {
106
+ const obj = {};
107
+ if (message.tid !== 0) {
108
+ obj.tid = Math.round(message.tid);
109
+ }
110
+ if (message.x !== 0) {
111
+ obj.x = Math.round(message.x);
112
+ }
113
+ if (message.y !== 0) {
114
+ obj.y = Math.round(message.y);
115
+ }
116
+ if (message.pressure !== 0) {
117
+ obj.pressure = Math.round(message.pressure);
118
+ }
119
+ return obj;
120
+ },
121
+ create(base) {
122
+ return TouchDown.fromPartial(base ?? {});
123
+ },
124
+ fromPartial(object) {
125
+ const message = createBaseTouchDown();
126
+ message.tid = object.tid ?? 0;
127
+ message.x = object.x ?? 0;
128
+ message.y = object.y ?? 0;
129
+ message.pressure = object.pressure ?? 0;
130
+ return message;
131
+ }
132
+ };
133
+ function createBaseTouchUp() {
134
+ return { tid: 0 };
135
+ }
136
+ var TouchUp = {
137
+ encode(message, writer = new BinaryWriter()) {
138
+ if (message.tid !== 0) {
139
+ writer.uint32(8).int32(message.tid);
140
+ }
141
+ return writer;
142
+ },
143
+ decode(input, length) {
144
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
145
+ let end = length === void 0 ? reader.len : reader.pos + length;
146
+ const message = createBaseTouchUp();
147
+ while (reader.pos < end) {
148
+ const tag = reader.uint32();
149
+ switch (tag >>> 3) {
150
+ case 1: {
151
+ if (tag !== 8) {
152
+ break;
153
+ }
154
+ message.tid = reader.int32();
155
+ continue;
156
+ }
157
+ }
158
+ if ((tag & 7) === 4 || tag === 0) {
159
+ break;
160
+ }
161
+ reader.skip(tag & 7);
162
+ }
163
+ return message;
164
+ },
165
+ fromJSON(object) {
166
+ return { tid: isSet(object.tid) ? globalThis.Number(object.tid) : 0 };
167
+ },
168
+ toJSON(message) {
169
+ const obj = {};
170
+ if (message.tid !== 0) {
171
+ obj.tid = Math.round(message.tid);
172
+ }
173
+ return obj;
174
+ },
175
+ create(base) {
176
+ return TouchUp.fromPartial(base ?? {});
177
+ },
178
+ fromPartial(object) {
179
+ const message = createBaseTouchUp();
180
+ message.tid = object.tid ?? 0;
181
+ return message;
182
+ }
183
+ };
184
+ function createBaseTouchMove() {
185
+ return { tid: 0, x: 0, y: 0, pressure: 0 };
186
+ }
187
+ var TouchMove = {
188
+ encode(message, writer = new BinaryWriter()) {
189
+ if (message.tid !== 0) {
190
+ writer.uint32(8).int32(message.tid);
191
+ }
192
+ if (message.x !== 0) {
193
+ writer.uint32(16).int32(message.x);
194
+ }
195
+ if (message.y !== 0) {
196
+ writer.uint32(24).int32(message.y);
197
+ }
198
+ if (message.pressure !== 0) {
199
+ writer.uint32(32).int32(message.pressure);
200
+ }
201
+ return writer;
202
+ },
203
+ decode(input, length) {
204
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
205
+ let end = length === void 0 ? reader.len : reader.pos + length;
206
+ const message = createBaseTouchMove();
207
+ while (reader.pos < end) {
208
+ const tag = reader.uint32();
209
+ switch (tag >>> 3) {
210
+ case 1: {
211
+ if (tag !== 8) {
212
+ break;
213
+ }
214
+ message.tid = reader.int32();
215
+ continue;
216
+ }
217
+ case 2: {
218
+ if (tag !== 16) {
219
+ break;
220
+ }
221
+ message.x = reader.int32();
222
+ continue;
223
+ }
224
+ case 3: {
225
+ if (tag !== 24) {
226
+ break;
227
+ }
228
+ message.y = reader.int32();
229
+ continue;
230
+ }
231
+ case 4: {
232
+ if (tag !== 32) {
233
+ break;
234
+ }
235
+ message.pressure = reader.int32();
236
+ continue;
237
+ }
238
+ }
239
+ if ((tag & 7) === 4 || tag === 0) {
240
+ break;
241
+ }
242
+ reader.skip(tag & 7);
243
+ }
244
+ return message;
245
+ },
246
+ fromJSON(object) {
247
+ return {
248
+ tid: isSet(object.tid) ? globalThis.Number(object.tid) : 0,
249
+ x: isSet(object.x) ? globalThis.Number(object.x) : 0,
250
+ y: isSet(object.y) ? globalThis.Number(object.y) : 0,
251
+ pressure: isSet(object.pressure) ? globalThis.Number(object.pressure) : 0
252
+ };
253
+ },
254
+ toJSON(message) {
255
+ const obj = {};
256
+ if (message.tid !== 0) {
257
+ obj.tid = Math.round(message.tid);
258
+ }
259
+ if (message.x !== 0) {
260
+ obj.x = Math.round(message.x);
261
+ }
262
+ if (message.y !== 0) {
263
+ obj.y = Math.round(message.y);
264
+ }
265
+ if (message.pressure !== 0) {
266
+ obj.pressure = Math.round(message.pressure);
267
+ }
268
+ return obj;
269
+ },
270
+ create(base) {
271
+ return TouchMove.fromPartial(base ?? {});
272
+ },
273
+ fromPartial(object) {
274
+ const message = createBaseTouchMove();
275
+ message.tid = object.tid ?? 0;
276
+ message.x = object.x ?? 0;
277
+ message.y = object.y ?? 0;
278
+ message.pressure = object.pressure ?? 0;
279
+ return message;
280
+ }
281
+ };
282
+ function createBaseTouchWait() {
283
+ return { wait: 0 };
284
+ }
285
+ var TouchWait = {
286
+ encode(message, writer = new BinaryWriter()) {
287
+ if (message.wait !== 0) {
288
+ writer.uint32(8).uint32(message.wait);
289
+ }
290
+ return writer;
291
+ },
292
+ decode(input, length) {
293
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
294
+ let end = length === void 0 ? reader.len : reader.pos + length;
295
+ const message = createBaseTouchWait();
296
+ while (reader.pos < end) {
297
+ const tag = reader.uint32();
298
+ switch (tag >>> 3) {
299
+ case 1: {
300
+ if (tag !== 8) {
301
+ break;
302
+ }
303
+ message.wait = reader.uint32();
304
+ continue;
305
+ }
306
+ }
307
+ if ((tag & 7) === 4 || tag === 0) {
308
+ break;
309
+ }
310
+ reader.skip(tag & 7);
311
+ }
312
+ return message;
313
+ },
314
+ fromJSON(object) {
315
+ return { wait: isSet(object.wait) ? globalThis.Number(object.wait) : 0 };
316
+ },
317
+ toJSON(message) {
318
+ const obj = {};
319
+ if (message.wait !== 0) {
320
+ obj.wait = Math.round(message.wait);
321
+ }
322
+ return obj;
323
+ },
324
+ create(base) {
325
+ return TouchWait.fromPartial(base ?? {});
326
+ },
327
+ fromPartial(object) {
328
+ const message = createBaseTouchWait();
329
+ message.wait = object.wait ?? 0;
330
+ return message;
331
+ }
332
+ };
333
+ function createBaseTouchAction() {
334
+ return { down: void 0, move: void 0, wait: void 0, up: void 0 };
335
+ }
336
+ var TouchAction = {
337
+ encode(message, writer = new BinaryWriter()) {
338
+ if (message.down !== void 0) {
339
+ TouchDown.encode(message.down, writer.uint32(10).fork()).join();
340
+ }
341
+ if (message.move !== void 0) {
342
+ TouchMove.encode(message.move, writer.uint32(18).fork()).join();
343
+ }
344
+ if (message.wait !== void 0) {
345
+ TouchWait.encode(message.wait, writer.uint32(26).fork()).join();
346
+ }
347
+ if (message.up !== void 0) {
348
+ TouchUp.encode(message.up, writer.uint32(34).fork()).join();
349
+ }
350
+ return writer;
351
+ },
352
+ decode(input, length) {
353
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
354
+ let end = length === void 0 ? reader.len : reader.pos + length;
355
+ const message = createBaseTouchAction();
356
+ while (reader.pos < end) {
357
+ const tag = reader.uint32();
358
+ switch (tag >>> 3) {
359
+ case 1: {
360
+ if (tag !== 10) {
361
+ break;
362
+ }
363
+ message.down = TouchDown.decode(reader, reader.uint32());
364
+ continue;
365
+ }
366
+ case 2: {
367
+ if (tag !== 18) {
368
+ break;
369
+ }
370
+ message.move = TouchMove.decode(reader, reader.uint32());
371
+ continue;
372
+ }
373
+ case 3: {
374
+ if (tag !== 26) {
375
+ break;
376
+ }
377
+ message.wait = TouchWait.decode(reader, reader.uint32());
378
+ continue;
379
+ }
380
+ case 4: {
381
+ if (tag !== 34) {
382
+ break;
383
+ }
384
+ message.up = TouchUp.decode(reader, reader.uint32());
385
+ continue;
386
+ }
387
+ }
388
+ if ((tag & 7) === 4 || tag === 0) {
389
+ break;
390
+ }
391
+ reader.skip(tag & 7);
392
+ }
393
+ return message;
394
+ },
395
+ fromJSON(object) {
396
+ return {
397
+ down: isSet(object.down) ? TouchDown.fromJSON(object.down) : void 0,
398
+ move: isSet(object.move) ? TouchMove.fromJSON(object.move) : void 0,
399
+ wait: isSet(object.wait) ? TouchWait.fromJSON(object.wait) : void 0,
400
+ up: isSet(object.up) ? TouchUp.fromJSON(object.up) : void 0
401
+ };
402
+ },
403
+ toJSON(message) {
404
+ const obj = {};
405
+ if (message.down !== void 0) {
406
+ obj.down = TouchDown.toJSON(message.down);
407
+ }
408
+ if (message.move !== void 0) {
409
+ obj.move = TouchMove.toJSON(message.move);
410
+ }
411
+ if (message.wait !== void 0) {
412
+ obj.wait = TouchWait.toJSON(message.wait);
413
+ }
414
+ if (message.up !== void 0) {
415
+ obj.up = TouchUp.toJSON(message.up);
416
+ }
417
+ return obj;
418
+ },
419
+ create(base) {
420
+ return TouchAction.fromPartial(base ?? {});
421
+ },
422
+ fromPartial(object) {
423
+ const message = createBaseTouchAction();
424
+ message.down = object.down !== void 0 && object.down !== null ? TouchDown.fromPartial(object.down) : void 0;
425
+ message.move = object.move !== void 0 && object.move !== null ? TouchMove.fromPartial(object.move) : void 0;
426
+ message.wait = object.wait !== void 0 && object.wait !== null ? TouchWait.fromPartial(object.wait) : void 0;
427
+ message.up = object.up !== void 0 && object.up !== null ? TouchUp.fromPartial(object.up) : void 0;
428
+ return message;
429
+ }
430
+ };
431
+ function createBaseTouchSequence() {
432
+ return { sequence: [] };
433
+ }
434
+ var TouchSequence = {
435
+ encode(message, writer = new BinaryWriter()) {
436
+ for (const v of message.sequence) {
437
+ TouchAction.encode(v, writer.uint32(10).fork()).join();
438
+ }
439
+ return writer;
440
+ },
441
+ decode(input, length) {
442
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
443
+ let end = length === void 0 ? reader.len : reader.pos + length;
444
+ const message = createBaseTouchSequence();
445
+ while (reader.pos < end) {
446
+ const tag = reader.uint32();
447
+ switch (tag >>> 3) {
448
+ case 1: {
449
+ if (tag !== 10) {
450
+ break;
451
+ }
452
+ message.sequence.push(TouchAction.decode(reader, reader.uint32()));
453
+ continue;
454
+ }
455
+ }
456
+ if ((tag & 7) === 4 || tag === 0) {
457
+ break;
458
+ }
459
+ reader.skip(tag & 7);
460
+ }
461
+ return message;
462
+ },
463
+ fromJSON(object) {
464
+ return {
465
+ sequence: globalThis.Array.isArray(object?.sequence) ? object.sequence.map((e) => TouchAction.fromJSON(e)) : []
466
+ };
467
+ },
468
+ toJSON(message) {
469
+ const obj = {};
470
+ if (message.sequence?.length) {
471
+ obj.sequence = message.sequence.map((e) => TouchAction.toJSON(e));
472
+ }
473
+ return obj;
474
+ },
475
+ create(base) {
476
+ return TouchSequence.fromPartial(base ?? {});
477
+ },
478
+ fromPartial(object) {
479
+ const message = createBaseTouchSequence();
480
+ message.sequence = object.sequence?.map((e) => TouchAction.fromPartial(e)) || [];
481
+ return message;
482
+ }
483
+ };
484
+ function createBasePerformTouchRequest() {
485
+ return { sequence: void 0, wait: false };
486
+ }
487
+ var PerformTouchRequest = {
488
+ encode(message, writer = new BinaryWriter()) {
489
+ if (message.sequence !== void 0) {
490
+ TouchSequence.encode(message.sequence, writer.uint32(10).fork()).join();
491
+ }
492
+ if (message.wait !== false) {
493
+ writer.uint32(16).bool(message.wait);
494
+ }
495
+ return writer;
496
+ },
497
+ decode(input, length) {
498
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
499
+ let end = length === void 0 ? reader.len : reader.pos + length;
500
+ const message = createBasePerformTouchRequest();
501
+ while (reader.pos < end) {
502
+ const tag = reader.uint32();
503
+ switch (tag >>> 3) {
504
+ case 1: {
505
+ if (tag !== 10) {
506
+ break;
507
+ }
508
+ message.sequence = TouchSequence.decode(reader, reader.uint32());
509
+ continue;
510
+ }
511
+ case 2: {
512
+ if (tag !== 16) {
513
+ break;
514
+ }
515
+ message.wait = reader.bool();
516
+ continue;
517
+ }
518
+ }
519
+ if ((tag & 7) === 4 || tag === 0) {
520
+ break;
521
+ }
522
+ reader.skip(tag & 7);
523
+ }
524
+ return message;
525
+ },
526
+ fromJSON(object) {
527
+ return {
528
+ sequence: isSet(object.sequence) ? TouchSequence.fromJSON(object.sequence) : void 0,
529
+ wait: isSet(object.wait) ? globalThis.Boolean(object.wait) : false
530
+ };
531
+ },
532
+ toJSON(message) {
533
+ const obj = {};
534
+ if (message.sequence !== void 0) {
535
+ obj.sequence = TouchSequence.toJSON(message.sequence);
536
+ }
537
+ if (message.wait !== false) {
538
+ obj.wait = message.wait;
539
+ }
540
+ return obj;
541
+ },
542
+ create(base) {
543
+ return PerformTouchRequest.fromPartial(base ?? {});
544
+ },
545
+ fromPartial(object) {
546
+ const message = createBasePerformTouchRequest();
547
+ message.sequence = object.sequence !== void 0 && object.sequence !== null ? TouchSequence.fromPartial(object.sequence) : void 0;
548
+ message.wait = object.wait ?? false;
549
+ return message;
550
+ }
551
+ };
552
+ function createBaseSetPropRequest() {
553
+ return { name: "", value: "" };
554
+ }
555
+ var SetPropRequest = {
556
+ encode(message, writer = new BinaryWriter()) {
557
+ if (message.name !== "") {
558
+ writer.uint32(10).string(message.name);
559
+ }
560
+ if (message.value !== "") {
561
+ writer.uint32(18).string(message.value);
562
+ }
563
+ return writer;
564
+ },
565
+ decode(input, length) {
566
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
567
+ let end = length === void 0 ? reader.len : reader.pos + length;
568
+ const message = createBaseSetPropRequest();
569
+ while (reader.pos < end) {
570
+ const tag = reader.uint32();
571
+ switch (tag >>> 3) {
572
+ case 1: {
573
+ if (tag !== 10) {
574
+ break;
575
+ }
576
+ message.name = reader.string();
577
+ continue;
578
+ }
579
+ case 2: {
580
+ if (tag !== 18) {
581
+ break;
582
+ }
583
+ message.value = reader.string();
584
+ continue;
585
+ }
586
+ }
587
+ if ((tag & 7) === 4 || tag === 0) {
588
+ break;
589
+ }
590
+ reader.skip(tag & 7);
591
+ }
592
+ return message;
593
+ },
594
+ fromJSON(object) {
595
+ return {
596
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
597
+ value: isSet(object.value) ? globalThis.String(object.value) : ""
598
+ };
599
+ },
600
+ toJSON(message) {
601
+ const obj = {};
602
+ if (message.name !== "") {
603
+ obj.name = message.name;
604
+ }
605
+ if (message.value !== "") {
606
+ obj.value = message.value;
607
+ }
608
+ return obj;
609
+ },
610
+ create(base) {
611
+ return SetPropRequest.fromPartial(base ?? {});
612
+ },
613
+ fromPartial(object) {
614
+ const message = createBaseSetPropRequest();
615
+ message.name = object.name ?? "";
616
+ message.value = object.value ?? "";
617
+ return message;
618
+ }
619
+ };
620
+ function createBaseCertifiRequest() {
621
+ return { cert: new Uint8Array(0) };
622
+ }
623
+ var CertifiRequest = {
624
+ encode(message, writer = new BinaryWriter()) {
625
+ if (message.cert.length !== 0) {
626
+ writer.uint32(10).bytes(message.cert);
627
+ }
628
+ return writer;
629
+ },
630
+ decode(input, length) {
631
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
632
+ let end = length === void 0 ? reader.len : reader.pos + length;
633
+ const message = createBaseCertifiRequest();
634
+ while (reader.pos < end) {
635
+ const tag = reader.uint32();
636
+ switch (tag >>> 3) {
637
+ case 1: {
638
+ if (tag !== 10) {
639
+ break;
640
+ }
641
+ message.cert = reader.bytes();
642
+ continue;
643
+ }
644
+ }
645
+ if ((tag & 7) === 4 || tag === 0) {
646
+ break;
647
+ }
648
+ reader.skip(tag & 7);
649
+ }
650
+ return message;
651
+ },
652
+ fromJSON(object) {
653
+ return { cert: isSet(object.cert) ? bytesFromBase64(object.cert) : new Uint8Array(0) };
654
+ },
655
+ toJSON(message) {
656
+ const obj = {};
657
+ if (message.cert.length !== 0) {
658
+ obj.cert = base64FromBytes(message.cert);
659
+ }
660
+ return obj;
661
+ },
662
+ create(base) {
663
+ return CertifiRequest.fromPartial(base ?? {});
664
+ },
665
+ fromPartial(object) {
666
+ const message = createBaseCertifiRequest();
667
+ message.cert = object.cert ?? new Uint8Array(0);
668
+ return message;
669
+ }
670
+ };
671
+ function createBaseShowToastRequest() {
672
+ return { text: "", duration: 0 };
673
+ }
674
+ var ShowToastRequest = {
675
+ encode(message, writer = new BinaryWriter()) {
676
+ if (message.text !== "") {
677
+ writer.uint32(10).string(message.text);
678
+ }
679
+ if (message.duration !== 0) {
680
+ writer.uint32(16).int32(message.duration);
681
+ }
682
+ return writer;
683
+ },
684
+ decode(input, length) {
685
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
686
+ let end = length === void 0 ? reader.len : reader.pos + length;
687
+ const message = createBaseShowToastRequest();
688
+ while (reader.pos < end) {
689
+ const tag = reader.uint32();
690
+ switch (tag >>> 3) {
691
+ case 1: {
692
+ if (tag !== 10) {
693
+ break;
694
+ }
695
+ message.text = reader.string();
696
+ continue;
697
+ }
698
+ case 2: {
699
+ if (tag !== 16) {
700
+ break;
701
+ }
702
+ message.duration = reader.int32();
703
+ continue;
704
+ }
705
+ }
706
+ if ((tag & 7) === 4 || tag === 0) {
707
+ break;
708
+ }
709
+ reader.skip(tag & 7);
710
+ }
711
+ return message;
712
+ },
713
+ fromJSON(object) {
714
+ return {
715
+ text: isSet(object.text) ? globalThis.String(object.text) : "",
716
+ duration: isSet(object.duration) ? toastDurationFromJSON(object.duration) : 0
717
+ };
718
+ },
719
+ toJSON(message) {
720
+ const obj = {};
721
+ if (message.text !== "") {
722
+ obj.text = message.text;
723
+ }
724
+ if (message.duration !== 0) {
725
+ obj.duration = toastDurationToJSON(message.duration);
726
+ }
727
+ return obj;
728
+ },
729
+ create(base) {
730
+ return ShowToastRequest.fromPartial(base ?? {});
731
+ },
732
+ fromPartial(object) {
733
+ const message = createBaseShowToastRequest();
734
+ message.text = object.text ?? "";
735
+ message.duration = object.duration ?? 0;
736
+ return message;
737
+ }
738
+ };
739
+ function createBaseServerInfoResponse() {
740
+ return { uniqueId: "", version: "", architecture: "", uptime: 0, secure: false };
741
+ }
742
+ var ServerInfoResponse = {
743
+ encode(message, writer = new BinaryWriter()) {
744
+ if (message.uniqueId !== "") {
745
+ writer.uint32(10).string(message.uniqueId);
746
+ }
747
+ if (message.version !== "") {
748
+ writer.uint32(18).string(message.version);
749
+ }
750
+ if (message.architecture !== "") {
751
+ writer.uint32(26).string(message.architecture);
752
+ }
753
+ if (message.uptime !== 0) {
754
+ writer.uint32(32).uint64(message.uptime);
755
+ }
756
+ if (message.secure !== false) {
757
+ writer.uint32(40).bool(message.secure);
758
+ }
759
+ return writer;
760
+ },
761
+ decode(input, length) {
762
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
763
+ let end = length === void 0 ? reader.len : reader.pos + length;
764
+ const message = createBaseServerInfoResponse();
765
+ while (reader.pos < end) {
766
+ const tag = reader.uint32();
767
+ switch (tag >>> 3) {
768
+ case 1: {
769
+ if (tag !== 10) {
770
+ break;
771
+ }
772
+ message.uniqueId = reader.string();
773
+ continue;
774
+ }
775
+ case 2: {
776
+ if (tag !== 18) {
777
+ break;
778
+ }
779
+ message.version = reader.string();
780
+ continue;
781
+ }
782
+ case 3: {
783
+ if (tag !== 26) {
784
+ break;
785
+ }
786
+ message.architecture = reader.string();
787
+ continue;
788
+ }
789
+ case 4: {
790
+ if (tag !== 32) {
791
+ break;
792
+ }
793
+ message.uptime = longToNumber(reader.uint64());
794
+ continue;
795
+ }
796
+ case 5: {
797
+ if (tag !== 40) {
798
+ break;
799
+ }
800
+ message.secure = reader.bool();
801
+ continue;
802
+ }
803
+ }
804
+ if ((tag & 7) === 4 || tag === 0) {
805
+ break;
806
+ }
807
+ reader.skip(tag & 7);
808
+ }
809
+ return message;
810
+ },
811
+ fromJSON(object) {
812
+ return {
813
+ uniqueId: isSet(object.uniqueId) ? globalThis.String(object.uniqueId) : "",
814
+ version: isSet(object.version) ? globalThis.String(object.version) : "",
815
+ architecture: isSet(object.architecture) ? globalThis.String(object.architecture) : "",
816
+ uptime: isSet(object.uptime) ? globalThis.Number(object.uptime) : 0,
817
+ secure: isSet(object.secure) ? globalThis.Boolean(object.secure) : false
818
+ };
819
+ },
820
+ toJSON(message) {
821
+ const obj = {};
822
+ if (message.uniqueId !== "") {
823
+ obj.uniqueId = message.uniqueId;
824
+ }
825
+ if (message.version !== "") {
826
+ obj.version = message.version;
827
+ }
828
+ if (message.architecture !== "") {
829
+ obj.architecture = message.architecture;
830
+ }
831
+ if (message.uptime !== 0) {
832
+ obj.uptime = Math.round(message.uptime);
833
+ }
834
+ if (message.secure !== false) {
835
+ obj.secure = message.secure;
836
+ }
837
+ return obj;
838
+ },
839
+ create(base) {
840
+ return ServerInfoResponse.fromPartial(base ?? {});
841
+ },
842
+ fromPartial(object) {
843
+ const message = createBaseServerInfoResponse();
844
+ message.uniqueId = object.uniqueId ?? "";
845
+ message.version = object.version ?? "";
846
+ message.architecture = object.architecture ?? "";
847
+ message.uptime = object.uptime ?? 0;
848
+ message.secure = object.secure ?? false;
849
+ return message;
850
+ }
851
+ };
852
+ function createBaseHexPatchRequest() {
853
+ return { pattern: "", replacement: "", path: "", maxreplace: 0, dryrun: false };
854
+ }
855
+ var HexPatchRequest = {
856
+ encode(message, writer = new BinaryWriter()) {
857
+ if (message.pattern !== "") {
858
+ writer.uint32(10).string(message.pattern);
859
+ }
860
+ if (message.replacement !== "") {
861
+ writer.uint32(18).string(message.replacement);
862
+ }
863
+ if (message.path !== "") {
864
+ writer.uint32(26).string(message.path);
865
+ }
866
+ if (message.maxreplace !== 0) {
867
+ writer.uint32(32).int32(message.maxreplace);
868
+ }
869
+ if (message.dryrun !== false) {
870
+ writer.uint32(40).bool(message.dryrun);
871
+ }
872
+ return writer;
873
+ },
874
+ decode(input, length) {
875
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
876
+ let end = length === void 0 ? reader.len : reader.pos + length;
877
+ const message = createBaseHexPatchRequest();
878
+ while (reader.pos < end) {
879
+ const tag = reader.uint32();
880
+ switch (tag >>> 3) {
881
+ case 1: {
882
+ if (tag !== 10) {
883
+ break;
884
+ }
885
+ message.pattern = reader.string();
886
+ continue;
887
+ }
888
+ case 2: {
889
+ if (tag !== 18) {
890
+ break;
891
+ }
892
+ message.replacement = reader.string();
893
+ continue;
894
+ }
895
+ case 3: {
896
+ if (tag !== 26) {
897
+ break;
898
+ }
899
+ message.path = reader.string();
900
+ continue;
901
+ }
902
+ case 4: {
903
+ if (tag !== 32) {
904
+ break;
905
+ }
906
+ message.maxreplace = reader.int32();
907
+ continue;
908
+ }
909
+ case 5: {
910
+ if (tag !== 40) {
911
+ break;
912
+ }
913
+ message.dryrun = reader.bool();
914
+ continue;
915
+ }
916
+ }
917
+ if ((tag & 7) === 4 || tag === 0) {
918
+ break;
919
+ }
920
+ reader.skip(tag & 7);
921
+ }
922
+ return message;
923
+ },
924
+ fromJSON(object) {
925
+ return {
926
+ pattern: isSet(object.pattern) ? globalThis.String(object.pattern) : "",
927
+ replacement: isSet(object.replacement) ? globalThis.String(object.replacement) : "",
928
+ path: isSet(object.path) ? globalThis.String(object.path) : "",
929
+ maxreplace: isSet(object.maxreplace) ? globalThis.Number(object.maxreplace) : 0,
930
+ dryrun: isSet(object.dryrun) ? globalThis.Boolean(object.dryrun) : false
931
+ };
932
+ },
933
+ toJSON(message) {
934
+ const obj = {};
935
+ if (message.pattern !== "") {
936
+ obj.pattern = message.pattern;
937
+ }
938
+ if (message.replacement !== "") {
939
+ obj.replacement = message.replacement;
940
+ }
941
+ if (message.path !== "") {
942
+ obj.path = message.path;
943
+ }
944
+ if (message.maxreplace !== 0) {
945
+ obj.maxreplace = Math.round(message.maxreplace);
946
+ }
947
+ if (message.dryrun !== false) {
948
+ obj.dryrun = message.dryrun;
949
+ }
950
+ return obj;
951
+ },
952
+ create(base) {
953
+ return HexPatchRequest.fromPartial(base ?? {});
954
+ },
955
+ fromPartial(object) {
956
+ const message = createBaseHexPatchRequest();
957
+ message.pattern = object.pattern ?? "";
958
+ message.replacement = object.replacement ?? "";
959
+ message.path = object.path ?? "";
960
+ message.maxreplace = object.maxreplace ?? 0;
961
+ message.dryrun = object.dryrun ?? false;
962
+ return message;
963
+ }
964
+ };
965
+ function createBaseHexPatchItem() {
966
+ return { path: "", index: 0, offset: 0 };
967
+ }
968
+ var HexPatchItem = {
969
+ encode(message, writer = new BinaryWriter()) {
970
+ if (message.path !== "") {
971
+ writer.uint32(10).string(message.path);
972
+ }
973
+ if (message.index !== 0) {
974
+ writer.uint32(16).int32(message.index);
975
+ }
976
+ if (message.offset !== 0) {
977
+ writer.uint32(24).uint64(message.offset);
978
+ }
979
+ return writer;
980
+ },
981
+ decode(input, length) {
982
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
983
+ let end = length === void 0 ? reader.len : reader.pos + length;
984
+ const message = createBaseHexPatchItem();
985
+ while (reader.pos < end) {
986
+ const tag = reader.uint32();
987
+ switch (tag >>> 3) {
988
+ case 1: {
989
+ if (tag !== 10) {
990
+ break;
991
+ }
992
+ message.path = reader.string();
993
+ continue;
994
+ }
995
+ case 2: {
996
+ if (tag !== 16) {
997
+ break;
998
+ }
999
+ message.index = reader.int32();
1000
+ continue;
1001
+ }
1002
+ case 3: {
1003
+ if (tag !== 24) {
1004
+ break;
1005
+ }
1006
+ message.offset = longToNumber(reader.uint64());
1007
+ continue;
1008
+ }
1009
+ }
1010
+ if ((tag & 7) === 4 || tag === 0) {
1011
+ break;
1012
+ }
1013
+ reader.skip(tag & 7);
1014
+ }
1015
+ return message;
1016
+ },
1017
+ fromJSON(object) {
1018
+ return {
1019
+ path: isSet(object.path) ? globalThis.String(object.path) : "",
1020
+ index: isSet(object.index) ? globalThis.Number(object.index) : 0,
1021
+ offset: isSet(object.offset) ? globalThis.Number(object.offset) : 0
1022
+ };
1023
+ },
1024
+ toJSON(message) {
1025
+ const obj = {};
1026
+ if (message.path !== "") {
1027
+ obj.path = message.path;
1028
+ }
1029
+ if (message.index !== 0) {
1030
+ obj.index = Math.round(message.index);
1031
+ }
1032
+ if (message.offset !== 0) {
1033
+ obj.offset = Math.round(message.offset);
1034
+ }
1035
+ return obj;
1036
+ },
1037
+ create(base) {
1038
+ return HexPatchItem.fromPartial(base ?? {});
1039
+ },
1040
+ fromPartial(object) {
1041
+ const message = createBaseHexPatchItem();
1042
+ message.path = object.path ?? "";
1043
+ message.index = object.index ?? 0;
1044
+ message.offset = object.offset ?? 0;
1045
+ return message;
1046
+ }
1047
+ };
1048
+ function createBaseHexPatchResponse() {
1049
+ return { count: 0, replaces: [] };
1050
+ }
1051
+ var HexPatchResponse = {
1052
+ encode(message, writer = new BinaryWriter()) {
1053
+ if (message.count !== 0) {
1054
+ writer.uint32(8).int32(message.count);
1055
+ }
1056
+ for (const v of message.replaces) {
1057
+ HexPatchItem.encode(v, writer.uint32(18).fork()).join();
1058
+ }
1059
+ return writer;
1060
+ },
1061
+ decode(input, length) {
1062
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1063
+ let end = length === void 0 ? reader.len : reader.pos + length;
1064
+ const message = createBaseHexPatchResponse();
1065
+ while (reader.pos < end) {
1066
+ const tag = reader.uint32();
1067
+ switch (tag >>> 3) {
1068
+ case 1: {
1069
+ if (tag !== 8) {
1070
+ break;
1071
+ }
1072
+ message.count = reader.int32();
1073
+ continue;
1074
+ }
1075
+ case 2: {
1076
+ if (tag !== 18) {
1077
+ break;
1078
+ }
1079
+ message.replaces.push(HexPatchItem.decode(reader, reader.uint32()));
1080
+ continue;
1081
+ }
1082
+ }
1083
+ if ((tag & 7) === 4 || tag === 0) {
1084
+ break;
1085
+ }
1086
+ reader.skip(tag & 7);
1087
+ }
1088
+ return message;
1089
+ },
1090
+ fromJSON(object) {
1091
+ return {
1092
+ count: isSet(object.count) ? globalThis.Number(object.count) : 0,
1093
+ replaces: globalThis.Array.isArray(object?.replaces) ? object.replaces.map((e) => HexPatchItem.fromJSON(e)) : []
1094
+ };
1095
+ },
1096
+ toJSON(message) {
1097
+ const obj = {};
1098
+ if (message.count !== 0) {
1099
+ obj.count = Math.round(message.count);
1100
+ }
1101
+ if (message.replaces?.length) {
1102
+ obj.replaces = message.replaces.map((e) => HexPatchItem.toJSON(e));
1103
+ }
1104
+ return obj;
1105
+ },
1106
+ create(base) {
1107
+ return HexPatchResponse.fromPartial(base ?? {});
1108
+ },
1109
+ fromPartial(object) {
1110
+ const message = createBaseHexPatchResponse();
1111
+ message.count = object.count ?? 0;
1112
+ message.replaces = object.replaces?.map((e) => HexPatchItem.fromPartial(e)) || [];
1113
+ return message;
1114
+ }
1115
+ };
1116
+ function bytesFromBase64(b64) {
1117
+ if (globalThis.Buffer) {
1118
+ return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
1119
+ } else {
1120
+ const bin = globalThis.atob(b64);
1121
+ const arr = new Uint8Array(bin.length);
1122
+ for (let i = 0; i < bin.length; ++i) {
1123
+ arr[i] = bin.charCodeAt(i);
1124
+ }
1125
+ return arr;
1126
+ }
1127
+ }
1128
+ function base64FromBytes(arr) {
1129
+ if (globalThis.Buffer) {
1130
+ return globalThis.Buffer.from(arr).toString("base64");
1131
+ } else {
1132
+ const bin = [];
1133
+ arr.forEach((byte) => {
1134
+ bin.push(globalThis.String.fromCharCode(byte));
1135
+ });
1136
+ return globalThis.btoa(bin.join(""));
1137
+ }
1138
+ }
1139
+ function longToNumber(int64) {
1140
+ const num = globalThis.Number(int64.toString());
1141
+ if (num > globalThis.Number.MAX_SAFE_INTEGER) {
1142
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
1143
+ }
1144
+ if (num < globalThis.Number.MIN_SAFE_INTEGER) {
1145
+ throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
1146
+ }
1147
+ return num;
1148
+ }
1149
+ function isSet(value) {
1150
+ return value !== null && value !== void 0;
1151
+ }
1152
+
1153
+ export {
1154
+ protobufPackage,
1155
+ ToastDuration,
1156
+ toastDurationFromJSON,
1157
+ toastDurationToJSON,
1158
+ TouchDown,
1159
+ TouchUp,
1160
+ TouchMove,
1161
+ TouchWait,
1162
+ TouchAction,
1163
+ TouchSequence,
1164
+ PerformTouchRequest,
1165
+ SetPropRequest,
1166
+ CertifiRequest,
1167
+ ShowToastRequest,
1168
+ ServerInfoResponse,
1169
+ HexPatchRequest,
1170
+ HexPatchItem,
1171
+ HexPatchResponse
1172
+ };