exupery-core-async 0.1.4 → 0.1.5
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/index.d.ts +3 -0
- package/dist/index.js +40 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as _et from "exupery-core-types";
|
|
1
2
|
export * from "./Safe_Command_Result";
|
|
2
3
|
export * from "./Unsafe_Command_Result";
|
|
3
4
|
export * from "./Safe_Query_Result";
|
|
@@ -11,6 +12,7 @@ import { Safe_Command_Result } from "./Safe_Command_Result";
|
|
|
11
12
|
import { Unsafe_Command_Result } from "./Unsafe_Command_Result";
|
|
12
13
|
import { Safe_Query_Result } from "./Safe_Query_Result";
|
|
13
14
|
import { Unsafe_Query_Result } from "./Unsafe_Query_Result";
|
|
15
|
+
import { Dictionary } from "exupery-core-types";
|
|
14
16
|
export declare const query: {
|
|
15
17
|
safe: {
|
|
16
18
|
'create result': <T>($: T) => Safe_Query_Result<T>;
|
|
@@ -25,5 +27,6 @@ export declare const command: {
|
|
|
25
27
|
};
|
|
26
28
|
unsafe: {
|
|
27
29
|
'create result': <E>() => Unsafe_Command_Result<E>;
|
|
30
|
+
dictionary: <T, E>($: _et.Dictionary<T>, handle_entry: ($: T) => Unsafe_Command_Result<E>) => Unsafe_Command_Result<Dictionary<E>>;
|
|
28
31
|
};
|
|
29
32
|
};
|
package/dist/index.js
CHANGED
|
@@ -10,11 +10,24 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
11
|
o[k2] = m[k];
|
|
12
12
|
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
13
25
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
26
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
27
|
};
|
|
16
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
29
|
exports.command = exports.query = void 0;
|
|
30
|
+
const _ei = __importStar(require("exupery-core-internals"));
|
|
18
31
|
__exportStar(require("./Safe_Command_Result"), exports);
|
|
19
32
|
__exportStar(require("./Unsafe_Command_Result"), exports);
|
|
20
33
|
__exportStar(require("./Safe_Query_Result"), exports);
|
|
@@ -28,6 +41,7 @@ const execute_safe_command_1 = require("./execute_safe_command");
|
|
|
28
41
|
const execute_unsafe_command_1 = require("./execute_unsafe_command");
|
|
29
42
|
const run_safe_query_1 = require("./run_safe_query");
|
|
30
43
|
const run_unsafe_query_1 = require("./run_unsafe_query");
|
|
44
|
+
const create_asynchronous_processes_monitor_1 = require("./create_asynchronous_processes_monitor");
|
|
31
45
|
exports.query = {
|
|
32
46
|
'safe': {
|
|
33
47
|
'create result': ($) => {
|
|
@@ -65,6 +79,32 @@ exports.command = {
|
|
|
65
79
|
on_success();
|
|
66
80
|
}
|
|
67
81
|
});
|
|
82
|
+
},
|
|
83
|
+
'dictionary': ($, handle_entry) => {
|
|
84
|
+
return (0, execute_unsafe_command_1.__execute_unsafe_command)({
|
|
85
|
+
'execute': (on_success, on_exception) => {
|
|
86
|
+
let exceptions = {};
|
|
87
|
+
(0, create_asynchronous_processes_monitor_1.create_asynchronous_processes_monitor)((monitor) => {
|
|
88
|
+
$.map(($, key) => {
|
|
89
|
+
monitor['report process started']();
|
|
90
|
+
handle_entry($).__start(() => {
|
|
91
|
+
monitor['report process finished']();
|
|
92
|
+
}, (e) => {
|
|
93
|
+
exceptions[key] = e;
|
|
94
|
+
monitor['report process finished']();
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
}, () => {
|
|
98
|
+
if (Object.keys(exceptions).length === 0) {
|
|
99
|
+
on_success();
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
on_exception(_ei.dictionary_literal(exceptions));
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
on_success();
|
|
106
|
+
}
|
|
107
|
+
});
|
|
68
108
|
}
|
|
69
109
|
},
|
|
70
110
|
};
|