@sentio/runtime 4.0.0-rc.9 → 4.0.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.
- package/lib/chunk-AUPVVLD3.js +3 -0
- package/lib/chunk-GIDETKWP.js +3 -0
- package/lib/{chunk-LSYQ34WX.js.map → chunk-GIDETKWP.js.map} +1 -1
- package/lib/chunk-OWUO6IOO.js +4 -0
- package/lib/{chunk-JTBA3KXU.js.map → chunk-OWUO6IOO.js.map} +1 -1
- package/lib/chunk-TW627LH5.js +3 -0
- package/lib/{chunk-I45UXGDM.js.map → chunk-TW627LH5.js.map} +1 -1
- package/lib/chunk-ZBEAD3P3.js +15 -0
- package/lib/{chunk-7JGO6QCN.js.map → chunk-ZBEAD3P3.js.map} +1 -1
- package/lib/getMachineId-bsd-D4LAJDEF.js +3 -0
- package/lib/{getMachineId-bsd-OV63RCBF.js.map → getMachineId-bsd-D4LAJDEF.js.map} +1 -1
- package/lib/getMachineId-darwin-LI2YUJNR.js +4 -0
- package/lib/{getMachineId-darwin-7BY3RHHX.js.map → getMachineId-darwin-LI2YUJNR.js.map} +1 -1
- package/lib/getMachineId-linux-U5ITOJBK.js +3 -0
- package/lib/{getMachineId-linux-SN23MJRK.js.map → getMachineId-linux-U5ITOJBK.js.map} +1 -1
- package/lib/getMachineId-unsupported-5HCFSWXA.js +3 -0
- package/lib/{getMachineId-unsupported-CQYUAEDB.js.map → getMachineId-unsupported-5HCFSWXA.js.map} +1 -1
- package/lib/getMachineId-win-MPVRXIQL.js +3 -0
- package/lib/{getMachineId-win-NL4ZQSDA.js.map → getMachineId-win-MPVRXIQL.js.map} +1 -1
- package/lib/index.d.ts +5 -5
- package/lib/index.js +1 -133
- package/lib/index.js.map +1 -1
- package/lib/processor-runner.js +92 -51086
- package/lib/processor-runner.js.map +1 -1
- package/package.json +1 -1
- package/src/chain-config.ts +1 -1
- package/src/endpoints.ts +5 -5
- package/src/gen/processor/protos/processor_pb.ts +6 -1
- package/lib/chunk-7JGO6QCN.js +0 -15174
- package/lib/chunk-I45UXGDM.js +0 -1697
- package/lib/chunk-JTBA3KXU.js +0 -4988
- package/lib/chunk-KVSDPGUI.js +0 -50
- package/lib/chunk-LSYQ34WX.js +0 -21
- package/lib/getMachineId-bsd-OV63RCBF.js +0 -41
- package/lib/getMachineId-darwin-7BY3RHHX.js +0 -41
- package/lib/getMachineId-linux-SN23MJRK.js +0 -33
- package/lib/getMachineId-unsupported-CQYUAEDB.js +0 -24
- package/lib/getMachineId-win-NL4ZQSDA.js +0 -43
- /package/lib/{chunk-KVSDPGUI.js.map → chunk-AUPVVLD3.js.map} +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as createRequireShim } from 'module'; const require = createRequireShim(import.meta.url);
|
|
2
|
+
import{a as t,b as s}from"./chunk-GIDETKWP.js";import{j as r,o as n}from"./chunk-TW627LH5.js";import{b as i}from"./chunk-AUPVVLD3.js";import{promises as o}from"fs";async function m(){try{return(await o.readFile("/etc/hostid",{encoding:"utf8"})).trim()}catch(e){r.debug(`error reading machine id: ${e}`)}try{return(await t("kenv -q smbios.system.uuid")).stdout.trim()}catch(e){r.debug(`error reading machine id: ${e}`)}}var a=i(()=>{s();n()});a();export{m as getMachineId};
|
|
3
|
+
//# sourceMappingURL=getMachineId-bsd-D4LAJDEF.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/resources/src/detectors/platform/node/machine-id/getMachineId-bsd.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { promises as fs } from 'fs';\nimport { execAsync } from './execAsync';\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\n try {\n const result = await fs.readFile('/etc/hostid', { encoding: 'utf8' });\n return result.trim();\n } catch (e) {\n diag.debug(`error reading machine id: ${e}`);\n }\n\n try {\n const result = await execAsync('kenv -q smbios.system.uuid');\n return result.stdout.trim();\n } catch (e) {\n diag.debug(`error reading machine id: ${e}`);\n }\n\n return undefined;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/resources/src/detectors/platform/node/machine-id/getMachineId-bsd.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { promises as fs } from 'fs';\nimport { execAsync } from './execAsync';\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\n try {\n const result = await fs.readFile('/etc/hostid', { encoding: 'utf8' });\n return result.trim();\n } catch (e) {\n diag.debug(`error reading machine id: ${e}`);\n }\n\n try {\n const result = await execAsync('kenv -q smbios.system.uuid');\n return result.stdout.trim();\n } catch (e) {\n diag.debug(`error reading machine id: ${e}`);\n }\n\n return undefined;\n}\n"],"mappings":";sIAKA,OAAS,YAAYA,MAAU,KAI/B,eAAsBC,GAAY,CAChC,GAAI,CAEF,OADe,MAAMD,EAAG,SAAS,cAAe,CAAE,SAAU,MAAM,CAAE,GACtD,KAAI,QACX,EAAG,CACVE,EAAK,MAAM,6BAA6B,CAAC,EAAE,EAG7C,GAAI,CAEF,OADe,MAAMC,EAAU,4BAA4B,GAC7C,OAAO,KAAI,QAClB,EAAG,CACVD,EAAK,MAAM,6BAA6B,CAAC,EAAE,EAI/C,CAzBA,IAAAE,EAAAC,EAAA,KAMAC,IACAC","names":["fs","getMachineId","diag","execAsync","init_getMachineId_bsd","__esmMin","init_execAsync","init_esm"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createRequire as createRequireShim } from 'module'; const require = createRequireShim(import.meta.url);
|
|
2
|
+
import{a as n,b as s}from"./chunk-GIDETKWP.js";import{j as i,o}from"./chunk-TW627LH5.js";import{b as d}from"./chunk-AUPVVLD3.js";async function l(){try{let t=(await n('ioreg -rd1 -c "IOPlatformExpertDevice"')).stdout.split(`
|
|
3
|
+
`).find(c=>c.includes("IOPlatformUUID"));if(!t)return;let r=t.split('" = "');if(r.length===2)return r[1].slice(0,-1)}catch(e){i.debug(`error reading machine id: ${e}`)}}var a=d(()=>{s();o()});a();export{l as getMachineId};
|
|
4
|
+
//# sourceMappingURL=getMachineId-darwin-LI2YUJNR.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/resources/src/detectors/platform/node/machine-id/getMachineId-darwin.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { execAsync } from './execAsync';\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\n try {\n const result = await execAsync('ioreg -rd1 -c \"IOPlatformExpertDevice\"');\n\n const idLine = result.stdout\n .split('\\n')\n .find(line => line.includes('IOPlatformUUID'));\n\n if (!idLine) {\n return undefined;\n }\n\n const parts = idLine.split('\" = \"');\n if (parts.length === 2) {\n return parts[1].slice(0, -1);\n }\n } catch (e) {\n diag.debug(`error reading machine id: ${e}`);\n }\n\n return undefined;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/resources/src/detectors/platform/node/machine-id/getMachineId-darwin.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { execAsync } from './execAsync';\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\n try {\n const result = await execAsync('ioreg -rd1 -c \"IOPlatformExpertDevice\"');\n\n const idLine = result.stdout\n .split('\\n')\n .find(line => line.includes('IOPlatformUUID'));\n\n if (!idLine) {\n return undefined;\n }\n\n const parts = idLine.split('\" = \"');\n if (parts.length === 2) {\n return parts[1].slice(0, -1);\n }\n } catch (e) {\n diag.debug(`error reading machine id: ${e}`);\n }\n\n return undefined;\n}\n"],"mappings":";iIAQA,eAAsBA,GAAY,CAChC,GAAI,CAGF,IAAMC,GAFS,MAAMC,EAAU,wCAAwC,GAEjD,OACnB,MAAM;CAAI,EACV,KAAKC,GAAQA,EAAK,SAAS,gBAAgB,CAAC,EAE/C,GAAI,CAACF,EACH,OAGF,IAAMG,EAAQH,EAAO,MAAM,OAAO,EAClC,GAAIG,EAAM,SAAW,EACnB,OAAOA,EAAM,CAAC,EAAE,MAAM,EAAG,EAAE,QAEtB,EAAG,CACVC,EAAK,MAAM,6BAA6B,CAAC,EAAE,EAI/C,CA7BA,IAAAC,EAAAC,EAAA,KAKAC,IACAC","names":["getMachineId","idLine","execAsync","line","parts","diag","init_getMachineId_darwin","__esmMin","init_execAsync","init_esm"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as createRequireShim } from 'module'; const require = createRequireShim(import.meta.url);
|
|
2
|
+
import{j as r,o as a}from"./chunk-TW627LH5.js";import{b as n}from"./chunk-AUPVVLD3.js";import{promises as o}from"fs";async function m(){let t=["/etc/machine-id","/var/lib/dbus/machine-id"];for(let i of t)try{return(await o.readFile(i,{encoding:"utf8"})).trim()}catch(e){r.debug(`error reading machine id: ${e}`)}}var c=n(()=>{a()});c();export{m as getMachineId};
|
|
3
|
+
//# sourceMappingURL=getMachineId-linux-U5ITOJBK.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/resources/src/detectors/platform/node/machine-id/getMachineId-linux.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { promises as fs } from 'fs';\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\n const paths = ['/etc/machine-id', '/var/lib/dbus/machine-id'];\n\n for (const path of paths) {\n try {\n const result = await fs.readFile(path, { encoding: 'utf8' });\n return result.trim();\n } catch (e) {\n diag.debug(`error reading machine id: ${e}`);\n }\n }\n\n return undefined;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/resources/src/detectors/platform/node/machine-id/getMachineId-linux.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { promises as fs } from 'fs';\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\n const paths = ['/etc/machine-id', '/var/lib/dbus/machine-id'];\n\n for (const path of paths) {\n try {\n const result = await fs.readFile(path, { encoding: 'utf8' });\n return result.trim();\n } catch (e) {\n diag.debug(`error reading machine id: ${e}`);\n }\n }\n\n return undefined;\n}\n"],"mappings":";uFAIA,OAAS,YAAYA,MAAU,KAG/B,eAAsBC,GAAY,CAChC,IAAMC,EAAQ,CAAC,kBAAmB,0BAA0B,EAE5D,QAAWC,KAAQD,EACjB,GAAI,CAEF,OADe,MAAMF,EAAG,SAASG,EAAM,CAAE,SAAU,MAAM,CAAE,GAC7C,KAAI,QACX,EAAG,CACVC,EAAK,MAAM,6BAA6B,CAAC,EAAE,EAKjD,CApBA,IAAAC,EAAAC,EAAA,KAKAC","names":["fs","getMachineId","paths","path","diag","init_getMachineId_linux","__esmMin","init_esm"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as createRequireShim } from 'module'; const require = createRequireShim(import.meta.url);
|
|
2
|
+
import{j as e,o as d}from"./chunk-TW627LH5.js";import{b as n}from"./chunk-AUPVVLD3.js";async function t(){e.debug("could not read machine-id: unsupported platform")}var o=n(()=>{d()});o();export{t as getMachineId};
|
|
3
|
+
//# sourceMappingURL=getMachineId-unsupported-5HCFSWXA.js.map
|
package/lib/{getMachineId-unsupported-CQYUAEDB.js.map → getMachineId-unsupported-5HCFSWXA.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/resources/src/detectors/platform/node/machine-id/getMachineId-unsupported.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\n diag.debug('could not read machine-id: unsupported platform');\n return undefined;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/resources/src/detectors/platform/node/machine-id/getMachineId-unsupported.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\n diag.debug('could not read machine-id: unsupported platform');\n return undefined;\n}\n"],"mappings":";uFAOA,eAAsBA,GAAY,CAChCC,EAAK,MAAM,iDAAiD,CAE9D,CAVA,IAAAC,EAAAC,EAAA,KAKAC","names":["getMachineId","diag","init_getMachineId_unsupported","__esmMin","init_esm"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as createRequireShim } from 'module'; const require = createRequireShim(import.meta.url);
|
|
2
|
+
import{a as s,b as d}from"./chunk-GIDETKWP.js";import{j as n,o as a}from"./chunk-TW627LH5.js";import{b as o}from"./chunk-AUPVVLD3.js";import*as r from"process";async function f(){let c="QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",e="%windir%\\System32\\REG.exe";r.arch==="ia32"&&"PROCESSOR_ARCHITEW6432"in r.env&&(e="%windir%\\sysnative\\cmd.exe /c "+e);try{let i=(await s(`${e} ${c}`)).stdout.split("REG_SZ");if(i.length===2)return i[1].trim()}catch(t){n.debug(`error reading machine id: ${t}`)}}var m=o(()=>{d();a()});m();export{f as getMachineId};
|
|
3
|
+
//# sourceMappingURL=getMachineId-win-MPVRXIQL.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/resources/src/detectors/platform/node/machine-id/getMachineId-win.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport * as process from 'process';\nimport { execAsync } from './execAsync';\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\n const args =\n 'QUERY HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Cryptography /v MachineGuid';\n let command = '%windir%\\\\System32\\\\REG.exe';\n if (process.arch === 'ia32' && 'PROCESSOR_ARCHITEW6432' in process.env) {\n command = '%windir%\\\\sysnative\\\\cmd.exe /c ' + command;\n }\n\n try {\n const result = await execAsync(`${command} ${args}`);\n const parts = result.stdout.split('REG_SZ');\n if (parts.length === 2) {\n return parts[1].trim();\n }\n } catch (e) {\n diag.debug(`error reading machine id: ${e}`);\n }\n\n return undefined;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/resources/src/detectors/platform/node/machine-id/getMachineId-win.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport * as process from 'process';\nimport { execAsync } from './execAsync';\nimport { diag } from '@opentelemetry/api';\n\nexport async function getMachineId(): Promise<string | undefined> {\n const args =\n 'QUERY HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Cryptography /v MachineGuid';\n let command = '%windir%\\\\System32\\\\REG.exe';\n if (process.arch === 'ia32' && 'PROCESSOR_ARCHITEW6432' in process.env) {\n command = '%windir%\\\\sysnative\\\\cmd.exe /c ' + command;\n }\n\n try {\n const result = await execAsync(`${command} ${args}`);\n const parts = result.stdout.split('REG_SZ');\n if (parts.length === 2) {\n return parts[1].trim();\n }\n } catch (e) {\n diag.debug(`error reading machine id: ${e}`);\n }\n\n return undefined;\n}\n"],"mappings":";sIAKA,UAAYA,MAAa,UAIzB,eAAsBC,GAAY,CAChC,IAAMC,EACJ,6EACEC,EAAU,8BACF,SAAS,QAAU,2BAAoC,QACjEA,EAAU,mCAAqCA,GAGjD,GAAI,CAEF,IAAMC,GADS,MAAMC,EAAU,GAAGF,CAAO,IAAID,CAAI,EAAE,GAC9B,OAAO,MAAM,QAAQ,EAC1C,GAAIE,EAAM,SAAW,EACnB,OAAOA,EAAM,CAAC,EAAE,KAAI,QAEfE,EAAG,CACVC,EAAK,MAAM,6BAA6BD,CAAC,EAAE,EAI/C,CA5BA,IAAAE,EAAAC,EAAA,KAMAC,IACAC","names":["process","getMachineId","args","command","parts","execAsync","e","diag","init_getMachineId_win","__esmMin","init_execAsync","init_esm"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -53,13 +53,13 @@ declare function compareSemver(a: Semver, b: Semver): number;
|
|
|
53
53
|
declare function locatePackageJson(pkgId: string): any;
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
|
-
* Resolved RPC endpoint for a chain: the base URL plus optional
|
|
57
|
-
*
|
|
58
|
-
*
|
|
56
|
+
* Resolved RPC endpoint for a chain: the base URL plus optional HTTP headers
|
|
57
|
+
* attached to every request, e.g. the `X-Forwarded-Host` routing key for the Sui
|
|
58
|
+
* gRPC client talking to the Sentio rpc-node.
|
|
59
59
|
*/
|
|
60
60
|
interface ChainRpc {
|
|
61
61
|
url: string;
|
|
62
|
-
|
|
62
|
+
headers?: Record<string, string>;
|
|
63
63
|
}
|
|
64
64
|
declare class Endpoints {
|
|
65
65
|
static INSTANCE: Endpoints;
|
|
@@ -74,7 +74,7 @@ declare function configureEndpoints(options: any): void;
|
|
|
74
74
|
|
|
75
75
|
interface RpcConfig {
|
|
76
76
|
Url: string;
|
|
77
|
-
|
|
77
|
+
Headers?: Record<string, string>;
|
|
78
78
|
}
|
|
79
79
|
interface ChainConfig {
|
|
80
80
|
ChainID: string;
|
package/lib/index.js
CHANGED
|
@@ -1,135 +1,3 @@
|
|
|
1
1
|
import { createRequire as createRequireShim } from 'module'; const require = createRequireShim(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
AbstractStoreContext,
|
|
4
|
-
DataBindingContext,
|
|
5
|
-
Endpoints,
|
|
6
|
-
GLOBAL_CONFIG,
|
|
7
|
-
ProcessorServiceImplV3,
|
|
8
|
-
StoreContext,
|
|
9
|
-
USER_PROCESSOR,
|
|
10
|
-
compareSemver,
|
|
11
|
-
configureEndpoints,
|
|
12
|
-
dbMetrics,
|
|
13
|
-
errorString,
|
|
14
|
-
locatePackageJson,
|
|
15
|
-
makeEthCallKey,
|
|
16
|
-
mergeProcessResults,
|
|
17
|
-
mergeProcessResultsInPlace,
|
|
18
|
-
metricsStorage,
|
|
19
|
-
parseSemver,
|
|
20
|
-
processMetrics,
|
|
21
|
-
providerMetrics,
|
|
22
|
-
recordRuntimeInfo,
|
|
23
|
-
timeoutError
|
|
24
|
-
} from "./chunk-7JGO6QCN.js";
|
|
25
|
-
import {
|
|
26
|
-
Plugin,
|
|
27
|
-
PluginManager
|
|
28
|
-
} from "./chunk-JTBA3KXU.js";
|
|
29
|
-
import "./chunk-I45UXGDM.js";
|
|
30
|
-
import "./chunk-KVSDPGUI.js";
|
|
31
|
-
|
|
32
|
-
// src/state.ts
|
|
33
|
-
var State = class _State {
|
|
34
|
-
stateMap = /* @__PURE__ */ new Map();
|
|
35
|
-
static INSTANCE = new _State();
|
|
36
|
-
static reset() {
|
|
37
|
-
_State.INSTANCE = new _State();
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
var StateStorage = class {
|
|
41
|
-
// TODO learn how to define single instance for all subclasses
|
|
42
|
-
constructor() {
|
|
43
|
-
}
|
|
44
|
-
key() {
|
|
45
|
-
return this.constructor.name;
|
|
46
|
-
}
|
|
47
|
-
getOrRegister() {
|
|
48
|
-
let metricState = State.INSTANCE.stateMap.get(this.key());
|
|
49
|
-
if (!metricState) {
|
|
50
|
-
metricState = this.initValue();
|
|
51
|
-
State.INSTANCE.stateMap.set(this.key(), metricState);
|
|
52
|
-
}
|
|
53
|
-
return metricState;
|
|
54
|
-
}
|
|
55
|
-
unregister() {
|
|
56
|
-
const value = State.INSTANCE.stateMap.get(this.key());
|
|
57
|
-
State.INSTANCE.stateMap.delete(this.key());
|
|
58
|
-
return value;
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
var MapStateStorage = class extends StateStorage {
|
|
62
|
-
initValue() {
|
|
63
|
-
return /* @__PURE__ */ new Map();
|
|
64
|
-
}
|
|
65
|
-
getValue(key) {
|
|
66
|
-
const m = this.getOrRegister();
|
|
67
|
-
return m.get(key);
|
|
68
|
-
}
|
|
69
|
-
getValues() {
|
|
70
|
-
const m = this.getOrRegister();
|
|
71
|
-
return Array.from(m.values());
|
|
72
|
-
}
|
|
73
|
-
getOrSetValue(key, value) {
|
|
74
|
-
const m = this.getOrRegister();
|
|
75
|
-
const oldValue = m.get(key);
|
|
76
|
-
if (oldValue) {
|
|
77
|
-
if (oldValue !== value) {
|
|
78
|
-
console.warn(key, "has been registered twice, use the previous one");
|
|
79
|
-
}
|
|
80
|
-
return oldValue;
|
|
81
|
-
}
|
|
82
|
-
m.set(key, value);
|
|
83
|
-
return value;
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
var ListStateStorage = class extends StateStorage {
|
|
87
|
-
initValue() {
|
|
88
|
-
return [];
|
|
89
|
-
}
|
|
90
|
-
getValues() {
|
|
91
|
-
return this.getOrRegister();
|
|
92
|
-
}
|
|
93
|
-
addValue(value) {
|
|
94
|
-
const m = this.getOrRegister();
|
|
95
|
-
m.push(value);
|
|
96
|
-
return value;
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
import("node:process").then((p) => p.stdout.write(""));
|
|
100
|
-
|
|
101
|
-
// src/chain-config.ts
|
|
102
|
-
import("node:process").then((p) => p.stdout.write(""));
|
|
103
|
-
|
|
104
|
-
// src/index.ts
|
|
105
|
-
import("node:process").then((p) => p.stdout.write(""));
|
|
106
|
-
export {
|
|
107
|
-
AbstractStoreContext,
|
|
108
|
-
DataBindingContext,
|
|
109
|
-
Endpoints,
|
|
110
|
-
GLOBAL_CONFIG,
|
|
111
|
-
ListStateStorage,
|
|
112
|
-
MapStateStorage,
|
|
113
|
-
Plugin,
|
|
114
|
-
PluginManager,
|
|
115
|
-
ProcessorServiceImplV3,
|
|
116
|
-
State,
|
|
117
|
-
StateStorage,
|
|
118
|
-
StoreContext,
|
|
119
|
-
USER_PROCESSOR,
|
|
120
|
-
compareSemver,
|
|
121
|
-
configureEndpoints,
|
|
122
|
-
dbMetrics,
|
|
123
|
-
errorString,
|
|
124
|
-
locatePackageJson,
|
|
125
|
-
makeEthCallKey,
|
|
126
|
-
mergeProcessResults,
|
|
127
|
-
mergeProcessResultsInPlace,
|
|
128
|
-
metricsStorage,
|
|
129
|
-
parseSemver,
|
|
130
|
-
processMetrics,
|
|
131
|
-
providerMetrics,
|
|
132
|
-
recordRuntimeInfo,
|
|
133
|
-
timeoutError
|
|
134
|
-
};
|
|
2
|
+
import{a as T,b as m,c as f,d as l,e as h,f as x,g as d,h as C,i as N,k as R,l as V,q as w,r as O,s as A,t as I,u as M,v as b,w as y,x as E,y as p,z as k}from"./chunk-ZBEAD3P3.js";import{A as c,B as u}from"./chunk-OWUO6IOO.js";import"./chunk-TW627LH5.js";import"./chunk-AUPVVLD3.js";var r=class e{stateMap=new Map;static INSTANCE=new e;static reset(){e.INSTANCE=new e}},i=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}},a=class extends i{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 o=this.getOrRegister(),n=o.get(t);return n?(n!==s&&console.warn(t,"has been registered twice, use the previous one"),n):(o.set(t,s),s)}},g=class extends i{initValue(){return[]}getValues(){return this.getOrRegister()}addValue(t){return this.getOrRegister().push(t),t}};import("node:process").then(e=>e.stdout.write(""));import("node:process").then(e=>e.stdout.write(""));import("node:process").then(e=>e.stdout.write(""));export{b as AbstractStoreContext,E as DataBindingContext,R as Endpoints,p as GLOBAL_CONFIG,g as ListStateStorage,a as MapStateStorage,c as Plugin,u as PluginManager,k as ProcessorServiceImplV3,r as State,i as StateStorage,y as StoreContext,h as USER_PROCESSOR,C as compareSemver,V as configureEndpoints,w as dbMetrics,l as errorString,N as locatePackageJson,x as makeEthCallKey,T as mergeProcessResults,m as mergeProcessResultsInPlace,I as metricsStorage,d as parseSemver,A as processMetrics,O as providerMetrics,f as recordRuntimeInfo,M as timeoutError};
|
|
135
3
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/state.ts","../src/chain-config.ts","../src/index.ts"],"sourcesContent":["export 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;import(\"node:process\").then((p) => p.stdout.write(\"\"));","export interface RpcConfig {\n Url: string\n
|
|
1
|
+
{"version":3,"sources":["../src/state.ts","../src/chain-config.ts","../src/index.ts"],"sourcesContent":["export 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;import(\"node:process\").then((p) => p.stdout.write(\"\"));","export interface RpcConfig {\n Url: string\n Headers?: Record<string, string>\n}\n\nexport interface ChainConfig {\n ChainID: string\n Https?: string[]\n Rpc?: RpcConfig\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-v3.js'\nexport { GLOBAL_CONFIG, type GlobalConfig } from './global-config.js'\nexport * from './db-context.js'\nexport * from './metrics.js'\n;import(\"node:process\").then((p) => p.stdout.write(\"\"));"],"mappings":";2RAAO,IAAMA,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,EACC,OAAO,cAAc,EAAE,KAAMM,GAAMA,EAAE,OAAO,MAAM,EAAE,CAAC,ECzErD,OAAO,cAAc,EAAE,KAAMC,GAAMA,EAAE,OAAO,MAAM,EAAE,CAAC,ECDrD,OAAO,cAAc,EAAE,KAAMC,GAAMA,EAAE,OAAO,MAAM,EAAE,CAAC","names":["State","_State","StateStorage","metricState","value","MapStateStorage","key","m","oldValue","ListStateStorage","p","p","p"]}
|