@sentio/runtime 2.63.0 → 2.63.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.
@@ -1,4 +1,4 @@
1
1
  import { createRequire as createRequireShim } from 'module'; const require = createRequireShim(import.meta.url);
2
- import{b as k}from"./chunk-XI22N6AJ.js";import{C as y,H as I,c as h,j as S,o as x,p as C,t as q}from"./chunk-WUUWUOFG.js";import"./chunk-TBN64DSW.js";import"./chunk-G6HW3DCN.js";import{e as E}from"./chunk-AUPVVLD3.js";var s=E(x(),1);var i=E(C(),1);import{threadId as o}from"worker_threads";import{Piscina as L}from"piscina";var D=E(y(),1),b=!1,u;process.on("uncaughtException",e=>{console.error("Uncaught Exception, please checking if await is properly used",e),u=e}).on("unhandledRejection",(e,t)=>{e?.message.startsWith('invalid ENS name (disallowed character: "*"')||(console.error("Unhandled Rejection, please checking if await is properly",e),u=e)}).on("exit",()=>{console.info("Worker thread exiting, threadId:",o)});var d,A=async e=>{if(e.target){let t=await import(e.target);return console.debug("Module loaded, path:",e.target,"module:",t),t}},v={};async function N(e,t){if(b)return{};q();try{d=new I(()=>A(t),t)}catch(a){throw new s.ServerError(s.Status.INVALID_ARGUMENT,"Failed to load processor: "+h(a))}return await d.start(e,v),b=!0,{}}async function F({processId:e,request:t,workerPort:a}){let{startRequest:p,configRequest:w,options:n}=L.workerData;if(!b){let r=process.env.LOG_LEVEL?.toUpperCase();k(n.logFormat==="json",r==="debug"?!0:n.debug,o),S(n),p&&(await N(p,n),console.debug("worker",o," started, template instance:",p.templateInstances?.length)),w&&(await d?.getConfig(w,v),console.debug("worker",o," configured"))}if(u){let r=u;throw u=void 0,console.error("Unhandled exception/rejection in previous request:",r),new i.RichServerError(s.Status.UNAVAILABLE,"Unhandled exception/rejection in previous request: "+h(r),[i.DebugInfo.fromPartial({detail:r.message,stackEntries:r.stack?.split(`
2
+ import{b as k}from"./chunk-XI22N6AJ.js";import{C as y,H as I,c as h,j as S,o as x,p as C,t as q}from"./chunk-EQHBEFKX.js";import"./chunk-U6BJVJ62.js";import"./chunk-G6HW3DCN.js";import{e as E}from"./chunk-AUPVVLD3.js";var s=E(x(),1);var i=E(C(),1);import{threadId as o}from"worker_threads";import{Piscina as L}from"piscina";var D=E(y(),1),b=!1,u;process.on("uncaughtException",e=>{console.error("Uncaught Exception, please checking if await is properly used",e),u=e}).on("unhandledRejection",(e,t)=>{e?.message.startsWith('invalid ENS name (disallowed character: "*"')||(console.error("Unhandled Rejection, please checking if await is properly",e),u=e)}).on("exit",()=>{console.info("Worker thread exiting, threadId:",o)});var d,A=async e=>{if(e.target){let t=await import(e.target);return console.debug("Module loaded, path:",e.target,"module:",t),t}},v={};async function N(e,t){if(b)return{};q();try{d=new I(()=>A(t),t)}catch(a){throw new s.ServerError(s.Status.INVALID_ARGUMENT,"Failed to load processor: "+h(a))}return await d.start(e,v),b=!0,{}}async function F({processId:e,request:t,workerPort:a}){let{startRequest:p,configRequest:w,options:n}=L.workerData;if(!b){let r=process.env.LOG_LEVEL?.toUpperCase();k(n.logFormat==="json",r==="debug"?!0:n.debug,o),S(n),p&&(await N(p,n),console.debug("worker",o," started, template instance:",p.templateInstances?.length)),w&&(await d?.getConfig(w,v),console.debug("worker",o," configured"))}if(u){let r=u;throw u=void 0,console.error("Unhandled exception/rejection in previous request:",r),new i.RichServerError(s.Status.UNAVAILABLE,"Unhandled exception/rejection in previous request: "+h(r),[i.DebugInfo.fromPartial({detail:r.message,stackEntries:r.stack?.split(`
3
3
  `)})])}let l=(n.workerTimeout||0)*1e3,P=n.enablePartition||!1;await new Promise((r,R)=>{let f=new D.Subject,m;f.subscribe(c=>{console.debug("Worker",o,"send response:",c.result?"result":"dbResult"),a.postMessage(c),c.result&&(m&&clearTimeout(m),r(),a.close())}),a.on("message",c=>{let g=c;console.debug("Worker",o,"received request:",g.start?"start":"dbResult"),d?.handleRequest(g,t.binding,f),P&&g.start&&l>0&&(m=setTimeout(async()=>{R(new i.RichServerError(s.Status.DEADLINE_EXCEEDED,"Worker timeout exceeded"))},l))}),console.debug("Worker",o,"handle request: binding"),d?.handleRequest(t,t.binding,f),!P&&l>0&&(m=setTimeout(()=>{R(new i.RichServerError(s.Status.DEADLINE_EXCEEDED,"Worker timeout exceeded"))},l))})}import("node:process").then(e=>e.stdout.write(""));export{F as default};
4
4
  //# sourceMappingURL=service-worker.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentio/runtime",
3
- "version": "2.63.0",
3
+ "version": "2.63.1",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -285,6 +285,17 @@ export class RuntimeServicePatcher {
285
285
  patchConfig(config: DeepPartial<ProcessConfigResponse>): void {
286
286
  config.executionConfig = ExecutionConfig.fromPartial(GLOBAL_CONFIG.execution)
287
287
 
288
+ // Move resource/object change handlers before the plural `types` field (SDK < 3.4.1)
289
+ // only set the deprecated singular `type`. The latest driver reads `types` only, so
290
+ // back-fill it here. Resource change configs live under both contract and account configs.
291
+ for (const cfg of [...(config.contractConfigs ?? []), ...(config.accountConfigs ?? [])]) {
292
+ for (const rc of cfg.moveResourceChangeConfigs ?? []) {
293
+ if (!rc.types?.length && rc.type) {
294
+ rc.types = [rc.type]
295
+ }
296
+ }
297
+ }
298
+
288
299
  if (config.contractConfigs) {
289
300
  for (const contract of config.contractConfigs) {
290
301
  // for old fuel processor
@@ -828,6 +828,7 @@ export interface MoveCallHandlerConfig {
828
828
 
829
829
  export interface MoveResourceChangeConfig {
830
830
  type: string;
831
+ types: string[];
831
832
  includeDeleted: boolean;
832
833
  handlerId: number;
833
834
  handlerName: string;
@@ -6406,7 +6407,7 @@ export const MoveCallHandlerConfig = {
6406
6407
  };
6407
6408
 
6408
6409
  function createBaseMoveResourceChangeConfig(): MoveResourceChangeConfig {
6409
- return { type: "", includeDeleted: false, handlerId: 0, handlerName: "" };
6410
+ return { type: "", types: [], includeDeleted: false, handlerId: 0, handlerName: "" };
6410
6411
  }
6411
6412
 
6412
6413
  export const MoveResourceChangeConfig = {
@@ -6414,6 +6415,9 @@ export const MoveResourceChangeConfig = {
6414
6415
  if (message.type !== "") {
6415
6416
  writer.uint32(10).string(message.type);
6416
6417
  }
6418
+ for (const v of message.types) {
6419
+ writer.uint32(42).string(v!);
6420
+ }
6417
6421
  if (message.includeDeleted !== false) {
6418
6422
  writer.uint32(32).bool(message.includeDeleted);
6419
6423
  }
@@ -6440,6 +6444,13 @@ export const MoveResourceChangeConfig = {
6440
6444
 
6441
6445
  message.type = reader.string();
6442
6446
  continue;
6447
+ case 5:
6448
+ if (tag !== 42) {
6449
+ break;
6450
+ }
6451
+
6452
+ message.types.push(reader.string());
6453
+ continue;
6443
6454
  case 4:
6444
6455
  if (tag !== 32) {
6445
6456
  break;
@@ -6473,6 +6484,7 @@ export const MoveResourceChangeConfig = {
6473
6484
  fromJSON(object: any): MoveResourceChangeConfig {
6474
6485
  return {
6475
6486
  type: isSet(object.type) ? globalThis.String(object.type) : "",
6487
+ types: globalThis.Array.isArray(object?.types) ? object.types.map((e: any) => globalThis.String(e)) : [],
6476
6488
  includeDeleted: isSet(object.includeDeleted) ? globalThis.Boolean(object.includeDeleted) : false,
6477
6489
  handlerId: isSet(object.handlerId) ? globalThis.Number(object.handlerId) : 0,
6478
6490
  handlerName: isSet(object.handlerName) ? globalThis.String(object.handlerName) : "",
@@ -6484,6 +6496,9 @@ export const MoveResourceChangeConfig = {
6484
6496
  if (message.type !== "") {
6485
6497
  obj.type = message.type;
6486
6498
  }
6499
+ if (message.types?.length) {
6500
+ obj.types = message.types;
6501
+ }
6487
6502
  if (message.includeDeleted !== false) {
6488
6503
  obj.includeDeleted = message.includeDeleted;
6489
6504
  }
@@ -6502,6 +6517,7 @@ export const MoveResourceChangeConfig = {
6502
6517
  fromPartial(object: DeepPartial<MoveResourceChangeConfig>): MoveResourceChangeConfig {
6503
6518
  const message = createBaseMoveResourceChangeConfig();
6504
6519
  message.type = object.type ?? "";
6520
+ message.types = object.types?.map((e) => e) || [];
6505
6521
  message.includeDeleted = object.includeDeleted ?? false;
6506
6522
  message.handlerId = object.handlerId ?? 0;
6507
6523
  message.handlerName = object.handlerName ?? "";