@world-engines/protocol-ts 0.1.0-alpha.0

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 (74) hide show
  1. package/LICENSE +46 -0
  2. package/dist/entity-prop-envelope.d.ts +36 -0
  3. package/dist/entity-prop-envelope.js +50 -0
  4. package/dist/gen/v1/auth.d.ts +46 -0
  5. package/dist/gen/v1/auth.js +278 -0
  6. package/dist/gen/v1/billing.d.ts +71 -0
  7. package/dist/gen/v1/billing.js +521 -0
  8. package/dist/gen/v1/common.d.ts +65 -0
  9. package/dist/gen/v1/common.js +387 -0
  10. package/dist/gen/v1/llm.d.ts +317 -0
  11. package/dist/gen/v1/llm.js +3557 -0
  12. package/dist/gen/v1/mcp.d.ts +373 -0
  13. package/dist/gen/v1/mcp.js +3190 -0
  14. package/dist/gen/v1/moderation.d.ts +51 -0
  15. package/dist/gen/v1/moderation.js +368 -0
  16. package/dist/gen/v1/neutral_scenario_source.d.ts +80 -0
  17. package/dist/gen/v1/neutral_scenario_source.js +569 -0
  18. package/dist/gen/v1/relation_kind.d.ts +105 -0
  19. package/dist/gen/v1/relation_kind.js +562 -0
  20. package/dist/gen/v1/rest/admin.d.ts +432 -0
  21. package/dist/gen/v1/rest/admin.js +4957 -0
  22. package/dist/gen/v1/rest/asset.d.ts +205 -0
  23. package/dist/gen/v1/rest/asset.js +2200 -0
  24. package/dist/gen/v1/rest/auth.d.ts +275 -0
  25. package/dist/gen/v1/rest/auth.js +2896 -0
  26. package/dist/gen/v1/rest/billing.d.ts +101 -0
  27. package/dist/gen/v1/rest/billing.js +866 -0
  28. package/dist/gen/v1/rest/common.d.ts +179 -0
  29. package/dist/gen/v1/rest/common.js +1358 -0
  30. package/dist/gen/v1/rest/creator.d.ts +354 -0
  31. package/dist/gen/v1/rest/creator.js +4169 -0
  32. package/dist/gen/v1/rest/messaging.d.ts +190 -0
  33. package/dist/gen/v1/rest/messaging.js +2017 -0
  34. package/dist/gen/v1/rest/moderation.d.ts +61 -0
  35. package/dist/gen/v1/rest/moderation.js +569 -0
  36. package/dist/gen/v1/rest/pet.d.ts +98 -0
  37. package/dist/gen/v1/rest/pet.js +698 -0
  38. package/dist/gen/v1/rest/project_transfer.d.ts +470 -0
  39. package/dist/gen/v1/rest/project_transfer.js +5266 -0
  40. package/dist/gen/v1/rest/scenario.d.ts +756 -0
  41. package/dist/gen/v1/rest/scenario.js +8768 -0
  42. package/dist/gen/v1/rest/stock_bounty.d.ts +154 -0
  43. package/dist/gen/v1/rest/stock_bounty.js +1547 -0
  44. package/dist/gen/v1/rest/stocks.d.ts +465 -0
  45. package/dist/gen/v1/rest/stocks.js +5200 -0
  46. package/dist/gen/v1/rest/support_ticket.d.ts +61 -0
  47. package/dist/gen/v1/rest/support_ticket.js +511 -0
  48. package/dist/gen/v1/rest/users.d.ts +292 -0
  49. package/dist/gen/v1/rest/users.js +2879 -0
  50. package/dist/gen/v1/rest/violations.d.ts +52 -0
  51. package/dist/gen/v1/rest/violations.js +338 -0
  52. package/dist/gen/v1/sav.d.ts +987 -0
  53. package/dist/gen/v1/sav.js +12327 -0
  54. package/dist/gen/v1/save.d.ts +68 -0
  55. package/dist/gen/v1/save.js +595 -0
  56. package/dist/gen/v1/scenario_part_source.d.ts +94 -0
  57. package/dist/gen/v1/scenario_part_source.js +913 -0
  58. package/dist/gen/v1/session.d.ts +49 -0
  59. package/dist/gen/v1/session.js +311 -0
  60. package/dist/gen/v1/view_state.d.ts +267 -0
  61. package/dist/gen/v1/view_state.js +3239 -0
  62. package/dist/gen/v1/world.d.ts +82 -0
  63. package/dist/gen/v1/world.js +707 -0
  64. package/dist/gen/v1/world_memory.d.ts +545 -0
  65. package/dist/gen/v1/world_memory.js +5816 -0
  66. package/dist/gen/v1/world_memory_privacy.d.ts +96 -0
  67. package/dist/gen/v1/world_memory_privacy.js +994 -0
  68. package/dist/gen/v1/ws_frame.d.ts +1626 -0
  69. package/dist/gen/v1/ws_frame.js +18253 -0
  70. package/dist/index.d.ts +2 -0
  71. package/dist/index.js +5 -0
  72. package/dist/ladybug-extraction.d.ts +36 -0
  73. package/dist/ladybug-extraction.js +1 -0
  74. package/package.json +65 -0
@@ -0,0 +1,1358 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.12.0
4
+ // protoc unknown
5
+ // source: v1/rest/common.proto
6
+ /* eslint-disable */
7
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
8
+ import { ErrorInfo } from "../common.js";
9
+ function createBaseEnvelopeV2() {
10
+ return { v: 0, nonce: new Uint8Array(0), ciphertext: new Uint8Array(0), inner: "", _unknownFields: {} };
11
+ }
12
+ export const EnvelopeV2 = {
13
+ encode(message, writer = new BinaryWriter()) {
14
+ if (message.v !== 0) {
15
+ writer.uint32(8).uint32(message.v);
16
+ }
17
+ if (message.nonce.length !== 0) {
18
+ writer.uint32(18).bytes(message.nonce);
19
+ }
20
+ if (message.ciphertext.length !== 0) {
21
+ writer.uint32(26).bytes(message.ciphertext);
22
+ }
23
+ if (message.inner !== "") {
24
+ writer.uint32(34).string(message.inner);
25
+ }
26
+ if (message._unknownFields !== undefined) {
27
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
28
+ const tag = parseInt(key, 10);
29
+ for (const value of values) {
30
+ writer.uint32(tag).raw(value);
31
+ }
32
+ }
33
+ }
34
+ return writer;
35
+ },
36
+ decode(input, length) {
37
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
38
+ const end = length === undefined ? reader.len : reader.pos + length;
39
+ const message = createBaseEnvelopeV2();
40
+ while (reader.pos < end) {
41
+ const tag = reader.uint32();
42
+ switch (tag >>> 3) {
43
+ case 1: {
44
+ if (tag !== 8) {
45
+ break;
46
+ }
47
+ message.v = reader.uint32();
48
+ continue;
49
+ }
50
+ case 2: {
51
+ if (tag !== 18) {
52
+ break;
53
+ }
54
+ message.nonce = reader.bytes();
55
+ continue;
56
+ }
57
+ case 3: {
58
+ if (tag !== 26) {
59
+ break;
60
+ }
61
+ message.ciphertext = reader.bytes();
62
+ continue;
63
+ }
64
+ case 4: {
65
+ if (tag !== 34) {
66
+ break;
67
+ }
68
+ message.inner = reader.string();
69
+ continue;
70
+ }
71
+ }
72
+ if ((tag & 7) === 4 || tag === 0) {
73
+ break;
74
+ }
75
+ const buf = reader.skip(tag & 7);
76
+ const list = message._unknownFields[tag];
77
+ if (list === undefined) {
78
+ message._unknownFields[tag] = [buf];
79
+ }
80
+ else {
81
+ list.push(buf);
82
+ }
83
+ }
84
+ return message;
85
+ },
86
+ fromJSON(object) {
87
+ return {
88
+ v: isSet(object.v) ? globalThis.Number(object.v) : 0,
89
+ nonce: isSet(object.nonce) ? bytesFromBase64(object.nonce) : new Uint8Array(0),
90
+ ciphertext: isSet(object.ciphertext) ? bytesFromBase64(object.ciphertext) : new Uint8Array(0),
91
+ inner: isSet(object.inner) ? globalThis.String(object.inner) : "",
92
+ };
93
+ },
94
+ toJSON(message) {
95
+ const obj = {};
96
+ if (message.v !== 0) {
97
+ obj.v = Math.round(message.v);
98
+ }
99
+ if (message.nonce.length !== 0) {
100
+ obj.nonce = base64FromBytes(message.nonce);
101
+ }
102
+ if (message.ciphertext.length !== 0) {
103
+ obj.ciphertext = base64FromBytes(message.ciphertext);
104
+ }
105
+ if (message.inner !== "") {
106
+ obj.inner = message.inner;
107
+ }
108
+ return obj;
109
+ },
110
+ create(base) {
111
+ return EnvelopeV2.fromPartial(base ?? {});
112
+ },
113
+ fromPartial(object) {
114
+ const message = createBaseEnvelopeV2();
115
+ message.v = object.v ?? 0;
116
+ message.nonce = object.nonce ?? new Uint8Array(0);
117
+ message.ciphertext = object.ciphertext ?? new Uint8Array(0);
118
+ message.inner = object.inner ?? "";
119
+ return message;
120
+ },
121
+ };
122
+ function createBasePageRequest() {
123
+ return { cursor: "", limit: 0, _unknownFields: {} };
124
+ }
125
+ export const PageRequest = {
126
+ encode(message, writer = new BinaryWriter()) {
127
+ if (message.cursor !== "") {
128
+ writer.uint32(10).string(message.cursor);
129
+ }
130
+ if (message.limit !== 0) {
131
+ writer.uint32(16).int32(message.limit);
132
+ }
133
+ if (message._unknownFields !== undefined) {
134
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
135
+ const tag = parseInt(key, 10);
136
+ for (const value of values) {
137
+ writer.uint32(tag).raw(value);
138
+ }
139
+ }
140
+ }
141
+ return writer;
142
+ },
143
+ decode(input, length) {
144
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
145
+ const end = length === undefined ? reader.len : reader.pos + length;
146
+ const message = createBasePageRequest();
147
+ while (reader.pos < end) {
148
+ const tag = reader.uint32();
149
+ switch (tag >>> 3) {
150
+ case 1: {
151
+ if (tag !== 10) {
152
+ break;
153
+ }
154
+ message.cursor = reader.string();
155
+ continue;
156
+ }
157
+ case 2: {
158
+ if (tag !== 16) {
159
+ break;
160
+ }
161
+ message.limit = reader.int32();
162
+ continue;
163
+ }
164
+ }
165
+ if ((tag & 7) === 4 || tag === 0) {
166
+ break;
167
+ }
168
+ const buf = reader.skip(tag & 7);
169
+ const list = message._unknownFields[tag];
170
+ if (list === undefined) {
171
+ message._unknownFields[tag] = [buf];
172
+ }
173
+ else {
174
+ list.push(buf);
175
+ }
176
+ }
177
+ return message;
178
+ },
179
+ fromJSON(object) {
180
+ return {
181
+ cursor: isSet(object.cursor) ? globalThis.String(object.cursor) : "",
182
+ limit: isSet(object.limit) ? globalThis.Number(object.limit) : 0,
183
+ };
184
+ },
185
+ toJSON(message) {
186
+ const obj = {};
187
+ if (message.cursor !== "") {
188
+ obj.cursor = message.cursor;
189
+ }
190
+ if (message.limit !== 0) {
191
+ obj.limit = Math.round(message.limit);
192
+ }
193
+ return obj;
194
+ },
195
+ create(base) {
196
+ return PageRequest.fromPartial(base ?? {});
197
+ },
198
+ fromPartial(object) {
199
+ const message = createBasePageRequest();
200
+ message.cursor = object.cursor ?? "";
201
+ message.limit = object.limit ?? 0;
202
+ return message;
203
+ },
204
+ };
205
+ function createBasePageInfo() {
206
+ return { next_cursor: "", has_more: false, _unknownFields: {} };
207
+ }
208
+ export const PageInfo = {
209
+ encode(message, writer = new BinaryWriter()) {
210
+ if (message.next_cursor !== "") {
211
+ writer.uint32(10).string(message.next_cursor);
212
+ }
213
+ if (message.has_more !== false) {
214
+ writer.uint32(16).bool(message.has_more);
215
+ }
216
+ if (message._unknownFields !== undefined) {
217
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
218
+ const tag = parseInt(key, 10);
219
+ for (const value of values) {
220
+ writer.uint32(tag).raw(value);
221
+ }
222
+ }
223
+ }
224
+ return writer;
225
+ },
226
+ decode(input, length) {
227
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
228
+ const end = length === undefined ? reader.len : reader.pos + length;
229
+ const message = createBasePageInfo();
230
+ while (reader.pos < end) {
231
+ const tag = reader.uint32();
232
+ switch (tag >>> 3) {
233
+ case 1: {
234
+ if (tag !== 10) {
235
+ break;
236
+ }
237
+ message.next_cursor = reader.string();
238
+ continue;
239
+ }
240
+ case 2: {
241
+ if (tag !== 16) {
242
+ break;
243
+ }
244
+ message.has_more = reader.bool();
245
+ continue;
246
+ }
247
+ }
248
+ if ((tag & 7) === 4 || tag === 0) {
249
+ break;
250
+ }
251
+ const buf = reader.skip(tag & 7);
252
+ const list = message._unknownFields[tag];
253
+ if (list === undefined) {
254
+ message._unknownFields[tag] = [buf];
255
+ }
256
+ else {
257
+ list.push(buf);
258
+ }
259
+ }
260
+ return message;
261
+ },
262
+ fromJSON(object) {
263
+ return {
264
+ next_cursor: isSet(object.nextCursor)
265
+ ? globalThis.String(object.nextCursor)
266
+ : isSet(object.next_cursor)
267
+ ? globalThis.String(object.next_cursor)
268
+ : "",
269
+ has_more: isSet(object.hasMore)
270
+ ? globalThis.Boolean(object.hasMore)
271
+ : isSet(object.has_more)
272
+ ? globalThis.Boolean(object.has_more)
273
+ : false,
274
+ };
275
+ },
276
+ toJSON(message) {
277
+ const obj = {};
278
+ if (message.next_cursor !== "") {
279
+ obj.nextCursor = message.next_cursor;
280
+ }
281
+ if (message.has_more !== false) {
282
+ obj.hasMore = message.has_more;
283
+ }
284
+ return obj;
285
+ },
286
+ create(base) {
287
+ return PageInfo.fromPartial(base ?? {});
288
+ },
289
+ fromPartial(object) {
290
+ const message = createBasePageInfo();
291
+ message.next_cursor = object.next_cursor ?? "";
292
+ message.has_more = object.has_more ?? false;
293
+ return message;
294
+ },
295
+ };
296
+ function createBaseOffsetPageRequest() {
297
+ return { offset: 0, limit: 0, _unknownFields: {} };
298
+ }
299
+ export const OffsetPageRequest = {
300
+ encode(message, writer = new BinaryWriter()) {
301
+ if (message.offset !== 0) {
302
+ writer.uint32(8).uint32(message.offset);
303
+ }
304
+ if (message.limit !== 0) {
305
+ writer.uint32(16).uint32(message.limit);
306
+ }
307
+ if (message._unknownFields !== undefined) {
308
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
309
+ const tag = parseInt(key, 10);
310
+ for (const value of values) {
311
+ writer.uint32(tag).raw(value);
312
+ }
313
+ }
314
+ }
315
+ return writer;
316
+ },
317
+ decode(input, length) {
318
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
319
+ const end = length === undefined ? reader.len : reader.pos + length;
320
+ const message = createBaseOffsetPageRequest();
321
+ while (reader.pos < end) {
322
+ const tag = reader.uint32();
323
+ switch (tag >>> 3) {
324
+ case 1: {
325
+ if (tag !== 8) {
326
+ break;
327
+ }
328
+ message.offset = reader.uint32();
329
+ continue;
330
+ }
331
+ case 2: {
332
+ if (tag !== 16) {
333
+ break;
334
+ }
335
+ message.limit = reader.uint32();
336
+ continue;
337
+ }
338
+ }
339
+ if ((tag & 7) === 4 || tag === 0) {
340
+ break;
341
+ }
342
+ const buf = reader.skip(tag & 7);
343
+ const list = message._unknownFields[tag];
344
+ if (list === undefined) {
345
+ message._unknownFields[tag] = [buf];
346
+ }
347
+ else {
348
+ list.push(buf);
349
+ }
350
+ }
351
+ return message;
352
+ },
353
+ fromJSON(object) {
354
+ return {
355
+ offset: isSet(object.offset) ? globalThis.Number(object.offset) : 0,
356
+ limit: isSet(object.limit) ? globalThis.Number(object.limit) : 0,
357
+ };
358
+ },
359
+ toJSON(message) {
360
+ const obj = {};
361
+ if (message.offset !== 0) {
362
+ obj.offset = Math.round(message.offset);
363
+ }
364
+ if (message.limit !== 0) {
365
+ obj.limit = Math.round(message.limit);
366
+ }
367
+ return obj;
368
+ },
369
+ create(base) {
370
+ return OffsetPageRequest.fromPartial(base ?? {});
371
+ },
372
+ fromPartial(object) {
373
+ const message = createBaseOffsetPageRequest();
374
+ message.offset = object.offset ?? 0;
375
+ message.limit = object.limit ?? 0;
376
+ return message;
377
+ },
378
+ };
379
+ function createBaseOffsetPageInfo() {
380
+ return { next_offset: undefined, _unknownFields: {} };
381
+ }
382
+ export const OffsetPageInfo = {
383
+ encode(message, writer = new BinaryWriter()) {
384
+ if (message.next_offset !== undefined) {
385
+ writer.uint32(8).uint32(message.next_offset);
386
+ }
387
+ if (message._unknownFields !== undefined) {
388
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
389
+ const tag = parseInt(key, 10);
390
+ for (const value of values) {
391
+ writer.uint32(tag).raw(value);
392
+ }
393
+ }
394
+ }
395
+ return writer;
396
+ },
397
+ decode(input, length) {
398
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
399
+ const end = length === undefined ? reader.len : reader.pos + length;
400
+ const message = createBaseOffsetPageInfo();
401
+ while (reader.pos < end) {
402
+ const tag = reader.uint32();
403
+ switch (tag >>> 3) {
404
+ case 1: {
405
+ if (tag !== 8) {
406
+ break;
407
+ }
408
+ message.next_offset = reader.uint32();
409
+ continue;
410
+ }
411
+ }
412
+ if ((tag & 7) === 4 || tag === 0) {
413
+ break;
414
+ }
415
+ const buf = reader.skip(tag & 7);
416
+ const list = message._unknownFields[tag];
417
+ if (list === undefined) {
418
+ message._unknownFields[tag] = [buf];
419
+ }
420
+ else {
421
+ list.push(buf);
422
+ }
423
+ }
424
+ return message;
425
+ },
426
+ fromJSON(object) {
427
+ return {
428
+ next_offset: isSet(object.nextOffset)
429
+ ? globalThis.Number(object.nextOffset)
430
+ : isSet(object.next_offset)
431
+ ? globalThis.Number(object.next_offset)
432
+ : undefined,
433
+ };
434
+ },
435
+ toJSON(message) {
436
+ const obj = {};
437
+ if (message.next_offset !== undefined) {
438
+ obj.nextOffset = Math.round(message.next_offset);
439
+ }
440
+ return obj;
441
+ },
442
+ create(base) {
443
+ return OffsetPageInfo.fromPartial(base ?? {});
444
+ },
445
+ fromPartial(object) {
446
+ const message = createBaseOffsetPageInfo();
447
+ message.next_offset = object.next_offset ?? undefined;
448
+ return message;
449
+ },
450
+ };
451
+ function createBaseMoney() {
452
+ return { units: "0", currency: "", _unknownFields: {} };
453
+ }
454
+ export const Money = {
455
+ encode(message, writer = new BinaryWriter()) {
456
+ if (message.units !== "0") {
457
+ writer.uint32(8).int64(message.units);
458
+ }
459
+ if (message.currency !== "") {
460
+ writer.uint32(18).string(message.currency);
461
+ }
462
+ if (message._unknownFields !== undefined) {
463
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
464
+ const tag = parseInt(key, 10);
465
+ for (const value of values) {
466
+ writer.uint32(tag).raw(value);
467
+ }
468
+ }
469
+ }
470
+ return writer;
471
+ },
472
+ decode(input, length) {
473
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
474
+ const end = length === undefined ? reader.len : reader.pos + length;
475
+ const message = createBaseMoney();
476
+ while (reader.pos < end) {
477
+ const tag = reader.uint32();
478
+ switch (tag >>> 3) {
479
+ case 1: {
480
+ if (tag !== 8) {
481
+ break;
482
+ }
483
+ message.units = reader.int64().toString();
484
+ continue;
485
+ }
486
+ case 2: {
487
+ if (tag !== 18) {
488
+ break;
489
+ }
490
+ message.currency = reader.string();
491
+ continue;
492
+ }
493
+ }
494
+ if ((tag & 7) === 4 || tag === 0) {
495
+ break;
496
+ }
497
+ const buf = reader.skip(tag & 7);
498
+ const list = message._unknownFields[tag];
499
+ if (list === undefined) {
500
+ message._unknownFields[tag] = [buf];
501
+ }
502
+ else {
503
+ list.push(buf);
504
+ }
505
+ }
506
+ return message;
507
+ },
508
+ fromJSON(object) {
509
+ return {
510
+ units: isSet(object.units) ? globalThis.String(object.units) : "0",
511
+ currency: isSet(object.currency) ? globalThis.String(object.currency) : "",
512
+ };
513
+ },
514
+ toJSON(message) {
515
+ const obj = {};
516
+ if (message.units !== "0") {
517
+ obj.units = message.units;
518
+ }
519
+ if (message.currency !== "") {
520
+ obj.currency = message.currency;
521
+ }
522
+ return obj;
523
+ },
524
+ create(base) {
525
+ return Money.fromPartial(base ?? {});
526
+ },
527
+ fromPartial(object) {
528
+ const message = createBaseMoney();
529
+ message.units = object.units ?? "0";
530
+ message.currency = object.currency ?? "";
531
+ return message;
532
+ },
533
+ };
534
+ function createBaseUuid() {
535
+ return { value: "", _unknownFields: {} };
536
+ }
537
+ export const Uuid = {
538
+ encode(message, writer = new BinaryWriter()) {
539
+ if (message.value !== "") {
540
+ writer.uint32(10).string(message.value);
541
+ }
542
+ if (message._unknownFields !== undefined) {
543
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
544
+ const tag = parseInt(key, 10);
545
+ for (const value of values) {
546
+ writer.uint32(tag).raw(value);
547
+ }
548
+ }
549
+ }
550
+ return writer;
551
+ },
552
+ decode(input, length) {
553
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
554
+ const end = length === undefined ? reader.len : reader.pos + length;
555
+ const message = createBaseUuid();
556
+ while (reader.pos < end) {
557
+ const tag = reader.uint32();
558
+ switch (tag >>> 3) {
559
+ case 1: {
560
+ if (tag !== 10) {
561
+ break;
562
+ }
563
+ message.value = reader.string();
564
+ continue;
565
+ }
566
+ }
567
+ if ((tag & 7) === 4 || tag === 0) {
568
+ break;
569
+ }
570
+ const buf = reader.skip(tag & 7);
571
+ const list = message._unknownFields[tag];
572
+ if (list === undefined) {
573
+ message._unknownFields[tag] = [buf];
574
+ }
575
+ else {
576
+ list.push(buf);
577
+ }
578
+ }
579
+ return message;
580
+ },
581
+ fromJSON(object) {
582
+ return { value: isSet(object.value) ? globalThis.String(object.value) : "" };
583
+ },
584
+ toJSON(message) {
585
+ const obj = {};
586
+ if (message.value !== "") {
587
+ obj.value = message.value;
588
+ }
589
+ return obj;
590
+ },
591
+ create(base) {
592
+ return Uuid.fromPartial(base ?? {});
593
+ },
594
+ fromPartial(object) {
595
+ const message = createBaseUuid();
596
+ message.value = object.value ?? "";
597
+ return message;
598
+ },
599
+ };
600
+ function createBaseOkResponse() {
601
+ return { error: undefined, _unknownFields: {} };
602
+ }
603
+ export const OkResponse = {
604
+ encode(message, writer = new BinaryWriter()) {
605
+ if (message.error !== undefined) {
606
+ ErrorInfo.encode(message.error, writer.uint32(10).fork()).join();
607
+ }
608
+ if (message._unknownFields !== undefined) {
609
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
610
+ const tag = parseInt(key, 10);
611
+ for (const value of values) {
612
+ writer.uint32(tag).raw(value);
613
+ }
614
+ }
615
+ }
616
+ return writer;
617
+ },
618
+ decode(input, length) {
619
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
620
+ const end = length === undefined ? reader.len : reader.pos + length;
621
+ const message = createBaseOkResponse();
622
+ while (reader.pos < end) {
623
+ const tag = reader.uint32();
624
+ switch (tag >>> 3) {
625
+ case 1: {
626
+ if (tag !== 10) {
627
+ break;
628
+ }
629
+ message.error = ErrorInfo.decode(reader, reader.uint32());
630
+ continue;
631
+ }
632
+ }
633
+ if ((tag & 7) === 4 || tag === 0) {
634
+ break;
635
+ }
636
+ const buf = reader.skip(tag & 7);
637
+ const list = message._unknownFields[tag];
638
+ if (list === undefined) {
639
+ message._unknownFields[tag] = [buf];
640
+ }
641
+ else {
642
+ list.push(buf);
643
+ }
644
+ }
645
+ return message;
646
+ },
647
+ fromJSON(object) {
648
+ return { error: isSet(object.error) ? ErrorInfo.fromJSON(object.error) : undefined };
649
+ },
650
+ toJSON(message) {
651
+ const obj = {};
652
+ if (message.error !== undefined) {
653
+ obj.error = ErrorInfo.toJSON(message.error);
654
+ }
655
+ return obj;
656
+ },
657
+ create(base) {
658
+ return OkResponse.fromPartial(base ?? {});
659
+ },
660
+ fromPartial(object) {
661
+ const message = createBaseOkResponse();
662
+ message.error = (object.error !== undefined && object.error !== null)
663
+ ? ErrorInfo.fromPartial(object.error)
664
+ : undefined;
665
+ return message;
666
+ },
667
+ };
668
+ function createBaseReasonRequest() {
669
+ return { reason: "", _unknownFields: {} };
670
+ }
671
+ export const ReasonRequest = {
672
+ encode(message, writer = new BinaryWriter()) {
673
+ if (message.reason !== "") {
674
+ writer.uint32(10).string(message.reason);
675
+ }
676
+ if (message._unknownFields !== undefined) {
677
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
678
+ const tag = parseInt(key, 10);
679
+ for (const value of values) {
680
+ writer.uint32(tag).raw(value);
681
+ }
682
+ }
683
+ }
684
+ return writer;
685
+ },
686
+ decode(input, length) {
687
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
688
+ const end = length === undefined ? reader.len : reader.pos + length;
689
+ const message = createBaseReasonRequest();
690
+ while (reader.pos < end) {
691
+ const tag = reader.uint32();
692
+ switch (tag >>> 3) {
693
+ case 1: {
694
+ if (tag !== 10) {
695
+ break;
696
+ }
697
+ message.reason = reader.string();
698
+ continue;
699
+ }
700
+ }
701
+ if ((tag & 7) === 4 || tag === 0) {
702
+ break;
703
+ }
704
+ const buf = reader.skip(tag & 7);
705
+ const list = message._unknownFields[tag];
706
+ if (list === undefined) {
707
+ message._unknownFields[tag] = [buf];
708
+ }
709
+ else {
710
+ list.push(buf);
711
+ }
712
+ }
713
+ return message;
714
+ },
715
+ fromJSON(object) {
716
+ return { reason: isSet(object.reason) ? globalThis.String(object.reason) : "" };
717
+ },
718
+ toJSON(message) {
719
+ const obj = {};
720
+ if (message.reason !== "") {
721
+ obj.reason = message.reason;
722
+ }
723
+ return obj;
724
+ },
725
+ create(base) {
726
+ return ReasonRequest.fromPartial(base ?? {});
727
+ },
728
+ fromPartial(object) {
729
+ const message = createBaseReasonRequest();
730
+ message.reason = object.reason ?? "";
731
+ return message;
732
+ },
733
+ };
734
+ function createBaseEncryptedReportPayload() {
735
+ return { id: "", kind: "", iv: "", payload: "", client_ts_unix_ms: "0", _unknownFields: {} };
736
+ }
737
+ export const EncryptedReportPayload = {
738
+ encode(message, writer = new BinaryWriter()) {
739
+ if (message.id !== "") {
740
+ writer.uint32(10).string(message.id);
741
+ }
742
+ if (message.kind !== "") {
743
+ writer.uint32(18).string(message.kind);
744
+ }
745
+ if (message.iv !== "") {
746
+ writer.uint32(26).string(message.iv);
747
+ }
748
+ if (message.payload !== "") {
749
+ writer.uint32(34).string(message.payload);
750
+ }
751
+ if (message.client_ts_unix_ms !== "0") {
752
+ writer.uint32(40).int64(message.client_ts_unix_ms);
753
+ }
754
+ if (message._unknownFields !== undefined) {
755
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
756
+ const tag = parseInt(key, 10);
757
+ for (const value of values) {
758
+ writer.uint32(tag).raw(value);
759
+ }
760
+ }
761
+ }
762
+ return writer;
763
+ },
764
+ decode(input, length) {
765
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
766
+ const end = length === undefined ? reader.len : reader.pos + length;
767
+ const message = createBaseEncryptedReportPayload();
768
+ while (reader.pos < end) {
769
+ const tag = reader.uint32();
770
+ switch (tag >>> 3) {
771
+ case 1: {
772
+ if (tag !== 10) {
773
+ break;
774
+ }
775
+ message.id = reader.string();
776
+ continue;
777
+ }
778
+ case 2: {
779
+ if (tag !== 18) {
780
+ break;
781
+ }
782
+ message.kind = reader.string();
783
+ continue;
784
+ }
785
+ case 3: {
786
+ if (tag !== 26) {
787
+ break;
788
+ }
789
+ message.iv = reader.string();
790
+ continue;
791
+ }
792
+ case 4: {
793
+ if (tag !== 34) {
794
+ break;
795
+ }
796
+ message.payload = reader.string();
797
+ continue;
798
+ }
799
+ case 5: {
800
+ if (tag !== 40) {
801
+ break;
802
+ }
803
+ message.client_ts_unix_ms = reader.int64().toString();
804
+ continue;
805
+ }
806
+ }
807
+ if ((tag & 7) === 4 || tag === 0) {
808
+ break;
809
+ }
810
+ const buf = reader.skip(tag & 7);
811
+ const list = message._unknownFields[tag];
812
+ if (list === undefined) {
813
+ message._unknownFields[tag] = [buf];
814
+ }
815
+ else {
816
+ list.push(buf);
817
+ }
818
+ }
819
+ return message;
820
+ },
821
+ fromJSON(object) {
822
+ return {
823
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
824
+ kind: isSet(object.kind) ? globalThis.String(object.kind) : "",
825
+ iv: isSet(object.iv) ? globalThis.String(object.iv) : "",
826
+ payload: isSet(object.payload) ? globalThis.String(object.payload) : "",
827
+ client_ts_unix_ms: isSet(object.clientTsUnixMs)
828
+ ? globalThis.String(object.clientTsUnixMs)
829
+ : isSet(object.client_ts_unix_ms)
830
+ ? globalThis.String(object.client_ts_unix_ms)
831
+ : "0",
832
+ };
833
+ },
834
+ toJSON(message) {
835
+ const obj = {};
836
+ if (message.id !== "") {
837
+ obj.id = message.id;
838
+ }
839
+ if (message.kind !== "") {
840
+ obj.kind = message.kind;
841
+ }
842
+ if (message.iv !== "") {
843
+ obj.iv = message.iv;
844
+ }
845
+ if (message.payload !== "") {
846
+ obj.payload = message.payload;
847
+ }
848
+ if (message.client_ts_unix_ms !== "0") {
849
+ obj.clientTsUnixMs = message.client_ts_unix_ms;
850
+ }
851
+ return obj;
852
+ },
853
+ create(base) {
854
+ return EncryptedReportPayload.fromPartial(base ?? {});
855
+ },
856
+ fromPartial(object) {
857
+ const message = createBaseEncryptedReportPayload();
858
+ message.id = object.id ?? "";
859
+ message.kind = object.kind ?? "";
860
+ message.iv = object.iv ?? "";
861
+ message.payload = object.payload ?? "";
862
+ message.client_ts_unix_ms = object.client_ts_unix_ms ?? "0";
863
+ return message;
864
+ },
865
+ };
866
+ function createBaseReportAcceptResponse() {
867
+ return { ack: false, accepted_id: "", banned: false, error: undefined, _unknownFields: {} };
868
+ }
869
+ export const ReportAcceptResponse = {
870
+ encode(message, writer = new BinaryWriter()) {
871
+ if (message.ack !== false) {
872
+ writer.uint32(8).bool(message.ack);
873
+ }
874
+ if (message.accepted_id !== "") {
875
+ writer.uint32(18).string(message.accepted_id);
876
+ }
877
+ if (message.banned !== false) {
878
+ writer.uint32(24).bool(message.banned);
879
+ }
880
+ if (message.error !== undefined) {
881
+ ErrorInfo.encode(message.error, writer.uint32(122).fork()).join();
882
+ }
883
+ if (message._unknownFields !== undefined) {
884
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
885
+ const tag = parseInt(key, 10);
886
+ for (const value of values) {
887
+ writer.uint32(tag).raw(value);
888
+ }
889
+ }
890
+ }
891
+ return writer;
892
+ },
893
+ decode(input, length) {
894
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
895
+ const end = length === undefined ? reader.len : reader.pos + length;
896
+ const message = createBaseReportAcceptResponse();
897
+ while (reader.pos < end) {
898
+ const tag = reader.uint32();
899
+ switch (tag >>> 3) {
900
+ case 1: {
901
+ if (tag !== 8) {
902
+ break;
903
+ }
904
+ message.ack = reader.bool();
905
+ continue;
906
+ }
907
+ case 2: {
908
+ if (tag !== 18) {
909
+ break;
910
+ }
911
+ message.accepted_id = reader.string();
912
+ continue;
913
+ }
914
+ case 3: {
915
+ if (tag !== 24) {
916
+ break;
917
+ }
918
+ message.banned = reader.bool();
919
+ continue;
920
+ }
921
+ case 15: {
922
+ if (tag !== 122) {
923
+ break;
924
+ }
925
+ message.error = ErrorInfo.decode(reader, reader.uint32());
926
+ continue;
927
+ }
928
+ }
929
+ if ((tag & 7) === 4 || tag === 0) {
930
+ break;
931
+ }
932
+ const buf = reader.skip(tag & 7);
933
+ const list = message._unknownFields[tag];
934
+ if (list === undefined) {
935
+ message._unknownFields[tag] = [buf];
936
+ }
937
+ else {
938
+ list.push(buf);
939
+ }
940
+ }
941
+ return message;
942
+ },
943
+ fromJSON(object) {
944
+ return {
945
+ ack: isSet(object.ack) ? globalThis.Boolean(object.ack) : false,
946
+ accepted_id: isSet(object.acceptedId)
947
+ ? globalThis.String(object.acceptedId)
948
+ : isSet(object.accepted_id)
949
+ ? globalThis.String(object.accepted_id)
950
+ : "",
951
+ banned: isSet(object.banned) ? globalThis.Boolean(object.banned) : false,
952
+ error: isSet(object.error) ? ErrorInfo.fromJSON(object.error) : undefined,
953
+ };
954
+ },
955
+ toJSON(message) {
956
+ const obj = {};
957
+ if (message.ack !== false) {
958
+ obj.ack = message.ack;
959
+ }
960
+ if (message.accepted_id !== "") {
961
+ obj.acceptedId = message.accepted_id;
962
+ }
963
+ if (message.banned !== false) {
964
+ obj.banned = message.banned;
965
+ }
966
+ if (message.error !== undefined) {
967
+ obj.error = ErrorInfo.toJSON(message.error);
968
+ }
969
+ return obj;
970
+ },
971
+ create(base) {
972
+ return ReportAcceptResponse.fromPartial(base ?? {});
973
+ },
974
+ fromPartial(object) {
975
+ const message = createBaseReportAcceptResponse();
976
+ message.ack = object.ack ?? false;
977
+ message.accepted_id = object.accepted_id ?? "";
978
+ message.banned = object.banned ?? false;
979
+ message.error = (object.error !== undefined && object.error !== null)
980
+ ? ErrorInfo.fromPartial(object.error)
981
+ : undefined;
982
+ return message;
983
+ },
984
+ };
985
+ function createBaseAccountBanStatusResponse() {
986
+ return { banned: false, reason: undefined, error: undefined, _unknownFields: {} };
987
+ }
988
+ export const AccountBanStatusResponse = {
989
+ encode(message, writer = new BinaryWriter()) {
990
+ if (message.banned !== false) {
991
+ writer.uint32(8).bool(message.banned);
992
+ }
993
+ if (message.reason !== undefined) {
994
+ writer.uint32(18).string(message.reason);
995
+ }
996
+ if (message.error !== undefined) {
997
+ ErrorInfo.encode(message.error, writer.uint32(122).fork()).join();
998
+ }
999
+ if (message._unknownFields !== undefined) {
1000
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
1001
+ const tag = parseInt(key, 10);
1002
+ for (const value of values) {
1003
+ writer.uint32(tag).raw(value);
1004
+ }
1005
+ }
1006
+ }
1007
+ return writer;
1008
+ },
1009
+ decode(input, length) {
1010
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1011
+ const end = length === undefined ? reader.len : reader.pos + length;
1012
+ const message = createBaseAccountBanStatusResponse();
1013
+ while (reader.pos < end) {
1014
+ const tag = reader.uint32();
1015
+ switch (tag >>> 3) {
1016
+ case 1: {
1017
+ if (tag !== 8) {
1018
+ break;
1019
+ }
1020
+ message.banned = reader.bool();
1021
+ continue;
1022
+ }
1023
+ case 2: {
1024
+ if (tag !== 18) {
1025
+ break;
1026
+ }
1027
+ message.reason = reader.string();
1028
+ continue;
1029
+ }
1030
+ case 15: {
1031
+ if (tag !== 122) {
1032
+ break;
1033
+ }
1034
+ message.error = ErrorInfo.decode(reader, reader.uint32());
1035
+ continue;
1036
+ }
1037
+ }
1038
+ if ((tag & 7) === 4 || tag === 0) {
1039
+ break;
1040
+ }
1041
+ const buf = reader.skip(tag & 7);
1042
+ const list = message._unknownFields[tag];
1043
+ if (list === undefined) {
1044
+ message._unknownFields[tag] = [buf];
1045
+ }
1046
+ else {
1047
+ list.push(buf);
1048
+ }
1049
+ }
1050
+ return message;
1051
+ },
1052
+ fromJSON(object) {
1053
+ return {
1054
+ banned: isSet(object.banned) ? globalThis.Boolean(object.banned) : false,
1055
+ reason: isSet(object.reason) ? globalThis.String(object.reason) : undefined,
1056
+ error: isSet(object.error) ? ErrorInfo.fromJSON(object.error) : undefined,
1057
+ };
1058
+ },
1059
+ toJSON(message) {
1060
+ const obj = {};
1061
+ if (message.banned !== false) {
1062
+ obj.banned = message.banned;
1063
+ }
1064
+ if (message.reason !== undefined) {
1065
+ obj.reason = message.reason;
1066
+ }
1067
+ if (message.error !== undefined) {
1068
+ obj.error = ErrorInfo.toJSON(message.error);
1069
+ }
1070
+ return obj;
1071
+ },
1072
+ create(base) {
1073
+ return AccountBanStatusResponse.fromPartial(base ?? {});
1074
+ },
1075
+ fromPartial(object) {
1076
+ const message = createBaseAccountBanStatusResponse();
1077
+ message.banned = object.banned ?? false;
1078
+ message.reason = object.reason ?? undefined;
1079
+ message.error = (object.error !== undefined && object.error !== null)
1080
+ ? ErrorInfo.fromPartial(object.error)
1081
+ : undefined;
1082
+ return message;
1083
+ },
1084
+ };
1085
+ function createBaseEmergencyUploadBody() {
1086
+ return { id: "", payload_b64: "", saved_at_unix_ms: "0", reason: "", _unknownFields: {} };
1087
+ }
1088
+ export const EmergencyUploadBody = {
1089
+ encode(message, writer = new BinaryWriter()) {
1090
+ if (message.id !== "") {
1091
+ writer.uint32(10).string(message.id);
1092
+ }
1093
+ if (message.payload_b64 !== "") {
1094
+ writer.uint32(18).string(message.payload_b64);
1095
+ }
1096
+ if (message.saved_at_unix_ms !== "0") {
1097
+ writer.uint32(24).int64(message.saved_at_unix_ms);
1098
+ }
1099
+ if (message.reason !== "") {
1100
+ writer.uint32(34).string(message.reason);
1101
+ }
1102
+ if (message._unknownFields !== undefined) {
1103
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
1104
+ const tag = parseInt(key, 10);
1105
+ for (const value of values) {
1106
+ writer.uint32(tag).raw(value);
1107
+ }
1108
+ }
1109
+ }
1110
+ return writer;
1111
+ },
1112
+ decode(input, length) {
1113
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1114
+ const end = length === undefined ? reader.len : reader.pos + length;
1115
+ const message = createBaseEmergencyUploadBody();
1116
+ while (reader.pos < end) {
1117
+ const tag = reader.uint32();
1118
+ switch (tag >>> 3) {
1119
+ case 1: {
1120
+ if (tag !== 10) {
1121
+ break;
1122
+ }
1123
+ message.id = reader.string();
1124
+ continue;
1125
+ }
1126
+ case 2: {
1127
+ if (tag !== 18) {
1128
+ break;
1129
+ }
1130
+ message.payload_b64 = reader.string();
1131
+ continue;
1132
+ }
1133
+ case 3: {
1134
+ if (tag !== 24) {
1135
+ break;
1136
+ }
1137
+ message.saved_at_unix_ms = reader.int64().toString();
1138
+ continue;
1139
+ }
1140
+ case 4: {
1141
+ if (tag !== 34) {
1142
+ break;
1143
+ }
1144
+ message.reason = reader.string();
1145
+ continue;
1146
+ }
1147
+ }
1148
+ if ((tag & 7) === 4 || tag === 0) {
1149
+ break;
1150
+ }
1151
+ const buf = reader.skip(tag & 7);
1152
+ const list = message._unknownFields[tag];
1153
+ if (list === undefined) {
1154
+ message._unknownFields[tag] = [buf];
1155
+ }
1156
+ else {
1157
+ list.push(buf);
1158
+ }
1159
+ }
1160
+ return message;
1161
+ },
1162
+ fromJSON(object) {
1163
+ return {
1164
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
1165
+ payload_b64: isSet(object.payloadB64)
1166
+ ? globalThis.String(object.payloadB64)
1167
+ : isSet(object.payload_b64)
1168
+ ? globalThis.String(object.payload_b64)
1169
+ : "",
1170
+ saved_at_unix_ms: isSet(object.savedAtUnixMs)
1171
+ ? globalThis.String(object.savedAtUnixMs)
1172
+ : isSet(object.saved_at_unix_ms)
1173
+ ? globalThis.String(object.saved_at_unix_ms)
1174
+ : "0",
1175
+ reason: isSet(object.reason) ? globalThis.String(object.reason) : "",
1176
+ };
1177
+ },
1178
+ toJSON(message) {
1179
+ const obj = {};
1180
+ if (message.id !== "") {
1181
+ obj.id = message.id;
1182
+ }
1183
+ if (message.payload_b64 !== "") {
1184
+ obj.payloadB64 = message.payload_b64;
1185
+ }
1186
+ if (message.saved_at_unix_ms !== "0") {
1187
+ obj.savedAtUnixMs = message.saved_at_unix_ms;
1188
+ }
1189
+ if (message.reason !== "") {
1190
+ obj.reason = message.reason;
1191
+ }
1192
+ return obj;
1193
+ },
1194
+ create(base) {
1195
+ return EmergencyUploadBody.fromPartial(base ?? {});
1196
+ },
1197
+ fromPartial(object) {
1198
+ const message = createBaseEmergencyUploadBody();
1199
+ message.id = object.id ?? "";
1200
+ message.payload_b64 = object.payload_b64 ?? "";
1201
+ message.saved_at_unix_ms = object.saved_at_unix_ms ?? "0";
1202
+ message.reason = object.reason ?? "";
1203
+ return message;
1204
+ },
1205
+ };
1206
+ function createBaseAdminUserContext() {
1207
+ return { user_id: "", email: undefined, email_verified: false, admin_roles: [], _unknownFields: {} };
1208
+ }
1209
+ export const AdminUserContext = {
1210
+ encode(message, writer = new BinaryWriter()) {
1211
+ if (message.user_id !== "") {
1212
+ writer.uint32(10).string(message.user_id);
1213
+ }
1214
+ if (message.email !== undefined) {
1215
+ writer.uint32(18).string(message.email);
1216
+ }
1217
+ if (message.email_verified !== false) {
1218
+ writer.uint32(24).bool(message.email_verified);
1219
+ }
1220
+ for (const v of message.admin_roles) {
1221
+ writer.uint32(34).string(v);
1222
+ }
1223
+ if (message._unknownFields !== undefined) {
1224
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
1225
+ const tag = parseInt(key, 10);
1226
+ for (const value of values) {
1227
+ writer.uint32(tag).raw(value);
1228
+ }
1229
+ }
1230
+ }
1231
+ return writer;
1232
+ },
1233
+ decode(input, length) {
1234
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1235
+ const end = length === undefined ? reader.len : reader.pos + length;
1236
+ const message = createBaseAdminUserContext();
1237
+ while (reader.pos < end) {
1238
+ const tag = reader.uint32();
1239
+ switch (tag >>> 3) {
1240
+ case 1: {
1241
+ if (tag !== 10) {
1242
+ break;
1243
+ }
1244
+ message.user_id = reader.string();
1245
+ continue;
1246
+ }
1247
+ case 2: {
1248
+ if (tag !== 18) {
1249
+ break;
1250
+ }
1251
+ message.email = reader.string();
1252
+ continue;
1253
+ }
1254
+ case 3: {
1255
+ if (tag !== 24) {
1256
+ break;
1257
+ }
1258
+ message.email_verified = reader.bool();
1259
+ continue;
1260
+ }
1261
+ case 4: {
1262
+ if (tag !== 34) {
1263
+ break;
1264
+ }
1265
+ message.admin_roles.push(reader.string());
1266
+ continue;
1267
+ }
1268
+ }
1269
+ if ((tag & 7) === 4 || tag === 0) {
1270
+ break;
1271
+ }
1272
+ const buf = reader.skip(tag & 7);
1273
+ const list = message._unknownFields[tag];
1274
+ if (list === undefined) {
1275
+ message._unknownFields[tag] = [buf];
1276
+ }
1277
+ else {
1278
+ list.push(buf);
1279
+ }
1280
+ }
1281
+ return message;
1282
+ },
1283
+ fromJSON(object) {
1284
+ return {
1285
+ user_id: isSet(object.userId)
1286
+ ? globalThis.String(object.userId)
1287
+ : isSet(object.user_id)
1288
+ ? globalThis.String(object.user_id)
1289
+ : "",
1290
+ email: isSet(object.email) ? globalThis.String(object.email) : undefined,
1291
+ email_verified: isSet(object.emailVerified)
1292
+ ? globalThis.Boolean(object.emailVerified)
1293
+ : isSet(object.email_verified)
1294
+ ? globalThis.Boolean(object.email_verified)
1295
+ : false,
1296
+ admin_roles: globalThis.Array.isArray(object?.adminRoles)
1297
+ ? object.adminRoles.map((e) => globalThis.String(e))
1298
+ : globalThis.Array.isArray(object?.admin_roles)
1299
+ ? object.admin_roles.map((e) => globalThis.String(e))
1300
+ : [],
1301
+ };
1302
+ },
1303
+ toJSON(message) {
1304
+ const obj = {};
1305
+ if (message.user_id !== "") {
1306
+ obj.userId = message.user_id;
1307
+ }
1308
+ if (message.email !== undefined) {
1309
+ obj.email = message.email;
1310
+ }
1311
+ if (message.email_verified !== false) {
1312
+ obj.emailVerified = message.email_verified;
1313
+ }
1314
+ if (message.admin_roles?.length) {
1315
+ obj.adminRoles = message.admin_roles;
1316
+ }
1317
+ return obj;
1318
+ },
1319
+ create(base) {
1320
+ return AdminUserContext.fromPartial(base ?? {});
1321
+ },
1322
+ fromPartial(object) {
1323
+ const message = createBaseAdminUserContext();
1324
+ message.user_id = object.user_id ?? "";
1325
+ message.email = object.email ?? undefined;
1326
+ message.email_verified = object.email_verified ?? false;
1327
+ message.admin_roles = object.admin_roles?.map((e) => e) || [];
1328
+ return message;
1329
+ },
1330
+ };
1331
+ function bytesFromBase64(b64) {
1332
+ if (globalThis.Buffer) {
1333
+ return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
1334
+ }
1335
+ else {
1336
+ const bin = globalThis.atob(b64);
1337
+ const arr = new Uint8Array(bin.length);
1338
+ for (let i = 0; i < bin.length; ++i) {
1339
+ arr[i] = bin.charCodeAt(i);
1340
+ }
1341
+ return arr;
1342
+ }
1343
+ }
1344
+ function base64FromBytes(arr) {
1345
+ if (globalThis.Buffer) {
1346
+ return globalThis.Buffer.from(arr).toString("base64");
1347
+ }
1348
+ else {
1349
+ const bin = [];
1350
+ arr.forEach((byte) => {
1351
+ bin.push(globalThis.String.fromCharCode(byte));
1352
+ });
1353
+ return globalThis.btoa(bin.join(""));
1354
+ }
1355
+ }
1356
+ function isSet(value) {
1357
+ return value !== null && value !== undefined;
1358
+ }