envio 2.32.3 → 3.0.0-alpha.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/bin.js +5 -3
- package/evm.schema.json +23 -6
- package/fuel.schema.json +17 -5
- package/index.d.ts +1 -27
- package/index.js +9 -6
- package/package.json +12 -7
- package/rescript.json +4 -3
- package/src/{Address.res.js → Address.res.mjs} +7 -6
- package/src/Batch.res +4 -4
- package/src/{Batch.res.js → Batch.res.mjs} +19 -18
- package/src/{ChainMap.res.js → ChainMap.res.mjs} +20 -19
- package/src/Change.res +9 -0
- package/src/Config.res +5 -5
- package/src/{Config.res.js → Config.res.mjs} +13 -10
- package/src/Envio.gen.ts +4 -17
- package/src/Envio.res +13 -38
- package/src/{Envio.res.js → Envio.res.mjs} +5 -16
- package/src/{ErrorHandling.res.js → ErrorHandling.res.mjs} +10 -9
- package/src/EventRegister.res +10 -11
- package/src/{EventRegister.res.js → EventRegister.res.mjs} +33 -26
- package/src/EventRegister.resi +2 -1
- package/src/{EventUtils.res.js → EventUtils.res.mjs} +10 -9
- package/src/{EvmTypes.res.js → EvmTypes.res.mjs} +5 -4
- package/src/{FetchState.res.js → FetchState.res.mjs} +44 -43
- package/src/{Hasura.res.js → Hasura.res.mjs} +25 -24
- package/src/InMemoryStore.res +7 -15
- package/src/{InMemoryStore.res.js → InMemoryStore.res.mjs} +21 -22
- package/src/InMemoryTable.res +50 -35
- package/src/{InMemoryTable.res.js → InMemoryTable.res.mjs} +73 -104
- package/src/Internal.gen.ts +1 -5
- package/src/Internal.res +29 -40
- package/src/Internal.res.mjs +58 -0
- package/src/{LazyLoader.res.js → LazyLoader.res.mjs} +14 -13
- package/src/{LoadManager.res.js → LoadManager.res.mjs} +11 -10
- package/src/{LogSelection.res.js → LogSelection.res.mjs} +14 -13
- package/src/{Logging.res.js → Logging.res.mjs} +37 -36
- package/src/Persistence.res +190 -38
- package/src/Persistence.res.mjs +213 -0
- package/src/PgStorage.res +700 -14
- package/src/{PgStorage.res.js → PgStorage.res.mjs} +478 -65
- package/src/Platform.res +140 -0
- package/src/Platform.res.mjs +170 -0
- package/src/Prometheus.res +41 -0
- package/src/{Prometheus.res.js → Prometheus.res.mjs} +106 -60
- package/src/{ReorgDetection.res.js → ReorgDetection.res.mjs} +12 -11
- package/src/SafeCheckpointTracking.res +5 -4
- package/src/{SafeCheckpointTracking.res.js → SafeCheckpointTracking.res.mjs} +6 -5
- package/src/Sink.res +47 -0
- package/src/Sink.res.mjs +37 -0
- package/src/{TableIndices.res.js → TableIndices.res.mjs} +8 -7
- package/src/{Throttler.res.js → Throttler.res.mjs} +7 -6
- package/src/{Time.res.js → Time.res.mjs} +8 -7
- package/src/{TopicFilter.res.js → TopicFilter.res.mjs} +18 -17
- package/src/Utils.res +42 -0
- package/src/{Utils.res.js → Utils.res.mjs} +71 -34
- package/src/bindings/BigDecimal.gen.ts +2 -2
- package/src/bindings/BigDecimal.res +5 -5
- package/src/bindings/BigDecimal.res.d.mts +5 -0
- package/src/bindings/{BigDecimal.res.js → BigDecimal.res.mjs} +10 -9
- package/src/bindings/BigInt.gen.ts +2 -2
- package/src/bindings/BigInt.res.d.mts +5 -0
- package/src/bindings/{BigInt.res.js → BigInt.res.mjs} +25 -24
- package/src/bindings/ClickHouse.res +387 -0
- package/src/bindings/ClickHouse.res.mjs +275 -0
- package/src/bindings/Ethers.gen.ts +2 -2
- package/src/bindings/Ethers.res.d.mts +5 -0
- package/src/bindings/{Ethers.res.js → Ethers.res.mjs} +18 -17
- package/src/bindings/Express.res.mjs +2 -0
- package/src/bindings/{Hrtime.res.js → Hrtime.res.mjs} +13 -12
- package/src/bindings/{Lodash.res.js → Lodash.res.mjs} +4 -3
- package/src/bindings/NodeJs.res +13 -1
- package/src/bindings/NodeJs.res.mjs +48 -0
- package/src/bindings/Pino.res +4 -4
- package/src/bindings/{Pino.res.js → Pino.res.mjs} +16 -15
- package/src/bindings/Postgres.res +17 -2
- package/src/bindings/{Postgres.res.js → Postgres.res.mjs} +4 -3
- package/src/bindings/{PromClient.res.js → PromClient.res.mjs} +6 -5
- package/src/bindings/{Promise.res.js → Promise.res.mjs} +6 -5
- package/src/bindings/{SDSL.res.js → SDSL.res.mjs} +3 -2
- package/src/bindings/{Viem.res.js → Viem.res.mjs} +9 -8
- package/src/bindings/vendored-lodash-fns.js +3 -35
- package/src/db/EntityHistory.res +33 -156
- package/src/db/EntityHistory.res.mjs +121 -0
- package/src/db/InternalTable.gen.ts +2 -2
- package/src/db/InternalTable.res +55 -56
- package/src/db/{InternalTable.res.js → InternalTable.res.mjs} +68 -71
- package/src/db/{Schema.res.js → Schema.res.mjs} +10 -9
- package/src/db/Table.res +86 -22
- package/src/db/{Table.res.js → Table.res.mjs} +108 -40
- package/src/sources/{EventRouter.res.js → EventRouter.res.mjs} +17 -16
- package/src/sources/{Fuel.res.js → Fuel.res.mjs} +6 -5
- package/src/sources/{HyperFuel.res.js → HyperFuel.res.mjs} +14 -13
- package/src/sources/{HyperFuelClient.res.js → HyperFuelClient.res.mjs} +7 -6
- package/src/sources/{HyperFuelSource.res.js → HyperFuelSource.res.mjs} +28 -27
- package/src/sources/{HyperSync.res.js → HyperSync.res.mjs} +21 -20
- package/src/sources/HyperSyncClient.gen.ts +1 -1
- package/src/sources/HyperSyncClient.res +78 -20
- package/src/sources/{HyperSyncClient.res.js → HyperSyncClient.res.mjs} +32 -15
- package/src/sources/{HyperSyncJsonApi.res.js → HyperSyncJsonApi.res.mjs} +10 -9
- package/src/sources/HyperSyncSource.res +77 -9
- package/src/sources/{HyperSyncSource.res.js → HyperSyncSource.res.mjs} +99 -38
- package/src/sources/{Rpc.res.js → Rpc.res.mjs} +16 -15
- package/src/sources/{RpcSource.res.js → RpcSource.res.mjs} +40 -39
- package/src/sources/Source.res +1 -1
- package/src/sources/{Source.res.js → Source.res.mjs} +4 -3
- package/src/sources/SourceManager.res +12 -1
- package/src/sources/{SourceManager.res.js → SourceManager.res.mjs} +32 -21
- package/src/sources/vendored-fuel-abi-coder.js +94 -149
- package/src/vendored/{Rest.res.js → Rest.res.mjs} +12 -11
- package/src/Internal.res.js +0 -62
- package/src/Persistence.res.js +0 -159
- package/src/bindings/NodeJs.res.js +0 -35
- package/src/db/EntityHistory.res.js +0 -195
- /package/src/{Indexer.res.js → Change.res.mjs} +0 -0
- /package/src/{bindings/Express.res.js → Indexer.res.mjs} +0 -0
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
-
'use strict';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import * as Internal from "./Internal.res.mjs";
|
|
4
|
+
import * as S$RescriptSchema from "rescript-schema/src/S.res.mjs";
|
|
6
5
|
|
|
7
6
|
function durationToMs(duration) {
|
|
8
7
|
if (typeof duration !== "number") {
|
|
@@ -61,18 +60,8 @@ function createEffect(options, handler) {
|
|
|
61
60
|
};
|
|
62
61
|
}
|
|
63
62
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
name: options.name,
|
|
68
|
-
input: options.input,
|
|
69
|
-
output: options.output,
|
|
70
|
-
rateLimit: rateLimit !== undefined ? rateLimit : false,
|
|
71
|
-
cache: options.cache
|
|
72
|
-
}, handler);
|
|
63
|
+
export {
|
|
64
|
+
durationToMs ,
|
|
65
|
+
createEffect ,
|
|
73
66
|
}
|
|
74
|
-
|
|
75
|
-
exports.durationToMs = durationToMs;
|
|
76
|
-
exports.createEffect = createEffect;
|
|
77
|
-
exports.experimental_createEffect = experimental_createEffect;
|
|
78
67
|
/* Internal Not a pure module */
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
-
'use strict';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import * as Utils from "./Utils.res.mjs";
|
|
4
|
+
import * as Logging from "./Logging.res.mjs";
|
|
6
5
|
|
|
7
6
|
function make(exn, loggerOpt, msg) {
|
|
8
7
|
var logger = loggerOpt !== undefined ? loggerOpt : Logging.getLogger();
|
|
@@ -47,10 +46,12 @@ function logAndRaise(self) {
|
|
|
47
46
|
throw Utils.prettifyExn(self.exn);
|
|
48
47
|
}
|
|
49
48
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
49
|
+
export {
|
|
50
|
+
make ,
|
|
51
|
+
log ,
|
|
52
|
+
raiseExn ,
|
|
53
|
+
mkLogAndRaise ,
|
|
54
|
+
unwrapLogAndRaise ,
|
|
55
|
+
logAndRaise ,
|
|
56
|
+
}
|
|
56
57
|
/* Utils Not a pure module */
|
package/src/EventRegister.res
CHANGED
|
@@ -4,7 +4,7 @@ type registrations = {
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
type activeRegistration = {
|
|
7
|
-
|
|
7
|
+
platform: Platform.t,
|
|
8
8
|
multichain: Config.multichain,
|
|
9
9
|
preloadHandlers: bool,
|
|
10
10
|
registrations: registrations,
|
|
@@ -36,9 +36,9 @@ let withRegistration = (fn: activeRegistration => unit) => {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
let startRegistration = (~
|
|
39
|
+
let startRegistration = (~platform, ~multichain, ~preloadHandlers) => {
|
|
40
40
|
let r = {
|
|
41
|
-
|
|
41
|
+
platform,
|
|
42
42
|
multichain,
|
|
43
43
|
preloadHandlers,
|
|
44
44
|
registrations: {
|
|
@@ -68,6 +68,13 @@ let finishRegistration = () => {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
let isPendingRegistration = () => {
|
|
72
|
+
switch activeRegistration.contents {
|
|
73
|
+
| Some(r) => !r.finished
|
|
74
|
+
| None => false
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
71
78
|
let onBlockOptionsSchema = S.schema(s =>
|
|
72
79
|
{
|
|
73
80
|
"name": s.matches(S.string),
|
|
@@ -80,14 +87,6 @@ let onBlockOptionsSchema = S.schema(s =>
|
|
|
80
87
|
|
|
81
88
|
let onBlock = (rawOptions: unknown, handler: Internal.onBlockArgs => promise<unit>) => {
|
|
82
89
|
withRegistration(registration => {
|
|
83
|
-
// There's no big reason for this. It's just more work
|
|
84
|
-
switch registration.ecosystem {
|
|
85
|
-
| Evm => ()
|
|
86
|
-
| Fuel =>
|
|
87
|
-
Js.Exn.raiseError(
|
|
88
|
-
"Block Handlers are not supported for non-EVM ecosystems. Please reach out to the Envio team if you need this feature.",
|
|
89
|
-
)
|
|
90
|
-
}
|
|
91
90
|
// We need to get timestamp for ordered multichain mode
|
|
92
91
|
switch registration.multichain {
|
|
93
92
|
| Unordered => ()
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
-
'use strict';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
import * as Js_exn from "rescript/lib/es6/js_exn.js";
|
|
4
|
+
import * as Logging from "./Logging.res.mjs";
|
|
5
|
+
import * as Belt_Option from "rescript/lib/es6/belt_Option.js";
|
|
6
|
+
import * as ErrorHandling from "./ErrorHandling.res.mjs";
|
|
7
|
+
import * as Caml_exceptions from "rescript/lib/es6/caml_exceptions.js";
|
|
8
|
+
import * as S$RescriptSchema from "rescript-schema/src/S.res.mjs";
|
|
10
9
|
|
|
11
10
|
var activeRegistration = {
|
|
12
11
|
contents: undefined
|
|
@@ -28,9 +27,9 @@ function withRegistration(fn) {
|
|
|
28
27
|
}
|
|
29
28
|
}
|
|
30
29
|
|
|
31
|
-
function startRegistration(
|
|
30
|
+
function startRegistration(platform, multichain, preloadHandlers) {
|
|
32
31
|
var r = {
|
|
33
|
-
|
|
32
|
+
platform: platform,
|
|
34
33
|
multichain: multichain,
|
|
35
34
|
preloadHandlers: preloadHandlers,
|
|
36
35
|
registrations: {
|
|
@@ -59,6 +58,15 @@ function finishRegistration() {
|
|
|
59
58
|
}
|
|
60
59
|
}
|
|
61
60
|
|
|
61
|
+
function isPendingRegistration() {
|
|
62
|
+
var r = activeRegistration.contents;
|
|
63
|
+
if (r !== undefined) {
|
|
64
|
+
return !r.finished;
|
|
65
|
+
} else {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
62
70
|
var onBlockOptionsSchema = S$RescriptSchema.schema(function (s) {
|
|
63
71
|
return {
|
|
64
72
|
name: s.m(S$RescriptSchema.string),
|
|
@@ -71,12 +79,8 @@ var onBlockOptionsSchema = S$RescriptSchema.schema(function (s) {
|
|
|
71
79
|
|
|
72
80
|
function onBlock(rawOptions, handler) {
|
|
73
81
|
withRegistration(function (registration) {
|
|
74
|
-
var match = registration.
|
|
75
|
-
if (match
|
|
76
|
-
Js_exn.raiseError("Block Handlers are not supported for non-EVM ecosystems. Please reach out to the Envio team if you need this feature.");
|
|
77
|
-
}
|
|
78
|
-
var match$1 = registration.multichain;
|
|
79
|
-
if (match$1 === "ordered") {
|
|
82
|
+
var match = registration.multichain;
|
|
83
|
+
if (match === "ordered") {
|
|
80
84
|
Js_exn.raiseError("Block Handlers are not supported for ordered multichain mode. Please reach out to the Envio team if you need this feature or enable unordered multichain mode with `unordered_multichain_mode: true` in your config.");
|
|
81
85
|
}
|
|
82
86
|
if (registration.preloadHandlers) {
|
|
@@ -225,15 +229,18 @@ function setContractRegister(t, contractRegister, eventOptions, loggerOpt) {
|
|
|
225
229
|
});
|
|
226
230
|
}
|
|
227
231
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
232
|
+
export {
|
|
233
|
+
startRegistration ,
|
|
234
|
+
isPendingRegistration ,
|
|
235
|
+
finishRegistration ,
|
|
236
|
+
make ,
|
|
237
|
+
setHandler ,
|
|
238
|
+
setContractRegister ,
|
|
239
|
+
getHandler ,
|
|
240
|
+
getContractRegister ,
|
|
241
|
+
getEventFilters ,
|
|
242
|
+
isWildcard ,
|
|
243
|
+
hasRegistration ,
|
|
244
|
+
onBlock ,
|
|
245
|
+
}
|
|
239
246
|
/* onBlockOptionsSchema Not a pure module */
|
package/src/EventRegister.resi
CHANGED
|
@@ -4,10 +4,11 @@ type registrations = {
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
let startRegistration: (
|
|
7
|
-
~
|
|
7
|
+
~platform: Platform.t,
|
|
8
8
|
~multichain: Config.multichain,
|
|
9
9
|
~preloadHandlers: bool,
|
|
10
10
|
) => unit
|
|
11
|
+
let isPendingRegistration: unit => bool
|
|
11
12
|
let finishRegistration: unit => registrations
|
|
12
13
|
|
|
13
14
|
type t
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
-
'use strict';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import * as $$BigInt from "./bindings/BigInt.res.mjs";
|
|
4
|
+
import * as Js_exn from "rescript/lib/es6/js_exn.js";
|
|
5
|
+
import * as Caml_obj from "rescript/lib/es6/caml_obj.js";
|
|
7
6
|
|
|
8
7
|
function getOrderedBatchItemComparator(item) {
|
|
9
8
|
if (item.kind === 0) {
|
|
@@ -34,9 +33,11 @@ function getEventIdKeyString(chainId, eventId) {
|
|
|
34
33
|
return chainIdStr + "_" + eventId;
|
|
35
34
|
}
|
|
36
35
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
export {
|
|
37
|
+
getOrderedBatchItemComparator ,
|
|
38
|
+
isEarlier ,
|
|
39
|
+
isEarlierUnordered ,
|
|
40
|
+
packEventIndex ,
|
|
41
|
+
getEventIdKeyString ,
|
|
42
|
+
}
|
|
42
43
|
/* BigInt Not a pure module */
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
-
'use strict';
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
import * as S$RescriptSchema from "rescript-schema/src/S.res.mjs";
|
|
5
4
|
|
|
6
5
|
var schema = S$RescriptSchema.setName(S$RescriptSchema.string, "EVM.Hex");
|
|
7
6
|
|
|
@@ -11,6 +10,8 @@ var Hex = {
|
|
|
11
10
|
|
|
12
11
|
var Abi = {};
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
export {
|
|
14
|
+
Hex ,
|
|
15
|
+
Abi ,
|
|
16
|
+
}
|
|
16
17
|
/* schema Not a pure module */
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
-
'use strict';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
3
|
+
import * as Caml from "rescript/lib/es6/caml.js";
|
|
4
|
+
import * as Utils from "./Utils.res.mjs";
|
|
5
|
+
import * as Js_exn from "rescript/lib/es6/js_exn.js";
|
|
6
|
+
import * as Js_dict from "rescript/lib/es6/js_dict.js";
|
|
7
|
+
import * as Js_math from "rescript/lib/es6/js_math.js";
|
|
8
|
+
import * as Logging from "./Logging.res.mjs";
|
|
9
|
+
import * as Belt_Int from "rescript/lib/es6/belt_Int.js";
|
|
10
|
+
import * as Belt_Array from "rescript/lib/es6/belt_Array.js";
|
|
11
|
+
import * as Caml_int32 from "rescript/lib/es6/caml_int32.js";
|
|
12
|
+
import * as Prometheus from "./Prometheus.res.mjs";
|
|
13
|
+
import * as Belt_Option from "rescript/lib/es6/belt_Option.js";
|
|
14
|
+
import * as Belt_Result from "rescript/lib/es6/belt_Result.js";
|
|
15
|
+
import * as Caml_exceptions from "rescript/lib/es6/caml_exceptions.js";
|
|
17
16
|
|
|
18
17
|
function mergeIntoPartition(p, target, maxAddrInPartition) {
|
|
19
18
|
if (!p.selection.dependsOnAddresses) {
|
|
@@ -1048,33 +1047,35 @@ function getUnorderedMultichainProgressBlockNumberAt(fetchState, index) {
|
|
|
1048
1047
|
|
|
1049
1048
|
var blockItemLogIndex = 16777216;
|
|
1050
1049
|
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1050
|
+
export {
|
|
1051
|
+
mergeIntoPartition ,
|
|
1052
|
+
bufferBlockNumber ,
|
|
1053
|
+
bufferBlock ,
|
|
1054
|
+
compareBufferItem ,
|
|
1055
|
+
blockItemLogIndex ,
|
|
1056
|
+
updateInternal ,
|
|
1057
|
+
numAddresses ,
|
|
1058
|
+
warnDifferentContractType ,
|
|
1059
|
+
registerDynamicContracts ,
|
|
1060
|
+
UnexpectedPartitionNotFound ,
|
|
1061
|
+
UnexpectedMergeQueryResponse ,
|
|
1062
|
+
handleQueryResult ,
|
|
1063
|
+
makePartitionQuery ,
|
|
1064
|
+
startFetchingQueries ,
|
|
1065
|
+
addressesByContractNameCount ,
|
|
1066
|
+
addressesByContractNameGetAll ,
|
|
1067
|
+
isFullPartition ,
|
|
1068
|
+
getNextQuery ,
|
|
1069
|
+
getTimestampAt ,
|
|
1070
|
+
hasReadyItem ,
|
|
1071
|
+
getReadyItemsCount ,
|
|
1072
|
+
make ,
|
|
1073
|
+
bufferSize ,
|
|
1074
|
+
rollbackPartition ,
|
|
1075
|
+
rollback ,
|
|
1076
|
+
isActivelyIndexing ,
|
|
1077
|
+
isReadyToEnterReorgThreshold ,
|
|
1078
|
+
sortForUnorderedBatch ,
|
|
1079
|
+
getUnorderedMultichainProgressBlockNumberAt ,
|
|
1080
|
+
}
|
|
1080
1081
|
/* Utils Not a pure module */
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
-
'use strict';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
import * as Rest from "./vendored/Rest.res.mjs";
|
|
4
|
+
import * as Table from "./db/Table.res.mjs";
|
|
5
|
+
import * as Utils from "./Utils.res.mjs";
|
|
6
|
+
import * as Schema from "./db/Schema.res.mjs";
|
|
7
|
+
import * as Logging from "./Logging.res.mjs";
|
|
8
|
+
import * as Belt_Array from "rescript/lib/es6/belt_Array.js";
|
|
9
|
+
import * as InternalTable from "./db/InternalTable.res.mjs";
|
|
10
|
+
import * as S$RescriptSchema from "rescript-schema/src/S.res.mjs";
|
|
11
|
+
import * as Caml_js_exceptions from "rescript/lib/es6/caml_js_exceptions.js";
|
|
13
12
|
|
|
14
13
|
function auth(s) {
|
|
15
14
|
return {
|
|
@@ -296,18 +295,20 @@ async function trackDatabase(endpoint, auth, pgSchema, userEntities, aggregateEn
|
|
|
296
295
|
return await executeBulkKeepGoing(endpoint, auth, allOperations);
|
|
297
296
|
}
|
|
298
297
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
298
|
+
export {
|
|
299
|
+
auth ,
|
|
300
|
+
responses ,
|
|
301
|
+
clearMetadataRoute ,
|
|
302
|
+
trackTablesRoute ,
|
|
303
|
+
createSelectPermissionRoute ,
|
|
304
|
+
rawBodyRoute ,
|
|
305
|
+
bulkKeepGoingRoute ,
|
|
306
|
+
bulkKeepGoingErrorsSchema ,
|
|
307
|
+
clearHasuraMetadata ,
|
|
308
|
+
trackTables ,
|
|
309
|
+
createSelectPermissionOperation ,
|
|
310
|
+
createEntityRelationshipOperation ,
|
|
311
|
+
executeBulkKeepGoing ,
|
|
312
|
+
trackDatabase ,
|
|
313
|
+
}
|
|
313
314
|
/* bulkKeepGoingErrorsSchema Not a pure module */
|
package/src/InMemoryStore.res
CHANGED
|
@@ -22,9 +22,7 @@ module EntityTables = {
|
|
|
22
22
|
switch self->Utils.Dict.dangerouslyGetNonOption(entityName) {
|
|
23
23
|
| Some(table) =>
|
|
24
24
|
table->(
|
|
25
|
-
Utils.magic: InMemoryTable.Entity.t<Internal.entity> => InMemoryTable.Entity.t<
|
|
26
|
-
entity,
|
|
27
|
-
>
|
|
25
|
+
Utils.magic: InMemoryTable.Entity.t<Internal.entity> => InMemoryTable.Entity.t<entity>
|
|
28
26
|
)
|
|
29
27
|
|
|
30
28
|
| None =>
|
|
@@ -53,13 +51,10 @@ type t = {
|
|
|
53
51
|
rawEvents: InMemoryTable.t<rawEventsKey, InternalTable.RawEvents.t>,
|
|
54
52
|
entities: dict<InMemoryTable.Entity.t<Internal.entity>>,
|
|
55
53
|
effects: dict<effectCacheInMemTable>,
|
|
56
|
-
rollbackTargetCheckpointId: option<
|
|
54
|
+
rollbackTargetCheckpointId: option<Internal.checkpointId>,
|
|
57
55
|
}
|
|
58
56
|
|
|
59
|
-
let make = (
|
|
60
|
-
~entities: array<Internal.entityConfig>,
|
|
61
|
-
~rollbackTargetCheckpointId=?,
|
|
62
|
-
): t => {
|
|
57
|
+
let make = (~entities: array<Internal.entityConfig>, ~rollbackTargetCheckpointId=?): t => {
|
|
63
58
|
rawEvents: InMemoryTable.make(~hash=hashRawEventsKey),
|
|
64
59
|
entities: EntityTables.make(entities),
|
|
65
60
|
effects: Js.Dict.empty(),
|
|
@@ -105,9 +100,7 @@ let isRollingBack = (inMemoryStore: t) => inMemoryStore.rollbackTargetCheckpoint
|
|
|
105
100
|
|
|
106
101
|
let setBatchDcs = (inMemoryStore: t, ~batch: Batch.t, ~shouldSaveHistory) => {
|
|
107
102
|
let inMemTable =
|
|
108
|
-
inMemoryStore->getInMemTable(
|
|
109
|
-
~entityConfig=InternalTable.DynamicContractRegistry.config,
|
|
110
|
-
)
|
|
103
|
+
inMemoryStore->getInMemTable(~entityConfig=InternalTable.DynamicContractRegistry.config)
|
|
111
104
|
|
|
112
105
|
let itemIdx = ref(0)
|
|
113
106
|
|
|
@@ -140,11 +133,11 @@ let setBatchDcs = (inMemoryStore: t, ~batch: Batch.t, ~shouldSaveHistory) => {
|
|
|
140
133
|
}
|
|
141
134
|
|
|
142
135
|
inMemTable->InMemoryTable.Entity.set(
|
|
143
|
-
{
|
|
136
|
+
Set({
|
|
144
137
|
entityId: entity.id,
|
|
145
138
|
checkpointId,
|
|
146
|
-
|
|
147
|
-
},
|
|
139
|
+
entity: entity->InternalTable.DynamicContractRegistry.castToInternal,
|
|
140
|
+
}),
|
|
148
141
|
~shouldSaveHistory,
|
|
149
142
|
)
|
|
150
143
|
}
|
|
@@ -154,4 +147,3 @@ let setBatchDcs = (inMemoryStore: t, ~batch: Batch.t, ~shouldSaveHistory) => {
|
|
|
154
147
|
itemIdx := itemIdx.contents + checkpointEventsProcessed
|
|
155
148
|
}
|
|
156
149
|
}
|
|
157
|
-
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
-
'use strict';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
import * as $$Array from "rescript/lib/es6/array.js";
|
|
4
|
+
import * as Utils from "./Utils.res.mjs";
|
|
5
|
+
import * as Js_dict from "rescript/lib/es6/js_dict.js";
|
|
6
|
+
import * as Belt_Array from "rescript/lib/es6/belt_Array.js";
|
|
7
|
+
import * as EventUtils from "./EventUtils.res.mjs";
|
|
8
|
+
import * as ErrorHandling from "./ErrorHandling.res.mjs";
|
|
9
|
+
import * as InMemoryTable from "./InMemoryTable.res.mjs";
|
|
10
|
+
import * as InternalTable from "./db/InternalTable.res.mjs";
|
|
11
|
+
import * as Caml_exceptions from "rescript/lib/es6/caml_exceptions.js";
|
|
13
12
|
|
|
14
13
|
function hashRawEventsKey(key) {
|
|
15
14
|
return EventUtils.getEventIdKeyString(key.chainId, key.eventId);
|
|
@@ -137,11 +136,9 @@ function setBatchDcs(inMemoryStore, batch, shouldSaveHistory) {
|
|
|
137
136
|
contract_name: entity_contract_name
|
|
138
137
|
};
|
|
139
138
|
InMemoryTable.Entity.set(inMemTable, {
|
|
139
|
+
type: "SET",
|
|
140
140
|
entityId: entity_id,
|
|
141
|
-
|
|
142
|
-
TAG: "Set",
|
|
143
|
-
_0: entity
|
|
144
|
-
},
|
|
141
|
+
entity: entity,
|
|
145
142
|
checkpointId: checkpointId
|
|
146
143
|
}, shouldSaveHistory, undefined);
|
|
147
144
|
}
|
|
@@ -152,12 +149,14 @@ function setBatchDcs(inMemoryStore, batch, shouldSaveHistory) {
|
|
|
152
149
|
}
|
|
153
150
|
}
|
|
154
151
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
152
|
+
export {
|
|
153
|
+
hashRawEventsKey ,
|
|
154
|
+
EntityTables ,
|
|
155
|
+
make$1 as make,
|
|
156
|
+
clone$1 as clone,
|
|
157
|
+
getEffectInMemTable ,
|
|
158
|
+
getInMemTable ,
|
|
159
|
+
isRollingBack ,
|
|
160
|
+
setBatchDcs ,
|
|
161
|
+
}
|
|
163
162
|
/* Utils Not a pure module */
|