exupery-core-async 0.3.24 → 0.3.26
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/procedure/create_procedure_primed_with_resources.js +22 -0
- 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,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
|
-
}
|
package/dist/shorthands.js
DELETED
|
@@ -1,204 +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.t = exports.q = exports.p = void 0;
|
|
27
|
-
const _ei = __importStar(require("exupery-core-internals"));
|
|
28
|
-
const create_procedure_promise_1 = require("./algorithms/procedure/create_procedure_promise");
|
|
29
|
-
const create_asynchronous_processes_monitor_1 = require("./create_asynchronous_processes_monitor");
|
|
30
|
-
var p;
|
|
31
|
-
(function (p) {
|
|
32
|
-
/**
|
|
33
|
-
*
|
|
34
|
-
* @param action upi
|
|
35
|
-
* @param query u.q
|
|
36
|
-
*/
|
|
37
|
-
p.action = (action, query, resources) => {
|
|
38
|
-
return (0, create_procedure_promise_1.__create_procedure_promise)({
|
|
39
|
-
'execute': (on_success, on_error) => {
|
|
40
|
-
//run the query
|
|
41
|
-
query.__start((query_result) => {
|
|
42
|
-
//run the action
|
|
43
|
-
action(resources)['execute with synchronous data'](query_result).__start(on_success, (error) => {
|
|
44
|
-
//transform the error
|
|
45
|
-
on_error(error);
|
|
46
|
-
});
|
|
47
|
-
}, on_error);
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
*
|
|
53
|
-
* @param steps up[]
|
|
54
|
-
* @returns
|
|
55
|
-
*/
|
|
56
|
-
p.sequence = (steps) => {
|
|
57
|
-
return (0, create_procedure_promise_1.__create_procedure_promise)({
|
|
58
|
-
'execute': (on_success, on_error) => {
|
|
59
|
-
const length = _ei.array_literal(steps).__get_number_of_elements();
|
|
60
|
-
const runStep = (index) => {
|
|
61
|
-
if (index >= length) {
|
|
62
|
-
on_success();
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
steps[index].__start(() => runStep(index + 1), on_error);
|
|
66
|
-
};
|
|
67
|
-
runStep(0);
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
*
|
|
73
|
-
* @param the_array up[]
|
|
74
|
-
* @param aggregate_errors gt
|
|
75
|
-
* @returns
|
|
76
|
-
*/
|
|
77
|
-
p.array = (the_array, aggregate_errors) => {
|
|
78
|
-
return (0, create_procedure_promise_1.__create_procedure_promise)({
|
|
79
|
-
'execute': (on_success, on_error) => {
|
|
80
|
-
const errors = [];
|
|
81
|
-
(0, create_asynchronous_processes_monitor_1.create_asynchronous_processes_monitor)((monitor) => {
|
|
82
|
-
the_array.map(($) => {
|
|
83
|
-
monitor['report process started']();
|
|
84
|
-
$.__start(() => {
|
|
85
|
-
monitor['report process finished']();
|
|
86
|
-
}, (e) => {
|
|
87
|
-
errors.push(e);
|
|
88
|
-
monitor['report process finished']();
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
}, () => {
|
|
92
|
-
if (errors.length === 0) {
|
|
93
|
-
on_success();
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
on_error(aggregate_errors(_ei.array_literal(errors)));
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
};
|
|
102
|
-
/**
|
|
103
|
-
*
|
|
104
|
-
* @param the_dictionary dict<up>
|
|
105
|
-
* @param aggregate_errors gt
|
|
106
|
-
* @returns
|
|
107
|
-
*/
|
|
108
|
-
p.dictionary = (the_dictionary, aggregate_errors) => {
|
|
109
|
-
return (0, create_procedure_promise_1.__create_procedure_promise)({
|
|
110
|
-
'execute': (on_success, on_error) => {
|
|
111
|
-
const errors = {};
|
|
112
|
-
(0, create_asynchronous_processes_monitor_1.create_asynchronous_processes_monitor)((monitor) => {
|
|
113
|
-
the_dictionary.map(($, key) => {
|
|
114
|
-
monitor['report process started']();
|
|
115
|
-
$.__start(() => {
|
|
116
|
-
monitor['report process finished']();
|
|
117
|
-
}, (e) => {
|
|
118
|
-
errors[key] = e;
|
|
119
|
-
monitor['report process finished']();
|
|
120
|
-
});
|
|
121
|
-
});
|
|
122
|
-
}, () => {
|
|
123
|
-
if (Object.keys(errors).length === 0) {
|
|
124
|
-
on_success();
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
on_error(aggregate_errors(_ei.dictionary_literal(errors)));
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
};
|
|
133
|
-
})(p || (exports.p = p = {}));
|
|
134
|
-
var q;
|
|
135
|
-
(function (q) {
|
|
136
|
-
/**
|
|
137
|
-
*
|
|
138
|
-
* @param query_result qr
|
|
139
|
-
* @returns
|
|
140
|
-
*/
|
|
141
|
-
q.fixed = (query_result) => {
|
|
142
|
-
return {
|
|
143
|
-
__start: (on_success, on_error) => {
|
|
144
|
-
on_success(query_result);
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
};
|
|
148
|
-
/**
|
|
149
|
-
* query
|
|
150
|
-
* @param the_query uqi
|
|
151
|
-
* @param parameters u.q
|
|
152
|
-
* @param result_refinement ut
|
|
153
|
-
* @param error_transform gt
|
|
154
|
-
* @param error_handler eh
|
|
155
|
-
* @returns
|
|
156
|
-
*/
|
|
157
|
-
q.u = (the_query, parameters, resources, result_refinement, error_transform, error_handler) => {
|
|
158
|
-
return {
|
|
159
|
-
__start: (on_success, on_error) => {
|
|
160
|
-
parameters.__start((qr_in) => {
|
|
161
|
-
the_query(resources).execute(qr_in).__start((result) => {
|
|
162
|
-
result_refinement(result).process((x) => on_success(x), on_error);
|
|
163
|
-
}, (error) => {
|
|
164
|
-
if (error_handler !== undefined) {
|
|
165
|
-
error_handler(error);
|
|
166
|
-
}
|
|
167
|
-
on_error(error_transform(error));
|
|
168
|
-
});
|
|
169
|
-
}, on_error);
|
|
170
|
-
}
|
|
171
|
-
};
|
|
172
|
-
};
|
|
173
|
-
})(q || (exports.q = q = {}));
|
|
174
|
-
var t;
|
|
175
|
-
(function (t) {
|
|
176
|
-
/**
|
|
177
|
-
*
|
|
178
|
-
* @param the_refinement ut
|
|
179
|
-
* @param error_transform gt
|
|
180
|
-
* @param error_handler eh
|
|
181
|
-
* @returns
|
|
182
|
-
*/
|
|
183
|
-
t.u = (the_refinement, error_transform, error_handler) => {
|
|
184
|
-
return ($) => {
|
|
185
|
-
const result = the_refinement($);
|
|
186
|
-
return result.map((out) => out, (transformation_error) => {
|
|
187
|
-
//run the error handler
|
|
188
|
-
if (error_handler !== undefined) {
|
|
189
|
-
error_handler(transformation_error);
|
|
190
|
-
}
|
|
191
|
-
return error_transform(transformation_error);
|
|
192
|
-
});
|
|
193
|
-
};
|
|
194
|
-
};
|
|
195
|
-
/**
|
|
196
|
-
*
|
|
197
|
-
* @param the_transformation gt
|
|
198
|
-
*/
|
|
199
|
-
t.g = (the_transformation) => {
|
|
200
|
-
return ($) => {
|
|
201
|
-
return _ei.refinement.successful(the_transformation($));
|
|
202
|
-
};
|
|
203
|
-
};
|
|
204
|
-
})(t || (exports.t = t = {}));
|