@fncts/query 0.0.26 → 0.0.27
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/LICENSE +26 -0
- package/_cjs/Cache/api.cjs +53 -47
- package/_cjs/Cache/api.cjs.map +1 -1
- package/_cjs/Cache/definition.cjs +8 -10
- package/_cjs/Cache/definition.cjs.map +1 -1
- package/_cjs/Cache.cjs +7 -28
- package/_cjs/CompletedRequestMap.cjs +40 -38
- package/_cjs/CompletedRequestMap.cjs.map +1 -1
- package/_cjs/DataSource/api.cjs +76 -72
- package/_cjs/DataSource/api.cjs.map +1 -1
- package/_cjs/DataSource/definition.cjs +69 -63
- package/_cjs/DataSource/definition.cjs.map +1 -1
- package/_cjs/DataSource.cjs +14 -28
- package/_cjs/DataSourceAspect.cjs +9 -10
- package/_cjs/DataSourceAspect.cjs.map +1 -1
- package/_cjs/Described.cjs +27 -29
- package/_cjs/Described.cjs.map +1 -1
- package/_cjs/Query/api/bimap.cjs +15 -14
- package/_cjs/Query/api/bimap.cjs.map +1 -1
- package/_cjs/Query/api/catchAllCause.cjs +23 -21
- package/_cjs/Query/api/catchAllCause.cjs.map +1 -1
- package/_cjs/Query/api/collectAll.cjs +13 -12
- package/_cjs/Query/api/collectAll.cjs.map +1 -1
- package/_cjs/Query/api/collectAllBatched.cjs +13 -12
- package/_cjs/Query/api/collectAllBatched.cjs.map +1 -1
- package/_cjs/Query/api/collectAllConcurrent.cjs +13 -12
- package/_cjs/Query/api/collectAllConcurrent.cjs.map +1 -1
- package/_cjs/Query/api/defer.cjs +13 -12
- package/_cjs/Query/api/defer.cjs.map +1 -1
- package/_cjs/Query/api/ensuring.cjs +17 -15
- package/_cjs/Query/api/ensuring.cjs.map +1 -1
- package/_cjs/Query/api/environment.cjs +76 -64
- package/_cjs/Query/api/environment.cjs.map +1 -1
- package/_cjs/Query/api/flatMap.cjs +30 -26
- package/_cjs/Query/api/flatMap.cjs.map +1 -1
- package/_cjs/Query/api/foreach.cjs +22 -21
- package/_cjs/Query/api/foreach.cjs.map +1 -1
- package/_cjs/Query/api/foreachBatched.cjs +22 -21
- package/_cjs/Query/api/foreachBatched.cjs.map +1 -1
- package/_cjs/Query/api/foreachConcurrent.cjs +17 -14
- package/_cjs/Query/api/foreachConcurrent.cjs.map +1 -1
- package/_cjs/Query/api/fromRequest.cjs +42 -33
- package/_cjs/Query/api/fromRequest.cjs.map +1 -1
- package/_cjs/Query/api/map.cjs +17 -15
- package/_cjs/Query/api/map.cjs.map +1 -1
- package/_cjs/Query/api/mapDataSources.cjs +17 -15
- package/_cjs/Query/api/mapDataSources.cjs.map +1 -1
- package/_cjs/Query/api/mapError.cjs +15 -14
- package/_cjs/Query/api/mapError.cjs.map +1 -1
- package/_cjs/Query/api/mapErrorCause.cjs +15 -14
- package/_cjs/Query/api/mapErrorCause.cjs.map +1 -1
- package/_cjs/Query/api/mapIO.cjs +15 -14
- package/_cjs/Query/api/mapIO.cjs.map +1 -1
- package/_cjs/Query/api/match.cjs +15 -14
- package/_cjs/Query/api/match.cjs.map +1 -1
- package/_cjs/Query/api/matchCauseQuery.cjs +23 -20
- package/_cjs/Query/api/matchCauseQuery.cjs.map +1 -1
- package/_cjs/Query/api/matchQuery.cjs +19 -16
- package/_cjs/Query/api/matchQuery.cjs.map +1 -1
- package/_cjs/Query/api/orHalt.cjs +22 -20
- package/_cjs/Query/api/orHalt.cjs.map +1 -1
- package/_cjs/Query/api/race.cjs +46 -36
- package/_cjs/Query/api/race.cjs.map +1 -1
- package/_cjs/Query/api/run.cjs +43 -35
- package/_cjs/Query/api/run.cjs.map +1 -1
- package/_cjs/Query/api/timeout.cjs +70 -56
- package/_cjs/Query/api/timeout.cjs.map +1 -1
- package/_cjs/Query/api/zipWith.cjs +37 -33
- package/_cjs/Query/api/zipWith.cjs.map +1 -1
- package/_cjs/Query/api/zipWithBatched.cjs +39 -34
- package/_cjs/Query/api/zipWithBatched.cjs.map +1 -1
- package/_cjs/Query/api/zipWithConcurrent.cjs +39 -34
- package/_cjs/Query/api/zipWithConcurrent.cjs.map +1 -1
- package/_cjs/Query/api.cjs +68 -60
- package/_cjs/Query/api.cjs.map +1 -1
- package/_cjs/Query/definition.cjs +16 -17
- package/_cjs/Query/definition.cjs.map +1 -1
- package/_cjs/Query.cjs +88 -336
- package/_cjs/QueryFailure.cjs +13 -14
- package/_cjs/QueryFailure.cjs.map +1 -1
- package/_cjs/Request.cjs +48 -41
- package/_cjs/Request.cjs.map +1 -1
- package/_cjs/chunk.cjs +28 -0
- package/_cjs/global.cjs +0 -2
- package/_cjs/index.cjs +0 -2
- package/_cjs/internal/BlockedRequest.cjs +23 -24
- package/_cjs/internal/BlockedRequest.cjs.map +1 -1
- package/_cjs/internal/BlockedRequests.cjs +318 -333
- package/_cjs/internal/BlockedRequests.cjs.map +1 -1
- package/_cjs/internal/Continue.cjs +244 -231
- package/_cjs/internal/Continue.cjs.map +1 -1
- package/_cjs/internal/Parallel.cjs +59 -55
- package/_cjs/internal/Parallel.cjs.map +1 -1
- package/_cjs/internal/Result.cjs +199 -185
- package/_cjs/internal/Result.cjs.map +1 -1
- package/_cjs/internal/Sequential.cjs +44 -41
- package/_cjs/internal/Sequential.cjs.map +1 -1
- package/_mjs/Cache/api.mjs +38 -34
- package/_mjs/Cache/api.mjs.map +1 -1
- package/_mjs/Cache/definition.mjs +8 -4
- package/_mjs/Cache/definition.mjs.map +1 -1
- package/_mjs/Cache.mjs +3 -4
- package/_mjs/CompletedRequestMap.mjs +34 -30
- package/_mjs/CompletedRequestMap.mjs.map +1 -1
- package/_mjs/DataSource/api.mjs +67 -63
- package/_mjs/DataSource/api.mjs.map +1 -1
- package/_mjs/DataSource/definition.mjs +54 -52
- package/_mjs/DataSource/definition.mjs.map +1 -1
- package/_mjs/DataSource.mjs +3 -4
- package/_mjs/DataSourceAspect.mjs +8 -4
- package/_mjs/DataSourceAspect.mjs.map +1 -1
- package/_mjs/Described.mjs +26 -22
- package/_mjs/Described.mjs.map +1 -1
- package/_mjs/Query/api/bimap.mjs +10 -6
- package/_mjs/Query/api/bimap.mjs.map +1 -1
- package/_mjs/Query/api/catchAllCause.mjs +17 -13
- package/_mjs/Query/api/catchAllCause.mjs.map +1 -1
- package/_mjs/Query/api/collectAll.mjs +8 -4
- package/_mjs/Query/api/collectAll.mjs.map +1 -1
- package/_mjs/Query/api/collectAllBatched.mjs +8 -4
- package/_mjs/Query/api/collectAllBatched.mjs.map +1 -1
- package/_mjs/Query/api/collectAllConcurrent.mjs +8 -4
- package/_mjs/Query/api/collectAllConcurrent.mjs.map +1 -1
- package/_mjs/Query/api/defer.mjs +9 -5
- package/_mjs/Query/api/defer.mjs.map +1 -1
- package/_mjs/Query/api/ensuring.mjs +10 -6
- package/_mjs/Query/api/ensuring.mjs.map +1 -1
- package/_mjs/Query/api/environment.mjs +53 -49
- package/_mjs/Query/api/environment.mjs.map +1 -1
- package/_mjs/Query/api/flatMap.mjs +19 -15
- package/_mjs/Query/api/flatMap.mjs.map +1 -1
- package/_mjs/Query/api/foreach.mjs +14 -12
- package/_mjs/Query/api/foreach.mjs.map +1 -1
- package/_mjs/Query/api/foreachBatched.mjs +15 -13
- package/_mjs/Query/api/foreachBatched.mjs.map +1 -1
- package/_mjs/Query/api/foreachConcurrent.mjs +9 -5
- package/_mjs/Query/api/foreachConcurrent.mjs.map +1 -1
- package/_mjs/Query/api/fromRequest.mjs +19 -18
- package/_mjs/Query/api/fromRequest.mjs.map +1 -1
- package/_mjs/Query/api/map.mjs +11 -7
- package/_mjs/Query/api/map.mjs.map +1 -1
- package/_mjs/Query/api/mapDataSources.mjs +11 -7
- package/_mjs/Query/api/mapDataSources.mjs.map +1 -1
- package/_mjs/Query/api/mapError.mjs +10 -6
- package/_mjs/Query/api/mapError.mjs.map +1 -1
- package/_mjs/Query/api/mapErrorCause.mjs +10 -6
- package/_mjs/Query/api/mapErrorCause.mjs.map +1 -1
- package/_mjs/Query/api/mapIO.mjs +11 -7
- package/_mjs/Query/api/mapIO.mjs.map +1 -1
- package/_mjs/Query/api/match.mjs +11 -7
- package/_mjs/Query/api/match.mjs.map +1 -1
- package/_mjs/Query/api/matchCauseQuery.mjs +16 -12
- package/_mjs/Query/api/matchCauseQuery.mjs.map +1 -1
- package/_mjs/Query/api/matchQuery.mjs +12 -8
- package/_mjs/Query/api/matchQuery.mjs.map +1 -1
- package/_mjs/Query/api/orHalt.mjs +14 -10
- package/_mjs/Query/api/orHalt.mjs.map +1 -1
- package/_mjs/Query/api/race.mjs +28 -24
- package/_mjs/Query/api/race.mjs.map +1 -1
- package/_mjs/Query/api/run.mjs +29 -25
- package/_mjs/Query/api/run.mjs.map +1 -1
- package/_mjs/Query/api/timeout.mjs +44 -40
- package/_mjs/Query/api/timeout.mjs.map +1 -1
- package/_mjs/Query/api/zipWith.mjs +26 -22
- package/_mjs/Query/api/zipWith.mjs.map +1 -1
- package/_mjs/Query/api/zipWithBatched.mjs +29 -25
- package/_mjs/Query/api/zipWithBatched.mjs.map +1 -1
- package/_mjs/Query/api/zipWithConcurrent.mjs +28 -24
- package/_mjs/Query/api/zipWithConcurrent.mjs.map +1 -1
- package/_mjs/Query/api.mjs +50 -46
- package/_mjs/Query/api.mjs.map +1 -1
- package/_mjs/Query/definition.mjs +15 -11
- package/_mjs/Query/definition.mjs.map +1 -1
- package/_mjs/Query.mjs +31 -34
- package/_mjs/QueryFailure.mjs +11 -7
- package/_mjs/QueryFailure.mjs.map +1 -1
- package/_mjs/Request.mjs +28 -25
- package/_mjs/Request.mjs.map +1 -1
- package/_mjs/global.mjs +0 -2
- package/_mjs/index.mjs +0 -2
- package/_mjs/internal/BlockedRequest.mjs +21 -17
- package/_mjs/internal/BlockedRequest.mjs.map +1 -1
- package/_mjs/internal/BlockedRequests.mjs +277 -308
- package/_mjs/internal/BlockedRequests.mjs.map +1 -1
- package/_mjs/internal/Continue.mjs +235 -239
- package/_mjs/internal/Continue.mjs.map +1 -1
- package/_mjs/internal/Parallel.mjs +48 -44
- package/_mjs/internal/Parallel.mjs.map +1 -1
- package/_mjs/internal/Result.mjs +177 -170
- package/_mjs/internal/Result.mjs.map +1 -1
- package/_mjs/internal/Sequential.mjs +35 -31
- package/_mjs/internal/Sequential.mjs.map +1 -1
- package/package.json +8 -4
- package/_cjs/Cache.cjs.map +0 -1
- package/_cjs/DataSource.cjs.map +0 -1
- package/_cjs/Query.cjs.map +0 -1
- package/_cjs/global.cjs.map +0 -1
- package/_cjs/index.cjs.map +0 -1
- package/_mjs/Cache.mjs.map +0 -1
- package/_mjs/DataSource.mjs.map +0 -1
- package/_mjs/Query.mjs.map +0 -1
- package/_mjs/global.mjs.map +0 -1
- package/_mjs/index.mjs.map +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Copyright (c) 2022, Peter Krol
|
|
2
|
+
|
|
3
|
+
Redistribution and use in source and binary forms, with or without
|
|
4
|
+
modification, are permitted provided that the following conditions are met:
|
|
5
|
+
|
|
6
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
7
|
+
list of conditions and the following disclaimer.
|
|
8
|
+
|
|
9
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
10
|
+
this list of conditions and the following disclaimer in the documentation
|
|
11
|
+
and/or other materials provided with the distribution.
|
|
12
|
+
|
|
13
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
14
|
+
contributors may be used to endorse or promote products derived from
|
|
15
|
+
this software without specific prior written permission.
|
|
16
|
+
|
|
17
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
18
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
19
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
20
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
21
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
22
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
23
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
24
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
25
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
26
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/_cjs/Cache/api.cjs
CHANGED
|
@@ -1,55 +1,61 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_chunk = require("../chunk.cjs");
|
|
3
|
+
let _fncts_io_IO_api = require("@fncts/io/IO/api");
|
|
4
|
+
_fncts_io_IO_api = require_chunk.__toESM(_fncts_io_IO_api, 1);
|
|
5
|
+
let _fncts_base_data_Maybe_destructors = require("@fncts/base/data/Maybe/destructors");
|
|
6
|
+
_fncts_base_data_Maybe_destructors = require_chunk.__toESM(_fncts_base_data_Maybe_destructors, 1);
|
|
7
|
+
let _fncts_io_Ref_api_get = require("@fncts/io/Ref/api/get");
|
|
8
|
+
_fncts_io_Ref_api_get = require_chunk.__toESM(_fncts_io_Ref_api_get, 1);
|
|
9
|
+
let _fncts_base_data_Maybe_constructors = require("@fncts/base/data/Maybe/constructors");
|
|
10
|
+
_fncts_base_data_Maybe_constructors = require_chunk.__toESM(_fncts_base_data_Maybe_constructors, 1);
|
|
11
|
+
let _fncts_io_Ref_constructors = require("@fncts/io/Ref/constructors");
|
|
12
|
+
_fncts_io_Ref_constructors = require_chunk.__toESM(_fncts_io_Ref_constructors, 1);
|
|
13
|
+
let _fncts_base_data_Either_constructors = require("@fncts/base/data/Either/constructors");
|
|
14
|
+
_fncts_base_data_Either_constructors = require_chunk.__toESM(_fncts_base_data_Either_constructors, 1);
|
|
15
|
+
let _fncts_base_collection_immutable_HashMap_api = require("@fncts/base/collection/immutable/HashMap/api");
|
|
16
|
+
_fncts_base_collection_immutable_HashMap_api = require_chunk.__toESM(_fncts_base_collection_immutable_HashMap_api, 1);
|
|
17
|
+
let _fncts_io_Ref_api_modify = require("@fncts/io/Ref/api/modify");
|
|
18
|
+
_fncts_io_Ref_api_modify = require_chunk.__toESM(_fncts_io_Ref_api_modify, 1);
|
|
19
|
+
let _fncts_query_Cache_definition = require("@fncts/query/Cache/definition");
|
|
20
|
+
//#region build/esm/Cache/api.js
|
|
19
21
|
const fileName_1 = "(@fncts/query) src/Cache/api.ts";
|
|
20
|
-
const unsafeMake =
|
|
22
|
+
const unsafeMake = unsafeMake_1;
|
|
21
23
|
/**
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
* @tsplus static fncts.query.CacheOps empty
|
|
25
|
+
*/
|
|
24
26
|
function empty(__tsplusTrace) {
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
class Default extends _definition.Cache {
|
|
28
|
-
state;
|
|
29
|
-
constructor(state) {
|
|
30
|
-
super();
|
|
31
|
-
this.state = state;
|
|
32
|
-
}
|
|
33
|
-
get(request, __tsplusTrace) {
|
|
34
|
-
return tsplus_module_1.orElseFail(() => undefined, fileName_1 + ":21:73")(tsplus_module_1.just(tsplus_module_1.map(map => tsplus_module_2.get(request)(map), fileName_1 + ":21:30")(tsplus_module_3.get(this.state, fileName_1 + ":21:22"))));
|
|
35
|
-
}
|
|
36
|
-
lookup(request, __tsplusTrace) {
|
|
37
|
-
return tsplus_module_1.flatMap(ref => {
|
|
38
|
-
return tsplus_module_6.modify(map => tsplus_module_5.match(() => [tsplus_module_4.left(ref, fileName_1 + ":30:22"), tsplus_module_2.set(request, ref)(map)], ref => [tsplus_module_4.right(ref, fileName_1 + ":31:26"), map])(tsplus_module_2.get(request)(map)), fileName_1 + ":28:31")(this.state);
|
|
39
|
-
}, fileName_1 + ":27:53")(tsplus_module_8.make(() => tsplus_module_7.nothing(fileName_1 + ":27:28"), fileName_1 + ":27:20"));
|
|
40
|
-
}
|
|
41
|
-
put(request, result, __tsplusTrace) {
|
|
42
|
-
return tsplus_module_6.update(map => tsplus_module_2.set(request, result)(map), fileName_1 + ":37:29")(this.state);
|
|
43
|
-
}
|
|
44
|
-
remove(request, __tsplusTrace) {
|
|
45
|
-
return tsplus_module_6.update(map => tsplus_module_2.remove(request)(map), fileName_1 + ":40:29")(this.state);
|
|
46
|
-
}
|
|
27
|
+
return _fncts_io_IO_api.succeed(() => unsafeMake_1(), __tsplusTrace);
|
|
47
28
|
}
|
|
29
|
+
var Default = class extends _fncts_query_Cache_definition.Cache {
|
|
30
|
+
state;
|
|
31
|
+
constructor(state) {
|
|
32
|
+
super();
|
|
33
|
+
this.state = state;
|
|
34
|
+
}
|
|
35
|
+
get(request, __tsplusTrace) {
|
|
36
|
+
return _fncts_io_IO_api.orElseFail(() => void 0, fileName_1 + ":21:73")(_fncts_io_IO_api.just(_fncts_io_IO_api.map((map) => _fncts_base_collection_immutable_HashMap_api.get(request)(map), fileName_1 + ":21:30")(_fncts_io_Ref_api_get.get(this.state, fileName_1 + ":21:22"))));
|
|
37
|
+
}
|
|
38
|
+
lookup(request, __tsplusTrace) {
|
|
39
|
+
return _fncts_io_IO_api.flatMap((ref) => {
|
|
40
|
+
return _fncts_io_Ref_api_modify.modify((map) => _fncts_base_data_Maybe_destructors.match(() => [_fncts_base_data_Either_constructors.left(ref, fileName_1 + ":30:22"), _fncts_base_collection_immutable_HashMap_api.set(request, ref)(map)], (ref) => [_fncts_base_data_Either_constructors.right(ref, fileName_1 + ":31:26"), map])(_fncts_base_collection_immutable_HashMap_api.get(request)(map)), fileName_1 + ":28:31")(this.state);
|
|
41
|
+
}, fileName_1 + ":27:53")(_fncts_io_Ref_constructors.make(() => _fncts_base_data_Maybe_constructors.nothing(fileName_1 + ":27:28"), fileName_1 + ":27:20"));
|
|
42
|
+
}
|
|
43
|
+
put(request, result, __tsplusTrace) {
|
|
44
|
+
return _fncts_io_Ref_api_modify.update((map) => _fncts_base_collection_immutable_HashMap_api.set(request, result)(map), fileName_1 + ":37:29")(this.state);
|
|
45
|
+
}
|
|
46
|
+
remove(request, __tsplusTrace) {
|
|
47
|
+
return _fncts_io_Ref_api_modify.update((map) => _fncts_base_collection_immutable_HashMap_api.remove(request)(map), fileName_1 + ":40:29")(this.state);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
48
50
|
/**
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
exports.Default = Default;
|
|
51
|
+
* @tsplus static fncts.query.CacheOps unsafeMake
|
|
52
|
+
*/
|
|
52
53
|
function unsafeMake_1() {
|
|
53
|
-
|
|
54
|
+
return new Default(_fncts_io_Ref_constructors.unsafeMake(_fncts_base_collection_immutable_HashMap_api.empty(), fileName_1 + ":48:36"));
|
|
54
55
|
}
|
|
56
|
+
//#endregion
|
|
57
|
+
exports.Default = Default;
|
|
58
|
+
exports.empty = empty;
|
|
59
|
+
exports.unsafeMake = unsafeMake;
|
|
60
|
+
|
|
55
61
|
//# sourceMappingURL=api.cjs.map
|
package/_cjs/Cache/api.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.cjs","names":["
|
|
1
|
+
{"version":3,"file":"api.cjs","names":["tsplus_module_1","Cache","tsplus_module_2","tsplus_module_3","tsplus_module_6","tsplus_module_5","tsplus_module_4","tsplus_module_8","tsplus_module_7"],"sources":["../../esm/Cache/api.js"],"sourcesContent":["const fileName_1 = \"(@fncts/query) src/Cache/api.ts\";\nimport * as tsplus_module_1 from \"@fncts/io/IO/api\";\nimport * as tsplus_module_2 from \"@fncts/base/collection/immutable/HashMap/api\";\nimport * as tsplus_module_3 from \"@fncts/io/Ref/api/get\";\nimport * as tsplus_module_4 from \"@fncts/base/data/Either/constructors\";\nimport * as tsplus_module_5 from \"@fncts/base/data/Maybe/destructors\";\nimport * as tsplus_module_6 from \"@fncts/io/Ref/api/modify\";\nimport * as tsplus_module_7 from \"@fncts/base/data/Maybe/constructors\";\nimport * as tsplus_module_8 from \"@fncts/io/Ref/constructors\";\nexport const unsafeMake = unsafeMake_1;\nimport { Cache } from \"@fncts/query/Cache/definition\";\n/**\n * @tsplus static fncts.query.CacheOps empty\n */\nexport function empty(__tsplusTrace) {\n return tsplus_module_1.succeed(() => unsafeMake_1(), __tsplusTrace);\n}\nexport class Default extends Cache {\n state;\n constructor(state) {\n super();\n this.state = state;\n }\n get(request, __tsplusTrace) {\n return tsplus_module_1.orElseFail(() => undefined, fileName_1 + \":21:73\")(tsplus_module_1.just(tsplus_module_1.map((map) => tsplus_module_2.get(request)(map), fileName_1 + \":21:30\")(tsplus_module_3.get(this.state, fileName_1 + \":21:22\"))));\n }\n lookup(request, __tsplusTrace) {\n return tsplus_module_1.flatMap((ref) => {\n return tsplus_module_6.modify((map) => tsplus_module_5.match(() => [tsplus_module_4.left(ref, fileName_1 + \":30:22\"), tsplus_module_2.set(request, ref)(map)], (ref) => [tsplus_module_4.right(ref, fileName_1 + \":31:26\"), map])(tsplus_module_2.get(request)(map)), fileName_1 + \":28:31\")(this.state);\n }, fileName_1 + \":27:53\")(tsplus_module_8.make(() => tsplus_module_7.nothing(fileName_1 + \":27:28\"), fileName_1 + \":27:20\"));\n }\n put(request, result, __tsplusTrace) {\n return tsplus_module_6.update((map) => tsplus_module_2.set(request, result)(map), fileName_1 + \":37:29\")(this.state);\n }\n remove(request, __tsplusTrace) {\n return tsplus_module_6.update((map) => tsplus_module_2.remove(request)(map), fileName_1 + \":40:29\")(this.state);\n }\n}\n/**\n * @tsplus static fncts.query.CacheOps unsafeMake\n */\nfunction unsafeMake_1() {\n return new Default(tsplus_module_8.unsafeMake(tsplus_module_2.empty(), fileName_1 + \":48:36\"));\n}\n//# sourceMappingURL=api.js.map"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,MAAM,aAAa;AASnB,MAAa,aAAa;;;;AAK1B,SAAgB,MAAM,eAAe;AACjC,QAAOA,iBAAgB,cAAc,cAAc,EAAE,cAAc;;AAEvE,IAAa,UAAb,cAA6BC,8BAAAA,MAAM;CAC/B;CACA,YAAY,OAAO;AACf,SAAO;AACP,OAAK,QAAQ;;CAEjB,IAAI,SAAS,eAAe;AACxB,SAAOD,iBAAgB,iBAAiB,KAAA,GAAW,aAAa,SAAS,CAACA,iBAAgB,KAAKA,iBAAgB,KAAK,QAAQE,6CAAgB,IAAI,QAAQ,CAAC,IAAI,EAAE,aAAa,SAAS,CAACC,sBAAgB,IAAI,KAAK,OAAO,aAAa,SAAS,CAAC,CAAC,CAAC;;CAEnP,OAAO,SAAS,eAAe;AAC3B,SAAOH,iBAAgB,SAAS,QAAQ;AACpC,UAAOI,yBAAgB,QAAQ,QAAQC,mCAAgB,YAAY,CAACC,qCAAgB,KAAK,KAAK,aAAa,SAAS,EAAEJ,6CAAgB,IAAI,SAAS,IAAI,CAAC,IAAI,CAAC,GAAG,QAAQ,CAACI,qCAAgB,MAAM,KAAK,aAAa,SAAS,EAAE,IAAI,CAAC,CAACJ,6CAAgB,IAAI,QAAQ,CAAC,IAAI,CAAC,EAAE,aAAa,SAAS,CAAC,KAAK,MAAM;KACzS,aAAa,SAAS,CAACK,2BAAgB,WAAWC,oCAAgB,QAAQ,aAAa,SAAS,EAAE,aAAa,SAAS,CAAC;;CAEhI,IAAI,SAAS,QAAQ,eAAe;AAChC,SAAOJ,yBAAgB,QAAQ,QAAQF,6CAAgB,IAAI,SAAS,OAAO,CAAC,IAAI,EAAE,aAAa,SAAS,CAAC,KAAK,MAAM;;CAExH,OAAO,SAAS,eAAe;AAC3B,SAAOE,yBAAgB,QAAQ,QAAQF,6CAAgB,OAAO,QAAQ,CAAC,IAAI,EAAE,aAAa,SAAS,CAAC,KAAK,MAAM;;;;;;AAMvH,SAAS,eAAe;AACpB,QAAO,IAAI,QAAQK,2BAAgB,WAAWL,6CAAgB,OAAO,EAAE,aAAa,SAAS,CAAC"}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.Cache = void 0;
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region build/esm/Cache/definition.js
|
|
7
3
|
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
* @tsplus type fncts.query.Cache
|
|
5
|
+
* @tsplus companion fncts.query.CacheOps
|
|
6
|
+
*/
|
|
7
|
+
var Cache = class {};
|
|
8
|
+
//#endregion
|
|
12
9
|
exports.Cache = Cache;
|
|
10
|
+
|
|
13
11
|
//# sourceMappingURL=definition.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.cjs","names":[
|
|
1
|
+
{"version":3,"file":"definition.cjs","names":[],"sources":["../../esm/Cache/definition.js"],"sourcesContent":["/**\n * @tsplus type fncts.query.Cache\n * @tsplus companion fncts.query.CacheOps\n */\nexport class Cache {\n}\n//# sourceMappingURL=definition.js.map"],"mappings":";;;;;;AAIA,IAAa,QAAb,MAAmB"}
|
package/_cjs/Cache.cjs
CHANGED
|
@@ -1,28 +1,7 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _api[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _api[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
var _definition = /*#__PURE__*/require("./Cache/definition.cjs");
|
|
18
|
-
Object.keys(_definition).forEach(function (key) {
|
|
19
|
-
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (key in exports && exports[key] === _definition[key]) return;
|
|
21
|
-
Object.defineProperty(exports, key, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function () {
|
|
24
|
-
return _definition[key];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
//# sourceMappingURL=Cache.cjs.map
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_Cache_api = require("./Cache/api.cjs");
|
|
3
|
+
const require_Cache_definition = require("./Cache/definition.cjs");
|
|
4
|
+
exports.Cache = require_Cache_definition.Cache;
|
|
5
|
+
exports.Default = require_Cache_api.Default;
|
|
6
|
+
exports.empty = require_Cache_api.empty;
|
|
7
|
+
exports.unsafeMake = require_Cache_api.unsafeMake;
|
|
@@ -1,41 +1,43 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_chunk = require("./chunk.cjs");
|
|
3
|
+
let _fncts_base_data_Maybe_destructors = require("@fncts/base/data/Maybe/destructors");
|
|
4
|
+
_fncts_base_data_Maybe_destructors = require_chunk.__toESM(_fncts_base_data_Maybe_destructors, 1);
|
|
5
|
+
let _fncts_base_data_Either_destructors = require("@fncts/base/data/Either/destructors");
|
|
6
|
+
_fncts_base_data_Either_destructors = require_chunk.__toESM(_fncts_base_data_Either_destructors, 1);
|
|
7
|
+
let _fncts_base_data_Either_constructors = require("@fncts/base/data/Either/constructors");
|
|
8
|
+
_fncts_base_data_Either_constructors = require_chunk.__toESM(_fncts_base_data_Either_constructors, 1);
|
|
9
|
+
let _fncts_base_collection_immutable_HashMap_api = require("@fncts/base/collection/immutable/HashMap/api");
|
|
10
|
+
_fncts_base_collection_immutable_HashMap_api = require_chunk.__toESM(_fncts_base_collection_immutable_HashMap_api, 1);
|
|
11
|
+
//#region build/esm/CompletedRequestMap.js
|
|
12
12
|
const fileName_1 = "(@fncts/query) src/CompletedRequestMap.ts";
|
|
13
|
-
class CompletedRequestMap {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
13
|
+
var CompletedRequestMap = class CompletedRequestMap {
|
|
14
|
+
map;
|
|
15
|
+
constructor(map) {
|
|
16
|
+
this.map = map;
|
|
17
|
+
}
|
|
18
|
+
static empty() {
|
|
19
|
+
return new CompletedRequestMap(_fncts_base_collection_immutable_HashMap_api.empty());
|
|
20
|
+
}
|
|
21
|
+
concat(that) {
|
|
22
|
+
return new CompletedRequestMap(_fncts_base_collection_immutable_HashMap_api.union(that.map)(this.map));
|
|
23
|
+
}
|
|
24
|
+
insert(request, result) {
|
|
25
|
+
return new CompletedRequestMap(_fncts_base_collection_immutable_HashMap_api.set(request, result)(this.map));
|
|
26
|
+
}
|
|
27
|
+
insertMaybe(request, result) {
|
|
28
|
+
return _fncts_base_data_Either_destructors.match((e) => this.insert(request, _fncts_base_data_Either_constructors.left(e, fileName_1 + ":20:39")), (r) => _fncts_base_data_Maybe_destructors.match(() => this, (a) => this.insert(request, _fncts_base_data_Either_constructors.right(a, fileName_1 + ":24:44")))(r))(result);
|
|
29
|
+
}
|
|
30
|
+
lookup(request) {
|
|
31
|
+
return _fncts_base_collection_immutable_HashMap_api.get(request)(this.map);
|
|
32
|
+
}
|
|
33
|
+
requests() {
|
|
34
|
+
return _fncts_base_collection_immutable_HashMap_api.keySet(this.map);
|
|
35
|
+
}
|
|
36
|
+
contains(request) {
|
|
37
|
+
return _fncts_base_collection_immutable_HashMap_api.has(request)(this.map);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
//#endregion
|
|
40
41
|
exports.CompletedRequestMap = CompletedRequestMap;
|
|
42
|
+
|
|
41
43
|
//# sourceMappingURL=CompletedRequestMap.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompletedRequestMap.cjs","names":["
|
|
1
|
+
{"version":3,"file":"CompletedRequestMap.cjs","names":["tsplus_module_1","tsplus_module_4","tsplus_module_2","tsplus_module_3"],"sources":["../esm/CompletedRequestMap.js"],"sourcesContent":["const fileName_1 = \"(@fncts/query) src/CompletedRequestMap.ts\";\nimport * as tsplus_module_1 from \"@fncts/base/collection/immutable/HashMap/api\";\nimport * as tsplus_module_2 from \"@fncts/base/data/Either/constructors\";\nimport * as tsplus_module_3 from \"@fncts/base/data/Maybe/destructors\";\nimport * as tsplus_module_4 from \"@fncts/base/data/Either/destructors\";\nexport class CompletedRequestMap {\n map;\n constructor(map) {\n this.map = map;\n }\n static empty() {\n return new CompletedRequestMap(tsplus_module_1.empty());\n }\n concat(that) {\n return new CompletedRequestMap(tsplus_module_1.union(that.map)(this.map));\n }\n insert(request, result) {\n return new CompletedRequestMap(tsplus_module_1.set(request, result)(this.map));\n }\n insertMaybe(request, result) {\n return tsplus_module_4.match((e) => this.insert(request, tsplus_module_2.left(e, fileName_1 + \":20:39\")), (r) => tsplus_module_3.match(() => this, (a) => this.insert(request, tsplus_module_2.right(a, fileName_1 + \":24:44\")))(r))(result);\n }\n lookup(request) {\n return tsplus_module_1.get(request)(this.map);\n }\n requests() {\n return tsplus_module_1.keySet(this.map);\n }\n contains(request) {\n return tsplus_module_1.has(request)(this.map);\n }\n}\n//# sourceMappingURL=CompletedRequestMap.js.map"],"mappings":";;;;;;;;;;;AAAA,MAAM,aAAa;AAKnB,IAAa,sBAAb,MAAa,oBAAoB;CAC7B;CACA,YAAY,KAAK;AACb,OAAK,MAAM;;CAEf,OAAO,QAAQ;AACX,SAAO,IAAI,oBAAoBA,6CAAgB,OAAO,CAAC;;CAE3D,OAAO,MAAM;AACT,SAAO,IAAI,oBAAoBA,6CAAgB,MAAM,KAAK,IAAI,CAAC,KAAK,IAAI,CAAC;;CAE7E,OAAO,SAAS,QAAQ;AACpB,SAAO,IAAI,oBAAoBA,6CAAgB,IAAI,SAAS,OAAO,CAAC,KAAK,IAAI,CAAC;;CAElF,YAAY,SAAS,QAAQ;AACzB,SAAOC,oCAAgB,OAAO,MAAM,KAAK,OAAO,SAASC,qCAAgB,KAAK,GAAG,aAAa,SAAS,CAAC,GAAG,MAAMC,mCAAgB,YAAY,OAAO,MAAM,KAAK,OAAO,SAASD,qCAAgB,MAAM,GAAG,aAAa,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,OAAO;;CAEhP,OAAO,SAAS;AACZ,SAAOF,6CAAgB,IAAI,QAAQ,CAAC,KAAK,IAAI;;CAEjD,WAAW;AACP,SAAOA,6CAAgB,OAAO,KAAK,IAAI;;CAE3C,SAAS,SAAS;AACd,SAAOA,6CAAgB,IAAI,QAAQ,CAAC,KAAK,IAAI"}
|
package/_cjs/DataSource/api.cjs
CHANGED
|
@@ -1,92 +1,96 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var tsplus_module_5 = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("@fncts/io/IO/api/foreachConcurrent"));
|
|
17
|
-
var _CompletedRequestMap = /*#__PURE__*/require("@fncts/query/CompletedRequestMap");
|
|
18
|
-
var _definition = /*#__PURE__*/require("@fncts/query/DataSource/definition");
|
|
19
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_chunk = require("../chunk.cjs");
|
|
3
|
+
let _fncts_io_IO_api = require("@fncts/io/IO/api");
|
|
4
|
+
_fncts_io_IO_api = require_chunk.__toESM(_fncts_io_IO_api, 1);
|
|
5
|
+
let _fncts_io_IO_api_environment = require("@fncts/io/IO/api/environment");
|
|
6
|
+
_fncts_io_IO_api_environment = require_chunk.__toESM(_fncts_io_IO_api_environment, 1);
|
|
7
|
+
let _fncts_io_IO_api_foreachConcurrent = require("@fncts/io/IO/api/foreachConcurrent");
|
|
8
|
+
_fncts_io_IO_api_foreachConcurrent = require_chunk.__toESM(_fncts_io_IO_api_foreachConcurrent, 1);
|
|
9
|
+
let _fncts_base_collection_immutable_Conc_api = require("@fncts/base/collection/immutable/Conc/api");
|
|
10
|
+
_fncts_base_collection_immutable_Conc_api = require_chunk.__toESM(_fncts_base_collection_immutable_Conc_api, 1);
|
|
11
|
+
let _fncts_base_data_Either_constructors = require("@fncts/base/data/Either/constructors");
|
|
12
|
+
_fncts_base_data_Either_constructors = require_chunk.__toESM(_fncts_base_data_Either_constructors, 1);
|
|
13
|
+
let _fncts_query_CompletedRequestMap = require("@fncts/query/CompletedRequestMap");
|
|
14
|
+
let _fncts_query_DataSource_definition = require("@fncts/query/DataSource/definition");
|
|
15
|
+
//#region build/esm/DataSource/api.js
|
|
20
16
|
const fileName_1 = "(@fncts/query) src/DataSource/api.ts";
|
|
21
17
|
/**
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
* @tsplus pipeable fncts.query.DataSource contramap
|
|
19
|
+
*/
|
|
24
20
|
function contamap(f) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
return (self) => {
|
|
22
|
+
return new class extends _fncts_query_DataSource_definition.DataSource {
|
|
23
|
+
identifier = `${self.identifier}.contramap(${f.description})`;
|
|
24
|
+
runAll(requests, __tsplusTrace) {
|
|
25
|
+
return self.runAll(_fncts_base_collection_immutable_Conc_api.map((_) => _fncts_base_collection_immutable_Conc_api.map(f.value)(_))(requests), fileName_1 + ":17:27");
|
|
26
|
+
}
|
|
27
|
+
}();
|
|
28
|
+
};
|
|
33
29
|
}
|
|
34
30
|
/**
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
* @tsplus pipeable fncts.query.DataSource contramapEnvironment
|
|
32
|
+
*/
|
|
37
33
|
function contramapEnvironment(f, __tsplusTrace) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
34
|
+
return (self) => {
|
|
35
|
+
return new class extends _fncts_query_DataSource_definition.DataSource {
|
|
36
|
+
identifier = `${self.identifier}.contramapEnvironment(${f.description})`;
|
|
37
|
+
runAll(requests, __tsplusTrace) {
|
|
38
|
+
return _fncts_io_IO_api_environment.contramapEnvironment(f.value, __tsplusTrace)(self.runAll(requests, __tsplusTrace));
|
|
39
|
+
}
|
|
40
|
+
}();
|
|
41
|
+
};
|
|
46
42
|
}
|
|
47
43
|
/**
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
* @tsplus static fncts.query.BatchedOps make
|
|
45
|
+
* @tsplus static fncts.query.DataSourceOps makeBatched
|
|
46
|
+
*/
|
|
51
47
|
function makeBatched(name, f) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
48
|
+
return new class extends _fncts_query_DataSource_definition.Batched {
|
|
49
|
+
identifier = name;
|
|
50
|
+
run(requests, __tsplusTrace) {
|
|
51
|
+
return f(requests);
|
|
52
|
+
}
|
|
53
|
+
}();
|
|
58
54
|
}
|
|
59
55
|
/**
|
|
60
|
-
|
|
61
|
-
|
|
56
|
+
* @tsplus static fncts.query.DataSourceOps make
|
|
57
|
+
*/
|
|
62
58
|
function make(name, f) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
59
|
+
return new class extends _fncts_query_DataSource_definition.DataSource {
|
|
60
|
+
identifier = name;
|
|
61
|
+
runAll(requests, __tsplusTrace) {
|
|
62
|
+
return f(requests);
|
|
63
|
+
}
|
|
64
|
+
}();
|
|
69
65
|
}
|
|
70
66
|
/**
|
|
71
|
-
|
|
72
|
-
|
|
67
|
+
* @tsplus static fncts.query.DataSourceOps fromFunction
|
|
68
|
+
*/
|
|
73
69
|
function fromFunction(name, f) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
70
|
+
return new class extends _fncts_query_DataSource_definition.Batched {
|
|
71
|
+
run(requests, __tsplusTrace) {
|
|
72
|
+
return _fncts_io_IO_api.succeedNow(_fncts_base_collection_immutable_Conc_api.foldLeft(_fncts_query_CompletedRequestMap.CompletedRequestMap.empty(), (map, k) => map.insert(k, _fncts_base_data_Either_constructors.right(f(k), fileName_1 + ":77:106")))(requests), fileName_1 + ":77:27");
|
|
73
|
+
}
|
|
74
|
+
identifier = name;
|
|
75
|
+
}();
|
|
80
76
|
}
|
|
81
77
|
/**
|
|
82
|
-
|
|
83
|
-
|
|
78
|
+
* @tsplus static fncts.query.DataSourceOps fromFunctionIO
|
|
79
|
+
*/
|
|
84
80
|
function fromFunctionIO(name, f) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
81
|
+
return new class extends _fncts_query_DataSource_definition.Batched {
|
|
82
|
+
identifier = name;
|
|
83
|
+
run(requests, __tsplusTrace) {
|
|
84
|
+
return _fncts_io_IO_api.map((results) => _fncts_base_collection_immutable_Conc_api.foldLeft(_fncts_query_CompletedRequestMap.CompletedRequestMap.empty(), (map, [k, v]) => map.insert(k, v))(results), fileName_1 + ":93:96")(_fncts_io_IO_api_foreachConcurrent.foreachConcurrent(requests, (a) => _fncts_io_IO_api.map((r) => [a, r], fileName_1 + ":93:67")(_fncts_io_IO_api.either(f(a), fileName_1 + ":93:56")), fileName_1 + ":93:34"));
|
|
85
|
+
}
|
|
86
|
+
}();
|
|
91
87
|
}
|
|
88
|
+
//#endregion
|
|
89
|
+
exports.contamap = contamap;
|
|
90
|
+
exports.contramapEnvironment = contramapEnvironment;
|
|
91
|
+
exports.fromFunction = fromFunction;
|
|
92
|
+
exports.fromFunctionIO = fromFunctionIO;
|
|
93
|
+
exports.make = make;
|
|
94
|
+
exports.makeBatched = makeBatched;
|
|
95
|
+
|
|
92
96
|
//# sourceMappingURL=api.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.cjs","names":["
|
|
1
|
+
{"version":3,"file":"api.cjs","names":["DataSource","tsplus_module_1","tsplus_module_2","Batched","tsplus_module_4","CompletedRequestMap","tsplus_module_3","tsplus_module_5"],"sources":["../../esm/DataSource/api.js"],"sourcesContent":["const fileName_1 = \"(@fncts/query) src/DataSource/api.ts\";\nimport * as tsplus_module_1 from \"@fncts/base/collection/immutable/Conc/api\";\nimport * as tsplus_module_2 from \"@fncts/io/IO/api/environment\";\nimport * as tsplus_module_3 from \"@fncts/base/data/Either/constructors\";\nimport * as tsplus_module_4 from \"@fncts/io/IO/api\";\nimport * as tsplus_module_5 from \"@fncts/io/IO/api/foreachConcurrent\";\nimport { CompletedRequestMap } from \"@fncts/query/CompletedRequestMap\";\nimport { Batched, DataSource } from \"@fncts/query/DataSource/definition\";\n/**\n * @tsplus pipeable fncts.query.DataSource contramap\n */\nexport function contamap(f) {\n return (self) => {\n return new (class extends DataSource {\n identifier = `${self.identifier}.contramap(${f.description})`;\n runAll(requests, __tsplusTrace) {\n return self.runAll(tsplus_module_1.map((_) => tsplus_module_1.map(f.value)(_))(requests), fileName_1 + \":17:27\");\n }\n })();\n };\n}\n/**\n * @tsplus pipeable fncts.query.DataSource contramapEnvironment\n */\nexport function contramapEnvironment(f, __tsplusTrace) {\n return (self) => {\n return new (class extends DataSource {\n identifier = `${self.identifier}.contramapEnvironment(${f.description})`;\n runAll(requests, __tsplusTrace) {\n return tsplus_module_2.contramapEnvironment(f.value, __tsplusTrace)(self.runAll(requests, __tsplusTrace));\n }\n })();\n };\n}\n/**\n * @tsplus static fncts.query.BatchedOps make\n * @tsplus static fncts.query.DataSourceOps makeBatched\n */\nexport function makeBatched(name, f) {\n return new (class extends Batched {\n identifier = name;\n run(requests, __tsplusTrace) {\n return f(requests);\n }\n })();\n}\n/**\n * @tsplus static fncts.query.DataSourceOps make\n */\nexport function make(name, f) {\n return new (class extends DataSource {\n identifier = name;\n runAll(requests, __tsplusTrace) {\n return f(requests);\n }\n })();\n}\n/**\n * @tsplus static fncts.query.DataSourceOps fromFunction\n */\nexport function fromFunction(name, f) {\n return new (class extends Batched {\n run(requests, __tsplusTrace) {\n return tsplus_module_4.succeedNow(tsplus_module_1.foldLeft(CompletedRequestMap.empty(), (map, k) => map.insert(k, tsplus_module_3.right(f(k), fileName_1 + \":77:106\")))(requests), fileName_1 + \":77:27\");\n }\n identifier = name;\n })();\n}\n/**\n * @tsplus static fncts.query.DataSourceOps fromFunctionIO\n */\nexport function fromFunctionIO(name, f) {\n return new (class extends Batched {\n identifier = name;\n run(requests, __tsplusTrace) {\n return tsplus_module_4.map((results) => tsplus_module_1.foldLeft(CompletedRequestMap.empty(), (map, [k, v]) => map.insert(k, v))(results), fileName_1 + \":93:96\")(tsplus_module_5.foreachConcurrent(requests, (a) => tsplus_module_4.map((r) => [a, r], fileName_1 + \":93:67\")(tsplus_module_4.either(f(a), fileName_1 + \":93:56\")), fileName_1 + \":93:34\"));\n }\n })();\n}\n//# sourceMappingURL=api.js.map"],"mappings":";;;;;;;;;;;;;;;AAAA,MAAM,aAAa;;;;AAWnB,SAAgB,SAAS,GAAG;AACxB,SAAQ,SAAS;AACb,SAAO,IAAK,cAAcA,mCAAAA,WAAW;GACjC,aAAa,GAAG,KAAK,WAAW,aAAa,EAAE,YAAY;GAC3D,OAAO,UAAU,eAAe;AAC5B,WAAO,KAAK,OAAOC,0CAAgB,KAAK,MAAMA,0CAAgB,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,SAAS,EAAE,aAAa,SAAS;;KAEpH;;;;;;AAMZ,SAAgB,qBAAqB,GAAG,eAAe;AACnD,SAAQ,SAAS;AACb,SAAO,IAAK,cAAcD,mCAAAA,WAAW;GACjC,aAAa,GAAG,KAAK,WAAW,wBAAwB,EAAE,YAAY;GACtE,OAAO,UAAU,eAAe;AAC5B,WAAOE,6BAAgB,qBAAqB,EAAE,OAAO,cAAc,CAAC,KAAK,OAAO,UAAU,cAAc,CAAC;;KAE7G;;;;;;;AAOZ,SAAgB,YAAY,MAAM,GAAG;AACjC,QAAO,IAAK,cAAcC,mCAAAA,QAAQ;EAC9B,aAAa;EACb,IAAI,UAAU,eAAe;AACzB,UAAO,EAAE,SAAS;;IAEtB;;;;;AAKR,SAAgB,KAAK,MAAM,GAAG;AAC1B,QAAO,IAAK,cAAcH,mCAAAA,WAAW;EACjC,aAAa;EACb,OAAO,UAAU,eAAe;AAC5B,UAAO,EAAE,SAAS;;IAEtB;;;;;AAKR,SAAgB,aAAa,MAAM,GAAG;AAClC,QAAO,IAAK,cAAcG,mCAAAA,QAAQ;EAC9B,IAAI,UAAU,eAAe;AACzB,UAAOC,iBAAgB,WAAWH,0CAAgB,SAASI,iCAAAA,oBAAoB,OAAO,GAAG,KAAK,MAAM,IAAI,OAAO,GAAGC,qCAAgB,MAAM,EAAE,EAAE,EAAE,aAAa,UAAU,CAAC,CAAC,CAAC,SAAS,EAAE,aAAa,SAAS;;EAE7M,aAAa;IACb;;;;;AAKR,SAAgB,eAAe,MAAM,GAAG;AACpC,QAAO,IAAK,cAAcH,mCAAAA,QAAQ;EAC9B,aAAa;EACb,IAAI,UAAU,eAAe;AACzB,UAAOC,iBAAgB,KAAK,YAAYH,0CAAgB,SAASI,iCAAAA,oBAAoB,OAAO,GAAG,KAAK,CAAC,GAAG,OAAO,IAAI,OAAO,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE,aAAa,SAAS,CAACE,mCAAgB,kBAAkB,WAAW,MAAMH,iBAAgB,KAAK,MAAM,CAAC,GAAG,EAAE,EAAE,aAAa,SAAS,CAACA,iBAAgB,OAAO,EAAE,EAAE,EAAE,aAAa,SAAS,CAAC,EAAE,aAAa,SAAS,CAAC;;IAEhW"}
|