@sentio/runtime 2.59.0-rc.27 → 2.59.0-rc.29

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,7 +1,7 @@
1
1
  import { createRequire as createRequireShim } from 'module'; const require = createRequireShim(import.meta.url);
2
2
  import {
3
3
  setupLogger
4
- } from "./chunk-ZYJXCGEJ.js";
4
+ } from "./chunk-CPLWSUD7.js";
5
5
  import {
6
6
  AbstractStoreContext,
7
7
  configureEndpoints,
@@ -10,12 +10,12 @@ import {
10
10
  recordRuntimeInfo,
11
11
  require_lib3 as require_lib,
12
12
  require_lib4 as require_lib2
13
- } from "./chunk-MKMFMWQ4.js";
13
+ } from "./chunk-X2VTMTYL.js";
14
14
  import {
15
15
  PluginManager,
16
16
  ProcessConfigResponse,
17
17
  __toESM
18
- } from "./chunk-HMNYJB5K.js";
18
+ } from "./chunk-FO2V2K7T.js";
19
19
 
20
20
  // src/service-worker.ts
21
21
  var import_nice_grpc = __toESM(require_lib(), 1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentio/runtime",
3
- "version": "2.59.0-rc.27",
3
+ "version": "2.59.0-rc.29",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "exports": {
@@ -1234,10 +1234,20 @@ export interface Data {
1234
1234
  }
1235
1235
 
1236
1236
  export interface Data_EthLog {
1237
+ /** @deprecated */
1237
1238
  log: { [key: string]: any } | undefined;
1238
- timestamp: Date | undefined;
1239
- transaction?: { [key: string]: any } | undefined;
1240
- transactionReceipt?: { [key: string]: any } | undefined;
1239
+ timestamp:
1240
+ | Date
1241
+ | undefined;
1242
+ /** @deprecated */
1243
+ transaction?:
1244
+ | { [key: string]: any }
1245
+ | undefined;
1246
+ /** @deprecated */
1247
+ transactionReceipt?:
1248
+ | { [key: string]: any }
1249
+ | undefined;
1250
+ /** @deprecated */
1241
1251
  block?: { [key: string]: any } | undefined;
1242
1252
  rawLog: string;
1243
1253
  rawTransaction?: string | undefined;
@@ -1250,10 +1260,20 @@ export interface Data_EthBlock {
1250
1260
  }
1251
1261
 
1252
1262
  export interface Data_EthTransaction {
1263
+ /** @deprecated */
1253
1264
  transaction: { [key: string]: any } | undefined;
1254
- timestamp: Date | undefined;
1255
- transactionReceipt?: { [key: string]: any } | undefined;
1256
- block?: { [key: string]: any } | undefined;
1265
+ timestamp:
1266
+ | Date
1267
+ | undefined;
1268
+ /** @deprecated */
1269
+ transactionReceipt?:
1270
+ | { [key: string]: any }
1271
+ | undefined;
1272
+ /** @deprecated */
1273
+ block?:
1274
+ | { [key: string]: any }
1275
+ | undefined;
1276
+ /** @deprecated */
1257
1277
  trace?: { [key: string]: any } | undefined;
1258
1278
  rawTransaction: string;
1259
1279
  rawTransactionReceipt?: string | undefined;
@@ -313,6 +313,59 @@ export interface UsageTracker {
313
313
  versionField: string;
314
314
  }
315
315
 
316
+ export interface AuthChecker {
317
+ projectIdField: string;
318
+ projectSlugField: string;
319
+ projectOwnerField: string;
320
+ projectPermission: AuthChecker_Permission;
321
+ loaderName: string;
322
+ }
323
+
324
+ export enum AuthChecker_Permission {
325
+ NONE = 0,
326
+ READ = 1,
327
+ WRITE = 2,
328
+ ADMIN = 3,
329
+ UNRECOGNIZED = -1,
330
+ }
331
+
332
+ export function authChecker_PermissionFromJSON(object: any): AuthChecker_Permission {
333
+ switch (object) {
334
+ case 0:
335
+ case "NONE":
336
+ return AuthChecker_Permission.NONE;
337
+ case 1:
338
+ case "READ":
339
+ return AuthChecker_Permission.READ;
340
+ case 2:
341
+ case "WRITE":
342
+ return AuthChecker_Permission.WRITE;
343
+ case 3:
344
+ case "ADMIN":
345
+ return AuthChecker_Permission.ADMIN;
346
+ case -1:
347
+ case "UNRECOGNIZED":
348
+ default:
349
+ return AuthChecker_Permission.UNRECOGNIZED;
350
+ }
351
+ }
352
+
353
+ export function authChecker_PermissionToJSON(object: AuthChecker_Permission): string {
354
+ switch (object) {
355
+ case AuthChecker_Permission.NONE:
356
+ return "NONE";
357
+ case AuthChecker_Permission.READ:
358
+ return "READ";
359
+ case AuthChecker_Permission.WRITE:
360
+ return "WRITE";
361
+ case AuthChecker_Permission.ADMIN:
362
+ return "ADMIN";
363
+ case AuthChecker_Permission.UNRECOGNIZED:
364
+ default:
365
+ return "UNRECOGNIZED";
366
+ }
367
+ }
368
+
316
369
  export interface AccessMeta {
317
370
  projectIdField: string;
318
371
  projectSlugField: string;
@@ -1592,6 +1645,7 @@ export interface Account {
1592
1645
  address: string;
1593
1646
  paymentMethod: PayMethod;
1594
1647
  usageOverCapLimit: string;
1648
+ status: string;
1595
1649
  }
1596
1650
 
1597
1651
  export interface ImportedProject {
@@ -2182,6 +2236,125 @@ export const UsageTracker = {
2182
2236
  },
2183
2237
  };
2184
2238
 
2239
+ function createBaseAuthChecker(): AuthChecker {
2240
+ return { projectIdField: "", projectSlugField: "", projectOwnerField: "", projectPermission: 0, loaderName: "" };
2241
+ }
2242
+
2243
+ export const AuthChecker = {
2244
+ encode(message: AuthChecker, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
2245
+ if (message.projectIdField !== "") {
2246
+ writer.uint32(10).string(message.projectIdField);
2247
+ }
2248
+ if (message.projectSlugField !== "") {
2249
+ writer.uint32(18).string(message.projectSlugField);
2250
+ }
2251
+ if (message.projectOwnerField !== "") {
2252
+ writer.uint32(26).string(message.projectOwnerField);
2253
+ }
2254
+ if (message.projectPermission !== 0) {
2255
+ writer.uint32(32).int32(message.projectPermission);
2256
+ }
2257
+ if (message.loaderName !== "") {
2258
+ writer.uint32(42).string(message.loaderName);
2259
+ }
2260
+ return writer;
2261
+ },
2262
+
2263
+ decode(input: _m0.Reader | Uint8Array, length?: number): AuthChecker {
2264
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
2265
+ let end = length === undefined ? reader.len : reader.pos + length;
2266
+ const message = createBaseAuthChecker();
2267
+ while (reader.pos < end) {
2268
+ const tag = reader.uint32();
2269
+ switch (tag >>> 3) {
2270
+ case 1:
2271
+ if (tag !== 10) {
2272
+ break;
2273
+ }
2274
+
2275
+ message.projectIdField = reader.string();
2276
+ continue;
2277
+ case 2:
2278
+ if (tag !== 18) {
2279
+ break;
2280
+ }
2281
+
2282
+ message.projectSlugField = reader.string();
2283
+ continue;
2284
+ case 3:
2285
+ if (tag !== 26) {
2286
+ break;
2287
+ }
2288
+
2289
+ message.projectOwnerField = reader.string();
2290
+ continue;
2291
+ case 4:
2292
+ if (tag !== 32) {
2293
+ break;
2294
+ }
2295
+
2296
+ message.projectPermission = reader.int32() as any;
2297
+ continue;
2298
+ case 5:
2299
+ if (tag !== 42) {
2300
+ break;
2301
+ }
2302
+
2303
+ message.loaderName = reader.string();
2304
+ continue;
2305
+ }
2306
+ if ((tag & 7) === 4 || tag === 0) {
2307
+ break;
2308
+ }
2309
+ reader.skipType(tag & 7);
2310
+ }
2311
+ return message;
2312
+ },
2313
+
2314
+ fromJSON(object: any): AuthChecker {
2315
+ return {
2316
+ projectIdField: isSet(object.projectIdField) ? globalThis.String(object.projectIdField) : "",
2317
+ projectSlugField: isSet(object.projectSlugField) ? globalThis.String(object.projectSlugField) : "",
2318
+ projectOwnerField: isSet(object.projectOwnerField) ? globalThis.String(object.projectOwnerField) : "",
2319
+ projectPermission: isSet(object.projectPermission) ? authChecker_PermissionFromJSON(object.projectPermission) : 0,
2320
+ loaderName: isSet(object.loaderName) ? globalThis.String(object.loaderName) : "",
2321
+ };
2322
+ },
2323
+
2324
+ toJSON(message: AuthChecker): unknown {
2325
+ const obj: any = {};
2326
+ if (message.projectIdField !== "") {
2327
+ obj.projectIdField = message.projectIdField;
2328
+ }
2329
+ if (message.projectSlugField !== "") {
2330
+ obj.projectSlugField = message.projectSlugField;
2331
+ }
2332
+ if (message.projectOwnerField !== "") {
2333
+ obj.projectOwnerField = message.projectOwnerField;
2334
+ }
2335
+ if (message.projectPermission !== 0) {
2336
+ obj.projectPermission = authChecker_PermissionToJSON(message.projectPermission);
2337
+ }
2338
+ if (message.loaderName !== "") {
2339
+ obj.loaderName = message.loaderName;
2340
+ }
2341
+ return obj;
2342
+ },
2343
+
2344
+ create(base?: DeepPartial<AuthChecker>): AuthChecker {
2345
+ return AuthChecker.fromPartial(base ?? {});
2346
+ },
2347
+ fromPartial(object: DeepPartial<AuthChecker>): AuthChecker {
2348
+ const message = createBaseAuthChecker();
2349
+ message.projectIdField = object.projectIdField ?? "";
2350
+ message.projectSlugField = object.projectSlugField ?? "";
2351
+ message.projectOwnerField = object.projectOwnerField ?? "";
2352
+ message.projectPermission = object.projectPermission ?? 0;
2353
+ message.loaderName = object.loaderName ?? "";
2354
+ return message;
2355
+ },
2356
+ };
2357
+
2185
2358
  function createBaseAccessMeta(): AccessMeta {
2186
2359
  return {
2187
2360
  projectIdField: "",
@@ -10316,6 +10489,7 @@ function createBaseAccount(): Account {
10316
10489
  address: "",
10317
10490
  paymentMethod: 0,
10318
10491
  usageOverCapLimit: "",
10492
+ status: "",
10319
10493
  };
10320
10494
  }
10321
10495
 
@@ -10348,6 +10522,9 @@ export const Account = {
10348
10522
  if (message.usageOverCapLimit !== "") {
10349
10523
  writer.uint32(90).string(message.usageOverCapLimit);
10350
10524
  }
10525
+ if (message.status !== "") {
10526
+ writer.uint32(98).string(message.status);
10527
+ }
10351
10528
  return writer;
10352
10529
  },
10353
10530
 
@@ -10421,6 +10598,13 @@ export const Account = {
10421
10598
 
10422
10599
  message.usageOverCapLimit = reader.string();
10423
10600
  continue;
10601
+ case 12:
10602
+ if (tag !== 98) {
10603
+ break;
10604
+ }
10605
+
10606
+ message.status = reader.string();
10607
+ continue;
10424
10608
  }
10425
10609
  if ((tag & 7) === 4 || tag === 0) {
10426
10610
  break;
@@ -10441,6 +10625,7 @@ export const Account = {
10441
10625
  address: isSet(object.address) ? globalThis.String(object.address) : "",
10442
10626
  paymentMethod: isSet(object.paymentMethod) ? payMethodFromJSON(object.paymentMethod) : 0,
10443
10627
  usageOverCapLimit: isSet(object.usageOverCapLimit) ? globalThis.String(object.usageOverCapLimit) : "",
10628
+ status: isSet(object.status) ? globalThis.String(object.status) : "",
10444
10629
  };
10445
10630
  },
10446
10631
 
@@ -10473,6 +10658,9 @@ export const Account = {
10473
10658
  if (message.usageOverCapLimit !== "") {
10474
10659
  obj.usageOverCapLimit = message.usageOverCapLimit;
10475
10660
  }
10661
+ if (message.status !== "") {
10662
+ obj.status = message.status;
10663
+ }
10476
10664
  return obj;
10477
10665
  },
10478
10666
 
@@ -10490,6 +10678,7 @@ export const Account = {
10490
10678
  message.address = object.address ?? "";
10491
10679
  message.paymentMethod = object.paymentMethod ?? 0;
10492
10680
  message.usageOverCapLimit = object.usageOverCapLimit ?? "";
10681
+ message.status = object.status ?? "";
10493
10682
  return message;
10494
10683
  },
10495
10684
  };
package/src/index.ts CHANGED
@@ -8,3 +8,10 @@ export { GLOBAL_CONFIG, type GlobalConfig } from './global-config.js'
8
8
  export * from './db-context.js'
9
9
  export * from './provider.js'
10
10
  export * from './metrics.js'
11
+ export {
12
+ type DataBinding,
13
+ type Data_EthLog,
14
+ type Data_EthBlock,
15
+ type Data_EthTransaction,
16
+ type Data_EthTrace
17
+ } from './gen/processor/protos/processor.js'
@@ -96,10 +96,11 @@ export class ServiceManager extends ProcessorServiceImpl {
96
96
  }
97
97
 
98
98
  if (this.enablePartition) {
99
- const partitions = await PluginManager.INSTANCE.partition(request.binding)
100
- subject.next({
101
- processId: request.processId,
102
- partitions
99
+ PluginManager.INSTANCE.partition(request.binding).then((partitions) => {
100
+ subject.next({
101
+ processId: request.processId,
102
+ partitions
103
+ })
103
104
  })
104
105
  lastBinding = request.binding
105
106
  } else {
package/src/service.ts CHANGED
@@ -424,7 +424,7 @@ export class ProcessorServiceImpl implements ProcessorServiceImplementation {
424
424
  let lastBinding: DataBinding | undefined = undefined
425
425
  for await (const request of requests) {
426
426
  try {
427
- console.log('received request:', request, 'lastBinding:', lastBinding)
427
+ // console.log('received request:', request, 'lastBinding:', lastBinding)
428
428
  if (request.binding) {
429
429
  process_binding_count.add(1)
430
430
 
@@ -440,10 +440,11 @@ export class ProcessorServiceImpl implements ProcessorServiceImplementation {
440
440
  lastBinding = request.binding
441
441
 
442
442
  if (this.enablePartition) {
443
- const partitions = await PluginManager.INSTANCE.partition(request.binding)
444
- subject.next({
445
- processId: request.processId,
446
- partitions
443
+ PluginManager.INSTANCE.partition(request.binding).then((partitions) => {
444
+ subject.next({
445
+ processId: request.processId,
446
+ partitions
447
+ })
447
448
  })
448
449
  } else {
449
450
  this.startProcess(request.processId, request.binding, contexts, subject)
@@ -472,7 +473,6 @@ export class ProcessorServiceImpl implements ProcessorServiceImplementation {
472
473
  console.error('unexpect error during handle loop', e)
473
474
  }
474
475
  }
475
- console.info('process stream requests finished')
476
476
  }
477
477
 
478
478
  private startProcess(