@sentio/runtime 0.0.0-rc.a
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/LICENSE +55 -0
- package/lib/chunk-DYOBLZD3.js +80341 -0
- package/lib/chunk-DYOBLZD3.js.map +1 -0
- package/lib/index.d.ts +663 -0
- package/lib/index.js +127 -0
- package/lib/index.js.map +1 -0
- package/lib/processor-runner.d.ts +34 -0
- package/lib/processor-runner.js +41155 -0
- package/lib/processor-runner.js.map +1 -0
- package/package.json +63 -0
- package/src/action-server.ts +18 -0
- package/src/chain-config.ts +5 -0
- package/src/db-context.ts +227 -0
- package/src/decode-benchmark.ts +28 -0
- package/src/endpoints.ts +11 -0
- package/src/full-service.ts +339 -0
- package/src/gen/google/protobuf/empty.ts +56 -0
- package/src/gen/google/protobuf/struct.ts +494 -0
- package/src/gen/google/protobuf/timestamp.ts +106 -0
- package/src/gen/processor/protos/processor.ts +13640 -0
- package/src/gen/service/common/protos/common.ts +14452 -0
- package/src/global-config.ts +33 -0
- package/src/index.ts +10 -0
- package/src/logger.ts +59 -0
- package/src/metrics.ts +202 -0
- package/src/multicall.ts +1615 -0
- package/src/otlp.ts +59 -0
- package/src/plugin.ts +120 -0
- package/src/processor-runner.ts +226 -0
- package/src/provider.ts +195 -0
- package/src/service-manager.ts +263 -0
- package/src/service-worker.ts +116 -0
- package/src/service.ts +505 -0
- package/src/state.ts +83 -0
- package/src/tsup.config.ts +16 -0
- package/src/utils.ts +93 -0
@@ -0,0 +1,56 @@
|
|
1
|
+
/* eslint-disable */
|
2
|
+
import _m0 from "protobufjs/minimal.js";
|
3
|
+
|
4
|
+
export interface Empty {
|
5
|
+
}
|
6
|
+
|
7
|
+
function createBaseEmpty(): Empty {
|
8
|
+
return {};
|
9
|
+
}
|
10
|
+
|
11
|
+
export const Empty = {
|
12
|
+
encode(_: Empty, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
13
|
+
return writer;
|
14
|
+
},
|
15
|
+
|
16
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): Empty {
|
17
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
18
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
19
|
+
const message = createBaseEmpty();
|
20
|
+
while (reader.pos < end) {
|
21
|
+
const tag = reader.uint32();
|
22
|
+
switch (tag >>> 3) {
|
23
|
+
}
|
24
|
+
if ((tag & 7) === 4 || tag === 0) {
|
25
|
+
break;
|
26
|
+
}
|
27
|
+
reader.skipType(tag & 7);
|
28
|
+
}
|
29
|
+
return message;
|
30
|
+
},
|
31
|
+
|
32
|
+
fromJSON(_: any): Empty {
|
33
|
+
return {};
|
34
|
+
},
|
35
|
+
|
36
|
+
toJSON(_: Empty): unknown {
|
37
|
+
const obj: any = {};
|
38
|
+
return obj;
|
39
|
+
},
|
40
|
+
|
41
|
+
create(base?: DeepPartial<Empty>): Empty {
|
42
|
+
return Empty.fromPartial(base ?? {});
|
43
|
+
},
|
44
|
+
fromPartial(_: DeepPartial<Empty>): Empty {
|
45
|
+
const message = createBaseEmpty();
|
46
|
+
return message;
|
47
|
+
},
|
48
|
+
};
|
49
|
+
|
50
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
|
51
|
+
|
52
|
+
type DeepPartial<T> = T extends Builtin ? T
|
53
|
+
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
54
|
+
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
55
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
56
|
+
: Partial<T>;
|
@@ -0,0 +1,494 @@
|
|
1
|
+
/* eslint-disable */
|
2
|
+
import _m0 from "protobufjs/minimal.js";
|
3
|
+
|
4
|
+
export enum NullValue {
|
5
|
+
NULL_VALUE = 0,
|
6
|
+
UNRECOGNIZED = -1,
|
7
|
+
}
|
8
|
+
|
9
|
+
export function nullValueFromJSON(object: any): NullValue {
|
10
|
+
switch (object) {
|
11
|
+
case 0:
|
12
|
+
case "NULL_VALUE":
|
13
|
+
return NullValue.NULL_VALUE;
|
14
|
+
case -1:
|
15
|
+
case "UNRECOGNIZED":
|
16
|
+
default:
|
17
|
+
return NullValue.UNRECOGNIZED;
|
18
|
+
}
|
19
|
+
}
|
20
|
+
|
21
|
+
export function nullValueToJSON(object: NullValue): string {
|
22
|
+
switch (object) {
|
23
|
+
case NullValue.NULL_VALUE:
|
24
|
+
return "NULL_VALUE";
|
25
|
+
case NullValue.UNRECOGNIZED:
|
26
|
+
default:
|
27
|
+
return "UNRECOGNIZED";
|
28
|
+
}
|
29
|
+
}
|
30
|
+
|
31
|
+
export interface Struct {
|
32
|
+
fields: { [key: string]: any | undefined };
|
33
|
+
}
|
34
|
+
|
35
|
+
export interface Struct_FieldsEntry {
|
36
|
+
key: string;
|
37
|
+
value: any | undefined;
|
38
|
+
}
|
39
|
+
|
40
|
+
export interface Value {
|
41
|
+
nullValue?: NullValue | undefined;
|
42
|
+
numberValue?: number | undefined;
|
43
|
+
stringValue?: string | undefined;
|
44
|
+
boolValue?: boolean | undefined;
|
45
|
+
structValue?: { [key: string]: any } | undefined;
|
46
|
+
listValue?: Array<any> | undefined;
|
47
|
+
}
|
48
|
+
|
49
|
+
export interface ListValue {
|
50
|
+
values: any[];
|
51
|
+
}
|
52
|
+
|
53
|
+
function createBaseStruct(): Struct {
|
54
|
+
return { fields: {} };
|
55
|
+
}
|
56
|
+
|
57
|
+
export const Struct = {
|
58
|
+
encode(message: Struct, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
59
|
+
Object.entries(message.fields).forEach(([key, value]) => {
|
60
|
+
if (value !== undefined) {
|
61
|
+
Struct_FieldsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).ldelim();
|
62
|
+
}
|
63
|
+
});
|
64
|
+
return writer;
|
65
|
+
},
|
66
|
+
|
67
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): Struct {
|
68
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
69
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
70
|
+
const message = createBaseStruct();
|
71
|
+
while (reader.pos < end) {
|
72
|
+
const tag = reader.uint32();
|
73
|
+
switch (tag >>> 3) {
|
74
|
+
case 1:
|
75
|
+
if (tag !== 10) {
|
76
|
+
break;
|
77
|
+
}
|
78
|
+
|
79
|
+
const entry1 = Struct_FieldsEntry.decode(reader, reader.uint32());
|
80
|
+
if (entry1.value !== undefined) {
|
81
|
+
message.fields[entry1.key] = entry1.value;
|
82
|
+
}
|
83
|
+
continue;
|
84
|
+
}
|
85
|
+
if ((tag & 7) === 4 || tag === 0) {
|
86
|
+
break;
|
87
|
+
}
|
88
|
+
reader.skipType(tag & 7);
|
89
|
+
}
|
90
|
+
return message;
|
91
|
+
},
|
92
|
+
|
93
|
+
fromJSON(object: any): Struct {
|
94
|
+
return {
|
95
|
+
fields: isObject(object.fields)
|
96
|
+
? Object.entries(object.fields).reduce<{ [key: string]: any | undefined }>((acc, [key, value]) => {
|
97
|
+
acc[key] = value as any | undefined;
|
98
|
+
return acc;
|
99
|
+
}, {})
|
100
|
+
: {},
|
101
|
+
};
|
102
|
+
},
|
103
|
+
|
104
|
+
toJSON(message: Struct): unknown {
|
105
|
+
const obj: any = {};
|
106
|
+
if (message.fields) {
|
107
|
+
const entries = Object.entries(message.fields);
|
108
|
+
if (entries.length > 0) {
|
109
|
+
obj.fields = {};
|
110
|
+
entries.forEach(([k, v]) => {
|
111
|
+
obj.fields[k] = v;
|
112
|
+
});
|
113
|
+
}
|
114
|
+
}
|
115
|
+
return obj;
|
116
|
+
},
|
117
|
+
|
118
|
+
create(base?: DeepPartial<Struct>): Struct {
|
119
|
+
return Struct.fromPartial(base ?? {});
|
120
|
+
},
|
121
|
+
fromPartial(object: DeepPartial<Struct>): Struct {
|
122
|
+
const message = createBaseStruct();
|
123
|
+
message.fields = Object.entries(object.fields ?? {}).reduce<{ [key: string]: any | undefined }>(
|
124
|
+
(acc, [key, value]) => {
|
125
|
+
if (value !== undefined) {
|
126
|
+
acc[key] = value;
|
127
|
+
}
|
128
|
+
return acc;
|
129
|
+
},
|
130
|
+
{},
|
131
|
+
);
|
132
|
+
return message;
|
133
|
+
},
|
134
|
+
|
135
|
+
wrap(object: { [key: string]: any } | undefined): Struct {
|
136
|
+
const struct = createBaseStruct();
|
137
|
+
|
138
|
+
if (object !== undefined) {
|
139
|
+
for (const key of Object.keys(object)) {
|
140
|
+
struct.fields[key] = object[key];
|
141
|
+
}
|
142
|
+
}
|
143
|
+
return struct;
|
144
|
+
},
|
145
|
+
|
146
|
+
unwrap(message: Struct): { [key: string]: any } {
|
147
|
+
const object: { [key: string]: any } = {};
|
148
|
+
if (message.fields) {
|
149
|
+
for (const key of Object.keys(message.fields)) {
|
150
|
+
object[key] = message.fields[key];
|
151
|
+
}
|
152
|
+
}
|
153
|
+
return object;
|
154
|
+
},
|
155
|
+
};
|
156
|
+
|
157
|
+
function createBaseStruct_FieldsEntry(): Struct_FieldsEntry {
|
158
|
+
return { key: "", value: undefined };
|
159
|
+
}
|
160
|
+
|
161
|
+
export const Struct_FieldsEntry = {
|
162
|
+
encode(message: Struct_FieldsEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
163
|
+
if (message.key !== "") {
|
164
|
+
writer.uint32(10).string(message.key);
|
165
|
+
}
|
166
|
+
if (message.value !== undefined) {
|
167
|
+
Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).ldelim();
|
168
|
+
}
|
169
|
+
return writer;
|
170
|
+
},
|
171
|
+
|
172
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): Struct_FieldsEntry {
|
173
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
174
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
175
|
+
const message = createBaseStruct_FieldsEntry();
|
176
|
+
while (reader.pos < end) {
|
177
|
+
const tag = reader.uint32();
|
178
|
+
switch (tag >>> 3) {
|
179
|
+
case 1:
|
180
|
+
if (tag !== 10) {
|
181
|
+
break;
|
182
|
+
}
|
183
|
+
|
184
|
+
message.key = reader.string();
|
185
|
+
continue;
|
186
|
+
case 2:
|
187
|
+
if (tag !== 18) {
|
188
|
+
break;
|
189
|
+
}
|
190
|
+
|
191
|
+
message.value = Value.unwrap(Value.decode(reader, reader.uint32()));
|
192
|
+
continue;
|
193
|
+
}
|
194
|
+
if ((tag & 7) === 4 || tag === 0) {
|
195
|
+
break;
|
196
|
+
}
|
197
|
+
reader.skipType(tag & 7);
|
198
|
+
}
|
199
|
+
return message;
|
200
|
+
},
|
201
|
+
|
202
|
+
fromJSON(object: any): Struct_FieldsEntry {
|
203
|
+
return {
|
204
|
+
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
205
|
+
value: isSet(object?.value) ? object.value : undefined,
|
206
|
+
};
|
207
|
+
},
|
208
|
+
|
209
|
+
toJSON(message: Struct_FieldsEntry): unknown {
|
210
|
+
const obj: any = {};
|
211
|
+
if (message.key !== "") {
|
212
|
+
obj.key = message.key;
|
213
|
+
}
|
214
|
+
if (message.value !== undefined) {
|
215
|
+
obj.value = message.value;
|
216
|
+
}
|
217
|
+
return obj;
|
218
|
+
},
|
219
|
+
|
220
|
+
create(base?: DeepPartial<Struct_FieldsEntry>): Struct_FieldsEntry {
|
221
|
+
return Struct_FieldsEntry.fromPartial(base ?? {});
|
222
|
+
},
|
223
|
+
fromPartial(object: DeepPartial<Struct_FieldsEntry>): Struct_FieldsEntry {
|
224
|
+
const message = createBaseStruct_FieldsEntry();
|
225
|
+
message.key = object.key ?? "";
|
226
|
+
message.value = object.value ?? undefined;
|
227
|
+
return message;
|
228
|
+
},
|
229
|
+
};
|
230
|
+
|
231
|
+
function createBaseValue(): Value {
|
232
|
+
return {
|
233
|
+
nullValue: undefined,
|
234
|
+
numberValue: undefined,
|
235
|
+
stringValue: undefined,
|
236
|
+
boolValue: undefined,
|
237
|
+
structValue: undefined,
|
238
|
+
listValue: undefined,
|
239
|
+
};
|
240
|
+
}
|
241
|
+
|
242
|
+
export const Value = {
|
243
|
+
encode(message: Value, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
244
|
+
if (message.nullValue !== undefined) {
|
245
|
+
writer.uint32(8).int32(message.nullValue);
|
246
|
+
}
|
247
|
+
if (message.numberValue !== undefined) {
|
248
|
+
writer.uint32(17).double(message.numberValue);
|
249
|
+
}
|
250
|
+
if (message.stringValue !== undefined) {
|
251
|
+
writer.uint32(26).string(message.stringValue);
|
252
|
+
}
|
253
|
+
if (message.boolValue !== undefined) {
|
254
|
+
writer.uint32(32).bool(message.boolValue);
|
255
|
+
}
|
256
|
+
if (message.structValue !== undefined) {
|
257
|
+
Struct.encode(Struct.wrap(message.structValue), writer.uint32(42).fork()).ldelim();
|
258
|
+
}
|
259
|
+
if (message.listValue !== undefined) {
|
260
|
+
ListValue.encode(ListValue.wrap(message.listValue), writer.uint32(50).fork()).ldelim();
|
261
|
+
}
|
262
|
+
return writer;
|
263
|
+
},
|
264
|
+
|
265
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): Value {
|
266
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
267
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
268
|
+
const message = createBaseValue();
|
269
|
+
while (reader.pos < end) {
|
270
|
+
const tag = reader.uint32();
|
271
|
+
switch (tag >>> 3) {
|
272
|
+
case 1:
|
273
|
+
if (tag !== 8) {
|
274
|
+
break;
|
275
|
+
}
|
276
|
+
|
277
|
+
message.nullValue = reader.int32() as any;
|
278
|
+
continue;
|
279
|
+
case 2:
|
280
|
+
if (tag !== 17) {
|
281
|
+
break;
|
282
|
+
}
|
283
|
+
|
284
|
+
message.numberValue = reader.double();
|
285
|
+
continue;
|
286
|
+
case 3:
|
287
|
+
if (tag !== 26) {
|
288
|
+
break;
|
289
|
+
}
|
290
|
+
|
291
|
+
message.stringValue = reader.string();
|
292
|
+
continue;
|
293
|
+
case 4:
|
294
|
+
if (tag !== 32) {
|
295
|
+
break;
|
296
|
+
}
|
297
|
+
|
298
|
+
message.boolValue = reader.bool();
|
299
|
+
continue;
|
300
|
+
case 5:
|
301
|
+
if (tag !== 42) {
|
302
|
+
break;
|
303
|
+
}
|
304
|
+
|
305
|
+
message.structValue = Struct.unwrap(Struct.decode(reader, reader.uint32()));
|
306
|
+
continue;
|
307
|
+
case 6:
|
308
|
+
if (tag !== 50) {
|
309
|
+
break;
|
310
|
+
}
|
311
|
+
|
312
|
+
message.listValue = ListValue.unwrap(ListValue.decode(reader, reader.uint32()));
|
313
|
+
continue;
|
314
|
+
}
|
315
|
+
if ((tag & 7) === 4 || tag === 0) {
|
316
|
+
break;
|
317
|
+
}
|
318
|
+
reader.skipType(tag & 7);
|
319
|
+
}
|
320
|
+
return message;
|
321
|
+
},
|
322
|
+
|
323
|
+
fromJSON(object: any): Value {
|
324
|
+
return {
|
325
|
+
nullValue: isSet(object.nullValue) ? nullValueFromJSON(object.nullValue) : undefined,
|
326
|
+
numberValue: isSet(object.numberValue) ? globalThis.Number(object.numberValue) : undefined,
|
327
|
+
stringValue: isSet(object.stringValue) ? globalThis.String(object.stringValue) : undefined,
|
328
|
+
boolValue: isSet(object.boolValue) ? globalThis.Boolean(object.boolValue) : undefined,
|
329
|
+
structValue: isObject(object.structValue) ? object.structValue : undefined,
|
330
|
+
listValue: globalThis.Array.isArray(object.listValue) ? [...object.listValue] : undefined,
|
331
|
+
};
|
332
|
+
},
|
333
|
+
|
334
|
+
toJSON(message: Value): unknown {
|
335
|
+
const obj: any = {};
|
336
|
+
if (message.nullValue !== undefined) {
|
337
|
+
obj.nullValue = nullValueToJSON(message.nullValue);
|
338
|
+
}
|
339
|
+
if (message.numberValue !== undefined) {
|
340
|
+
obj.numberValue = message.numberValue;
|
341
|
+
}
|
342
|
+
if (message.stringValue !== undefined) {
|
343
|
+
obj.stringValue = message.stringValue;
|
344
|
+
}
|
345
|
+
if (message.boolValue !== undefined) {
|
346
|
+
obj.boolValue = message.boolValue;
|
347
|
+
}
|
348
|
+
if (message.structValue !== undefined) {
|
349
|
+
obj.structValue = message.structValue;
|
350
|
+
}
|
351
|
+
if (message.listValue !== undefined) {
|
352
|
+
obj.listValue = message.listValue;
|
353
|
+
}
|
354
|
+
return obj;
|
355
|
+
},
|
356
|
+
|
357
|
+
create(base?: DeepPartial<Value>): Value {
|
358
|
+
return Value.fromPartial(base ?? {});
|
359
|
+
},
|
360
|
+
fromPartial(object: DeepPartial<Value>): Value {
|
361
|
+
const message = createBaseValue();
|
362
|
+
message.nullValue = object.nullValue ?? undefined;
|
363
|
+
message.numberValue = object.numberValue ?? undefined;
|
364
|
+
message.stringValue = object.stringValue ?? undefined;
|
365
|
+
message.boolValue = object.boolValue ?? undefined;
|
366
|
+
message.structValue = object.structValue ?? undefined;
|
367
|
+
message.listValue = object.listValue ?? undefined;
|
368
|
+
return message;
|
369
|
+
},
|
370
|
+
|
371
|
+
wrap(value: any): Value {
|
372
|
+
const result = createBaseValue();
|
373
|
+
if (value === null) {
|
374
|
+
result.nullValue = NullValue.NULL_VALUE;
|
375
|
+
} else if (typeof value === "boolean") {
|
376
|
+
result.boolValue = value;
|
377
|
+
} else if (typeof value === "number") {
|
378
|
+
result.numberValue = value;
|
379
|
+
} else if (typeof value === "string") {
|
380
|
+
result.stringValue = value;
|
381
|
+
} else if (globalThis.Array.isArray(value)) {
|
382
|
+
result.listValue = value;
|
383
|
+
} else if (typeof value === "object") {
|
384
|
+
result.structValue = value;
|
385
|
+
} else if (typeof value !== "undefined") {
|
386
|
+
throw new globalThis.Error("Unsupported any value type: " + typeof value);
|
387
|
+
}
|
388
|
+
return result;
|
389
|
+
},
|
390
|
+
|
391
|
+
unwrap(message: any): string | number | boolean | Object | null | Array<any> | undefined {
|
392
|
+
if (message.stringValue !== undefined) {
|
393
|
+
return message.stringValue;
|
394
|
+
} else if (message?.numberValue !== undefined) {
|
395
|
+
return message.numberValue;
|
396
|
+
} else if (message?.boolValue !== undefined) {
|
397
|
+
return message.boolValue;
|
398
|
+
} else if (message?.structValue !== undefined) {
|
399
|
+
return message.structValue as any;
|
400
|
+
} else if (message?.listValue !== undefined) {
|
401
|
+
return message.listValue;
|
402
|
+
} else if (message?.nullValue !== undefined) {
|
403
|
+
return null;
|
404
|
+
}
|
405
|
+
return undefined;
|
406
|
+
},
|
407
|
+
};
|
408
|
+
|
409
|
+
function createBaseListValue(): ListValue {
|
410
|
+
return { values: [] };
|
411
|
+
}
|
412
|
+
|
413
|
+
export const ListValue = {
|
414
|
+
encode(message: ListValue, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
415
|
+
for (const v of message.values) {
|
416
|
+
Value.encode(Value.wrap(v!), writer.uint32(10).fork()).ldelim();
|
417
|
+
}
|
418
|
+
return writer;
|
419
|
+
},
|
420
|
+
|
421
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): ListValue {
|
422
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
423
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
424
|
+
const message = createBaseListValue();
|
425
|
+
while (reader.pos < end) {
|
426
|
+
const tag = reader.uint32();
|
427
|
+
switch (tag >>> 3) {
|
428
|
+
case 1:
|
429
|
+
if (tag !== 10) {
|
430
|
+
break;
|
431
|
+
}
|
432
|
+
|
433
|
+
message.values.push(Value.unwrap(Value.decode(reader, reader.uint32())));
|
434
|
+
continue;
|
435
|
+
}
|
436
|
+
if ((tag & 7) === 4 || tag === 0) {
|
437
|
+
break;
|
438
|
+
}
|
439
|
+
reader.skipType(tag & 7);
|
440
|
+
}
|
441
|
+
return message;
|
442
|
+
},
|
443
|
+
|
444
|
+
fromJSON(object: any): ListValue {
|
445
|
+
return { values: globalThis.Array.isArray(object?.values) ? [...object.values] : [] };
|
446
|
+
},
|
447
|
+
|
448
|
+
toJSON(message: ListValue): unknown {
|
449
|
+
const obj: any = {};
|
450
|
+
if (message.values?.length) {
|
451
|
+
obj.values = message.values;
|
452
|
+
}
|
453
|
+
return obj;
|
454
|
+
},
|
455
|
+
|
456
|
+
create(base?: DeepPartial<ListValue>): ListValue {
|
457
|
+
return ListValue.fromPartial(base ?? {});
|
458
|
+
},
|
459
|
+
fromPartial(object: DeepPartial<ListValue>): ListValue {
|
460
|
+
const message = createBaseListValue();
|
461
|
+
message.values = object.values?.map((e) => e) || [];
|
462
|
+
return message;
|
463
|
+
},
|
464
|
+
|
465
|
+
wrap(array: Array<any> | undefined): ListValue {
|
466
|
+
const result = createBaseListValue();
|
467
|
+
result.values = array ?? [];
|
468
|
+
return result;
|
469
|
+
},
|
470
|
+
|
471
|
+
unwrap(message: ListValue): Array<any> {
|
472
|
+
if (message?.hasOwnProperty("values") && globalThis.Array.isArray(message.values)) {
|
473
|
+
return message.values;
|
474
|
+
} else {
|
475
|
+
return message as any;
|
476
|
+
}
|
477
|
+
},
|
478
|
+
};
|
479
|
+
|
480
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
|
481
|
+
|
482
|
+
type DeepPartial<T> = T extends Builtin ? T
|
483
|
+
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
484
|
+
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
485
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
486
|
+
: Partial<T>;
|
487
|
+
|
488
|
+
function isObject(value: any): boolean {
|
489
|
+
return typeof value === "object" && value !== null;
|
490
|
+
}
|
491
|
+
|
492
|
+
function isSet(value: any): boolean {
|
493
|
+
return value !== null && value !== undefined;
|
494
|
+
}
|
@@ -0,0 +1,106 @@
|
|
1
|
+
/* eslint-disable */
|
2
|
+
import Long from "long";
|
3
|
+
import _m0 from "protobufjs/minimal.js";
|
4
|
+
|
5
|
+
export interface Timestamp {
|
6
|
+
seconds: bigint;
|
7
|
+
nanos: number;
|
8
|
+
}
|
9
|
+
|
10
|
+
function createBaseTimestamp(): Timestamp {
|
11
|
+
return { seconds: BigInt("0"), nanos: 0 };
|
12
|
+
}
|
13
|
+
|
14
|
+
export const Timestamp = {
|
15
|
+
encode(message: Timestamp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
16
|
+
if (message.seconds !== BigInt("0")) {
|
17
|
+
if (BigInt.asIntN(64, message.seconds) !== message.seconds) {
|
18
|
+
throw new globalThis.Error("value provided for field message.seconds of type int64 too large");
|
19
|
+
}
|
20
|
+
writer.uint32(8).int64(message.seconds.toString());
|
21
|
+
}
|
22
|
+
if (message.nanos !== 0) {
|
23
|
+
writer.uint32(16).int32(message.nanos);
|
24
|
+
}
|
25
|
+
return writer;
|
26
|
+
},
|
27
|
+
|
28
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): Timestamp {
|
29
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
30
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
31
|
+
const message = createBaseTimestamp();
|
32
|
+
while (reader.pos < end) {
|
33
|
+
const tag = reader.uint32();
|
34
|
+
switch (tag >>> 3) {
|
35
|
+
case 1:
|
36
|
+
if (tag !== 8) {
|
37
|
+
break;
|
38
|
+
}
|
39
|
+
|
40
|
+
message.seconds = longToBigint(reader.int64() as Long);
|
41
|
+
continue;
|
42
|
+
case 2:
|
43
|
+
if (tag !== 16) {
|
44
|
+
break;
|
45
|
+
}
|
46
|
+
|
47
|
+
message.nanos = reader.int32();
|
48
|
+
continue;
|
49
|
+
}
|
50
|
+
if ((tag & 7) === 4 || tag === 0) {
|
51
|
+
break;
|
52
|
+
}
|
53
|
+
reader.skipType(tag & 7);
|
54
|
+
}
|
55
|
+
return message;
|
56
|
+
},
|
57
|
+
|
58
|
+
fromJSON(object: any): Timestamp {
|
59
|
+
return {
|
60
|
+
seconds: isSet(object.seconds) ? BigInt(object.seconds) : BigInt("0"),
|
61
|
+
nanos: isSet(object.nanos) ? globalThis.Number(object.nanos) : 0,
|
62
|
+
};
|
63
|
+
},
|
64
|
+
|
65
|
+
toJSON(message: Timestamp): unknown {
|
66
|
+
const obj: any = {};
|
67
|
+
if (message.seconds !== BigInt("0")) {
|
68
|
+
obj.seconds = message.seconds.toString();
|
69
|
+
}
|
70
|
+
if (message.nanos !== 0) {
|
71
|
+
obj.nanos = Math.round(message.nanos);
|
72
|
+
}
|
73
|
+
return obj;
|
74
|
+
},
|
75
|
+
|
76
|
+
create(base?: DeepPartial<Timestamp>): Timestamp {
|
77
|
+
return Timestamp.fromPartial(base ?? {});
|
78
|
+
},
|
79
|
+
fromPartial(object: DeepPartial<Timestamp>): Timestamp {
|
80
|
+
const message = createBaseTimestamp();
|
81
|
+
message.seconds = object.seconds ?? BigInt("0");
|
82
|
+
message.nanos = object.nanos ?? 0;
|
83
|
+
return message;
|
84
|
+
},
|
85
|
+
};
|
86
|
+
|
87
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
|
88
|
+
|
89
|
+
type DeepPartial<T> = T extends Builtin ? T
|
90
|
+
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
91
|
+
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
92
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
93
|
+
: Partial<T>;
|
94
|
+
|
95
|
+
function longToBigint(long: Long) {
|
96
|
+
return BigInt(long.toString());
|
97
|
+
}
|
98
|
+
|
99
|
+
if (_m0.util.Long !== Long) {
|
100
|
+
_m0.util.Long = Long as any;
|
101
|
+
_m0.configure();
|
102
|
+
}
|
103
|
+
|
104
|
+
function isSet(value: any): boolean {
|
105
|
+
return value !== null && value !== undefined;
|
106
|
+
}
|