@requestnetwork/data-access 0.28.1-next.1937 → 0.28.1-next.1939
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/combined-data-access.d.ts +0 -1
- package/dist/combined-data-access.d.ts.map +1 -1
- package/dist/combined-data-access.js.map +1 -1
- package/dist/data-read.d.ts +17 -0
- package/dist/data-read.d.ts.map +1 -0
- package/dist/data-read.js +158 -0
- package/dist/data-read.js.map +1 -0
- package/dist/data-write.d.ts +10 -0
- package/dist/data-write.d.ts.map +1 -0
- package/dist/data-write.js +48 -0
- package/dist/data-write.js.map +1 -0
- package/dist/in-memory-indexer.d.ts +18 -0
- package/dist/in-memory-indexer.d.ts.map +1 -0
- package/dist/in-memory-indexer.js +107 -0
- package/dist/in-memory-indexer.js.map +1 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -5
- package/dist/index.js.map +1 -1
- package/dist/mock-data-access.d.ts +13 -0
- package/dist/mock-data-access.d.ts.map +1 -0
- package/dist/mock-data-access.js +29 -0
- package/dist/mock-data-access.js.map +1 -0
- package/dist/pending-store.d.ts +16 -0
- package/dist/pending-store.d.ts.map +1 -0
- package/dist/pending-store.js +33 -0
- package/dist/pending-store.js.map +1 -0
- package/dist/types.d.ts +7 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +5 -9
- package/dist/data-access.d.ts +0 -148
- package/dist/data-access.d.ts.map +0 -1
- package/dist/data-access.js +0 -428
- package/dist/data-access.js.map +0 -1
- package/dist/ignored-location.d.ts +0 -58
- package/dist/ignored-location.d.ts.map +0 -1
- package/dist/ignored-location.js +0 -96
- package/dist/ignored-location.js.map +0 -1
- package/dist/interval-timer.d.ts +0 -41
- package/dist/interval-timer.d.ts.map +0 -1
- package/dist/interval-timer.js +0 -94
- package/dist/interval-timer.js.map +0 -1
- package/dist/transaction-index/index.d.ts +0 -5
- package/dist/transaction-index/index.d.ts.map +0 -1
- package/dist/transaction-index/index.js +0 -8
- package/dist/transaction-index/index.js.map +0 -1
- package/dist/transaction-index/location-by-topic.d.ts +0 -53
- package/dist/transaction-index/location-by-topic.d.ts.map +0 -1
- package/dist/transaction-index/location-by-topic.js +0 -103
- package/dist/transaction-index/location-by-topic.js.map +0 -1
- package/dist/transaction-index/timestamp-by-location.d.ts +0 -60
- package/dist/transaction-index/timestamp-by-location.d.ts.map +0 -1
- package/dist/transaction-index/timestamp-by-location.js +0 -108
- package/dist/transaction-index/timestamp-by-location.js.map +0 -1
- package/dist/transaction-index/transaction-index.d.ts +0 -74
- package/dist/transaction-index/transaction-index.d.ts.map +0 -1
- package/dist/transaction-index/transaction-index.js +0 -204
- package/dist/transaction-index/transaction-index.js.map +0 -1
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import * as Keyv from 'keyv';
|
|
2
|
-
/**
|
|
3
|
-
* Interface for reason from location
|
|
4
|
-
*/
|
|
5
|
-
export interface IReasonByIgnoredLocation {
|
|
6
|
-
[location: string]: string;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Class used to store the block's reason indexed by location of blocks
|
|
10
|
-
*/
|
|
11
|
-
export default class ReasonsByIgnoredLocationIndex {
|
|
12
|
-
/**
|
|
13
|
-
* reason by location
|
|
14
|
-
* maps dataId => reason
|
|
15
|
-
*/
|
|
16
|
-
private reasonsByIgnoredLocation;
|
|
17
|
-
private listIgnoredLocation;
|
|
18
|
-
/**
|
|
19
|
-
* reasonByLocationTransactionIndex constructor
|
|
20
|
-
* @param store a Keyv store to persist the index to
|
|
21
|
-
*/
|
|
22
|
-
constructor(store?: Keyv.Store<any>);
|
|
23
|
-
/**
|
|
24
|
-
* Function to push reason indexed by location
|
|
25
|
-
*
|
|
26
|
-
* @param dataId dataId of the block
|
|
27
|
-
* @param reason reason to be ignored
|
|
28
|
-
*/
|
|
29
|
-
pushReasonByLocation(dataId: string, reason: string): Promise<void>;
|
|
30
|
-
/**
|
|
31
|
-
* Function to update reason indexed by location
|
|
32
|
-
*
|
|
33
|
-
* @param dataId dataId of the block
|
|
34
|
-
* @param reason reason to be ignored
|
|
35
|
-
*/
|
|
36
|
-
removeReasonByLocation(dataId: string): Promise<void>;
|
|
37
|
-
/**
|
|
38
|
-
* Function to get reason from location
|
|
39
|
-
*
|
|
40
|
-
* @param dataId location to get the reason from
|
|
41
|
-
* @returns reason of the location, null if not found
|
|
42
|
-
*/
|
|
43
|
-
getReasonFromLocation(dataId: string): Promise<string | null>;
|
|
44
|
-
/**
|
|
45
|
-
* Get the list of data ids stored
|
|
46
|
-
*
|
|
47
|
-
* @returns the list of data ids stored
|
|
48
|
-
*/
|
|
49
|
-
getIgnoredLocations(): Promise<IReasonByIgnoredLocation>;
|
|
50
|
-
/**
|
|
51
|
-
* Update the list of data ids stored
|
|
52
|
-
*
|
|
53
|
-
* @param dataId data id to add to the list
|
|
54
|
-
* @returns
|
|
55
|
-
*/
|
|
56
|
-
private updateDataId;
|
|
57
|
-
}
|
|
58
|
-
//# sourceMappingURL=ignored-location.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ignored-location.d.ts","sourceRoot":"","sources":["../src/ignored-location.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;CAC5B;AACD;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,6BAA6B;IAChD;;;OAGG;IACH,OAAO,CAAC,wBAAwB,CAAe;IAE/C,OAAO,CAAC,mBAAmB,CAAiB;IAE5C;;;OAGG;gBACgB,KAAK,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;IAY1C;;;;;OAKG;IACU,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAOhF;;;;;OAKG;IACU,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIlE;;;;;OAKG;IACU,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAK1E;;;;OAIG;IACU,mBAAmB,IAAI,OAAO,CAAC,wBAAwB,CAAC;IAcrE;;;;;OAKG;YACW,YAAY;CAQ3B"}
|
package/dist/ignored-location.js
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const Keyv = require("keyv");
|
|
5
|
-
/**
|
|
6
|
-
* Class used to store the block's reason indexed by location of blocks
|
|
7
|
-
*/
|
|
8
|
-
class ReasonsByIgnoredLocationIndex {
|
|
9
|
-
/**
|
|
10
|
-
* reasonByLocationTransactionIndex constructor
|
|
11
|
-
* @param store a Keyv store to persist the index to
|
|
12
|
-
*/
|
|
13
|
-
constructor(store) {
|
|
14
|
-
this.reasonsByIgnoredLocation = new Keyv({
|
|
15
|
-
namespace: 'reasonsByIgnoredLocation',
|
|
16
|
-
store,
|
|
17
|
-
});
|
|
18
|
-
this.listIgnoredLocation = new Keyv({
|
|
19
|
-
namespace: 'listIgnoredLocation',
|
|
20
|
-
store,
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Function to push reason indexed by location
|
|
25
|
-
*
|
|
26
|
-
* @param dataId dataId of the block
|
|
27
|
-
* @param reason reason to be ignored
|
|
28
|
-
*/
|
|
29
|
-
pushReasonByLocation(dataId, reason) {
|
|
30
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
31
|
-
if (!(yield this.reasonsByIgnoredLocation.get(dataId))) {
|
|
32
|
-
yield this.reasonsByIgnoredLocation.set(dataId, reason);
|
|
33
|
-
yield this.updateDataId(dataId);
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Function to update reason indexed by location
|
|
39
|
-
*
|
|
40
|
-
* @param dataId dataId of the block
|
|
41
|
-
* @param reason reason to be ignored
|
|
42
|
-
*/
|
|
43
|
-
removeReasonByLocation(dataId) {
|
|
44
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
45
|
-
yield this.reasonsByIgnoredLocation.delete(dataId);
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Function to get reason from location
|
|
50
|
-
*
|
|
51
|
-
* @param dataId location to get the reason from
|
|
52
|
-
* @returns reason of the location, null if not found
|
|
53
|
-
*/
|
|
54
|
-
getReasonFromLocation(dataId) {
|
|
55
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
56
|
-
const reason = yield this.reasonsByIgnoredLocation.get(dataId);
|
|
57
|
-
return reason ? reason : null;
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Get the list of data ids stored
|
|
62
|
-
*
|
|
63
|
-
* @returns the list of data ids stored
|
|
64
|
-
*/
|
|
65
|
-
getIgnoredLocations() {
|
|
66
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
67
|
-
const listDataId = yield this.listIgnoredLocation.get('list');
|
|
68
|
-
if (!listDataId) {
|
|
69
|
-
return {};
|
|
70
|
-
}
|
|
71
|
-
const result = {};
|
|
72
|
-
for (const dataId of Array.from(listDataId)) {
|
|
73
|
-
result[dataId] = yield this.reasonsByIgnoredLocation.get(dataId);
|
|
74
|
-
}
|
|
75
|
-
return result;
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Update the list of data ids stored
|
|
80
|
-
*
|
|
81
|
-
* @param dataId data id to add to the list
|
|
82
|
-
* @returns
|
|
83
|
-
*/
|
|
84
|
-
updateDataId(dataId) {
|
|
85
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
86
|
-
let listDataIds = yield this.listIgnoredLocation.get('list');
|
|
87
|
-
if (!listDataIds) {
|
|
88
|
-
listDataIds = [];
|
|
89
|
-
}
|
|
90
|
-
listDataIds.push(dataId);
|
|
91
|
-
yield this.listIgnoredLocation.set('list', listDataIds);
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
exports.default = ReasonsByIgnoredLocationIndex;
|
|
96
|
-
//# sourceMappingURL=ignored-location.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ignored-location.js","sourceRoot":"","sources":["../src/ignored-location.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAQ7B;;GAEG;AACH,MAAqB,6BAA6B;IAShD;;;OAGG;IACH,YAAmB,KAAuB;QACxC,IAAI,CAAC,wBAAwB,GAAG,IAAI,IAAI,CAAS;YAC/C,SAAS,EAAE,0BAA0B;YACrC,KAAK;SACN,CAAC,CAAC;QAEH,IAAI,CAAC,mBAAmB,GAAG,IAAI,IAAI,CAAW;YAC5C,SAAS,EAAE,qBAAqB;YAChC,KAAK;SACN,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACU,oBAAoB,CAAC,MAAc,EAAE,MAAc;;YAC9D,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,wBAAwB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE;gBACtD,MAAM,IAAI,CAAC,wBAAwB,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;gBACxD,MAAM,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;aACjC;QACH,CAAC;KAAA;IAED;;;;;OAKG;IACU,sBAAsB,CAAC,MAAc;;YAChD,MAAM,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACrD,CAAC;KAAA;IAED;;;;;OAKG;IACU,qBAAqB,CAAC,MAAc;;YAC/C,MAAM,MAAM,GAAuB,MAAM,IAAI,CAAC,wBAAwB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YACnF,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;QAChC,CAAC;KAAA;IAED;;;;OAIG;IACU,mBAAmB;;YAC9B,MAAM,UAAU,GAAyB,MAAM,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YAEpF,IAAI,CAAC,UAAU,EAAE;gBACf,OAAO,EAAE,CAAC;aACX;YACD,MAAM,MAAM,GAAQ,EAAE,CAAC;YACvB,KAAK,MAAM,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE;gBAC3C,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,wBAAwB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;aAClE;YAED,OAAO,MAAM,CAAC;QAChB,CAAC;KAAA;IAED;;;;;OAKG;IACW,YAAY,CAAC,MAAc;;YACvC,IAAI,WAAW,GAAyB,MAAM,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YACnF,IAAI,CAAC,WAAW,EAAE;gBAChB,WAAW,GAAG,EAAE,CAAC;aAClB;YACD,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACzB,MAAM,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QAC1D,CAAC;KAAA;CACF;AA5FD,gDA4FC"}
|
package/dist/interval-timer.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { LogTypes } from '@requestnetwork/types';
|
|
2
|
-
/**
|
|
3
|
-
* Module to start and stop a periodical function
|
|
4
|
-
*/
|
|
5
|
-
export default class IntervalTimer {
|
|
6
|
-
intervalFunctionSuccessiveFailureCount: number;
|
|
7
|
-
private readonly intervalFunction;
|
|
8
|
-
private readonly intervalTime;
|
|
9
|
-
private readonly logger;
|
|
10
|
-
private readonly successiveFailureThreshold;
|
|
11
|
-
private timeoutObject;
|
|
12
|
-
private lastRecursion;
|
|
13
|
-
/**
|
|
14
|
-
* Constructor IntervalTimer
|
|
15
|
-
*
|
|
16
|
-
* @param intervalFunction function to call periodically when timer is started
|
|
17
|
-
* @param intervalTime Interval time between interval function call
|
|
18
|
-
* @param logger Logger instance
|
|
19
|
-
* @param successiveFailureThreshold Required number of successive failure from interval function before logging an error
|
|
20
|
-
*/
|
|
21
|
-
constructor(intervalFunction: () => Promise<void>, intervalTime: number, logger: LogTypes.ILogger, successiveFailureThreshold?: number);
|
|
22
|
-
/**
|
|
23
|
-
* Start the interval timer
|
|
24
|
-
*/
|
|
25
|
-
start(): void;
|
|
26
|
-
/**
|
|
27
|
-
* Stop the interval timer
|
|
28
|
-
*/
|
|
29
|
-
stop(): Promise<void>;
|
|
30
|
-
get isStarted(): boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Gets current configuration
|
|
33
|
-
*
|
|
34
|
-
* @return the current configuration attributes
|
|
35
|
-
*/
|
|
36
|
-
getConfig(): {
|
|
37
|
-
intervalTime: number;
|
|
38
|
-
successiveFailureThreshold: number;
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=interval-timer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interval-timer.d.ts","sourceRoot":"","sources":["../src/interval-timer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,aAAa;IAGzB,sCAAsC,SAAK;IAElD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAsB;IACvD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IACtC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAmB;IAC1C,OAAO,CAAC,QAAQ,CAAC,0BAA0B,CAAS;IACpD,OAAO,CAAC,aAAa,CAA+B;IACpD,OAAO,CAAC,aAAa,CAAoC;IAEzD;;;;;;;OAOG;gBAED,gBAAgB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EACrC,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,QAAQ,CAAC,OAAO,EACxB,0BAA0B,SAAI;IAQhC;;OAEG;IACI,KAAK,IAAI,IAAI;IA+CpB;;OAEG;IACU,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAUlC,IAAW,SAAS,IAAI,OAAO,CAE9B;IAED;;;;OAIG;IACI,SAAS,IAAI;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,0BAA0B,EAAE,MAAM,CAAA;KAAE;CAMjF"}
|
package/dist/interval-timer.js
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
/**
|
|
5
|
-
* Module to start and stop a periodical function
|
|
6
|
-
*/
|
|
7
|
-
class IntervalTimer {
|
|
8
|
-
/**
|
|
9
|
-
* Constructor IntervalTimer
|
|
10
|
-
*
|
|
11
|
-
* @param intervalFunction function to call periodically when timer is started
|
|
12
|
-
* @param intervalTime Interval time between interval function call
|
|
13
|
-
* @param logger Logger instance
|
|
14
|
-
* @param successiveFailureThreshold Required number of successive failure from interval function before logging an error
|
|
15
|
-
*/
|
|
16
|
-
constructor(intervalFunction, intervalTime, logger, successiveFailureThreshold = 1) {
|
|
17
|
-
// Count the successive number of failure from the interval function
|
|
18
|
-
// This value is used as we may not want to directly log an error if the interval function fails once
|
|
19
|
-
this.intervalFunctionSuccessiveFailureCount = 0;
|
|
20
|
-
this.timeoutObject = null;
|
|
21
|
-
this.lastRecursion = Promise.resolve();
|
|
22
|
-
this.intervalFunction = intervalFunction;
|
|
23
|
-
this.intervalTime = intervalTime;
|
|
24
|
-
this.logger = logger;
|
|
25
|
-
this.successiveFailureThreshold = successiveFailureThreshold;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Start the interval timer
|
|
29
|
-
*/
|
|
30
|
-
start() {
|
|
31
|
-
// Timer can't be restarted
|
|
32
|
-
if (this.timeoutObject) {
|
|
33
|
-
throw Error('IntervalTimer already started');
|
|
34
|
-
}
|
|
35
|
-
// Function to be called periodically
|
|
36
|
-
// This function calls and waits for the intervalFunction and sets a timeout
|
|
37
|
-
// to call itself recursively
|
|
38
|
-
const recursiveTimeoutFunction = () => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
39
|
-
try {
|
|
40
|
-
// We wait for the internal function to reset the timeout
|
|
41
|
-
yield this.intervalFunction();
|
|
42
|
-
// Reset intervalFunctionSuccessiveFailureCount
|
|
43
|
-
this.intervalFunctionSuccessiveFailureCount = 0;
|
|
44
|
-
}
|
|
45
|
-
catch (e) {
|
|
46
|
-
// An error in the interval function should not stop the interval timer
|
|
47
|
-
// An isolated error from the interval function is considered as a warning
|
|
48
|
-
this.logger.warn(`${this.intervalFunction.name || 'intervalFunction'} error: ${e}`);
|
|
49
|
-
this.intervalFunctionSuccessiveFailureCount++;
|
|
50
|
-
// If the interval function failed several times in a row, it can be caused by a bigger problem therefore we display an error
|
|
51
|
-
if (this.intervalFunctionSuccessiveFailureCount >= this.successiveFailureThreshold) {
|
|
52
|
-
this.logger.error(`${this.intervalFunction.name || 'intervalFunction'} failed ${this.intervalFunctionSuccessiveFailureCount} times in a row, last error: ${e}`);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
createRecursion();
|
|
56
|
-
});
|
|
57
|
-
const createRecursion = () => {
|
|
58
|
-
this.timeoutObject = setTimeout(() => {
|
|
59
|
-
this.lastRecursion = recursiveTimeoutFunction();
|
|
60
|
-
}, this.intervalTime);
|
|
61
|
-
};
|
|
62
|
-
// First call to the recursive timeout function
|
|
63
|
-
createRecursion();
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Stop the interval timer
|
|
67
|
-
*/
|
|
68
|
-
stop() {
|
|
69
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
70
|
-
if (!this.timeoutObject) {
|
|
71
|
-
return Promise.reject("Can't stop IntervalTimer if it has not been started");
|
|
72
|
-
}
|
|
73
|
-
clearTimeout(this.timeoutObject);
|
|
74
|
-
this.timeoutObject = null;
|
|
75
|
-
return this.lastRecursion;
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
get isStarted() {
|
|
79
|
-
return Boolean(this.timeoutObject);
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Gets current configuration
|
|
83
|
-
*
|
|
84
|
-
* @return the current configuration attributes
|
|
85
|
-
*/
|
|
86
|
-
getConfig() {
|
|
87
|
-
return {
|
|
88
|
-
intervalTime: this.intervalTime,
|
|
89
|
-
successiveFailureThreshold: this.successiveFailureThreshold,
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
exports.default = IntervalTimer;
|
|
94
|
-
//# sourceMappingURL=interval-timer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interval-timer.js","sourceRoot":"","sources":["../src/interval-timer.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACH,MAAqB,aAAa;IAYhC;;;;;;;OAOG;IACH,YACE,gBAAqC,EACrC,YAAoB,EACpB,MAAwB,EACxB,0BAA0B,GAAG,CAAC;QAvBhC,oEAAoE;QACpE,qGAAqG;QAC9F,2CAAsC,GAAG,CAAC,CAAC;QAM1C,kBAAa,GAA0B,IAAI,CAAC;QAC5C,kBAAa,GAAkB,OAAO,CAAC,OAAO,EAAE,CAAC;QAgBvD,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,0BAA0B,GAAG,0BAA0B,CAAC;IAC/D,CAAC;IAED;;OAEG;IACI,KAAK;QACV,2BAA2B;QAC3B,IAAI,IAAI,CAAC,aAAa,EAAE;YACtB,MAAM,KAAK,CAAC,+BAA+B,CAAC,CAAC;SAC9C;QAED,qCAAqC;QACrC,4EAA4E;QAC5E,6BAA6B;QAC7B,MAAM,wBAAwB,GAAG,GAAwB,EAAE;YACzD,IAAI;gBACF,yDAAyD;gBACzD,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC;gBAE9B,+CAA+C;gBAC/C,IAAI,CAAC,sCAAsC,GAAG,CAAC,CAAC;aACjD;YAAC,OAAO,CAAC,EAAE;gBACV,uEAAuE;gBAEvE,0EAA0E;gBAC1E,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,IAAI,kBAAkB,WAAW,CAAC,EAAE,CAAC,CAAC;gBAEpF,IAAI,CAAC,sCAAsC,EAAE,CAAC;gBAE9C,6HAA6H;gBAC7H,IAAI,IAAI,CAAC,sCAAsC,IAAI,IAAI,CAAC,0BAA0B,EAAE;oBAClF,IAAI,CAAC,MAAM,CAAC,KAAK,CACf,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,IAAI,kBAAkB,WACjD,IAAI,CAAC,sCACP,gCAAgC,CAAC,EAAE,CACpC,CAAC;iBACH;aACF;YAED,eAAe,EAAE,CAAC;QACpB,CAAC,CAAA,CAAC;QAEF,MAAM,eAAe,GAAG,GAAG,EAAE;YAC3B,IAAI,CAAC,aAAa,GAAG,UAAU,CAAC,GAAG,EAAE;gBACnC,IAAI,CAAC,aAAa,GAAG,wBAAwB,EAAE,CAAC;YAClD,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QACxB,CAAC,CAAC;QAEF,+CAA+C;QAC/C,eAAe,EAAE,CAAC;IACpB,CAAC;IAED;;OAEG;IACU,IAAI;;YACf,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE;gBACvB,OAAO,OAAO,CAAC,MAAM,CAAC,qDAAqD,CAAC,CAAC;aAC9E;YAED,YAAY,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YACjC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;YAC1B,OAAO,IAAI,CAAC,aAAa,CAAC;QAC5B,CAAC;KAAA;IAED,IAAW,SAAS;QAClB,OAAO,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACrC,CAAC;IAED;;;;OAIG;IACI,SAAS;QACd,OAAO;YACL,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,0BAA0B,EAAE,IAAI,CAAC,0BAA0B;SAC5D,CAAC;IACJ,CAAC;CACF;AA9GD,gCA8GC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/transaction-index/index.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,qBAAqB,CAAC;AAEnD,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AAExC,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const transaction_index_1 = require("./transaction-index");
|
|
5
|
-
tslib_1.__exportStar(require("./location-by-topic"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./timestamp-by-location"), exports);
|
|
7
|
-
exports.default = transaction_index_1.default;
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/transaction-index/index.ts"],"names":[],"mappings":";;;AAAA,2DAAmD;AAEnD,8DAAoC;AACpC,kEAAwC;AAExC,kBAAe,2BAAgB,CAAC"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { DataAccessTypes } from '@requestnetwork/types';
|
|
2
|
-
import * as Keyv from 'keyv';
|
|
3
|
-
/**
|
|
4
|
-
* Helps store and retrieve channelIds by topic, and transaction location per channelId
|
|
5
|
-
*/
|
|
6
|
-
export default class LocationByTopicTransactionIndex {
|
|
7
|
-
/**
|
|
8
|
-
* Storage location by channel id
|
|
9
|
-
* maps channelId => [storageLocation]
|
|
10
|
-
* This attribute is public for mocking purpose
|
|
11
|
-
*/
|
|
12
|
-
storageLocationByChannelId: Keyv<Set<string>>;
|
|
13
|
-
/**
|
|
14
|
-
* Channel Ids by topic
|
|
15
|
-
* maps topic => [channelId]
|
|
16
|
-
* This attribute is public for mocking purpose
|
|
17
|
-
*/
|
|
18
|
-
channelIdByTopics: Keyv<Set<string>>;
|
|
19
|
-
/**
|
|
20
|
-
* Constructor for LocationByTopicIndex
|
|
21
|
-
* @param store a Keyv store to persist the index to.
|
|
22
|
-
*/
|
|
23
|
-
constructor(store?: Keyv.Store<any>);
|
|
24
|
-
/**
|
|
25
|
-
* Function to push location indexed with block topics
|
|
26
|
-
*
|
|
27
|
-
* @param storageLocation storage location to index
|
|
28
|
-
* @param blockHeader header of the block
|
|
29
|
-
*/
|
|
30
|
-
pushStorageLocationIndexedWithBlockTopics(storageLocation: string, blockHeader: DataAccessTypes.IBlockHeader): Promise<void>;
|
|
31
|
-
/**
|
|
32
|
-
* Function to get the channel ids from a topic
|
|
33
|
-
*
|
|
34
|
-
* @param topic topic to retrieve the dataId
|
|
35
|
-
* @returns list of the channel ids connected to the topic
|
|
36
|
-
*/
|
|
37
|
-
getChannelIdsFromTopic(topic: string): Promise<string[]>;
|
|
38
|
-
/**
|
|
39
|
-
* Function to get the channel ids from multiple topics
|
|
40
|
-
*
|
|
41
|
-
* @param topics topics to retrieve the dataIds
|
|
42
|
-
* @returns list of the channel ids linked to the topics
|
|
43
|
-
*/
|
|
44
|
-
getChannelIdsFromMultipleTopics(topics: string[]): Promise<string[]>;
|
|
45
|
-
/**
|
|
46
|
-
* Function to get storage locations from a channel id
|
|
47
|
-
*
|
|
48
|
-
* @param channelId channel id to retrieve the storage location
|
|
49
|
-
* @returns list of the location connected to the channel id
|
|
50
|
-
*/
|
|
51
|
-
getStorageLocationsFromChannelId(channelId: string): Promise<string[]>;
|
|
52
|
-
}
|
|
53
|
-
//# sourceMappingURL=location-by-topic.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"location-by-topic.d.ts","sourceRoot":"","sources":["../../src/transaction-index/location-by-topic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAkB7B;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,+BAA+B;IAClD;;;;OAIG;IACI,0BAA0B,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;IAErD;;;;OAIG;IACI,iBAAiB,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;IAE5C;;;OAGG;gBACS,KAAK,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;IAenC;;;;;OAKG;IACU,yCAAyC,CACpD,eAAe,EAAE,MAAM,EACvB,WAAW,EAAE,eAAe,CAAC,YAAY,GACxC,OAAO,CAAC,IAAI,CAAC;IAkBhB;;;;;OAKG;IACU,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAIrE;;;;;OAKG;IACU,+BAA+B,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IASjF;;;;;OAKG;IACU,gCAAgC,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;CAGpF"}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const Keyv = require("keyv");
|
|
5
|
-
const utils_1 = require("@requestnetwork/utils");
|
|
6
|
-
// Serialize function used for keyv to serialize a Set data structure into a string
|
|
7
|
-
// There is no way to directly stringify a Set, we need to convert it to an array before
|
|
8
|
-
// Typescript error from keyv: deserialized's type should be { value: Set<string>, expires: number }
|
|
9
|
-
// but it's inferred as a Set<string>
|
|
10
|
-
const serializeSet = (deserialized) => JSON.stringify(Array.from(deserialized.value));
|
|
11
|
-
// Deserialize function used for keyv to deserialize a string into a Set data structure
|
|
12
|
-
// Typescript error from keyv: function return's type should be { value: Set<string>, expires: number }
|
|
13
|
-
// but it's inferred as a Set<string>
|
|
14
|
-
const deserializeSet = (serialized) => {
|
|
15
|
-
// We use JSON.parse to convert the string into an array before converting it to a Set
|
|
16
|
-
const set = new Set(JSON.parse(serialized));
|
|
17
|
-
return { value: set };
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* Helps store and retrieve channelIds by topic, and transaction location per channelId
|
|
21
|
-
*/
|
|
22
|
-
class LocationByTopicTransactionIndex {
|
|
23
|
-
/**
|
|
24
|
-
* Constructor for LocationByTopicIndex
|
|
25
|
-
* @param store a Keyv store to persist the index to.
|
|
26
|
-
*/
|
|
27
|
-
constructor(store) {
|
|
28
|
-
this.storageLocationByChannelId = new Keyv({
|
|
29
|
-
deserialize: deserializeSet,
|
|
30
|
-
namespace: 'storageLocationByChannelId',
|
|
31
|
-
serialize: serializeSet,
|
|
32
|
-
store,
|
|
33
|
-
});
|
|
34
|
-
this.channelIdByTopics = new Keyv({
|
|
35
|
-
deserialize: deserializeSet,
|
|
36
|
-
namespace: 'channelIdByTopics',
|
|
37
|
-
serialize: serializeSet,
|
|
38
|
-
store,
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Function to push location indexed with block topics
|
|
43
|
-
*
|
|
44
|
-
* @param storageLocation storage location to index
|
|
45
|
-
* @param blockHeader header of the block
|
|
46
|
-
*/
|
|
47
|
-
pushStorageLocationIndexedWithBlockTopics(storageLocation, blockHeader) {
|
|
48
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
49
|
-
// index the new block with the channel ids
|
|
50
|
-
for (const id of Object.keys(blockHeader.channelIds)) {
|
|
51
|
-
const existingLocationIds = (yield this.storageLocationByChannelId.get(id)) || new Set([]);
|
|
52
|
-
yield this.storageLocationByChannelId.set(id, existingLocationIds.add(storageLocation));
|
|
53
|
-
}
|
|
54
|
-
// index channel ids by the topics
|
|
55
|
-
for (const id of Object.keys(blockHeader.topics)) {
|
|
56
|
-
for (const topic of blockHeader.topics[id]) {
|
|
57
|
-
const existingChannelIds = (yield this.channelIdByTopics.get(topic)) || new Set([]);
|
|
58
|
-
yield this.channelIdByTopics.set(topic, existingChannelIds.add(id));
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Function to get the channel ids from a topic
|
|
65
|
-
*
|
|
66
|
-
* @param topic topic to retrieve the dataId
|
|
67
|
-
* @returns list of the channel ids connected to the topic
|
|
68
|
-
*/
|
|
69
|
-
getChannelIdsFromTopic(topic) {
|
|
70
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
71
|
-
return Array.from((yield this.channelIdByTopics.get(topic)) || []);
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Function to get the channel ids from multiple topics
|
|
76
|
-
*
|
|
77
|
-
* @param topics topics to retrieve the dataIds
|
|
78
|
-
* @returns list of the channel ids linked to the topics
|
|
79
|
-
*/
|
|
80
|
-
getChannelIdsFromMultipleTopics(topics) {
|
|
81
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
82
|
-
const channelIdsPromises = topics.map((topic) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
83
|
-
return Array.from((yield this.channelIdByTopics.get(topic)) || []);
|
|
84
|
-
}));
|
|
85
|
-
const channelIds = yield Promise.all(channelIdsPromises);
|
|
86
|
-
// flatten the array of array and remove the duplicates
|
|
87
|
-
return (0, utils_1.unique)((0, utils_1.flatten2DimensionsArray)(channelIds)).uniqueItems;
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Function to get storage locations from a channel id
|
|
92
|
-
*
|
|
93
|
-
* @param channelId channel id to retrieve the storage location
|
|
94
|
-
* @returns list of the location connected to the channel id
|
|
95
|
-
*/
|
|
96
|
-
getStorageLocationsFromChannelId(channelId) {
|
|
97
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
98
|
-
return Array.from((yield this.storageLocationByChannelId.get(channelId)) || []);
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
exports.default = LocationByTopicTransactionIndex;
|
|
103
|
-
//# sourceMappingURL=location-by-topic.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"location-by-topic.js","sourceRoot":"","sources":["../../src/transaction-index/location-by-topic.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { DataAccessTypes } from '@requestnetwork/types';
|
|
2
|
-
import * as Keyv from 'keyv';
|
|
3
|
-
/**
|
|
4
|
-
* Class used to store the block's timestamp indexed by location
|
|
5
|
-
*/
|
|
6
|
-
export default class TimestampByLocationTransactionIndex {
|
|
7
|
-
/**
|
|
8
|
-
* timestamp by location
|
|
9
|
-
* maps dataId => timestamp
|
|
10
|
-
*/
|
|
11
|
-
private timestampByLocation;
|
|
12
|
-
/**
|
|
13
|
-
* TimestampByLocationTransactionIndex constructor
|
|
14
|
-
* @param store a Keyv store to persist the index to
|
|
15
|
-
*/
|
|
16
|
-
constructor(store?: Keyv.Store<any>);
|
|
17
|
-
/**
|
|
18
|
-
* Function to push timestamp indexed by location
|
|
19
|
-
*
|
|
20
|
-
* @param dataId dataId of the block
|
|
21
|
-
* @param timestamp timestamp of the block
|
|
22
|
-
*/
|
|
23
|
-
pushTimestampByLocation(dataId: string, timestamp: number): Promise<void>;
|
|
24
|
-
/**
|
|
25
|
-
* Removes timestamp indexed by location
|
|
26
|
-
*
|
|
27
|
-
* @param dataId dataId of the block
|
|
28
|
-
*/
|
|
29
|
-
removeIndexedDataId(dataId: string): Promise<void>;
|
|
30
|
-
/**
|
|
31
|
-
* Function to update timestamp indexed by location
|
|
32
|
-
*
|
|
33
|
-
* @param dataId dataId of the block
|
|
34
|
-
* @param timestamp timestamp of the block
|
|
35
|
-
*/
|
|
36
|
-
updateTimestampByLocation(dataId: string, timestamp: number): Promise<void>;
|
|
37
|
-
/**
|
|
38
|
-
* Function to get timestamp from location
|
|
39
|
-
*
|
|
40
|
-
* @param dataId location to get the timestamp from
|
|
41
|
-
* @returns timestamp of the location, null if not found
|
|
42
|
-
*/
|
|
43
|
-
getTimestampFromLocation(dataId: string): Promise<number | null>;
|
|
44
|
-
/**
|
|
45
|
-
* Function to get timestamp from location
|
|
46
|
-
*
|
|
47
|
-
* @param dataId location to get the timestamp from
|
|
48
|
-
* @returns timestamp of the location, null if not found
|
|
49
|
-
*/
|
|
50
|
-
isDataInBoundaries(dataId: string, boundaries?: DataAccessTypes.ITimestampBoundaries): Promise<boolean>;
|
|
51
|
-
/**
|
|
52
|
-
* the timestamp of the latest transaction
|
|
53
|
-
*/
|
|
54
|
-
getLastTransactionTimestamp(): Promise<number | null>;
|
|
55
|
-
/**
|
|
56
|
-
* the timestamp of the latest transaction
|
|
57
|
-
*/
|
|
58
|
-
private setLastTransactionTimestamp;
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=timestamp-by-location.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"timestamp-by-location.d.ts","sourceRoot":"","sources":["../../src/transaction-index/timestamp-by-location.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,mCAAmC;IACtD;;;OAGG;IACH,OAAO,CAAC,mBAAmB,CAAe;IAE1C;;;OAGG;gBACgB,KAAK,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;IAO1C;;;;;OAKG;IACU,uBAAuB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAUtF;;;;OAIG;IACU,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI/D;;;;;OAKG;IACU,yBAAyB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IASxF;;;;;OAKG;IACU,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAK7E;;;;;OAKG;IACU,kBAAkB,CAC7B,MAAM,EAAE,MAAM,EACd,UAAU,CAAC,EAAE,eAAe,CAAC,oBAAoB,GAChD,OAAO,CAAC,OAAO,CAAC;IAanB;;OAEG;IACU,2BAA2B,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAIlE;;OAEG;YACW,2BAA2B;CAG1C"}
|