mezon-js-protobuf 1.7.31 → 1.7.32
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.
- package/api/api.ts +39739 -39739
- package/dist/mezon-js-protobuf/rtapi/realtime.d.ts +229 -155
- package/dist/mezon-js-protobuf.cjs.js +114 -2
- package/dist/mezon-js-protobuf.esm.mjs +114 -2
- package/google/protobuf/struct.ts +554 -554
- package/google/protobuf/timestamp.ts +223 -223
- package/google/protobuf/wrappers.ts +670 -670
- package/package.json +1 -1
- package/rtapi/realtime.ts +12577 -12432
|
@@ -1,554 +1,554 @@
|
|
|
1
|
-
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
-
// versions:
|
|
3
|
-
// protoc-gen-ts_proto v1.181.2
|
|
4
|
-
// protoc
|
|
5
|
-
// source: google/protobuf/struct.proto
|
|
6
|
-
|
|
7
|
-
/* eslint-disable */
|
|
8
|
-
import _m0 from "protobufjs/minimal";
|
|
9
|
-
|
|
10
|
-
export const protobufPackage = "google.protobuf";
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* `NullValue` is a singleton enumeration to represent the null value for the
|
|
14
|
-
* `Value` type union.
|
|
15
|
-
*
|
|
16
|
-
* The JSON representation for `NullValue` is JSON `null`.
|
|
17
|
-
*/
|
|
18
|
-
export enum NullValue {
|
|
19
|
-
/** NULL_VALUE - Null value. */
|
|
20
|
-
NULL_VALUE = 0,
|
|
21
|
-
UNRECOGNIZED = -1,
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export function nullValueFromJSON(object: any): NullValue {
|
|
25
|
-
switch (object) {
|
|
26
|
-
case 0:
|
|
27
|
-
case "NULL_VALUE":
|
|
28
|
-
return NullValue.NULL_VALUE;
|
|
29
|
-
case -1:
|
|
30
|
-
case "UNRECOGNIZED":
|
|
31
|
-
default:
|
|
32
|
-
return NullValue.UNRECOGNIZED;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export function nullValueToJSON(object: NullValue): string {
|
|
37
|
-
switch (object) {
|
|
38
|
-
case NullValue.NULL_VALUE:
|
|
39
|
-
return "NULL_VALUE";
|
|
40
|
-
case NullValue.UNRECOGNIZED:
|
|
41
|
-
default:
|
|
42
|
-
return "UNRECOGNIZED";
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* `Struct` represents a structured data value, consisting of fields
|
|
48
|
-
* which map to dynamically typed values. In some languages, `Struct`
|
|
49
|
-
* might be supported by a native representation. For example, in
|
|
50
|
-
* scripting languages like JS a struct is represented as an
|
|
51
|
-
* object. The details of that representation are described together
|
|
52
|
-
* with the proto support for the language.
|
|
53
|
-
*
|
|
54
|
-
* The JSON representation for `Struct` is JSON object.
|
|
55
|
-
*/
|
|
56
|
-
export interface Struct {
|
|
57
|
-
/** Unordered map of dynamically typed values. */
|
|
58
|
-
fields: { [key: string]: any | undefined };
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export interface Struct_FieldsEntry {
|
|
62
|
-
key: string;
|
|
63
|
-
value: any | undefined;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* `Value` represents a dynamically typed value which can be either
|
|
68
|
-
* null, a number, a string, a boolean, a recursive struct value, or a
|
|
69
|
-
* list of values. A producer of value is expected to set one of these
|
|
70
|
-
* variants. Absence of any variant indicates an error.
|
|
71
|
-
*
|
|
72
|
-
* The JSON representation for `Value` is JSON value.
|
|
73
|
-
*/
|
|
74
|
-
export interface Value {
|
|
75
|
-
/** Represents a null value. */
|
|
76
|
-
null_value?:
|
|
77
|
-
| NullValue
|
|
78
|
-
| undefined;
|
|
79
|
-
/** Represents a double value. */
|
|
80
|
-
number_value?:
|
|
81
|
-
| number
|
|
82
|
-
| undefined;
|
|
83
|
-
/** Represents a string value. */
|
|
84
|
-
string_value?:
|
|
85
|
-
| string
|
|
86
|
-
| undefined;
|
|
87
|
-
/** Represents a boolean value. */
|
|
88
|
-
bool_value?:
|
|
89
|
-
| boolean
|
|
90
|
-
| undefined;
|
|
91
|
-
/** Represents a structured value. */
|
|
92
|
-
struct_value?:
|
|
93
|
-
| { [key: string]: any }
|
|
94
|
-
| undefined;
|
|
95
|
-
/** Represents a repeated `Value`. */
|
|
96
|
-
list_value?: Array<any> | undefined;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* `ListValue` is a wrapper around a repeated field of values.
|
|
101
|
-
*
|
|
102
|
-
* The JSON representation for `ListValue` is JSON array.
|
|
103
|
-
*/
|
|
104
|
-
export interface ListValue {
|
|
105
|
-
/** Repeated field of dynamically typed values. */
|
|
106
|
-
values: any[];
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
function createBaseStruct(): Struct {
|
|
110
|
-
return { fields: {} };
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export const Struct = {
|
|
114
|
-
encode(message: Struct, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
115
|
-
Object.entries(message.fields).forEach(([key, value]) => {
|
|
116
|
-
if (value !== undefined) {
|
|
117
|
-
Struct_FieldsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).ldelim();
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
return writer;
|
|
121
|
-
},
|
|
122
|
-
|
|
123
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): Struct {
|
|
124
|
-
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
125
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
126
|
-
const message = createBaseStruct();
|
|
127
|
-
while (reader.pos < end) {
|
|
128
|
-
const tag = reader.uint32();
|
|
129
|
-
switch (tag >>> 3) {
|
|
130
|
-
case 1:
|
|
131
|
-
if (tag !== 10) {
|
|
132
|
-
break;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
const entry1 = Struct_FieldsEntry.decode(reader, reader.uint32());
|
|
136
|
-
if (entry1.value !== undefined) {
|
|
137
|
-
message.fields[entry1.key] = entry1.value;
|
|
138
|
-
}
|
|
139
|
-
continue;
|
|
140
|
-
}
|
|
141
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
142
|
-
break;
|
|
143
|
-
}
|
|
144
|
-
reader.skipType(tag & 7);
|
|
145
|
-
}
|
|
146
|
-
return message;
|
|
147
|
-
},
|
|
148
|
-
|
|
149
|
-
fromJSON(object: any): Struct {
|
|
150
|
-
return {
|
|
151
|
-
fields: isObject(object.fields)
|
|
152
|
-
? Object.entries(object.fields).reduce<{ [key: string]: any | undefined }>((acc, [key, value]) => {
|
|
153
|
-
acc[key] = value as any | undefined;
|
|
154
|
-
return acc;
|
|
155
|
-
}, {})
|
|
156
|
-
: {},
|
|
157
|
-
};
|
|
158
|
-
},
|
|
159
|
-
|
|
160
|
-
toJSON(message: Struct): unknown {
|
|
161
|
-
const obj: any = {};
|
|
162
|
-
if (message.fields) {
|
|
163
|
-
const entries = Object.entries(message.fields);
|
|
164
|
-
if (entries.length > 0) {
|
|
165
|
-
obj.fields = {};
|
|
166
|
-
entries.forEach(([k, v]) => {
|
|
167
|
-
obj.fields[k] = v;
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
return obj;
|
|
172
|
-
},
|
|
173
|
-
|
|
174
|
-
create<I extends Exact<DeepPartial<Struct>, I>>(base?: I): Struct {
|
|
175
|
-
return Struct.fromPartial(base ?? ({} as any));
|
|
176
|
-
},
|
|
177
|
-
fromPartial<I extends Exact<DeepPartial<Struct>, I>>(object: I): Struct {
|
|
178
|
-
const message = createBaseStruct();
|
|
179
|
-
message.fields = Object.entries(object.fields ?? {}).reduce<{ [key: string]: any | undefined }>(
|
|
180
|
-
(acc, [key, value]) => {
|
|
181
|
-
if (value !== undefined) {
|
|
182
|
-
acc[key] = value;
|
|
183
|
-
}
|
|
184
|
-
return acc;
|
|
185
|
-
},
|
|
186
|
-
{},
|
|
187
|
-
);
|
|
188
|
-
return message;
|
|
189
|
-
},
|
|
190
|
-
|
|
191
|
-
wrap(object: { [key: string]: any } | undefined): Struct {
|
|
192
|
-
const struct = createBaseStruct();
|
|
193
|
-
|
|
194
|
-
if (object !== undefined) {
|
|
195
|
-
for (const key of Object.keys(object)) {
|
|
196
|
-
struct.fields[key] = object[key];
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
return struct;
|
|
200
|
-
},
|
|
201
|
-
|
|
202
|
-
unwrap(message: Struct): { [key: string]: any } {
|
|
203
|
-
const object: { [key: string]: any } = {};
|
|
204
|
-
if (message.fields) {
|
|
205
|
-
for (const key of Object.keys(message.fields)) {
|
|
206
|
-
object[key] = message.fields[key];
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
return object;
|
|
210
|
-
},
|
|
211
|
-
};
|
|
212
|
-
|
|
213
|
-
function createBaseStruct_FieldsEntry(): Struct_FieldsEntry {
|
|
214
|
-
return { key: "", value: undefined };
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
export const Struct_FieldsEntry = {
|
|
218
|
-
encode(message: Struct_FieldsEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
219
|
-
if (message.key !== "") {
|
|
220
|
-
writer.uint32(10).string(message.key);
|
|
221
|
-
}
|
|
222
|
-
if (message.value !== undefined) {
|
|
223
|
-
Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).ldelim();
|
|
224
|
-
}
|
|
225
|
-
return writer;
|
|
226
|
-
},
|
|
227
|
-
|
|
228
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): Struct_FieldsEntry {
|
|
229
|
-
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
230
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
231
|
-
const message = createBaseStruct_FieldsEntry();
|
|
232
|
-
while (reader.pos < end) {
|
|
233
|
-
const tag = reader.uint32();
|
|
234
|
-
switch (tag >>> 3) {
|
|
235
|
-
case 1:
|
|
236
|
-
if (tag !== 10) {
|
|
237
|
-
break;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
message.key = reader.string();
|
|
241
|
-
continue;
|
|
242
|
-
case 2:
|
|
243
|
-
if (tag !== 18) {
|
|
244
|
-
break;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
message.value = Value.unwrap(Value.decode(reader, reader.uint32()));
|
|
248
|
-
continue;
|
|
249
|
-
}
|
|
250
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
251
|
-
break;
|
|
252
|
-
}
|
|
253
|
-
reader.skipType(tag & 7);
|
|
254
|
-
}
|
|
255
|
-
return message;
|
|
256
|
-
},
|
|
257
|
-
|
|
258
|
-
fromJSON(object: any): Struct_FieldsEntry {
|
|
259
|
-
return {
|
|
260
|
-
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
261
|
-
value: isSet(object?.value) ? object.value : undefined,
|
|
262
|
-
};
|
|
263
|
-
},
|
|
264
|
-
|
|
265
|
-
toJSON(message: Struct_FieldsEntry): unknown {
|
|
266
|
-
const obj: any = {};
|
|
267
|
-
if (message.key !== "") {
|
|
268
|
-
obj.key = message.key;
|
|
269
|
-
}
|
|
270
|
-
if (message.value !== undefined) {
|
|
271
|
-
obj.value = message.value;
|
|
272
|
-
}
|
|
273
|
-
return obj;
|
|
274
|
-
},
|
|
275
|
-
|
|
276
|
-
create<I extends Exact<DeepPartial<Struct_FieldsEntry>, I>>(base?: I): Struct_FieldsEntry {
|
|
277
|
-
return Struct_FieldsEntry.fromPartial(base ?? ({} as any));
|
|
278
|
-
},
|
|
279
|
-
fromPartial<I extends Exact<DeepPartial<Struct_FieldsEntry>, I>>(object: I): Struct_FieldsEntry {
|
|
280
|
-
const message = createBaseStruct_FieldsEntry();
|
|
281
|
-
message.key = object.key ?? "";
|
|
282
|
-
message.value = object.value ?? undefined;
|
|
283
|
-
return message;
|
|
284
|
-
},
|
|
285
|
-
};
|
|
286
|
-
|
|
287
|
-
function createBaseValue(): Value {
|
|
288
|
-
return {
|
|
289
|
-
null_value: undefined,
|
|
290
|
-
number_value: undefined,
|
|
291
|
-
string_value: undefined,
|
|
292
|
-
bool_value: undefined,
|
|
293
|
-
struct_value: undefined,
|
|
294
|
-
list_value: undefined,
|
|
295
|
-
};
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
export const Value = {
|
|
299
|
-
encode(message: Value, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
300
|
-
if (message.null_value !== undefined) {
|
|
301
|
-
writer.uint32(8).int32(message.null_value);
|
|
302
|
-
}
|
|
303
|
-
if (message.number_value !== undefined) {
|
|
304
|
-
writer.uint32(17).double(message.number_value);
|
|
305
|
-
}
|
|
306
|
-
if (message.string_value !== undefined) {
|
|
307
|
-
writer.uint32(26).string(message.string_value);
|
|
308
|
-
}
|
|
309
|
-
if (message.bool_value !== undefined) {
|
|
310
|
-
writer.uint32(32).bool(message.bool_value);
|
|
311
|
-
}
|
|
312
|
-
if (message.struct_value !== undefined) {
|
|
313
|
-
Struct.encode(Struct.wrap(message.struct_value), writer.uint32(42).fork()).ldelim();
|
|
314
|
-
}
|
|
315
|
-
if (message.list_value !== undefined) {
|
|
316
|
-
ListValue.encode(ListValue.wrap(message.list_value), writer.uint32(50).fork()).ldelim();
|
|
317
|
-
}
|
|
318
|
-
return writer;
|
|
319
|
-
},
|
|
320
|
-
|
|
321
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): Value {
|
|
322
|
-
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
323
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
324
|
-
const message = createBaseValue();
|
|
325
|
-
while (reader.pos < end) {
|
|
326
|
-
const tag = reader.uint32();
|
|
327
|
-
switch (tag >>> 3) {
|
|
328
|
-
case 1:
|
|
329
|
-
if (tag !== 8) {
|
|
330
|
-
break;
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
message.null_value = reader.int32() as any;
|
|
334
|
-
continue;
|
|
335
|
-
case 2:
|
|
336
|
-
if (tag !== 17) {
|
|
337
|
-
break;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
message.number_value = reader.double();
|
|
341
|
-
continue;
|
|
342
|
-
case 3:
|
|
343
|
-
if (tag !== 26) {
|
|
344
|
-
break;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
message.string_value = reader.string();
|
|
348
|
-
continue;
|
|
349
|
-
case 4:
|
|
350
|
-
if (tag !== 32) {
|
|
351
|
-
break;
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
message.bool_value = reader.bool();
|
|
355
|
-
continue;
|
|
356
|
-
case 5:
|
|
357
|
-
if (tag !== 42) {
|
|
358
|
-
break;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
message.struct_value = Struct.unwrap(Struct.decode(reader, reader.uint32()));
|
|
362
|
-
continue;
|
|
363
|
-
case 6:
|
|
364
|
-
if (tag !== 50) {
|
|
365
|
-
break;
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
message.list_value = ListValue.unwrap(ListValue.decode(reader, reader.uint32()));
|
|
369
|
-
continue;
|
|
370
|
-
}
|
|
371
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
372
|
-
break;
|
|
373
|
-
}
|
|
374
|
-
reader.skipType(tag & 7);
|
|
375
|
-
}
|
|
376
|
-
return message;
|
|
377
|
-
},
|
|
378
|
-
|
|
379
|
-
fromJSON(object: any): Value {
|
|
380
|
-
return {
|
|
381
|
-
null_value: isSet(object.null_value) ? nullValueFromJSON(object.null_value) : undefined,
|
|
382
|
-
number_value: isSet(object.number_value) ? globalThis.Number(object.number_value) : undefined,
|
|
383
|
-
string_value: isSet(object.string_value) ? globalThis.String(object.string_value) : undefined,
|
|
384
|
-
bool_value: isSet(object.bool_value) ? globalThis.Boolean(object.bool_value) : undefined,
|
|
385
|
-
struct_value: isObject(object.struct_value) ? object.struct_value : undefined,
|
|
386
|
-
list_value: globalThis.Array.isArray(object.list_value) ? [...object.list_value] : undefined,
|
|
387
|
-
};
|
|
388
|
-
},
|
|
389
|
-
|
|
390
|
-
toJSON(message: Value): unknown {
|
|
391
|
-
const obj: any = {};
|
|
392
|
-
if (message.null_value !== undefined) {
|
|
393
|
-
obj.null_value = nullValueToJSON(message.null_value);
|
|
394
|
-
}
|
|
395
|
-
if (message.number_value !== undefined) {
|
|
396
|
-
obj.number_value = message.number_value;
|
|
397
|
-
}
|
|
398
|
-
if (message.string_value !== undefined) {
|
|
399
|
-
obj.string_value = message.string_value;
|
|
400
|
-
}
|
|
401
|
-
if (message.bool_value !== undefined) {
|
|
402
|
-
obj.bool_value = message.bool_value;
|
|
403
|
-
}
|
|
404
|
-
if (message.struct_value !== undefined) {
|
|
405
|
-
obj.struct_value = message.struct_value;
|
|
406
|
-
}
|
|
407
|
-
if (message.list_value !== undefined) {
|
|
408
|
-
obj.list_value = message.list_value;
|
|
409
|
-
}
|
|
410
|
-
return obj;
|
|
411
|
-
},
|
|
412
|
-
|
|
413
|
-
create<I extends Exact<DeepPartial<Value>, I>>(base?: I): Value {
|
|
414
|
-
return Value.fromPartial(base ?? ({} as any));
|
|
415
|
-
},
|
|
416
|
-
fromPartial<I extends Exact<DeepPartial<Value>, I>>(object: I): Value {
|
|
417
|
-
const message = createBaseValue();
|
|
418
|
-
message.null_value = object.null_value ?? undefined;
|
|
419
|
-
message.number_value = object.number_value ?? undefined;
|
|
420
|
-
message.string_value = object.string_value ?? undefined;
|
|
421
|
-
message.bool_value = object.bool_value ?? undefined;
|
|
422
|
-
message.struct_value = object.struct_value ?? undefined;
|
|
423
|
-
message.list_value = object.list_value ?? undefined;
|
|
424
|
-
return message;
|
|
425
|
-
},
|
|
426
|
-
|
|
427
|
-
wrap(value: any): Value {
|
|
428
|
-
const result = createBaseValue();
|
|
429
|
-
if (value === null) {
|
|
430
|
-
result.null_value = NullValue.NULL_VALUE;
|
|
431
|
-
} else if (typeof value === "boolean") {
|
|
432
|
-
result.bool_value = value;
|
|
433
|
-
} else if (typeof value === "number") {
|
|
434
|
-
result.number_value = value;
|
|
435
|
-
} else if (typeof value === "string") {
|
|
436
|
-
result.string_value = value;
|
|
437
|
-
} else if (globalThis.Array.isArray(value)) {
|
|
438
|
-
result.list_value = value;
|
|
439
|
-
} else if (typeof value === "object") {
|
|
440
|
-
result.struct_value = value;
|
|
441
|
-
} else if (typeof value !== "undefined") {
|
|
442
|
-
throw new globalThis.Error("Unsupported any value type: " + typeof value);
|
|
443
|
-
}
|
|
444
|
-
return result;
|
|
445
|
-
},
|
|
446
|
-
|
|
447
|
-
unwrap(message: any): string | number | boolean | Object | null | Array<any> | undefined {
|
|
448
|
-
if (message.string_value !== undefined) {
|
|
449
|
-
return message.string_value;
|
|
450
|
-
} else if (message?.number_value !== undefined) {
|
|
451
|
-
return message.number_value;
|
|
452
|
-
} else if (message?.bool_value !== undefined) {
|
|
453
|
-
return message.bool_value;
|
|
454
|
-
} else if (message?.struct_value !== undefined) {
|
|
455
|
-
return message.struct_value as any;
|
|
456
|
-
} else if (message?.list_value !== undefined) {
|
|
457
|
-
return message.list_value;
|
|
458
|
-
} else if (message?.null_value !== undefined) {
|
|
459
|
-
return null;
|
|
460
|
-
}
|
|
461
|
-
return undefined;
|
|
462
|
-
},
|
|
463
|
-
};
|
|
464
|
-
|
|
465
|
-
function createBaseListValue(): ListValue {
|
|
466
|
-
return { values: [] };
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
export const ListValue = {
|
|
470
|
-
encode(message: ListValue, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
471
|
-
for (const v of message.values) {
|
|
472
|
-
Value.encode(Value.wrap(v!), writer.uint32(10).fork()).ldelim();
|
|
473
|
-
}
|
|
474
|
-
return writer;
|
|
475
|
-
},
|
|
476
|
-
|
|
477
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): ListValue {
|
|
478
|
-
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
479
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
480
|
-
const message = createBaseListValue();
|
|
481
|
-
while (reader.pos < end) {
|
|
482
|
-
const tag = reader.uint32();
|
|
483
|
-
switch (tag >>> 3) {
|
|
484
|
-
case 1:
|
|
485
|
-
if (tag !== 10) {
|
|
486
|
-
break;
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
message.values.push(Value.unwrap(Value.decode(reader, reader.uint32())));
|
|
490
|
-
continue;
|
|
491
|
-
}
|
|
492
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
493
|
-
break;
|
|
494
|
-
}
|
|
495
|
-
reader.skipType(tag & 7);
|
|
496
|
-
}
|
|
497
|
-
return message;
|
|
498
|
-
},
|
|
499
|
-
|
|
500
|
-
fromJSON(object: any): ListValue {
|
|
501
|
-
return { values: globalThis.Array.isArray(object?.values) ? [...object.values] : [] };
|
|
502
|
-
},
|
|
503
|
-
|
|
504
|
-
toJSON(message: ListValue): unknown {
|
|
505
|
-
const obj: any = {};
|
|
506
|
-
if (message.values?.length) {
|
|
507
|
-
obj.values = message.values;
|
|
508
|
-
}
|
|
509
|
-
return obj;
|
|
510
|
-
},
|
|
511
|
-
|
|
512
|
-
create<I extends Exact<DeepPartial<ListValue>, I>>(base?: I): ListValue {
|
|
513
|
-
return ListValue.fromPartial(base ?? ({} as any));
|
|
514
|
-
},
|
|
515
|
-
fromPartial<I extends Exact<DeepPartial<ListValue>, I>>(object: I): ListValue {
|
|
516
|
-
const message = createBaseListValue();
|
|
517
|
-
message.values = object.values?.map((e) => e) || [];
|
|
518
|
-
return message;
|
|
519
|
-
},
|
|
520
|
-
|
|
521
|
-
wrap(array: Array<any> | undefined): ListValue {
|
|
522
|
-
const result = createBaseListValue();
|
|
523
|
-
result.values = array ?? [];
|
|
524
|
-
return result;
|
|
525
|
-
},
|
|
526
|
-
|
|
527
|
-
unwrap(message: ListValue): Array<any> {
|
|
528
|
-
if (message?.hasOwnProperty("values") && globalThis.Array.isArray(message.values)) {
|
|
529
|
-
return message.values;
|
|
530
|
-
} else {
|
|
531
|
-
return message as any;
|
|
532
|
-
}
|
|
533
|
-
},
|
|
534
|
-
};
|
|
535
|
-
|
|
536
|
-
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
537
|
-
|
|
538
|
-
export type DeepPartial<T> = T extends Builtin ? T
|
|
539
|
-
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
|
540
|
-
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
541
|
-
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
542
|
-
: Partial<T>;
|
|
543
|
-
|
|
544
|
-
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
545
|
-
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
546
|
-
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
547
|
-
|
|
548
|
-
function isObject(value: any): boolean {
|
|
549
|
-
return typeof value === "object" && value !== null;
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
function isSet(value: any): boolean {
|
|
553
|
-
return value !== null && value !== undefined;
|
|
554
|
-
}
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v1.181.2
|
|
4
|
+
// protoc v5.27.5
|
|
5
|
+
// source: google/protobuf/struct.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import _m0 from "protobufjs/minimal";
|
|
9
|
+
|
|
10
|
+
export const protobufPackage = "google.protobuf";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* `NullValue` is a singleton enumeration to represent the null value for the
|
|
14
|
+
* `Value` type union.
|
|
15
|
+
*
|
|
16
|
+
* The JSON representation for `NullValue` is JSON `null`.
|
|
17
|
+
*/
|
|
18
|
+
export enum NullValue {
|
|
19
|
+
/** NULL_VALUE - Null value. */
|
|
20
|
+
NULL_VALUE = 0,
|
|
21
|
+
UNRECOGNIZED = -1,
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function nullValueFromJSON(object: any): NullValue {
|
|
25
|
+
switch (object) {
|
|
26
|
+
case 0:
|
|
27
|
+
case "NULL_VALUE":
|
|
28
|
+
return NullValue.NULL_VALUE;
|
|
29
|
+
case -1:
|
|
30
|
+
case "UNRECOGNIZED":
|
|
31
|
+
default:
|
|
32
|
+
return NullValue.UNRECOGNIZED;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function nullValueToJSON(object: NullValue): string {
|
|
37
|
+
switch (object) {
|
|
38
|
+
case NullValue.NULL_VALUE:
|
|
39
|
+
return "NULL_VALUE";
|
|
40
|
+
case NullValue.UNRECOGNIZED:
|
|
41
|
+
default:
|
|
42
|
+
return "UNRECOGNIZED";
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* `Struct` represents a structured data value, consisting of fields
|
|
48
|
+
* which map to dynamically typed values. In some languages, `Struct`
|
|
49
|
+
* might be supported by a native representation. For example, in
|
|
50
|
+
* scripting languages like JS a struct is represented as an
|
|
51
|
+
* object. The details of that representation are described together
|
|
52
|
+
* with the proto support for the language.
|
|
53
|
+
*
|
|
54
|
+
* The JSON representation for `Struct` is JSON object.
|
|
55
|
+
*/
|
|
56
|
+
export interface Struct {
|
|
57
|
+
/** Unordered map of dynamically typed values. */
|
|
58
|
+
fields: { [key: string]: any | undefined };
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface Struct_FieldsEntry {
|
|
62
|
+
key: string;
|
|
63
|
+
value: any | undefined;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* `Value` represents a dynamically typed value which can be either
|
|
68
|
+
* null, a number, a string, a boolean, a recursive struct value, or a
|
|
69
|
+
* list of values. A producer of value is expected to set one of these
|
|
70
|
+
* variants. Absence of any variant indicates an error.
|
|
71
|
+
*
|
|
72
|
+
* The JSON representation for `Value` is JSON value.
|
|
73
|
+
*/
|
|
74
|
+
export interface Value {
|
|
75
|
+
/** Represents a null value. */
|
|
76
|
+
null_value?:
|
|
77
|
+
| NullValue
|
|
78
|
+
| undefined;
|
|
79
|
+
/** Represents a double value. */
|
|
80
|
+
number_value?:
|
|
81
|
+
| number
|
|
82
|
+
| undefined;
|
|
83
|
+
/** Represents a string value. */
|
|
84
|
+
string_value?:
|
|
85
|
+
| string
|
|
86
|
+
| undefined;
|
|
87
|
+
/** Represents a boolean value. */
|
|
88
|
+
bool_value?:
|
|
89
|
+
| boolean
|
|
90
|
+
| undefined;
|
|
91
|
+
/** Represents a structured value. */
|
|
92
|
+
struct_value?:
|
|
93
|
+
| { [key: string]: any }
|
|
94
|
+
| undefined;
|
|
95
|
+
/** Represents a repeated `Value`. */
|
|
96
|
+
list_value?: Array<any> | undefined;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* `ListValue` is a wrapper around a repeated field of values.
|
|
101
|
+
*
|
|
102
|
+
* The JSON representation for `ListValue` is JSON array.
|
|
103
|
+
*/
|
|
104
|
+
export interface ListValue {
|
|
105
|
+
/** Repeated field of dynamically typed values. */
|
|
106
|
+
values: any[];
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function createBaseStruct(): Struct {
|
|
110
|
+
return { fields: {} };
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export const Struct = {
|
|
114
|
+
encode(message: Struct, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
115
|
+
Object.entries(message.fields).forEach(([key, value]) => {
|
|
116
|
+
if (value !== undefined) {
|
|
117
|
+
Struct_FieldsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).ldelim();
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
return writer;
|
|
121
|
+
},
|
|
122
|
+
|
|
123
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): Struct {
|
|
124
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
125
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
126
|
+
const message = createBaseStruct();
|
|
127
|
+
while (reader.pos < end) {
|
|
128
|
+
const tag = reader.uint32();
|
|
129
|
+
switch (tag >>> 3) {
|
|
130
|
+
case 1:
|
|
131
|
+
if (tag !== 10) {
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const entry1 = Struct_FieldsEntry.decode(reader, reader.uint32());
|
|
136
|
+
if (entry1.value !== undefined) {
|
|
137
|
+
message.fields[entry1.key] = entry1.value;
|
|
138
|
+
}
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
142
|
+
break;
|
|
143
|
+
}
|
|
144
|
+
reader.skipType(tag & 7);
|
|
145
|
+
}
|
|
146
|
+
return message;
|
|
147
|
+
},
|
|
148
|
+
|
|
149
|
+
fromJSON(object: any): Struct {
|
|
150
|
+
return {
|
|
151
|
+
fields: isObject(object.fields)
|
|
152
|
+
? Object.entries(object.fields).reduce<{ [key: string]: any | undefined }>((acc, [key, value]) => {
|
|
153
|
+
acc[key] = value as any | undefined;
|
|
154
|
+
return acc;
|
|
155
|
+
}, {})
|
|
156
|
+
: {},
|
|
157
|
+
};
|
|
158
|
+
},
|
|
159
|
+
|
|
160
|
+
toJSON(message: Struct): unknown {
|
|
161
|
+
const obj: any = {};
|
|
162
|
+
if (message.fields) {
|
|
163
|
+
const entries = Object.entries(message.fields);
|
|
164
|
+
if (entries.length > 0) {
|
|
165
|
+
obj.fields = {};
|
|
166
|
+
entries.forEach(([k, v]) => {
|
|
167
|
+
obj.fields[k] = v;
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return obj;
|
|
172
|
+
},
|
|
173
|
+
|
|
174
|
+
create<I extends Exact<DeepPartial<Struct>, I>>(base?: I): Struct {
|
|
175
|
+
return Struct.fromPartial(base ?? ({} as any));
|
|
176
|
+
},
|
|
177
|
+
fromPartial<I extends Exact<DeepPartial<Struct>, I>>(object: I): Struct {
|
|
178
|
+
const message = createBaseStruct();
|
|
179
|
+
message.fields = Object.entries(object.fields ?? {}).reduce<{ [key: string]: any | undefined }>(
|
|
180
|
+
(acc, [key, value]) => {
|
|
181
|
+
if (value !== undefined) {
|
|
182
|
+
acc[key] = value;
|
|
183
|
+
}
|
|
184
|
+
return acc;
|
|
185
|
+
},
|
|
186
|
+
{},
|
|
187
|
+
);
|
|
188
|
+
return message;
|
|
189
|
+
},
|
|
190
|
+
|
|
191
|
+
wrap(object: { [key: string]: any } | undefined): Struct {
|
|
192
|
+
const struct = createBaseStruct();
|
|
193
|
+
|
|
194
|
+
if (object !== undefined) {
|
|
195
|
+
for (const key of Object.keys(object)) {
|
|
196
|
+
struct.fields[key] = object[key];
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
return struct;
|
|
200
|
+
},
|
|
201
|
+
|
|
202
|
+
unwrap(message: Struct): { [key: string]: any } {
|
|
203
|
+
const object: { [key: string]: any } = {};
|
|
204
|
+
if (message.fields) {
|
|
205
|
+
for (const key of Object.keys(message.fields)) {
|
|
206
|
+
object[key] = message.fields[key];
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
return object;
|
|
210
|
+
},
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
function createBaseStruct_FieldsEntry(): Struct_FieldsEntry {
|
|
214
|
+
return { key: "", value: undefined };
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export const Struct_FieldsEntry = {
|
|
218
|
+
encode(message: Struct_FieldsEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
219
|
+
if (message.key !== "") {
|
|
220
|
+
writer.uint32(10).string(message.key);
|
|
221
|
+
}
|
|
222
|
+
if (message.value !== undefined) {
|
|
223
|
+
Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).ldelim();
|
|
224
|
+
}
|
|
225
|
+
return writer;
|
|
226
|
+
},
|
|
227
|
+
|
|
228
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): Struct_FieldsEntry {
|
|
229
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
230
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
231
|
+
const message = createBaseStruct_FieldsEntry();
|
|
232
|
+
while (reader.pos < end) {
|
|
233
|
+
const tag = reader.uint32();
|
|
234
|
+
switch (tag >>> 3) {
|
|
235
|
+
case 1:
|
|
236
|
+
if (tag !== 10) {
|
|
237
|
+
break;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
message.key = reader.string();
|
|
241
|
+
continue;
|
|
242
|
+
case 2:
|
|
243
|
+
if (tag !== 18) {
|
|
244
|
+
break;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
message.value = Value.unwrap(Value.decode(reader, reader.uint32()));
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
251
|
+
break;
|
|
252
|
+
}
|
|
253
|
+
reader.skipType(tag & 7);
|
|
254
|
+
}
|
|
255
|
+
return message;
|
|
256
|
+
},
|
|
257
|
+
|
|
258
|
+
fromJSON(object: any): Struct_FieldsEntry {
|
|
259
|
+
return {
|
|
260
|
+
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
261
|
+
value: isSet(object?.value) ? object.value : undefined,
|
|
262
|
+
};
|
|
263
|
+
},
|
|
264
|
+
|
|
265
|
+
toJSON(message: Struct_FieldsEntry): unknown {
|
|
266
|
+
const obj: any = {};
|
|
267
|
+
if (message.key !== "") {
|
|
268
|
+
obj.key = message.key;
|
|
269
|
+
}
|
|
270
|
+
if (message.value !== undefined) {
|
|
271
|
+
obj.value = message.value;
|
|
272
|
+
}
|
|
273
|
+
return obj;
|
|
274
|
+
},
|
|
275
|
+
|
|
276
|
+
create<I extends Exact<DeepPartial<Struct_FieldsEntry>, I>>(base?: I): Struct_FieldsEntry {
|
|
277
|
+
return Struct_FieldsEntry.fromPartial(base ?? ({} as any));
|
|
278
|
+
},
|
|
279
|
+
fromPartial<I extends Exact<DeepPartial<Struct_FieldsEntry>, I>>(object: I): Struct_FieldsEntry {
|
|
280
|
+
const message = createBaseStruct_FieldsEntry();
|
|
281
|
+
message.key = object.key ?? "";
|
|
282
|
+
message.value = object.value ?? undefined;
|
|
283
|
+
return message;
|
|
284
|
+
},
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
function createBaseValue(): Value {
|
|
288
|
+
return {
|
|
289
|
+
null_value: undefined,
|
|
290
|
+
number_value: undefined,
|
|
291
|
+
string_value: undefined,
|
|
292
|
+
bool_value: undefined,
|
|
293
|
+
struct_value: undefined,
|
|
294
|
+
list_value: undefined,
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
export const Value = {
|
|
299
|
+
encode(message: Value, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
300
|
+
if (message.null_value !== undefined) {
|
|
301
|
+
writer.uint32(8).int32(message.null_value);
|
|
302
|
+
}
|
|
303
|
+
if (message.number_value !== undefined) {
|
|
304
|
+
writer.uint32(17).double(message.number_value);
|
|
305
|
+
}
|
|
306
|
+
if (message.string_value !== undefined) {
|
|
307
|
+
writer.uint32(26).string(message.string_value);
|
|
308
|
+
}
|
|
309
|
+
if (message.bool_value !== undefined) {
|
|
310
|
+
writer.uint32(32).bool(message.bool_value);
|
|
311
|
+
}
|
|
312
|
+
if (message.struct_value !== undefined) {
|
|
313
|
+
Struct.encode(Struct.wrap(message.struct_value), writer.uint32(42).fork()).ldelim();
|
|
314
|
+
}
|
|
315
|
+
if (message.list_value !== undefined) {
|
|
316
|
+
ListValue.encode(ListValue.wrap(message.list_value), writer.uint32(50).fork()).ldelim();
|
|
317
|
+
}
|
|
318
|
+
return writer;
|
|
319
|
+
},
|
|
320
|
+
|
|
321
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): Value {
|
|
322
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
323
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
324
|
+
const message = createBaseValue();
|
|
325
|
+
while (reader.pos < end) {
|
|
326
|
+
const tag = reader.uint32();
|
|
327
|
+
switch (tag >>> 3) {
|
|
328
|
+
case 1:
|
|
329
|
+
if (tag !== 8) {
|
|
330
|
+
break;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
message.null_value = reader.int32() as any;
|
|
334
|
+
continue;
|
|
335
|
+
case 2:
|
|
336
|
+
if (tag !== 17) {
|
|
337
|
+
break;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
message.number_value = reader.double();
|
|
341
|
+
continue;
|
|
342
|
+
case 3:
|
|
343
|
+
if (tag !== 26) {
|
|
344
|
+
break;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
message.string_value = reader.string();
|
|
348
|
+
continue;
|
|
349
|
+
case 4:
|
|
350
|
+
if (tag !== 32) {
|
|
351
|
+
break;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
message.bool_value = reader.bool();
|
|
355
|
+
continue;
|
|
356
|
+
case 5:
|
|
357
|
+
if (tag !== 42) {
|
|
358
|
+
break;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
message.struct_value = Struct.unwrap(Struct.decode(reader, reader.uint32()));
|
|
362
|
+
continue;
|
|
363
|
+
case 6:
|
|
364
|
+
if (tag !== 50) {
|
|
365
|
+
break;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
message.list_value = ListValue.unwrap(ListValue.decode(reader, reader.uint32()));
|
|
369
|
+
continue;
|
|
370
|
+
}
|
|
371
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
372
|
+
break;
|
|
373
|
+
}
|
|
374
|
+
reader.skipType(tag & 7);
|
|
375
|
+
}
|
|
376
|
+
return message;
|
|
377
|
+
},
|
|
378
|
+
|
|
379
|
+
fromJSON(object: any): Value {
|
|
380
|
+
return {
|
|
381
|
+
null_value: isSet(object.null_value) ? nullValueFromJSON(object.null_value) : undefined,
|
|
382
|
+
number_value: isSet(object.number_value) ? globalThis.Number(object.number_value) : undefined,
|
|
383
|
+
string_value: isSet(object.string_value) ? globalThis.String(object.string_value) : undefined,
|
|
384
|
+
bool_value: isSet(object.bool_value) ? globalThis.Boolean(object.bool_value) : undefined,
|
|
385
|
+
struct_value: isObject(object.struct_value) ? object.struct_value : undefined,
|
|
386
|
+
list_value: globalThis.Array.isArray(object.list_value) ? [...object.list_value] : undefined,
|
|
387
|
+
};
|
|
388
|
+
},
|
|
389
|
+
|
|
390
|
+
toJSON(message: Value): unknown {
|
|
391
|
+
const obj: any = {};
|
|
392
|
+
if (message.null_value !== undefined) {
|
|
393
|
+
obj.null_value = nullValueToJSON(message.null_value);
|
|
394
|
+
}
|
|
395
|
+
if (message.number_value !== undefined) {
|
|
396
|
+
obj.number_value = message.number_value;
|
|
397
|
+
}
|
|
398
|
+
if (message.string_value !== undefined) {
|
|
399
|
+
obj.string_value = message.string_value;
|
|
400
|
+
}
|
|
401
|
+
if (message.bool_value !== undefined) {
|
|
402
|
+
obj.bool_value = message.bool_value;
|
|
403
|
+
}
|
|
404
|
+
if (message.struct_value !== undefined) {
|
|
405
|
+
obj.struct_value = message.struct_value;
|
|
406
|
+
}
|
|
407
|
+
if (message.list_value !== undefined) {
|
|
408
|
+
obj.list_value = message.list_value;
|
|
409
|
+
}
|
|
410
|
+
return obj;
|
|
411
|
+
},
|
|
412
|
+
|
|
413
|
+
create<I extends Exact<DeepPartial<Value>, I>>(base?: I): Value {
|
|
414
|
+
return Value.fromPartial(base ?? ({} as any));
|
|
415
|
+
},
|
|
416
|
+
fromPartial<I extends Exact<DeepPartial<Value>, I>>(object: I): Value {
|
|
417
|
+
const message = createBaseValue();
|
|
418
|
+
message.null_value = object.null_value ?? undefined;
|
|
419
|
+
message.number_value = object.number_value ?? undefined;
|
|
420
|
+
message.string_value = object.string_value ?? undefined;
|
|
421
|
+
message.bool_value = object.bool_value ?? undefined;
|
|
422
|
+
message.struct_value = object.struct_value ?? undefined;
|
|
423
|
+
message.list_value = object.list_value ?? undefined;
|
|
424
|
+
return message;
|
|
425
|
+
},
|
|
426
|
+
|
|
427
|
+
wrap(value: any): Value {
|
|
428
|
+
const result = createBaseValue();
|
|
429
|
+
if (value === null) {
|
|
430
|
+
result.null_value = NullValue.NULL_VALUE;
|
|
431
|
+
} else if (typeof value === "boolean") {
|
|
432
|
+
result.bool_value = value;
|
|
433
|
+
} else if (typeof value === "number") {
|
|
434
|
+
result.number_value = value;
|
|
435
|
+
} else if (typeof value === "string") {
|
|
436
|
+
result.string_value = value;
|
|
437
|
+
} else if (globalThis.Array.isArray(value)) {
|
|
438
|
+
result.list_value = value;
|
|
439
|
+
} else if (typeof value === "object") {
|
|
440
|
+
result.struct_value = value;
|
|
441
|
+
} else if (typeof value !== "undefined") {
|
|
442
|
+
throw new globalThis.Error("Unsupported any value type: " + typeof value);
|
|
443
|
+
}
|
|
444
|
+
return result;
|
|
445
|
+
},
|
|
446
|
+
|
|
447
|
+
unwrap(message: any): string | number | boolean | Object | null | Array<any> | undefined {
|
|
448
|
+
if (message.string_value !== undefined) {
|
|
449
|
+
return message.string_value;
|
|
450
|
+
} else if (message?.number_value !== undefined) {
|
|
451
|
+
return message.number_value;
|
|
452
|
+
} else if (message?.bool_value !== undefined) {
|
|
453
|
+
return message.bool_value;
|
|
454
|
+
} else if (message?.struct_value !== undefined) {
|
|
455
|
+
return message.struct_value as any;
|
|
456
|
+
} else if (message?.list_value !== undefined) {
|
|
457
|
+
return message.list_value;
|
|
458
|
+
} else if (message?.null_value !== undefined) {
|
|
459
|
+
return null;
|
|
460
|
+
}
|
|
461
|
+
return undefined;
|
|
462
|
+
},
|
|
463
|
+
};
|
|
464
|
+
|
|
465
|
+
function createBaseListValue(): ListValue {
|
|
466
|
+
return { values: [] };
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
export const ListValue = {
|
|
470
|
+
encode(message: ListValue, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
471
|
+
for (const v of message.values) {
|
|
472
|
+
Value.encode(Value.wrap(v!), writer.uint32(10).fork()).ldelim();
|
|
473
|
+
}
|
|
474
|
+
return writer;
|
|
475
|
+
},
|
|
476
|
+
|
|
477
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): ListValue {
|
|
478
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
479
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
480
|
+
const message = createBaseListValue();
|
|
481
|
+
while (reader.pos < end) {
|
|
482
|
+
const tag = reader.uint32();
|
|
483
|
+
switch (tag >>> 3) {
|
|
484
|
+
case 1:
|
|
485
|
+
if (tag !== 10) {
|
|
486
|
+
break;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
message.values.push(Value.unwrap(Value.decode(reader, reader.uint32())));
|
|
490
|
+
continue;
|
|
491
|
+
}
|
|
492
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
493
|
+
break;
|
|
494
|
+
}
|
|
495
|
+
reader.skipType(tag & 7);
|
|
496
|
+
}
|
|
497
|
+
return message;
|
|
498
|
+
},
|
|
499
|
+
|
|
500
|
+
fromJSON(object: any): ListValue {
|
|
501
|
+
return { values: globalThis.Array.isArray(object?.values) ? [...object.values] : [] };
|
|
502
|
+
},
|
|
503
|
+
|
|
504
|
+
toJSON(message: ListValue): unknown {
|
|
505
|
+
const obj: any = {};
|
|
506
|
+
if (message.values?.length) {
|
|
507
|
+
obj.values = message.values;
|
|
508
|
+
}
|
|
509
|
+
return obj;
|
|
510
|
+
},
|
|
511
|
+
|
|
512
|
+
create<I extends Exact<DeepPartial<ListValue>, I>>(base?: I): ListValue {
|
|
513
|
+
return ListValue.fromPartial(base ?? ({} as any));
|
|
514
|
+
},
|
|
515
|
+
fromPartial<I extends Exact<DeepPartial<ListValue>, I>>(object: I): ListValue {
|
|
516
|
+
const message = createBaseListValue();
|
|
517
|
+
message.values = object.values?.map((e) => e) || [];
|
|
518
|
+
return message;
|
|
519
|
+
},
|
|
520
|
+
|
|
521
|
+
wrap(array: Array<any> | undefined): ListValue {
|
|
522
|
+
const result = createBaseListValue();
|
|
523
|
+
result.values = array ?? [];
|
|
524
|
+
return result;
|
|
525
|
+
},
|
|
526
|
+
|
|
527
|
+
unwrap(message: ListValue): Array<any> {
|
|
528
|
+
if (message?.hasOwnProperty("values") && globalThis.Array.isArray(message.values)) {
|
|
529
|
+
return message.values;
|
|
530
|
+
} else {
|
|
531
|
+
return message as any;
|
|
532
|
+
}
|
|
533
|
+
},
|
|
534
|
+
};
|
|
535
|
+
|
|
536
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
537
|
+
|
|
538
|
+
export type DeepPartial<T> = T extends Builtin ? T
|
|
539
|
+
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
|
540
|
+
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
541
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
542
|
+
: Partial<T>;
|
|
543
|
+
|
|
544
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
545
|
+
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
546
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
547
|
+
|
|
548
|
+
function isObject(value: any): boolean {
|
|
549
|
+
return typeof value === "object" && value !== null;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
function isSet(value: any): boolean {
|
|
553
|
+
return value !== null && value !== undefined;
|
|
554
|
+
}
|