exupery-core-async 0.1.34 → 0.1.35

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 CHANGED
@@ -1,7 +1,9 @@
1
1
  export * from "./procedure/Guaranteed_Procedure_Context";
2
2
  export * from "./procedure/Unguaranteed_Procedure_Context";
3
- export * from "./query/Guaranteed_Query_Result";
3
+ export * from "./query/Guaranteed_Query";
4
4
  export * from "./query/Unguaranteed_Query_Result";
5
+ export * from "./query/Guaranteed_Query_Result";
6
+ export * from "./query/Unguaranteed_Query";
5
7
  export * from "./query/merge_2_guaranteed_query_results";
6
8
  export * from "./query/run_guaranteed_query";
7
9
  export * from "./query/run_unguaranteed_query";
package/dist/index.js CHANGED
@@ -15,10 +15,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.command = exports.query = void 0;
18
+ //types
18
19
  __exportStar(require("./procedure/Guaranteed_Procedure_Context"), exports);
19
20
  __exportStar(require("./procedure/Unguaranteed_Procedure_Context"), exports);
20
- __exportStar(require("./query/Guaranteed_Query_Result"), exports);
21
+ __exportStar(require("./query/Guaranteed_Query"), exports);
21
22
  __exportStar(require("./query/Unguaranteed_Query_Result"), exports);
23
+ __exportStar(require("./query/Guaranteed_Query_Result"), exports);
24
+ __exportStar(require("./query/Unguaranteed_Query"), exports);
25
+ //functions
22
26
  __exportStar(require("./query/merge_2_guaranteed_query_results"), exports);
23
27
  __exportStar(require("./query/run_guaranteed_query"), exports);
24
28
  __exportStar(require("./query/run_unguaranteed_query"), exports);
@@ -24,13 +24,13 @@ export interface Unguaranteed_Procedure_Context<E> {
24
24
  * first, the exception handler will be called, to report the exception.
25
25
  * secondly, the exception will be mapped into a new exception value that has the same type as the command's exception type.
26
26
  */
27
- process_unguaranteed_data<Params, Query_Result, New_Exception>(get_action: () => Unguaranteed_Action<Params, E>, get_data: () => Unguaranteed_Query_Result<Query_Result, New_Exception>, handle_exception: ($i: Guaranteed_Procedure_Context, $: New_Exception) => Guaranteed_Procedure_Context, map_exception: ($: New_Exception) => E, get_parameters: ($: Query_Result) => Params): Unguaranteed_Procedure_Context<E>;
28
- process_guaranteed_data<Params, Query_Result>(get_action: () => Unguaranteed_Action<Params, E>, get_data: () => Guaranteed_Query_Result<Query_Result>, get_parameters: ($: Query_Result) => Params): Unguaranteed_Procedure_Context<E>;
27
+ process_unguaranteed_data<Params, Query_Result, New_Exception>(action: Unguaranteed_Action<Params, E>, get_data: () => Unguaranteed_Query_Result<Query_Result, New_Exception>, handle_exception: ($i: Guaranteed_Procedure_Context, $: New_Exception) => Guaranteed_Procedure_Context, map_exception: ($: New_Exception) => E, get_parameters: ($: Query_Result) => Params): Unguaranteed_Procedure_Context<E>;
28
+ process_guaranteed_data<Params, Query_Result>(action: Unguaranteed_Action<Params, E>, get_data: () => Guaranteed_Query_Result<Query_Result>, get_parameters: ($: Query_Result) => Params): Unguaranteed_Procedure_Context<E>;
29
29
  throw_exception<E>($: E): Unguaranteed_Procedure_Context<E>;
30
30
  catch(handle_exception: ($i: Guaranteed_Procedure_Context, $: E) => Guaranteed_Procedure_Context): Guaranteed_Procedure_Context;
31
- execute_unguaranteed<Params>(get_action: () => Unguaranteed_Action<Params, E>, get_parameters: () => Params): Unguaranteed_Procedure_Context<E>;
32
- execute_foreign<Params, NE>(get_action: () => Unguaranteed_Action<Params, NE>, get_parameters: () => Params, handle_exception: ($i: Guaranteed_Procedure_Context, $: NE) => Guaranteed_Procedure_Context, map: ($: NE) => E): Unguaranteed_Procedure_Context<E>;
33
- execute<Params>(get_action: () => Guaranteed_Action<Params>, get_parameters: () => Params): Unguaranteed_Procedure_Context<E>;
31
+ execute_unguaranteed<Params>(action: Unguaranteed_Action<Params, E>, get_parameters: () => Params): Unguaranteed_Procedure_Context<E>;
32
+ execute_foreign<Params, NE>(action: Unguaranteed_Action<Params, NE>, get_parameters: () => Params, handle_exception: ($i: Guaranteed_Procedure_Context, $: NE) => Guaranteed_Procedure_Context, map: ($: NE) => E): Unguaranteed_Procedure_Context<E>;
33
+ execute<Params>(action: Guaranteed_Action<Params>, get_parameters: () => Params): Unguaranteed_Procedure_Context<E>;
34
34
  execute_dictionary_unguaranteed<E2>($: _et.Dictionary<Unguaranteed_Procedure_Context<E2>>, aggregate_exceptions: ($: _et.Dictionary<E2>) => E): Unguaranteed_Procedure_Context<E>;
35
35
  execute_multiple_unguaranteed<E2>($: _et.Array<Unguaranteed_Procedure_Context<E2>>, aggregate_exceptions: ($: _et.Array<E2>) => E): Unguaranteed_Procedure_Context<E>;
36
36
  __start(on_success: () => void, on_exception: ($: E) => void): void;
@@ -32,12 +32,11 @@ class Unguaranteed_Command_Result_Class {
32
32
  constructor(executer) {
33
33
  this.executer = executer;
34
34
  }
35
- process_guaranteed_data(get_action, get_data, get_parameters) {
35
+ process_guaranteed_data(action, get_data, get_parameters) {
36
36
  return __execute_unguaranteed_action({
37
37
  'execute': (on_success, on_exception) => {
38
38
  this.executer.execute(() => {
39
39
  get_data().__start((value) => {
40
- const action = get_action();
41
40
  const params = get_parameters(value);
42
41
  action(params).__start(on_success, on_exception);
43
42
  });
@@ -46,13 +45,12 @@ class Unguaranteed_Command_Result_Class {
46
45
  }
47
46
  });
48
47
  }
49
- process_unguaranteed_data(get_action, get_data, handle_exception, map_exception, get_parameters) {
48
+ process_unguaranteed_data(action, get_data, handle_exception, map_exception, get_parameters) {
50
49
  return __execute_unguaranteed_action({
51
50
  'execute': (on_success, on_exception) => {
52
51
  this.executer.execute(() => {
53
52
  get_data().__start((value) => {
54
53
  //the data was successfully retrieved
55
- const action = get_action();
56
54
  const params = get_parameters(value);
57
55
  action(params).__start(on_success, on_exception);
58
56
  }, (exception) => {
@@ -91,24 +89,20 @@ class Unguaranteed_Command_Result_Class {
91
89
  }
92
90
  });
93
91
  }
94
- execute_unguaranteed(get_action, get_parameters) {
92
+ execute_unguaranteed(action, get_parameters) {
95
93
  return new Unguaranteed_Command_Result_Class({
96
94
  'execute': (new_on_success, new_on_exception) => {
97
95
  this.executer.execute(() => {
98
- const action = get_action();
99
- const params = get_parameters();
100
- action(params).__start(new_on_success, new_on_exception);
96
+ action(get_parameters()).__start(new_on_success, new_on_exception);
101
97
  }, new_on_exception);
102
98
  }
103
99
  });
104
100
  }
105
- execute_foreign(get_action, get_parameters, handle_exception, map_exception) {
101
+ execute_foreign(action, get_parameters, handle_exception, map_exception) {
106
102
  return new Unguaranteed_Command_Result_Class({
107
103
  'execute': (new_on_success, new_on_exception) => {
108
104
  this.executer.execute(() => {
109
- const action = get_action();
110
- const params = get_parameters();
111
- action(params).__start(new_on_success, ($) => {
105
+ action(get_parameters()).__start(new_on_success, ($) => {
112
106
  handle_exception((0, initialize_guaranteed_procedure_context_1.initialize_guaranteed_procedure_context)(), $).__start(() => {
113
107
  new_on_exception(map_exception($));
114
108
  });
@@ -117,13 +111,11 @@ class Unguaranteed_Command_Result_Class {
117
111
  }
118
112
  });
119
113
  }
120
- execute(get_action, get_parameters) {
114
+ execute(action, get_parameters) {
121
115
  return new Unguaranteed_Command_Result_Class({
122
116
  'execute': (new_on_success, new_on_exception) => {
123
117
  this.executer.execute(() => {
124
- const action = get_action();
125
- const params = get_parameters();
126
- action(params).__start(new_on_success);
118
+ action(get_parameters()).__start(new_on_success);
127
119
  }, new_on_exception);
128
120
  }
129
121
  });
@@ -0,0 +1,2 @@
1
+ import { Guaranteed_Query_Result } from "./Guaranteed_Query_Result";
2
+ export type Guaranteed_Query<Parameters, Result> = ($: Parameters) => Guaranteed_Query_Result<Result>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ import { Unguaranteed_Query_Result } from "./Unguaranteed_Query_Result";
2
+ export type Unguaranteed_Query<Parameters, Result, Error> = ($: Parameters) => Unguaranteed_Query_Result<Result, Error>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "exupery-core-async",
3
- "version": "0.1.34",
3
+ "version": "0.1.35",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Corno",
6
6
  "description": "async types for Exupery",