quidproquo-actionprocessor-node 0.0.262 → 0.1.0

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 (169) hide show
  1. package/lib/commonjs/actionProcessor/core/index.d.ts +2 -12
  2. package/lib/commonjs/actionProcessor/core/index.js +10 -25
  3. package/lib/commonjs/actionProcessor/core/inlineFunction/getInlineFunctionExecuteActionProcessor.d.ts +2 -0
  4. package/lib/commonjs/actionProcessor/core/inlineFunction/getInlineFunctionExecuteActionProcessor.js +47 -0
  5. package/lib/commonjs/actionProcessor/core/{network/getNetworkRequestActionProcessor.d.ts → inlineFunction/index.d.ts} +1 -1
  6. package/lib/commonjs/actionProcessor/core/{error → inlineFunction}/index.js +5 -5
  7. package/lib/commonjs/actionProcessor/core/{context/getContextReadActionProcessor.d.ts → stream/getStreamCloseActionProcessor.d.ts} +1 -1
  8. package/lib/commonjs/actionProcessor/core/{context/getContextReadActionProcessor.js → stream/getStreamCloseActionProcessor.js} +8 -10
  9. package/lib/commonjs/actionProcessor/core/stream/getStreamReadActionProcessor.d.ts +2 -0
  10. package/lib/commonjs/actionProcessor/core/{math/getMathRandomNumberActionProcessor.js → stream/getStreamReadActionProcessor.js} +8 -7
  11. package/lib/commonjs/actionProcessor/core/{system → stream}/index.d.ts +1 -1
  12. package/lib/commonjs/actionProcessor/core/{system → stream}/index.js +6 -5
  13. package/lib/commonjs/actionProcessor/webserver/index.js +4 -2
  14. package/lib/commonjs/dynamicActionProcessor/file/getFileDeleteActionProcessor.js +7 -4
  15. package/lib/commonjs/dynamicActionProcessor/file/getFileExistsActionProcessor.js +10 -4
  16. package/lib/commonjs/dynamicActionProcessor/file/getFileGenerateTemporarySecureUrlActionProcessor.js +1 -2
  17. package/lib/commonjs/dynamicActionProcessor/file/getFileGenerateTemporaryUploadSecureUrlActionProcessor.js +1 -2
  18. package/lib/commonjs/dynamicActionProcessor/file/getFileListDirectoryActionProcessor.js +6 -9
  19. package/lib/commonjs/dynamicActionProcessor/file/getFileReadBinaryContentsActionProcessor.js +4 -6
  20. package/lib/commonjs/dynamicActionProcessor/file/getFileReadObjectJsonActionProcessor.js +5 -9
  21. package/lib/commonjs/dynamicActionProcessor/file/getFileReadTextContentsActionProcessor.js +4 -6
  22. package/lib/commonjs/dynamicActionProcessor/file/getFileStreamOpenActionProcessor.d.ts +3 -0
  23. package/lib/commonjs/dynamicActionProcessor/file/getFileStreamOpenActionProcessor.js +135 -0
  24. package/lib/commonjs/dynamicActionProcessor/file/getFileWriteBinaryContentsActionProcessor.js +10 -3
  25. package/lib/commonjs/dynamicActionProcessor/file/getFileWriteObjectJsonActionProcessor.js +4 -3
  26. package/lib/commonjs/dynamicActionProcessor/file/getFileWriteTextContentsActionProcessor.js +4 -3
  27. package/lib/commonjs/dynamicActionProcessor/file/index.js +2 -1
  28. package/lib/commonjs/dynamicActionProcessor/file/utils.d.ts +2 -1
  29. package/lib/commonjs/dynamicActionProcessor/file/utils.js +11 -1
  30. package/lib/esm/actionProcessor/core/index.d.ts +2 -12
  31. package/lib/esm/actionProcessor/core/index.js +12 -35
  32. package/lib/esm/actionProcessor/core/inlineFunction/getInlineFunctionExecuteActionProcessor.d.ts +2 -0
  33. package/lib/esm/actionProcessor/core/inlineFunction/getInlineFunctionExecuteActionProcessor.js +32 -0
  34. package/lib/esm/actionProcessor/core/{network/getNetworkRequestActionProcessor.d.ts → inlineFunction/index.d.ts} +1 -1
  35. package/lib/esm/actionProcessor/core/inlineFunction/index.js +4 -0
  36. package/lib/{commonjs/actionProcessor/core/context/getContextListActionProcessor.d.ts → esm/actionProcessor/core/stream/getStreamCloseActionProcessor.d.ts} +1 -1
  37. package/lib/esm/actionProcessor/core/stream/getStreamCloseActionProcessor.js +10 -0
  38. package/lib/esm/actionProcessor/core/stream/getStreamReadActionProcessor.d.ts +2 -0
  39. package/lib/esm/actionProcessor/core/stream/getStreamReadActionProcessor.js +10 -0
  40. package/lib/esm/actionProcessor/core/{config → stream}/index.d.ts +1 -1
  41. package/lib/esm/actionProcessor/core/stream/index.js +6 -0
  42. package/lib/esm/actionProcessor/webserver/index.js +4 -2
  43. package/lib/esm/dynamicActionProcessor/file/getFileDeleteActionProcessor.js +8 -5
  44. package/lib/esm/dynamicActionProcessor/file/getFileExistsActionProcessor.js +11 -5
  45. package/lib/esm/dynamicActionProcessor/file/getFileGenerateTemporarySecureUrlActionProcessor.js +2 -3
  46. package/lib/esm/dynamicActionProcessor/file/getFileGenerateTemporaryUploadSecureUrlActionProcessor.js +2 -3
  47. package/lib/esm/dynamicActionProcessor/file/getFileListDirectoryActionProcessor.js +7 -10
  48. package/lib/esm/dynamicActionProcessor/file/getFileReadBinaryContentsActionProcessor.js +5 -7
  49. package/lib/esm/dynamicActionProcessor/file/getFileReadObjectJsonActionProcessor.js +6 -10
  50. package/lib/esm/dynamicActionProcessor/file/getFileReadTextContentsActionProcessor.js +5 -7
  51. package/lib/esm/dynamicActionProcessor/file/getFileStreamOpenActionProcessor.d.ts +3 -0
  52. package/lib/esm/dynamicActionProcessor/file/getFileStreamOpenActionProcessor.js +37 -0
  53. package/lib/esm/dynamicActionProcessor/file/getFileWriteBinaryContentsActionProcessor.js +11 -4
  54. package/lib/esm/dynamicActionProcessor/file/getFileWriteObjectJsonActionProcessor.js +5 -4
  55. package/lib/esm/dynamicActionProcessor/file/getFileWriteTextContentsActionProcessor.js +5 -4
  56. package/lib/esm/dynamicActionProcessor/file/index.js +2 -0
  57. package/lib/esm/dynamicActionProcessor/file/utils.d.ts +2 -1
  58. package/lib/esm/dynamicActionProcessor/file/utils.js +9 -1
  59. package/package.json +5 -9
  60. package/lib/commonjs/actionProcessor/core/claudeAi/getClaudeAiMessagesApiActionProcessor.d.ts +0 -2
  61. package/lib/commonjs/actionProcessor/core/claudeAi/getClaudeAiMessagesApiActionProcessor.js +0 -74
  62. package/lib/commonjs/actionProcessor/core/claudeAi/index.d.ts +0 -2
  63. package/lib/commonjs/actionProcessor/core/claudeAi/index.js +0 -17
  64. package/lib/commonjs/actionProcessor/core/config/getConfigGetApplicationInfoActionProcessor.d.ts +0 -2
  65. package/lib/commonjs/actionProcessor/core/config/getConfigGetApplicationInfoActionProcessor.js +0 -30
  66. package/lib/commonjs/actionProcessor/core/config/index.d.ts +0 -2
  67. package/lib/commonjs/actionProcessor/core/config/index.js +0 -17
  68. package/lib/commonjs/actionProcessor/core/context/getContextListActionProcessor.js +0 -24
  69. package/lib/commonjs/actionProcessor/core/context/index.d.ts +0 -2
  70. package/lib/commonjs/actionProcessor/core/context/index.js +0 -18
  71. package/lib/commonjs/actionProcessor/core/customActions/getCustomActionActionProcessor.d.ts +0 -2
  72. package/lib/commonjs/actionProcessor/core/customActions/getCustomActionActionProcessor.js +0 -58
  73. package/lib/commonjs/actionProcessor/core/customActions/index.d.ts +0 -1
  74. package/lib/commonjs/actionProcessor/core/customActions/index.js +0 -18
  75. package/lib/commonjs/actionProcessor/core/date/getDateNowActionProcessor.d.ts +0 -2
  76. package/lib/commonjs/actionProcessor/core/date/getDateNowActionProcessor.js +0 -24
  77. package/lib/commonjs/actionProcessor/core/date/index.d.ts +0 -2
  78. package/lib/commonjs/actionProcessor/core/date/index.js +0 -17
  79. package/lib/commonjs/actionProcessor/core/error/getErrorThrowErrorActionProcessor.d.ts +0 -2
  80. package/lib/commonjs/actionProcessor/core/error/getErrorThrowErrorActionProcessor.js +0 -24
  81. package/lib/commonjs/actionProcessor/core/error/index.d.ts +0 -2
  82. package/lib/commonjs/actionProcessor/core/guid/getGuidNewActionProcessor.d.ts +0 -2
  83. package/lib/commonjs/actionProcessor/core/guid/getGuidNewActionProcessor.js +0 -25
  84. package/lib/commonjs/actionProcessor/core/guid/getGuidNewSortableActionProcessor.d.ts +0 -2
  85. package/lib/commonjs/actionProcessor/core/guid/getGuidNewSortableActionProcessor.js +0 -25
  86. package/lib/commonjs/actionProcessor/core/guid/index.d.ts +0 -2
  87. package/lib/commonjs/actionProcessor/core/guid/index.js +0 -18
  88. package/lib/commonjs/actionProcessor/core/log/getLogCreateActionProcessor.d.ts +0 -2
  89. package/lib/commonjs/actionProcessor/core/log/getLogCreateActionProcessor.js +0 -30
  90. package/lib/commonjs/actionProcessor/core/log/getLogDisableEventHistoryActionProcessor.d.ts +0 -2
  91. package/lib/commonjs/actionProcessor/core/log/getLogDisableEventHistoryActionProcessor.js +0 -25
  92. package/lib/commonjs/actionProcessor/core/log/getLogTemplateLiteralActionProcessor.d.ts +0 -2
  93. package/lib/commonjs/actionProcessor/core/log/getLogTemplateLiteralActionProcessor.js +0 -26
  94. package/lib/commonjs/actionProcessor/core/log/index.d.ts +0 -2
  95. package/lib/commonjs/actionProcessor/core/log/index.js +0 -19
  96. package/lib/commonjs/actionProcessor/core/math/getMathRandomNumberActionProcessor.d.ts +0 -2
  97. package/lib/commonjs/actionProcessor/core/math/index.d.ts +0 -2
  98. package/lib/commonjs/actionProcessor/core/math/index.js +0 -17
  99. package/lib/commonjs/actionProcessor/core/network/getNetworkRequestActionProcessor.js +0 -150
  100. package/lib/commonjs/actionProcessor/core/network/index.d.ts +0 -2
  101. package/lib/commonjs/actionProcessor/core/network/index.js +0 -17
  102. package/lib/commonjs/actionProcessor/core/platform/getPlatformDelayActionProcessor.d.ts +0 -2
  103. package/lib/commonjs/actionProcessor/core/platform/getPlatformDelayActionProcessor.js +0 -24
  104. package/lib/commonjs/actionProcessor/core/platform/index.d.ts +0 -2
  105. package/lib/commonjs/actionProcessor/core/platform/index.js +0 -17
  106. package/lib/commonjs/actionProcessor/core/system/getSystemBatchActionProcessor.d.ts +0 -2
  107. package/lib/commonjs/actionProcessor/core/system/getSystemBatchActionProcessor.js +0 -51
  108. package/lib/commonjs/actionProcessor/webserver/dns/getDnsListActionProcessor.d.ts +0 -2
  109. package/lib/commonjs/actionProcessor/webserver/dns/getDnsListActionProcessor.js +0 -26
  110. package/lib/commonjs/actionProcessor/webserver/dns/index.d.ts +0 -2
  111. package/lib/commonjs/actionProcessor/webserver/dns/index.js +0 -17
  112. package/lib/esm/actionProcessor/core/claudeAi/getClaudeAiMessagesApiActionProcessor.d.ts +0 -2
  113. package/lib/esm/actionProcessor/core/claudeAi/getClaudeAiMessagesApiActionProcessor.js +0 -26
  114. package/lib/esm/actionProcessor/core/claudeAi/index.d.ts +0 -2
  115. package/lib/esm/actionProcessor/core/claudeAi/index.js +0 -4
  116. package/lib/esm/actionProcessor/core/config/getConfigGetApplicationInfoActionProcessor.d.ts +0 -2
  117. package/lib/esm/actionProcessor/core/config/getConfigGetApplicationInfoActionProcessor.js +0 -15
  118. package/lib/esm/actionProcessor/core/config/index.js +0 -4
  119. package/lib/esm/actionProcessor/core/context/getContextListActionProcessor.d.ts +0 -2
  120. package/lib/esm/actionProcessor/core/context/getContextListActionProcessor.js +0 -9
  121. package/lib/esm/actionProcessor/core/context/getContextReadActionProcessor.d.ts +0 -2
  122. package/lib/esm/actionProcessor/core/context/getContextReadActionProcessor.js +0 -12
  123. package/lib/esm/actionProcessor/core/context/index.d.ts +0 -2
  124. package/lib/esm/actionProcessor/core/context/index.js +0 -6
  125. package/lib/esm/actionProcessor/core/customActions/getCustomActionActionProcessor.d.ts +0 -2
  126. package/lib/esm/actionProcessor/core/customActions/getCustomActionActionProcessor.js +0 -43
  127. package/lib/esm/actionProcessor/core/customActions/index.d.ts +0 -1
  128. package/lib/esm/actionProcessor/core/customActions/index.js +0 -2
  129. package/lib/esm/actionProcessor/core/date/getDateNowActionProcessor.d.ts +0 -2
  130. package/lib/esm/actionProcessor/core/date/getDateNowActionProcessor.js +0 -9
  131. package/lib/esm/actionProcessor/core/date/index.d.ts +0 -2
  132. package/lib/esm/actionProcessor/core/date/index.js +0 -4
  133. package/lib/esm/actionProcessor/core/error/getErrorThrowErrorActionProcessor.d.ts +0 -2
  134. package/lib/esm/actionProcessor/core/error/getErrorThrowErrorActionProcessor.js +0 -9
  135. package/lib/esm/actionProcessor/core/error/index.d.ts +0 -2
  136. package/lib/esm/actionProcessor/core/error/index.js +0 -4
  137. package/lib/esm/actionProcessor/core/guid/getGuidNewActionProcessor.d.ts +0 -2
  138. package/lib/esm/actionProcessor/core/guid/getGuidNewActionProcessor.js +0 -10
  139. package/lib/esm/actionProcessor/core/guid/getGuidNewSortableActionProcessor.d.ts +0 -2
  140. package/lib/esm/actionProcessor/core/guid/getGuidNewSortableActionProcessor.js +0 -10
  141. package/lib/esm/actionProcessor/core/guid/index.d.ts +0 -2
  142. package/lib/esm/actionProcessor/core/guid/index.js +0 -6
  143. package/lib/esm/actionProcessor/core/log/getLogCreateActionProcessor.d.ts +0 -2
  144. package/lib/esm/actionProcessor/core/log/getLogCreateActionProcessor.js +0 -15
  145. package/lib/esm/actionProcessor/core/log/getLogDisableEventHistoryActionProcessor.d.ts +0 -2
  146. package/lib/esm/actionProcessor/core/log/getLogDisableEventHistoryActionProcessor.js +0 -10
  147. package/lib/esm/actionProcessor/core/log/getLogTemplateLiteralActionProcessor.d.ts +0 -2
  148. package/lib/esm/actionProcessor/core/log/getLogTemplateLiteralActionProcessor.js +0 -11
  149. package/lib/esm/actionProcessor/core/log/index.d.ts +0 -2
  150. package/lib/esm/actionProcessor/core/log/index.js +0 -8
  151. package/lib/esm/actionProcessor/core/math/getMathRandomNumberActionProcessor.d.ts +0 -2
  152. package/lib/esm/actionProcessor/core/math/getMathRandomNumberActionProcessor.js +0 -9
  153. package/lib/esm/actionProcessor/core/math/index.d.ts +0 -2
  154. package/lib/esm/actionProcessor/core/math/index.js +0 -4
  155. package/lib/esm/actionProcessor/core/network/getNetworkRequestActionProcessor.js +0 -134
  156. package/lib/esm/actionProcessor/core/network/index.d.ts +0 -2
  157. package/lib/esm/actionProcessor/core/network/index.js +0 -4
  158. package/lib/esm/actionProcessor/core/platform/getPlatformDelayActionProcessor.d.ts +0 -2
  159. package/lib/esm/actionProcessor/core/platform/getPlatformDelayActionProcessor.js +0 -9
  160. package/lib/esm/actionProcessor/core/platform/index.d.ts +0 -2
  161. package/lib/esm/actionProcessor/core/platform/index.js +0 -4
  162. package/lib/esm/actionProcessor/core/system/getSystemBatchActionProcessor.d.ts +0 -2
  163. package/lib/esm/actionProcessor/core/system/getSystemBatchActionProcessor.js +0 -36
  164. package/lib/esm/actionProcessor/core/system/index.d.ts +0 -2
  165. package/lib/esm/actionProcessor/core/system/index.js +0 -4
  166. package/lib/esm/actionProcessor/webserver/dns/getDnsListActionProcessor.d.ts +0 -2
  167. package/lib/esm/actionProcessor/webserver/dns/getDnsListActionProcessor.js +0 -11
  168. package/lib/esm/actionProcessor/webserver/dns/index.d.ts +0 -2
  169. package/lib/esm/actionProcessor/webserver/dns/index.js +0 -4
@@ -1,25 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.getLogDisableEventHistoryActionProcessor = void 0;
13
- const quidproquo_core_1 = require("quidproquo-core");
14
- const getProcessLogDisableEventHistory = (qpqConfig) => {
15
- return (_a, session_1, _actionProcessors_1, logger_1) => __awaiter(void 0, [_a, session_1, _actionProcessors_1, logger_1], void 0, function* ({ enable, reason }, session, _actionProcessors, logger) {
16
- yield logger.enableLogs(enable, reason, session.correlation || '');
17
- return (0, quidproquo_core_1.actionResult)(void 0);
18
- });
19
- };
20
- const getLogDisableEventHistoryActionProcessor = (qpqConfig) => __awaiter(void 0, void 0, void 0, function* () {
21
- return ({
22
- [quidproquo_core_1.LogActionType.DisableEventHistory]: getProcessLogDisableEventHistory(qpqConfig),
23
- });
24
- });
25
- exports.getLogDisableEventHistoryActionProcessor = getLogDisableEventHistoryActionProcessor;
@@ -1,2 +0,0 @@
1
- import { ActionProcessorListResolver } from 'quidproquo-core';
2
- export declare const getLogTemplateLiteralActionProcessor: ActionProcessorListResolver;
@@ -1,26 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.getLogTemplateLiteralActionProcessor = void 0;
13
- const quidproquo_core_1 = require("quidproquo-core");
14
- const getProcessLogTemplateLiteral = (qpqConfig) => {
15
- return (_a) => __awaiter(void 0, [_a], void 0, function* ({ messageParts }) {
16
- const message = (0, quidproquo_core_1.decomposedStringToString)(messageParts);
17
- console.log(message);
18
- return (0, quidproquo_core_1.actionResult)(void 0);
19
- });
20
- };
21
- const getLogTemplateLiteralActionProcessor = (qpqConfig) => __awaiter(void 0, void 0, void 0, function* () {
22
- return ({
23
- [quidproquo_core_1.LogActionType.TemplateLiteral]: getProcessLogTemplateLiteral(qpqConfig),
24
- });
25
- });
26
- exports.getLogTemplateLiteralActionProcessor = getLogTemplateLiteralActionProcessor;
@@ -1,2 +0,0 @@
1
- import { ActionProcessorListResolver } from 'quidproquo-core';
2
- export declare const getLogActionProcessor: ActionProcessorListResolver;
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.getLogActionProcessor = void 0;
13
- const getLogCreateActionProcessor_1 = require("./getLogCreateActionProcessor");
14
- const getLogDisableEventHistoryActionProcessor_1 = require("./getLogDisableEventHistoryActionProcessor");
15
- const getLogTemplateLiteralActionProcessor_1 = require("./getLogTemplateLiteralActionProcessor");
16
- const getLogActionProcessor = (qpqConfig, dynamicModuleLoader) => __awaiter(void 0, void 0, void 0, function* () {
17
- return (Object.assign(Object.assign(Object.assign({}, (yield (0, getLogCreateActionProcessor_1.getLogCreateActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getLogDisableEventHistoryActionProcessor_1.getLogDisableEventHistoryActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getLogTemplateLiteralActionProcessor_1.getLogTemplateLiteralActionProcessor)(qpqConfig, dynamicModuleLoader))));
18
- });
19
- exports.getLogActionProcessor = getLogActionProcessor;
@@ -1,2 +0,0 @@
1
- import { ActionProcessorListResolver } from 'quidproquo-core';
2
- export declare const getMathRandomNumberActionProcessor: ActionProcessorListResolver;
@@ -1,2 +0,0 @@
1
- import { ActionProcessorListResolver } from 'quidproquo-core';
2
- export declare const getMathActionProcessor: ActionProcessorListResolver;
@@ -1,17 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.getMathActionProcessor = void 0;
13
- const getMathRandomNumberActionProcessor_1 = require("./getMathRandomNumberActionProcessor");
14
- const getMathActionProcessor = (qpqConfig, dynamicModuleLoader) => __awaiter(void 0, void 0, void 0, function* () {
15
- return (Object.assign({}, (yield (0, getMathRandomNumberActionProcessor_1.getMathRandomNumberActionProcessor)(qpqConfig, dynamicModuleLoader))));
16
- });
17
- exports.getMathActionProcessor = getMathActionProcessor;
@@ -1,150 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.getNetworkRequestActionProcessor = void 0;
16
- const quidproquo_core_1 = require("quidproquo-core");
17
- const axios_1 = __importDefault(require("axios"));
18
- const mime_types_1 = require("mime-types");
19
- const getAxiosResponseType = (responseType) => {
20
- if (responseType === 'binary') {
21
- return 'arraybuffer';
22
- }
23
- return 'json';
24
- };
25
- const transformResponse = (payload, response) => {
26
- var _a, _b;
27
- if (payload.responseType === 'binary') {
28
- const headers = response.headers || {};
29
- const mimeType = headers['content-type'] || 'application/octet-stream';
30
- const filename = ((_b = (_a = headers['content-disposition']) === null || _a === void 0 ? void 0 : _a.match(/filename="([^"]+)"/)) === null || _b === void 0 ? void 0 : _b[1]) || `file.${(0, mime_types_1.extension)(mimeType)}`;
31
- return Object.assign(Object.assign({}, response), { data: {
32
- base64Data: Buffer.from(response.data).toString('base64'),
33
- mimetype: mimeType,
34
- filename,
35
- } });
36
- }
37
- return response;
38
- };
39
- const axiosInstance = axios_1.default.create({
40
- timeout: 25000,
41
- headers: {
42
- // Fixes: https://github.com/axios/axios/issues/5346
43
- 'Accept-Encoding': 'gzip,deflate,compress',
44
- },
45
- validateStatus: () => true,
46
- });
47
- const processNetworkRequestGet = (payload) => __awaiter(void 0, void 0, void 0, function* () {
48
- const response = yield axiosInstance.get(payload.url, {
49
- baseURL: payload.basePath,
50
- headers: payload.headers,
51
- params: payload.params,
52
- responseType: getAxiosResponseType(payload.responseType),
53
- });
54
- return transformResponse(payload, response);
55
- });
56
- const processNetworkRequestPost = (payload) => __awaiter(void 0, void 0, void 0, function* () {
57
- const response = yield axiosInstance.post(payload.url, payload.body, {
58
- baseURL: payload.basePath,
59
- headers: payload.headers,
60
- params: payload.params,
61
- responseType: getAxiosResponseType(payload.responseType),
62
- });
63
- return transformResponse(payload, response);
64
- });
65
- const processNetworkRequestDelete = (payload) => __awaiter(void 0, void 0, void 0, function* () {
66
- const response = yield axiosInstance.delete(payload.url, {
67
- baseURL: payload.basePath,
68
- headers: payload.headers,
69
- params: payload.params,
70
- responseType: getAxiosResponseType(payload.responseType),
71
- });
72
- return transformResponse(payload, response);
73
- });
74
- const processNetworkRequestHead = (payload) => __awaiter(void 0, void 0, void 0, function* () {
75
- const response = yield axiosInstance.head(payload.url, {
76
- baseURL: payload.basePath,
77
- headers: payload.headers,
78
- params: payload.params,
79
- responseType: getAxiosResponseType(payload.responseType),
80
- });
81
- return transformResponse(payload, response);
82
- });
83
- const processNetworkRequestOptions = (payload) => __awaiter(void 0, void 0, void 0, function* () {
84
- const response = yield axiosInstance.options(payload.url, {
85
- baseURL: payload.basePath,
86
- headers: payload.headers,
87
- params: payload.params,
88
- responseType: getAxiosResponseType(payload.responseType),
89
- });
90
- return transformResponse(payload, response);
91
- });
92
- const processNetworkRequestPut = (payload) => __awaiter(void 0, void 0, void 0, function* () {
93
- const response = yield axiosInstance.put(payload.url, payload.body, {
94
- baseURL: payload.basePath,
95
- headers: payload.headers,
96
- params: payload.params,
97
- responseType: getAxiosResponseType(payload.responseType),
98
- });
99
- return transformResponse(payload, response);
100
- });
101
- const processNetworkRequestPatch = (payload) => __awaiter(void 0, void 0, void 0, function* () {
102
- const response = yield axiosInstance.patch(payload.url, payload.body, {
103
- baseURL: payload.basePath,
104
- headers: payload.headers,
105
- params: payload.params,
106
- responseType: getAxiosResponseType(payload.responseType),
107
- });
108
- return transformResponse(payload, response);
109
- });
110
- const processNetworkRequestConnect = (payload) => __awaiter(void 0, void 0, void 0, function* () {
111
- throw new Error('Function not implemented.');
112
- });
113
- const requestMethodMap = {
114
- GET: processNetworkRequestGet,
115
- POST: processNetworkRequestPost,
116
- DELETE: processNetworkRequestDelete,
117
- HEAD: processNetworkRequestHead,
118
- OPTIONS: processNetworkRequestOptions,
119
- PUT: processNetworkRequestPut,
120
- PATCH: processNetworkRequestPatch,
121
- CONNECT: processNetworkRequestConnect,
122
- };
123
- const getProcessNetworkRequest = (qpqConfig) => {
124
- return (payload) => __awaiter(void 0, void 0, void 0, function* () {
125
- const requestMethod = requestMethodMap[payload.method];
126
- if (!requestMethod) {
127
- return (0, quidproquo_core_1.actionResultError)(quidproquo_core_1.ErrorTypeEnum.NotImplemented, `${payload.method}: Not implemented`);
128
- }
129
- console.log(payload.url);
130
- try {
131
- const response = yield requestMethod(payload);
132
- return (0, quidproquo_core_1.actionResult)({
133
- headers: response.headers,
134
- status: response.status,
135
- statusText: response.statusText,
136
- data: response.data,
137
- });
138
- }
139
- catch (err) {
140
- console.log(err);
141
- return (0, quidproquo_core_1.actionResultError)(quidproquo_core_1.ErrorTypeEnum.GenericError, err.stack);
142
- }
143
- });
144
- };
145
- const getNetworkRequestActionProcessor = (qpqConfig) => __awaiter(void 0, void 0, void 0, function* () {
146
- return ({
147
- [quidproquo_core_1.NetworkActionType.Request]: getProcessNetworkRequest(qpqConfig),
148
- });
149
- });
150
- exports.getNetworkRequestActionProcessor = getNetworkRequestActionProcessor;
@@ -1,2 +0,0 @@
1
- import { ActionProcessorListResolver } from 'quidproquo-core';
2
- export declare const getNetworkActionProcessor: ActionProcessorListResolver;
@@ -1,17 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.getNetworkActionProcessor = void 0;
13
- const getNetworkRequestActionProcessor_1 = require("./getNetworkRequestActionProcessor");
14
- const getNetworkActionProcessor = (qpqConfig, dynamicModuleLoader) => __awaiter(void 0, void 0, void 0, function* () {
15
- return (Object.assign({}, (yield (0, getNetworkRequestActionProcessor_1.getNetworkRequestActionProcessor)(qpqConfig, dynamicModuleLoader))));
16
- });
17
- exports.getNetworkActionProcessor = getNetworkActionProcessor;
@@ -1,2 +0,0 @@
1
- import { ActionProcessorListResolver } from 'quidproquo-core';
2
- export declare const getPlatformDelayActionProcessor: ActionProcessorListResolver;
@@ -1,24 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.getPlatformDelayActionProcessor = void 0;
13
- const quidproquo_core_1 = require("quidproquo-core");
14
- const getProcessPlatformDelay = (qpqConfig) => {
15
- return (_a) => __awaiter(void 0, [_a], void 0, function* ({ timeMs }) {
16
- return new Promise((resolve) => setTimeout(() => resolve((0, quidproquo_core_1.actionResult)(undefined)), timeMs));
17
- });
18
- };
19
- const getPlatformDelayActionProcessor = (qpqConfig) => __awaiter(void 0, void 0, void 0, function* () {
20
- return ({
21
- [quidproquo_core_1.PlatformActionType.Delay]: getProcessPlatformDelay(qpqConfig),
22
- });
23
- });
24
- exports.getPlatformDelayActionProcessor = getPlatformDelayActionProcessor;
@@ -1,2 +0,0 @@
1
- import { ActionProcessorListResolver } from 'quidproquo-core';
2
- export declare const getPlatformActionProcessor: ActionProcessorListResolver;
@@ -1,17 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.getPlatformActionProcessor = void 0;
13
- const getPlatformDelayActionProcessor_1 = require("./getPlatformDelayActionProcessor");
14
- const getPlatformActionProcessor = (qpqConfig, dynamicModuleLoader) => __awaiter(void 0, void 0, void 0, function* () {
15
- return (Object.assign({}, (yield (0, getPlatformDelayActionProcessor_1.getPlatformDelayActionProcessor)(qpqConfig, dynamicModuleLoader))));
16
- });
17
- exports.getPlatformActionProcessor = getPlatformActionProcessor;
@@ -1,2 +0,0 @@
1
- import { ActionProcessorListResolver } from 'quidproquo-core';
2
- export declare const getSystemBatchActionProcessor: ActionProcessorListResolver;
@@ -1,51 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.getSystemBatchActionProcessor = void 0;
13
- const quidproquo_core_1 = require("quidproquo-core");
14
- const getProcessSystemBatch = (qpqConfig) => {
15
- return (payload, session, actionProcessors, logger, updateSession, dynamicModuleLoader) => __awaiter(void 0, void 0, void 0, function* () {
16
- // console.log('~~~~~~~~~~~ RUNNING BATCH ~~~~~~~~~: ', payload);
17
- const batchRes = yield Promise.all(payload.actions.map((a) => (0, quidproquo_core_1.processAction)(a, actionProcessors, session, logger, updateSession, dynamicModuleLoader)));
18
- // console.log('~~~~~~~~~~~ RESULT BATCH ~~~~~~~~~: ', batchRes);
19
- // If there was an error, that does not want to be returned, throw that error back
20
- const erroredBatchItem = batchRes.find((br, i) => (0, quidproquo_core_1.isErroredActionResult)(br) && !payload.actions[i].returnErrors);
21
- if (erroredBatchItem) {
22
- const error = (0, quidproquo_core_1.resolveActionResultError)(erroredBatchItem);
23
- return (0, quidproquo_core_1.actionResultError)(error.errorType, error.errorText, error.errorStack);
24
- }
25
- // unwrap the values
26
- return (0, quidproquo_core_1.actionResult)(batchRes.map((br, i) => {
27
- // If we want to return errors, return the either result.
28
- if (payload.actions[i].returnErrors) {
29
- const isSuccess = !(0, quidproquo_core_1.isErroredActionResult)(br);
30
- const result = isSuccess
31
- ? {
32
- success: true,
33
- result: (0, quidproquo_core_1.resolveActionResult)(br),
34
- }
35
- : {
36
- success: false,
37
- error: (0, quidproquo_core_1.resolveActionResultError)(br),
38
- };
39
- return result;
40
- }
41
- // return the resolved result
42
- return (0, quidproquo_core_1.resolveActionResult)(br);
43
- }));
44
- });
45
- };
46
- const getSystemBatchActionProcessor = (qpqConfig) => __awaiter(void 0, void 0, void 0, function* () {
47
- return ({
48
- [quidproquo_core_1.SystemActionType.Batch]: getProcessSystemBatch(qpqConfig),
49
- });
50
- });
51
- exports.getSystemBatchActionProcessor = getSystemBatchActionProcessor;
@@ -1,2 +0,0 @@
1
- import { ActionProcessorListResolver } from 'quidproquo-core';
2
- export declare const getDnsListActionProcessor: ActionProcessorListResolver;
@@ -1,26 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.getDnsListActionProcessor = void 0;
13
- const quidproquo_core_1 = require("quidproquo-core");
14
- const quidproquo_webserver_1 = require("quidproquo-webserver");
15
- const getProcessDnsList = (qpqConfig) => {
16
- return () => __awaiter(void 0, void 0, void 0, function* () {
17
- const dnsList = quidproquo_webserver_1.qpqWebServerUtils.getDnsConfigs(qpqConfig).map((dc) => dc.dnsBase);
18
- return (0, quidproquo_core_1.actionResult)(dnsList);
19
- });
20
- };
21
- const getDnsListActionProcessor = (qpqConfig) => __awaiter(void 0, void 0, void 0, function* () {
22
- return ({
23
- [quidproquo_webserver_1.DnsActionType.List]: getProcessDnsList(qpqConfig),
24
- });
25
- });
26
- exports.getDnsListActionProcessor = getDnsListActionProcessor;
@@ -1,2 +0,0 @@
1
- import { ActionProcessorListResolver } from 'quidproquo-core';
2
- export declare const getDnsActionProcessor: ActionProcessorListResolver;
@@ -1,17 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.getDnsActionProcessor = void 0;
13
- const getDnsListActionProcessor_1 = require("./getDnsListActionProcessor");
14
- const getDnsActionProcessor = (qpqConfig, dynamicModuleLoader) => __awaiter(void 0, void 0, void 0, function* () {
15
- return (Object.assign({}, (yield (0, getDnsListActionProcessor_1.getDnsListActionProcessor)(qpqConfig, dynamicModuleLoader))));
16
- });
17
- exports.getDnsActionProcessor = getDnsActionProcessor;
@@ -1,2 +0,0 @@
1
- import { ActionProcessorListResolver } from 'quidproquo-core';
2
- export declare const getClaudeAiMessagesApiActionProcessor: ActionProcessorListResolver;
@@ -1,26 +0,0 @@
1
- import { actionResult, actionResultError, ClaudeAiActionType, ErrorTypeEnum, } from 'quidproquo-core';
2
- import Anthropic, { AuthenticationError } from '@anthropic-ai/sdk';
3
- const getProcessMessagesApi = (qpqConfig) => {
4
- return async ({ body, apiKey }) => {
5
- const anthropic = new Anthropic({ apiKey });
6
- try {
7
- const msg = await anthropic.messages.create(body);
8
- return actionResult(msg);
9
- }
10
- catch (error) {
11
- console.log(error);
12
- if (error instanceof AuthenticationError) {
13
- return actionResultError(ErrorTypeEnum.Unauthorized, 'Invalid API key.');
14
- }
15
- else if (error instanceof Error) {
16
- return actionResultError(ErrorTypeEnum.GenericError, error.message);
17
- }
18
- else {
19
- return actionResultError(ErrorTypeEnum.GenericError, 'An error occurred while processing your request.');
20
- }
21
- }
22
- };
23
- };
24
- export const getClaudeAiMessagesApiActionProcessor = async (qpqConfig) => ({
25
- [ClaudeAiActionType.MessagesApi]: getProcessMessagesApi(qpqConfig),
26
- });
@@ -1,2 +0,0 @@
1
- import { ActionProcessorListResolver } from 'quidproquo-core';
2
- export declare const getClaudeAiActionProcessor: ActionProcessorListResolver;
@@ -1,4 +0,0 @@
1
- import { getClaudeAiMessagesApiActionProcessor } from './getClaudeAiMessagesApiActionProcessor';
2
- export const getClaudeAiActionProcessor = async (qpqConfig, dynamicModuleLoader) => ({
3
- ...(await getClaudeAiMessagesApiActionProcessor(qpqConfig, dynamicModuleLoader)),
4
- });
@@ -1,2 +0,0 @@
1
- import { ActionProcessorListResolver } from 'quidproquo-core';
2
- export declare const getConfigGetApplicationInfoActionProcessor: ActionProcessorListResolver;
@@ -1,15 +0,0 @@
1
- import { actionResult, ConfigActionType, qpqCoreUtils, } from 'quidproquo-core';
2
- const getProcessConfigGetApplicationConfig = (qpqConfig) => {
3
- return async () => {
4
- const appInfo = {
5
- environment: qpqCoreUtils.getApplicationModuleEnvironment(qpqConfig),
6
- feature: qpqCoreUtils.getApplicationModuleFeature(qpqConfig),
7
- module: qpqCoreUtils.getApplicationModuleName(qpqConfig),
8
- name: qpqCoreUtils.getApplicationName(qpqConfig),
9
- };
10
- return actionResult(appInfo);
11
- };
12
- };
13
- export const getConfigGetApplicationInfoActionProcessor = async (qpqConfig) => ({
14
- [ConfigActionType.GetApplicationInfo]: getProcessConfigGetApplicationConfig(qpqConfig),
15
- });
@@ -1,4 +0,0 @@
1
- import { getConfigGetApplicationInfoActionProcessor } from './getConfigGetApplicationInfoActionProcessor';
2
- export const getConfigActionProcessor = async (qpqConfig, dynamicModuleLoader) => ({
3
- ...(await getConfigGetApplicationInfoActionProcessor(qpqConfig, dynamicModuleLoader)),
4
- });
@@ -1,2 +0,0 @@
1
- import { ActionProcessorListResolver } from 'quidproquo-core';
2
- export declare const getContextListActionProcessor: ActionProcessorListResolver;
@@ -1,9 +0,0 @@
1
- import { actionResult, ContextActionType, } from 'quidproquo-core';
2
- const getProcessContextList = (qpqConfig) => {
3
- return async (payload, session) => {
4
- return actionResult(session.context);
5
- };
6
- };
7
- export const getContextListActionProcessor = async (qpqConfig) => ({
8
- [ContextActionType.List]: getProcessContextList(qpqConfig),
9
- });
@@ -1,2 +0,0 @@
1
- import { ActionProcessorListResolver } from 'quidproquo-core';
2
- export declare const getContextReadActionProcessor: ActionProcessorListResolver;
@@ -1,12 +0,0 @@
1
- import { actionResult, ContextActionType, } from 'quidproquo-core';
2
- const getContextValue = (context, contextIdentifier) => {
3
- return contextIdentifier.uniqueName in context ? context[contextIdentifier.uniqueName] : contextIdentifier.defaultValue;
4
- };
5
- const getProcessContextRead = (qpqConfig) => {
6
- return async ({ contextIdentifier }, session) => {
7
- return actionResult(getContextValue(session.context, contextIdentifier));
8
- };
9
- };
10
- export const getContextReadActionProcessor = async (qpqConfig) => ({
11
- [ContextActionType.Read]: getProcessContextRead(qpqConfig),
12
- });
@@ -1,2 +0,0 @@
1
- import { ActionProcessorListResolver } from 'quidproquo-core';
2
- export declare const getContextActionProcessor: ActionProcessorListResolver;
@@ -1,6 +0,0 @@
1
- import { getContextListActionProcessor } from './getContextListActionProcessor';
2
- import { getContextReadActionProcessor } from './getContextReadActionProcessor';
3
- export const getContextActionProcessor = async (qpqConfig, dynamicModuleLoader) => ({
4
- ...(await getContextListActionProcessor(qpqConfig, dynamicModuleLoader)),
5
- ...(await getContextReadActionProcessor(qpqConfig, dynamicModuleLoader)),
6
- });
@@ -1,2 +0,0 @@
1
- import { ActionProcessorListResolver } from 'quidproquo-core';
2
- export declare const getCustomActionActionProcessor: ActionProcessorListResolver;
@@ -1,43 +0,0 @@
1
- import { qpqCoreUtils } from 'quidproquo-core';
2
- function getActionProcessorListLoader(dynamicModuleLoader, qpqConfig) {
3
- return async function loadModule(qpqFunctionRuntime) {
4
- try {
5
- const possibleModule = await dynamicModuleLoader(qpqFunctionRuntime);
6
- if (typeof possibleModule !== 'function') {
7
- throw new Error(`Expected module to be a function, but got ${typeof possibleModule}`);
8
- }
9
- const apl = await possibleModule(qpqConfig, dynamicModuleLoader);
10
- if (typeof apl !== 'object') {
11
- throw new Error(`Expected action processor list to be an object, but got ${typeof apl}`);
12
- }
13
- if (Object.values(apl).find((aplv) => typeof aplv !== 'function')) {
14
- throw new Error('Expected all action processors to be functions');
15
- }
16
- return apl;
17
- }
18
- catch (e) {
19
- console.log(`Unable to dynamically load action processors: [${e}] ${JSON.stringify(qpqFunctionRuntime)}`);
20
- throw e;
21
- }
22
- };
23
- }
24
- const getProcessCustomAction = async (qpqConfig, dynamicModuleLoader) => {
25
- try {
26
- const actionProcessorListLoader = getActionProcessorListLoader(dynamicModuleLoader, qpqConfig);
27
- const getCustomActionProcessors = qpqCoreUtils.getActionProcessorSources(qpqConfig);
28
- const possibleModuleResults = await Promise.allSettled(getCustomActionProcessors.map(actionProcessorListLoader));
29
- // Filter out successfully loaded modules that are functions
30
- const actionProcessorLists = possibleModuleResults
31
- .filter((result) => result.status === 'fulfilled')
32
- .map((result) => result.value);
33
- return actionProcessorLists.reduce((acc, cur) => ({ ...acc, ...cur }), {});
34
- }
35
- catch (e) {
36
- // This should never get hit, but just in case
37
- console.log(`Unable to dynamically load action processors: [${e}]`);
38
- return {};
39
- }
40
- };
41
- export const getCustomActionActionProcessor = async (qpqConfig, dynamicModuleLoader) => ({
42
- ...(await getProcessCustomAction(qpqConfig, dynamicModuleLoader)),
43
- });
@@ -1 +0,0 @@
1
- export * from './getCustomActionActionProcessor';
@@ -1,2 +0,0 @@
1
- // This is a special one because it just has all the custom ones
2
- export * from './getCustomActionActionProcessor';
@@ -1,2 +0,0 @@
1
- import { ActionProcessorListResolver } from 'quidproquo-core';
2
- export declare const getDateNowActionProcessor: ActionProcessorListResolver;
@@ -1,9 +0,0 @@
1
- import { actionResult, DateActionType } from 'quidproquo-core';
2
- const getProcessDateNow = (qpqConfig) => {
3
- return async () => {
4
- return actionResult(new Date().toISOString());
5
- };
6
- };
7
- export const getDateNowActionProcessor = async (qpqConfig) => ({
8
- [DateActionType.Now]: getProcessDateNow(qpqConfig),
9
- });