@sentio/runtime 2.59.4 → 2.60.0-rc.1

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.
@@ -665,6 +665,16 @@ export interface TemplateInstance {
665
665
  baseLabels: { [key: string]: any } | undefined;
666
666
  }
667
667
 
668
+ export interface InitResponse {
669
+ chainIds: string[];
670
+ dbSchema: DataBaseSchema | undefined;
671
+ }
672
+
673
+ export interface ConfigureHandlersRequest {
674
+ chainId: string;
675
+ templateInstances: TemplateInstance[];
676
+ }
677
+
668
678
  export interface StartRequest {
669
679
  templateInstances: TemplateInstance[];
670
680
  }
@@ -979,6 +989,15 @@ export interface ProcessStreamResponse_Partitions_PartitionsEntry {
979
989
  value: ProcessStreamResponse_Partitions_Partition | undefined;
980
990
  }
981
991
 
992
+ export interface ProcessStreamResponseV2 {
993
+ processId: number;
994
+ partitions?: ProcessStreamResponse_Partitions | undefined;
995
+ dbRequest?: DBRequest | undefined;
996
+ tsRequest?: TSRequest | undefined;
997
+ tplRequest?: TPLRequest | undefined;
998
+ result?: ProcessResult | undefined;
999
+ }
1000
+
982
1001
  export interface PreprocessStreamRequest {
983
1002
  processId: number;
984
1003
  bindings?: PreprocessStreamRequest_DataBindings | undefined;
@@ -1069,6 +1088,14 @@ export interface EntityUpdateData_FieldsEntry {
1069
1088
  value: EntityUpdateData_FieldValue | undefined;
1070
1089
  }
1071
1090
 
1091
+ export interface TPLRequest {
1092
+ templates: TemplateInstance[];
1093
+ }
1094
+
1095
+ export interface TSRequest {
1096
+ data: TimeseriesResult[];
1097
+ }
1098
+
1072
1099
  export interface DBRequest {
1073
1100
  opId: bigint;
1074
1101
  get?: DBRequest_DBGet | undefined;
@@ -4377,6 +4404,158 @@ export const TemplateInstance = {
4377
4404
  },
4378
4405
  };
4379
4406
 
4407
+ function createBaseInitResponse(): InitResponse {
4408
+ return { chainIds: [], dbSchema: undefined };
4409
+ }
4410
+
4411
+ export const InitResponse = {
4412
+ encode(message: InitResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
4413
+ for (const v of message.chainIds) {
4414
+ writer.uint32(10).string(v!);
4415
+ }
4416
+ if (message.dbSchema !== undefined) {
4417
+ DataBaseSchema.encode(message.dbSchema, writer.uint32(18).fork()).ldelim();
4418
+ }
4419
+ return writer;
4420
+ },
4421
+
4422
+ decode(input: _m0.Reader | Uint8Array, length?: number): InitResponse {
4423
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
4424
+ let end = length === undefined ? reader.len : reader.pos + length;
4425
+ const message = createBaseInitResponse();
4426
+ while (reader.pos < end) {
4427
+ const tag = reader.uint32();
4428
+ switch (tag >>> 3) {
4429
+ case 1:
4430
+ if (tag !== 10) {
4431
+ break;
4432
+ }
4433
+
4434
+ message.chainIds.push(reader.string());
4435
+ continue;
4436
+ case 2:
4437
+ if (tag !== 18) {
4438
+ break;
4439
+ }
4440
+
4441
+ message.dbSchema = DataBaseSchema.decode(reader, reader.uint32());
4442
+ continue;
4443
+ }
4444
+ if ((tag & 7) === 4 || tag === 0) {
4445
+ break;
4446
+ }
4447
+ reader.skipType(tag & 7);
4448
+ }
4449
+ return message;
4450
+ },
4451
+
4452
+ fromJSON(object: any): InitResponse {
4453
+ return {
4454
+ chainIds: globalThis.Array.isArray(object?.chainIds) ? object.chainIds.map((e: any) => globalThis.String(e)) : [],
4455
+ dbSchema: isSet(object.dbSchema) ? DataBaseSchema.fromJSON(object.dbSchema) : undefined,
4456
+ };
4457
+ },
4458
+
4459
+ toJSON(message: InitResponse): unknown {
4460
+ const obj: any = {};
4461
+ if (message.chainIds?.length) {
4462
+ obj.chainIds = message.chainIds;
4463
+ }
4464
+ if (message.dbSchema !== undefined) {
4465
+ obj.dbSchema = DataBaseSchema.toJSON(message.dbSchema);
4466
+ }
4467
+ return obj;
4468
+ },
4469
+
4470
+ create(base?: DeepPartial<InitResponse>): InitResponse {
4471
+ return InitResponse.fromPartial(base ?? {});
4472
+ },
4473
+ fromPartial(object: DeepPartial<InitResponse>): InitResponse {
4474
+ const message = createBaseInitResponse();
4475
+ message.chainIds = object.chainIds?.map((e) => e) || [];
4476
+ message.dbSchema = (object.dbSchema !== undefined && object.dbSchema !== null)
4477
+ ? DataBaseSchema.fromPartial(object.dbSchema)
4478
+ : undefined;
4479
+ return message;
4480
+ },
4481
+ };
4482
+
4483
+ function createBaseConfigureHandlersRequest(): ConfigureHandlersRequest {
4484
+ return { chainId: "", templateInstances: [] };
4485
+ }
4486
+
4487
+ export const ConfigureHandlersRequest = {
4488
+ encode(message: ConfigureHandlersRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
4489
+ if (message.chainId !== "") {
4490
+ writer.uint32(10).string(message.chainId);
4491
+ }
4492
+ for (const v of message.templateInstances) {
4493
+ TemplateInstance.encode(v!, writer.uint32(18).fork()).ldelim();
4494
+ }
4495
+ return writer;
4496
+ },
4497
+
4498
+ decode(input: _m0.Reader | Uint8Array, length?: number): ConfigureHandlersRequest {
4499
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
4500
+ let end = length === undefined ? reader.len : reader.pos + length;
4501
+ const message = createBaseConfigureHandlersRequest();
4502
+ while (reader.pos < end) {
4503
+ const tag = reader.uint32();
4504
+ switch (tag >>> 3) {
4505
+ case 1:
4506
+ if (tag !== 10) {
4507
+ break;
4508
+ }
4509
+
4510
+ message.chainId = reader.string();
4511
+ continue;
4512
+ case 2:
4513
+ if (tag !== 18) {
4514
+ break;
4515
+ }
4516
+
4517
+ message.templateInstances.push(TemplateInstance.decode(reader, reader.uint32()));
4518
+ continue;
4519
+ }
4520
+ if ((tag & 7) === 4 || tag === 0) {
4521
+ break;
4522
+ }
4523
+ reader.skipType(tag & 7);
4524
+ }
4525
+ return message;
4526
+ },
4527
+
4528
+ fromJSON(object: any): ConfigureHandlersRequest {
4529
+ return {
4530
+ chainId: isSet(object.chainId) ? globalThis.String(object.chainId) : "",
4531
+ templateInstances: globalThis.Array.isArray(object?.templateInstances)
4532
+ ? object.templateInstances.map((e: any) => TemplateInstance.fromJSON(e))
4533
+ : [],
4534
+ };
4535
+ },
4536
+
4537
+ toJSON(message: ConfigureHandlersRequest): unknown {
4538
+ const obj: any = {};
4539
+ if (message.chainId !== "") {
4540
+ obj.chainId = message.chainId;
4541
+ }
4542
+ if (message.templateInstances?.length) {
4543
+ obj.templateInstances = message.templateInstances.map((e) => TemplateInstance.toJSON(e));
4544
+ }
4545
+ return obj;
4546
+ },
4547
+
4548
+ create(base?: DeepPartial<ConfigureHandlersRequest>): ConfigureHandlersRequest {
4549
+ return ConfigureHandlersRequest.fromPartial(base ?? {});
4550
+ },
4551
+ fromPartial(object: DeepPartial<ConfigureHandlersRequest>): ConfigureHandlersRequest {
4552
+ const message = createBaseConfigureHandlersRequest();
4553
+ message.chainId = object.chainId ?? "";
4554
+ message.templateInstances = object.templateInstances?.map((e) => TemplateInstance.fromPartial(e)) || [];
4555
+ return message;
4556
+ },
4557
+ };
4558
+
4380
4559
  function createBaseStartRequest(): StartRequest {
4381
4560
  return { templateInstances: [] };
4382
4561
  }
@@ -8520,6 +8699,157 @@ export const ProcessStreamResponse_Partitions_PartitionsEntry = {
8520
8699
  },
8521
8700
  };
8522
8701
 
8702
+ function createBaseProcessStreamResponseV2(): ProcessStreamResponseV2 {
8703
+ return {
8704
+ processId: 0,
8705
+ partitions: undefined,
8706
+ dbRequest: undefined,
8707
+ tsRequest: undefined,
8708
+ tplRequest: undefined,
8709
+ result: undefined,
8710
+ };
8711
+ }
8712
+
8713
+ export const ProcessStreamResponseV2 = {
8714
+ encode(message: ProcessStreamResponseV2, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
8715
+ if (message.processId !== 0) {
8716
+ writer.uint32(8).int32(message.processId);
8717
+ }
8718
+ if (message.partitions !== undefined) {
8719
+ ProcessStreamResponse_Partitions.encode(message.partitions, writer.uint32(18).fork()).ldelim();
8720
+ }
8721
+ if (message.dbRequest !== undefined) {
8722
+ DBRequest.encode(message.dbRequest, writer.uint32(26).fork()).ldelim();
8723
+ }
8724
+ if (message.tsRequest !== undefined) {
8725
+ TSRequest.encode(message.tsRequest, writer.uint32(34).fork()).ldelim();
8726
+ }
8727
+ if (message.tplRequest !== undefined) {
8728
+ TPLRequest.encode(message.tplRequest, writer.uint32(42).fork()).ldelim();
8729
+ }
8730
+ if (message.result !== undefined) {
8731
+ ProcessResult.encode(message.result, writer.uint32(50).fork()).ldelim();
8732
+ }
8733
+ return writer;
8734
+ },
8735
+
8736
+ decode(input: _m0.Reader | Uint8Array, length?: number): ProcessStreamResponseV2 {
8737
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
8738
+ let end = length === undefined ? reader.len : reader.pos + length;
8739
+ const message = createBaseProcessStreamResponseV2();
8740
+ while (reader.pos < end) {
8741
+ const tag = reader.uint32();
8742
+ switch (tag >>> 3) {
8743
+ case 1:
8744
+ if (tag !== 8) {
8745
+ break;
8746
+ }
8747
+
8748
+ message.processId = reader.int32();
8749
+ continue;
8750
+ case 2:
8751
+ if (tag !== 18) {
8752
+ break;
8753
+ }
8754
+
8755
+ message.partitions = ProcessStreamResponse_Partitions.decode(reader, reader.uint32());
8756
+ continue;
8757
+ case 3:
8758
+ if (tag !== 26) {
8759
+ break;
8760
+ }
8761
+
8762
+ message.dbRequest = DBRequest.decode(reader, reader.uint32());
8763
+ continue;
8764
+ case 4:
8765
+ if (tag !== 34) {
8766
+ break;
8767
+ }
8768
+
8769
+ message.tsRequest = TSRequest.decode(reader, reader.uint32());
8770
+ continue;
8771
+ case 5:
8772
+ if (tag !== 42) {
8773
+ break;
8774
+ }
8775
+
8776
+ message.tplRequest = TPLRequest.decode(reader, reader.uint32());
8777
+ continue;
8778
+ case 6:
8779
+ if (tag !== 50) {
8780
+ break;
8781
+ }
8782
+
8783
+ message.result = ProcessResult.decode(reader, reader.uint32());
8784
+ continue;
8785
+ }
8786
+ if ((tag & 7) === 4 || tag === 0) {
8787
+ break;
8788
+ }
8789
+ reader.skipType(tag & 7);
8790
+ }
8791
+ return message;
8792
+ },
8793
+
8794
+ fromJSON(object: any): ProcessStreamResponseV2 {
8795
+ return {
8796
+ processId: isSet(object.processId) ? globalThis.Number(object.processId) : 0,
8797
+ partitions: isSet(object.partitions) ? ProcessStreamResponse_Partitions.fromJSON(object.partitions) : undefined,
8798
+ dbRequest: isSet(object.dbRequest) ? DBRequest.fromJSON(object.dbRequest) : undefined,
8799
+ tsRequest: isSet(object.tsRequest) ? TSRequest.fromJSON(object.tsRequest) : undefined,
8800
+ tplRequest: isSet(object.tplRequest) ? TPLRequest.fromJSON(object.tplRequest) : undefined,
8801
+ result: isSet(object.result) ? ProcessResult.fromJSON(object.result) : undefined,
8802
+ };
8803
+ },
8804
+
8805
+ toJSON(message: ProcessStreamResponseV2): unknown {
8806
+ const obj: any = {};
8807
+ if (message.processId !== 0) {
8808
+ obj.processId = Math.round(message.processId);
8809
+ }
8810
+ if (message.partitions !== undefined) {
8811
+ obj.partitions = ProcessStreamResponse_Partitions.toJSON(message.partitions);
8812
+ }
8813
+ if (message.dbRequest !== undefined) {
8814
+ obj.dbRequest = DBRequest.toJSON(message.dbRequest);
8815
+ }
8816
+ if (message.tsRequest !== undefined) {
8817
+ obj.tsRequest = TSRequest.toJSON(message.tsRequest);
8818
+ }
8819
+ if (message.tplRequest !== undefined) {
8820
+ obj.tplRequest = TPLRequest.toJSON(message.tplRequest);
8821
+ }
8822
+ if (message.result !== undefined) {
8823
+ obj.result = ProcessResult.toJSON(message.result);
8824
+ }
8825
+ return obj;
8826
+ },
8827
+
8828
+ create(base?: DeepPartial<ProcessStreamResponseV2>): ProcessStreamResponseV2 {
8829
+ return ProcessStreamResponseV2.fromPartial(base ?? {});
8830
+ },
8831
+ fromPartial(object: DeepPartial<ProcessStreamResponseV2>): ProcessStreamResponseV2 {
8832
+ const message = createBaseProcessStreamResponseV2();
8833
+ message.processId = object.processId ?? 0;
8834
+ message.partitions = (object.partitions !== undefined && object.partitions !== null)
8835
+ ? ProcessStreamResponse_Partitions.fromPartial(object.partitions)
8836
+ : undefined;
8837
+ message.dbRequest = (object.dbRequest !== undefined && object.dbRequest !== null)
8838
+ ? DBRequest.fromPartial(object.dbRequest)
8839
+ : undefined;
8840
+ message.tsRequest = (object.tsRequest !== undefined && object.tsRequest !== null)
8841
+ ? TSRequest.fromPartial(object.tsRequest)
8842
+ : undefined;
8843
+ message.tplRequest = (object.tplRequest !== undefined && object.tplRequest !== null)
8844
+ ? TPLRequest.fromPartial(object.tplRequest)
8845
+ : undefined;
8846
+ message.result = (object.result !== undefined && object.result !== null)
8847
+ ? ProcessResult.fromPartial(object.result)
8848
+ : undefined;
8849
+ return message;
8850
+ },
8851
+ };
8852
+
8523
8853
  function createBasePreprocessStreamRequest(): PreprocessStreamRequest {
8524
8854
  return { processId: 0, bindings: undefined, dbResult: undefined };
8525
8855
  }
@@ -9330,6 +9660,126 @@ export const EntityUpdateData_FieldsEntry = {
9330
9660
  },
9331
9661
  };
9332
9662
 
9663
+ function createBaseTPLRequest(): TPLRequest {
9664
+ return { templates: [] };
9665
+ }
9666
+
9667
+ export const TPLRequest = {
9668
+ encode(message: TPLRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
9669
+ for (const v of message.templates) {
9670
+ TemplateInstance.encode(v!, writer.uint32(10).fork()).ldelim();
9671
+ }
9672
+ return writer;
9673
+ },
9674
+
9675
+ decode(input: _m0.Reader | Uint8Array, length?: number): TPLRequest {
9676
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
9677
+ let end = length === undefined ? reader.len : reader.pos + length;
9678
+ const message = createBaseTPLRequest();
9679
+ while (reader.pos < end) {
9680
+ const tag = reader.uint32();
9681
+ switch (tag >>> 3) {
9682
+ case 1:
9683
+ if (tag !== 10) {
9684
+ break;
9685
+ }
9686
+
9687
+ message.templates.push(TemplateInstance.decode(reader, reader.uint32()));
9688
+ continue;
9689
+ }
9690
+ if ((tag & 7) === 4 || tag === 0) {
9691
+ break;
9692
+ }
9693
+ reader.skipType(tag & 7);
9694
+ }
9695
+ return message;
9696
+ },
9697
+
9698
+ fromJSON(object: any): TPLRequest {
9699
+ return {
9700
+ templates: globalThis.Array.isArray(object?.templates)
9701
+ ? object.templates.map((e: any) => TemplateInstance.fromJSON(e))
9702
+ : [],
9703
+ };
9704
+ },
9705
+
9706
+ toJSON(message: TPLRequest): unknown {
9707
+ const obj: any = {};
9708
+ if (message.templates?.length) {
9709
+ obj.templates = message.templates.map((e) => TemplateInstance.toJSON(e));
9710
+ }
9711
+ return obj;
9712
+ },
9713
+
9714
+ create(base?: DeepPartial<TPLRequest>): TPLRequest {
9715
+ return TPLRequest.fromPartial(base ?? {});
9716
+ },
9717
+ fromPartial(object: DeepPartial<TPLRequest>): TPLRequest {
9718
+ const message = createBaseTPLRequest();
9719
+ message.templates = object.templates?.map((e) => TemplateInstance.fromPartial(e)) || [];
9720
+ return message;
9721
+ },
9722
+ };
9723
+
9724
+ function createBaseTSRequest(): TSRequest {
9725
+ return { data: [] };
9726
+ }
9727
+
9728
+ export const TSRequest = {
9729
+ encode(message: TSRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
9730
+ for (const v of message.data) {
9731
+ TimeseriesResult.encode(v!, writer.uint32(10).fork()).ldelim();
9732
+ }
9733
+ return writer;
9734
+ },
9735
+
9736
+ decode(input: _m0.Reader | Uint8Array, length?: number): TSRequest {
9737
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
9738
+ let end = length === undefined ? reader.len : reader.pos + length;
9739
+ const message = createBaseTSRequest();
9740
+ while (reader.pos < end) {
9741
+ const tag = reader.uint32();
9742
+ switch (tag >>> 3) {
9743
+ case 1:
9744
+ if (tag !== 10) {
9745
+ break;
9746
+ }
9747
+
9748
+ message.data.push(TimeseriesResult.decode(reader, reader.uint32()));
9749
+ continue;
9750
+ }
9751
+ if ((tag & 7) === 4 || tag === 0) {
9752
+ break;
9753
+ }
9754
+ reader.skipType(tag & 7);
9755
+ }
9756
+ return message;
9757
+ },
9758
+
9759
+ fromJSON(object: any): TSRequest {
9760
+ return {
9761
+ data: globalThis.Array.isArray(object?.data) ? object.data.map((e: any) => TimeseriesResult.fromJSON(e)) : [],
9762
+ };
9763
+ },
9764
+
9765
+ toJSON(message: TSRequest): unknown {
9766
+ const obj: any = {};
9767
+ if (message.data?.length) {
9768
+ obj.data = message.data.map((e) => TimeseriesResult.toJSON(e));
9769
+ }
9770
+ return obj;
9771
+ },
9772
+
9773
+ create(base?: DeepPartial<TSRequest>): TSRequest {
9774
+ return TSRequest.fromPartial(base ?? {});
9775
+ },
9776
+ fromPartial(object: DeepPartial<TSRequest>): TSRequest {
9777
+ const message = createBaseTSRequest();
9778
+ message.data = object.data?.map((e) => TimeseriesResult.fromPartial(e)) || [];
9779
+ return message;
9780
+ },
9781
+ };
9782
+
9333
9783
  function createBaseDBRequest(): DBRequest {
9334
9784
  return {
9335
9785
  opId: BigInt("0"),
@@ -14544,6 +14994,62 @@ export interface ProcessorClient<CallOptionsExt = {}> {
14544
14994
  ): AsyncIterable<PreprocessStreamResponse>;
14545
14995
  }
14546
14996
 
14997
+ export type ProcessorV2Definition = typeof ProcessorV2Definition;
14998
+ export const ProcessorV2Definition = {
14999
+ name: "ProcessorV2",
15000
+ fullName: "processor.ProcessorV2",
15001
+ methods: {
15002
+ init: {
15003
+ name: "Init",
15004
+ requestType: Empty,
15005
+ requestStream: false,
15006
+ responseType: InitResponse,
15007
+ responseStream: false,
15008
+ options: {},
15009
+ },
15010
+ configureHandlers: {
15011
+ name: "ConfigureHandlers",
15012
+ requestType: ConfigureHandlersRequest,
15013
+ requestStream: false,
15014
+ responseType: ProcessConfigResponse,
15015
+ responseStream: false,
15016
+ options: {},
15017
+ },
15018
+ processBindingsStream: {
15019
+ name: "ProcessBindingsStream",
15020
+ requestType: ProcessStreamRequest,
15021
+ requestStream: true,
15022
+ responseType: ProcessStreamResponseV2,
15023
+ responseStream: true,
15024
+ options: {},
15025
+ },
15026
+ },
15027
+ } as const;
15028
+
15029
+ export interface ProcessorV2ServiceImplementation<CallContextExt = {}> {
15030
+ init(request: Empty, context: CallContext & CallContextExt): Promise<DeepPartial<InitResponse>>;
15031
+ configureHandlers(
15032
+ request: ConfigureHandlersRequest,
15033
+ context: CallContext & CallContextExt,
15034
+ ): Promise<DeepPartial<ProcessConfigResponse>>;
15035
+ processBindingsStream(
15036
+ request: AsyncIterable<ProcessStreamRequest>,
15037
+ context: CallContext & CallContextExt,
15038
+ ): ServerStreamingMethodResult<DeepPartial<ProcessStreamResponseV2>>;
15039
+ }
15040
+
15041
+ export interface ProcessorV2Client<CallOptionsExt = {}> {
15042
+ init(request: DeepPartial<Empty>, options?: CallOptions & CallOptionsExt): Promise<InitResponse>;
15043
+ configureHandlers(
15044
+ request: DeepPartial<ConfigureHandlersRequest>,
15045
+ options?: CallOptions & CallOptionsExt,
15046
+ ): Promise<ProcessConfigResponse>;
15047
+ processBindingsStream(
15048
+ request: AsyncIterable<DeepPartial<ProcessStreamRequest>>,
15049
+ options?: CallOptions & CallOptionsExt,
15050
+ ): AsyncIterable<ProcessStreamResponseV2>;
15051
+ }
15052
+
14547
15053
  type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
14548
15054
 
14549
15055
  type DeepPartial<T> = T extends Builtin ? T