pareto-core 0.1.253 → 0.1.254

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.
Files changed (139) hide show
  1. package/dist/implementation/__internal/async/asynchronous_dictionary_builder.d.ts +6 -0
  2. package/dist/implementation/__internal/async/asynchronous_dictionary_builder.js +15 -0
  3. package/dist/implementation/__internal/async/asynchronous_list_builder.d.ts +7 -0
  4. package/dist/implementation/__internal/async/asynchronous_list_builder.js +17 -0
  5. package/dist/implementation/__internal/async/create_asynchronous_processes_monitor.d.ts +18 -0
  6. package/dist/implementation/__internal/async/create_asynchronous_processes_monitor.js +50 -0
  7. package/dist/implementation/__internal/command/Command_Block.d.ts +3 -0
  8. package/dist/implementation/__internal/command/Command_Block.js +3 -0
  9. package/dist/implementation/__internal/command/command.d.ts +10 -0
  10. package/dist/implementation/__internal/command/command.js +21 -0
  11. package/dist/implementation/__internal/command/command_action.d.ts +4 -0
  12. package/dist/implementation/__internal/command/command_action.js +16 -0
  13. package/dist/implementation/__internal/command/command_promise.d.ts +18 -0
  14. package/dist/implementation/__internal/command/command_promise.js +19 -0
  15. package/dist/implementation/__internal/command/command_statements.d.ts +17 -0
  16. package/dist/implementation/__internal/command/command_statements.js +131 -0
  17. package/dist/implementation/__internal/command/decide.d.ts +13 -0
  18. package/dist/implementation/__internal/command/decide.js +28 -0
  19. package/dist/implementation/__internal/command/handle_command_block.d.ts +4 -0
  20. package/dist/implementation/__internal/command/handle_command_block.js +22 -0
  21. package/dist/implementation/__internal/query/Super_Query_Result_.d.ts +1 -0
  22. package/dist/implementation/__internal/query/Super_Query_Result_.js +24 -0
  23. package/dist/implementation/__internal/query/decide.d.ts +12 -0
  24. package/dist/implementation/__internal/query/decide.js +21 -0
  25. package/dist/implementation/__internal/query/query.d.ts +7 -0
  26. package/dist/implementation/__internal/query/query.js +15 -0
  27. package/dist/implementation/__internal/query/query_action.d.ts +4 -0
  28. package/dist/implementation/__internal/query/query_action.js +12 -0
  29. package/dist/implementation/__internal/query/query_expressions.d.ts +16 -0
  30. package/dist/implementation/__internal/query/query_expressions.js +72 -0
  31. package/dist/implementation/__internal/query/query_result.d.ts +11 -0
  32. package/dist/implementation/__internal/query/query_result.js +11 -0
  33. package/dist/implementation/__internal/refiner/from.d.ts +30 -0
  34. package/dist/implementation/__internal/refiner/from.js +178 -0
  35. package/dist/implementation/__internal/sync/create_refinement_context.d.ts +7 -0
  36. package/dist/implementation/__internal/sync/create_refinement_context.js +36 -0
  37. package/dist/implementation/__internal/sync/data_switch.d.ts +37 -0
  38. package/dist/implementation/__internal/sync/data_switch.js +43 -0
  39. package/dist/implementation/__internal/sync/literal.d.ts +19 -0
  40. package/dist/implementation/__internal/sync/literal.js +70 -0
  41. package/dist/implementation/__internal/sync/primitives/Dictionary.d.ts +9 -0
  42. package/dist/implementation/__internal/sync/primitives/Dictionary.js +11 -0
  43. package/dist/implementation/__internal/sync/primitives/List.d.ts +13 -0
  44. package/dist/implementation/__internal/sync/primitives/List.js +25 -0
  45. package/dist/implementation/__internal/sync/primitives/Optional.d.ts +12 -0
  46. package/dist/implementation/__internal/sync/primitives/Optional.js +20 -0
  47. package/dist/implementation/__internal/transformer/from.d.ts +79 -0
  48. package/dist/implementation/__internal/transformer/from.js +429 -0
  49. package/dist/implementation/command/specials/variables.d.ts +1 -0
  50. package/dist/implementation/command/specials/variables.js +4 -0
  51. package/dist/implementation/command.d.ts +7 -0
  52. package/dist/implementation/command.js +8 -0
  53. package/dist/implementation/query/specials/variables.d.ts +1 -0
  54. package/dist/implementation/query/specials/variables.js +4 -0
  55. package/dist/implementation/query/super_query_result.d.ts +22 -0
  56. package/dist/implementation/query/super_query_result.js +46 -0
  57. package/dist/implementation/query.d.ts +8 -0
  58. package/dist/implementation/query.js +9 -0
  59. package/dist/implementation/refiner/specials/assert.d.ts +9 -0
  60. package/dist/implementation/refiner/specials/assert.js +15 -0
  61. package/dist/implementation/refiner/specials/change_context.d.ts +17 -0
  62. package/dist/implementation/refiner/specials/change_context.js +20 -0
  63. package/dist/implementation/refiner/specials/iterate.d.ts +9 -0
  64. package/dist/implementation/refiner/specials/iterate.js +108 -0
  65. package/dist/implementation/refiner/specials/list_build_deprecated.d.ts +7 -0
  66. package/dist/implementation/refiner/specials/list_build_deprecated.js +15 -0
  67. package/dist/implementation/refiner/specials/list_from_text.d.ts +2 -0
  68. package/dist/implementation/refiner/specials/list_from_text.js +10 -0
  69. package/dist/implementation/refiner/specials/lookup.d.ts +13 -0
  70. package/dist/implementation/refiner/specials/lookup.js +64 -0
  71. package/dist/implementation/refiner/specials/variables.d.ts +1 -0
  72. package/dist/implementation/refiner/specials/variables.js +4 -0
  73. package/dist/implementation/refiner.d.ts +3 -0
  74. package/dist/implementation/refiner.js +4 -0
  75. package/dist/implementation/resource.d.ts +6 -0
  76. package/dist/implementation/resource.js +23 -0
  77. package/dist/implementation/transformer/specials/lookup.d.ts +13 -0
  78. package/dist/implementation/transformer/specials/lookup.js +44 -0
  79. package/dist/implementation/transformer/specials/text_from_list.d.ts +2 -0
  80. package/dist/implementation/transformer/specials/text_from_list.js +12 -0
  81. package/dist/implementation/transformer/specials/unreachable_code_path.d.ts +6 -0
  82. package/dist/implementation/transformer/specials/unreachable_code_path.js +11 -0
  83. package/dist/implementation/transformer/specials/variables.d.ts +1 -0
  84. package/dist/implementation/transformer/specials/variables.js +4 -0
  85. package/dist/implementation/transformer.d.ts +3 -0
  86. package/dist/implementation/transformer.js +4 -0
  87. package/dist/interface/__internal/Abort.d.ts +2 -0
  88. package/dist/interface/__internal/Abort.js +2 -0
  89. package/dist/interface/__internal/Raw_Optional_Value.d.ts +1 -0
  90. package/dist/interface/__internal/Raw_Optional_Value.js +2 -0
  91. package/dist/interface/__internal/command/Command.d.ts +8 -0
  92. package/dist/interface/__internal/command/Command.js +4 -0
  93. package/dist/interface/__internal/command/Command_Action.d.ts +6 -0
  94. package/dist/interface/__internal/command/Command_Action.js +4 -0
  95. package/dist/interface/__internal/command/Command_Promise.d.ts +4 -0
  96. package/dist/interface/__internal/command/Command_Promise.js +2 -0
  97. package/dist/interface/__internal/command/Iterator.d.ts +19 -0
  98. package/dist/interface/__internal/command/Iterator.js +3 -0
  99. package/dist/interface/__internal/data/Circular_Dependency.d.ts +9 -0
  100. package/dist/interface/__internal/data/Circular_Dependency.js +2 -0
  101. package/dist/interface/__internal/data/Dictionary.d.ts +9 -0
  102. package/dist/interface/__internal/data/Dictionary.js +2 -0
  103. package/dist/interface/__internal/data/List.d.ts +15 -0
  104. package/dist/interface/__internal/data/List.js +4 -0
  105. package/dist/interface/__internal/data/Optional_Value.d.ts +12 -0
  106. package/dist/interface/__internal/data/Optional_Value.js +3 -0
  107. package/dist/interface/__internal/data/Value.d.ts +9 -0
  108. package/dist/interface/__internal/data/Value.js +5 -0
  109. package/dist/interface/__internal/query/List.d.ts +15 -0
  110. package/dist/interface/__internal/query/List.js +4 -0
  111. package/dist/interface/__internal/query/Optional_Value.d.ts +12 -0
  112. package/dist/interface/__internal/query/Optional_Value.js +3 -0
  113. package/dist/interface/__internal/query/Query.d.ts +5 -0
  114. package/dist/interface/__internal/query/Query.js +3 -0
  115. package/dist/interface/__internal/query/Query_Action.d.ts +4 -0
  116. package/dist/interface/__internal/query/Query_Action.js +4 -0
  117. package/dist/interface/__internal/query/Query_Result.d.ts +4 -0
  118. package/dist/interface/__internal/query/Query_Result.js +2 -0
  119. package/dist/interface/__internal/refiner/Iterator.d.ts +19 -0
  120. package/dist/interface/__internal/refiner/Iterator.js +3 -0
  121. package/dist/interface/command.d.ts +1 -0
  122. package/dist/interface/command.js +2 -0
  123. package/dist/interface/command_action.d.ts +1 -0
  124. package/dist/interface/command_action.js +2 -0
  125. package/dist/interface/data.d.ts +5 -0
  126. package/dist/interface/data.js +6 -0
  127. package/dist/interface/query.d.ts +2 -0
  128. package/dist/interface/query.js +3 -0
  129. package/dist/interface/query_action.d.ts +1 -0
  130. package/dist/interface/query_action.js +2 -0
  131. package/dist/interface/refiner.d.ts +42 -0
  132. package/dist/interface/refiner.js +5 -0
  133. package/dist/interface/resource.d.ts +12 -0
  134. package/dist/interface/resource.js +3 -0
  135. package/dist/interface/transformer.d.ts +28 -0
  136. package/dist/interface/transformer.js +2 -0
  137. package/dist/temp/Generic_Dictionary.d.ts +12 -0
  138. package/dist/temp/Generic_Dictionary.js +18 -0
  139. package/package.json +1 -1
@@ -0,0 +1,6 @@
1
+ import * as p_di from "../../../interface/data.js";
2
+ export type Asynchronous_Dictionary_Builder<Entry extends p_di.Value> = {
3
+ 'add entry': (id: string, entry: Entry) => undefined;
4
+ 'get dictionary': () => p_di.Dictionary<Entry>;
5
+ };
6
+ export default function create_asynchronous_dictionary_builder<Entry extends p_di.Value>(): Asynchronous_Dictionary_Builder<Entry>;
@@ -0,0 +1,15 @@
1
+ import * as p_di from "../../../interface/data.js";
2
+ import * as lit from "../sync/literal.js";
3
+ export default function create_asynchronous_dictionary_builder() {
4
+ const entries = {};
5
+ return {
6
+ 'add entry': (id, entry) => {
7
+ entries[id] = entry;
8
+ },
9
+ 'get dictionary': () => {
10
+ return lit.dictionary(entries);
11
+ // return new Dictionary_Class()
12
+ },
13
+ };
14
+ }
15
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXN5bmNocm9ub3VzX2RpY3Rpb25hcnlfYnVpbGRlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9pbXBsZW1lbnRhdGlvbi9fX2ludGVybmFsL2FzeW5jL2FzeW5jaHJvbm91c19kaWN0aW9uYXJ5X2J1aWxkZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLElBQUksTUFBTSw0QkFBNEIsQ0FBQTtBQUNsRCxPQUFPLEtBQUssR0FBRyxNQUFNLG9CQUFvQixDQUFBO0FBTXpDLE1BQU0sQ0FBQyxPQUFPLFVBQVUsc0NBQXNDO0lBQzFELE1BQU0sT0FBTyxHQUE0QixFQUFFLENBQUE7SUFFM0MsT0FBTztRQUNILFdBQVcsRUFBRSxDQUFDLEVBQVUsRUFBRSxLQUFZLEVBQUUsRUFBRTtZQUN0QyxPQUFPLENBQUMsRUFBRSxDQUFDLEdBQUcsS0FBSyxDQUFBO1FBQ3ZCLENBQUM7UUFFRCxnQkFBZ0IsRUFBRSxHQUFHLEVBQUU7WUFDbkIsT0FBTyxHQUFHLENBQUMsVUFBVSxDQUFDLE9BQU8sQ0FBQyxDQUFBO1lBRTlCLGdDQUFnQztRQUNwQyxDQUFDO0tBQ0osQ0FBQTtBQUNMLENBQUMifQ==
@@ -0,0 +1,7 @@
1
+ import * as p_di from "../../../interface/data.js";
2
+ export type Asynchronous_List_Builder<Item extends p_di.Value> = {
3
+ 'add item': (item: Item) => undefined;
4
+ 'add list': (list: p_di.List<Item>) => undefined;
5
+ 'get list': () => p_di.List<Item>;
6
+ };
7
+ export default function create_asynchronous_list_builder<Item extends p_di.Value>(): Asynchronous_List_Builder<Item>;
@@ -0,0 +1,17 @@
1
+ import * as p_di from "../../../interface/data.js";
2
+ import { List_Class } from "../sync/primitives/List.js";
3
+ export default function create_asynchronous_list_builder() {
4
+ const items = [];
5
+ return {
6
+ 'add item': (item) => {
7
+ items.push(item);
8
+ },
9
+ 'add list': (list) => {
10
+ items.push(...list.__get_raw());
11
+ },
12
+ 'get list': () => {
13
+ return new List_Class(items);
14
+ },
15
+ };
16
+ }
17
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXN5bmNocm9ub3VzX2xpc3RfYnVpbGRlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9pbXBsZW1lbnRhdGlvbi9fX2ludGVybmFsL2FzeW5jL2FzeW5jaHJvbm91c19saXN0X2J1aWxkZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLElBQUksTUFBTSw0QkFBNEIsQ0FBQTtBQUNsRCxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sNEJBQTRCLENBQUE7QUFXdkQsTUFBTSxDQUFDLE9BQU8sVUFBVSxnQ0FBZ0M7SUFHcEQsTUFBTSxLQUFLLEdBQVcsRUFBRSxDQUFBO0lBRXhCLE9BQU87UUFDSCxVQUFVLEVBQUUsQ0FBQyxJQUFVLEVBQUUsRUFBRTtZQUN2QixLQUFLLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFBO1FBQ3BCLENBQUM7UUFDRCxVQUFVLEVBQUUsQ0FBQyxJQUFxQixFQUFFLEVBQUU7WUFDbEMsS0FBSyxDQUFDLElBQUksQ0FBQyxHQUFHLElBQUksQ0FBQyxTQUFTLEVBQUUsQ0FBQyxDQUFBO1FBQ25DLENBQUM7UUFFRCxVQUFVLEVBQUUsR0FBRyxFQUFFO1lBQ2IsT0FBTyxJQUFJLFVBQVUsQ0FBQyxLQUFLLENBQUMsQ0FBQTtRQUNoQyxDQUFDO0tBQ0osQ0FBQTtBQUNMLENBQUMifQ==
@@ -0,0 +1,18 @@
1
+ export type I_Async_Monitor = {
2
+ readonly report_process_started: () => undefined;
3
+ readonly report_process_finished: () => undefined;
4
+ };
5
+ /**
6
+ * this function helps in keeping track of ongoing async operations
7
+ * async operations are registered and when finished reported as such.
8
+ * when all ongoing operations are finished the onEnd callback is called
9
+ *
10
+ * this function is specifically useful for async map functions
11
+ *
12
+ * @param callback this callback creates a scope within which the counter is provided
13
+ * @param onEnd this callback will be called when all ongoing operations are finished
14
+ */
15
+ export default function create_asynchronous_processes_monitor(parameters: {
16
+ monitoring_phase: ($: I_Async_Monitor) => undefined;
17
+ on_all_finished: () => undefined;
18
+ }): undefined;
@@ -0,0 +1,50 @@
1
+ /**
2
+ * this function helps in keeping track of ongoing async operations
3
+ * async operations are registered and when finished reported as such.
4
+ * when all ongoing operations are finished the onEnd callback is called
5
+ *
6
+ * this function is specifically useful for async map functions
7
+ *
8
+ * @param callback this callback creates a scope within which the counter is provided
9
+ * @param onEnd this callback will be called when all ongoing operations are finished
10
+ */
11
+ export default function create_asynchronous_processes_monitor(parameters) {
12
+ let running_processes_counter = 0;
13
+ /*
14
+ * we need to keep track of if the registration phase is ended or not.
15
+ * it can happen that the counter reaches 0 during the registration phase, specifically if there is no real async calls being made
16
+ * in that case the counter is already called during the registration phase.
17
+ * If that happens there should not yet be a call to onEnd().
18
+ */
19
+ let registration_phase_ended = false;
20
+ let on_all_finished_has_been_called = false;
21
+ function checkStatus() {
22
+ if (registration_phase_ended) {
23
+ if (running_processes_counter === 0) {
24
+ if (on_all_finished_has_been_called === true) {
25
+ throw new Error("CORE: already ended");
26
+ }
27
+ on_all_finished_has_been_called = true;
28
+ parameters.on_all_finished();
29
+ }
30
+ }
31
+ }
32
+ parameters.monitoring_phase({
33
+ 'report_process_started': () => {
34
+ if (on_all_finished_has_been_called) {
35
+ throw new Error("CORE: async call done after context is ready");
36
+ }
37
+ running_processes_counter += 1;
38
+ },
39
+ 'report_process_finished': () => {
40
+ if (running_processes_counter === 0) {
41
+ throw new Error("CORE: decrement while counter is 0");
42
+ }
43
+ running_processes_counter -= 1;
44
+ checkStatus();
45
+ },
46
+ });
47
+ registration_phase_ended = true;
48
+ checkStatus();
49
+ }
50
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3JlYXRlX2FzeW5jaHJvbm91c19wcm9jZXNzZXNfbW9uaXRvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9pbXBsZW1lbnRhdGlvbi9fX2ludGVybmFsL2FzeW5jL2NyZWF0ZV9hc3luY2hyb25vdXNfcHJvY2Vzc2VzX21vbml0b3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBTUE7Ozs7Ozs7OztHQVNHO0FBQ0gsTUFBTSxDQUFDLE9BQU8sV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BQUksQ0FBQTtJQUMvQixXQUFXLEVBQUUsQ0FBQTtBQUNqQixDQUFDIn0=
@@ -0,0 +1,3 @@
1
+ import * as p_di from "../../../interface/data.js";
2
+ import { type Command_Promise } from "../../../interface/__internal/command/Command_Promise.js";
3
+ export type Command_Block<Error extends p_di.Value> = Command_Promise<Error>[];
@@ -0,0 +1,3 @@
1
+ import * as p_di from "../../../interface/data.js";
2
+ import {} from "../../../interface/__internal/command/Command_Promise.js";
3
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQ29tbWFuZF9CbG9jay5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9pbXBsZW1lbnRhdGlvbi9fX2ludGVybmFsL2NvbW1hbmQvQ29tbWFuZF9CbG9jay50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssSUFBSSxNQUFNLDRCQUE0QixDQUFBO0FBQ2xELE9BQU8sRUFBd0IsTUFBTSwwREFBMEQsQ0FBQSJ9
@@ -0,0 +1,10 @@
1
+ import * as p_di from "../../../interface/data.js";
2
+ import { type Command_Action } from "../../../interface/__internal/command/Command_Action.js";
3
+ import { type Command_Block } from "./Command_Block.js";
4
+ import { type Command } from "../../../interface/__internal/command/Command.js";
5
+ import { type Query_Action } from "../../../interface/__internal/query/Query_Action.js";
6
+ export default function command_procedure<Error extends p_di.Value, Dynamic_Parameters extends p_di.Value, Static_Parameters extends p_di.Value, Query_Resources extends null | {
7
+ [key: string]: Query_Action<any, any, any>;
8
+ }, Command_Resources extends null | {
9
+ [key: string]: Command_Action<any, any>;
10
+ }>(execution_handler: ($d: Dynamic_Parameters, $s: Static_Parameters, $qr: Query_Resources, $cr: Command_Resources) => Command_Block<Error>): Command<Command_Action<Error, Dynamic_Parameters>, Static_Parameters, Query_Resources, Command_Resources>;
@@ -0,0 +1,21 @@
1
+ import * as p_di from "../../../interface/data.js";
2
+ import {} from "../../../interface/__internal/command/Command_Action.js";
3
+ import {} from "./Command_Block.js";
4
+ import {} from "../../../interface/__internal/command/Command.js";
5
+ import {} from "../../../interface/__internal/query/Query_Action.js";
6
+ import command_promise from "./command_promise.js";
7
+ import handle_command_block from "./handle_command_block.js";
8
+ export default function command_procedure(execution_handler) {
9
+ return ($s, $q, $c) => {
10
+ return {
11
+ 'execute': ($d, error_transformer) => command_promise({
12
+ 'execute': (on_success, on_error) => {
13
+ handle_command_block(execution_handler($d, $s, $q, $c)).__start(on_success, ($) => {
14
+ on_error(error_transformer($));
15
+ });
16
+ }
17
+ }),
18
+ };
19
+ };
20
+ }
21
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbWFuZC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9pbXBsZW1lbnRhdGlvbi9fX2ludGVybmFsL2NvbW1hbmQvY29tbWFuZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssSUFBSSxNQUFNLDRCQUE0QixDQUFBO0FBRWxELE9BQU8sRUFBdUIsTUFBTSx5REFBeUQsQ0FBQTtBQUM3RixPQUFPLEVBQXNCLE1BQU0sb0JBQW9CLENBQUE7QUFDdkQsT0FBTyxFQUFnQixNQUFNLGtEQUFrRCxDQUFBO0FBQy9FLE9BQU8sRUFBcUIsTUFBTSxxREFBcUQsQ0FBQTtBQUN2RixPQUFPLGVBQWUsTUFBTSxzQkFBc0IsQ0FBQTtBQUNsRCxPQUFPLG9CQUFvQixNQUFNLDJCQUEyQixDQUFBO0FBRTVELE1BQU0sQ0FBQyxPQUFPLFVBQVUsaUJBQWlCLENBT3JDLGlCQUt5QjtJQVV6QixPQUFPLENBQUMsRUFBRSxFQUFFLEVBQUUsRUFBRSxFQUFFLEVBQUUsRUFBRTtRQUNsQixPQUFPO1lBQ0gsU0FBUyxFQUFFLENBQUMsRUFBRSxFQUFFLGlCQUFpQixFQUFFLEVBQUUsQ0FBQyxlQUFlLENBQUM7Z0JBQ2xELFNBQVMsRUFBRSxDQUFDLFVBQVUsRUFBRSxRQUFRLEVBQUUsRUFBRTtvQkFFaEMsb0JBQW9CLENBQUMsaUJBQWlCLENBQUMsRUFBRSxFQUFFLEVBQUUsRUFBRSxFQUFFLEVBQUUsRUFBRSxDQUFDLENBQUMsQ0FBQyxPQUFPLENBQzNELFVBQVUsRUFDVixDQUFDLENBQUMsRUFBRSxFQUFFO3dCQUNGLFFBQVEsQ0FDSixpQkFBaUIsQ0FBQyxDQUFDLENBQUMsQ0FDdkIsQ0FBQTtvQkFDTCxDQUFDLENBQ0osQ0FBQTtnQkFDTCxDQUFDO2FBQ0osQ0FBQztTQUNMLENBQUE7SUFDTCxDQUFDLENBQUE7QUFDTCxDQUFDIn0=
@@ -0,0 +1,4 @@
1
+ import * as p_di from "../../../interface/data.js";
2
+ import { type Command_Promise } from "../../../interface/__internal/command/Command_Promise.js";
3
+ import { type Command_Action } from "../../../interface/__internal/command/Command_Action.js";
4
+ export default function command<Error extends p_di.Value, Dynamic_Parameters extends p_di.Value>(handler: ($: Dynamic_Parameters) => Command_Promise<Error>): Command_Action<Error, Dynamic_Parameters>;
@@ -0,0 +1,16 @@
1
+ import * as p_di from "../../../interface/data.js";
2
+ import command_promise from "./command_promise.js";
3
+ import {} from "../../../interface/__internal/command/Command_Promise.js";
4
+ import {} from "../../../interface/__internal/command/Command_Action.js";
5
+ export default function command(handler) {
6
+ return {
7
+ 'execute': (parameters, error_transformer) => command_promise({
8
+ 'execute': (on_success, on_error) => {
9
+ handler(parameters).__start(on_success, (error) => {
10
+ on_error(error_transformer(error));
11
+ });
12
+ }
13
+ }),
14
+ };
15
+ }
16
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbWFuZF9hY3Rpb24uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvaW1wbGVtZW50YXRpb24vX19pbnRlcm5hbC9jb21tYW5kL2NvbW1hbmRfYWN0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxJQUFJLE1BQU0sNEJBQTRCLENBQUE7QUFDbEQsT0FBTyxlQUFlLE1BQU0sc0JBQXNCLENBQUE7QUFDbEQsT0FBTyxFQUF3QixNQUFNLDBEQUEwRCxDQUFBO0FBQy9GLE9BQU8sRUFBdUIsTUFBTSx5REFBeUQsQ0FBQTtBQUU3RixNQUFNLENBQUMsT0FBTyxVQUFVLE9BQU8sQ0FJM0IsT0FBMEQ7SUFLMUQsT0FBTztRQUNILFNBQVMsRUFBRSxDQUFDLFVBQVUsRUFBRSxpQkFBaUIsRUFBRSxFQUFFLENBQUMsZUFBZSxDQUFDO1lBQzFELFNBQVMsRUFBRSxDQUFDLFVBQVUsRUFBRSxRQUFRLEVBQUUsRUFBRTtnQkFDaEMsT0FBTyxDQUFDLFVBQVUsQ0FBQyxDQUFDLE9BQU8sQ0FDdkIsVUFBVSxFQUNWLENBQUMsS0FBSyxFQUFFLEVBQUU7b0JBQ04sUUFBUSxDQUNKLGlCQUFpQixDQUFDLEtBQUssQ0FBQyxDQUMzQixDQUFBO2dCQUNMLENBQUMsQ0FDSixDQUFBO1lBQ0wsQ0FBQztTQUNKLENBQUM7S0FDTCxDQUFBO0FBQ0wsQ0FBQyJ9
@@ -0,0 +1,18 @@
1
+ import * as p_di from "../../../interface/data.js";
2
+ import { type Command_Promise } from "../../../interface/__internal/command/Command_Promise.js";
3
+ /**
4
+ * this function contains the body in which the async value or error is executed
5
+ * after the execution, either the on_value or on_error callback will be called
6
+ * @param on_value the callback to call when a value is produced
7
+ * @param on_error the callback to call when an error is produced
8
+ */
9
+ type Executer<E> = {
10
+ 'execute': (on_success: () => undefined, on_error: ($: E) => undefined) => undefined;
11
+ };
12
+ /**
13
+ * returns an {@link Async_Value }
14
+ * @param executer the function that produces the eventual value
15
+ * @returns
16
+ */
17
+ export default function command_promise<E extends p_di.Value>(executer: Executer<E>): Command_Promise<E>;
18
+ export {};
@@ -0,0 +1,19 @@
1
+ import * as p_di from "../../../interface/data.js";
2
+ import {} from "../../../interface/__internal/command/Command_Promise.js";
3
+ class Command_Promise_Class {
4
+ constructor(executer) {
5
+ this.executer = executer;
6
+ }
7
+ __start(on_success, on_error) {
8
+ this.executer.execute(on_success, on_error);
9
+ }
10
+ }
11
+ /**
12
+ * returns an {@link Async_Value }
13
+ * @param executer the function that produces the eventual value
14
+ * @returns
15
+ */
16
+ export default function command_promise(executer) {
17
+ return new Command_Promise_Class(executer);
18
+ }
19
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbWFuZF9wcm9taXNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2ltcGxlbWVudGF0aW9uL19faW50ZXJuYWwvY29tbWFuZC9jb21tYW5kX3Byb21pc2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLElBQUksTUFBTSw0QkFBNEIsQ0FBQTtBQUNsRCxPQUFPLEVBQXdCLE1BQU0sMERBQTBELENBQUE7QUFnQi9GLE1BQU0scUJBQXFCO0lBRXZCLFlBQVksUUFBcUI7UUFDN0IsSUFBSSxDQUFDLFFBQVEsR0FBRyxRQUFRLENBQUE7SUFDNUIsQ0FBQztJQUVELE9BQU8sQ0FDSCxVQUEyQixFQUMzQixRQUE2QjtRQUU3QixJQUFJLENBQUMsUUFBUSxDQUFDLE9BQU8sQ0FBQyxVQUFVLEVBQUUsUUFBUSxDQUFDLENBQUE7SUFDL0MsQ0FBQztDQUNKO0FBRUQ7Ozs7R0FJRztBQUNILE1BQU0sQ0FBQyxPQUFPLFVBQVUsZUFBZSxDQUNuQyxRQUFxQjtJQUVyQixPQUFPLElBQUkscUJBQXFCLENBQUksUUFBUSxDQUFDLENBQUE7QUFFakQsQ0FBQyJ9
@@ -0,0 +1,17 @@
1
+ import * as p_di from "../../../interface/data.js";
2
+ import * as p_ti from "../../../interface/transformer.js";
3
+ import * as p_qi from "../../../interface/query.js";
4
+ import { type Abort } from "../../../interface/__internal/Abort.js";
5
+ import { type Command_Block } from "./Command_Block.js";
6
+ import { type Command_Action } from "../../../interface/__internal/command/Command_Action.js";
7
+ import { type Command_Promise } from "../../../interface/__internal/command/Command_Promise.js";
8
+ export declare function execute<Error extends p_di.Value, Dynamic_Parameters extends p_di.Value>(command: Command_Action<Error, Dynamic_Parameters>, $d: Dynamic_Parameters, error_transformer: p_ti.Transformer<Error, Error>): Command_Promise<Error>;
9
+ export declare function dictionary<Entry_Error extends p_di.Value, T extends p_di.Value, Error extends p_di.Value>(dictionary: p_di.Dictionary<T>, parametrized_command_block: (value: T, id: string) => Command_Block<Entry_Error>, aggregate_errors: p_ti.Transformer<p_di.Dictionary<Entry_Error>, Error>): Command_Promise<Error>;
10
+ export declare function handle_error<Target_Error extends p_di.Value, Block_Error extends p_di.Value>(command_block: Command_Block<Block_Error>, parametrized_command_block: ($v: Block_Error) => Command_Block<Target_Error>, assign_target_error: () => Target_Error): Command_Promise<Target_Error>;
11
+ export declare function block<Error extends p_di.Value>(block: Command_Block<Error>): Command_Promise<Error>;
12
+ export declare function fail<Error extends p_di.Value>(error: Error): Command_Promise<Error>;
13
+ export declare function query<Error extends p_di.Value, Query_Output extends p_di.Value>(query_result: p_qi.Query_Result<Query_Output, Error>, parametrized_command_block: ($v: Query_Output) => Command_Block<Error>): Command_Promise<Error>;
14
+ export declare function refine<Error extends p_di.Value, Staging_Output extends p_di.Value>(callback: (abort: Abort<Error>) => Staging_Output, parametrized_command_block: ($v: Staging_Output) => Command_Block<Error>): Command_Promise<Error>;
15
+ export declare function if_<Error extends p_di.Value>(precondition: boolean, command_block: Command_Block<Error>, else_command_block?: Command_Block<Error>): Command_Promise<Error>;
16
+ export declare function test_for_successful_execution<Target_Error extends p_di.Value, Block_Error extends p_di.Value>(command_block: Command_Block<Block_Error>, on_result: ($: p_di.Optional_Value<Block_Error>) => Command_Block<Target_Error>): Command_Promise<Target_Error>;
17
+ export declare function assert<Error extends p_di.Value>(assertion: boolean, error_if_failed: Error): Command_Promise<Error>;
@@ -0,0 +1,131 @@
1
+ import * as p_di from "../../../interface/data.js";
2
+ import * as p_ti from "../../../interface/transformer.js";
3
+ import * as p_qi from "../../../interface/query.js";
4
+ import * as p_ci from "../../../interface/command.js";
5
+ import {} from "../../../interface/__internal/Abort.js";
6
+ import {} from "./Command_Block.js";
7
+ import {} from "../../../interface/__internal/command/Command_Action.js";
8
+ import command_promise from "./command_promise.js";
9
+ import handle_command_block from "./handle_command_block.js";
10
+ import create_refinement_context from "../sync/create_refinement_context.js";
11
+ import create_asynchronous_dictionary_builder from "../async/asynchronous_dictionary_builder.js";
12
+ import create_asynchronous_processes_monitor from "../async/create_asynchronous_processes_monitor.js";
13
+ import {} from "../../../interface/__internal/command/Command_Promise.js";
14
+ import * as lit from "../sync/literal.js";
15
+ export function execute(command, $d, error_transformer) {
16
+ return command.execute($d, error_transformer);
17
+ }
18
+ export function dictionary(dictionary, parametrized_command_block, aggregate_errors) {
19
+ return command_promise({
20
+ 'execute': (on_success, on_error) => {
21
+ const errors_builder = create_asynchronous_dictionary_builder();
22
+ create_asynchronous_processes_monitor({
23
+ monitoring_phase: (monitor) => {
24
+ dictionary.__get_raw().forEach(($) => {
25
+ const id = $[0];
26
+ const value = $[1];
27
+ monitor['report_process_started']();
28
+ handle_command_block(parametrized_command_block(value, id)).__start(() => {
29
+ monitor['report_process_finished']();
30
+ }, (e) => {
31
+ errors_builder['add entry'](id, e);
32
+ monitor['report_process_finished']();
33
+ });
34
+ });
35
+ },
36
+ on_all_finished: () => {
37
+ const errors = errors_builder['get dictionary']();
38
+ if (errors.__get_raw().length === 0) {
39
+ on_success();
40
+ }
41
+ else {
42
+ on_error(aggregate_errors(errors));
43
+ }
44
+ }
45
+ });
46
+ }
47
+ });
48
+ }
49
+ export function handle_error(command_block, parametrized_command_block, assign_target_error) {
50
+ return command_promise({
51
+ 'execute': (on_success, on_error) => {
52
+ handle_command_block(command_block).__start(on_success, (e) => {
53
+ handle_command_block(parametrized_command_block(e)).__start(() => {
54
+ on_error(assign_target_error());
55
+ }, on_error);
56
+ });
57
+ }
58
+ });
59
+ }
60
+ export function block(block) {
61
+ return command_promise({
62
+ 'execute': (on_success, on_error) => {
63
+ handle_command_block(block).__start(on_success, on_error);
64
+ }
65
+ });
66
+ }
67
+ export function fail(error) {
68
+ return command_promise({
69
+ 'execute': (on_success, on_error) => {
70
+ on_error(error);
71
+ }
72
+ });
73
+ }
74
+ export function query(query_result, parametrized_command_block) {
75
+ return command_promise({
76
+ 'execute': (on_success, on_error) => {
77
+ query_result.__extract_data((output) => {
78
+ handle_command_block(parametrized_command_block(output)).__start(on_success, on_error);
79
+ }, on_error);
80
+ }
81
+ });
82
+ }
83
+ export function refine(callback, parametrized_command_block) {
84
+ return command_promise({
85
+ 'execute': (on_success, on_error) => {
86
+ create_refinement_context(callback).__extract_data((output) => {
87
+ handle_command_block(parametrized_command_block(output)).__start(on_success, on_error);
88
+ }, on_error);
89
+ }
90
+ });
91
+ }
92
+ export function if_(precondition, command_block, else_command_block) {
93
+ return command_promise({
94
+ 'execute': (on_success, on_error) => {
95
+ if (precondition) {
96
+ handle_command_block(command_block).__start(on_success, on_error);
97
+ }
98
+ else {
99
+ if (else_command_block !== undefined) {
100
+ handle_command_block(else_command_block).__start(on_success, on_error);
101
+ }
102
+ else {
103
+ on_success();
104
+ }
105
+ }
106
+ }
107
+ });
108
+ }
109
+ export function test_for_successful_execution(command_block, on_result) {
110
+ return command_promise({
111
+ 'execute': (on_success, on_error) => {
112
+ handle_command_block(command_block).__start(() => {
113
+ handle_command_block(on_result(lit.not_set())).__start(on_success, on_error);
114
+ }, (e) => {
115
+ handle_command_block(on_result(lit.set(e))).__start(on_success, on_error);
116
+ });
117
+ }
118
+ });
119
+ }
120
+ export function assert(assertion, error_if_failed) {
121
+ return command_promise({
122
+ 'execute': (on_success, on_error) => {
123
+ if (!assertion) {
124
+ on_error(error_if_failed);
125
+ return;
126
+ }
127
+ on_success();
128
+ }
129
+ });
130
+ }
131
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbWFuZF9zdGF0ZW1lbnRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2ltcGxlbWVudGF0aW9uL19faW50ZXJuYWwvY29tbWFuZC9jb21tYW5kX3N0YXRlbWVudHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLElBQUksTUFBTSw0QkFBNEIsQ0FBQTtBQUNsRCxPQUFPLEtBQUssSUFBSSxNQUFNLG1DQUFtQyxDQUFBO0FBQ3pELE9BQU8sS0FBSyxJQUFJLE1BQU0sNkJBQTZCLENBQUE7QUFDbkQsT0FBTyxLQUFLLElBQUksTUFBTSwrQkFBK0IsQ0FBQTtBQUVyRCxPQUFPLEVBQWMsTUFBTSx3Q0FBd0MsQ0FBQTtBQUNuRSxPQUFPLEVBQXNCLE1BQU0sb0JBQW9CLENBQUE7QUFDdkQsT0FBTyxFQUF1QixNQUFNLHlEQUF5RCxDQUFBO0FBQzdGLE9BQU8sZUFBZSxNQUFNLHNCQUFzQixDQUFBO0FBQ2xELE9BQU8sb0JBQW9CLE1BQU0sMkJBQTJCLENBQUE7QUFDNUQsT0FBTyx5QkFBeUIsTUFBTSxzQ0FBc0MsQ0FBQTtBQUM1RSxPQUFPLHNDQUFzQyxNQUFNLDZDQUE2QyxDQUFBO0FBQ2hHLE9BQU8scUNBQXFDLE1BQU0sbURBQW1ELENBQUE7QUFDckcsT0FBTyxFQUF3QixNQUFNLDBEQUEwRCxDQUFBO0FBQy9GLE9BQU8sS0FBSyxH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FBUyxFQUFFLENBQ1AsVUFBVSxFQUNWLFFBQVEsRUFDVixFQUFFO1lBQ0Esb0JBQW9CLENBQUMsYUFBYSxDQUFDLENBQUMsT0FBTyxDQUN2QyxHQUFHLEVBQUU7Z0JBQ0Qsb0JBQW9CLENBQUMsU0FBUyxDQUFDLEdBQUcsQ0FBQyxPQUFPLEVBQUUsQ0FBQyxDQUFDLENBQUMsT0FBTyxDQUNsRCxVQUFVLEVBQ1YsUUFBUSxDQUNYLENBQUE7WUFDTCxDQUFDLEVBQ0QsQ0FBQyxDQUFDLEVBQUUsRUFBRTtnQkFDRixvQkFBb0IsQ0FBQyxTQUFTLENBQUMsR0FBRyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsT0FBTyxDQUMvQyxVQUFVLEVBQ1YsUUFBUSxDQUNYLENBQUE7WUFDTCxDQUFDLENBQ0osQ0FBQTtRQUNMLENBQUM7S0FDSixDQUFDLENBQUE7QUFDTixDQUFDO0FBRUQsTUFBTSxVQUFVLE1BQU0sQ0FDbEIsU0FBa0IsRUFDbEIsZUFBc0I7SUFFdEIsT0FBTyxlQUFlLENBQUM7UUFDbkIsU0FBUyxFQUFFLENBQUMsVUFBVSxFQUFFLFFBQVEsRUFBRSxFQUFFO1lBQ2hDLElBQUksQ0FBQyxTQUFTLEVBQUUsQ0FBQztnQkFDYixRQUFRLENBQUMsZUFBZSxDQUFDLENBQUE7Z0JBQ3pCLE9BQU07WUFDVixDQUFDO1lBQ0QsVUFBVSxFQUFFLENBQUE7UUFDaEIsQ0FBQztLQUNKLENBQUMsQ0FBQTtBQUNOLENBQUMifQ==
@@ -0,0 +1,13 @@
1
+ import * as p_di from "../../../interface/data.js";
2
+ import { type Command_Promise } from "../../../interface/__internal/command/Command_Promise.js";
3
+ import { type Command_Block } from "./Command_Block.js";
4
+ export type Option<T extends p_di.Value> = readonly [string, T];
5
+ /**
6
+ * @deprecated use 'option' instead
7
+ */
8
+ export declare function ss<T extends p_di.Value, Error extends p_di.Value>(option: Option<T>, $c: ($: T) => Command_Block<Error>): Command_Block<Error>;
9
+ export declare function option<T extends p_di.Value, Error extends p_di.Value>(option: Option<T>, $c: ($: T) => Command_Block<Error>): Command_Block<Error>;
10
+ export declare function au<Error extends p_di.Value>(_x: never): Command_Block<Error>;
11
+ export declare namespace decide {
12
+ const state: <T extends p_di.State, Error extends p_di.Value>(state: T, assign: (output: T) => Command_Block<Error>) => Command_Promise<Error>;
13
+ }
@@ -0,0 +1,28 @@
1
+ import * as p_di from "../../../interface/data.js";
2
+ import {} from "../../../interface/__internal/command/Command_Promise.js";
3
+ import {} from "./Command_Block.js";
4
+ import command_promise from "./command_promise.js";
5
+ import handle_command_block from "./handle_command_block.js";
6
+ /**
7
+ * @deprecated use 'option' instead
8
+ */
9
+ export function ss(option, $c) {
10
+ return $c(option[1]);
11
+ }
12
+ export function option(option, $c) {
13
+ return $c(option[1]);
14
+ }
15
+ export function au(_x) {
16
+ throw new Error("unreachable");
17
+ }
18
+ export var decide;
19
+ (function (decide) {
20
+ decide.state = (state, assign) => {
21
+ return command_promise({
22
+ 'execute': (on_success, on_error) => {
23
+ handle_command_block(assign(state)).__start(on_success, on_error);
24
+ }
25
+ });
26
+ };
27
+ })(decide || (decide = {}));
28
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVjaWRlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2ltcGxlbWVudGF0aW9uL19faW50ZXJuYWwvY29tbWFuZC9kZWNpZGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLElBQUksTUFBTSw0QkFBNEIsQ0FBQTtBQUNsRCxPQUFPLEVBQXdCLE1BQU0sMERBQTBELENBQUE7QUFFL0YsT0FBTyxFQUFzQixNQUFNLG9CQUFvQixDQUFBO0FBQ3ZELE9BQU8sZUFBZSxNQUFNLHNCQUFzQixDQUFBO0FBQ2xELE9BQU8sb0JBQW9CLE1BQU0sMkJBQTJCLENBQUE7QUFJNUQ7O0dBRUc7QUFDSCxNQUFNLFVBQVUsRUFBRSxDQUlkLE1BQWlCLEVBQ2pCLEVBQWtDO0lBRWxDLE9BQU8sRUFBRSxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFBO0FBQ3hCLENBQUM7QUFFRCxNQUFNLFVBQVUsTUFBTSxDQUlsQixNQUFpQixFQUNqQixFQUFrQztJQUVsQyxPQUFPLEVBQUUsQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQTtBQUN4QixDQUFDO0FBRUQsTUFBTSxVQUFVLEVBQUUsQ0FHZCxFQUFTO0lBRVQsTUFBTSxJQUFJLEtBQUssQ0FBQyxhQUFhLENBQUMsQ0FBQTtBQUNsQyxDQUFDO0FBRUQsTUFBTSxLQUFXLE1BQU0sQ0F1QnRCO0FBdkJELFdBQWlCLE1BQU07SUFFTixZQUFLLEdBQUcsQ0FJakIsS0FBUSxFQUNSLE1BQTJDLEVBQ3JCLEVBQUU7UUFFeEIsT0FBTyxlQUFlLENBQUM7WUFDbkIsU0FBUyxFQUFFLENBQ1AsVUFBVSxFQUNWLFFBQVEsRUFDVixFQUFFO2dCQUNBLG9CQUFvQixDQUFDLE1BQU0sQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLE9BQU8sQ0FDdkMsVUFBVSxFQUNWLFFBQVEsQ0FDWCxDQUFBO1lBQ0wsQ0FBQztTQUNKLENBQUMsQ0FBQTtJQUNOLENBQUMsQ0FBQTtBQUVMLENBQUMsRUF2QmdCLE1BQU0sS0FBTixNQUFNLFFBdUJ0QiJ9
@@ -0,0 +1,4 @@
1
+ import * as p_di from "../../../interface/data.js";
2
+ import { type Command_Block } from "./Command_Block.js";
3
+ import { type Command_Promise } from "../../../interface/__internal/command/Command_Promise.js";
4
+ export default function handle_command_block<Error extends p_di.Value>(block: Command_Block<Error>): Command_Promise<Error>;
@@ -0,0 +1,22 @@
1
+ import * as p_di from "../../../interface/data.js";
2
+ import command_promise from "./command_promise.js";
3
+ import {} from "./Command_Block.js";
4
+ import {} from "../../../interface/__internal/command/Command_Promise.js";
5
+ export default function handle_command_block(block) {
6
+ return command_promise({
7
+ 'execute': (on_success, on_error) => {
8
+ const length = block.length;
9
+ const runStep = (index) => {
10
+ if (index >= length) {
11
+ on_success();
12
+ return;
13
+ }
14
+ block[index].__start(() => {
15
+ runStep(index + 1);
16
+ }, on_error);
17
+ };
18
+ runStep(0);
19
+ }
20
+ });
21
+ }
22
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGFuZGxlX2NvbW1hbmRfYmxvY2suanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvaW1wbGVtZW50YXRpb24vX19pbnRlcm5hbC9jb21tYW5kL2hhbmRsZV9jb21tYW5kX2Jsb2NrLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxJQUFJLE1BQU0sNEJBQTRCLENBQUE7QUFDbEQsT0FBTyxlQUFlLE1BQU0sc0JBQXNCLENBQUE7QUFDbEQsT0FBTyxFQUFzQixNQUFNLG9CQUFvQixDQUFBO0FBQ3ZELE9BQU8sRUFBd0IsTUFBTSwwREFBMEQsQ0FBQTtBQUUvRixNQUFNLENBQUMsT0FBTyxVQUFVLG9CQUFvQixDQUd4QyxLQUEyQjtJQUUzQixPQUFPLGVBQWUsQ0FBQztRQUNuQixTQUFTLEVBQUUsQ0FDUCxVQUFVLEVBQ1YsUUFBUSxFQUNWLEVBQUU7WUFFQSxNQUFNLE1BQU0sR0FBRyxLQUFLLENBQUMsTUFBTSxDQUFBO1lBQzNCLE1BQU0sT0FBTyxHQUFHLENBQUMsS0FBYSxFQUFFLEVBQUU7Z0JBQzlCLElBQUksS0FBSyxJQUFJLE1BQU0sRUFBRSxDQUFDO29CQUNsQixVQUFVLEVBQUUsQ0FBQTtvQkFDWixPQUFNO2dCQUNWLENBQUM7Z0JBQ0QsS0FBSyxDQUFDLEtBQUssQ0FBRSxDQUFDLE9BQU8sQ0FDakIsR0FBRyxFQUFFO29CQUNELE9BQU8sQ0FBQyxLQUFLLEdBQUcsQ0FBQyxDQUFDLENBQUE7Z0JBQ3RCLENBQUMsRUFDRCxRQUFRLENBQ1gsQ0FBQTtZQUNMLENBQUMsQ0FBQTtZQUNELE9BQU8sQ0FBQyxDQUFDLENBQUMsQ0FBQTtRQUNkLENBQUM7S0FDSixDQUFDLENBQUE7QUFDTixDQUFDIn0=
@@ -0,0 +1,24 @@
1
+ // export interface Super_Query_Result<Output, Error> {
2
+ export {};
3
+ // transform<New_Output>(
4
+ // transformer: p_ti.Transformer<Output, New_Output>
5
+ // ): Super_Query_Result<New_Output, Error>
6
+ // query<New_Output>(
7
+ // query: Query_Callback<New_Output, Error, Output>
8
+ // ): Super_Query_Result<New_Output, Error>
9
+ // refine<New_Output>(
10
+ // callback: ($: Output, abort: Abort<Error>) => New_Output,
11
+ // ): Super_Query_Result<New_Output, Error>
12
+ // rework_error_temp<New_Error, Rework_Error>(
13
+ // error_reworker: Query_Callback<New_Error, Rework_Error, Error>,
14
+ // /**
15
+ // * if the reworker fails, we need to transform *that* error into the New_Error
16
+ // */
17
+ // rework_error_transformer: p_ti.Transformer<Rework_Error, New_Error>,
18
+ // ): Super_Query_Result<Output, New_Error>
19
+ // __extract_data: (
20
+ // on_success: ($: Output) => undefined,
21
+ // on_error: ($: Error) => undefined
22
+ // ) => undefined
23
+ // }
24
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiU3VwZXJfUXVlcnlfUmVzdWx0Xy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9pbXBsZW1lbnRhdGlvbi9fX2ludGVybmFsL3F1ZXJ5L1N1cGVyX1F1ZXJ5X1Jlc3VsdF8udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsdURBQXVEOztBQUV2RCw2QkFBNkI7QUFDN0IsNERBQTREO0FBQzVELCtDQUErQztBQUUvQyx5QkFBeUI7QUFDekIsMkRBQTJEO0FBQzNELCtDQUErQztBQUUvQywwQkFBMEI7QUFDMUIsb0VBQW9FO0FBQ3BFLCtDQUErQztBQUUvQyxrREFBa0Q7QUFDbEQsMEVBQTBFO0FBQzFFLGNBQWM7QUFDZCx5RkFBeUY7QUFDekYsY0FBYztBQUNkLCtFQUErRTtBQUMvRSwrQ0FBK0M7QUFFL0Msd0JBQXdCO0FBQ3hCLGdEQUFnRDtBQUNoRCw0Q0FBNEM7QUFDNUMscUJBQXFCO0FBRXJCLElBQUkifQ==
@@ -0,0 +1,12 @@
1
+ import * as p_di from "../../../interface/data.js";
2
+ import * as p_qi from "../../../interface/query.js";
3
+ export type Option<T extends p_di.Value> = readonly [string, T];
4
+ /**
5
+ * @deprecated use 'option' instead
6
+ */
7
+ export declare function ss<T extends p_di.Value, RT extends p_qi.Query_Result<any, any>>(option: Option<T>, $c: ($: T) => RT): RT;
8
+ export declare function option<T extends p_di.Value, RT extends p_qi.Query_Result<any, any>>(option: Option<T>, $c: ($: T) => RT): RT;
9
+ export declare function au<RT extends p_qi.Query_Result<any, any>>(_x: never): RT;
10
+ export declare namespace decide {
11
+ const state: <T extends p_di.State, RT extends p_qi.Query_Result<any, any>>(state: T, assign: (output: T) => RT) => RT;
12
+ }
@@ -0,0 +1,21 @@
1
+ import * as p_di from "../../../interface/data.js";
2
+ import * as p_qi from "../../../interface/query.js";
3
+ /**
4
+ * @deprecated use 'option' instead
5
+ */
6
+ export function ss(option, $c) {
7
+ return $c(option[1]);
8
+ }
9
+ export function option(option, $c) {
10
+ return $c(option[1]);
11
+ }
12
+ export function au(_x) {
13
+ throw new Error("unreachable");
14
+ }
15
+ export var decide;
16
+ (function (decide) {
17
+ decide.state = (state, assign) => {
18
+ return assign(state);
19
+ };
20
+ })(decide || (decide = {}));
21
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVjaWRlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2ltcGxlbWVudGF0aW9uL19faW50ZXJuYWwvcXVlcnkvZGVjaWRlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sS0FBSyxJQUFJLE1BQU0sNEJBQTRCLENBQUE7QUFDbEQsT0FBTyxLQUFLLElBQUksTUFBTSw2QkFBNkIsQ0FBQTtBQUluRDs7R0FFRztBQUNILE1BQU0sVUFBVSxFQUFFLENBQ2QsTUFBaUIsRUFDakIsRUFBZ0I7SUFDaEIsT0FBTyxFQUFFLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUE7QUFDeEIsQ0FBQztBQUVELE1BQU0sVUFBVSxNQUFNLENBQ2xCLE1BQWlCLEVBQ2pCLEVBQWdCO0lBQ2hCLE9BQU8sRUFBRSxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFBO0FBQ3hCLENBQUM7QUFFRCxNQUFNLFVBQVUsRUFBRSxDQUNkLEVBQVM7SUFFVCxNQUFNLElBQUksS0FBSyxDQUFDLGFBQWEsQ0FBQyxDQUFBO0FBQ2xDLENBQUM7QUFFRCxNQUFNLEtBQVcsTUFBTSxDQVl0QjtBQVpELFdBQWlCLE1BQU07SUFFTixZQUFLLEdBQUcsQ0FJakIsS0FBUSxFQUNSLE1BQXlCLEVBQ3ZCLEVBQUU7UUFDSixPQUFPLE1BQU0sQ0FBQyxLQUFLLENBQUMsQ0FBQTtJQUN4QixDQUFDLENBQUE7QUFFTCxDQUFDLEVBWmdCLE1BQU0sS0FBTixNQUFNLFFBWXRCIn0=
@@ -0,0 +1,7 @@
1
+ import * as p_di from "../../../interface/data.js";
2
+ import { type Query_Action } from "../../../interface/__internal/query/Query_Action.js";
3
+ import { type Query } from "../../../interface/__internal/query/Query.js";
4
+ import { type Query_Result } from "../../../interface/__internal/query/Query_Result.js";
5
+ export default function query_function<Result extends p_di.Value, Error extends p_di.Value, Dynamic_Parameters extends p_di.Value, Static_Parameters extends p_di.Value, Query_Resources extends null | {
6
+ [key: string]: Query_Action<any, any, any>;
7
+ }>(handler: ($d: Dynamic_Parameters, $s: Static_Parameters, $q: Query_Resources) => Query_Result<Result, Error>): Query<Query_Action<Result, Error, Dynamic_Parameters>, Static_Parameters, Query_Resources>;
@@ -0,0 +1,15 @@
1
+ import * as p_di from "../../../interface/data.js";
2
+ import {} from "../../../interface/__internal/query/Query_Action.js";
3
+ import {} from "../../../interface/__internal/query/Query.js";
4
+ import {} from "../../../interface/__internal/query/Query_Result.js";
5
+ import query_result from "./query_result.js";
6
+ export default function query_function(handler) {
7
+ return ($s, $q) => ($d, error_transformer) => {
8
+ return query_result((on_success, on_error) => {
9
+ handler($d, $s, $q).__extract_data(on_success, (e) => {
10
+ on_error(error_transformer(e));
11
+ });
12
+ });
13
+ };
14
+ }
15
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXVlcnkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvaW1wbGVtZW50YXRpb24vX19pbnRlcm5hbC9xdWVyeS9xdWVyeS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssSUFBSSxNQUFNLDRCQUE0QixDQUFBO0FBRWxELE9BQU8sRUFBcUIsTUFBTSxxREFBcUQsQ0FBQTtBQUN2RixPQUFPLEVBQWMsTUFBTSw4Q0FBOEMsQ0FBQTtBQUN6RSxPQUFPLEVBQXFCLE1BQU0scURBQXFELENBQUE7QUFFdkYsT0FBTyxZQUFZLE1BQU0sbUJBQW1CLENBQUE7QUFFNUMsTUFBTSxDQUFDLE9BQU8sVUFBVSxjQUFjLENBT2xDLE9BT0M7SUFVRCxPQUFPLENBQUMsRUFBRSxFQUFFLEVBQUUsRUFBRSxFQUFFLENBQUMsQ0FDZixFQUFFLEVBQ0YsaUJBQWlCLEVBQ25CLEVBQUU7UUFDQSxPQUFPLFlBQVksQ0FDZixDQUNJLFVBQVUsRUFDVixRQUFRLEVBQ1YsRUFBRTtZQUNBLE9BQU8sQ0FBQyxFQUFFLEVBQUUsRUFBRSxFQUFFLEVBQUUsQ0FBQyxDQUFDLGNBQWMsQ0FDOUIsVUFBVSxFQUNWLENBQUMsQ0FBQyxFQUFFLEVBQUU7Z0JBQ0YsUUFBUSxDQUFDLGlCQUFpQixDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUE7WUFDbEMsQ0FBQyxDQUNKLENBQUE7UUFDTCxDQUFDLENBQ0osQ0FBQTtJQUNMLENBQUMsQ0FBQTtBQUNMLENBQUMifQ==
@@ -0,0 +1,4 @@
1
+ import * as p_i from "../../../interface/query.js";
2
+ import * as p_di from "../../../interface/data.js";
3
+ import { type Query_Action } from "../../../interface/__internal/query/Query_Action.js";
4
+ export default function query<Result extends p_di.Value, Error extends p_di.Value, Dynamic_Parameters extends p_di.Value>(handler: ($: Dynamic_Parameters) => p_i.Query_Result<Result, Error>): Query_Action<Result, Error, Dynamic_Parameters>;
@@ -0,0 +1,12 @@
1
+ import * as p_i from "../../../interface/query.js";
2
+ import * as p_di from "../../../interface/data.js";
3
+ import {} from "../../../interface/__internal/query/Query_Action.js";
4
+ import query_result from "./query_result.js";
5
+ export default function query(handler) {
6
+ return (parameters, error_transformer) => query_result((on_success, on_error) => {
7
+ handler(parameters).__extract_data(on_success, (e) => {
8
+ on_error(error_transformer(e));
9
+ });
10
+ });
11
+ }
12
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXVlcnlfYWN0aW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2ltcGxlbWVudGF0aW9uL19faW50ZXJuYWwvcXVlcnkvcXVlcnlfYWN0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxHQUFHLE1BQU0sNkJBQTZCLENBQUE7QUFDbEQsT0FBTyxLQUFLLElBQUksTUFBTSw0QkFBNEIsQ0FBQTtBQUVsRCxPQUFPLEVBQXFCLE1BQU0scURBQXFELENBQUE7QUFFdkYsT0FBTyxZQUFZLE1BQU0sbUJBQW1CLENBQUE7QUFFNUMsTUFBTSxDQUFDLE9BQU8sVUFBVSxLQUFLLENBS3pCLE9BRW9DO0lBTXBDLE9BQU8sQ0FBQyxVQUFVLEVBQUUsaUJBQWlCLEVBQUUsRUFBRSxDQUFDLFlBQVksQ0FBQyxDQUFDLFVBQVUsRUFBRSxRQUFRLEVBQUUsRUFBRTtRQUM1RSxPQUFPLENBQUMsVUFBVSxDQUFDLENBQUMsY0FBYyxDQUM5QixVQUFVLEVBQ1YsQ0FBQyxDQUFDLEVBQUUsRUFBRTtZQUNGLFFBQVEsQ0FBQyxpQkFBaUIsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFBO1FBQ2xDLENBQUMsQ0FDSixDQUFBO0lBQ0wsQ0FBQyxDQUFDLENBQUE7QUFDTixDQUFDIn0=
@@ -0,0 +1,16 @@
1
+ import * as p_qi from "../../../interface/query.js";
2
+ import * as p_ti from "../../../interface/transformer.js";
3
+ import * as p_di from "../../../interface/data.js";
4
+ import { type Abort } from "../../../interface/__internal/Abort.js";
5
+ export declare function dictionary<Entry extends p_di.Value, Result extends p_di.Value, Error extends p_di.Value, Entry_Error extends p_di.Value>(dictionary: p_di.Dictionary<Entry>, map_entry: ($: Entry, id: string) => p_qi.Query_Result<Result, Entry_Error>, aggregate_errors: p_ti.Transformer<p_di.Dictionary<Entry_Error>, Error>): p_qi.Query_Result<p_di.Dictionary<Result>, Error>;
6
+ export declare function direct_result<Result extends p_di.Value, Error extends p_di.Value>(result: Result): p_qi.Query_Result<Result, Error>;
7
+ export declare function direct_error<T extends p_di.Value, E extends p_di.Value>($: E): p_qi.Query_Result<T, E>;
8
+ export declare function refine<T extends p_di.Value, E extends p_di.Value>(callback: (abort: Abort<E>) => T): p_qi.Query_Result<T, E>;
9
+ export declare function transform<T extends p_di.Value, E extends p_di.Value>(callback: () => T): p_qi.Query_Result<T, E>;
10
+ /**
11
+ * try the query, handle the succes result and catch the error
12
+ */
13
+ export declare function observe_behavior<Preparation_Result extends p_di.Value, Preparation_Error extends p_di.Value, Target_Outcome extends p_di.Value, Target_Error extends p_di.Value>(result: p_qi.Query_Result<Preparation_Result, Preparation_Error>, handlers: {
14
+ success: (result: Preparation_Result) => p_qi.Query_Result<Target_Outcome, Target_Error>;
15
+ error: (error: Preparation_Error) => p_qi.Query_Result<Target_Outcome, Target_Error>;
16
+ }): p_qi.Query_Result<Target_Outcome, Target_Error>;