@ekhein/lamda-node-sdk 1.0.1 → 1.0.2

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 (109) hide show
  1. package/dist/chunk-3HDKHFYE.js +1602 -0
  2. package/dist/chunk-3JBDAA2H.js +439 -0
  3. package/dist/chunk-4AHM55IO.js +1172 -0
  4. package/dist/chunk-6HD35RPW.js +5370 -0
  5. package/dist/chunk-7XF22HAW.js +907 -0
  6. package/dist/chunk-7YGA6EOV.js +109 -0
  7. package/dist/chunk-ADS4GRIL.js +14 -0
  8. package/dist/chunk-FSLE4VGI.js +48 -0
  9. package/dist/chunk-H7Z6XFBF.js +134 -0
  10. package/dist/chunk-KJKSI2WL.js +62 -0
  11. package/dist/chunk-O52JGDU7.js +800 -0
  12. package/dist/chunk-ORXTTWPB.js +379 -0
  13. package/dist/chunk-OZJH6SR7.js +20 -0
  14. package/dist/chunk-P53F45YO.js +64 -0
  15. package/dist/chunk-QXMPY6EE.js +289 -0
  16. package/dist/chunk-SBFKX3ZY.js +1554 -0
  17. package/dist/chunk-WFQEBPE6.js +300 -0
  18. package/dist/chunk-X4LTH2UN.js +983 -0
  19. package/dist/chunk-XAX5BZL3.js +132 -0
  20. package/dist/chunk-ZXF5DGTC.js +45 -0
  21. package/dist/constants/activity.flag.cjs +92 -0
  22. package/dist/constants/activity.flag.d.cts +24 -0
  23. package/dist/constants/activity.flag.d.ts +24 -0
  24. package/dist/constants/activity.flag.js +49 -0
  25. package/dist/constants/android.permission.cjs +116 -0
  26. package/dist/constants/android.permission.d.cts +32 -0
  27. package/dist/constants/android.permission.d.ts +32 -0
  28. package/dist/constants/android.permission.js +65 -0
  29. package/dist/constants/index.cjs +186 -0
  30. package/dist/constants/index.d.cts +2 -0
  31. package/dist/constants/index.d.ts +2 -0
  32. package/dist/constants/index.js +111 -0
  33. package/dist/decorators/inject.decorator.cjs +43 -0
  34. package/dist/decorators/inject.decorator.d.cts +5 -0
  35. package/dist/decorators/inject.decorator.d.ts +5 -0
  36. package/dist/decorators/inject.decorator.js +7 -0
  37. package/dist/main.cjs +1 -2
  38. package/dist/main.d.cts +17 -1152
  39. package/dist/main.d.ts +17 -1152
  40. package/dist/main.js +36 -11873
  41. package/dist/rpc/application.cjs +2019 -0
  42. package/dist/rpc/application.d.cts +138 -0
  43. package/dist/rpc/application.d.ts +138 -0
  44. package/dist/rpc/application.js +50 -0
  45. package/dist/rpc/debug.cjs +86 -0
  46. package/dist/rpc/debug.d.cts +21 -0
  47. package/dist/rpc/debug.d.ts +21 -0
  48. package/dist/rpc/debug.js +9 -0
  49. package/dist/rpc/file.cjs +405 -0
  50. package/dist/rpc/file.d.cts +40 -0
  51. package/dist/rpc/file.d.ts +40 -0
  52. package/dist/rpc/file.js +13 -0
  53. package/dist/rpc/google/protobuf/any.cjs +126 -0
  54. package/dist/rpc/google/protobuf/any.d.cts +22 -0
  55. package/dist/rpc/google/protobuf/any.d.ts +22 -0
  56. package/dist/rpc/google/protobuf/any.js +103 -0
  57. package/dist/rpc/google/protobuf/empty.cjs +69 -0
  58. package/dist/rpc/google/protobuf/empty.d.cts +20 -0
  59. package/dist/rpc/google/protobuf/empty.d.ts +20 -0
  60. package/dist/rpc/google/protobuf/empty.js +9 -0
  61. package/dist/rpc/google/protobuf/struct.cjs +469 -0
  62. package/dist/rpc/google/protobuf/struct.d.cts +65 -0
  63. package/dist/rpc/google/protobuf/struct.d.ts +65 -0
  64. package/dist/rpc/google/protobuf/struct.js +21 -0
  65. package/dist/rpc/policy.cjs +133 -0
  66. package/dist/rpc/policy.d.cts +24 -0
  67. package/dist/rpc/policy.d.ts +24 -0
  68. package/dist/rpc/policy.js +9 -0
  69. package/dist/rpc/proxy.cjs +1109 -0
  70. package/dist/rpc/proxy.d.cts +108 -0
  71. package/dist/rpc/proxy.d.ts +108 -0
  72. package/dist/rpc/proxy.js +49 -0
  73. package/dist/rpc/services.cjs +11898 -0
  74. package/dist/rpc/services.d.cts +1920 -0
  75. package/dist/rpc/services.d.ts +1920 -0
  76. package/dist/rpc/services.js +48 -0
  77. package/dist/rpc/settings.cjs +161 -0
  78. package/dist/rpc/settings.d.cts +31 -0
  79. package/dist/rpc/settings.d.ts +31 -0
  80. package/dist/rpc/settings.js +15 -0
  81. package/dist/rpc/shell.cjs +326 -0
  82. package/dist/rpc/shell.d.cts +36 -0
  83. package/dist/rpc/shell.d.ts +36 -0
  84. package/dist/rpc/shell.js +13 -0
  85. package/dist/rpc/status.cjs +936 -0
  86. package/dist/rpc/status.d.cts +76 -0
  87. package/dist/rpc/status.d.ts +76 -0
  88. package/dist/rpc/status.js +19 -0
  89. package/dist/rpc/storage.cjs +156 -0
  90. package/dist/rpc/storage.d.cts +24 -0
  91. package/dist/rpc/storage.d.ts +24 -0
  92. package/dist/rpc/storage.js +9 -0
  93. package/dist/rpc/types.cjs +317 -0
  94. package/dist/rpc/types.d.cts +36 -0
  95. package/dist/rpc/types.d.ts +36 -0
  96. package/dist/rpc/types.js +17 -0
  97. package/dist/rpc/uiautomator.cjs +5446 -0
  98. package/dist/rpc/uiautomator.d.cts +618 -0
  99. package/dist/rpc/uiautomator.d.ts +618 -0
  100. package/dist/rpc/uiautomator.js +113 -0
  101. package/dist/rpc/util.cjs +1212 -0
  102. package/dist/rpc/util.d.cts +103 -0
  103. package/dist/rpc/util.d.ts +103 -0
  104. package/dist/rpc/util.js +41 -0
  105. package/dist/rpc/wifi.cjs +1015 -0
  106. package/dist/rpc/wifi.d.cts +84 -0
  107. package/dist/rpc/wifi.d.ts +84 -0
  108. package/dist/rpc/wifi.js +25 -0
  109. package/package.json +3 -4
@@ -0,0 +1,2019 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/rpc/application.ts
20
+ var application_exports = {};
21
+ __export(application_exports, {
22
+ ApplicationActivityInfo: () => ApplicationActivityInfo,
23
+ ApplicationActivityInfoList: () => ApplicationActivityInfoList,
24
+ ApplicationActivityRequest: () => ApplicationActivityRequest,
25
+ ApplicationInfo: () => ApplicationInfo,
26
+ ApplicationPermissions: () => ApplicationPermissions,
27
+ ApplicationPkgNames: () => ApplicationPkgNames,
28
+ ApplicationProcess: () => ApplicationProcess,
29
+ ApplicationProcesses: () => ApplicationProcesses,
30
+ ApplicationRequest: () => ApplicationRequest,
31
+ DataEncode: () => DataEncode,
32
+ GrantType: () => GrantType,
33
+ HookRequest: () => HookRequest,
34
+ HookRpcRequest: () => HookRpcRequest,
35
+ HookRpcResponse: () => HookRpcResponse,
36
+ ScriptRuntime: () => ScriptRuntime,
37
+ dataEncodeFromJSON: () => dataEncodeFromJSON,
38
+ dataEncodeToJSON: () => dataEncodeToJSON,
39
+ grantTypeFromJSON: () => grantTypeFromJSON,
40
+ grantTypeToJSON: () => grantTypeToJSON,
41
+ protobufPackage: () => protobufPackage,
42
+ scriptRuntimeFromJSON: () => scriptRuntimeFromJSON,
43
+ scriptRuntimeToJSON: () => scriptRuntimeToJSON
44
+ });
45
+ module.exports = __toCommonJS(application_exports);
46
+ var import_wire2 = require("@bufbuild/protobuf/wire");
47
+
48
+ // src/rpc/google/protobuf/struct.ts
49
+ var import_wire = require("@bufbuild/protobuf/wire");
50
+ function nullValueFromJSON(object) {
51
+ switch (object) {
52
+ case 0:
53
+ case "NULL_VALUE":
54
+ return 0 /* NULL_VALUE */;
55
+ case -1:
56
+ case "UNRECOGNIZED":
57
+ default:
58
+ return -1 /* UNRECOGNIZED */;
59
+ }
60
+ }
61
+ function nullValueToJSON(object) {
62
+ switch (object) {
63
+ case 0 /* NULL_VALUE */:
64
+ return "NULL_VALUE";
65
+ case -1 /* UNRECOGNIZED */:
66
+ default:
67
+ return "UNRECOGNIZED";
68
+ }
69
+ }
70
+ function createBaseStruct() {
71
+ return { fields: {} };
72
+ }
73
+ var Struct = {
74
+ encode(message, writer = new import_wire.BinaryWriter()) {
75
+ Object.entries(message.fields).forEach(([key, value]) => {
76
+ if (value !== void 0) {
77
+ Struct_FieldsEntry.encode({ key, value }, writer.uint32(10).fork()).join();
78
+ }
79
+ });
80
+ return writer;
81
+ },
82
+ decode(input, length) {
83
+ const reader = input instanceof import_wire.BinaryReader ? input : new import_wire.BinaryReader(input);
84
+ let end = length === void 0 ? reader.len : reader.pos + length;
85
+ const message = createBaseStruct();
86
+ while (reader.pos < end) {
87
+ const tag = reader.uint32();
88
+ switch (tag >>> 3) {
89
+ case 1: {
90
+ if (tag !== 10) {
91
+ break;
92
+ }
93
+ const entry1 = Struct_FieldsEntry.decode(reader, reader.uint32());
94
+ if (entry1.value !== void 0) {
95
+ message.fields[entry1.key] = entry1.value;
96
+ }
97
+ continue;
98
+ }
99
+ }
100
+ if ((tag & 7) === 4 || tag === 0) {
101
+ break;
102
+ }
103
+ reader.skip(tag & 7);
104
+ }
105
+ return message;
106
+ },
107
+ fromJSON(object) {
108
+ return {
109
+ fields: isObject(object.fields) ? Object.entries(object.fields).reduce((acc, [key, value]) => {
110
+ acc[key] = value;
111
+ return acc;
112
+ }, {}) : {}
113
+ };
114
+ },
115
+ toJSON(message) {
116
+ const obj = {};
117
+ if (message.fields) {
118
+ const entries = Object.entries(message.fields);
119
+ if (entries.length > 0) {
120
+ obj.fields = {};
121
+ entries.forEach(([k, v]) => {
122
+ obj.fields[k] = v;
123
+ });
124
+ }
125
+ }
126
+ return obj;
127
+ },
128
+ create(base) {
129
+ return Struct.fromPartial(base ?? {});
130
+ },
131
+ fromPartial(object) {
132
+ const message = createBaseStruct();
133
+ message.fields = Object.entries(object.fields ?? {}).reduce(
134
+ (acc, [key, value]) => {
135
+ if (value !== void 0) {
136
+ acc[key] = value;
137
+ }
138
+ return acc;
139
+ },
140
+ {}
141
+ );
142
+ return message;
143
+ },
144
+ wrap(object) {
145
+ const struct = createBaseStruct();
146
+ if (object !== void 0) {
147
+ for (const key of Object.keys(object)) {
148
+ struct.fields[key] = object[key];
149
+ }
150
+ }
151
+ return struct;
152
+ },
153
+ unwrap(message) {
154
+ const object = {};
155
+ if (message.fields) {
156
+ for (const key of Object.keys(message.fields)) {
157
+ object[key] = message.fields[key];
158
+ }
159
+ }
160
+ return object;
161
+ }
162
+ };
163
+ function createBaseStruct_FieldsEntry() {
164
+ return { key: "", value: void 0 };
165
+ }
166
+ var Struct_FieldsEntry = {
167
+ encode(message, writer = new import_wire.BinaryWriter()) {
168
+ if (message.key !== "") {
169
+ writer.uint32(10).string(message.key);
170
+ }
171
+ if (message.value !== void 0) {
172
+ Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).join();
173
+ }
174
+ return writer;
175
+ },
176
+ decode(input, length) {
177
+ const reader = input instanceof import_wire.BinaryReader ? input : new import_wire.BinaryReader(input);
178
+ let end = length === void 0 ? reader.len : reader.pos + length;
179
+ const message = createBaseStruct_FieldsEntry();
180
+ while (reader.pos < end) {
181
+ const tag = reader.uint32();
182
+ switch (tag >>> 3) {
183
+ case 1: {
184
+ if (tag !== 10) {
185
+ break;
186
+ }
187
+ message.key = reader.string();
188
+ continue;
189
+ }
190
+ case 2: {
191
+ if (tag !== 18) {
192
+ break;
193
+ }
194
+ message.value = Value.unwrap(Value.decode(reader, reader.uint32()));
195
+ continue;
196
+ }
197
+ }
198
+ if ((tag & 7) === 4 || tag === 0) {
199
+ break;
200
+ }
201
+ reader.skip(tag & 7);
202
+ }
203
+ return message;
204
+ },
205
+ fromJSON(object) {
206
+ return {
207
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
208
+ value: isSet(object?.value) ? object.value : void 0
209
+ };
210
+ },
211
+ toJSON(message) {
212
+ const obj = {};
213
+ if (message.key !== "") {
214
+ obj.key = message.key;
215
+ }
216
+ if (message.value !== void 0) {
217
+ obj.value = message.value;
218
+ }
219
+ return obj;
220
+ },
221
+ create(base) {
222
+ return Struct_FieldsEntry.fromPartial(base ?? {});
223
+ },
224
+ fromPartial(object) {
225
+ const message = createBaseStruct_FieldsEntry();
226
+ message.key = object.key ?? "";
227
+ message.value = object.value ?? void 0;
228
+ return message;
229
+ }
230
+ };
231
+ function createBaseValue() {
232
+ return {
233
+ nullValue: void 0,
234
+ numberValue: void 0,
235
+ stringValue: void 0,
236
+ boolValue: void 0,
237
+ structValue: void 0,
238
+ listValue: void 0
239
+ };
240
+ }
241
+ var Value = {
242
+ encode(message, writer = new import_wire.BinaryWriter()) {
243
+ if (message.nullValue !== void 0) {
244
+ writer.uint32(8).int32(message.nullValue);
245
+ }
246
+ if (message.numberValue !== void 0) {
247
+ writer.uint32(17).double(message.numberValue);
248
+ }
249
+ if (message.stringValue !== void 0) {
250
+ writer.uint32(26).string(message.stringValue);
251
+ }
252
+ if (message.boolValue !== void 0) {
253
+ writer.uint32(32).bool(message.boolValue);
254
+ }
255
+ if (message.structValue !== void 0) {
256
+ Struct.encode(Struct.wrap(message.structValue), writer.uint32(42).fork()).join();
257
+ }
258
+ if (message.listValue !== void 0) {
259
+ ListValue.encode(ListValue.wrap(message.listValue), writer.uint32(50).fork()).join();
260
+ }
261
+ return writer;
262
+ },
263
+ decode(input, length) {
264
+ const reader = input instanceof import_wire.BinaryReader ? input : new import_wire.BinaryReader(input);
265
+ let end = length === void 0 ? reader.len : reader.pos + length;
266
+ const message = createBaseValue();
267
+ while (reader.pos < end) {
268
+ const tag = reader.uint32();
269
+ switch (tag >>> 3) {
270
+ case 1: {
271
+ if (tag !== 8) {
272
+ break;
273
+ }
274
+ message.nullValue = reader.int32();
275
+ continue;
276
+ }
277
+ case 2: {
278
+ if (tag !== 17) {
279
+ break;
280
+ }
281
+ message.numberValue = reader.double();
282
+ continue;
283
+ }
284
+ case 3: {
285
+ if (tag !== 26) {
286
+ break;
287
+ }
288
+ message.stringValue = reader.string();
289
+ continue;
290
+ }
291
+ case 4: {
292
+ if (tag !== 32) {
293
+ break;
294
+ }
295
+ message.boolValue = reader.bool();
296
+ continue;
297
+ }
298
+ case 5: {
299
+ if (tag !== 42) {
300
+ break;
301
+ }
302
+ message.structValue = Struct.unwrap(Struct.decode(reader, reader.uint32()));
303
+ continue;
304
+ }
305
+ case 6: {
306
+ if (tag !== 50) {
307
+ break;
308
+ }
309
+ message.listValue = ListValue.unwrap(ListValue.decode(reader, reader.uint32()));
310
+ continue;
311
+ }
312
+ }
313
+ if ((tag & 7) === 4 || tag === 0) {
314
+ break;
315
+ }
316
+ reader.skip(tag & 7);
317
+ }
318
+ return message;
319
+ },
320
+ fromJSON(object) {
321
+ return {
322
+ nullValue: isSet(object.nullValue) ? nullValueFromJSON(object.nullValue) : void 0,
323
+ numberValue: isSet(object.numberValue) ? globalThis.Number(object.numberValue) : void 0,
324
+ stringValue: isSet(object.stringValue) ? globalThis.String(object.stringValue) : void 0,
325
+ boolValue: isSet(object.boolValue) ? globalThis.Boolean(object.boolValue) : void 0,
326
+ structValue: isObject(object.structValue) ? object.structValue : void 0,
327
+ listValue: globalThis.Array.isArray(object.listValue) ? [...object.listValue] : void 0
328
+ };
329
+ },
330
+ toJSON(message) {
331
+ const obj = {};
332
+ if (message.nullValue !== void 0) {
333
+ obj.nullValue = nullValueToJSON(message.nullValue);
334
+ }
335
+ if (message.numberValue !== void 0) {
336
+ obj.numberValue = message.numberValue;
337
+ }
338
+ if (message.stringValue !== void 0) {
339
+ obj.stringValue = message.stringValue;
340
+ }
341
+ if (message.boolValue !== void 0) {
342
+ obj.boolValue = message.boolValue;
343
+ }
344
+ if (message.structValue !== void 0) {
345
+ obj.structValue = message.structValue;
346
+ }
347
+ if (message.listValue !== void 0) {
348
+ obj.listValue = message.listValue;
349
+ }
350
+ return obj;
351
+ },
352
+ create(base) {
353
+ return Value.fromPartial(base ?? {});
354
+ },
355
+ fromPartial(object) {
356
+ const message = createBaseValue();
357
+ message.nullValue = object.nullValue ?? void 0;
358
+ message.numberValue = object.numberValue ?? void 0;
359
+ message.stringValue = object.stringValue ?? void 0;
360
+ message.boolValue = object.boolValue ?? void 0;
361
+ message.structValue = object.structValue ?? void 0;
362
+ message.listValue = object.listValue ?? void 0;
363
+ return message;
364
+ },
365
+ wrap(value) {
366
+ const result = createBaseValue();
367
+ if (value === null) {
368
+ result.nullValue = 0 /* NULL_VALUE */;
369
+ } else if (typeof value === "boolean") {
370
+ result.boolValue = value;
371
+ } else if (typeof value === "number") {
372
+ result.numberValue = value;
373
+ } else if (typeof value === "string") {
374
+ result.stringValue = value;
375
+ } else if (globalThis.Array.isArray(value)) {
376
+ result.listValue = value;
377
+ } else if (typeof value === "object") {
378
+ result.structValue = value;
379
+ } else if (typeof value !== "undefined") {
380
+ throw new globalThis.Error("Unsupported any value type: " + typeof value);
381
+ }
382
+ return result;
383
+ },
384
+ unwrap(message) {
385
+ if (message.stringValue !== void 0) {
386
+ return message.stringValue;
387
+ } else if (message?.numberValue !== void 0) {
388
+ return message.numberValue;
389
+ } else if (message?.boolValue !== void 0) {
390
+ return message.boolValue;
391
+ } else if (message?.structValue !== void 0) {
392
+ return message.structValue;
393
+ } else if (message?.listValue !== void 0) {
394
+ return message.listValue;
395
+ } else if (message?.nullValue !== void 0) {
396
+ return null;
397
+ }
398
+ return void 0;
399
+ }
400
+ };
401
+ function createBaseListValue() {
402
+ return { values: [] };
403
+ }
404
+ var ListValue = {
405
+ encode(message, writer = new import_wire.BinaryWriter()) {
406
+ for (const v of message.values) {
407
+ Value.encode(Value.wrap(v), writer.uint32(10).fork()).join();
408
+ }
409
+ return writer;
410
+ },
411
+ decode(input, length) {
412
+ const reader = input instanceof import_wire.BinaryReader ? input : new import_wire.BinaryReader(input);
413
+ let end = length === void 0 ? reader.len : reader.pos + length;
414
+ const message = createBaseListValue();
415
+ while (reader.pos < end) {
416
+ const tag = reader.uint32();
417
+ switch (tag >>> 3) {
418
+ case 1: {
419
+ if (tag !== 10) {
420
+ break;
421
+ }
422
+ message.values.push(Value.unwrap(Value.decode(reader, reader.uint32())));
423
+ continue;
424
+ }
425
+ }
426
+ if ((tag & 7) === 4 || tag === 0) {
427
+ break;
428
+ }
429
+ reader.skip(tag & 7);
430
+ }
431
+ return message;
432
+ },
433
+ fromJSON(object) {
434
+ return { values: globalThis.Array.isArray(object?.values) ? [...object.values] : [] };
435
+ },
436
+ toJSON(message) {
437
+ const obj = {};
438
+ if (message.values?.length) {
439
+ obj.values = message.values;
440
+ }
441
+ return obj;
442
+ },
443
+ create(base) {
444
+ return ListValue.fromPartial(base ?? {});
445
+ },
446
+ fromPartial(object) {
447
+ const message = createBaseListValue();
448
+ message.values = object.values?.map((e) => e) || [];
449
+ return message;
450
+ },
451
+ wrap(array) {
452
+ const result = createBaseListValue();
453
+ result.values = array ?? [];
454
+ return result;
455
+ },
456
+ unwrap(message) {
457
+ if (message?.hasOwnProperty("values") && globalThis.Array.isArray(message.values)) {
458
+ return message.values;
459
+ } else {
460
+ return message;
461
+ }
462
+ }
463
+ };
464
+ function isObject(value) {
465
+ return typeof value === "object" && value !== null;
466
+ }
467
+ function isSet(value) {
468
+ return value !== null && value !== void 0;
469
+ }
470
+
471
+ // src/rpc/application.ts
472
+ var protobufPackage = "lamda.rpc";
473
+ var GrantType = /* @__PURE__ */ ((GrantType2) => {
474
+ GrantType2[GrantType2["GRANT_ALLOW"] = 0] = "GRANT_ALLOW";
475
+ GrantType2[GrantType2["GRANT_DENY"] = 1] = "GRANT_DENY";
476
+ GrantType2[GrantType2["GRANT_IGNORE"] = 2] = "GRANT_IGNORE";
477
+ GrantType2[GrantType2["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
478
+ return GrantType2;
479
+ })(GrantType || {});
480
+ function grantTypeFromJSON(object) {
481
+ switch (object) {
482
+ case 0:
483
+ case "GRANT_ALLOW":
484
+ return 0 /* GRANT_ALLOW */;
485
+ case 1:
486
+ case "GRANT_DENY":
487
+ return 1 /* GRANT_DENY */;
488
+ case 2:
489
+ case "GRANT_IGNORE":
490
+ return 2 /* GRANT_IGNORE */;
491
+ case -1:
492
+ case "UNRECOGNIZED":
493
+ default:
494
+ return -1 /* UNRECOGNIZED */;
495
+ }
496
+ }
497
+ function grantTypeToJSON(object) {
498
+ switch (object) {
499
+ case 0 /* GRANT_ALLOW */:
500
+ return "GRANT_ALLOW";
501
+ case 1 /* GRANT_DENY */:
502
+ return "GRANT_DENY";
503
+ case 2 /* GRANT_IGNORE */:
504
+ return "GRANT_IGNORE";
505
+ case -1 /* UNRECOGNIZED */:
506
+ default:
507
+ return "UNRECOGNIZED";
508
+ }
509
+ }
510
+ var DataEncode = /* @__PURE__ */ ((DataEncode2) => {
511
+ DataEncode2[DataEncode2["DATA_ENCODE_NONE"] = 0] = "DATA_ENCODE_NONE";
512
+ DataEncode2[DataEncode2["DATA_ENCODE_ZLIB"] = 1] = "DATA_ENCODE_ZLIB";
513
+ DataEncode2[DataEncode2["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
514
+ return DataEncode2;
515
+ })(DataEncode || {});
516
+ function dataEncodeFromJSON(object) {
517
+ switch (object) {
518
+ case 0:
519
+ case "DATA_ENCODE_NONE":
520
+ return 0 /* DATA_ENCODE_NONE */;
521
+ case 1:
522
+ case "DATA_ENCODE_ZLIB":
523
+ return 1 /* DATA_ENCODE_ZLIB */;
524
+ case -1:
525
+ case "UNRECOGNIZED":
526
+ default:
527
+ return -1 /* UNRECOGNIZED */;
528
+ }
529
+ }
530
+ function dataEncodeToJSON(object) {
531
+ switch (object) {
532
+ case 0 /* DATA_ENCODE_NONE */:
533
+ return "DATA_ENCODE_NONE";
534
+ case 1 /* DATA_ENCODE_ZLIB */:
535
+ return "DATA_ENCODE_ZLIB";
536
+ case -1 /* UNRECOGNIZED */:
537
+ default:
538
+ return "UNRECOGNIZED";
539
+ }
540
+ }
541
+ var ScriptRuntime = /* @__PURE__ */ ((ScriptRuntime2) => {
542
+ ScriptRuntime2[ScriptRuntime2["RUNTIME_QJS"] = 0] = "RUNTIME_QJS";
543
+ ScriptRuntime2[ScriptRuntime2["RUNTIME_V8"] = 1] = "RUNTIME_V8";
544
+ ScriptRuntime2[ScriptRuntime2["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
545
+ return ScriptRuntime2;
546
+ })(ScriptRuntime || {});
547
+ function scriptRuntimeFromJSON(object) {
548
+ switch (object) {
549
+ case 0:
550
+ case "RUNTIME_QJS":
551
+ return 0 /* RUNTIME_QJS */;
552
+ case 1:
553
+ case "RUNTIME_V8":
554
+ return 1 /* RUNTIME_V8 */;
555
+ case -1:
556
+ case "UNRECOGNIZED":
557
+ default:
558
+ return -1 /* UNRECOGNIZED */;
559
+ }
560
+ }
561
+ function scriptRuntimeToJSON(object) {
562
+ switch (object) {
563
+ case 0 /* RUNTIME_QJS */:
564
+ return "RUNTIME_QJS";
565
+ case 1 /* RUNTIME_V8 */:
566
+ return "RUNTIME_V8";
567
+ case -1 /* UNRECOGNIZED */:
568
+ default:
569
+ return "UNRECOGNIZED";
570
+ }
571
+ }
572
+ function createBaseApplicationRequest() {
573
+ return { name: "", permission: "", mode: 0, path: "", user: 0 };
574
+ }
575
+ var ApplicationRequest = {
576
+ encode(message, writer = new import_wire2.BinaryWriter()) {
577
+ if (message.name !== "") {
578
+ writer.uint32(10).string(message.name);
579
+ }
580
+ if (message.permission !== "") {
581
+ writer.uint32(18).string(message.permission);
582
+ }
583
+ if (message.mode !== 0) {
584
+ writer.uint32(24).int32(message.mode);
585
+ }
586
+ if (message.path !== "") {
587
+ writer.uint32(34).string(message.path);
588
+ }
589
+ if (message.user !== 0) {
590
+ writer.uint32(40).uint32(message.user);
591
+ }
592
+ return writer;
593
+ },
594
+ decode(input, length) {
595
+ const reader = input instanceof import_wire2.BinaryReader ? input : new import_wire2.BinaryReader(input);
596
+ let end = length === void 0 ? reader.len : reader.pos + length;
597
+ const message = createBaseApplicationRequest();
598
+ while (reader.pos < end) {
599
+ const tag = reader.uint32();
600
+ switch (tag >>> 3) {
601
+ case 1: {
602
+ if (tag !== 10) {
603
+ break;
604
+ }
605
+ message.name = reader.string();
606
+ continue;
607
+ }
608
+ case 2: {
609
+ if (tag !== 18) {
610
+ break;
611
+ }
612
+ message.permission = reader.string();
613
+ continue;
614
+ }
615
+ case 3: {
616
+ if (tag !== 24) {
617
+ break;
618
+ }
619
+ message.mode = reader.int32();
620
+ continue;
621
+ }
622
+ case 4: {
623
+ if (tag !== 34) {
624
+ break;
625
+ }
626
+ message.path = reader.string();
627
+ continue;
628
+ }
629
+ case 5: {
630
+ if (tag !== 40) {
631
+ break;
632
+ }
633
+ message.user = reader.uint32();
634
+ continue;
635
+ }
636
+ }
637
+ if ((tag & 7) === 4 || tag === 0) {
638
+ break;
639
+ }
640
+ reader.skip(tag & 7);
641
+ }
642
+ return message;
643
+ },
644
+ fromJSON(object) {
645
+ return {
646
+ name: isSet2(object.name) ? globalThis.String(object.name) : "",
647
+ permission: isSet2(object.permission) ? globalThis.String(object.permission) : "",
648
+ mode: isSet2(object.mode) ? grantTypeFromJSON(object.mode) : 0,
649
+ path: isSet2(object.path) ? globalThis.String(object.path) : "",
650
+ user: isSet2(object.user) ? globalThis.Number(object.user) : 0
651
+ };
652
+ },
653
+ toJSON(message) {
654
+ const obj = {};
655
+ if (message.name !== "") {
656
+ obj.name = message.name;
657
+ }
658
+ if (message.permission !== "") {
659
+ obj.permission = message.permission;
660
+ }
661
+ if (message.mode !== 0) {
662
+ obj.mode = grantTypeToJSON(message.mode);
663
+ }
664
+ if (message.path !== "") {
665
+ obj.path = message.path;
666
+ }
667
+ if (message.user !== 0) {
668
+ obj.user = Math.round(message.user);
669
+ }
670
+ return obj;
671
+ },
672
+ create(base) {
673
+ return ApplicationRequest.fromPartial(base ?? {});
674
+ },
675
+ fromPartial(object) {
676
+ const message = createBaseApplicationRequest();
677
+ message.name = object.name ?? "";
678
+ message.permission = object.permission ?? "";
679
+ message.mode = object.mode ?? 0;
680
+ message.path = object.path ?? "";
681
+ message.user = object.user ?? 0;
682
+ return message;
683
+ }
684
+ };
685
+ function createBaseApplicationActivityRequest() {
686
+ return {
687
+ package: "",
688
+ action: "",
689
+ category: "",
690
+ component: "",
691
+ extras: void 0,
692
+ categories: [],
693
+ flags: 0,
694
+ debug: false,
695
+ data: "",
696
+ user: 0
697
+ };
698
+ }
699
+ var ApplicationActivityRequest = {
700
+ encode(message, writer = new import_wire2.BinaryWriter()) {
701
+ if (message.package !== "") {
702
+ writer.uint32(10).string(message.package);
703
+ }
704
+ if (message.action !== "") {
705
+ writer.uint32(18).string(message.action);
706
+ }
707
+ if (message.category !== "") {
708
+ writer.uint32(26).string(message.category);
709
+ }
710
+ if (message.component !== "") {
711
+ writer.uint32(34).string(message.component);
712
+ }
713
+ if (message.extras !== void 0) {
714
+ Struct.encode(Struct.wrap(message.extras), writer.uint32(42).fork()).join();
715
+ }
716
+ for (const v of message.categories) {
717
+ writer.uint32(50).string(v);
718
+ }
719
+ if (message.flags !== 0) {
720
+ writer.uint32(56).int64(message.flags);
721
+ }
722
+ if (message.debug !== false) {
723
+ writer.uint32(64).bool(message.debug);
724
+ }
725
+ if (message.data !== "") {
726
+ writer.uint32(74).string(message.data);
727
+ }
728
+ if (message.user !== 0) {
729
+ writer.uint32(80).uint32(message.user);
730
+ }
731
+ return writer;
732
+ },
733
+ decode(input, length) {
734
+ const reader = input instanceof import_wire2.BinaryReader ? input : new import_wire2.BinaryReader(input);
735
+ let end = length === void 0 ? reader.len : reader.pos + length;
736
+ const message = createBaseApplicationActivityRequest();
737
+ while (reader.pos < end) {
738
+ const tag = reader.uint32();
739
+ switch (tag >>> 3) {
740
+ case 1: {
741
+ if (tag !== 10) {
742
+ break;
743
+ }
744
+ message.package = reader.string();
745
+ continue;
746
+ }
747
+ case 2: {
748
+ if (tag !== 18) {
749
+ break;
750
+ }
751
+ message.action = reader.string();
752
+ continue;
753
+ }
754
+ case 3: {
755
+ if (tag !== 26) {
756
+ break;
757
+ }
758
+ message.category = reader.string();
759
+ continue;
760
+ }
761
+ case 4: {
762
+ if (tag !== 34) {
763
+ break;
764
+ }
765
+ message.component = reader.string();
766
+ continue;
767
+ }
768
+ case 5: {
769
+ if (tag !== 42) {
770
+ break;
771
+ }
772
+ message.extras = Struct.unwrap(Struct.decode(reader, reader.uint32()));
773
+ continue;
774
+ }
775
+ case 6: {
776
+ if (tag !== 50) {
777
+ break;
778
+ }
779
+ message.categories.push(reader.string());
780
+ continue;
781
+ }
782
+ case 7: {
783
+ if (tag !== 56) {
784
+ break;
785
+ }
786
+ message.flags = longToNumber(reader.int64());
787
+ continue;
788
+ }
789
+ case 8: {
790
+ if (tag !== 64) {
791
+ break;
792
+ }
793
+ message.debug = reader.bool();
794
+ continue;
795
+ }
796
+ case 9: {
797
+ if (tag !== 74) {
798
+ break;
799
+ }
800
+ message.data = reader.string();
801
+ continue;
802
+ }
803
+ case 10: {
804
+ if (tag !== 80) {
805
+ break;
806
+ }
807
+ message.user = reader.uint32();
808
+ continue;
809
+ }
810
+ }
811
+ if ((tag & 7) === 4 || tag === 0) {
812
+ break;
813
+ }
814
+ reader.skip(tag & 7);
815
+ }
816
+ return message;
817
+ },
818
+ fromJSON(object) {
819
+ return {
820
+ package: isSet2(object.package) ? globalThis.String(object.package) : "",
821
+ action: isSet2(object.action) ? globalThis.String(object.action) : "",
822
+ category: isSet2(object.category) ? globalThis.String(object.category) : "",
823
+ component: isSet2(object.component) ? globalThis.String(object.component) : "",
824
+ extras: isObject2(object.extras) ? object.extras : void 0,
825
+ categories: globalThis.Array.isArray(object?.categories) ? object.categories.map((e) => globalThis.String(e)) : [],
826
+ flags: isSet2(object.flags) ? globalThis.Number(object.flags) : 0,
827
+ debug: isSet2(object.debug) ? globalThis.Boolean(object.debug) : false,
828
+ data: isSet2(object.data) ? globalThis.String(object.data) : "",
829
+ user: isSet2(object.user) ? globalThis.Number(object.user) : 0
830
+ };
831
+ },
832
+ toJSON(message) {
833
+ const obj = {};
834
+ if (message.package !== "") {
835
+ obj.package = message.package;
836
+ }
837
+ if (message.action !== "") {
838
+ obj.action = message.action;
839
+ }
840
+ if (message.category !== "") {
841
+ obj.category = message.category;
842
+ }
843
+ if (message.component !== "") {
844
+ obj.component = message.component;
845
+ }
846
+ if (message.extras !== void 0) {
847
+ obj.extras = message.extras;
848
+ }
849
+ if (message.categories?.length) {
850
+ obj.categories = message.categories;
851
+ }
852
+ if (message.flags !== 0) {
853
+ obj.flags = Math.round(message.flags);
854
+ }
855
+ if (message.debug !== false) {
856
+ obj.debug = message.debug;
857
+ }
858
+ if (message.data !== "") {
859
+ obj.data = message.data;
860
+ }
861
+ if (message.user !== 0) {
862
+ obj.user = Math.round(message.user);
863
+ }
864
+ return obj;
865
+ },
866
+ create(base) {
867
+ return ApplicationActivityRequest.fromPartial(base ?? {});
868
+ },
869
+ fromPartial(object) {
870
+ const message = createBaseApplicationActivityRequest();
871
+ message.package = object.package ?? "";
872
+ message.action = object.action ?? "";
873
+ message.category = object.category ?? "";
874
+ message.component = object.component ?? "";
875
+ message.extras = object.extras ?? void 0;
876
+ message.categories = object.categories?.map((e) => e) || [];
877
+ message.flags = object.flags ?? 0;
878
+ message.debug = object.debug ?? false;
879
+ message.data = object.data ?? "";
880
+ message.user = object.user ?? 0;
881
+ return message;
882
+ }
883
+ };
884
+ function createBaseApplicationActivityInfo() {
885
+ return {
886
+ package: "",
887
+ action: "",
888
+ category: "",
889
+ component: "",
890
+ extras: void 0,
891
+ categories: [],
892
+ flags: 0,
893
+ debug: false,
894
+ data: "",
895
+ user: 0
896
+ };
897
+ }
898
+ var ApplicationActivityInfo = {
899
+ encode(message, writer = new import_wire2.BinaryWriter()) {
900
+ if (message.package !== "") {
901
+ writer.uint32(10).string(message.package);
902
+ }
903
+ if (message.action !== "") {
904
+ writer.uint32(18).string(message.action);
905
+ }
906
+ if (message.category !== "") {
907
+ writer.uint32(26).string(message.category);
908
+ }
909
+ if (message.component !== "") {
910
+ writer.uint32(34).string(message.component);
911
+ }
912
+ if (message.extras !== void 0) {
913
+ Struct.encode(Struct.wrap(message.extras), writer.uint32(42).fork()).join();
914
+ }
915
+ for (const v of message.categories) {
916
+ writer.uint32(50).string(v);
917
+ }
918
+ if (message.flags !== 0) {
919
+ writer.uint32(56).int64(message.flags);
920
+ }
921
+ if (message.debug !== false) {
922
+ writer.uint32(64).bool(message.debug);
923
+ }
924
+ if (message.data !== "") {
925
+ writer.uint32(74).string(message.data);
926
+ }
927
+ if (message.user !== 0) {
928
+ writer.uint32(80).uint32(message.user);
929
+ }
930
+ return writer;
931
+ },
932
+ decode(input, length) {
933
+ const reader = input instanceof import_wire2.BinaryReader ? input : new import_wire2.BinaryReader(input);
934
+ let end = length === void 0 ? reader.len : reader.pos + length;
935
+ const message = createBaseApplicationActivityInfo();
936
+ while (reader.pos < end) {
937
+ const tag = reader.uint32();
938
+ switch (tag >>> 3) {
939
+ case 1: {
940
+ if (tag !== 10) {
941
+ break;
942
+ }
943
+ message.package = reader.string();
944
+ continue;
945
+ }
946
+ case 2: {
947
+ if (tag !== 18) {
948
+ break;
949
+ }
950
+ message.action = reader.string();
951
+ continue;
952
+ }
953
+ case 3: {
954
+ if (tag !== 26) {
955
+ break;
956
+ }
957
+ message.category = reader.string();
958
+ continue;
959
+ }
960
+ case 4: {
961
+ if (tag !== 34) {
962
+ break;
963
+ }
964
+ message.component = reader.string();
965
+ continue;
966
+ }
967
+ case 5: {
968
+ if (tag !== 42) {
969
+ break;
970
+ }
971
+ message.extras = Struct.unwrap(Struct.decode(reader, reader.uint32()));
972
+ continue;
973
+ }
974
+ case 6: {
975
+ if (tag !== 50) {
976
+ break;
977
+ }
978
+ message.categories.push(reader.string());
979
+ continue;
980
+ }
981
+ case 7: {
982
+ if (tag !== 56) {
983
+ break;
984
+ }
985
+ message.flags = longToNumber(reader.int64());
986
+ continue;
987
+ }
988
+ case 8: {
989
+ if (tag !== 64) {
990
+ break;
991
+ }
992
+ message.debug = reader.bool();
993
+ continue;
994
+ }
995
+ case 9: {
996
+ if (tag !== 74) {
997
+ break;
998
+ }
999
+ message.data = reader.string();
1000
+ continue;
1001
+ }
1002
+ case 10: {
1003
+ if (tag !== 80) {
1004
+ break;
1005
+ }
1006
+ message.user = reader.uint32();
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
+ package: isSet2(object.package) ? globalThis.String(object.package) : "",
1020
+ action: isSet2(object.action) ? globalThis.String(object.action) : "",
1021
+ category: isSet2(object.category) ? globalThis.String(object.category) : "",
1022
+ component: isSet2(object.component) ? globalThis.String(object.component) : "",
1023
+ extras: isObject2(object.extras) ? object.extras : void 0,
1024
+ categories: globalThis.Array.isArray(object?.categories) ? object.categories.map((e) => globalThis.String(e)) : [],
1025
+ flags: isSet2(object.flags) ? globalThis.Number(object.flags) : 0,
1026
+ debug: isSet2(object.debug) ? globalThis.Boolean(object.debug) : false,
1027
+ data: isSet2(object.data) ? globalThis.String(object.data) : "",
1028
+ user: isSet2(object.user) ? globalThis.Number(object.user) : 0
1029
+ };
1030
+ },
1031
+ toJSON(message) {
1032
+ const obj = {};
1033
+ if (message.package !== "") {
1034
+ obj.package = message.package;
1035
+ }
1036
+ if (message.action !== "") {
1037
+ obj.action = message.action;
1038
+ }
1039
+ if (message.category !== "") {
1040
+ obj.category = message.category;
1041
+ }
1042
+ if (message.component !== "") {
1043
+ obj.component = message.component;
1044
+ }
1045
+ if (message.extras !== void 0) {
1046
+ obj.extras = message.extras;
1047
+ }
1048
+ if (message.categories?.length) {
1049
+ obj.categories = message.categories;
1050
+ }
1051
+ if (message.flags !== 0) {
1052
+ obj.flags = Math.round(message.flags);
1053
+ }
1054
+ if (message.debug !== false) {
1055
+ obj.debug = message.debug;
1056
+ }
1057
+ if (message.data !== "") {
1058
+ obj.data = message.data;
1059
+ }
1060
+ if (message.user !== 0) {
1061
+ obj.user = Math.round(message.user);
1062
+ }
1063
+ return obj;
1064
+ },
1065
+ create(base) {
1066
+ return ApplicationActivityInfo.fromPartial(base ?? {});
1067
+ },
1068
+ fromPartial(object) {
1069
+ const message = createBaseApplicationActivityInfo();
1070
+ message.package = object.package ?? "";
1071
+ message.action = object.action ?? "";
1072
+ message.category = object.category ?? "";
1073
+ message.component = object.component ?? "";
1074
+ message.extras = object.extras ?? void 0;
1075
+ message.categories = object.categories?.map((e) => e) || [];
1076
+ message.flags = object.flags ?? 0;
1077
+ message.debug = object.debug ?? false;
1078
+ message.data = object.data ?? "";
1079
+ message.user = object.user ?? 0;
1080
+ return message;
1081
+ }
1082
+ };
1083
+ function createBaseApplicationActivityInfoList() {
1084
+ return { activities: [] };
1085
+ }
1086
+ var ApplicationActivityInfoList = {
1087
+ encode(message, writer = new import_wire2.BinaryWriter()) {
1088
+ for (const v of message.activities) {
1089
+ ApplicationActivityInfo.encode(v, writer.uint32(10).fork()).join();
1090
+ }
1091
+ return writer;
1092
+ },
1093
+ decode(input, length) {
1094
+ const reader = input instanceof import_wire2.BinaryReader ? input : new import_wire2.BinaryReader(input);
1095
+ let end = length === void 0 ? reader.len : reader.pos + length;
1096
+ const message = createBaseApplicationActivityInfoList();
1097
+ while (reader.pos < end) {
1098
+ const tag = reader.uint32();
1099
+ switch (tag >>> 3) {
1100
+ case 1: {
1101
+ if (tag !== 10) {
1102
+ break;
1103
+ }
1104
+ message.activities.push(ApplicationActivityInfo.decode(reader, reader.uint32()));
1105
+ continue;
1106
+ }
1107
+ }
1108
+ if ((tag & 7) === 4 || tag === 0) {
1109
+ break;
1110
+ }
1111
+ reader.skip(tag & 7);
1112
+ }
1113
+ return message;
1114
+ },
1115
+ fromJSON(object) {
1116
+ return {
1117
+ activities: globalThis.Array.isArray(object?.activities) ? object.activities.map((e) => ApplicationActivityInfo.fromJSON(e)) : []
1118
+ };
1119
+ },
1120
+ toJSON(message) {
1121
+ const obj = {};
1122
+ if (message.activities?.length) {
1123
+ obj.activities = message.activities.map((e) => ApplicationActivityInfo.toJSON(e));
1124
+ }
1125
+ return obj;
1126
+ },
1127
+ create(base) {
1128
+ return ApplicationActivityInfoList.fromPartial(base ?? {});
1129
+ },
1130
+ fromPartial(object) {
1131
+ const message = createBaseApplicationActivityInfoList();
1132
+ message.activities = object.activities?.map((e) => ApplicationActivityInfo.fromPartial(e)) || [];
1133
+ return message;
1134
+ }
1135
+ };
1136
+ function createBaseApplicationPermissions() {
1137
+ return { permissions: [] };
1138
+ }
1139
+ var ApplicationPermissions = {
1140
+ encode(message, writer = new import_wire2.BinaryWriter()) {
1141
+ for (const v of message.permissions) {
1142
+ writer.uint32(10).string(v);
1143
+ }
1144
+ return writer;
1145
+ },
1146
+ decode(input, length) {
1147
+ const reader = input instanceof import_wire2.BinaryReader ? input : new import_wire2.BinaryReader(input);
1148
+ let end = length === void 0 ? reader.len : reader.pos + length;
1149
+ const message = createBaseApplicationPermissions();
1150
+ while (reader.pos < end) {
1151
+ const tag = reader.uint32();
1152
+ switch (tag >>> 3) {
1153
+ case 1: {
1154
+ if (tag !== 10) {
1155
+ break;
1156
+ }
1157
+ message.permissions.push(reader.string());
1158
+ continue;
1159
+ }
1160
+ }
1161
+ if ((tag & 7) === 4 || tag === 0) {
1162
+ break;
1163
+ }
1164
+ reader.skip(tag & 7);
1165
+ }
1166
+ return message;
1167
+ },
1168
+ fromJSON(object) {
1169
+ return {
1170
+ permissions: globalThis.Array.isArray(object?.permissions) ? object.permissions.map((e) => globalThis.String(e)) : []
1171
+ };
1172
+ },
1173
+ toJSON(message) {
1174
+ const obj = {};
1175
+ if (message.permissions?.length) {
1176
+ obj.permissions = message.permissions;
1177
+ }
1178
+ return obj;
1179
+ },
1180
+ create(base) {
1181
+ return ApplicationPermissions.fromPartial(base ?? {});
1182
+ },
1183
+ fromPartial(object) {
1184
+ const message = createBaseApplicationPermissions();
1185
+ message.permissions = object.permissions?.map((e) => e) || [];
1186
+ return message;
1187
+ }
1188
+ };
1189
+ function createBaseApplicationInfo() {
1190
+ return {
1191
+ packageName: "",
1192
+ uid: 0,
1193
+ enabled: false,
1194
+ processName: "",
1195
+ sourceDir: "",
1196
+ dataDir: "",
1197
+ baseRevisionCode: 0,
1198
+ firstInstallTime: 0,
1199
+ lastUpdateTime: 0,
1200
+ versionCode: 0,
1201
+ versionName: "",
1202
+ activity: "",
1203
+ user: 0
1204
+ };
1205
+ }
1206
+ var ApplicationInfo = {
1207
+ encode(message, writer = new import_wire2.BinaryWriter()) {
1208
+ if (message.packageName !== "") {
1209
+ writer.uint32(10).string(message.packageName);
1210
+ }
1211
+ if (message.uid !== 0) {
1212
+ writer.uint32(16).uint32(message.uid);
1213
+ }
1214
+ if (message.enabled !== false) {
1215
+ writer.uint32(24).bool(message.enabled);
1216
+ }
1217
+ if (message.processName !== "") {
1218
+ writer.uint32(34).string(message.processName);
1219
+ }
1220
+ if (message.sourceDir !== "") {
1221
+ writer.uint32(42).string(message.sourceDir);
1222
+ }
1223
+ if (message.dataDir !== "") {
1224
+ writer.uint32(50).string(message.dataDir);
1225
+ }
1226
+ if (message.baseRevisionCode !== 0) {
1227
+ writer.uint32(56).uint32(message.baseRevisionCode);
1228
+ }
1229
+ if (message.firstInstallTime !== 0) {
1230
+ writer.uint32(64).int64(message.firstInstallTime);
1231
+ }
1232
+ if (message.lastUpdateTime !== 0) {
1233
+ writer.uint32(72).int64(message.lastUpdateTime);
1234
+ }
1235
+ if (message.versionCode !== 0) {
1236
+ writer.uint32(80).uint32(message.versionCode);
1237
+ }
1238
+ if (message.versionName !== "") {
1239
+ writer.uint32(90).string(message.versionName);
1240
+ }
1241
+ if (message.activity !== "") {
1242
+ writer.uint32(98).string(message.activity);
1243
+ }
1244
+ if (message.user !== 0) {
1245
+ writer.uint32(104).uint32(message.user);
1246
+ }
1247
+ return writer;
1248
+ },
1249
+ decode(input, length) {
1250
+ const reader = input instanceof import_wire2.BinaryReader ? input : new import_wire2.BinaryReader(input);
1251
+ let end = length === void 0 ? reader.len : reader.pos + length;
1252
+ const message = createBaseApplicationInfo();
1253
+ while (reader.pos < end) {
1254
+ const tag = reader.uint32();
1255
+ switch (tag >>> 3) {
1256
+ case 1: {
1257
+ if (tag !== 10) {
1258
+ break;
1259
+ }
1260
+ message.packageName = reader.string();
1261
+ continue;
1262
+ }
1263
+ case 2: {
1264
+ if (tag !== 16) {
1265
+ break;
1266
+ }
1267
+ message.uid = reader.uint32();
1268
+ continue;
1269
+ }
1270
+ case 3: {
1271
+ if (tag !== 24) {
1272
+ break;
1273
+ }
1274
+ message.enabled = reader.bool();
1275
+ continue;
1276
+ }
1277
+ case 4: {
1278
+ if (tag !== 34) {
1279
+ break;
1280
+ }
1281
+ message.processName = reader.string();
1282
+ continue;
1283
+ }
1284
+ case 5: {
1285
+ if (tag !== 42) {
1286
+ break;
1287
+ }
1288
+ message.sourceDir = reader.string();
1289
+ continue;
1290
+ }
1291
+ case 6: {
1292
+ if (tag !== 50) {
1293
+ break;
1294
+ }
1295
+ message.dataDir = reader.string();
1296
+ continue;
1297
+ }
1298
+ case 7: {
1299
+ if (tag !== 56) {
1300
+ break;
1301
+ }
1302
+ message.baseRevisionCode = reader.uint32();
1303
+ continue;
1304
+ }
1305
+ case 8: {
1306
+ if (tag !== 64) {
1307
+ break;
1308
+ }
1309
+ message.firstInstallTime = longToNumber(reader.int64());
1310
+ continue;
1311
+ }
1312
+ case 9: {
1313
+ if (tag !== 72) {
1314
+ break;
1315
+ }
1316
+ message.lastUpdateTime = longToNumber(reader.int64());
1317
+ continue;
1318
+ }
1319
+ case 10: {
1320
+ if (tag !== 80) {
1321
+ break;
1322
+ }
1323
+ message.versionCode = reader.uint32();
1324
+ continue;
1325
+ }
1326
+ case 11: {
1327
+ if (tag !== 90) {
1328
+ break;
1329
+ }
1330
+ message.versionName = reader.string();
1331
+ continue;
1332
+ }
1333
+ case 12: {
1334
+ if (tag !== 98) {
1335
+ break;
1336
+ }
1337
+ message.activity = reader.string();
1338
+ continue;
1339
+ }
1340
+ case 13: {
1341
+ if (tag !== 104) {
1342
+ break;
1343
+ }
1344
+ message.user = reader.uint32();
1345
+ continue;
1346
+ }
1347
+ }
1348
+ if ((tag & 7) === 4 || tag === 0) {
1349
+ break;
1350
+ }
1351
+ reader.skip(tag & 7);
1352
+ }
1353
+ return message;
1354
+ },
1355
+ fromJSON(object) {
1356
+ return {
1357
+ packageName: isSet2(object.packageName) ? globalThis.String(object.packageName) : "",
1358
+ uid: isSet2(object.uid) ? globalThis.Number(object.uid) : 0,
1359
+ enabled: isSet2(object.enabled) ? globalThis.Boolean(object.enabled) : false,
1360
+ processName: isSet2(object.processName) ? globalThis.String(object.processName) : "",
1361
+ sourceDir: isSet2(object.sourceDir) ? globalThis.String(object.sourceDir) : "",
1362
+ dataDir: isSet2(object.dataDir) ? globalThis.String(object.dataDir) : "",
1363
+ baseRevisionCode: isSet2(object.baseRevisionCode) ? globalThis.Number(object.baseRevisionCode) : 0,
1364
+ firstInstallTime: isSet2(object.firstInstallTime) ? globalThis.Number(object.firstInstallTime) : 0,
1365
+ lastUpdateTime: isSet2(object.lastUpdateTime) ? globalThis.Number(object.lastUpdateTime) : 0,
1366
+ versionCode: isSet2(object.versionCode) ? globalThis.Number(object.versionCode) : 0,
1367
+ versionName: isSet2(object.versionName) ? globalThis.String(object.versionName) : "",
1368
+ activity: isSet2(object.activity) ? globalThis.String(object.activity) : "",
1369
+ user: isSet2(object.user) ? globalThis.Number(object.user) : 0
1370
+ };
1371
+ },
1372
+ toJSON(message) {
1373
+ const obj = {};
1374
+ if (message.packageName !== "") {
1375
+ obj.packageName = message.packageName;
1376
+ }
1377
+ if (message.uid !== 0) {
1378
+ obj.uid = Math.round(message.uid);
1379
+ }
1380
+ if (message.enabled !== false) {
1381
+ obj.enabled = message.enabled;
1382
+ }
1383
+ if (message.processName !== "") {
1384
+ obj.processName = message.processName;
1385
+ }
1386
+ if (message.sourceDir !== "") {
1387
+ obj.sourceDir = message.sourceDir;
1388
+ }
1389
+ if (message.dataDir !== "") {
1390
+ obj.dataDir = message.dataDir;
1391
+ }
1392
+ if (message.baseRevisionCode !== 0) {
1393
+ obj.baseRevisionCode = Math.round(message.baseRevisionCode);
1394
+ }
1395
+ if (message.firstInstallTime !== 0) {
1396
+ obj.firstInstallTime = Math.round(message.firstInstallTime);
1397
+ }
1398
+ if (message.lastUpdateTime !== 0) {
1399
+ obj.lastUpdateTime = Math.round(message.lastUpdateTime);
1400
+ }
1401
+ if (message.versionCode !== 0) {
1402
+ obj.versionCode = Math.round(message.versionCode);
1403
+ }
1404
+ if (message.versionName !== "") {
1405
+ obj.versionName = message.versionName;
1406
+ }
1407
+ if (message.activity !== "") {
1408
+ obj.activity = message.activity;
1409
+ }
1410
+ if (message.user !== 0) {
1411
+ obj.user = Math.round(message.user);
1412
+ }
1413
+ return obj;
1414
+ },
1415
+ create(base) {
1416
+ return ApplicationInfo.fromPartial(base ?? {});
1417
+ },
1418
+ fromPartial(object) {
1419
+ const message = createBaseApplicationInfo();
1420
+ message.packageName = object.packageName ?? "";
1421
+ message.uid = object.uid ?? 0;
1422
+ message.enabled = object.enabled ?? false;
1423
+ message.processName = object.processName ?? "";
1424
+ message.sourceDir = object.sourceDir ?? "";
1425
+ message.dataDir = object.dataDir ?? "";
1426
+ message.baseRevisionCode = object.baseRevisionCode ?? 0;
1427
+ message.firstInstallTime = object.firstInstallTime ?? 0;
1428
+ message.lastUpdateTime = object.lastUpdateTime ?? 0;
1429
+ message.versionCode = object.versionCode ?? 0;
1430
+ message.versionName = object.versionName ?? "";
1431
+ message.activity = object.activity ?? "";
1432
+ message.user = object.user ?? 0;
1433
+ return message;
1434
+ }
1435
+ };
1436
+ function createBaseApplicationProcess() {
1437
+ return { packages: [], processName: "", uid: 0, pid: 0 };
1438
+ }
1439
+ var ApplicationProcess = {
1440
+ encode(message, writer = new import_wire2.BinaryWriter()) {
1441
+ for (const v of message.packages) {
1442
+ writer.uint32(10).string(v);
1443
+ }
1444
+ if (message.processName !== "") {
1445
+ writer.uint32(18).string(message.processName);
1446
+ }
1447
+ if (message.uid !== 0) {
1448
+ writer.uint32(24).int64(message.uid);
1449
+ }
1450
+ if (message.pid !== 0) {
1451
+ writer.uint32(32).int64(message.pid);
1452
+ }
1453
+ return writer;
1454
+ },
1455
+ decode(input, length) {
1456
+ const reader = input instanceof import_wire2.BinaryReader ? input : new import_wire2.BinaryReader(input);
1457
+ let end = length === void 0 ? reader.len : reader.pos + length;
1458
+ const message = createBaseApplicationProcess();
1459
+ while (reader.pos < end) {
1460
+ const tag = reader.uint32();
1461
+ switch (tag >>> 3) {
1462
+ case 1: {
1463
+ if (tag !== 10) {
1464
+ break;
1465
+ }
1466
+ message.packages.push(reader.string());
1467
+ continue;
1468
+ }
1469
+ case 2: {
1470
+ if (tag !== 18) {
1471
+ break;
1472
+ }
1473
+ message.processName = reader.string();
1474
+ continue;
1475
+ }
1476
+ case 3: {
1477
+ if (tag !== 24) {
1478
+ break;
1479
+ }
1480
+ message.uid = longToNumber(reader.int64());
1481
+ continue;
1482
+ }
1483
+ case 4: {
1484
+ if (tag !== 32) {
1485
+ break;
1486
+ }
1487
+ message.pid = longToNumber(reader.int64());
1488
+ continue;
1489
+ }
1490
+ }
1491
+ if ((tag & 7) === 4 || tag === 0) {
1492
+ break;
1493
+ }
1494
+ reader.skip(tag & 7);
1495
+ }
1496
+ return message;
1497
+ },
1498
+ fromJSON(object) {
1499
+ return {
1500
+ packages: globalThis.Array.isArray(object?.packages) ? object.packages.map((e) => globalThis.String(e)) : [],
1501
+ processName: isSet2(object.processName) ? globalThis.String(object.processName) : "",
1502
+ uid: isSet2(object.uid) ? globalThis.Number(object.uid) : 0,
1503
+ pid: isSet2(object.pid) ? globalThis.Number(object.pid) : 0
1504
+ };
1505
+ },
1506
+ toJSON(message) {
1507
+ const obj = {};
1508
+ if (message.packages?.length) {
1509
+ obj.packages = message.packages;
1510
+ }
1511
+ if (message.processName !== "") {
1512
+ obj.processName = message.processName;
1513
+ }
1514
+ if (message.uid !== 0) {
1515
+ obj.uid = Math.round(message.uid);
1516
+ }
1517
+ if (message.pid !== 0) {
1518
+ obj.pid = Math.round(message.pid);
1519
+ }
1520
+ return obj;
1521
+ },
1522
+ create(base) {
1523
+ return ApplicationProcess.fromPartial(base ?? {});
1524
+ },
1525
+ fromPartial(object) {
1526
+ const message = createBaseApplicationProcess();
1527
+ message.packages = object.packages?.map((e) => e) || [];
1528
+ message.processName = object.processName ?? "";
1529
+ message.uid = object.uid ?? 0;
1530
+ message.pid = object.pid ?? 0;
1531
+ return message;
1532
+ }
1533
+ };
1534
+ function createBaseApplicationProcesses() {
1535
+ return { processes: [] };
1536
+ }
1537
+ var ApplicationProcesses = {
1538
+ encode(message, writer = new import_wire2.BinaryWriter()) {
1539
+ for (const v of message.processes) {
1540
+ ApplicationProcess.encode(v, writer.uint32(10).fork()).join();
1541
+ }
1542
+ return writer;
1543
+ },
1544
+ decode(input, length) {
1545
+ const reader = input instanceof import_wire2.BinaryReader ? input : new import_wire2.BinaryReader(input);
1546
+ let end = length === void 0 ? reader.len : reader.pos + length;
1547
+ const message = createBaseApplicationProcesses();
1548
+ while (reader.pos < end) {
1549
+ const tag = reader.uint32();
1550
+ switch (tag >>> 3) {
1551
+ case 1: {
1552
+ if (tag !== 10) {
1553
+ break;
1554
+ }
1555
+ message.processes.push(ApplicationProcess.decode(reader, reader.uint32()));
1556
+ continue;
1557
+ }
1558
+ }
1559
+ if ((tag & 7) === 4 || tag === 0) {
1560
+ break;
1561
+ }
1562
+ reader.skip(tag & 7);
1563
+ }
1564
+ return message;
1565
+ },
1566
+ fromJSON(object) {
1567
+ return {
1568
+ processes: globalThis.Array.isArray(object?.processes) ? object.processes.map((e) => ApplicationProcess.fromJSON(e)) : []
1569
+ };
1570
+ },
1571
+ toJSON(message) {
1572
+ const obj = {};
1573
+ if (message.processes?.length) {
1574
+ obj.processes = message.processes.map((e) => ApplicationProcess.toJSON(e));
1575
+ }
1576
+ return obj;
1577
+ },
1578
+ create(base) {
1579
+ return ApplicationProcesses.fromPartial(base ?? {});
1580
+ },
1581
+ fromPartial(object) {
1582
+ const message = createBaseApplicationProcesses();
1583
+ message.processes = object.processes?.map((e) => ApplicationProcess.fromPartial(e)) || [];
1584
+ return message;
1585
+ }
1586
+ };
1587
+ function createBaseApplicationPkgNames() {
1588
+ return { names: [] };
1589
+ }
1590
+ var ApplicationPkgNames = {
1591
+ encode(message, writer = new import_wire2.BinaryWriter()) {
1592
+ for (const v of message.names) {
1593
+ writer.uint32(10).string(v);
1594
+ }
1595
+ return writer;
1596
+ },
1597
+ decode(input, length) {
1598
+ const reader = input instanceof import_wire2.BinaryReader ? input : new import_wire2.BinaryReader(input);
1599
+ let end = length === void 0 ? reader.len : reader.pos + length;
1600
+ const message = createBaseApplicationPkgNames();
1601
+ while (reader.pos < end) {
1602
+ const tag = reader.uint32();
1603
+ switch (tag >>> 3) {
1604
+ case 1: {
1605
+ if (tag !== 10) {
1606
+ break;
1607
+ }
1608
+ message.names.push(reader.string());
1609
+ continue;
1610
+ }
1611
+ }
1612
+ if ((tag & 7) === 4 || tag === 0) {
1613
+ break;
1614
+ }
1615
+ reader.skip(tag & 7);
1616
+ }
1617
+ return message;
1618
+ },
1619
+ fromJSON(object) {
1620
+ return { names: globalThis.Array.isArray(object?.names) ? object.names.map((e) => globalThis.String(e)) : [] };
1621
+ },
1622
+ toJSON(message) {
1623
+ const obj = {};
1624
+ if (message.names?.length) {
1625
+ obj.names = message.names;
1626
+ }
1627
+ return obj;
1628
+ },
1629
+ create(base) {
1630
+ return ApplicationPkgNames.fromPartial(base ?? {});
1631
+ },
1632
+ fromPartial(object) {
1633
+ const message = createBaseApplicationPkgNames();
1634
+ message.names = object.names?.map((e) => e) || [];
1635
+ return message;
1636
+ }
1637
+ };
1638
+ function createBaseHookRequest() {
1639
+ return {
1640
+ package: "",
1641
+ script: new Uint8Array(0),
1642
+ runtime: 0,
1643
+ destination: "",
1644
+ encode: 0,
1645
+ standup: 0,
1646
+ spawn: false,
1647
+ user: 0
1648
+ };
1649
+ }
1650
+ var HookRequest = {
1651
+ encode(message, writer = new import_wire2.BinaryWriter()) {
1652
+ if (message.package !== "") {
1653
+ writer.uint32(10).string(message.package);
1654
+ }
1655
+ if (message.script.length !== 0) {
1656
+ writer.uint32(18).bytes(message.script);
1657
+ }
1658
+ if (message.runtime !== 0) {
1659
+ writer.uint32(24).int32(message.runtime);
1660
+ }
1661
+ if (message.destination !== "") {
1662
+ writer.uint32(34).string(message.destination);
1663
+ }
1664
+ if (message.encode !== 0) {
1665
+ writer.uint32(40).int32(message.encode);
1666
+ }
1667
+ if (message.standup !== 0) {
1668
+ writer.uint32(48).uint32(message.standup);
1669
+ }
1670
+ if (message.spawn !== false) {
1671
+ writer.uint32(56).bool(message.spawn);
1672
+ }
1673
+ if (message.user !== 0) {
1674
+ writer.uint32(64).uint32(message.user);
1675
+ }
1676
+ return writer;
1677
+ },
1678
+ decode(input, length) {
1679
+ const reader = input instanceof import_wire2.BinaryReader ? input : new import_wire2.BinaryReader(input);
1680
+ let end = length === void 0 ? reader.len : reader.pos + length;
1681
+ const message = createBaseHookRequest();
1682
+ while (reader.pos < end) {
1683
+ const tag = reader.uint32();
1684
+ switch (tag >>> 3) {
1685
+ case 1: {
1686
+ if (tag !== 10) {
1687
+ break;
1688
+ }
1689
+ message.package = reader.string();
1690
+ continue;
1691
+ }
1692
+ case 2: {
1693
+ if (tag !== 18) {
1694
+ break;
1695
+ }
1696
+ message.script = reader.bytes();
1697
+ continue;
1698
+ }
1699
+ case 3: {
1700
+ if (tag !== 24) {
1701
+ break;
1702
+ }
1703
+ message.runtime = reader.int32();
1704
+ continue;
1705
+ }
1706
+ case 4: {
1707
+ if (tag !== 34) {
1708
+ break;
1709
+ }
1710
+ message.destination = reader.string();
1711
+ continue;
1712
+ }
1713
+ case 5: {
1714
+ if (tag !== 40) {
1715
+ break;
1716
+ }
1717
+ message.encode = reader.int32();
1718
+ continue;
1719
+ }
1720
+ case 6: {
1721
+ if (tag !== 48) {
1722
+ break;
1723
+ }
1724
+ message.standup = reader.uint32();
1725
+ continue;
1726
+ }
1727
+ case 7: {
1728
+ if (tag !== 56) {
1729
+ break;
1730
+ }
1731
+ message.spawn = reader.bool();
1732
+ continue;
1733
+ }
1734
+ case 8: {
1735
+ if (tag !== 64) {
1736
+ break;
1737
+ }
1738
+ message.user = reader.uint32();
1739
+ continue;
1740
+ }
1741
+ }
1742
+ if ((tag & 7) === 4 || tag === 0) {
1743
+ break;
1744
+ }
1745
+ reader.skip(tag & 7);
1746
+ }
1747
+ return message;
1748
+ },
1749
+ fromJSON(object) {
1750
+ return {
1751
+ package: isSet2(object.package) ? globalThis.String(object.package) : "",
1752
+ script: isSet2(object.script) ? bytesFromBase64(object.script) : new Uint8Array(0),
1753
+ runtime: isSet2(object.runtime) ? scriptRuntimeFromJSON(object.runtime) : 0,
1754
+ destination: isSet2(object.destination) ? globalThis.String(object.destination) : "",
1755
+ encode: isSet2(object.encode) ? dataEncodeFromJSON(object.encode) : 0,
1756
+ standup: isSet2(object.standup) ? globalThis.Number(object.standup) : 0,
1757
+ spawn: isSet2(object.spawn) ? globalThis.Boolean(object.spawn) : false,
1758
+ user: isSet2(object.user) ? globalThis.Number(object.user) : 0
1759
+ };
1760
+ },
1761
+ toJSON(message) {
1762
+ const obj = {};
1763
+ if (message.package !== "") {
1764
+ obj.package = message.package;
1765
+ }
1766
+ if (message.script.length !== 0) {
1767
+ obj.script = base64FromBytes(message.script);
1768
+ }
1769
+ if (message.runtime !== 0) {
1770
+ obj.runtime = scriptRuntimeToJSON(message.runtime);
1771
+ }
1772
+ if (message.destination !== "") {
1773
+ obj.destination = message.destination;
1774
+ }
1775
+ if (message.encode !== 0) {
1776
+ obj.encode = dataEncodeToJSON(message.encode);
1777
+ }
1778
+ if (message.standup !== 0) {
1779
+ obj.standup = Math.round(message.standup);
1780
+ }
1781
+ if (message.spawn !== false) {
1782
+ obj.spawn = message.spawn;
1783
+ }
1784
+ if (message.user !== 0) {
1785
+ obj.user = Math.round(message.user);
1786
+ }
1787
+ return obj;
1788
+ },
1789
+ create(base) {
1790
+ return HookRequest.fromPartial(base ?? {});
1791
+ },
1792
+ fromPartial(object) {
1793
+ const message = createBaseHookRequest();
1794
+ message.package = object.package ?? "";
1795
+ message.script = object.script ?? new Uint8Array(0);
1796
+ message.runtime = object.runtime ?? 0;
1797
+ message.destination = object.destination ?? "";
1798
+ message.encode = object.encode ?? 0;
1799
+ message.standup = object.standup ?? 0;
1800
+ message.spawn = object.spawn ?? false;
1801
+ message.user = object.user ?? 0;
1802
+ return message;
1803
+ }
1804
+ };
1805
+ function createBaseHookRpcRequest() {
1806
+ return { package: "", callinfo: "", user: 0 };
1807
+ }
1808
+ var HookRpcRequest = {
1809
+ encode(message, writer = new import_wire2.BinaryWriter()) {
1810
+ if (message.package !== "") {
1811
+ writer.uint32(10).string(message.package);
1812
+ }
1813
+ if (message.callinfo !== "") {
1814
+ writer.uint32(18).string(message.callinfo);
1815
+ }
1816
+ if (message.user !== 0) {
1817
+ writer.uint32(24).uint32(message.user);
1818
+ }
1819
+ return writer;
1820
+ },
1821
+ decode(input, length) {
1822
+ const reader = input instanceof import_wire2.BinaryReader ? input : new import_wire2.BinaryReader(input);
1823
+ let end = length === void 0 ? reader.len : reader.pos + length;
1824
+ const message = createBaseHookRpcRequest();
1825
+ while (reader.pos < end) {
1826
+ const tag = reader.uint32();
1827
+ switch (tag >>> 3) {
1828
+ case 1: {
1829
+ if (tag !== 10) {
1830
+ break;
1831
+ }
1832
+ message.package = reader.string();
1833
+ continue;
1834
+ }
1835
+ case 2: {
1836
+ if (tag !== 18) {
1837
+ break;
1838
+ }
1839
+ message.callinfo = reader.string();
1840
+ continue;
1841
+ }
1842
+ case 3: {
1843
+ if (tag !== 24) {
1844
+ break;
1845
+ }
1846
+ message.user = reader.uint32();
1847
+ continue;
1848
+ }
1849
+ }
1850
+ if ((tag & 7) === 4 || tag === 0) {
1851
+ break;
1852
+ }
1853
+ reader.skip(tag & 7);
1854
+ }
1855
+ return message;
1856
+ },
1857
+ fromJSON(object) {
1858
+ return {
1859
+ package: isSet2(object.package) ? globalThis.String(object.package) : "",
1860
+ callinfo: isSet2(object.callinfo) ? globalThis.String(object.callinfo) : "",
1861
+ user: isSet2(object.user) ? globalThis.Number(object.user) : 0
1862
+ };
1863
+ },
1864
+ toJSON(message) {
1865
+ const obj = {};
1866
+ if (message.package !== "") {
1867
+ obj.package = message.package;
1868
+ }
1869
+ if (message.callinfo !== "") {
1870
+ obj.callinfo = message.callinfo;
1871
+ }
1872
+ if (message.user !== 0) {
1873
+ obj.user = Math.round(message.user);
1874
+ }
1875
+ return obj;
1876
+ },
1877
+ create(base) {
1878
+ return HookRpcRequest.fromPartial(base ?? {});
1879
+ },
1880
+ fromPartial(object) {
1881
+ const message = createBaseHookRpcRequest();
1882
+ message.package = object.package ?? "";
1883
+ message.callinfo = object.callinfo ?? "";
1884
+ message.user = object.user ?? 0;
1885
+ return message;
1886
+ }
1887
+ };
1888
+ function createBaseHookRpcResponse() {
1889
+ return { package: "", callresult: "" };
1890
+ }
1891
+ var HookRpcResponse = {
1892
+ encode(message, writer = new import_wire2.BinaryWriter()) {
1893
+ if (message.package !== "") {
1894
+ writer.uint32(10).string(message.package);
1895
+ }
1896
+ if (message.callresult !== "") {
1897
+ writer.uint32(18).string(message.callresult);
1898
+ }
1899
+ return writer;
1900
+ },
1901
+ decode(input, length) {
1902
+ const reader = input instanceof import_wire2.BinaryReader ? input : new import_wire2.BinaryReader(input);
1903
+ let end = length === void 0 ? reader.len : reader.pos + length;
1904
+ const message = createBaseHookRpcResponse();
1905
+ while (reader.pos < end) {
1906
+ const tag = reader.uint32();
1907
+ switch (tag >>> 3) {
1908
+ case 1: {
1909
+ if (tag !== 10) {
1910
+ break;
1911
+ }
1912
+ message.package = reader.string();
1913
+ continue;
1914
+ }
1915
+ case 2: {
1916
+ if (tag !== 18) {
1917
+ break;
1918
+ }
1919
+ message.callresult = reader.string();
1920
+ continue;
1921
+ }
1922
+ }
1923
+ if ((tag & 7) === 4 || tag === 0) {
1924
+ break;
1925
+ }
1926
+ reader.skip(tag & 7);
1927
+ }
1928
+ return message;
1929
+ },
1930
+ fromJSON(object) {
1931
+ return {
1932
+ package: isSet2(object.package) ? globalThis.String(object.package) : "",
1933
+ callresult: isSet2(object.callresult) ? globalThis.String(object.callresult) : ""
1934
+ };
1935
+ },
1936
+ toJSON(message) {
1937
+ const obj = {};
1938
+ if (message.package !== "") {
1939
+ obj.package = message.package;
1940
+ }
1941
+ if (message.callresult !== "") {
1942
+ obj.callresult = message.callresult;
1943
+ }
1944
+ return obj;
1945
+ },
1946
+ create(base) {
1947
+ return HookRpcResponse.fromPartial(base ?? {});
1948
+ },
1949
+ fromPartial(object) {
1950
+ const message = createBaseHookRpcResponse();
1951
+ message.package = object.package ?? "";
1952
+ message.callresult = object.callresult ?? "";
1953
+ return message;
1954
+ }
1955
+ };
1956
+ function bytesFromBase64(b64) {
1957
+ if (globalThis.Buffer) {
1958
+ return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
1959
+ } else {
1960
+ const bin = globalThis.atob(b64);
1961
+ const arr = new Uint8Array(bin.length);
1962
+ for (let i = 0; i < bin.length; ++i) {
1963
+ arr[i] = bin.charCodeAt(i);
1964
+ }
1965
+ return arr;
1966
+ }
1967
+ }
1968
+ function base64FromBytes(arr) {
1969
+ if (globalThis.Buffer) {
1970
+ return globalThis.Buffer.from(arr).toString("base64");
1971
+ } else {
1972
+ const bin = [];
1973
+ arr.forEach((byte) => {
1974
+ bin.push(globalThis.String.fromCharCode(byte));
1975
+ });
1976
+ return globalThis.btoa(bin.join(""));
1977
+ }
1978
+ }
1979
+ function longToNumber(int64) {
1980
+ const num = globalThis.Number(int64.toString());
1981
+ if (num > globalThis.Number.MAX_SAFE_INTEGER) {
1982
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
1983
+ }
1984
+ if (num < globalThis.Number.MIN_SAFE_INTEGER) {
1985
+ throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
1986
+ }
1987
+ return num;
1988
+ }
1989
+ function isObject2(value) {
1990
+ return typeof value === "object" && value !== null;
1991
+ }
1992
+ function isSet2(value) {
1993
+ return value !== null && value !== void 0;
1994
+ }
1995
+ // Annotate the CommonJS export names for ESM import in node:
1996
+ 0 && (module.exports = {
1997
+ ApplicationActivityInfo,
1998
+ ApplicationActivityInfoList,
1999
+ ApplicationActivityRequest,
2000
+ ApplicationInfo,
2001
+ ApplicationPermissions,
2002
+ ApplicationPkgNames,
2003
+ ApplicationProcess,
2004
+ ApplicationProcesses,
2005
+ ApplicationRequest,
2006
+ DataEncode,
2007
+ GrantType,
2008
+ HookRequest,
2009
+ HookRpcRequest,
2010
+ HookRpcResponse,
2011
+ ScriptRuntime,
2012
+ dataEncodeFromJSON,
2013
+ dataEncodeToJSON,
2014
+ grantTypeFromJSON,
2015
+ grantTypeToJSON,
2016
+ protobufPackage,
2017
+ scriptRuntimeFromJSON,
2018
+ scriptRuntimeToJSON
2019
+ });