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.
Files changed (115) hide show
  1. package/bin.js +5 -3
  2. package/evm.schema.json +23 -6
  3. package/fuel.schema.json +17 -5
  4. package/index.d.ts +1 -27
  5. package/index.js +9 -6
  6. package/package.json +12 -7
  7. package/rescript.json +4 -3
  8. package/src/{Address.res.js → Address.res.mjs} +7 -6
  9. package/src/Batch.res +4 -4
  10. package/src/{Batch.res.js → Batch.res.mjs} +19 -18
  11. package/src/{ChainMap.res.js → ChainMap.res.mjs} +20 -19
  12. package/src/Change.res +9 -0
  13. package/src/Config.res +5 -5
  14. package/src/{Config.res.js → Config.res.mjs} +13 -10
  15. package/src/Envio.gen.ts +4 -17
  16. package/src/Envio.res +13 -38
  17. package/src/{Envio.res.js → Envio.res.mjs} +5 -16
  18. package/src/{ErrorHandling.res.js → ErrorHandling.res.mjs} +10 -9
  19. package/src/EventRegister.res +10 -11
  20. package/src/{EventRegister.res.js → EventRegister.res.mjs} +33 -26
  21. package/src/EventRegister.resi +2 -1
  22. package/src/{EventUtils.res.js → EventUtils.res.mjs} +10 -9
  23. package/src/{EvmTypes.res.js → EvmTypes.res.mjs} +5 -4
  24. package/src/{FetchState.res.js → FetchState.res.mjs} +44 -43
  25. package/src/{Hasura.res.js → Hasura.res.mjs} +25 -24
  26. package/src/InMemoryStore.res +7 -15
  27. package/src/{InMemoryStore.res.js → InMemoryStore.res.mjs} +21 -22
  28. package/src/InMemoryTable.res +50 -35
  29. package/src/{InMemoryTable.res.js → InMemoryTable.res.mjs} +73 -104
  30. package/src/Internal.gen.ts +1 -5
  31. package/src/Internal.res +29 -40
  32. package/src/Internal.res.mjs +58 -0
  33. package/src/{LazyLoader.res.js → LazyLoader.res.mjs} +14 -13
  34. package/src/{LoadManager.res.js → LoadManager.res.mjs} +11 -10
  35. package/src/{LogSelection.res.js → LogSelection.res.mjs} +14 -13
  36. package/src/{Logging.res.js → Logging.res.mjs} +37 -36
  37. package/src/Persistence.res +190 -38
  38. package/src/Persistence.res.mjs +213 -0
  39. package/src/PgStorage.res +700 -14
  40. package/src/{PgStorage.res.js → PgStorage.res.mjs} +478 -65
  41. package/src/Platform.res +140 -0
  42. package/src/Platform.res.mjs +170 -0
  43. package/src/Prometheus.res +41 -0
  44. package/src/{Prometheus.res.js → Prometheus.res.mjs} +106 -60
  45. package/src/{ReorgDetection.res.js → ReorgDetection.res.mjs} +12 -11
  46. package/src/SafeCheckpointTracking.res +5 -4
  47. package/src/{SafeCheckpointTracking.res.js → SafeCheckpointTracking.res.mjs} +6 -5
  48. package/src/Sink.res +47 -0
  49. package/src/Sink.res.mjs +37 -0
  50. package/src/{TableIndices.res.js → TableIndices.res.mjs} +8 -7
  51. package/src/{Throttler.res.js → Throttler.res.mjs} +7 -6
  52. package/src/{Time.res.js → Time.res.mjs} +8 -7
  53. package/src/{TopicFilter.res.js → TopicFilter.res.mjs} +18 -17
  54. package/src/Utils.res +42 -0
  55. package/src/{Utils.res.js → Utils.res.mjs} +71 -34
  56. package/src/bindings/BigDecimal.gen.ts +2 -2
  57. package/src/bindings/BigDecimal.res +5 -5
  58. package/src/bindings/BigDecimal.res.d.mts +5 -0
  59. package/src/bindings/{BigDecimal.res.js → BigDecimal.res.mjs} +10 -9
  60. package/src/bindings/BigInt.gen.ts +2 -2
  61. package/src/bindings/BigInt.res.d.mts +5 -0
  62. package/src/bindings/{BigInt.res.js → BigInt.res.mjs} +25 -24
  63. package/src/bindings/ClickHouse.res +387 -0
  64. package/src/bindings/ClickHouse.res.mjs +275 -0
  65. package/src/bindings/Ethers.gen.ts +2 -2
  66. package/src/bindings/Ethers.res.d.mts +5 -0
  67. package/src/bindings/{Ethers.res.js → Ethers.res.mjs} +18 -17
  68. package/src/bindings/Express.res.mjs +2 -0
  69. package/src/bindings/{Hrtime.res.js → Hrtime.res.mjs} +13 -12
  70. package/src/bindings/{Lodash.res.js → Lodash.res.mjs} +4 -3
  71. package/src/bindings/NodeJs.res +13 -1
  72. package/src/bindings/NodeJs.res.mjs +48 -0
  73. package/src/bindings/Pino.res +4 -4
  74. package/src/bindings/{Pino.res.js → Pino.res.mjs} +16 -15
  75. package/src/bindings/Postgres.res +17 -2
  76. package/src/bindings/{Postgres.res.js → Postgres.res.mjs} +4 -3
  77. package/src/bindings/{PromClient.res.js → PromClient.res.mjs} +6 -5
  78. package/src/bindings/{Promise.res.js → Promise.res.mjs} +6 -5
  79. package/src/bindings/{SDSL.res.js → SDSL.res.mjs} +3 -2
  80. package/src/bindings/{Viem.res.js → Viem.res.mjs} +9 -8
  81. package/src/bindings/vendored-lodash-fns.js +3 -35
  82. package/src/db/EntityHistory.res +33 -156
  83. package/src/db/EntityHistory.res.mjs +121 -0
  84. package/src/db/InternalTable.gen.ts +2 -2
  85. package/src/db/InternalTable.res +55 -56
  86. package/src/db/{InternalTable.res.js → InternalTable.res.mjs} +68 -71
  87. package/src/db/{Schema.res.js → Schema.res.mjs} +10 -9
  88. package/src/db/Table.res +86 -22
  89. package/src/db/{Table.res.js → Table.res.mjs} +108 -40
  90. package/src/sources/{EventRouter.res.js → EventRouter.res.mjs} +17 -16
  91. package/src/sources/{Fuel.res.js → Fuel.res.mjs} +6 -5
  92. package/src/sources/{HyperFuel.res.js → HyperFuel.res.mjs} +14 -13
  93. package/src/sources/{HyperFuelClient.res.js → HyperFuelClient.res.mjs} +7 -6
  94. package/src/sources/{HyperFuelSource.res.js → HyperFuelSource.res.mjs} +28 -27
  95. package/src/sources/{HyperSync.res.js → HyperSync.res.mjs} +21 -20
  96. package/src/sources/HyperSyncClient.gen.ts +1 -1
  97. package/src/sources/HyperSyncClient.res +78 -20
  98. package/src/sources/{HyperSyncClient.res.js → HyperSyncClient.res.mjs} +32 -15
  99. package/src/sources/{HyperSyncJsonApi.res.js → HyperSyncJsonApi.res.mjs} +10 -9
  100. package/src/sources/HyperSyncSource.res +77 -9
  101. package/src/sources/{HyperSyncSource.res.js → HyperSyncSource.res.mjs} +99 -38
  102. package/src/sources/{Rpc.res.js → Rpc.res.mjs} +16 -15
  103. package/src/sources/{RpcSource.res.js → RpcSource.res.mjs} +40 -39
  104. package/src/sources/Source.res +1 -1
  105. package/src/sources/{Source.res.js → Source.res.mjs} +4 -3
  106. package/src/sources/SourceManager.res +12 -1
  107. package/src/sources/{SourceManager.res.js → SourceManager.res.mjs} +32 -21
  108. package/src/sources/vendored-fuel-abi-coder.js +94 -149
  109. package/src/vendored/{Rest.res.js → Rest.res.mjs} +12 -11
  110. package/src/Internal.res.js +0 -62
  111. package/src/Persistence.res.js +0 -159
  112. package/src/bindings/NodeJs.res.js +0 -35
  113. package/src/db/EntityHistory.res.js +0 -195
  114. /package/src/{Indexer.res.js → Change.res.mjs} +0 -0
  115. /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
- var Internal = require("./Internal.res.js");
5
- var S$RescriptSchema = require("rescript-schema/src/S.res.js");
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
- function experimental_createEffect(options, handler) {
65
- var rateLimit = options.rateLimit;
66
- return createEffect({
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
- var Utils = require("./Utils.res.js");
5
- var Logging = require("./Logging.res.js");
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
- exports.make = make;
51
- exports.log = log;
52
- exports.raiseExn = raiseExn;
53
- exports.mkLogAndRaise = mkLogAndRaise;
54
- exports.unwrapLogAndRaise = unwrapLogAndRaise;
55
- exports.logAndRaise = logAndRaise;
49
+ export {
50
+ make ,
51
+ log ,
52
+ raiseExn ,
53
+ mkLogAndRaise ,
54
+ unwrapLogAndRaise ,
55
+ logAndRaise ,
56
+ }
56
57
  /* Utils Not a pure module */
@@ -4,7 +4,7 @@ type registrations = {
4
4
  }
5
5
 
6
6
  type activeRegistration = {
7
- ecosystem: Config.ecosystem,
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 = (~ecosystem, ~multichain, ~preloadHandlers) => {
39
+ let startRegistration = (~platform, ~multichain, ~preloadHandlers) => {
40
40
  let r = {
41
- ecosystem,
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
- var Js_exn = require("rescript/lib/js/js_exn.js");
5
- var Logging = require("./Logging.res.js");
6
- var Belt_Option = require("rescript/lib/js/belt_Option.js");
7
- var ErrorHandling = require("./ErrorHandling.res.js");
8
- var Caml_exceptions = require("rescript/lib/js/caml_exceptions.js");
9
- var S$RescriptSchema = require("rescript-schema/src/S.res.js");
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(ecosystem, multichain, preloadHandlers) {
30
+ function startRegistration(platform, multichain, preloadHandlers) {
32
31
  var r = {
33
- ecosystem: ecosystem,
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.ecosystem;
75
- if (match !== "evm") {
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
- exports.startRegistration = startRegistration;
229
- exports.finishRegistration = finishRegistration;
230
- exports.make = make;
231
- exports.setHandler = setHandler;
232
- exports.setContractRegister = setContractRegister;
233
- exports.getHandler = getHandler;
234
- exports.getContractRegister = getContractRegister;
235
- exports.getEventFilters = getEventFilters;
236
- exports.isWildcard = isWildcard;
237
- exports.hasRegistration = hasRegistration;
238
- exports.onBlock = onBlock;
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 */
@@ -4,10 +4,11 @@ type registrations = {
4
4
  }
5
5
 
6
6
  let startRegistration: (
7
- ~ecosystem: Config.ecosystem,
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
- var $$BigInt = require("./bindings/BigInt.res.js");
5
- var Js_exn = require("rescript/lib/js/js_exn.js");
6
- var Caml_obj = require("rescript/lib/js/caml_obj.js");
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
- exports.getOrderedBatchItemComparator = getOrderedBatchItemComparator;
38
- exports.isEarlier = isEarlier;
39
- exports.isEarlierUnordered = isEarlierUnordered;
40
- exports.packEventIndex = packEventIndex;
41
- exports.getEventIdKeyString = getEventIdKeyString;
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
- var S$RescriptSchema = require("rescript-schema/src/S.res.js");
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
- exports.Hex = Hex;
15
- exports.Abi = Abi;
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
- var Caml = require("rescript/lib/js/caml.js");
5
- var Utils = require("./Utils.res.js");
6
- var Js_exn = require("rescript/lib/js/js_exn.js");
7
- var Js_dict = require("rescript/lib/js/js_dict.js");
8
- var Js_math = require("rescript/lib/js/js_math.js");
9
- var Logging = require("./Logging.res.js");
10
- var Belt_Int = require("rescript/lib/js/belt_Int.js");
11
- var Belt_Array = require("rescript/lib/js/belt_Array.js");
12
- var Caml_int32 = require("rescript/lib/js/caml_int32.js");
13
- var Prometheus = require("./Prometheus.res.js");
14
- var Belt_Option = require("rescript/lib/js/belt_Option.js");
15
- var Belt_Result = require("rescript/lib/js/belt_Result.js");
16
- var Caml_exceptions = require("rescript/lib/js/caml_exceptions.js");
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
- exports.mergeIntoPartition = mergeIntoPartition;
1052
- exports.bufferBlockNumber = bufferBlockNumber;
1053
- exports.bufferBlock = bufferBlock;
1054
- exports.compareBufferItem = compareBufferItem;
1055
- exports.blockItemLogIndex = blockItemLogIndex;
1056
- exports.updateInternal = updateInternal;
1057
- exports.numAddresses = numAddresses;
1058
- exports.warnDifferentContractType = warnDifferentContractType;
1059
- exports.registerDynamicContracts = registerDynamicContracts;
1060
- exports.UnexpectedPartitionNotFound = UnexpectedPartitionNotFound;
1061
- exports.UnexpectedMergeQueryResponse = UnexpectedMergeQueryResponse;
1062
- exports.handleQueryResult = handleQueryResult;
1063
- exports.makePartitionQuery = makePartitionQuery;
1064
- exports.startFetchingQueries = startFetchingQueries;
1065
- exports.addressesByContractNameCount = addressesByContractNameCount;
1066
- exports.addressesByContractNameGetAll = addressesByContractNameGetAll;
1067
- exports.isFullPartition = isFullPartition;
1068
- exports.getNextQuery = getNextQuery;
1069
- exports.getTimestampAt = getTimestampAt;
1070
- exports.hasReadyItem = hasReadyItem;
1071
- exports.getReadyItemsCount = getReadyItemsCount;
1072
- exports.make = make;
1073
- exports.bufferSize = bufferSize;
1074
- exports.rollbackPartition = rollbackPartition;
1075
- exports.rollback = rollback;
1076
- exports.isActivelyIndexing = isActivelyIndexing;
1077
- exports.isReadyToEnterReorgThreshold = isReadyToEnterReorgThreshold;
1078
- exports.sortForUnorderedBatch = sortForUnorderedBatch;
1079
- exports.getUnorderedMultichainProgressBlockNumberAt = getUnorderedMultichainProgressBlockNumberAt;
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
- var Rest = require("./vendored/Rest.res.js");
5
- var Table = require("./db/Table.res.js");
6
- var Utils = require("./Utils.res.js");
7
- var Schema = require("./db/Schema.res.js");
8
- var Logging = require("./Logging.res.js");
9
- var Belt_Array = require("rescript/lib/js/belt_Array.js");
10
- var InternalTable = require("./db/InternalTable.res.js");
11
- var S$RescriptSchema = require("rescript-schema/src/S.res.js");
12
- var Caml_js_exceptions = require("rescript/lib/js/caml_js_exceptions.js");
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
- exports.auth = auth;
300
- exports.responses = responses;
301
- exports.clearMetadataRoute = clearMetadataRoute;
302
- exports.trackTablesRoute = trackTablesRoute;
303
- exports.createSelectPermissionRoute = createSelectPermissionRoute;
304
- exports.rawBodyRoute = rawBodyRoute;
305
- exports.bulkKeepGoingRoute = bulkKeepGoingRoute;
306
- exports.bulkKeepGoingErrorsSchema = bulkKeepGoingErrorsSchema;
307
- exports.clearHasuraMetadata = clearHasuraMetadata;
308
- exports.trackTables = trackTables;
309
- exports.createSelectPermissionOperation = createSelectPermissionOperation;
310
- exports.createEntityRelationshipOperation = createEntityRelationshipOperation;
311
- exports.executeBulkKeepGoing = executeBulkKeepGoing;
312
- exports.trackDatabase = trackDatabase;
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 */
@@ -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<int>,
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
- entityUpdateAction: Set(entity->InternalTable.DynamicContractRegistry.castToInternal),
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
- var $$Array = require("rescript/lib/js/array.js");
5
- var Utils = require("./Utils.res.js");
6
- var Js_dict = require("rescript/lib/js/js_dict.js");
7
- var Belt_Array = require("rescript/lib/js/belt_Array.js");
8
- var EventUtils = require("./EventUtils.res.js");
9
- var ErrorHandling = require("./ErrorHandling.res.js");
10
- var InMemoryTable = require("./InMemoryTable.res.js");
11
- var InternalTable = require("./db/InternalTable.res.js");
12
- var Caml_exceptions = require("rescript/lib/js/caml_exceptions.js");
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
- entityUpdateAction: {
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
- exports.hashRawEventsKey = hashRawEventsKey;
156
- exports.EntityTables = EntityTables;
157
- exports.make = make$1;
158
- exports.clone = clone$1;
159
- exports.getEffectInMemTable = getEffectInMemTable;
160
- exports.getInMemTable = getInMemTable;
161
- exports.isRollingBack = isRollingBack;
162
- exports.setBatchDcs = setBatchDcs;
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 */