@sentio/runtime 2.59.0-rc.8 → 2.59.0

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.
@@ -0,0 +1,3 @@
1
+ import { createRequire as createRequireShim } from 'module'; const require = createRequireShim(import.meta.url);
2
+ import{isMainThread as T,parentPort as g,threadId as p}from"node:worker_threads";var r=class e{stateMap=new Map;static INSTANCE=new e;static reset(){e.INSTANCE=new e}},n=class{constructor(){}key(){return this.constructor.name}getOrRegister(){let t=r.INSTANCE.stateMap.get(this.key());return t||(t=this.initValue(),r.INSTANCE.stateMap.set(this.key(),t)),t}unregister(){let t=r.INSTANCE.stateMap.get(this.key());return r.INSTANCE.stateMap.delete(this.key()),t}},c=class extends n{initValue(){return new Map}getValue(t){return this.getOrRegister().get(t)}getValues(){let t=this.getOrRegister();return Array.from(t.values())}getOrSetValue(t,s){let u=this.getOrRegister(),a=u.get(t);return a?(a!==s&&console.warn(t,"has been registered twice, use the previous one"),a):(u.set(t,s),s)}},i=class extends n{initValue(){return[]}getValues(){return this.getOrRegister()}addValue(t){return this.getOrRegister().push(t),t}},o=class e extends i{static INSTANCE=new e;constructor(){super()}addValue(t){return T||g?.postMessage({event:"add_template_instance",value:t,from:p}),super.addValue(t)}};import("node:process").then(e=>e.stdout.write(""));export{r as a,n as b,c,i as d,o as e};
3
+ //# sourceMappingURL=chunk-WHWNPZZ3.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/state.ts"],"sourcesContent":["import { TemplateInstance } from '@sentio/protos'\nimport { isMainThread, parentPort, threadId } from 'node:worker_threads'\n\nexport class State {\n stateMap = new Map<string, any>()\n\n static INSTANCE = new State()\n\n static reset() {\n State.INSTANCE = new State()\n }\n}\n\nexport abstract class StateStorage<T> {\n // TODO learn how to define single instance for all subclasses\n\n protected constructor() {\n //\n }\n\n abstract initValue(): T\n\n key(): string {\n return this.constructor.name\n }\n\n getOrRegister(): T {\n let metricState: T = State.INSTANCE.stateMap.get(this.key())\n if (!metricState) {\n metricState = this.initValue()\n State.INSTANCE.stateMap.set(this.key(), metricState)\n }\n return metricState\n }\n\n unregister(): T {\n const value = State.INSTANCE.stateMap.get(this.key())\n State.INSTANCE.stateMap.delete(this.key())\n return value\n }\n}\n\nexport abstract class MapStateStorage<T> extends StateStorage<Map<string, T>> {\n initValue() {\n return new Map<string, T>()\n }\n\n getValue(key: string): T | undefined {\n const m = this.getOrRegister()\n return m.get(key)\n }\n\n getValues(): T[] {\n const m = this.getOrRegister()\n return Array.from(m.values())\n }\n\n getOrSetValue(key: string, value: T): T {\n const m = this.getOrRegister()\n const oldValue = m.get(key)\n if (oldValue) {\n if (oldValue !== value) {\n console.warn(key, 'has been registered twice, use the previous one')\n }\n return oldValue\n }\n m.set(key, value)\n return value\n }\n}\n\nexport abstract class ListStateStorage<T> extends StateStorage<T[]> {\n initValue() {\n return []\n }\n\n getValues(): T[] {\n return this.getOrRegister()\n }\n\n addValue(value: T): T {\n const m = this.getOrRegister()\n m.push(value)\n return value\n }\n}\n\nexport class TemplateInstanceState extends ListStateStorage<TemplateInstance> {\n static INSTANCE = new TemplateInstanceState()\n\n constructor() {\n super()\n }\n\n override addValue(value: TemplateInstance): TemplateInstance {\n if (!isMainThread) {\n // I'm worker thread, should notice the main thread\n parentPort?.postMessage({ event: 'add_template_instance', value, from: threadId })\n }\n return super.addValue(value)\n }\n}\n;import(\"node:process\").then((p) => p.stdout.write(\"\"));"],"mappings":";;;AACA,SAAS,cAAc,YAAY,gBAAgB;AAE5C,IAAM,QAAN,MAAM,OAAM;AAAA,EACjB,WAAW,oBAAI,IAAiB;AAAA,EAEhC,OAAO,WAAW,IAAI,OAAM;AAAA,EAE5B,OAAO,QAAQ;AACb,WAAM,WAAW,IAAI,OAAM;AAAA,EAC7B;AACF;AAEO,IAAe,eAAf,MAA+B;AAAA;AAAA,EAG1B,cAAc;AAAA,EAExB;AAAA,EAIA,MAAc;AACZ,WAAO,KAAK,YAAY;AAAA,EAC1B;AAAA,EAEA,gBAAmB;AACjB,QAAI,cAAiB,MAAM,SAAS,SAAS,IAAI,KAAK,IAAI,CAAC;AAC3D,QAAI,CAAC,aAAa;AAChB,oBAAc,KAAK,UAAU;AAC7B,YAAM,SAAS,SAAS,IAAI,KAAK,IAAI,GAAG,WAAW;AAAA,IACrD;AACA,WAAO;AAAA,EACT;AAAA,EAEA,aAAgB;AACd,UAAM,QAAQ,MAAM,SAAS,SAAS,IAAI,KAAK,IAAI,CAAC;AACpD,UAAM,SAAS,SAAS,OAAO,KAAK,IAAI,CAAC;AACzC,WAAO;AAAA,EACT;AACF;AAEO,IAAe,kBAAf,cAA0C,aAA6B;AAAA,EAC5E,YAAY;AACV,WAAO,oBAAI,IAAe;AAAA,EAC5B;AAAA,EAEA,SAAS,KAA4B;AACnC,UAAM,IAAI,KAAK,cAAc;AAC7B,WAAO,EAAE,IAAI,GAAG;AAAA,EAClB;AAAA,EAEA,YAAiB;AACf,UAAM,IAAI,KAAK,cAAc;AAC7B,WAAO,MAAM,KAAK,EAAE,OAAO,CAAC;AAAA,EAC9B;AAAA,EAEA,cAAc,KAAa,OAAa;AACtC,UAAM,IAAI,KAAK,cAAc;AAC7B,UAAM,WAAW,EAAE,IAAI,GAAG;AAC1B,QAAI,UAAU;AACZ,UAAI,aAAa,OAAO;AACtB,gBAAQ,KAAK,KAAK,iDAAiD;AAAA,MACrE;AACA,aAAO;AAAA,IACT;AACA,MAAE,IAAI,KAAK,KAAK;AAChB,WAAO;AAAA,EACT;AACF;AAEO,IAAe,mBAAf,cAA2C,aAAkB;AAAA,EAClE,YAAY;AACV,WAAO,CAAC;AAAA,EACV;AAAA,EAEA,YAAiB;AACf,WAAO,KAAK,cAAc;AAAA,EAC5B;AAAA,EAEA,SAAS,OAAa;AACpB,UAAM,IAAI,KAAK,cAAc;AAC7B,MAAE,KAAK,KAAK;AACZ,WAAO;AAAA,EACT;AACF;AAEO,IAAM,wBAAN,MAAM,+BAA8B,iBAAmC;AAAA,EAC5E,OAAO,WAAW,IAAI,uBAAsB;AAAA,EAE5C,cAAc;AACZ,UAAM;AAAA,EACR;AAAA,EAES,SAAS,OAA2C;AAC3D,QAAI,CAAC,cAAc;AAEjB,kBAAY,YAAY,EAAE,OAAO,yBAAyB,OAAO,MAAM,SAAS,CAAC;AAAA,IACnF;AACA,WAAO,MAAM,SAAS,KAAK;AAAA,EAC7B;AACF;AACC,OAAO,cAAc,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,MAAM,EAAE,CAAC;","names":[]}
1
+ {"version":3,"sources":["../src/state.ts"],"sourcesContent":["import { TemplateInstance } from '@sentio/protos'\nimport { isMainThread, parentPort, threadId } from 'node:worker_threads'\n\nexport class State {\n stateMap = new Map<string, any>()\n\n static INSTANCE = new State()\n\n static reset() {\n State.INSTANCE = new State()\n }\n}\n\nexport abstract class StateStorage<T> {\n // TODO learn how to define single instance for all subclasses\n\n protected constructor() {\n //\n }\n\n abstract initValue(): T\n\n key(): string {\n return this.constructor.name\n }\n\n getOrRegister(): T {\n let metricState: T = State.INSTANCE.stateMap.get(this.key())\n if (!metricState) {\n metricState = this.initValue()\n State.INSTANCE.stateMap.set(this.key(), metricState)\n }\n return metricState\n }\n\n unregister(): T {\n const value = State.INSTANCE.stateMap.get(this.key())\n State.INSTANCE.stateMap.delete(this.key())\n return value\n }\n}\n\nexport abstract class MapStateStorage<T> extends StateStorage<Map<string, T>> {\n initValue() {\n return new Map<string, T>()\n }\n\n getValue(key: string): T | undefined {\n const m = this.getOrRegister()\n return m.get(key)\n }\n\n getValues(): T[] {\n const m = this.getOrRegister()\n return Array.from(m.values())\n }\n\n getOrSetValue(key: string, value: T): T {\n const m = this.getOrRegister()\n const oldValue = m.get(key)\n if (oldValue) {\n if (oldValue !== value) {\n console.warn(key, 'has been registered twice, use the previous one')\n }\n return oldValue\n }\n m.set(key, value)\n return value\n }\n}\n\nexport abstract class ListStateStorage<T> extends StateStorage<T[]> {\n initValue() {\n return []\n }\n\n getValues(): T[] {\n return this.getOrRegister()\n }\n\n addValue(value: T): T {\n const m = this.getOrRegister()\n m.push(value)\n return value\n }\n}\n\nexport class TemplateInstanceState extends ListStateStorage<TemplateInstance> {\n static INSTANCE = new TemplateInstanceState()\n\n constructor() {\n super()\n }\n\n override addValue(value: TemplateInstance): TemplateInstance {\n if (!isMainThread) {\n // I'm worker thread, should notice the main thread\n parentPort?.postMessage({ event: 'add_template_instance', value, from: threadId })\n }\n return super.addValue(value)\n }\n}\n;import(\"node:process\").then((p) => p.stdout.write(\"\"));"],"mappings":";AACA,OAAS,gBAAAA,EAAc,cAAAC,EAAY,YAAAC,MAAgB,sBAE5C,IAAMC,EAAN,MAAMC,CAAM,CACjB,SAAW,IAAI,IAEf,OAAO,SAAW,IAAIA,EAEtB,OAAO,OAAQ,CACbA,EAAM,SAAW,IAAIA,CACvB,CACF,EAEsBC,EAAf,KAA+B,CAG1B,aAAc,CAExB,CAIA,KAAc,CACZ,OAAO,KAAK,YAAY,IAC1B,CAEA,eAAmB,CACjB,IAAIC,EAAiBH,EAAM,SAAS,SAAS,IAAI,KAAK,IAAI,CAAC,EAC3D,OAAKG,IACHA,EAAc,KAAK,UAAU,EAC7BH,EAAM,SAAS,SAAS,IAAI,KAAK,IAAI,EAAGG,CAAW,GAE9CA,CACT,CAEA,YAAgB,CACd,IAAMC,EAAQJ,EAAM,SAAS,SAAS,IAAI,KAAK,IAAI,CAAC,EACpD,OAAAA,EAAM,SAAS,SAAS,OAAO,KAAK,IAAI,CAAC,EAClCI,CACT,CACF,EAEsBC,EAAf,cAA0CH,CAA6B,CAC5E,WAAY,CACV,OAAO,IAAI,GACb,CAEA,SAASI,EAA4B,CAEnC,OADU,KAAK,cAAc,EACpB,IAAIA,CAAG,CAClB,CAEA,WAAiB,CACf,IAAMC,EAAI,KAAK,cAAc,EAC7B,OAAO,MAAM,KAAKA,EAAE,OAAO,CAAC,CAC9B,CAEA,cAAcD,EAAaF,EAAa,CACtC,IAAMG,EAAI,KAAK,cAAc,EACvBC,EAAWD,EAAE,IAAID,CAAG,EAC1B,OAAIE,GACEA,IAAaJ,GACf,QAAQ,KAAKE,EAAK,iDAAiD,EAE9DE,IAETD,EAAE,IAAID,EAAKF,CAAK,EACTA,EACT,CACF,EAEsBK,EAAf,cAA2CP,CAAkB,CAClE,WAAY,CACV,MAAO,CAAC,CACV,CAEA,WAAiB,CACf,OAAO,KAAK,cAAc,CAC5B,CAEA,SAASE,EAAa,CAEpB,OADU,KAAK,cAAc,EAC3B,KAAKA,CAAK,EACLA,CACT,CACF,EAEaM,EAAN,MAAMC,UAA8BF,CAAmC,CAC5E,OAAO,SAAW,IAAIE,EAEtB,aAAc,CACZ,MAAM,CACR,CAES,SAASP,EAA2C,CAC3D,OAAKP,GAEHC,GAAY,YAAY,CAAE,MAAO,wBAAyB,MAAAM,EAAO,KAAML,CAAS,CAAC,EAE5E,MAAM,SAASK,CAAK,CAC7B,CACF,EACC,OAAO,cAAc,EAAE,KAAMQ,GAAMA,EAAE,OAAO,MAAM,EAAE,CAAC","names":["isMainThread","parentPort","threadId","State","_State","StateStorage","metricState","value","MapStateStorage","key","m","oldValue","ListStateStorage","TemplateInstanceState","_TemplateInstanceState","p"]}
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
@@ -1,72 +1,3 @@
1
1
  import { createRequire as createRequireShim } from 'module'; const require = createRequireShim(import.meta.url);
2
- import {
3
- ListStateStorage,
4
- MapStateStorage,
5
- State,
6
- StateStorage,
7
- TemplateInstanceState
8
- } from "./chunk-6XHWJ2VS.js";
9
- import {
10
- AbstractStoreContext,
11
- DummyProvider,
12
- Endpoints,
13
- GLOBAL_CONFIG,
14
- ProcessorServiceImpl,
15
- QueuedStaticJsonRpcProvider,
16
- StoreContext,
17
- USER_PROCESSOR,
18
- compareSemver,
19
- configureEndpoints,
20
- dbMetrics,
21
- errorString,
22
- getProvider,
23
- makeEthCallKey,
24
- mergeProcessResults,
25
- metricsStorage,
26
- parseSemver,
27
- processMetrics,
28
- providerMetrics,
29
- recordRuntimeInfo,
30
- timeoutError
31
- } from "./chunk-J23VJQSB.js";
32
- import {
33
- Plugin,
34
- PluginManager
35
- } from "./chunk-3T4PWGQU.js";
36
-
37
- // src/chain-config.ts
38
- import("node:process").then((p) => p.stdout.write(""));
39
-
40
- // src/index.ts
41
- import("node:process").then((p) => p.stdout.write(""));
42
- export {
43
- AbstractStoreContext,
44
- DummyProvider,
45
- Endpoints,
46
- GLOBAL_CONFIG,
47
- ListStateStorage,
48
- MapStateStorage,
49
- Plugin,
50
- PluginManager,
51
- ProcessorServiceImpl,
52
- QueuedStaticJsonRpcProvider,
53
- State,
54
- StateStorage,
55
- StoreContext,
56
- TemplateInstanceState,
57
- USER_PROCESSOR,
58
- compareSemver,
59
- configureEndpoints,
60
- dbMetrics,
61
- errorString,
62
- getProvider,
63
- makeEthCallKey,
64
- mergeProcessResults,
65
- metricsStorage,
66
- parseSemver,
67
- processMetrics,
68
- providerMetrics,
69
- recordRuntimeInfo,
70
- timeoutError
71
- };
2
+ import{a as p,b as f,c as i,d as m,e as n}from"./chunk-WHWNPZZ3.js";import{$ as B,P as u,Q as w,R as I,S as L,T as O,U as b,V as c,Y as v,Z as y,_ as A,a as x,aa as D,b as s,c as C,d as a,e as g,f as h,g as G,i as d,j as l,r as o}from"./chunk-UWKXTTDA.js";import{t,u as e}from"./chunk-VUN3TGG5.js";import("node:process").then(r=>r.stdout.write(""));import("node:process").then(r=>r.stdout.write(""));export{b as AbstractStoreContext,v as DummyProvider,d as Endpoints,o as GLOBAL_CONFIG,m as ListStateStorage,i as MapStateStorage,t as Plugin,e as PluginManager,B as ProcessorServiceImpl,A as QueuedStaticJsonRpcProvider,p as State,f as StateStorage,c as StoreContext,n as TemplateInstanceState,a as USER_PROCESSOR,G as compareSemver,l as configureEndpoints,u as dbMetrics,C as errorString,y as getProvider,g as makeEthCallKey,x as mergeProcessResults,s as mergeProcessResultsInPlace,L as metricsStorage,h as parseSemver,I as processMetrics,w as providerMetrics,D as recordRuntimeInfo,O as timeoutError};
72
3
  //# sourceMappingURL=index.js.map
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":";0SAKC,OAAO,cAAc,EAAE,KAAMA,GAAMA,EAAE,OAAO,MAAM,EAAE,CAAC,ECKrD,OAAO,cAAc,EAAE,KAAMC,GAAMA,EAAE,OAAO,MAAM,EAAE,CAAC","names":["p","p"]}