@shock-cinema/contracts 1.0.1 → 1.0.4
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/gen/auth.ts +30 -170
- package/gen/google/protobuf/any.ts +2 -127
- package/gen/google/protobuf/duration.ts +2 -113
- package/gen/google/protobuf/empty.ts +2 -65
- package/gen/google/protobuf/struct.ts +21 -415
- package/gen/google/protobuf/timestamp.ts +2 -113
- package/gen/test.ts +21 -536
- package/package.json +3 -5
- package/proto/auth.proto +12 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
2
|
// versions:
|
|
3
3
|
// protoc-gen-ts_proto v2.10.1
|
|
4
|
-
// protoc v6.33.
|
|
4
|
+
// protoc v6.33.1
|
|
5
5
|
// source: google/protobuf/struct.proto
|
|
6
6
|
|
|
7
7
|
/* eslint-disable */
|
|
8
|
-
import {
|
|
8
|
+
import { wrappers } from "protobufjs";
|
|
9
9
|
|
|
10
10
|
export const protobufPackage = "google.protobuf";
|
|
11
11
|
|
|
@@ -21,28 +21,6 @@ export enum NullValue {
|
|
|
21
21
|
UNRECOGNIZED = -1,
|
|
22
22
|
}
|
|
23
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
24
|
/**
|
|
47
25
|
* `Struct` represents a structured data value, consisting of fields
|
|
48
26
|
* which map to dynamically typed values. In some languages, `Struct`
|
|
@@ -106,98 +84,19 @@ export interface ListValue {
|
|
|
106
84
|
values: any[];
|
|
107
85
|
}
|
|
108
86
|
|
|
87
|
+
export const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
|
|
88
|
+
|
|
109
89
|
function createBaseStruct(): Struct {
|
|
110
90
|
return { fields: {} };
|
|
111
91
|
}
|
|
112
92
|
|
|
113
93
|
export const Struct: MessageFns<Struct> & StructWrapperFns = {
|
|
114
|
-
encode(message: Struct, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
115
|
-
globalThis.Object.entries(message.fields).forEach(([key, value]: [string, any | undefined]) => {
|
|
116
|
-
if (value !== undefined) {
|
|
117
|
-
Struct_FieldsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
return writer;
|
|
121
|
-
},
|
|
122
|
-
|
|
123
|
-
decode(input: BinaryReader | Uint8Array, length?: number): Struct {
|
|
124
|
-
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
125
|
-
const 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
|
-
}
|
|
142
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
143
|
-
break;
|
|
144
|
-
}
|
|
145
|
-
reader.skip(tag & 7);
|
|
146
|
-
}
|
|
147
|
-
return message;
|
|
148
|
-
},
|
|
149
|
-
|
|
150
|
-
fromJSON(object: any): Struct {
|
|
151
|
-
return {
|
|
152
|
-
fields: isObject(object.fields)
|
|
153
|
-
? (globalThis.Object.entries(object.fields) as [string, any][]).reduce(
|
|
154
|
-
(acc: { [key: string]: any | undefined }, [key, value]: [string, any]) => {
|
|
155
|
-
acc[key] = value as any | undefined;
|
|
156
|
-
return acc;
|
|
157
|
-
},
|
|
158
|
-
{},
|
|
159
|
-
)
|
|
160
|
-
: {},
|
|
161
|
-
};
|
|
162
|
-
},
|
|
163
|
-
|
|
164
|
-
toJSON(message: Struct): unknown {
|
|
165
|
-
const obj: any = {};
|
|
166
|
-
if (message.fields) {
|
|
167
|
-
const entries = globalThis.Object.entries(message.fields) as [string, any | undefined][];
|
|
168
|
-
if (entries.length > 0) {
|
|
169
|
-
obj.fields = {};
|
|
170
|
-
entries.forEach(([k, v]) => {
|
|
171
|
-
obj.fields[k] = v;
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
return obj;
|
|
176
|
-
},
|
|
177
|
-
|
|
178
|
-
create<I extends Exact<DeepPartial<Struct>, I>>(base?: I): Struct {
|
|
179
|
-
return Struct.fromPartial(base ?? ({} as any));
|
|
180
|
-
},
|
|
181
|
-
fromPartial<I extends Exact<DeepPartial<Struct>, I>>(object: I): Struct {
|
|
182
|
-
const message = createBaseStruct();
|
|
183
|
-
message.fields = (globalThis.Object.entries(object.fields ?? {}) as [string, any | undefined][]).reduce(
|
|
184
|
-
(acc: { [key: string]: any | undefined }, [key, value]: [string, any | undefined]) => {
|
|
185
|
-
if (value !== undefined) {
|
|
186
|
-
acc[key] = value;
|
|
187
|
-
}
|
|
188
|
-
return acc;
|
|
189
|
-
},
|
|
190
|
-
{},
|
|
191
|
-
);
|
|
192
|
-
return message;
|
|
193
|
-
},
|
|
194
|
-
|
|
195
94
|
wrap(object: { [key: string]: any } | undefined): Struct {
|
|
196
95
|
const struct = createBaseStruct();
|
|
197
96
|
|
|
198
97
|
if (object !== undefined) {
|
|
199
98
|
for (const key of globalThis.Object.keys(object)) {
|
|
200
|
-
struct.fields[key] = object[key];
|
|
99
|
+
struct.fields[key] = Value.wrap(object[key]);
|
|
201
100
|
}
|
|
202
101
|
}
|
|
203
102
|
return struct;
|
|
@@ -207,237 +106,20 @@ export const Struct: MessageFns<Struct> & StructWrapperFns = {
|
|
|
207
106
|
const object: { [key: string]: any } = {};
|
|
208
107
|
if (message.fields) {
|
|
209
108
|
for (const key of globalThis.Object.keys(message.fields)) {
|
|
210
|
-
object[key] = message.fields[key];
|
|
109
|
+
object[key] = Value.unwrap(message.fields[key]);
|
|
211
110
|
}
|
|
212
111
|
}
|
|
213
112
|
return object;
|
|
214
113
|
},
|
|
215
114
|
};
|
|
216
115
|
|
|
217
|
-
function createBaseStruct_FieldsEntry(): Struct_FieldsEntry {
|
|
218
|
-
return { key: "", value: undefined };
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
export const Struct_FieldsEntry: MessageFns<Struct_FieldsEntry> = {
|
|
222
|
-
encode(message: Struct_FieldsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
223
|
-
if (message.key !== "") {
|
|
224
|
-
writer.uint32(10).string(message.key);
|
|
225
|
-
}
|
|
226
|
-
if (message.value !== undefined) {
|
|
227
|
-
Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).join();
|
|
228
|
-
}
|
|
229
|
-
return writer;
|
|
230
|
-
},
|
|
231
|
-
|
|
232
|
-
decode(input: BinaryReader | Uint8Array, length?: number): Struct_FieldsEntry {
|
|
233
|
-
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
234
|
-
const end = length === undefined ? reader.len : reader.pos + length;
|
|
235
|
-
const message = createBaseStruct_FieldsEntry();
|
|
236
|
-
while (reader.pos < end) {
|
|
237
|
-
const tag = reader.uint32();
|
|
238
|
-
switch (tag >>> 3) {
|
|
239
|
-
case 1: {
|
|
240
|
-
if (tag !== 10) {
|
|
241
|
-
break;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
message.key = reader.string();
|
|
245
|
-
continue;
|
|
246
|
-
}
|
|
247
|
-
case 2: {
|
|
248
|
-
if (tag !== 18) {
|
|
249
|
-
break;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
message.value = Value.unwrap(Value.decode(reader, reader.uint32()));
|
|
253
|
-
continue;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
257
|
-
break;
|
|
258
|
-
}
|
|
259
|
-
reader.skip(tag & 7);
|
|
260
|
-
}
|
|
261
|
-
return message;
|
|
262
|
-
},
|
|
263
|
-
|
|
264
|
-
fromJSON(object: any): Struct_FieldsEntry {
|
|
265
|
-
return {
|
|
266
|
-
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
267
|
-
value: isSet(object?.value) ? object.value : undefined,
|
|
268
|
-
};
|
|
269
|
-
},
|
|
270
|
-
|
|
271
|
-
toJSON(message: Struct_FieldsEntry): unknown {
|
|
272
|
-
const obj: any = {};
|
|
273
|
-
if (message.key !== "") {
|
|
274
|
-
obj.key = message.key;
|
|
275
|
-
}
|
|
276
|
-
if (message.value !== undefined) {
|
|
277
|
-
obj.value = message.value;
|
|
278
|
-
}
|
|
279
|
-
return obj;
|
|
280
|
-
},
|
|
281
|
-
|
|
282
|
-
create<I extends Exact<DeepPartial<Struct_FieldsEntry>, I>>(base?: I): Struct_FieldsEntry {
|
|
283
|
-
return Struct_FieldsEntry.fromPartial(base ?? ({} as any));
|
|
284
|
-
},
|
|
285
|
-
fromPartial<I extends Exact<DeepPartial<Struct_FieldsEntry>, I>>(object: I): Struct_FieldsEntry {
|
|
286
|
-
const message = createBaseStruct_FieldsEntry();
|
|
287
|
-
message.key = object.key ?? "";
|
|
288
|
-
message.value = object.value ?? undefined;
|
|
289
|
-
return message;
|
|
290
|
-
},
|
|
291
|
-
};
|
|
292
|
-
|
|
293
116
|
function createBaseValue(): Value {
|
|
294
|
-
return {
|
|
295
|
-
nullValue: undefined,
|
|
296
|
-
numberValue: undefined,
|
|
297
|
-
stringValue: undefined,
|
|
298
|
-
boolValue: undefined,
|
|
299
|
-
structValue: undefined,
|
|
300
|
-
listValue: undefined,
|
|
301
|
-
};
|
|
117
|
+
return {};
|
|
302
118
|
}
|
|
303
119
|
|
|
304
120
|
export const Value: MessageFns<Value> & AnyValueWrapperFns = {
|
|
305
|
-
encode(message: Value, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
306
|
-
if (message.nullValue !== undefined) {
|
|
307
|
-
writer.uint32(8).int32(message.nullValue);
|
|
308
|
-
}
|
|
309
|
-
if (message.numberValue !== undefined) {
|
|
310
|
-
writer.uint32(17).double(message.numberValue);
|
|
311
|
-
}
|
|
312
|
-
if (message.stringValue !== undefined) {
|
|
313
|
-
writer.uint32(26).string(message.stringValue);
|
|
314
|
-
}
|
|
315
|
-
if (message.boolValue !== undefined) {
|
|
316
|
-
writer.uint32(32).bool(message.boolValue);
|
|
317
|
-
}
|
|
318
|
-
if (message.structValue !== undefined) {
|
|
319
|
-
Struct.encode(Struct.wrap(message.structValue), writer.uint32(42).fork()).join();
|
|
320
|
-
}
|
|
321
|
-
if (message.listValue !== undefined) {
|
|
322
|
-
ListValue.encode(ListValue.wrap(message.listValue), writer.uint32(50).fork()).join();
|
|
323
|
-
}
|
|
324
|
-
return writer;
|
|
325
|
-
},
|
|
326
|
-
|
|
327
|
-
decode(input: BinaryReader | Uint8Array, length?: number): Value {
|
|
328
|
-
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
329
|
-
const end = length === undefined ? reader.len : reader.pos + length;
|
|
330
|
-
const message = createBaseValue();
|
|
331
|
-
while (reader.pos < end) {
|
|
332
|
-
const tag = reader.uint32();
|
|
333
|
-
switch (tag >>> 3) {
|
|
334
|
-
case 1: {
|
|
335
|
-
if (tag !== 8) {
|
|
336
|
-
break;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
message.nullValue = reader.int32() as any;
|
|
340
|
-
continue;
|
|
341
|
-
}
|
|
342
|
-
case 2: {
|
|
343
|
-
if (tag !== 17) {
|
|
344
|
-
break;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
message.numberValue = reader.double();
|
|
348
|
-
continue;
|
|
349
|
-
}
|
|
350
|
-
case 3: {
|
|
351
|
-
if (tag !== 26) {
|
|
352
|
-
break;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
message.stringValue = reader.string();
|
|
356
|
-
continue;
|
|
357
|
-
}
|
|
358
|
-
case 4: {
|
|
359
|
-
if (tag !== 32) {
|
|
360
|
-
break;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
message.boolValue = reader.bool();
|
|
364
|
-
continue;
|
|
365
|
-
}
|
|
366
|
-
case 5: {
|
|
367
|
-
if (tag !== 42) {
|
|
368
|
-
break;
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
message.structValue = Struct.unwrap(Struct.decode(reader, reader.uint32()));
|
|
372
|
-
continue;
|
|
373
|
-
}
|
|
374
|
-
case 6: {
|
|
375
|
-
if (tag !== 50) {
|
|
376
|
-
break;
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
message.listValue = ListValue.unwrap(ListValue.decode(reader, reader.uint32()));
|
|
380
|
-
continue;
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
384
|
-
break;
|
|
385
|
-
}
|
|
386
|
-
reader.skip(tag & 7);
|
|
387
|
-
}
|
|
388
|
-
return message;
|
|
389
|
-
},
|
|
390
|
-
|
|
391
|
-
fromJSON(object: any): Value {
|
|
392
|
-
return {
|
|
393
|
-
nullValue: isSet(object.nullValue) ? nullValueFromJSON(object.nullValue) : undefined,
|
|
394
|
-
numberValue: isSet(object.numberValue) ? globalThis.Number(object.numberValue) : undefined,
|
|
395
|
-
stringValue: isSet(object.stringValue) ? globalThis.String(object.stringValue) : undefined,
|
|
396
|
-
boolValue: isSet(object.boolValue) ? globalThis.Boolean(object.boolValue) : undefined,
|
|
397
|
-
structValue: isObject(object.structValue) ? object.structValue : undefined,
|
|
398
|
-
listValue: globalThis.Array.isArray(object.listValue) ? [...object.listValue] : undefined,
|
|
399
|
-
};
|
|
400
|
-
},
|
|
401
|
-
|
|
402
|
-
toJSON(message: Value): unknown {
|
|
403
|
-
const obj: any = {};
|
|
404
|
-
if (message.nullValue !== undefined) {
|
|
405
|
-
obj.nullValue = nullValueToJSON(message.nullValue);
|
|
406
|
-
}
|
|
407
|
-
if (message.numberValue !== undefined) {
|
|
408
|
-
obj.numberValue = message.numberValue;
|
|
409
|
-
}
|
|
410
|
-
if (message.stringValue !== undefined) {
|
|
411
|
-
obj.stringValue = message.stringValue;
|
|
412
|
-
}
|
|
413
|
-
if (message.boolValue !== undefined) {
|
|
414
|
-
obj.boolValue = message.boolValue;
|
|
415
|
-
}
|
|
416
|
-
if (message.structValue !== undefined) {
|
|
417
|
-
obj.structValue = message.structValue;
|
|
418
|
-
}
|
|
419
|
-
if (message.listValue !== undefined) {
|
|
420
|
-
obj.listValue = message.listValue;
|
|
421
|
-
}
|
|
422
|
-
return obj;
|
|
423
|
-
},
|
|
424
|
-
|
|
425
|
-
create<I extends Exact<DeepPartial<Value>, I>>(base?: I): Value {
|
|
426
|
-
return Value.fromPartial(base ?? ({} as any));
|
|
427
|
-
},
|
|
428
|
-
fromPartial<I extends Exact<DeepPartial<Value>, I>>(object: I): Value {
|
|
429
|
-
const message = createBaseValue();
|
|
430
|
-
message.nullValue = object.nullValue ?? undefined;
|
|
431
|
-
message.numberValue = object.numberValue ?? undefined;
|
|
432
|
-
message.stringValue = object.stringValue ?? undefined;
|
|
433
|
-
message.boolValue = object.boolValue ?? undefined;
|
|
434
|
-
message.structValue = object.structValue ?? undefined;
|
|
435
|
-
message.listValue = object.listValue ?? undefined;
|
|
436
|
-
return message;
|
|
437
|
-
},
|
|
438
|
-
|
|
439
121
|
wrap(value: any): Value {
|
|
440
|
-
const result =
|
|
122
|
+
const result = {} as any;
|
|
441
123
|
if (value === null) {
|
|
442
124
|
result.nullValue = NullValue.NULL_VALUE;
|
|
443
125
|
} else if (typeof value === "boolean") {
|
|
@@ -447,9 +129,9 @@ export const Value: MessageFns<Value> & AnyValueWrapperFns = {
|
|
|
447
129
|
} else if (typeof value === "string") {
|
|
448
130
|
result.stringValue = value;
|
|
449
131
|
} else if (globalThis.Array.isArray(value)) {
|
|
450
|
-
result.listValue = value;
|
|
132
|
+
result.listValue = ListValue.wrap(value);
|
|
451
133
|
} else if (typeof value === "object") {
|
|
452
|
-
result.structValue = value;
|
|
134
|
+
result.structValue = Struct.wrap(value);
|
|
453
135
|
} else if (typeof value !== "undefined") {
|
|
454
136
|
throw new globalThis.Error("Unsupported any value type: " + typeof value);
|
|
455
137
|
}
|
|
@@ -457,17 +139,17 @@ export const Value: MessageFns<Value> & AnyValueWrapperFns = {
|
|
|
457
139
|
},
|
|
458
140
|
|
|
459
141
|
unwrap(message: any): string | number | boolean | Object | null | Array<any> | undefined {
|
|
460
|
-
if (message.stringValue !== undefined) {
|
|
142
|
+
if (message?.hasOwnProperty("stringValue") && message.stringValue !== undefined) {
|
|
461
143
|
return message.stringValue;
|
|
462
|
-
} else if (message?.numberValue !== undefined) {
|
|
144
|
+
} else if (message?.hasOwnProperty("numberValue") && message?.numberValue !== undefined) {
|
|
463
145
|
return message.numberValue;
|
|
464
|
-
} else if (message?.boolValue !== undefined) {
|
|
146
|
+
} else if (message?.hasOwnProperty("boolValue") && message?.boolValue !== undefined) {
|
|
465
147
|
return message.boolValue;
|
|
466
|
-
} else if (message?.structValue !== undefined) {
|
|
467
|
-
return message.structValue as any;
|
|
468
|
-
} else if (message?.listValue !== undefined) {
|
|
469
|
-
return message.listValue;
|
|
470
|
-
} else if (message?.nullValue !== undefined) {
|
|
148
|
+
} else if (message?.hasOwnProperty("structValue") && message?.structValue !== undefined) {
|
|
149
|
+
return Struct.unwrap(message.structValue as any);
|
|
150
|
+
} else if (message?.hasOwnProperty("listValue") && message?.listValue !== undefined) {
|
|
151
|
+
return ListValue.unwrap(message.listValue);
|
|
152
|
+
} else if (message?.hasOwnProperty("nullValue") && message?.nullValue !== undefined) {
|
|
471
153
|
return null;
|
|
472
154
|
}
|
|
473
155
|
return undefined;
|
|
@@ -479,100 +161,24 @@ function createBaseListValue(): ListValue {
|
|
|
479
161
|
}
|
|
480
162
|
|
|
481
163
|
export const ListValue: MessageFns<ListValue> & ListValueWrapperFns = {
|
|
482
|
-
encode(message: ListValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
483
|
-
for (const v of message.values) {
|
|
484
|
-
Value.encode(Value.wrap(v!), writer.uint32(10).fork()).join();
|
|
485
|
-
}
|
|
486
|
-
return writer;
|
|
487
|
-
},
|
|
488
|
-
|
|
489
|
-
decode(input: BinaryReader | Uint8Array, length?: number): ListValue {
|
|
490
|
-
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
491
|
-
const end = length === undefined ? reader.len : reader.pos + length;
|
|
492
|
-
const message = createBaseListValue();
|
|
493
|
-
while (reader.pos < end) {
|
|
494
|
-
const tag = reader.uint32();
|
|
495
|
-
switch (tag >>> 3) {
|
|
496
|
-
case 1: {
|
|
497
|
-
if (tag !== 10) {
|
|
498
|
-
break;
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
message.values.push(Value.unwrap(Value.decode(reader, reader.uint32())));
|
|
502
|
-
continue;
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
506
|
-
break;
|
|
507
|
-
}
|
|
508
|
-
reader.skip(tag & 7);
|
|
509
|
-
}
|
|
510
|
-
return message;
|
|
511
|
-
},
|
|
512
|
-
|
|
513
|
-
fromJSON(object: any): ListValue {
|
|
514
|
-
return { values: globalThis.Array.isArray(object?.values) ? [...object.values] : [] };
|
|
515
|
-
},
|
|
516
|
-
|
|
517
|
-
toJSON(message: ListValue): unknown {
|
|
518
|
-
const obj: any = {};
|
|
519
|
-
if (message.values?.length) {
|
|
520
|
-
obj.values = message.values;
|
|
521
|
-
}
|
|
522
|
-
return obj;
|
|
523
|
-
},
|
|
524
|
-
|
|
525
|
-
create<I extends Exact<DeepPartial<ListValue>, I>>(base?: I): ListValue {
|
|
526
|
-
return ListValue.fromPartial(base ?? ({} as any));
|
|
527
|
-
},
|
|
528
|
-
fromPartial<I extends Exact<DeepPartial<ListValue>, I>>(object: I): ListValue {
|
|
529
|
-
const message = createBaseListValue();
|
|
530
|
-
message.values = object.values?.map((e) => e) || [];
|
|
531
|
-
return message;
|
|
532
|
-
},
|
|
533
|
-
|
|
534
164
|
wrap(array: Array<any> | undefined): ListValue {
|
|
535
165
|
const result = createBaseListValue();
|
|
536
|
-
result.values = array ?? [];
|
|
166
|
+
result.values = (array ?? []).map(Value.wrap);
|
|
537
167
|
return result;
|
|
538
168
|
},
|
|
539
169
|
|
|
540
170
|
unwrap(message: ListValue): Array<any> {
|
|
541
171
|
if (message?.hasOwnProperty("values") && globalThis.Array.isArray(message.values)) {
|
|
542
|
-
return message.values;
|
|
172
|
+
return message.values.map(Value.unwrap);
|
|
543
173
|
} else {
|
|
544
174
|
return message as any;
|
|
545
175
|
}
|
|
546
176
|
},
|
|
547
177
|
};
|
|
548
178
|
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
export type DeepPartial<T> = T extends Builtin ? T
|
|
552
|
-
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
|
553
|
-
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
554
|
-
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
555
|
-
: Partial<T>;
|
|
556
|
-
|
|
557
|
-
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
558
|
-
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
559
|
-
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
560
|
-
|
|
561
|
-
function isObject(value: any): boolean {
|
|
562
|
-
return typeof value === "object" && value !== null;
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
function isSet(value: any): boolean {
|
|
566
|
-
return value !== null && value !== undefined;
|
|
567
|
-
}
|
|
179
|
+
wrappers[".google.protobuf.Struct"] = { fromObject: Struct.wrap, toObject: Struct.unwrap } as any;
|
|
568
180
|
|
|
569
181
|
export interface MessageFns<T> {
|
|
570
|
-
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
571
|
-
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
572
|
-
fromJSON(object: any): T;
|
|
573
|
-
toJSON(message: T): unknown;
|
|
574
|
-
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
575
|
-
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
576
182
|
}
|
|
577
183
|
|
|
578
184
|
export interface StructWrapperFns {
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
2
|
// versions:
|
|
3
3
|
// protoc-gen-ts_proto v2.10.1
|
|
4
|
-
// protoc v6.33.
|
|
4
|
+
// protoc v6.33.1
|
|
5
5
|
// source: google/protobuf/timestamp.proto
|
|
6
6
|
|
|
7
7
|
/* eslint-disable */
|
|
8
|
-
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
9
8
|
|
|
10
9
|
export const protobufPackage = "google.protobuf";
|
|
11
10
|
|
|
@@ -117,114 +116,4 @@ export interface Timestamp {
|
|
|
117
116
|
nanos: number;
|
|
118
117
|
}
|
|
119
118
|
|
|
120
|
-
|
|
121
|
-
return { seconds: 0, nanos: 0 };
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export const Timestamp: MessageFns<Timestamp> = {
|
|
125
|
-
encode(message: Timestamp, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
126
|
-
if (message.seconds !== 0) {
|
|
127
|
-
writer.uint32(8).int64(message.seconds);
|
|
128
|
-
}
|
|
129
|
-
if (message.nanos !== 0) {
|
|
130
|
-
writer.uint32(16).int32(message.nanos);
|
|
131
|
-
}
|
|
132
|
-
return writer;
|
|
133
|
-
},
|
|
134
|
-
|
|
135
|
-
decode(input: BinaryReader | Uint8Array, length?: number): Timestamp {
|
|
136
|
-
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
137
|
-
const end = length === undefined ? reader.len : reader.pos + length;
|
|
138
|
-
const message = createBaseTimestamp();
|
|
139
|
-
while (reader.pos < end) {
|
|
140
|
-
const tag = reader.uint32();
|
|
141
|
-
switch (tag >>> 3) {
|
|
142
|
-
case 1: {
|
|
143
|
-
if (tag !== 8) {
|
|
144
|
-
break;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
message.seconds = longToNumber(reader.int64());
|
|
148
|
-
continue;
|
|
149
|
-
}
|
|
150
|
-
case 2: {
|
|
151
|
-
if (tag !== 16) {
|
|
152
|
-
break;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
message.nanos = reader.int32();
|
|
156
|
-
continue;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
160
|
-
break;
|
|
161
|
-
}
|
|
162
|
-
reader.skip(tag & 7);
|
|
163
|
-
}
|
|
164
|
-
return message;
|
|
165
|
-
},
|
|
166
|
-
|
|
167
|
-
fromJSON(object: any): Timestamp {
|
|
168
|
-
return {
|
|
169
|
-
seconds: isSet(object.seconds) ? globalThis.Number(object.seconds) : 0,
|
|
170
|
-
nanos: isSet(object.nanos) ? globalThis.Number(object.nanos) : 0,
|
|
171
|
-
};
|
|
172
|
-
},
|
|
173
|
-
|
|
174
|
-
toJSON(message: Timestamp): unknown {
|
|
175
|
-
const obj: any = {};
|
|
176
|
-
if (message.seconds !== 0) {
|
|
177
|
-
obj.seconds = Math.round(message.seconds);
|
|
178
|
-
}
|
|
179
|
-
if (message.nanos !== 0) {
|
|
180
|
-
obj.nanos = Math.round(message.nanos);
|
|
181
|
-
}
|
|
182
|
-
return obj;
|
|
183
|
-
},
|
|
184
|
-
|
|
185
|
-
create<I extends Exact<DeepPartial<Timestamp>, I>>(base?: I): Timestamp {
|
|
186
|
-
return Timestamp.fromPartial(base ?? ({} as any));
|
|
187
|
-
},
|
|
188
|
-
fromPartial<I extends Exact<DeepPartial<Timestamp>, I>>(object: I): Timestamp {
|
|
189
|
-
const message = createBaseTimestamp();
|
|
190
|
-
message.seconds = object.seconds ?? 0;
|
|
191
|
-
message.nanos = object.nanos ?? 0;
|
|
192
|
-
return message;
|
|
193
|
-
},
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
197
|
-
|
|
198
|
-
export type DeepPartial<T> = T extends Builtin ? T
|
|
199
|
-
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
|
200
|
-
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
201
|
-
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
202
|
-
: Partial<T>;
|
|
203
|
-
|
|
204
|
-
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
205
|
-
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
206
|
-
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
207
|
-
|
|
208
|
-
function longToNumber(int64: { toString(): string }): number {
|
|
209
|
-
const num = globalThis.Number(int64.toString());
|
|
210
|
-
if (num > globalThis.Number.MAX_SAFE_INTEGER) {
|
|
211
|
-
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
212
|
-
}
|
|
213
|
-
if (num < globalThis.Number.MIN_SAFE_INTEGER) {
|
|
214
|
-
throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
|
|
215
|
-
}
|
|
216
|
-
return num;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
function isSet(value: any): boolean {
|
|
220
|
-
return value !== null && value !== undefined;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
export interface MessageFns<T> {
|
|
224
|
-
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
225
|
-
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
226
|
-
fromJSON(object: any): T;
|
|
227
|
-
toJSON(message: T): unknown;
|
|
228
|
-
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
229
|
-
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
230
|
-
}
|
|
119
|
+
export const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
|