@sentio/runtime 2.59.0-rc.9 → 2.59.1-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.
@@ -6,7 +6,7 @@ import {
6
6
  __require,
7
7
  __toCommonJS,
8
8
  __toESM
9
- } from "./chunk-3T4PWGQU.js";
9
+ } from "./chunk-LCS6SRJY.js";
10
10
 
11
11
  // ../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/format.js
12
12
  var require_format = __commonJS({
@@ -10972,4 +10972,4 @@ export {
10972
10972
  safe-buffer/index.js:
10973
10973
  (*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
10974
10974
  */
10975
- //# sourceMappingURL=chunk-GD7EL7GH.js.map
10975
+ //# sourceMappingURL=chunk-U5UZYRQ4.js.map
package/lib/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _sentio_protos from '@sentio/protos';
2
- import { DeepPartial as DeepPartial$1, DBResponse, ProcessStreamResponse, DBRequest_DBUpsert, DBRequest, HandlerType, ProcessConfigResponse, StartRequest, DataBinding, PreparedData, ProcessResult, PreprocessResult, TemplateInstance, EthCallParam, ProcessorServiceImplementation, ProcessConfigRequest, Empty, ProcessBindingsRequest, ProcessBindingResponse, ProcessStreamRequest, PreprocessStreamRequest, PreprocessStreamResponse } from '@sentio/protos';
2
+ import { DeepPartial as DeepPartial$1, DBResponse, ProcessStreamResponse, DBRequest_DBUpsert, DBRequest, HandlerType, ProcessConfigResponse, StartRequest, DataBinding, PreparedData, ProcessResult, PreprocessResult, ProcessStreamResponse_Partitions, TemplateInstance, EthCallParam, ProcessorServiceImplementation, ProcessConfigRequest, Empty, ProcessBindingsRequest, ProcessBindingResponse, ProcessStreamRequest, PreprocessStreamRequest, PreprocessStreamResponse } from '@sentio/protos';
3
3
  import { Subject } from 'rxjs';
4
4
  import { AsyncLocalStorage } from 'node:async_hooks';
5
5
  import { Required } from 'utility-types';
@@ -65,6 +65,7 @@ declare abstract class Plugin {
65
65
  preprocessBinding(request: DataBinding, preprocessStore: {
66
66
  [k: string]: any;
67
67
  }): Promise<PreprocessResult>;
68
+ partition(request: DataBinding): Promise<ProcessStreamResponse_Partitions>;
68
69
  /**
69
70
  * method used by action server only
70
71
  * @param port
@@ -90,6 +91,7 @@ declare class PluginManager {
90
91
  */
91
92
  stateDiff(config: ProcessConfigResponse): boolean;
92
93
  processBinding(request: DataBinding, preparedData: PreparedData | undefined, dbContext?: IStoreContext): Promise<ProcessResult>;
94
+ partition(request: DataBinding): Promise<ProcessStreamResponse_Partitions>;
93
95
  preprocessBinding(request: DataBinding, preprocessStore: {
94
96
  [k: string]: any;
95
97
  }, dbContext?: StoreContext): Promise<PreprocessResult>;
@@ -125,6 +127,7 @@ declare class TemplateInstanceState extends ListStateStorage<TemplateInstance> {
125
127
  }
126
128
 
127
129
  declare function mergeProcessResults(results: ProcessResult[]): Required<ProcessResult, 'states'>;
130
+ declare function mergeProcessResultsInPlace(res: ProcessResult, results: ProcessResult[]): Required<ProcessResult, 'states'>;
128
131
  declare function errorString(e: Error): string;
129
132
  declare const USER_PROCESSOR = "user_processor";
130
133
  declare function makeEthCallKey(param: EthCallParam): string;
@@ -162,7 +165,8 @@ declare class ProcessorServiceImpl implements ProcessorServiceImplementation {
162
165
  private readonly shutdownHandler?;
163
166
  private readonly enablePreprocess;
164
167
  private preparedData;
165
- constructor(loader: () => Promise<any>, shutdownHandler?: () => void);
168
+ readonly enablePartition: boolean;
169
+ constructor(loader: () => Promise<any>, options?: any, shutdownHandler?: () => void);
166
170
  getConfig(request: ProcessConfigRequest, context: CallContext): Promise<ProcessConfigResponse>;
167
171
  start(request: StartRequest, context: CallContext): Promise<Empty>;
168
172
  stop(request: Empty, context: CallContext): Promise<Empty>;
@@ -235,6 +239,59 @@ declare class ProcessorServiceImpl implements ProcessorServiceImplementation {
235
239
  } | undefined;
236
240
  }[] | undefined;
237
241
  } | undefined;
242
+ update?: {
243
+ entity?: string[] | undefined;
244
+ id?: string[] | undefined;
245
+ entityData?: {
246
+ fields?: {
247
+ [x: string]: {
248
+ value?: {
249
+ nullValue?: _sentio_protos.RichValue_NullValue | undefined;
250
+ intValue?: number | undefined;
251
+ int64Value?: bigint | undefined;
252
+ floatValue?: number | undefined;
253
+ bytesValue?: Uint8Array | undefined;
254
+ boolValue?: boolean | undefined;
255
+ stringValue?: string | undefined;
256
+ timestampValue?: Date | undefined;
257
+ bigintValue?: {
258
+ negative?: boolean | undefined;
259
+ data?: Uint8Array | undefined;
260
+ } | undefined;
261
+ bigdecimalValue?: {
262
+ value?: {
263
+ negative?: boolean | undefined;
264
+ data?: Uint8Array | undefined;
265
+ } | undefined;
266
+ exp?: number | undefined;
267
+ } | undefined;
268
+ listValue?: {
269
+ values?: any[] | undefined;
270
+ } | undefined;
271
+ structValue?: any | undefined;
272
+ tokenValue?: {
273
+ token?: {
274
+ symbol?: string | undefined;
275
+ address?: {
276
+ address?: string | undefined;
277
+ chain?: string | undefined;
278
+ } | undefined;
279
+ } | undefined;
280
+ amount?: {
281
+ value?: {
282
+ negative?: boolean | undefined;
283
+ data?: Uint8Array | undefined;
284
+ } | undefined;
285
+ exp?: number | undefined;
286
+ } | undefined;
287
+ specifiedAt?: Date | undefined;
288
+ } | undefined;
289
+ } | undefined;
290
+ op?: _sentio_protos.EntityUpdateData_Operator | undefined;
291
+ } | undefined;
292
+ } | undefined;
293
+ }[] | undefined;
294
+ } | undefined;
238
295
  delete?: {
239
296
  entity?: string[] | undefined;
240
297
  id?: string[] | undefined;
@@ -400,6 +457,79 @@ declare class ProcessorServiceImpl implements ProcessorServiceImplementation {
400
457
  configUpdated?: boolean | undefined;
401
458
  error?: string | undefined;
402
459
  } | undefined;
460
+ timeseriesResult?: {
461
+ metadata?: {
462
+ address?: string | undefined;
463
+ contractName?: string | undefined;
464
+ blockNumber?: bigint | undefined;
465
+ transactionHash?: string | undefined;
466
+ chainId?: string | undefined;
467
+ transactionIndex?: number | undefined;
468
+ logIndex?: number | undefined;
469
+ name?: string | undefined;
470
+ labels?: {
471
+ [x: string]: string | undefined;
472
+ } | undefined;
473
+ } | undefined;
474
+ type?: _sentio_protos.TimeseriesResult_TimeseriesType | undefined;
475
+ data?: {
476
+ fields?: {
477
+ [x: string]: {
478
+ nullValue?: _sentio_protos.RichValue_NullValue | undefined;
479
+ intValue?: number | undefined;
480
+ int64Value?: bigint | undefined;
481
+ floatValue?: number | undefined;
482
+ bytesValue?: Uint8Array | undefined;
483
+ boolValue?: boolean | undefined;
484
+ stringValue?: string | undefined;
485
+ timestampValue?: Date | undefined;
486
+ bigintValue?: {
487
+ negative?: boolean | undefined;
488
+ data?: Uint8Array | undefined;
489
+ } | undefined;
490
+ bigdecimalValue?: {
491
+ value?: {
492
+ negative?: boolean | undefined;
493
+ data?: Uint8Array | undefined;
494
+ } | undefined;
495
+ exp?: number | undefined;
496
+ } | undefined;
497
+ listValue?: {
498
+ values?: any[] | undefined;
499
+ } | undefined;
500
+ structValue?: any | undefined;
501
+ tokenValue?: {
502
+ token?: {
503
+ symbol?: string | undefined;
504
+ address?: {
505
+ address?: string | undefined;
506
+ chain?: string | undefined;
507
+ } | undefined;
508
+ } | undefined;
509
+ amount?: {
510
+ value?: {
511
+ negative?: boolean | undefined;
512
+ data?: Uint8Array | undefined;
513
+ } | undefined;
514
+ exp?: number | undefined;
515
+ } | undefined;
516
+ specifiedAt?: Date | undefined;
517
+ } | undefined;
518
+ } | undefined;
519
+ } | undefined;
520
+ } | undefined;
521
+ runtimeInfo?: {
522
+ from?: HandlerType | undefined;
523
+ } | undefined;
524
+ }[] | undefined;
525
+ } | undefined;
526
+ partitions?: {
527
+ partitions?: {
528
+ [x: number]: {
529
+ userValue?: string | undefined;
530
+ sysValue?: _sentio_protos.ProcessStreamResponse_Partitions_Partition_SysValue | undefined;
531
+ } | undefined;
532
+ } | undefined;
403
533
  } | undefined;
404
534
  }, void, undefined>;
405
535
  handlePreprocessRequests(requests: AsyncIterable<PreprocessStreamRequest>, subject: Subject<DeepPartial$1<PreprocessStreamResponse>>): Promise<void>;
@@ -464,6 +594,59 @@ declare class ProcessorServiceImpl implements ProcessorServiceImplementation {
464
594
  } | undefined;
465
595
  }[] | undefined;
466
596
  } | undefined;
597
+ update?: {
598
+ entity?: string[] | undefined;
599
+ id?: string[] | undefined;
600
+ entityData?: {
601
+ fields?: {
602
+ [x: string]: {
603
+ value?: {
604
+ nullValue?: _sentio_protos.RichValue_NullValue | undefined;
605
+ intValue?: number | undefined;
606
+ int64Value?: bigint | undefined;
607
+ floatValue?: number | undefined;
608
+ bytesValue?: Uint8Array | undefined;
609
+ boolValue?: boolean | undefined;
610
+ stringValue?: string | undefined;
611
+ timestampValue?: Date | undefined;
612
+ bigintValue?: {
613
+ negative?: boolean | undefined;
614
+ data?: Uint8Array | undefined;
615
+ } | undefined;
616
+ bigdecimalValue?: {
617
+ value?: {
618
+ negative?: boolean | undefined;
619
+ data?: Uint8Array | undefined;
620
+ } | undefined;
621
+ exp?: number | undefined;
622
+ } | undefined;
623
+ listValue?: {
624
+ values?: any[] | undefined;
625
+ } | undefined;
626
+ structValue?: any | undefined;
627
+ tokenValue?: {
628
+ token?: {
629
+ symbol?: string | undefined;
630
+ address?: {
631
+ address?: string | undefined;
632
+ chain?: string | undefined;
633
+ } | undefined;
634
+ } | undefined;
635
+ amount?: {
636
+ value?: {
637
+ negative?: boolean | undefined;
638
+ data?: Uint8Array | undefined;
639
+ } | undefined;
640
+ exp?: number | undefined;
641
+ } | undefined;
642
+ specifiedAt?: Date | undefined;
643
+ } | undefined;
644
+ } | undefined;
645
+ op?: _sentio_protos.EntityUpdateData_Operator | undefined;
646
+ } | undefined;
647
+ } | undefined;
648
+ }[] | undefined;
649
+ } | undefined;
467
650
  delete?: {
468
651
  entity?: string[] | undefined;
469
652
  id?: string[] | undefined;
@@ -482,7 +665,10 @@ declare class ProcessorServiceImpl implements ProcessorServiceImplementation {
482
665
  } | undefined;
483
666
  } | undefined;
484
667
  }, void, undefined>;
668
+ private dbContexts;
485
669
  protected handleRequests(requests: AsyncIterable<ProcessStreamRequest>, subject: Subject<DeepPartial$1<ProcessStreamResponse>>): Promise<void>;
670
+ handleRequest(request: ProcessStreamRequest, lastBinding: DataBinding | undefined, subject: Subject<DeepPartial$1<ProcessStreamResponse>>): Promise<void>;
671
+ private startProcess;
486
672
  }
487
673
  declare function recordRuntimeInfo(results: ProcessResult, handlerType: HandlerType): void;
488
674
 
@@ -568,24 +754,28 @@ declare const dbMetrics: {
568
754
  upsert: C;
569
755
  list: C;
570
756
  delete: C;
757
+ update: C;
571
758
  };
572
759
  recv_counts: {
573
760
  get: C;
574
761
  upsert: C;
575
762
  list: C;
576
763
  delete: C;
764
+ update: C;
577
765
  };
578
766
  request_times: {
579
767
  get: C;
580
768
  upsert: C;
581
769
  list: C;
582
770
  delete: C;
771
+ update: C;
583
772
  };
584
773
  request_errors: {
585
774
  get: C;
586
775
  upsert: C;
587
776
  list: C;
588
777
  delete: C;
778
+ update: C;
589
779
  };
590
780
  batched_total_count: C;
591
781
  batched_request_count: C;
@@ -681,4 +871,4 @@ declare const processMetrics: {
681
871
  };
682
872
  declare const metricsStorage: AsyncLocalStorage<string>;
683
873
 
684
- export { AbstractStoreContext, type ChainConfig, DummyProvider, Endpoints, GLOBAL_CONFIG, type GlobalConfig, type IStoreContext, ListStateStorage, MapStateStorage, Plugin, PluginManager, ProcessorServiceImpl, QueuedStaticJsonRpcProvider, type Semver, State, StateStorage, StoreContext, TemplateInstanceState, USER_PROCESSOR, compareSemver, configureEndpoints, dbMetrics, errorString, getProvider, makeEthCallKey, mergeProcessResults, metricsStorage, parseSemver, processMetrics, providerMetrics, recordRuntimeInfo, timeoutError };
874
+ export { AbstractStoreContext, type ChainConfig, DummyProvider, Endpoints, GLOBAL_CONFIG, type GlobalConfig, type IStoreContext, ListStateStorage, MapStateStorage, Plugin, PluginManager, ProcessorServiceImpl, QueuedStaticJsonRpcProvider, type Semver, State, StateStorage, StoreContext, TemplateInstanceState, USER_PROCESSOR, compareSemver, configureEndpoints, dbMetrics, errorString, getProvider, makeEthCallKey, mergeProcessResults, mergeProcessResultsInPlace, metricsStorage, parseSemver, processMetrics, providerMetrics, recordRuntimeInfo, timeoutError };
package/lib/index.js CHANGED
@@ -22,17 +22,18 @@ import {
22
22
  getProvider,
23
23
  makeEthCallKey,
24
24
  mergeProcessResults,
25
+ mergeProcessResultsInPlace,
25
26
  metricsStorage,
26
27
  parseSemver,
27
28
  processMetrics,
28
29
  providerMetrics,
29
30
  recordRuntimeInfo,
30
31
  timeoutError
31
- } from "./chunk-J23VJQSB.js";
32
+ } from "./chunk-4UYFH4YB.js";
32
33
  import {
33
34
  Plugin,
34
35
  PluginManager
35
- } from "./chunk-3T4PWGQU.js";
36
+ } from "./chunk-LCS6SRJY.js";
36
37
 
37
38
  // src/chain-config.ts
38
39
  import("node:process").then((p) => p.stdout.write(""));
@@ -62,6 +63,7 @@ export {
62
63
  getProvider,
63
64
  makeEthCallKey,
64
65
  mergeProcessResults,
66
+ mergeProcessResultsInPlace,
65
67
  metricsStorage,
66
68
  parseSemver,
67
69
  processMetrics,
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/chain-config.ts","../src/index.ts"],"sourcesContent":["export interface ChainConfig {\n ChainID: string\n Https?: string[]\n ChainServer?: string\n}\n;import(\"node:process\").then((p) => p.stdout.write(\"\"));","export * from './plugin.js'\nexport * from './state.js'\nexport * from './utils.js'\nexport * from './endpoints.js'\nexport * from './chain-config.js'\nexport * from './service.js'\nexport { GLOBAL_CONFIG, type GlobalConfig } from './global-config.js'\nexport * from './db-context.js'\nexport * from './provider.js'\nexport * from './metrics.js'\n;import(\"node:process\").then((p) => p.stdout.write(\"\"));"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKC,OAAO,cAAc,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,MAAM,EAAE,CAAC;;;ACKrD,OAAO,cAAc,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,MAAM,EAAE,CAAC;","names":[]}
1
+ {"version":3,"sources":["../src/chain-config.ts","../src/index.ts"],"sourcesContent":["export interface ChainConfig {\n ChainID: string\n Https?: string[]\n ChainServer?: string\n}\n;import(\"node:process\").then((p) => p.stdout.write(\"\"));","export * from './plugin.js'\nexport * from './state.js'\nexport * from './utils.js'\nexport * from './endpoints.js'\nexport * from './chain-config.js'\nexport * from './service.js'\nexport { GLOBAL_CONFIG, type GlobalConfig } from './global-config.js'\nexport * from './db-context.js'\nexport * from './provider.js'\nexport * from './metrics.js'\n;import(\"node:process\").then((p) => p.stdout.write(\"\"));"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKC,OAAO,cAAc,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,MAAM,EAAE,CAAC;;;ACKrD,OAAO,cAAc,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,MAAM,EAAE,CAAC;","names":[]}