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