@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,61 @@
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ import { ErrorInfo } from "../common.js";
3
+ /** GET /v1/moderation/dequeue */
4
+ export interface DequeueResponse {
5
+ empty: boolean;
6
+ ticket_id: string;
7
+ scenario_id: string;
8
+ r2_key?: string | undefined;
9
+ sha256?: string | undefined;
10
+ manifest_json: Uint8Array;
11
+ error?: ErrorInfo | undefined;
12
+ _unknownFields?: {
13
+ [key: number]: Uint8Array[];
14
+ } | undefined;
15
+ }
16
+ /** POST /v1/moderation/result */
17
+ export interface SubmitResultRequest {
18
+ ticket_id: string;
19
+ verdict: string;
20
+ violations: string[];
21
+ reviewer_notes?: string | undefined;
22
+ official_risk_tags: string[];
23
+ input_tokens?: string | undefined;
24
+ output_tokens?: string | undefined;
25
+ model_id?: string | undefined;
26
+ cache_hit_tokens?: string | undefined;
27
+ _unknownFields?: {
28
+ [key: number]: Uint8Array[];
29
+ } | undefined;
30
+ }
31
+ export interface SubmitResultResponse {
32
+ ok: boolean;
33
+ ticket_id: string;
34
+ status: string;
35
+ error?: ErrorInfo | undefined;
36
+ _unknownFields?: {
37
+ [key: number]: Uint8Array[];
38
+ } | undefined;
39
+ }
40
+ export declare const DequeueResponse: MessageFns<DequeueResponse>;
41
+ export declare const SubmitResultRequest: MessageFns<SubmitResultRequest>;
42
+ export declare const SubmitResultResponse: MessageFns<SubmitResultResponse>;
43
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
44
+ type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
45
+ [K in keyof T]?: DeepPartial<T[K]>;
46
+ } : Partial<T>;
47
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
48
+ type Exact<P, I extends P> = P extends Builtin ? P : P & {
49
+ [K in keyof P]: Exact<P[K], I[K]>;
50
+ } & {
51
+ [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
52
+ };
53
+ interface MessageFns<T> {
54
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
55
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
56
+ fromJSON(object: any): T;
57
+ toJSON(message: T): unknown;
58
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
59
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
60
+ }
61
+ export {};
@@ -0,0 +1,569 @@
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/moderation.proto
6
+ /* eslint-disable */
7
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
8
+ import { ErrorInfo } from "../common.js";
9
+ function createBaseDequeueResponse() {
10
+ return {
11
+ empty: false,
12
+ ticket_id: "",
13
+ scenario_id: "",
14
+ r2_key: undefined,
15
+ sha256: undefined,
16
+ manifest_json: new Uint8Array(0),
17
+ error: undefined,
18
+ _unknownFields: {},
19
+ };
20
+ }
21
+ export const DequeueResponse = {
22
+ encode(message, writer = new BinaryWriter()) {
23
+ if (message.empty !== false) {
24
+ writer.uint32(8).bool(message.empty);
25
+ }
26
+ if (message.ticket_id !== "") {
27
+ writer.uint32(18).string(message.ticket_id);
28
+ }
29
+ if (message.scenario_id !== "") {
30
+ writer.uint32(26).string(message.scenario_id);
31
+ }
32
+ if (message.r2_key !== undefined) {
33
+ writer.uint32(34).string(message.r2_key);
34
+ }
35
+ if (message.sha256 !== undefined) {
36
+ writer.uint32(42).string(message.sha256);
37
+ }
38
+ if (message.manifest_json.length !== 0) {
39
+ writer.uint32(50).bytes(message.manifest_json);
40
+ }
41
+ if (message.error !== undefined) {
42
+ ErrorInfo.encode(message.error, writer.uint32(122).fork()).join();
43
+ }
44
+ if (message._unknownFields !== undefined) {
45
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
46
+ const tag = parseInt(key, 10);
47
+ for (const value of values) {
48
+ writer.uint32(tag).raw(value);
49
+ }
50
+ }
51
+ }
52
+ return writer;
53
+ },
54
+ decode(input, length) {
55
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
56
+ const end = length === undefined ? reader.len : reader.pos + length;
57
+ const message = createBaseDequeueResponse();
58
+ while (reader.pos < end) {
59
+ const tag = reader.uint32();
60
+ switch (tag >>> 3) {
61
+ case 1: {
62
+ if (tag !== 8) {
63
+ break;
64
+ }
65
+ message.empty = reader.bool();
66
+ continue;
67
+ }
68
+ case 2: {
69
+ if (tag !== 18) {
70
+ break;
71
+ }
72
+ message.ticket_id = reader.string();
73
+ continue;
74
+ }
75
+ case 3: {
76
+ if (tag !== 26) {
77
+ break;
78
+ }
79
+ message.scenario_id = reader.string();
80
+ continue;
81
+ }
82
+ case 4: {
83
+ if (tag !== 34) {
84
+ break;
85
+ }
86
+ message.r2_key = reader.string();
87
+ continue;
88
+ }
89
+ case 5: {
90
+ if (tag !== 42) {
91
+ break;
92
+ }
93
+ message.sha256 = reader.string();
94
+ continue;
95
+ }
96
+ case 6: {
97
+ if (tag !== 50) {
98
+ break;
99
+ }
100
+ message.manifest_json = reader.bytes();
101
+ continue;
102
+ }
103
+ case 15: {
104
+ if (tag !== 122) {
105
+ break;
106
+ }
107
+ message.error = ErrorInfo.decode(reader, reader.uint32());
108
+ continue;
109
+ }
110
+ }
111
+ if ((tag & 7) === 4 || tag === 0) {
112
+ break;
113
+ }
114
+ const buf = reader.skip(tag & 7);
115
+ const list = message._unknownFields[tag];
116
+ if (list === undefined) {
117
+ message._unknownFields[tag] = [buf];
118
+ }
119
+ else {
120
+ list.push(buf);
121
+ }
122
+ }
123
+ return message;
124
+ },
125
+ fromJSON(object) {
126
+ return {
127
+ empty: isSet(object.empty) ? globalThis.Boolean(object.empty) : false,
128
+ ticket_id: isSet(object.ticketId)
129
+ ? globalThis.String(object.ticketId)
130
+ : isSet(object.ticket_id)
131
+ ? globalThis.String(object.ticket_id)
132
+ : "",
133
+ scenario_id: isSet(object.scenarioId)
134
+ ? globalThis.String(object.scenarioId)
135
+ : isSet(object.scenario_id)
136
+ ? globalThis.String(object.scenario_id)
137
+ : "",
138
+ r2_key: isSet(object.r2Key)
139
+ ? globalThis.String(object.r2Key)
140
+ : isSet(object.r2_key)
141
+ ? globalThis.String(object.r2_key)
142
+ : undefined,
143
+ sha256: isSet(object.sha256) ? globalThis.String(object.sha256) : undefined,
144
+ manifest_json: isSet(object.manifestJson)
145
+ ? bytesFromBase64(object.manifestJson)
146
+ : isSet(object.manifest_json)
147
+ ? bytesFromBase64(object.manifest_json)
148
+ : new Uint8Array(0),
149
+ error: isSet(object.error) ? ErrorInfo.fromJSON(object.error) : undefined,
150
+ };
151
+ },
152
+ toJSON(message) {
153
+ const obj = {};
154
+ if (message.empty !== false) {
155
+ obj.empty = message.empty;
156
+ }
157
+ if (message.ticket_id !== "") {
158
+ obj.ticketId = message.ticket_id;
159
+ }
160
+ if (message.scenario_id !== "") {
161
+ obj.scenarioId = message.scenario_id;
162
+ }
163
+ if (message.r2_key !== undefined) {
164
+ obj.r2Key = message.r2_key;
165
+ }
166
+ if (message.sha256 !== undefined) {
167
+ obj.sha256 = message.sha256;
168
+ }
169
+ if (message.manifest_json.length !== 0) {
170
+ obj.manifestJson = base64FromBytes(message.manifest_json);
171
+ }
172
+ if (message.error !== undefined) {
173
+ obj.error = ErrorInfo.toJSON(message.error);
174
+ }
175
+ return obj;
176
+ },
177
+ create(base) {
178
+ return DequeueResponse.fromPartial(base ?? {});
179
+ },
180
+ fromPartial(object) {
181
+ const message = createBaseDequeueResponse();
182
+ message.empty = object.empty ?? false;
183
+ message.ticket_id = object.ticket_id ?? "";
184
+ message.scenario_id = object.scenario_id ?? "";
185
+ message.r2_key = object.r2_key ?? undefined;
186
+ message.sha256 = object.sha256 ?? undefined;
187
+ message.manifest_json = object.manifest_json ?? new Uint8Array(0);
188
+ message.error = (object.error !== undefined && object.error !== null)
189
+ ? ErrorInfo.fromPartial(object.error)
190
+ : undefined;
191
+ return message;
192
+ },
193
+ };
194
+ function createBaseSubmitResultRequest() {
195
+ return {
196
+ ticket_id: "",
197
+ verdict: "",
198
+ violations: [],
199
+ reviewer_notes: undefined,
200
+ official_risk_tags: [],
201
+ input_tokens: undefined,
202
+ output_tokens: undefined,
203
+ model_id: undefined,
204
+ cache_hit_tokens: undefined,
205
+ _unknownFields: {},
206
+ };
207
+ }
208
+ export const SubmitResultRequest = {
209
+ encode(message, writer = new BinaryWriter()) {
210
+ if (message.ticket_id !== "") {
211
+ writer.uint32(10).string(message.ticket_id);
212
+ }
213
+ if (message.verdict !== "") {
214
+ writer.uint32(18).string(message.verdict);
215
+ }
216
+ for (const v of message.violations) {
217
+ writer.uint32(26).string(v);
218
+ }
219
+ if (message.reviewer_notes !== undefined) {
220
+ writer.uint32(34).string(message.reviewer_notes);
221
+ }
222
+ for (const v of message.official_risk_tags) {
223
+ writer.uint32(42).string(v);
224
+ }
225
+ if (message.input_tokens !== undefined) {
226
+ writer.uint32(48).int64(message.input_tokens);
227
+ }
228
+ if (message.output_tokens !== undefined) {
229
+ writer.uint32(56).int64(message.output_tokens);
230
+ }
231
+ if (message.model_id !== undefined) {
232
+ writer.uint32(66).string(message.model_id);
233
+ }
234
+ if (message.cache_hit_tokens !== undefined) {
235
+ writer.uint32(72).int64(message.cache_hit_tokens);
236
+ }
237
+ if (message._unknownFields !== undefined) {
238
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
239
+ const tag = parseInt(key, 10);
240
+ for (const value of values) {
241
+ writer.uint32(tag).raw(value);
242
+ }
243
+ }
244
+ }
245
+ return writer;
246
+ },
247
+ decode(input, length) {
248
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
249
+ const end = length === undefined ? reader.len : reader.pos + length;
250
+ const message = createBaseSubmitResultRequest();
251
+ while (reader.pos < end) {
252
+ const tag = reader.uint32();
253
+ switch (tag >>> 3) {
254
+ case 1: {
255
+ if (tag !== 10) {
256
+ break;
257
+ }
258
+ message.ticket_id = reader.string();
259
+ continue;
260
+ }
261
+ case 2: {
262
+ if (tag !== 18) {
263
+ break;
264
+ }
265
+ message.verdict = reader.string();
266
+ continue;
267
+ }
268
+ case 3: {
269
+ if (tag !== 26) {
270
+ break;
271
+ }
272
+ message.violations.push(reader.string());
273
+ continue;
274
+ }
275
+ case 4: {
276
+ if (tag !== 34) {
277
+ break;
278
+ }
279
+ message.reviewer_notes = reader.string();
280
+ continue;
281
+ }
282
+ case 5: {
283
+ if (tag !== 42) {
284
+ break;
285
+ }
286
+ message.official_risk_tags.push(reader.string());
287
+ continue;
288
+ }
289
+ case 6: {
290
+ if (tag !== 48) {
291
+ break;
292
+ }
293
+ message.input_tokens = reader.int64().toString();
294
+ continue;
295
+ }
296
+ case 7: {
297
+ if (tag !== 56) {
298
+ break;
299
+ }
300
+ message.output_tokens = reader.int64().toString();
301
+ continue;
302
+ }
303
+ case 8: {
304
+ if (tag !== 66) {
305
+ break;
306
+ }
307
+ message.model_id = reader.string();
308
+ continue;
309
+ }
310
+ case 9: {
311
+ if (tag !== 72) {
312
+ break;
313
+ }
314
+ message.cache_hit_tokens = reader.int64().toString();
315
+ continue;
316
+ }
317
+ }
318
+ if ((tag & 7) === 4 || tag === 0) {
319
+ break;
320
+ }
321
+ const buf = reader.skip(tag & 7);
322
+ const list = message._unknownFields[tag];
323
+ if (list === undefined) {
324
+ message._unknownFields[tag] = [buf];
325
+ }
326
+ else {
327
+ list.push(buf);
328
+ }
329
+ }
330
+ return message;
331
+ },
332
+ fromJSON(object) {
333
+ return {
334
+ ticket_id: isSet(object.ticketId)
335
+ ? globalThis.String(object.ticketId)
336
+ : isSet(object.ticket_id)
337
+ ? globalThis.String(object.ticket_id)
338
+ : "",
339
+ verdict: isSet(object.verdict) ? globalThis.String(object.verdict) : "",
340
+ violations: globalThis.Array.isArray(object?.violations)
341
+ ? object.violations.map((e) => globalThis.String(e))
342
+ : [],
343
+ reviewer_notes: isSet(object.reviewerNotes)
344
+ ? globalThis.String(object.reviewerNotes)
345
+ : isSet(object.reviewer_notes)
346
+ ? globalThis.String(object.reviewer_notes)
347
+ : undefined,
348
+ official_risk_tags: globalThis.Array.isArray(object?.officialRiskTags)
349
+ ? object.officialRiskTags.map((e) => globalThis.String(e))
350
+ : globalThis.Array.isArray(object?.official_risk_tags)
351
+ ? object.official_risk_tags.map((e) => globalThis.String(e))
352
+ : [],
353
+ input_tokens: isSet(object.inputTokens)
354
+ ? globalThis.String(object.inputTokens)
355
+ : isSet(object.input_tokens)
356
+ ? globalThis.String(object.input_tokens)
357
+ : undefined,
358
+ output_tokens: isSet(object.outputTokens)
359
+ ? globalThis.String(object.outputTokens)
360
+ : isSet(object.output_tokens)
361
+ ? globalThis.String(object.output_tokens)
362
+ : undefined,
363
+ model_id: isSet(object.modelId)
364
+ ? globalThis.String(object.modelId)
365
+ : isSet(object.model_id)
366
+ ? globalThis.String(object.model_id)
367
+ : undefined,
368
+ cache_hit_tokens: isSet(object.cacheHitTokens)
369
+ ? globalThis.String(object.cacheHitTokens)
370
+ : isSet(object.cache_hit_tokens)
371
+ ? globalThis.String(object.cache_hit_tokens)
372
+ : undefined,
373
+ };
374
+ },
375
+ toJSON(message) {
376
+ const obj = {};
377
+ if (message.ticket_id !== "") {
378
+ obj.ticketId = message.ticket_id;
379
+ }
380
+ if (message.verdict !== "") {
381
+ obj.verdict = message.verdict;
382
+ }
383
+ if (message.violations?.length) {
384
+ obj.violations = message.violations;
385
+ }
386
+ if (message.reviewer_notes !== undefined) {
387
+ obj.reviewerNotes = message.reviewer_notes;
388
+ }
389
+ if (message.official_risk_tags?.length) {
390
+ obj.officialRiskTags = message.official_risk_tags;
391
+ }
392
+ if (message.input_tokens !== undefined) {
393
+ obj.inputTokens = message.input_tokens;
394
+ }
395
+ if (message.output_tokens !== undefined) {
396
+ obj.outputTokens = message.output_tokens;
397
+ }
398
+ if (message.model_id !== undefined) {
399
+ obj.modelId = message.model_id;
400
+ }
401
+ if (message.cache_hit_tokens !== undefined) {
402
+ obj.cacheHitTokens = message.cache_hit_tokens;
403
+ }
404
+ return obj;
405
+ },
406
+ create(base) {
407
+ return SubmitResultRequest.fromPartial(base ?? {});
408
+ },
409
+ fromPartial(object) {
410
+ const message = createBaseSubmitResultRequest();
411
+ message.ticket_id = object.ticket_id ?? "";
412
+ message.verdict = object.verdict ?? "";
413
+ message.violations = object.violations?.map((e) => e) || [];
414
+ message.reviewer_notes = object.reviewer_notes ?? undefined;
415
+ message.official_risk_tags = object.official_risk_tags?.map((e) => e) || [];
416
+ message.input_tokens = object.input_tokens ?? undefined;
417
+ message.output_tokens = object.output_tokens ?? undefined;
418
+ message.model_id = object.model_id ?? undefined;
419
+ message.cache_hit_tokens = object.cache_hit_tokens ?? undefined;
420
+ return message;
421
+ },
422
+ };
423
+ function createBaseSubmitResultResponse() {
424
+ return { ok: false, ticket_id: "", status: "", error: undefined, _unknownFields: {} };
425
+ }
426
+ export const SubmitResultResponse = {
427
+ encode(message, writer = new BinaryWriter()) {
428
+ if (message.ok !== false) {
429
+ writer.uint32(8).bool(message.ok);
430
+ }
431
+ if (message.ticket_id !== "") {
432
+ writer.uint32(18).string(message.ticket_id);
433
+ }
434
+ if (message.status !== "") {
435
+ writer.uint32(26).string(message.status);
436
+ }
437
+ if (message.error !== undefined) {
438
+ ErrorInfo.encode(message.error, writer.uint32(122).fork()).join();
439
+ }
440
+ if (message._unknownFields !== undefined) {
441
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
442
+ const tag = parseInt(key, 10);
443
+ for (const value of values) {
444
+ writer.uint32(tag).raw(value);
445
+ }
446
+ }
447
+ }
448
+ return writer;
449
+ },
450
+ decode(input, length) {
451
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
452
+ const end = length === undefined ? reader.len : reader.pos + length;
453
+ const message = createBaseSubmitResultResponse();
454
+ while (reader.pos < end) {
455
+ const tag = reader.uint32();
456
+ switch (tag >>> 3) {
457
+ case 1: {
458
+ if (tag !== 8) {
459
+ break;
460
+ }
461
+ message.ok = reader.bool();
462
+ continue;
463
+ }
464
+ case 2: {
465
+ if (tag !== 18) {
466
+ break;
467
+ }
468
+ message.ticket_id = reader.string();
469
+ continue;
470
+ }
471
+ case 3: {
472
+ if (tag !== 26) {
473
+ break;
474
+ }
475
+ message.status = reader.string();
476
+ continue;
477
+ }
478
+ case 15: {
479
+ if (tag !== 122) {
480
+ break;
481
+ }
482
+ message.error = ErrorInfo.decode(reader, reader.uint32());
483
+ continue;
484
+ }
485
+ }
486
+ if ((tag & 7) === 4 || tag === 0) {
487
+ break;
488
+ }
489
+ const buf = reader.skip(tag & 7);
490
+ const list = message._unknownFields[tag];
491
+ if (list === undefined) {
492
+ message._unknownFields[tag] = [buf];
493
+ }
494
+ else {
495
+ list.push(buf);
496
+ }
497
+ }
498
+ return message;
499
+ },
500
+ fromJSON(object) {
501
+ return {
502
+ ok: isSet(object.ok) ? globalThis.Boolean(object.ok) : false,
503
+ ticket_id: isSet(object.ticketId)
504
+ ? globalThis.String(object.ticketId)
505
+ : isSet(object.ticket_id)
506
+ ? globalThis.String(object.ticket_id)
507
+ : "",
508
+ status: isSet(object.status) ? globalThis.String(object.status) : "",
509
+ error: isSet(object.error) ? ErrorInfo.fromJSON(object.error) : undefined,
510
+ };
511
+ },
512
+ toJSON(message) {
513
+ const obj = {};
514
+ if (message.ok !== false) {
515
+ obj.ok = message.ok;
516
+ }
517
+ if (message.ticket_id !== "") {
518
+ obj.ticketId = message.ticket_id;
519
+ }
520
+ if (message.status !== "") {
521
+ obj.status = message.status;
522
+ }
523
+ if (message.error !== undefined) {
524
+ obj.error = ErrorInfo.toJSON(message.error);
525
+ }
526
+ return obj;
527
+ },
528
+ create(base) {
529
+ return SubmitResultResponse.fromPartial(base ?? {});
530
+ },
531
+ fromPartial(object) {
532
+ const message = createBaseSubmitResultResponse();
533
+ message.ok = object.ok ?? false;
534
+ message.ticket_id = object.ticket_id ?? "";
535
+ message.status = object.status ?? "";
536
+ message.error = (object.error !== undefined && object.error !== null)
537
+ ? ErrorInfo.fromPartial(object.error)
538
+ : undefined;
539
+ return message;
540
+ },
541
+ };
542
+ function bytesFromBase64(b64) {
543
+ if (globalThis.Buffer) {
544
+ return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
545
+ }
546
+ else {
547
+ const bin = globalThis.atob(b64);
548
+ const arr = new Uint8Array(bin.length);
549
+ for (let i = 0; i < bin.length; ++i) {
550
+ arr[i] = bin.charCodeAt(i);
551
+ }
552
+ return arr;
553
+ }
554
+ }
555
+ function base64FromBytes(arr) {
556
+ if (globalThis.Buffer) {
557
+ return globalThis.Buffer.from(arr).toString("base64");
558
+ }
559
+ else {
560
+ const bin = [];
561
+ arr.forEach((byte) => {
562
+ bin.push(globalThis.String.fromCharCode(byte));
563
+ });
564
+ return globalThis.btoa(bin.join(""));
565
+ }
566
+ }
567
+ function isSet(value) {
568
+ return value !== null && value !== undefined;
569
+ }