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
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)(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 = {}));
|