envio 3.0.0-alpha-main-clickhouse-sink → 3.0.0-alpha.1
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 +0 -27
- package/index.js +9 -6
- package/package.json +11 -7
- package/rescript.json +4 -3
- package/src/{Address.res.js → Address.res.mjs} +7 -6
- package/src/{Batch.res.js → Batch.res.mjs} +19 -18
- package/src/{ChainMap.res.js → ChainMap.res.mjs} +20 -19
- package/src/{Config.res.js → Config.res.mjs} +11 -10
- package/src/Envio.gen.ts +2 -15
- package/src/Envio.res +0 -36
- package/src/{Envio.res.js → Envio.res.mjs} +5 -16
- package/src/{ErrorHandling.res.js → ErrorHandling.res.mjs} +10 -9
- package/src/EventRegister.res +7 -0
- package/src/{EventRegister.res.js → EventRegister.res.mjs} +29 -18
- package/src/EventRegister.resi +1 -0
- 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.js → InMemoryStore.res.mjs} +19 -18
- package/src/{InMemoryTable.res.js → InMemoryTable.res.mjs} +21 -20
- package/src/Internal.gen.ts +1 -3
- package/src/Internal.res +9 -2
- package/src/{Internal.res.js → Internal.res.mjs} +21 -11
- 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.js → Persistence.res.mjs} +22 -21
- package/src/{PgStorage.res.js → PgStorage.res.mjs} +58 -57
- package/src/Platform.res +4 -5
- package/src/{Platform.res.js → Platform.res.mjs} +10 -10
- package/src/{Prometheus.res.js → Prometheus.res.mjs} +66 -65
- package/src/{ReorgDetection.res.js → ReorgDetection.res.mjs} +12 -11
- package/src/{SafeCheckpointTracking.res.js → SafeCheckpointTracking.res.mjs} +6 -5
- package/src/{Sink.res.js → Sink.res.mjs} +6 -5
- 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 +40 -0
- package/src/{Utils.res.js → Utils.res.mjs} +68 -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 +2 -2
- package/src/bindings/{ClickHouse.res.js → ClickHouse.res.mjs} +22 -21
- 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/{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 +6 -6
- package/src/bindings/{Pino.res.js → Pino.res.mjs} +16 -15
- package/src/bindings/Postgres.res +2 -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.js → EntityHistory.res.mjs} +21 -20
- package/src/db/InternalTable.gen.ts +2 -2
- package/src/db/InternalTable.res +0 -2
- package/src/db/{InternalTable.res.js → InternalTable.res.mjs} +19 -19
- package/src/db/{Schema.res.js → Schema.res.mjs} +10 -9
- package/src/db/{Table.res.js → Table.res.mjs} +34 -33
- 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/bindings/NodeJs.res.js +0 -35
- /package/src/{Change.res.js → Change.res.mjs} +0 -0
- /package/src/{Indexer.res.js → Indexer.res.mjs} +0 -0
- /package/src/bindings/{Express.res.js → Express.res.mjs} +0 -0
package/src/Utils.res
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
|
+
@@directive("import packageJson from '../package.json' with { type: 'json' }")
|
|
2
|
+
|
|
1
3
|
external magic: 'a => 'b = "%identity"
|
|
2
4
|
|
|
5
|
+
@val external importPath: string => promise<unknown> = "import"
|
|
6
|
+
|
|
7
|
+
@val
|
|
8
|
+
external importPathWithJson: (
|
|
9
|
+
string,
|
|
10
|
+
@as(json`{with: {type: "json"}}`) _,
|
|
11
|
+
) => promise<{
|
|
12
|
+
"default": Js.Json.t,
|
|
13
|
+
}> = "import"
|
|
14
|
+
|
|
3
15
|
let delay = milliseconds =>
|
|
4
16
|
Js.Promise2.make((~resolve, ~reject as _) => {
|
|
5
17
|
let _interval = Js.Global.setTimeout(_ => {
|
|
@@ -198,6 +210,8 @@ module UnsafeIntOperators = {
|
|
|
198
210
|
external \"-": (int, int) => int = "%subfloat"
|
|
199
211
|
}
|
|
200
212
|
|
|
213
|
+
type asyncIterator<'a>
|
|
214
|
+
|
|
201
215
|
module Array = {
|
|
202
216
|
let immutableEmpty: array<unknown> = []
|
|
203
217
|
|
|
@@ -360,6 +374,19 @@ Helper to check if a value exists in an array
|
|
|
360
374
|
external copy: array<'a> => array<'a> = "slice"
|
|
361
375
|
|
|
362
376
|
@send external at: (array<'a>, int) => option<'a> = "at"
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
Converts an async iterator to an array by iterating through all values
|
|
380
|
+
*/
|
|
381
|
+
let fromAsyncIterator: asyncIterator<string> => promise<
|
|
382
|
+
array<string>,
|
|
383
|
+
> = %raw(`async (iterator) => {
|
|
384
|
+
const result = [];
|
|
385
|
+
for await (const item of iterator) {
|
|
386
|
+
result.push(item);
|
|
387
|
+
}
|
|
388
|
+
return result;
|
|
389
|
+
}`)
|
|
363
390
|
}
|
|
364
391
|
|
|
365
392
|
module String = {
|
|
@@ -655,3 +682,16 @@ let prettifyExn = exn => {
|
|
|
655
682
|
| exn => exn
|
|
656
683
|
}
|
|
657
684
|
}
|
|
685
|
+
|
|
686
|
+
module EnvioPackage = {
|
|
687
|
+
type t = {version: string}
|
|
688
|
+
|
|
689
|
+
let value = try %raw(`packageJson`)->S.parseJsonOrThrow(
|
|
690
|
+
S.schema(s => {
|
|
691
|
+
version: s.matches(S.string),
|
|
692
|
+
}),
|
|
693
|
+
) catch {
|
|
694
|
+
| S.Raised(error) =>
|
|
695
|
+
Js.Exn.raiseError(`Failed to get package.json in envio package: ${error->S.Error.message}`)
|
|
696
|
+
}
|
|
697
|
+
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
+
import packageJson from '../package.json' with { type: 'json' }
|
|
1
2
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var Caml_js_exceptions = require("rescript/lib/js/caml_js_exceptions.js");
|
|
3
|
+
|
|
4
|
+
import * as $$Array from "rescript/lib/es6/array.js";
|
|
5
|
+
import * as Js_exn from "rescript/lib/es6/js_exn.js";
|
|
6
|
+
import * as Caml_obj from "rescript/lib/es6/caml_obj.js";
|
|
7
|
+
import * as Belt_Array from "rescript/lib/es6/belt_Array.js";
|
|
8
|
+
import * as Caml_array from "rescript/lib/es6/caml_array.js";
|
|
9
|
+
import * as Belt_Option from "rescript/lib/es6/belt_Option.js";
|
|
10
|
+
import * as Caml_option from "rescript/lib/es6/caml_option.js";
|
|
11
|
+
import * as Caml_splice_call from "rescript/lib/es6/caml_splice_call.js";
|
|
12
|
+
import * as S$RescriptSchema from "rescript-schema/src/S.res.mjs";
|
|
13
|
+
import * as Caml_js_exceptions from "rescript/lib/es6/caml_js_exceptions.js";
|
|
14
14
|
|
|
15
15
|
function delay(milliseconds) {
|
|
16
16
|
return new Promise((function (resolve, param) {
|
|
@@ -346,6 +346,14 @@ function interleave(arr, separator) {
|
|
|
346
346
|
return interleaved;
|
|
347
347
|
}
|
|
348
348
|
|
|
349
|
+
var fromAsyncIterator = (async (iterator) => {
|
|
350
|
+
const result = [];
|
|
351
|
+
for await (const item of iterator) {
|
|
352
|
+
result.push(item);
|
|
353
|
+
}
|
|
354
|
+
return result;
|
|
355
|
+
});
|
|
356
|
+
|
|
349
357
|
var $$Array$1 = {
|
|
350
358
|
immutableEmpty: immutableEmpty,
|
|
351
359
|
mergeSorted: mergeSorted,
|
|
@@ -360,7 +368,8 @@ var $$Array$1 = {
|
|
|
360
368
|
last: last,
|
|
361
369
|
lastUnsafe: lastUnsafe,
|
|
362
370
|
findReverseWithIndex: findReverseWithIndex,
|
|
363
|
-
interleave: interleave
|
|
371
|
+
interleave: interleave,
|
|
372
|
+
fromAsyncIterator: fromAsyncIterator
|
|
364
373
|
};
|
|
365
374
|
|
|
366
375
|
function capitalize(str) {
|
|
@@ -583,24 +592,49 @@ function prettifyExn(exn) {
|
|
|
583
592
|
}
|
|
584
593
|
}
|
|
585
594
|
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
595
|
+
var value;
|
|
596
|
+
|
|
597
|
+
try {
|
|
598
|
+
value = S$RescriptSchema.parseJsonOrThrow(packageJson, S$RescriptSchema.schema(function (s) {
|
|
599
|
+
return {
|
|
600
|
+
version: s.m(S$RescriptSchema.string)
|
|
601
|
+
};
|
|
602
|
+
}));
|
|
603
|
+
}
|
|
604
|
+
catch (raw_error){
|
|
605
|
+
var error = Caml_js_exceptions.internalToOCamlException(raw_error);
|
|
606
|
+
if (error.RE_EXN_ID === S$RescriptSchema.Raised) {
|
|
607
|
+
value = Js_exn.raiseError("Failed to get package.json in envio package: " + S$RescriptSchema.$$Error.message(error._1));
|
|
608
|
+
} else {
|
|
609
|
+
throw error;
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
var EnvioPackage = {
|
|
614
|
+
value: value
|
|
615
|
+
};
|
|
616
|
+
|
|
617
|
+
export {
|
|
618
|
+
delay ,
|
|
619
|
+
$$Object ,
|
|
620
|
+
$$Error ,
|
|
621
|
+
$$Option ,
|
|
622
|
+
Tuple ,
|
|
623
|
+
Dict ,
|
|
624
|
+
$$Math ,
|
|
625
|
+
UnsafeIntOperators ,
|
|
626
|
+
$$Array$1 as $$Array,
|
|
627
|
+
$$String ,
|
|
628
|
+
Result ,
|
|
629
|
+
unwrapResultExn ,
|
|
630
|
+
Schema ,
|
|
631
|
+
getVariantsTags ,
|
|
632
|
+
$$Set ,
|
|
633
|
+
$$WeakMap ,
|
|
634
|
+
$$Map ,
|
|
635
|
+
$$Proxy ,
|
|
636
|
+
Hash ,
|
|
637
|
+
prettifyExn ,
|
|
638
|
+
EnvioPackage ,
|
|
639
|
+
}
|
|
640
|
+
/* fromAsyncIterator Not a pure module */
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
/* tslint:disable */
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
import * as BigDecimalJS from './BigDecimal.res.mjs';
|
|
7
7
|
|
|
8
|
-
import type {S_t as RescriptSchema_S_t} from 'rescript-schema/RescriptSchema.gen';
|
|
8
|
+
import type {S_t as RescriptSchema_S_t} from 'rescript-schema/RescriptSchema.gen.js';
|
|
9
9
|
|
|
10
10
|
import type {default as $$t} from 'bignumber.js';
|
|
11
11
|
|
|
@@ -14,11 +14,11 @@ type rec t = {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
// Constructors
|
|
17
|
-
@new @module external fromBigInt: bigint => t = "
|
|
18
|
-
@new @module external fromFloat: float => t = "
|
|
19
|
-
@new @module external fromInt: int => t = "
|
|
20
|
-
@new @module external fromStringUnsafe: string => t = "
|
|
21
|
-
@new @module external fromString: string => option<t> = "
|
|
17
|
+
@new @module("bignumber.js") external fromBigInt: bigint => t = "default"
|
|
18
|
+
@new @module("bignumber.js") external fromFloat: float => t = "default"
|
|
19
|
+
@new @module("bignumber.js") external fromInt: int => t = "default"
|
|
20
|
+
@new @module("bignumber.js") external fromStringUnsafe: string => t = "default"
|
|
21
|
+
@new @module("bignumber.js") external fromString: string => option<t> = "default"
|
|
22
22
|
|
|
23
23
|
// Methods
|
|
24
24
|
@send external toString: t => string = "toString"
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
-
'use strict';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import * as Belt_Int from "rescript/lib/es6/belt_Int.js";
|
|
4
|
+
import BignumberJs from "bignumber.js";
|
|
5
|
+
import * as S$RescriptSchema from "rescript-schema/src/S.res.mjs";
|
|
7
6
|
|
|
8
7
|
function toInt(b) {
|
|
9
8
|
return Belt_Int.fromString(b.toString());
|
|
@@ -33,9 +32,11 @@ var schema = S$RescriptSchema.transform(S$RescriptSchema.setName(S$RescriptSchem
|
|
|
33
32
|
};
|
|
34
33
|
}));
|
|
35
34
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
export {
|
|
36
|
+
toInt ,
|
|
37
|
+
notEquals ,
|
|
38
|
+
zero ,
|
|
39
|
+
one ,
|
|
40
|
+
schema ,
|
|
41
|
+
}
|
|
41
42
|
/* zero Not a pure module */
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
/* tslint:disable */
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
import * as BigIntJS from './BigInt.res.mjs';
|
|
7
7
|
|
|
8
|
-
import type {S_t as RescriptSchema_S_t} from 'rescript-schema/RescriptSchema.gen';
|
|
8
|
+
import type {S_t as RescriptSchema_S_t} from 'rescript-schema/RescriptSchema.gen.js';
|
|
9
9
|
|
|
10
10
|
export const schema: RescriptSchema_S_t<bigint> = BigIntJS.schema as any;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
-
'use strict';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
import * as Js_exn from "rescript/lib/es6/js_exn.js";
|
|
4
|
+
import * as Belt_Int from "rescript/lib/es6/belt_Int.js";
|
|
5
|
+
import * as Caml_option from "rescript/lib/es6/caml_option.js";
|
|
6
|
+
import * as S$RescriptSchema from "rescript-schema/src/S.res.mjs";
|
|
7
|
+
import * as Caml_js_exceptions from "rescript/lib/es6/caml_js_exceptions.js";
|
|
9
8
|
|
|
10
9
|
function fromString(str) {
|
|
11
10
|
try {
|
|
@@ -117,22 +116,24 @@ var schema = S$RescriptSchema.transform(S$RescriptSchema.setName(S$RescriptSchem
|
|
|
117
116
|
|
|
118
117
|
var nativeSchema = S$RescriptSchema.bigint;
|
|
119
118
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
119
|
+
export {
|
|
120
|
+
fromString ,
|
|
121
|
+
toInt ,
|
|
122
|
+
add ,
|
|
123
|
+
sub ,
|
|
124
|
+
mul ,
|
|
125
|
+
div ,
|
|
126
|
+
pow ,
|
|
127
|
+
mod ,
|
|
128
|
+
eq ,
|
|
129
|
+
neq ,
|
|
130
|
+
gt ,
|
|
131
|
+
gte ,
|
|
132
|
+
lt ,
|
|
133
|
+
lte ,
|
|
134
|
+
Bitwise ,
|
|
135
|
+
zero ,
|
|
136
|
+
schema ,
|
|
137
|
+
nativeSchema ,
|
|
138
|
+
}
|
|
138
139
|
/* zero Not a pure module */
|
|
@@ -316,8 +316,8 @@ let initialize = async (
|
|
|
316
316
|
~enums as _: array<Table.enumConfig<Table.enum>>,
|
|
317
317
|
) => {
|
|
318
318
|
try {
|
|
319
|
-
await client->exec({query: `
|
|
320
|
-
await client->exec({query: `CREATE DATABASE ${database}`})
|
|
319
|
+
await client->exec({query: `TRUNCATE DATABASE IF EXISTS ${database}`})
|
|
320
|
+
await client->exec({query: `CREATE DATABASE IF NOT EXISTS ${database}`})
|
|
321
321
|
await client->exec({query: `USE ${database}`})
|
|
322
322
|
|
|
323
323
|
await Promise.all(
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
-
'use strict';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
3
|
+
import * as Table from "../db/Table.res.mjs";
|
|
4
|
+
import * as Utils from "../Utils.res.mjs";
|
|
5
|
+
import * as Js_exn from "rescript/lib/es6/js_exn.js";
|
|
6
|
+
import * as Logging from "../Logging.res.mjs";
|
|
7
|
+
import * as Belt_Array from "rescript/lib/es6/belt_Array.js";
|
|
8
|
+
import * as Persistence from "../Persistence.res.mjs";
|
|
9
|
+
import * as EntityHistory from "../db/EntityHistory.res.mjs";
|
|
10
|
+
import * as InternalTable from "../db/InternalTable.res.mjs";
|
|
11
|
+
import * as S$RescriptSchema from "rescript-schema/src/S.res.mjs";
|
|
12
|
+
import * as Caml_js_exceptions from "rescript/lib/es6/caml_js_exceptions.js";
|
|
14
13
|
|
|
15
14
|
function getClickHouseFieldType(fieldType, isNullable, isArray) {
|
|
16
15
|
var baseType;
|
|
@@ -197,10 +196,10 @@ function makeCreateViewQuery(entityConfig, database) {
|
|
|
197
196
|
async function initialize(client, database, entities, param) {
|
|
198
197
|
try {
|
|
199
198
|
await client.exec({
|
|
200
|
-
query: "
|
|
199
|
+
query: "TRUNCATE DATABASE IF EXISTS " + database
|
|
201
200
|
});
|
|
202
201
|
await client.exec({
|
|
203
|
-
query: "CREATE DATABASE " + database
|
|
202
|
+
query: "CREATE DATABASE IF NOT EXISTS " + database
|
|
204
203
|
});
|
|
205
204
|
await client.exec({
|
|
206
205
|
query: "USE " + database
|
|
@@ -263,12 +262,14 @@ async function resume(client, database, checkpointId) {
|
|
|
263
262
|
}
|
|
264
263
|
}
|
|
265
264
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
265
|
+
export {
|
|
266
|
+
getClickHouseFieldType ,
|
|
267
|
+
setCheckpointsOrThrow ,
|
|
268
|
+
setUpdatesOrThrow ,
|
|
269
|
+
makeCreateHistoryTableQuery ,
|
|
270
|
+
makeCreateCheckpointsTableQuery ,
|
|
271
|
+
makeCreateViewQuery ,
|
|
272
|
+
initialize ,
|
|
273
|
+
resume ,
|
|
274
|
+
}
|
|
274
275
|
/* Table Not a pure module */
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
/* tslint:disable */
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
import * as EthersJS from './Ethers.res.mjs';
|
|
7
7
|
|
|
8
|
-
import type {t as Address_t} from '../../src/Address.gen';
|
|
8
|
+
import type {t as Address_t} from '../../src/Address.gen.js';
|
|
9
9
|
|
|
10
10
|
export const Addresses_mockAddresses: Address_t[] = EthersJS.Addresses.mockAddresses as any;
|
|
11
11
|
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
-
'use strict';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
import * as Ethers from "ethers";
|
|
4
|
+
import * as Address from "../Address.res.mjs";
|
|
5
|
+
import * as Belt_Array from "rescript/lib/es6/belt_Array.js";
|
|
6
|
+
import * as Caml_array from "rescript/lib/es6/caml_array.js";
|
|
7
|
+
import * as Caml_option from "rescript/lib/es6/caml_option.js";
|
|
9
8
|
|
|
10
9
|
function makeAbi(abi) {
|
|
11
10
|
return abi;
|
|
@@ -115,15 +114,17 @@ var JsonRpcProvider = {
|
|
|
115
114
|
|
|
116
115
|
var ethAddressSchema = Address.schema;
|
|
117
116
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
117
|
+
export {
|
|
118
|
+
makeAbi ,
|
|
119
|
+
getAddressFromStringUnsafe ,
|
|
120
|
+
ethAddressToString ,
|
|
121
|
+
ethAddressSchema ,
|
|
122
|
+
Constants ,
|
|
123
|
+
Addresses ,
|
|
124
|
+
Filter ,
|
|
125
|
+
CombinedFilter ,
|
|
126
|
+
logToMinimumParseableLogData ,
|
|
127
|
+
Network ,
|
|
128
|
+
JsonRpcProvider ,
|
|
129
|
+
}
|
|
129
130
|
/* mockAddresses Not a pure module */
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
-
'use strict';
|
|
3
2
|
|
|
4
3
|
|
|
5
4
|
function nanoToMilli(nano) {
|
|
@@ -57,15 +56,17 @@ var intFromNanos = toInt;
|
|
|
57
56
|
|
|
58
57
|
var intFromSeconds = toInt;
|
|
59
58
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
59
|
+
export {
|
|
60
|
+
makeTimer ,
|
|
61
|
+
timeSince ,
|
|
62
|
+
nanoToMilli ,
|
|
63
|
+
secToMilli ,
|
|
64
|
+
timeElapsedToNewRef ,
|
|
65
|
+
toMillis ,
|
|
66
|
+
intFromMillis ,
|
|
67
|
+
intFromNanos ,
|
|
68
|
+
intFromSeconds ,
|
|
69
|
+
floatFromMillis ,
|
|
70
|
+
millisBetween ,
|
|
71
|
+
}
|
|
71
72
|
/* No side effect */
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
-
'use strict';
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
import * as VendoredLodashFnsJs from "./vendored-lodash-fns.js";
|
|
5
4
|
|
|
6
5
|
function cloneDeep(prim) {
|
|
7
6
|
return VendoredLodashFnsJs.cloneDeep(prim);
|
|
8
7
|
}
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
export {
|
|
10
|
+
cloneDeep ,
|
|
11
|
+
}
|
|
11
12
|
/* ./vendored-lodash-fns.js Not a pure module */
|
package/src/bindings/NodeJs.res
CHANGED
|
@@ -56,6 +56,16 @@ module ChildProcess = {
|
|
|
56
56
|
external execWithOptions: (string, execOptions, callback) => unit = "exec"
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
module Url = {
|
|
60
|
+
type t
|
|
61
|
+
@module("url") external fileURLToPath: t => string = "fileURLToPath"
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
module ImportMeta = {
|
|
65
|
+
type t = {url: Url.t}
|
|
66
|
+
@val external importMeta: t = "import.meta"
|
|
67
|
+
}
|
|
68
|
+
|
|
59
69
|
module Path = {
|
|
60
70
|
type t
|
|
61
71
|
|
|
@@ -63,10 +73,12 @@ module Path = {
|
|
|
63
73
|
external resolve: array<string> => t = "resolve"
|
|
64
74
|
|
|
65
75
|
@module("path") external join: (t, string) => t = "join"
|
|
76
|
+
@module("path") external dirname: string => t = "dirname"
|
|
66
77
|
|
|
67
78
|
external toString: t => string = "%identity"
|
|
68
79
|
|
|
69
|
-
|
|
80
|
+
// ESM-compatible __dirname replacement
|
|
81
|
+
let __dirname = dirname(Url.fileURLToPath(ImportMeta.importMeta.url))
|
|
70
82
|
}
|
|
71
83
|
|
|
72
84
|
module Fs = {
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Url from "url";
|
|
4
|
+
import * as Path from "path";
|
|
5
|
+
import * as Util from "util";
|
|
6
|
+
|
|
7
|
+
function inspectObj(a) {
|
|
8
|
+
return Util.inspect(a, {
|
|
9
|
+
showHidden: false,
|
|
10
|
+
depth: null,
|
|
11
|
+
colors: true
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
var Util$1 = {
|
|
16
|
+
inspectObj: inspectObj
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
var Process = {};
|
|
20
|
+
|
|
21
|
+
var ChildProcess = {};
|
|
22
|
+
|
|
23
|
+
var Url$1 = {};
|
|
24
|
+
|
|
25
|
+
var ImportMeta = {};
|
|
26
|
+
|
|
27
|
+
var $$__dirname = Path.dirname(Url.fileURLToPath(import.meta.url));
|
|
28
|
+
|
|
29
|
+
var Path$1 = {
|
|
30
|
+
$$__dirname: $$__dirname
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
var Promises = {};
|
|
34
|
+
|
|
35
|
+
var Fs = {
|
|
36
|
+
Promises: Promises
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export {
|
|
40
|
+
Util$1 as Util,
|
|
41
|
+
Process ,
|
|
42
|
+
ChildProcess ,
|
|
43
|
+
Url$1 as Url,
|
|
44
|
+
ImportMeta ,
|
|
45
|
+
Path$1 as Path,
|
|
46
|
+
Fs ,
|
|
47
|
+
}
|
|
48
|
+
/* __dirname Not a pure module */
|
package/src/bindings/Pino.res
CHANGED
|
@@ -67,7 +67,7 @@ module Transport = {
|
|
|
67
67
|
external make: transportTarget => t = "transport"
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
@module external makeWithTransport: Transport.t => t = "pino"
|
|
70
|
+
@module("pino") external makeWithTransport: Transport.t => t = "pino"
|
|
71
71
|
|
|
72
72
|
type hooks = {logMethod: (array<string>, string, logLevel) => unit}
|
|
73
73
|
|
|
@@ -100,16 +100,16 @@ type options = {
|
|
|
100
100
|
messageKey?: string,
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
@module external make: options => t = "pino"
|
|
104
|
-
@module external makeWithOptionsAndTransport: (options, Transport.t) => t = "pino"
|
|
103
|
+
@module("pino") external make: options => t = "pino"
|
|
104
|
+
@module("pino") external makeWithOptionsAndTransport: (options, Transport.t) => t = "pino"
|
|
105
105
|
|
|
106
106
|
type childParams
|
|
107
107
|
let createChildParams: 'a => childParams = Utils.magic
|
|
108
108
|
@send external child: (t, childParams) => t = "child"
|
|
109
109
|
|
|
110
110
|
module ECS = {
|
|
111
|
-
@module
|
|
112
|
-
external make: 'a => options = "
|
|
111
|
+
@module("@elastic/ecs-pino-format")
|
|
112
|
+
external make: 'a => options = "default"
|
|
113
113
|
let make = make
|
|
114
114
|
}
|
|
115
115
|
|
|
@@ -123,7 +123,7 @@ module MultiStreamLogger = {
|
|
|
123
123
|
type multiStreamRes
|
|
124
124
|
@module("pino") external multistream: array<multiStream> => multiStreamRes = "multistream"
|
|
125
125
|
|
|
126
|
-
@module external makeWithMultiStream: (options, multiStreamRes) => t = "pino"
|
|
126
|
+
@module("pino") external makeWithMultiStream: (options, multiStreamRes) => t = "pino"
|
|
127
127
|
|
|
128
128
|
type destinationOpts = {
|
|
129
129
|
dest: string, //file path
|