exupery-core-async 0.3.23 → 0.3.25
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/algorithms/query/create_query_primed_with_resources.js +8 -6
- package/dist/algorithms/query/create_query_promise.d.ts +3 -3
- package/dist/algorithms/query/create_query_promise.js +57 -17
- package/dist/expressions/procedure.d.ts +27 -0
- package/dist/expressions/procedure.js +303 -0
- package/dist/expressions/query.d.ts +6 -0
- package/dist/expressions/query.js +81 -0
- package/dist/index.d.ts +2 -15
- package/dist/index.js +2 -15
- package/package.json +1 -1
- package/dist/procedure/assert_async.d.ts +0 -3
- package/dist/procedure/assert_async.js +0 -23
- package/dist/procedure/assert_sync.d.ts +0 -3
- package/dist/procedure/assert_sync.js +0 -18
- package/dist/procedure/conditional_async.d.ts +0 -4
- package/dist/procedure/conditional_async.js +0 -23
- package/dist/procedure/conditional_multiple.d.ts +0 -4
- package/dist/procedure/conditional_multiple.js +0 -32
- package/dist/procedure/conditional_sync.d.ts +0 -2
- package/dist/procedure/conditional_sync.js +0 -17
- package/dist/procedure/dictionary_sequence.d.ts +0 -6
- package/dist/procedure/dictionary_sequence.js +0 -61
- package/dist/procedure/execute_with_async_data.d.ts +0 -2
- package/dist/procedure/execute_with_async_data.js +0 -14
- package/dist/procedure/procedure_dictionary.d.ts +0 -2
- package/dist/procedure/procedure_dictionary.js +0 -58
- package/dist/procedure/sequence.d.ts +0 -2
- package/dist/procedure/sequence.js +0 -23
- package/dist/procedure/three_steps.d.ts +0 -3
- package/dist/procedure/three_steps.js +0 -22
- package/dist/procedure/two_steps.d.ts +0 -3
- package/dist/procedure/two_steps.js +0 -18
- package/dist/query/query_dictionary.d.ts +0 -3
- package/dist/query/query_dictionary.js +0 -60
- package/dist/query/transform_query.d.ts +0 -3
- package/dist/query/transform_query.js +0 -16
- package/dist/shorthands.d.ts +0 -64
- package/dist/shorthands.js +0 -204
- package/dist/types/Basic_Query.d.ts +0 -3
- package/dist/types/Basic_Query.js +0 -2
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.assert_async = void 0;
|
|
4
|
-
const create_procedure_promise_1 = require("../algorithms/procedure/create_procedure_promise");
|
|
5
|
-
const assert_async = (assertion, procedure) => {
|
|
6
|
-
return (0, create_procedure_promise_1.__create_procedure_promise)({
|
|
7
|
-
'execute': (on_success, on_error) => {
|
|
8
|
-
assertion.__start(($) => {
|
|
9
|
-
if ($) {
|
|
10
|
-
procedure.__start(on_success, ($) => {
|
|
11
|
-
on_error(['procedure error', $]);
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
else {
|
|
15
|
-
on_error(['assertion failed', null]);
|
|
16
|
-
}
|
|
17
|
-
}, ($) => {
|
|
18
|
-
on_error(['assertion error', $]);
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
exports.assert_async = assert_async;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import * as _et from 'exupery-core-types';
|
|
2
|
-
export type Assert_Sync_Error<Procedure_Error> = ['assertion failed', null] | ['procedure error', Procedure_Error];
|
|
3
|
-
export declare const assert_sync: <Assertion_Error, Procedure_Error>(assertion: boolean, procedure: _et.Procedure_Promise<Procedure_Error>) => _et.Procedure_Promise<Assert_Sync_Error<Procedure_Error>>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.assert_sync = void 0;
|
|
4
|
-
const create_procedure_promise_1 = require("../algorithms/procedure/create_procedure_promise");
|
|
5
|
-
const assert_sync = (assertion, procedure) => {
|
|
6
|
-
return (0, create_procedure_promise_1.__create_procedure_promise)({
|
|
7
|
-
'execute': (on_success, on_error) => {
|
|
8
|
-
if (!assertion) {
|
|
9
|
-
on_error(['assertion failed', null]);
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
procedure.__start(on_success, ($) => {
|
|
13
|
-
on_error(['procedure error', $]);
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
exports.assert_sync = assert_sync;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import * as _et from 'exupery-core-types';
|
|
2
|
-
import { Basic_Query_Promise } from '../types/Basic_Query';
|
|
3
|
-
export type Conditional_Async_Error<Precondition_Error, Procedure_Error> = ['precondition', Precondition_Error] | ['procedure', Procedure_Error];
|
|
4
|
-
export declare const conditional_async: <Precondition_Error, Procedure_Error>(precondition: Basic_Query_Promise<boolean, Precondition_Error>, procedure: _et.Procedure_Promise<Procedure_Error>) => _et.Procedure_Promise<Conditional_Async_Error<Precondition_Error, Procedure_Error>>;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.conditional_async = void 0;
|
|
4
|
-
const create_procedure_promise_1 = require("../algorithms/procedure/create_procedure_promise");
|
|
5
|
-
const conditional_async = (precondition, procedure) => {
|
|
6
|
-
return (0, create_procedure_promise_1.__create_procedure_promise)({
|
|
7
|
-
'execute': (on_success, on_error) => {
|
|
8
|
-
precondition.__start(($) => {
|
|
9
|
-
if ($) {
|
|
10
|
-
procedure.__start(on_success, (e) => {
|
|
11
|
-
on_error(['procedure', e]);
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
else {
|
|
15
|
-
on_success();
|
|
16
|
-
}
|
|
17
|
-
}, ($) => {
|
|
18
|
-
on_error(['precondition', $]);
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
exports.conditional_async = conditional_async;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import * as _et from 'exupery-core-types';
|
|
2
|
-
import { Basic_Query_Promise } from '../types/Basic_Query';
|
|
3
|
-
export type Conditional_Multiple_Error<Precondition_Error, Procedure_Error> = ['preconditions', _et.Dictionary<Precondition_Error>] | ['procedure', Procedure_Error];
|
|
4
|
-
export declare const conditional_multiple: <Precondition_Error, Procedure_Error>(preconditions: _et.Dictionary<Basic_Query_Promise<boolean, Precondition_Error>>, procedure: _et.Procedure_Promise<Procedure_Error>) => _et.Procedure_Promise<Conditional_Multiple_Error<Precondition_Error, Procedure_Error>>;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.conditional_multiple = void 0;
|
|
4
|
-
const query_dictionary_1 = require("../query/query_dictionary");
|
|
5
|
-
const create_procedure_promise_1 = require("../algorithms/procedure/create_procedure_promise");
|
|
6
|
-
const conditional_multiple = (preconditions, procedure) => {
|
|
7
|
-
return (0, create_procedure_promise_1.__create_procedure_promise)({
|
|
8
|
-
'execute': (on_success, on_error) => {
|
|
9
|
-
(0, query_dictionary_1.query_dictionary)(preconditions).__start(($) => {
|
|
10
|
-
let has_errors = false;
|
|
11
|
-
$.map(($) => {
|
|
12
|
-
if (!$) {
|
|
13
|
-
has_errors = true;
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
if (!has_errors) {
|
|
17
|
-
// all preconditions passed
|
|
18
|
-
procedure.__start(on_success, (e) => {
|
|
19
|
-
on_error(['procedure', e]);
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
//the preconditions failed, so we are *successfully* skipping the procedure
|
|
24
|
-
on_success();
|
|
25
|
-
}
|
|
26
|
-
}, ($) => {
|
|
27
|
-
on_error(['preconditions', $]);
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
exports.conditional_multiple = conditional_multiple;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.conditional_sync = void 0;
|
|
4
|
-
const create_procedure_promise_1 = require("../algorithms/procedure/create_procedure_promise");
|
|
5
|
-
const conditional_sync = (precondition, procedure) => {
|
|
6
|
-
return (0, create_procedure_promise_1.__create_procedure_promise)({
|
|
7
|
-
'execute': (on_success, on_error) => {
|
|
8
|
-
if (precondition) {
|
|
9
|
-
procedure.__start(on_success, on_error);
|
|
10
|
-
}
|
|
11
|
-
else {
|
|
12
|
-
on_success();
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
};
|
|
17
|
-
exports.conditional_sync = conditional_sync;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
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
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.dictionary_sequence = void 0;
|
|
27
|
-
const _ei = __importStar(require("exupery-core-internals"));
|
|
28
|
-
const create_procedure_promise_1 = require("../algorithms/procedure/create_procedure_promise");
|
|
29
|
-
const op_dictionary_to_list_based_on_insertion_order = (dict) => {
|
|
30
|
-
const temp = [];
|
|
31
|
-
dict.map(($, key) => {
|
|
32
|
-
temp.push({ key, value: $ });
|
|
33
|
-
});
|
|
34
|
-
return _ei.array_literal(temp);
|
|
35
|
-
};
|
|
36
|
-
const dictionary_sequence = (steps) => {
|
|
37
|
-
return (0, create_procedure_promise_1.__create_procedure_promise)({
|
|
38
|
-
'execute': (on_success, on_error) => {
|
|
39
|
-
const as_list = op_dictionary_to_list_based_on_insertion_order(steps);
|
|
40
|
-
let current = 0;
|
|
41
|
-
const do_next = () => {
|
|
42
|
-
as_list.__get_element_at(current).transform(($) => {
|
|
43
|
-
const key = $.key;
|
|
44
|
-
current += 1;
|
|
45
|
-
$.value.__start(() => {
|
|
46
|
-
do_next();
|
|
47
|
-
}, ($) => {
|
|
48
|
-
on_error({
|
|
49
|
-
'error': $,
|
|
50
|
-
'step': key,
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
}, () => {
|
|
54
|
-
on_success();
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
|
-
do_next();
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
};
|
|
61
|
-
exports.dictionary_sequence = dictionary_sequence;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.execute_with_async_data = void 0;
|
|
4
|
-
const create_procedure_promise_1 = require("../algorithms/procedure/create_procedure_promise");
|
|
5
|
-
const execute_with_async_data = (procedure, query) => {
|
|
6
|
-
return (0, create_procedure_promise_1.__create_procedure_promise)({
|
|
7
|
-
'execute': (on_success, on_error) => {
|
|
8
|
-
query.__start((query_result) => {
|
|
9
|
-
procedure["execute with synchronous data"](query_result).__start(on_success, on_error);
|
|
10
|
-
}, on_error);
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
};
|
|
14
|
-
exports.execute_with_async_data = execute_with_async_data;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
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
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.procedure_dictionary = void 0;
|
|
27
|
-
const _ei = __importStar(require("exupery-core-internals"));
|
|
28
|
-
const create_procedure_promise_1 = require("../algorithms/procedure/create_procedure_promise");
|
|
29
|
-
const procedure_dictionary = ($) => {
|
|
30
|
-
return (0, create_procedure_promise_1.__create_procedure_promise)({
|
|
31
|
-
'execute': (on_success, on_error) => {
|
|
32
|
-
let count_down = $.__get_number_of_entries();
|
|
33
|
-
let has_errors = false;
|
|
34
|
-
const errors = {};
|
|
35
|
-
const decrement_and_wrap_up_if_done = () => {
|
|
36
|
-
count_down -= 1;
|
|
37
|
-
if (count_down === 0) {
|
|
38
|
-
if (has_errors) {
|
|
39
|
-
on_error(_ei.dictionary_literal(errors));
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
on_success();
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
$.map(($, key) => {
|
|
47
|
-
$.__start(() => {
|
|
48
|
-
decrement_and_wrap_up_if_done();
|
|
49
|
-
}, (e) => {
|
|
50
|
-
has_errors = true;
|
|
51
|
-
errors[key] = e;
|
|
52
|
-
decrement_and_wrap_up_if_done();
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
};
|
|
58
|
-
exports.procedure_dictionary = procedure_dictionary;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sequence = void 0;
|
|
4
|
-
const create_procedure_promise_1 = require("../algorithms/procedure/create_procedure_promise");
|
|
5
|
-
const sequence = (steps) => {
|
|
6
|
-
return (0, create_procedure_promise_1.__create_procedure_promise)({
|
|
7
|
-
'execute': (on_success, on_error) => {
|
|
8
|
-
let current = 0;
|
|
9
|
-
const do_next = () => {
|
|
10
|
-
steps.__get_element_at(current).transform(($) => {
|
|
11
|
-
current += 1;
|
|
12
|
-
$.__start(() => {
|
|
13
|
-
do_next();
|
|
14
|
-
}, on_error);
|
|
15
|
-
}, () => {
|
|
16
|
-
on_success();
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
do_next();
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
exports.sequence = sequence;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import * as _et from 'exupery-core-types';
|
|
2
|
-
export type Three_Steps_Error<Step_1_Error, Step_2_Error, Step_3_Error> = ['step1', Step_1_Error] | ['step2', Step_2_Error] | ['step3', Step_3_Error];
|
|
3
|
-
export declare const three_steps: <Step_1_Error, Step_2_Error, Step_3_Error>(step_1: _et.Procedure_Promise<Step_1_Error>, step_2: _et.Procedure_Promise<Step_2_Error>, step_3: _et.Procedure_Promise<Step_3_Error>) => _et.Procedure_Promise<Three_Steps_Error<Step_1_Error, Step_2_Error, Step_3_Error>>;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.three_steps = void 0;
|
|
4
|
-
const create_procedure_promise_1 = require("../algorithms/procedure/create_procedure_promise");
|
|
5
|
-
const three_steps = (step_1, step_2, step_3) => {
|
|
6
|
-
return (0, create_procedure_promise_1.__create_procedure_promise)({
|
|
7
|
-
'execute': (on_success, on_error) => {
|
|
8
|
-
step_1.__start(() => {
|
|
9
|
-
step_2.__start(() => {
|
|
10
|
-
step_3.__start(on_success, (error) => {
|
|
11
|
-
on_error(['step3', error]);
|
|
12
|
-
});
|
|
13
|
-
}, (error) => {
|
|
14
|
-
on_error(['step2', error]);
|
|
15
|
-
});
|
|
16
|
-
}, (error) => {
|
|
17
|
-
on_error(['step1', error]);
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
exports.three_steps = three_steps;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import * as _et from 'exupery-core-types';
|
|
2
|
-
export type Two_Steps_Error<Step_1_Error, Step_2_Error> = ['step1', Step_1_Error] | ['step2', Step_2_Error];
|
|
3
|
-
export declare const two_steps: <Step_1_Error, Step_2_Error>(step_1: _et.Procedure_Promise<Step_1_Error>, step_2: _et.Procedure_Promise<Step_2_Error>) => _et.Procedure_Promise<Two_Steps_Error<Step_1_Error, Step_2_Error>>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.two_steps = void 0;
|
|
4
|
-
const create_procedure_promise_1 = require("../algorithms/procedure/create_procedure_promise");
|
|
5
|
-
const two_steps = (step_1, step_2) => {
|
|
6
|
-
return (0, create_procedure_promise_1.__create_procedure_promise)({
|
|
7
|
-
'execute': (on_success, on_error) => {
|
|
8
|
-
step_1.__start(() => {
|
|
9
|
-
step_2.__start(on_success, (error) => {
|
|
10
|
-
on_error(['step2', error]);
|
|
11
|
-
});
|
|
12
|
-
}, (error) => {
|
|
13
|
-
on_error(['step1', error]);
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
exports.two_steps = two_steps;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import * as _et from 'exupery-core-types';
|
|
2
|
-
import { Basic_Query_Promise } from '../types/Basic_Query';
|
|
3
|
-
export declare const query_dictionary: <Result, Error>($: _et.Dictionary<Basic_Query_Promise<Result, Error>>) => _et.Query_Promise<_et.Dictionary<Result>, _et.Dictionary<Error>>;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
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
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.query_dictionary = void 0;
|
|
27
|
-
const _ei = __importStar(require("exupery-core-internals"));
|
|
28
|
-
const create_query_promise_1 = require("../algorithms/query/create_query_promise");
|
|
29
|
-
const query_dictionary = ($) => {
|
|
30
|
-
return (0, create_query_promise_1.__create_query_promise)({
|
|
31
|
-
'execute': (on_success, on_error) => {
|
|
32
|
-
let count_down = $.__get_number_of_entries();
|
|
33
|
-
let has_errors = false;
|
|
34
|
-
const errors = {};
|
|
35
|
-
const results = {};
|
|
36
|
-
const decrement_and_wrap_up_if_done = () => {
|
|
37
|
-
count_down -= 1;
|
|
38
|
-
if (count_down === 0) {
|
|
39
|
-
if (has_errors) {
|
|
40
|
-
on_error(_ei.dictionary_literal(errors));
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
on_success(_ei.dictionary_literal(results));
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
$.map(($, key) => {
|
|
48
|
-
$.__start(($) => {
|
|
49
|
-
results[key] = $;
|
|
50
|
-
decrement_and_wrap_up_if_done();
|
|
51
|
-
}, ($) => {
|
|
52
|
-
has_errors = true;
|
|
53
|
-
errors[key] = $;
|
|
54
|
-
decrement_and_wrap_up_if_done();
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
};
|
|
60
|
-
exports.query_dictionary = query_dictionary;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.transform_query = void 0;
|
|
4
|
-
const create_query_promise_1 = require("../algorithms/query/create_query_promise");
|
|
5
|
-
const transform_query = (query, transform) => {
|
|
6
|
-
return (0, create_query_promise_1.__create_query_promise)({
|
|
7
|
-
'execute': (on_success, on_error) => {
|
|
8
|
-
query.__start(($) => {
|
|
9
|
-
on_success(transform($));
|
|
10
|
-
}, (e) => {
|
|
11
|
-
on_error(e);
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
};
|
|
16
|
-
exports.transform_query = transform_query;
|
package/dist/shorthands.d.ts
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import * as _et from 'exupery-core-types';
|
|
2
|
-
import { Basic_Query_Promise } from "./types/Basic_Query";
|
|
3
|
-
import { Error_Handler } from "./types/Error_Handler";
|
|
4
|
-
export declare namespace p {
|
|
5
|
-
/**
|
|
6
|
-
*
|
|
7
|
-
* @param action upi
|
|
8
|
-
* @param query u.q
|
|
9
|
-
*/
|
|
10
|
-
const action: <Error, Parameters, Resources>(action: _et.Procedure<Parameters, Error, Resources>, query: Basic_Query_Promise<Parameters, Error>, resources: Resources) => _et.Procedure_Promise<Error>;
|
|
11
|
-
/**
|
|
12
|
-
*
|
|
13
|
-
* @param steps up[]
|
|
14
|
-
* @returns
|
|
15
|
-
*/
|
|
16
|
-
const sequence: <Error>(steps: _et.Procedure_Promise<Error>[]) => _et.Procedure_Promise<Error>;
|
|
17
|
-
/**
|
|
18
|
-
*
|
|
19
|
-
* @param the_array up[]
|
|
20
|
-
* @param aggregate_errors gt
|
|
21
|
-
* @returns
|
|
22
|
-
*/
|
|
23
|
-
const array: <Error, Element_Error>(the_array: _et.Array<_et.Procedure_Promise<Element_Error>>, aggregate_errors: _et.Transformer_Without_Parameters<_et.Array<Element_Error>, Error>) => _et.Procedure_Promise<Error>;
|
|
24
|
-
/**
|
|
25
|
-
*
|
|
26
|
-
* @param the_dictionary dict<up>
|
|
27
|
-
* @param aggregate_errors gt
|
|
28
|
-
* @returns
|
|
29
|
-
*/
|
|
30
|
-
const dictionary: <Error, Element_Error>(the_dictionary: _et.Dictionary<_et.Procedure_Promise<Element_Error>>, aggregate_errors: _et.Transformer_Without_Parameters<_et.Dictionary<Element_Error>, Error>) => _et.Procedure_Promise<Error>;
|
|
31
|
-
}
|
|
32
|
-
export declare namespace q {
|
|
33
|
-
/**
|
|
34
|
-
*
|
|
35
|
-
* @param query_result qr
|
|
36
|
-
* @returns
|
|
37
|
-
*/
|
|
38
|
-
const fixed: <Query_Result, Error>(query_result: Query_Result) => Basic_Query_Promise<Query_Result, Error>;
|
|
39
|
-
/**
|
|
40
|
-
* query
|
|
41
|
-
* @param the_query uqi
|
|
42
|
-
* @param parameters u.q
|
|
43
|
-
* @param result_refinement ut
|
|
44
|
-
* @param error_transform gt
|
|
45
|
-
* @param error_handler eh
|
|
46
|
-
* @returns
|
|
47
|
-
*/
|
|
48
|
-
const u: <Result_After_Transformation, Error, Parameters, Query_Result, Query_Error, Resources>(the_query: _et.Query<Parameters, Query_Result, Query_Error, Resources>, parameters: Basic_Query_Promise<Parameters, Error>, resources: Resources, result_refinement: _et.Refiner_Without_Parameters<Query_Result, Result_After_Transformation, Error>, error_transform: _et.Transformer_Without_Parameters<Query_Error, Error>, error_handler?: Error_Handler<Query_Error>) => Basic_Query_Promise<Result_After_Transformation, Error>;
|
|
49
|
-
}
|
|
50
|
-
export declare namespace t {
|
|
51
|
-
/**
|
|
52
|
-
*
|
|
53
|
-
* @param the_refinement ut
|
|
54
|
-
* @param error_transform gt
|
|
55
|
-
* @param error_handler eh
|
|
56
|
-
* @returns
|
|
57
|
-
*/
|
|
58
|
-
const u: <In, Out, Error, Transformation_Error>(the_refinement: _et.Refiner_Without_Parameters<In, Out, Transformation_Error>, error_transform: _et.Transformer_Without_Parameters<Transformation_Error, Error>, error_handler?: Error_Handler<Transformation_Error>) => _et.Refiner_Without_Parameters<In, Out, Error>;
|
|
59
|
-
/**
|
|
60
|
-
*
|
|
61
|
-
* @param the_transformation gt
|
|
62
|
-
*/
|
|
63
|
-
const g: <In, Out, Error>(the_transformation: _et.Transformer_Without_Parameters<In, Out>) => _et.Refiner_Without_Parameters<In, Out, Error>;
|
|
64
|
-
}
|