apibara 2.1.0-beta.37 → 2.1.0-beta.39
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/dist/runtime/dev.mjs
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { runWithReconnect } from "@apibara/indexer";
|
|
2
|
+
import { createAuthenticatedClient } from "@apibara/protocol";
|
|
2
3
|
import { getRuntimeDataFromEnv } from "apibara/common";
|
|
3
4
|
import { defineCommand, runMain } from "citty";
|
|
4
5
|
import { blueBright } from "picocolors";
|
|
5
|
-
import {
|
|
6
|
-
availableIndexers,
|
|
7
|
-
createAuthenticatedClient,
|
|
8
|
-
createIndexer
|
|
9
|
-
} from "./internal/app.mjs";
|
|
6
|
+
import { availableIndexers, createIndexer } from "./internal/app.mjs";
|
|
10
7
|
const startCommand = defineCommand({
|
|
11
8
|
meta: {
|
|
12
9
|
name: "start",
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type CreateClientOptions, type StreamConfig } from "@apibara/protocol";
|
|
2
1
|
export declare const availableIndexers: any;
|
|
3
2
|
export declare function createIndexer({ indexerName, processedRuntimeConfig, preset, }: {
|
|
4
3
|
indexerName: string;
|
|
@@ -14,4 +13,3 @@ export declare function createIndexer({ indexerName, processedRuntimeConfig, pre
|
|
|
14
13
|
indexer: import("@apibara/indexer").Indexer<unknown, unknown>;
|
|
15
14
|
logger: any;
|
|
16
15
|
} | undefined;
|
|
17
|
-
export declare function createAuthenticatedClient(config: StreamConfig<unknown, unknown>, streamUrl: string, options?: CreateClientOptions): import("@apibara/protocol").GrpcClient<unknown, unknown>;
|
|
@@ -6,10 +6,6 @@ import {
|
|
|
6
6
|
inMemoryPersistence,
|
|
7
7
|
logger
|
|
8
8
|
} from "@apibara/indexer/plugins";
|
|
9
|
-
import {
|
|
10
|
-
Metadata,
|
|
11
|
-
createClient
|
|
12
|
-
} from "@apibara/protocol";
|
|
13
9
|
import consola from "consola";
|
|
14
10
|
import { indexers } from "#apibara-internal-virtual/indexers";
|
|
15
11
|
import { logger as instrumentationLogger } from "#apibara-internal-virtual/instrumentation";
|
|
@@ -63,24 +59,3 @@ export function createIndexer({
|
|
|
63
59
|
logger: consola.create({ reporters: [reporter] })
|
|
64
60
|
};
|
|
65
61
|
}
|
|
66
|
-
export function createAuthenticatedClient(config, streamUrl, options) {
|
|
67
|
-
const dnaToken = process.env.DNA_TOKEN;
|
|
68
|
-
if (!dnaToken) {
|
|
69
|
-
consola.warn(
|
|
70
|
-
"DNA_TOKEN environment variable is not set. Trying to connect without authentication."
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
return createClient(config, streamUrl, {
|
|
74
|
-
...options,
|
|
75
|
-
defaultCallOptions: {
|
|
76
|
-
...options?.defaultCallOptions ?? {},
|
|
77
|
-
"*": {
|
|
78
|
-
metadata: Metadata({
|
|
79
|
-
Authorization: `Bearer ${dnaToken}`
|
|
80
|
-
}),
|
|
81
|
-
// metadata cant be overrided with spread as its a class so we override it fully if user provided it.
|
|
82
|
-
...options?.defaultCallOptions?.["*"] ?? {}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
}
|
package/dist/runtime/start.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { runWithReconnect } from "@apibara/indexer";
|
|
2
|
+
import { createAuthenticatedClient } from "@apibara/protocol";
|
|
2
3
|
import {
|
|
3
4
|
checkForUnknownArgs,
|
|
4
5
|
getProcessedRuntimeConfig,
|
|
@@ -14,7 +15,7 @@ import {
|
|
|
14
15
|
runtimeConfig,
|
|
15
16
|
userEnvRuntimeConfig
|
|
16
17
|
} from "#apibara-internal-virtual/static-config";
|
|
17
|
-
import {
|
|
18
|
+
import { createIndexer } from "./internal/app.mjs";
|
|
18
19
|
const startCommand = defineCommand({
|
|
19
20
|
meta: {
|
|
20
21
|
name: "start",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "apibara",
|
|
3
|
-
"version": "2.1.0-beta.
|
|
3
|
+
"version": "2.1.0-beta.39",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/core/index.mjs",
|
|
6
6
|
"exports": {
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"playground:add": "pnpm playground add --dir playground"
|
|
99
99
|
},
|
|
100
100
|
"devDependencies": {
|
|
101
|
-
"@apibara/starknet": "2.1.0-beta.
|
|
101
|
+
"@apibara/starknet": "2.1.0-beta.39",
|
|
102
102
|
"@types/fs-extra": "^11.0.4",
|
|
103
103
|
"@types/node": "^20.14.0",
|
|
104
104
|
"@types/prompts": "^2.4.9",
|
|
@@ -109,8 +109,8 @@
|
|
|
109
109
|
"vitest": "^1.6.0"
|
|
110
110
|
},
|
|
111
111
|
"dependencies": {
|
|
112
|
-
"@apibara/indexer": "2.1.0-beta.
|
|
113
|
-
"@apibara/protocol": "2.1.0-beta.
|
|
112
|
+
"@apibara/indexer": "2.1.0-beta.39",
|
|
113
|
+
"@apibara/protocol": "2.1.0-beta.39",
|
|
114
114
|
"@rollup/plugin-replace": "^6.0.2",
|
|
115
115
|
"@rollup/plugin-virtual": "^3.0.2",
|
|
116
116
|
"c12": "^1.11.1",
|
package/src/runtime/dev.ts
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { runWithReconnect } from "@apibara/indexer";
|
|
2
|
+
import { createAuthenticatedClient } from "@apibara/protocol";
|
|
2
3
|
import { getRuntimeDataFromEnv } from "apibara/common";
|
|
3
4
|
import { defineCommand, runMain } from "citty";
|
|
4
5
|
import { blueBright } from "picocolors";
|
|
5
|
-
import {
|
|
6
|
-
availableIndexers,
|
|
7
|
-
createAuthenticatedClient,
|
|
8
|
-
createIndexer,
|
|
9
|
-
} from "./internal/app";
|
|
6
|
+
import { availableIndexers, createIndexer } from "./internal/app";
|
|
10
7
|
|
|
11
8
|
const startCommand = defineCommand({
|
|
12
9
|
meta: {
|
|
@@ -8,12 +8,6 @@ import {
|
|
|
8
8
|
inMemoryPersistence,
|
|
9
9
|
logger,
|
|
10
10
|
} from "@apibara/indexer/plugins";
|
|
11
|
-
import {
|
|
12
|
-
type CreateClientOptions,
|
|
13
|
-
Metadata,
|
|
14
|
-
type StreamConfig,
|
|
15
|
-
createClient,
|
|
16
|
-
} from "@apibara/protocol";
|
|
17
11
|
import consola from "consola";
|
|
18
12
|
import { indexers } from "#apibara-internal-virtual/indexers";
|
|
19
13
|
import { logger as instrumentationLogger } from "#apibara-internal-virtual/instrumentation";
|
|
@@ -95,30 +89,3 @@ export function createIndexer({
|
|
|
95
89
|
logger: consola.create({ reporters: [reporter] }),
|
|
96
90
|
};
|
|
97
91
|
}
|
|
98
|
-
|
|
99
|
-
export function createAuthenticatedClient(
|
|
100
|
-
config: StreamConfig<unknown, unknown>,
|
|
101
|
-
streamUrl: string,
|
|
102
|
-
options?: CreateClientOptions,
|
|
103
|
-
) {
|
|
104
|
-
const dnaToken = process.env.DNA_TOKEN;
|
|
105
|
-
if (!dnaToken) {
|
|
106
|
-
consola.warn(
|
|
107
|
-
"DNA_TOKEN environment variable is not set. Trying to connect without authentication.",
|
|
108
|
-
);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
return createClient(config, streamUrl, {
|
|
112
|
-
...options,
|
|
113
|
-
defaultCallOptions: {
|
|
114
|
-
...(options?.defaultCallOptions ?? {}),
|
|
115
|
-
"*": {
|
|
116
|
-
metadata: Metadata({
|
|
117
|
-
Authorization: `Bearer ${dnaToken}`,
|
|
118
|
-
}),
|
|
119
|
-
// metadata cant be overrided with spread as its a class so we override it fully if user provided it.
|
|
120
|
-
...(options?.defaultCallOptions?.["*"] ?? {}),
|
|
121
|
-
},
|
|
122
|
-
},
|
|
123
|
-
});
|
|
124
|
-
}
|
package/src/runtime/start.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { runWithReconnect } from "@apibara/indexer";
|
|
2
|
+
import { createAuthenticatedClient } from "@apibara/protocol";
|
|
2
3
|
import {
|
|
3
4
|
checkForUnknownArgs,
|
|
4
5
|
getProcessedRuntimeConfig,
|
|
@@ -15,7 +16,7 @@ import {
|
|
|
15
16
|
runtimeConfig,
|
|
16
17
|
userEnvRuntimeConfig,
|
|
17
18
|
} from "#apibara-internal-virtual/static-config";
|
|
18
|
-
import {
|
|
19
|
+
import { createIndexer } from "./internal/app";
|
|
19
20
|
|
|
20
21
|
const startCommand = defineCommand({
|
|
21
22
|
meta: {
|