quidproquo-actionprocessor-node 0.0.254 → 0.0.255

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 (137) hide show
  1. package/lib/commonjs/actionProcessor/core/claudeAi/getClaudeAiMessagesApiActionProcessor.d.ts +2 -2
  2. package/lib/commonjs/actionProcessor/core/claudeAi/getClaudeAiMessagesApiActionProcessor.js +74 -64
  3. package/lib/commonjs/actionProcessor/core/claudeAi/index.d.ts +2 -2
  4. package/lib/commonjs/actionProcessor/core/claudeAi/index.js +17 -17
  5. package/lib/commonjs/actionProcessor/core/config/getConfigGetApplicationInfoActionProcessor.d.ts +2 -2
  6. package/lib/commonjs/actionProcessor/core/config/getConfigGetApplicationInfoActionProcessor.js +30 -30
  7. package/lib/commonjs/actionProcessor/core/config/index.d.ts +2 -2
  8. package/lib/commonjs/actionProcessor/core/config/index.js +17 -17
  9. package/lib/commonjs/actionProcessor/core/context/getContextListActionProcessor.d.ts +2 -2
  10. package/lib/commonjs/actionProcessor/core/context/getContextListActionProcessor.js +24 -24
  11. package/lib/commonjs/actionProcessor/core/context/getContextReadActionProcessor.d.ts +2 -2
  12. package/lib/commonjs/actionProcessor/core/context/getContextReadActionProcessor.js +27 -27
  13. package/lib/commonjs/actionProcessor/core/context/index.d.ts +2 -2
  14. package/lib/commonjs/actionProcessor/core/context/index.js +18 -18
  15. package/lib/commonjs/actionProcessor/core/customActions/getCustomActionActionProcessor.d.ts +2 -2
  16. package/lib/commonjs/actionProcessor/core/customActions/getCustomActionActionProcessor.js +58 -58
  17. package/lib/commonjs/actionProcessor/core/customActions/index.d.ts +1 -1
  18. package/lib/commonjs/actionProcessor/core/customActions/index.js +18 -18
  19. package/lib/commonjs/actionProcessor/core/date/getDateNowActionProcessor.d.ts +2 -2
  20. package/lib/commonjs/actionProcessor/core/date/getDateNowActionProcessor.js +24 -24
  21. package/lib/commonjs/actionProcessor/core/date/index.d.ts +2 -2
  22. package/lib/commonjs/actionProcessor/core/date/index.js +17 -17
  23. package/lib/commonjs/actionProcessor/core/error/getErrorThrowErrorActionProcessor.d.ts +2 -2
  24. package/lib/commonjs/actionProcessor/core/error/getErrorThrowErrorActionProcessor.js +24 -24
  25. package/lib/commonjs/actionProcessor/core/error/index.d.ts +2 -2
  26. package/lib/commonjs/actionProcessor/core/error/index.js +17 -17
  27. package/lib/commonjs/actionProcessor/core/guid/getGuidNewActionProcessor.d.ts +2 -2
  28. package/lib/commonjs/actionProcessor/core/guid/getGuidNewActionProcessor.js +25 -25
  29. package/lib/commonjs/actionProcessor/core/guid/getGuidNewSortableActionProcessor.d.ts +2 -2
  30. package/lib/commonjs/actionProcessor/core/guid/getGuidNewSortableActionProcessor.js +25 -25
  31. package/lib/commonjs/actionProcessor/core/guid/index.d.ts +2 -2
  32. package/lib/commonjs/actionProcessor/core/guid/index.js +18 -18
  33. package/lib/commonjs/actionProcessor/core/index.d.ts +14 -14
  34. package/lib/commonjs/actionProcessor/core/index.js +54 -54
  35. package/lib/commonjs/actionProcessor/core/log/getLogCreateActionProcessor.d.ts +2 -2
  36. package/lib/commonjs/actionProcessor/core/log/getLogCreateActionProcessor.js +30 -30
  37. package/lib/commonjs/actionProcessor/core/log/getLogDisableEventHistoryActionProcessor.d.ts +2 -2
  38. package/lib/commonjs/actionProcessor/core/log/getLogDisableEventHistoryActionProcessor.js +25 -25
  39. package/lib/commonjs/actionProcessor/core/log/getLogTemplateLiteralActionProcessor.d.ts +2 -2
  40. package/lib/commonjs/actionProcessor/core/log/getLogTemplateLiteralActionProcessor.js +26 -26
  41. package/lib/commonjs/actionProcessor/core/log/index.d.ts +2 -2
  42. package/lib/commonjs/actionProcessor/core/log/index.js +19 -19
  43. package/lib/commonjs/actionProcessor/core/math/getMathRandomNumberActionProcessor.d.ts +2 -2
  44. package/lib/commonjs/actionProcessor/core/math/getMathRandomNumberActionProcessor.js +24 -24
  45. package/lib/commonjs/actionProcessor/core/math/index.d.ts +2 -2
  46. package/lib/commonjs/actionProcessor/core/math/index.js +17 -17
  47. package/lib/commonjs/actionProcessor/core/network/getNetworkRequestActionProcessor.d.ts +2 -2
  48. package/lib/commonjs/actionProcessor/core/network/getNetworkRequestActionProcessor.js +150 -150
  49. package/lib/commonjs/actionProcessor/core/network/index.d.ts +2 -2
  50. package/lib/commonjs/actionProcessor/core/network/index.js +17 -17
  51. package/lib/commonjs/actionProcessor/core/platform/getPlatformDelayActionProcessor.d.ts +2 -2
  52. package/lib/commonjs/actionProcessor/core/platform/getPlatformDelayActionProcessor.js +24 -24
  53. package/lib/commonjs/actionProcessor/core/platform/index.d.ts +2 -2
  54. package/lib/commonjs/actionProcessor/core/platform/index.js +17 -17
  55. package/lib/commonjs/actionProcessor/core/system/getSystemBatchActionProcessor.d.ts +2 -2
  56. package/lib/commonjs/actionProcessor/core/system/getSystemBatchActionProcessor.js +51 -51
  57. package/lib/commonjs/actionProcessor/core/system/index.d.ts +2 -2
  58. package/lib/commonjs/actionProcessor/core/system/index.js +17 -17
  59. package/lib/commonjs/actionProcessor/index.d.ts +2 -2
  60. package/lib/commonjs/actionProcessor/index.js +18 -18
  61. package/lib/commonjs/actionProcessor/webserver/dns/getDnsListActionProcessor.d.ts +2 -2
  62. package/lib/commonjs/actionProcessor/webserver/dns/getDnsListActionProcessor.js +26 -26
  63. package/lib/commonjs/actionProcessor/webserver/dns/index.d.ts +2 -2
  64. package/lib/commonjs/actionProcessor/webserver/dns/index.js +17 -17
  65. package/lib/commonjs/actionProcessor/webserver/index.d.ts +2 -2
  66. package/lib/commonjs/actionProcessor/webserver/index.js +17 -17
  67. package/lib/commonjs/index.d.ts +1 -1
  68. package/lib/commonjs/index.js +17 -17
  69. package/lib/esm/actionProcessor/core/claudeAi/getClaudeAiMessagesApiActionProcessor.d.ts +2 -2
  70. package/lib/esm/actionProcessor/core/claudeAi/getClaudeAiMessagesApiActionProcessor.js +26 -26
  71. package/lib/esm/actionProcessor/core/claudeAi/index.d.ts +2 -2
  72. package/lib/esm/actionProcessor/core/claudeAi/index.js +4 -4
  73. package/lib/esm/actionProcessor/core/config/getConfigGetApplicationInfoActionProcessor.d.ts +2 -2
  74. package/lib/esm/actionProcessor/core/config/getConfigGetApplicationInfoActionProcessor.js +15 -15
  75. package/lib/esm/actionProcessor/core/config/index.d.ts +2 -2
  76. package/lib/esm/actionProcessor/core/config/index.js +4 -4
  77. package/lib/esm/actionProcessor/core/context/getContextListActionProcessor.d.ts +2 -2
  78. package/lib/esm/actionProcessor/core/context/getContextListActionProcessor.js +9 -9
  79. package/lib/esm/actionProcessor/core/context/getContextReadActionProcessor.d.ts +2 -2
  80. package/lib/esm/actionProcessor/core/context/getContextReadActionProcessor.js +12 -12
  81. package/lib/esm/actionProcessor/core/context/index.d.ts +2 -2
  82. package/lib/esm/actionProcessor/core/context/index.js +6 -6
  83. package/lib/esm/actionProcessor/core/customActions/getCustomActionActionProcessor.d.ts +2 -2
  84. package/lib/esm/actionProcessor/core/customActions/getCustomActionActionProcessor.js +43 -43
  85. package/lib/esm/actionProcessor/core/customActions/index.d.ts +1 -1
  86. package/lib/esm/actionProcessor/core/customActions/index.js +2 -2
  87. package/lib/esm/actionProcessor/core/date/getDateNowActionProcessor.d.ts +2 -2
  88. package/lib/esm/actionProcessor/core/date/getDateNowActionProcessor.js +9 -9
  89. package/lib/esm/actionProcessor/core/date/index.d.ts +2 -2
  90. package/lib/esm/actionProcessor/core/date/index.js +4 -4
  91. package/lib/esm/actionProcessor/core/error/getErrorThrowErrorActionProcessor.d.ts +2 -2
  92. package/lib/esm/actionProcessor/core/error/getErrorThrowErrorActionProcessor.js +9 -9
  93. package/lib/esm/actionProcessor/core/error/index.d.ts +2 -2
  94. package/lib/esm/actionProcessor/core/error/index.js +4 -4
  95. package/lib/esm/actionProcessor/core/guid/getGuidNewActionProcessor.d.ts +2 -2
  96. package/lib/esm/actionProcessor/core/guid/getGuidNewActionProcessor.js +10 -10
  97. package/lib/esm/actionProcessor/core/guid/getGuidNewSortableActionProcessor.d.ts +2 -2
  98. package/lib/esm/actionProcessor/core/guid/getGuidNewSortableActionProcessor.js +10 -10
  99. package/lib/esm/actionProcessor/core/guid/index.d.ts +2 -2
  100. package/lib/esm/actionProcessor/core/guid/index.js +6 -6
  101. package/lib/esm/actionProcessor/core/index.d.ts +14 -14
  102. package/lib/esm/actionProcessor/core/index.js +37 -37
  103. package/lib/esm/actionProcessor/core/log/getLogCreateActionProcessor.d.ts +2 -2
  104. package/lib/esm/actionProcessor/core/log/getLogCreateActionProcessor.js +15 -15
  105. package/lib/esm/actionProcessor/core/log/getLogDisableEventHistoryActionProcessor.d.ts +2 -2
  106. package/lib/esm/actionProcessor/core/log/getLogDisableEventHistoryActionProcessor.js +10 -10
  107. package/lib/esm/actionProcessor/core/log/getLogTemplateLiteralActionProcessor.d.ts +2 -2
  108. package/lib/esm/actionProcessor/core/log/getLogTemplateLiteralActionProcessor.js +11 -11
  109. package/lib/esm/actionProcessor/core/log/index.d.ts +2 -2
  110. package/lib/esm/actionProcessor/core/log/index.js +8 -8
  111. package/lib/esm/actionProcessor/core/math/getMathRandomNumberActionProcessor.d.ts +2 -2
  112. package/lib/esm/actionProcessor/core/math/getMathRandomNumberActionProcessor.js +9 -9
  113. package/lib/esm/actionProcessor/core/math/index.d.ts +2 -2
  114. package/lib/esm/actionProcessor/core/math/index.js +4 -4
  115. package/lib/esm/actionProcessor/core/network/getNetworkRequestActionProcessor.d.ts +2 -2
  116. package/lib/esm/actionProcessor/core/network/getNetworkRequestActionProcessor.js +134 -134
  117. package/lib/esm/actionProcessor/core/network/index.d.ts +2 -2
  118. package/lib/esm/actionProcessor/core/network/index.js +4 -4
  119. package/lib/esm/actionProcessor/core/platform/getPlatformDelayActionProcessor.d.ts +2 -2
  120. package/lib/esm/actionProcessor/core/platform/getPlatformDelayActionProcessor.js +9 -9
  121. package/lib/esm/actionProcessor/core/platform/index.d.ts +2 -2
  122. package/lib/esm/actionProcessor/core/platform/index.js +4 -4
  123. package/lib/esm/actionProcessor/core/system/getSystemBatchActionProcessor.d.ts +2 -2
  124. package/lib/esm/actionProcessor/core/system/getSystemBatchActionProcessor.js +36 -36
  125. package/lib/esm/actionProcessor/core/system/index.d.ts +2 -2
  126. package/lib/esm/actionProcessor/core/system/index.js +4 -4
  127. package/lib/esm/actionProcessor/index.d.ts +2 -2
  128. package/lib/esm/actionProcessor/index.js +2 -2
  129. package/lib/esm/actionProcessor/webserver/dns/getDnsListActionProcessor.d.ts +2 -2
  130. package/lib/esm/actionProcessor/webserver/dns/getDnsListActionProcessor.js +11 -11
  131. package/lib/esm/actionProcessor/webserver/dns/index.d.ts +2 -2
  132. package/lib/esm/actionProcessor/webserver/dns/index.js +4 -4
  133. package/lib/esm/actionProcessor/webserver/index.d.ts +2 -2
  134. package/lib/esm/actionProcessor/webserver/index.js +4 -4
  135. package/lib/esm/index.d.ts +1 -1
  136. package/lib/esm/index.js +1 -1
  137. package/package.json +5 -5
@@ -1,134 +1,134 @@
1
- import { actionResult, actionResultError, ErrorTypeEnum, NetworkActionType, } from 'quidproquo-core';
2
- import axios from 'axios';
3
- import { extension } from 'mime-types';
4
- const getAxiosResponseType = (responseType) => {
5
- if (responseType === 'binary') {
6
- return 'arraybuffer';
7
- }
8
- return 'json';
9
- };
10
- const transformResponse = (payload, response) => {
11
- if (payload.responseType === 'binary') {
12
- const headers = response.headers || {};
13
- const mimeType = headers['content-type'] || 'application/octet-stream';
14
- const filename = headers['content-disposition']?.match(/filename="([^"]+)"/)?.[1] || `file.${extension(mimeType)}`;
15
- return {
16
- ...response,
17
- data: {
18
- base64Data: Buffer.from(response.data).toString('base64'),
19
- mimetype: mimeType,
20
- filename,
21
- },
22
- };
23
- }
24
- return response;
25
- };
26
- const axiosInstance = axios.create({
27
- timeout: 25000,
28
- headers: {
29
- // Fixes: https://github.com/axios/axios/issues/5346
30
- 'Accept-Encoding': 'gzip,deflate,compress',
31
- },
32
- validateStatus: () => true,
33
- });
34
- const processNetworkRequestGet = async (payload) => {
35
- const response = await axiosInstance.get(payload.url, {
36
- baseURL: payload.basePath,
37
- headers: payload.headers,
38
- params: payload.params,
39
- responseType: getAxiosResponseType(payload.responseType),
40
- });
41
- return transformResponse(payload, response);
42
- };
43
- const processNetworkRequestPost = async (payload) => {
44
- const response = await axiosInstance.post(payload.url, payload.body, {
45
- baseURL: payload.basePath,
46
- headers: payload.headers,
47
- params: payload.params,
48
- responseType: getAxiosResponseType(payload.responseType),
49
- });
50
- return transformResponse(payload, response);
51
- };
52
- const processNetworkRequestDelete = async (payload) => {
53
- const response = await axiosInstance.delete(payload.url, {
54
- baseURL: payload.basePath,
55
- headers: payload.headers,
56
- params: payload.params,
57
- responseType: getAxiosResponseType(payload.responseType),
58
- });
59
- return transformResponse(payload, response);
60
- };
61
- const processNetworkRequestHead = async (payload) => {
62
- const response = await axiosInstance.head(payload.url, {
63
- baseURL: payload.basePath,
64
- headers: payload.headers,
65
- params: payload.params,
66
- responseType: getAxiosResponseType(payload.responseType),
67
- });
68
- return transformResponse(payload, response);
69
- };
70
- const processNetworkRequestOptions = async (payload) => {
71
- const response = await axiosInstance.options(payload.url, {
72
- baseURL: payload.basePath,
73
- headers: payload.headers,
74
- params: payload.params,
75
- responseType: getAxiosResponseType(payload.responseType),
76
- });
77
- return transformResponse(payload, response);
78
- };
79
- const processNetworkRequestPut = async (payload) => {
80
- const response = await axiosInstance.put(payload.url, payload.body, {
81
- baseURL: payload.basePath,
82
- headers: payload.headers,
83
- params: payload.params,
84
- responseType: getAxiosResponseType(payload.responseType),
85
- });
86
- return transformResponse(payload, response);
87
- };
88
- const processNetworkRequestPatch = async (payload) => {
89
- const response = await axiosInstance.patch(payload.url, payload.body, {
90
- baseURL: payload.basePath,
91
- headers: payload.headers,
92
- params: payload.params,
93
- responseType: getAxiosResponseType(payload.responseType),
94
- });
95
- return transformResponse(payload, response);
96
- };
97
- const processNetworkRequestConnect = async (payload) => {
98
- throw new Error('Function not implemented.');
99
- };
100
- const requestMethodMap = {
101
- GET: processNetworkRequestGet,
102
- POST: processNetworkRequestPost,
103
- DELETE: processNetworkRequestDelete,
104
- HEAD: processNetworkRequestHead,
105
- OPTIONS: processNetworkRequestOptions,
106
- PUT: processNetworkRequestPut,
107
- PATCH: processNetworkRequestPatch,
108
- CONNECT: processNetworkRequestConnect,
109
- };
110
- const getProcessNetworkRequest = (qpqConfig) => {
111
- return async (payload) => {
112
- const requestMethod = requestMethodMap[payload.method];
113
- if (!requestMethod) {
114
- return actionResultError(ErrorTypeEnum.NotImplemented, `${payload.method}: Not implemented`);
115
- }
116
- console.log(payload.url);
117
- try {
118
- const response = await requestMethod(payload);
119
- return actionResult({
120
- headers: response.headers,
121
- status: response.status,
122
- statusText: response.statusText,
123
- data: response.data,
124
- });
125
- }
126
- catch (err) {
127
- console.log(err);
128
- return actionResultError(ErrorTypeEnum.GenericError, err.stack);
129
- }
130
- };
131
- };
132
- export const getNetworkRequestActionProcessor = async (qpqConfig) => ({
133
- [NetworkActionType.Request]: getProcessNetworkRequest(qpqConfig),
134
- });
1
+ import { actionResult, actionResultError, ErrorTypeEnum, NetworkActionType, } from 'quidproquo-core';
2
+ import axios from 'axios';
3
+ import { extension } from 'mime-types';
4
+ const getAxiosResponseType = (responseType) => {
5
+ if (responseType === 'binary') {
6
+ return 'arraybuffer';
7
+ }
8
+ return 'json';
9
+ };
10
+ const transformResponse = (payload, response) => {
11
+ if (payload.responseType === 'binary') {
12
+ const headers = response.headers || {};
13
+ const mimeType = headers['content-type'] || 'application/octet-stream';
14
+ const filename = headers['content-disposition']?.match(/filename="([^"]+)"/)?.[1] || `file.${extension(mimeType)}`;
15
+ return {
16
+ ...response,
17
+ data: {
18
+ base64Data: Buffer.from(response.data).toString('base64'),
19
+ mimetype: mimeType,
20
+ filename,
21
+ },
22
+ };
23
+ }
24
+ return response;
25
+ };
26
+ const axiosInstance = axios.create({
27
+ timeout: 25000,
28
+ headers: {
29
+ // Fixes: https://github.com/axios/axios/issues/5346
30
+ 'Accept-Encoding': 'gzip,deflate,compress',
31
+ },
32
+ validateStatus: () => true,
33
+ });
34
+ const processNetworkRequestGet = async (payload) => {
35
+ const response = await axiosInstance.get(payload.url, {
36
+ baseURL: payload.basePath,
37
+ headers: payload.headers,
38
+ params: payload.params,
39
+ responseType: getAxiosResponseType(payload.responseType),
40
+ });
41
+ return transformResponse(payload, response);
42
+ };
43
+ const processNetworkRequestPost = async (payload) => {
44
+ const response = await axiosInstance.post(payload.url, payload.body, {
45
+ baseURL: payload.basePath,
46
+ headers: payload.headers,
47
+ params: payload.params,
48
+ responseType: getAxiosResponseType(payload.responseType),
49
+ });
50
+ return transformResponse(payload, response);
51
+ };
52
+ const processNetworkRequestDelete = async (payload) => {
53
+ const response = await axiosInstance.delete(payload.url, {
54
+ baseURL: payload.basePath,
55
+ headers: payload.headers,
56
+ params: payload.params,
57
+ responseType: getAxiosResponseType(payload.responseType),
58
+ });
59
+ return transformResponse(payload, response);
60
+ };
61
+ const processNetworkRequestHead = async (payload) => {
62
+ const response = await axiosInstance.head(payload.url, {
63
+ baseURL: payload.basePath,
64
+ headers: payload.headers,
65
+ params: payload.params,
66
+ responseType: getAxiosResponseType(payload.responseType),
67
+ });
68
+ return transformResponse(payload, response);
69
+ };
70
+ const processNetworkRequestOptions = async (payload) => {
71
+ const response = await axiosInstance.options(payload.url, {
72
+ baseURL: payload.basePath,
73
+ headers: payload.headers,
74
+ params: payload.params,
75
+ responseType: getAxiosResponseType(payload.responseType),
76
+ });
77
+ return transformResponse(payload, response);
78
+ };
79
+ const processNetworkRequestPut = async (payload) => {
80
+ const response = await axiosInstance.put(payload.url, payload.body, {
81
+ baseURL: payload.basePath,
82
+ headers: payload.headers,
83
+ params: payload.params,
84
+ responseType: getAxiosResponseType(payload.responseType),
85
+ });
86
+ return transformResponse(payload, response);
87
+ };
88
+ const processNetworkRequestPatch = async (payload) => {
89
+ const response = await axiosInstance.patch(payload.url, payload.body, {
90
+ baseURL: payload.basePath,
91
+ headers: payload.headers,
92
+ params: payload.params,
93
+ responseType: getAxiosResponseType(payload.responseType),
94
+ });
95
+ return transformResponse(payload, response);
96
+ };
97
+ const processNetworkRequestConnect = async (payload) => {
98
+ throw new Error('Function not implemented.');
99
+ };
100
+ const requestMethodMap = {
101
+ GET: processNetworkRequestGet,
102
+ POST: processNetworkRequestPost,
103
+ DELETE: processNetworkRequestDelete,
104
+ HEAD: processNetworkRequestHead,
105
+ OPTIONS: processNetworkRequestOptions,
106
+ PUT: processNetworkRequestPut,
107
+ PATCH: processNetworkRequestPatch,
108
+ CONNECT: processNetworkRequestConnect,
109
+ };
110
+ const getProcessNetworkRequest = (qpqConfig) => {
111
+ return async (payload) => {
112
+ const requestMethod = requestMethodMap[payload.method];
113
+ if (!requestMethod) {
114
+ return actionResultError(ErrorTypeEnum.NotImplemented, `${payload.method}: Not implemented`);
115
+ }
116
+ console.log(payload.url);
117
+ try {
118
+ const response = await requestMethod(payload);
119
+ return actionResult({
120
+ headers: response.headers,
121
+ status: response.status,
122
+ statusText: response.statusText,
123
+ data: response.data,
124
+ });
125
+ }
126
+ catch (err) {
127
+ console.log(err);
128
+ return actionResultError(ErrorTypeEnum.GenericError, err.stack);
129
+ }
130
+ };
131
+ };
132
+ export const getNetworkRequestActionProcessor = async (qpqConfig) => ({
133
+ [NetworkActionType.Request]: getProcessNetworkRequest(qpqConfig),
134
+ });
@@ -1,2 +1,2 @@
1
- import { ActionProcessorListResolver } from 'quidproquo-core';
2
- export declare const getNetworkActionProcessor: ActionProcessorListResolver;
1
+ import { ActionProcessorListResolver } from 'quidproquo-core';
2
+ export declare const getNetworkActionProcessor: ActionProcessorListResolver;
@@ -1,4 +1,4 @@
1
- import { getNetworkRequestActionProcessor } from './getNetworkRequestActionProcessor';
2
- export const getNetworkActionProcessor = async (qpqConfig, dynamicModuleLoader) => ({
3
- ...(await getNetworkRequestActionProcessor(qpqConfig, dynamicModuleLoader)),
4
- });
1
+ import { getNetworkRequestActionProcessor } from './getNetworkRequestActionProcessor';
2
+ export const getNetworkActionProcessor = async (qpqConfig, dynamicModuleLoader) => ({
3
+ ...(await getNetworkRequestActionProcessor(qpqConfig, dynamicModuleLoader)),
4
+ });
@@ -1,2 +1,2 @@
1
- import { ActionProcessorListResolver } from 'quidproquo-core';
2
- export declare const getPlatformDelayActionProcessor: ActionProcessorListResolver;
1
+ import { ActionProcessorListResolver } from 'quidproquo-core';
2
+ export declare const getPlatformDelayActionProcessor: ActionProcessorListResolver;
@@ -1,9 +1,9 @@
1
- import { actionResult, PlatformActionType, } from 'quidproquo-core';
2
- const getProcessPlatformDelay = (qpqConfig) => {
3
- return async ({ timeMs }) => {
4
- return new Promise((resolve) => setTimeout(() => resolve(actionResult(undefined)), timeMs));
5
- };
6
- };
7
- export const getPlatformDelayActionProcessor = async (qpqConfig) => ({
8
- [PlatformActionType.Delay]: getProcessPlatformDelay(qpqConfig),
9
- });
1
+ import { actionResult, PlatformActionType, } from 'quidproquo-core';
2
+ const getProcessPlatformDelay = (qpqConfig) => {
3
+ return async ({ timeMs }) => {
4
+ return new Promise((resolve) => setTimeout(() => resolve(actionResult(undefined)), timeMs));
5
+ };
6
+ };
7
+ export const getPlatformDelayActionProcessor = async (qpqConfig) => ({
8
+ [PlatformActionType.Delay]: getProcessPlatformDelay(qpqConfig),
9
+ });
@@ -1,2 +1,2 @@
1
- import { ActionProcessorListResolver } from 'quidproquo-core';
2
- export declare const getPlatformActionProcessor: ActionProcessorListResolver;
1
+ import { ActionProcessorListResolver } from 'quidproquo-core';
2
+ export declare const getPlatformActionProcessor: ActionProcessorListResolver;
@@ -1,4 +1,4 @@
1
- import { getPlatformDelayActionProcessor } from './getPlatformDelayActionProcessor';
2
- export const getPlatformActionProcessor = async (qpqConfig, dynamicModuleLoader) => ({
3
- ...(await getPlatformDelayActionProcessor(qpqConfig, dynamicModuleLoader)),
4
- });
1
+ import { getPlatformDelayActionProcessor } from './getPlatformDelayActionProcessor';
2
+ export const getPlatformActionProcessor = async (qpqConfig, dynamicModuleLoader) => ({
3
+ ...(await getPlatformDelayActionProcessor(qpqConfig, dynamicModuleLoader)),
4
+ });
@@ -1,2 +1,2 @@
1
- import { ActionProcessorListResolver } from 'quidproquo-core';
2
- export declare const getSystemBatchActionProcessor: ActionProcessorListResolver;
1
+ import { ActionProcessorListResolver } from 'quidproquo-core';
2
+ export declare const getSystemBatchActionProcessor: ActionProcessorListResolver;
@@ -1,36 +1,36 @@
1
- import { actionResult, actionResultError, isErroredActionResult, processAction, resolveActionResult, resolveActionResultError, SystemActionType, } from 'quidproquo-core';
2
- const getProcessSystemBatch = (qpqConfig) => {
3
- return async (payload, session, actionProcessors, logger, updateSession, dynamicModuleLoader) => {
4
- // console.log('~~~~~~~~~~~ RUNNING BATCH ~~~~~~~~~: ', payload);
5
- const batchRes = await Promise.all(payload.actions.map((a) => processAction(a, actionProcessors, session, logger, updateSession, dynamicModuleLoader)));
6
- // console.log('~~~~~~~~~~~ RESULT BATCH ~~~~~~~~~: ', batchRes);
7
- // If there was an error, that does not want to be returned, throw that error back
8
- const erroredBatchItem = batchRes.find((br, i) => isErroredActionResult(br) && !payload.actions[i].returnErrors);
9
- if (erroredBatchItem) {
10
- const error = resolveActionResultError(erroredBatchItem);
11
- return actionResultError(error.errorType, error.errorText, error.errorStack);
12
- }
13
- // unwrap the values
14
- return actionResult(batchRes.map((br, i) => {
15
- // If we want to return errors, return the either result.
16
- if (payload.actions[i].returnErrors) {
17
- const isSuccess = !isErroredActionResult(br);
18
- const result = isSuccess
19
- ? {
20
- success: true,
21
- result: resolveActionResult(br),
22
- }
23
- : {
24
- success: false,
25
- error: resolveActionResultError(br),
26
- };
27
- return result;
28
- }
29
- // return the resolved result
30
- return resolveActionResult(br);
31
- }));
32
- };
33
- };
34
- export const getSystemBatchActionProcessor = async (qpqConfig) => ({
35
- [SystemActionType.Batch]: getProcessSystemBatch(qpqConfig),
36
- });
1
+ import { actionResult, actionResultError, isErroredActionResult, processAction, resolveActionResult, resolveActionResultError, SystemActionType, } from 'quidproquo-core';
2
+ const getProcessSystemBatch = (qpqConfig) => {
3
+ return async (payload, session, actionProcessors, logger, updateSession, dynamicModuleLoader) => {
4
+ // console.log('~~~~~~~~~~~ RUNNING BATCH ~~~~~~~~~: ', payload);
5
+ const batchRes = await Promise.all(payload.actions.map((a) => processAction(a, actionProcessors, session, logger, updateSession, dynamicModuleLoader)));
6
+ // console.log('~~~~~~~~~~~ RESULT BATCH ~~~~~~~~~: ', batchRes);
7
+ // If there was an error, that does not want to be returned, throw that error back
8
+ const erroredBatchItem = batchRes.find((br, i) => isErroredActionResult(br) && !payload.actions[i].returnErrors);
9
+ if (erroredBatchItem) {
10
+ const error = resolveActionResultError(erroredBatchItem);
11
+ return actionResultError(error.errorType, error.errorText, error.errorStack);
12
+ }
13
+ // unwrap the values
14
+ return actionResult(batchRes.map((br, i) => {
15
+ // If we want to return errors, return the either result.
16
+ if (payload.actions[i].returnErrors) {
17
+ const isSuccess = !isErroredActionResult(br);
18
+ const result = isSuccess
19
+ ? {
20
+ success: true,
21
+ result: resolveActionResult(br),
22
+ }
23
+ : {
24
+ success: false,
25
+ error: resolveActionResultError(br),
26
+ };
27
+ return result;
28
+ }
29
+ // return the resolved result
30
+ return resolveActionResult(br);
31
+ }));
32
+ };
33
+ };
34
+ export const getSystemBatchActionProcessor = async (qpqConfig) => ({
35
+ [SystemActionType.Batch]: getProcessSystemBatch(qpqConfig),
36
+ });
@@ -1,2 +1,2 @@
1
- import { ActionProcessorListResolver } from 'quidproquo-core';
2
- export declare const getSystemActionProcessor: ActionProcessorListResolver;
1
+ import { ActionProcessorListResolver } from 'quidproquo-core';
2
+ export declare const getSystemActionProcessor: ActionProcessorListResolver;
@@ -1,4 +1,4 @@
1
- import { getSystemBatchActionProcessor } from './getSystemBatchActionProcessor';
2
- export const getSystemActionProcessor = async (qpqConfig, dynamicModuleLoader) => ({
3
- ...(await getSystemBatchActionProcessor(qpqConfig, dynamicModuleLoader)),
4
- });
1
+ import { getSystemBatchActionProcessor } from './getSystemBatchActionProcessor';
2
+ export const getSystemActionProcessor = async (qpqConfig, dynamicModuleLoader) => ({
3
+ ...(await getSystemBatchActionProcessor(qpqConfig, dynamicModuleLoader)),
4
+ });
@@ -1,2 +1,2 @@
1
- export * from './core';
2
- export * from './webserver';
1
+ export * from './core';
2
+ export * from './webserver';
@@ -1,2 +1,2 @@
1
- export * from './core';
2
- export * from './webserver';
1
+ export * from './core';
2
+ export * from './webserver';
@@ -1,2 +1,2 @@
1
- import { ActionProcessorListResolver } from 'quidproquo-core';
2
- export declare const getDnsListActionProcessor: ActionProcessorListResolver;
1
+ import { ActionProcessorListResolver } from 'quidproquo-core';
2
+ export declare const getDnsListActionProcessor: ActionProcessorListResolver;
@@ -1,11 +1,11 @@
1
- import { actionResult } from 'quidproquo-core';
2
- import { DnsActionType, qpqWebServerUtils } from 'quidproquo-webserver';
3
- const getProcessDnsList = (qpqConfig) => {
4
- return async () => {
5
- const dnsList = qpqWebServerUtils.getDnsConfigs(qpqConfig).map((dc) => dc.dnsBase);
6
- return actionResult(dnsList);
7
- };
8
- };
9
- export const getDnsListActionProcessor = async (qpqConfig) => ({
10
- [DnsActionType.List]: getProcessDnsList(qpqConfig),
11
- });
1
+ import { actionResult } from 'quidproquo-core';
2
+ import { DnsActionType, qpqWebServerUtils } from 'quidproquo-webserver';
3
+ const getProcessDnsList = (qpqConfig) => {
4
+ return async () => {
5
+ const dnsList = qpqWebServerUtils.getDnsConfigs(qpqConfig).map((dc) => dc.dnsBase);
6
+ return actionResult(dnsList);
7
+ };
8
+ };
9
+ export const getDnsListActionProcessor = async (qpqConfig) => ({
10
+ [DnsActionType.List]: getProcessDnsList(qpqConfig),
11
+ });
@@ -1,2 +1,2 @@
1
- import { ActionProcessorListResolver } from 'quidproquo-core';
2
- export declare const getDnsActionProcessor: ActionProcessorListResolver;
1
+ import { ActionProcessorListResolver } from 'quidproquo-core';
2
+ export declare const getDnsActionProcessor: ActionProcessorListResolver;
@@ -1,4 +1,4 @@
1
- import { getDnsListActionProcessor } from './getDnsListActionProcessor';
2
- export const getDnsActionProcessor = async (qpqConfig, dynamicModuleLoader) => ({
3
- ...(await getDnsListActionProcessor(qpqConfig, dynamicModuleLoader)),
4
- });
1
+ import { getDnsListActionProcessor } from './getDnsListActionProcessor';
2
+ export const getDnsActionProcessor = async (qpqConfig, dynamicModuleLoader) => ({
3
+ ...(await getDnsListActionProcessor(qpqConfig, dynamicModuleLoader)),
4
+ });
@@ -1,2 +1,2 @@
1
- import { ActionProcessorListResolver } from 'quidproquo-core';
2
- export declare const getWebserverActionProcessor: ActionProcessorListResolver;
1
+ import { ActionProcessorListResolver } from 'quidproquo-core';
2
+ export declare const getWebserverActionProcessor: ActionProcessorListResolver;
@@ -1,4 +1,4 @@
1
- import { getDnsActionProcessor } from './dns';
2
- export const getWebserverActionProcessor = async (qpqConfig, dynamicModuleLoader) => ({
3
- ...(await getDnsActionProcessor(qpqConfig, dynamicModuleLoader)),
4
- });
1
+ import { getDnsActionProcessor } from './dns';
2
+ export const getWebserverActionProcessor = async (qpqConfig, dynamicModuleLoader) => ({
3
+ ...(await getDnsActionProcessor(qpqConfig, dynamicModuleLoader)),
4
+ });
@@ -1 +1 @@
1
- export * from './actionProcessor';
1
+ export * from './actionProcessor';
package/lib/esm/index.js CHANGED
@@ -1 +1 @@
1
- export * from './actionProcessor';
1
+ export * from './actionProcessor';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quidproquo-actionprocessor-node",
3
- "version": "0.0.254",
3
+ "version": "0.0.255",
4
4
  "description": "",
5
5
  "main": "./lib/commonjs/index.js",
6
6
  "module": "./lib/esm/index.js",
@@ -35,15 +35,15 @@
35
35
  "@anthropic-ai/sdk": "^0.19.1",
36
36
  "axios": "^1.2.1",
37
37
  "mime-types": "^2.1.35",
38
- "quidproquo-core": "0.0.254",
39
- "quidproquo-webserver": "0.0.254",
38
+ "quidproquo-core": "0.0.255",
39
+ "quidproquo-webserver": "0.0.255",
40
40
  "uuid": "^9.0.0",
41
41
  "uuidv7": "^1.0.1"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/mime-types": "^2.1.1",
45
45
  "@types/uuid": "^9.0.0",
46
- "quidproquo-tsconfig": "0.0.254",
47
- "typescript": "^4.9.3"
46
+ "quidproquo-tsconfig": "0.0.255",
47
+ "typescript": "^5.8.2"
48
48
  }
49
49
  }