quidproquo-actionprocessor-node 0.0.263 → 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.
- package/lib/commonjs/actionProcessor/core/index.d.ts +0 -12
- package/lib/commonjs/actionProcessor/core/index.js +6 -25
- package/lib/commonjs/actionProcessor/core/inlineFunction/getInlineFunctionExecuteActionProcessor.js +1 -0
- package/lib/commonjs/actionProcessor/webserver/index.js +4 -2
- package/lib/commonjs/dynamicActionProcessor/file/getFileDeleteActionProcessor.js +7 -4
- package/lib/commonjs/dynamicActionProcessor/file/getFileExistsActionProcessor.js +10 -4
- package/lib/commonjs/dynamicActionProcessor/file/getFileGenerateTemporarySecureUrlActionProcessor.js +1 -2
- package/lib/commonjs/dynamicActionProcessor/file/getFileGenerateTemporaryUploadSecureUrlActionProcessor.js +1 -2
- package/lib/commonjs/dynamicActionProcessor/file/getFileListDirectoryActionProcessor.js +6 -9
- package/lib/commonjs/dynamicActionProcessor/file/getFileReadBinaryContentsActionProcessor.js +4 -6
- package/lib/commonjs/dynamicActionProcessor/file/getFileReadObjectJsonActionProcessor.js +5 -9
- package/lib/commonjs/dynamicActionProcessor/file/getFileReadTextContentsActionProcessor.js +4 -6
- package/lib/commonjs/dynamicActionProcessor/file/getFileStreamOpenActionProcessor.js +6 -7
- package/lib/commonjs/dynamicActionProcessor/file/getFileWriteBinaryContentsActionProcessor.js +10 -3
- package/lib/commonjs/dynamicActionProcessor/file/getFileWriteObjectJsonActionProcessor.js +4 -3
- package/lib/commonjs/dynamicActionProcessor/file/getFileWriteTextContentsActionProcessor.js +4 -3
- package/lib/commonjs/dynamicActionProcessor/file/utils.d.ts +2 -1
- package/lib/commonjs/dynamicActionProcessor/file/utils.js +11 -1
- package/lib/esm/actionProcessor/core/index.d.ts +0 -12
- package/lib/esm/actionProcessor/core/index.js +6 -35
- package/lib/esm/actionProcessor/core/inlineFunction/getInlineFunctionExecuteActionProcessor.js +1 -0
- package/lib/esm/actionProcessor/webserver/index.js +4 -2
- package/lib/esm/dynamicActionProcessor/file/getFileDeleteActionProcessor.js +8 -5
- package/lib/esm/dynamicActionProcessor/file/getFileExistsActionProcessor.js +11 -5
- package/lib/esm/dynamicActionProcessor/file/getFileGenerateTemporarySecureUrlActionProcessor.js +2 -3
- package/lib/esm/dynamicActionProcessor/file/getFileGenerateTemporaryUploadSecureUrlActionProcessor.js +2 -3
- package/lib/esm/dynamicActionProcessor/file/getFileListDirectoryActionProcessor.js +7 -10
- package/lib/esm/dynamicActionProcessor/file/getFileReadBinaryContentsActionProcessor.js +5 -7
- package/lib/esm/dynamicActionProcessor/file/getFileReadObjectJsonActionProcessor.js +6 -10
- package/lib/esm/dynamicActionProcessor/file/getFileReadTextContentsActionProcessor.js +5 -7
- package/lib/esm/dynamicActionProcessor/file/getFileStreamOpenActionProcessor.js +7 -8
- package/lib/esm/dynamicActionProcessor/file/getFileWriteBinaryContentsActionProcessor.js +11 -4
- package/lib/esm/dynamicActionProcessor/file/getFileWriteObjectJsonActionProcessor.js +5 -4
- package/lib/esm/dynamicActionProcessor/file/getFileWriteTextContentsActionProcessor.js +5 -4
- package/lib/esm/dynamicActionProcessor/file/utils.d.ts +2 -1
- package/lib/esm/dynamicActionProcessor/file/utils.js +9 -1
- package/package.json +5 -9
- package/lib/commonjs/actionProcessor/core/claudeAi/getClaudeAiMessagesApiActionProcessor.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/claudeAi/getClaudeAiMessagesApiActionProcessor.js +0 -74
- package/lib/commonjs/actionProcessor/core/claudeAi/index.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/claudeAi/index.js +0 -17
- package/lib/commonjs/actionProcessor/core/config/getConfigGetApplicationInfoActionProcessor.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/config/getConfigGetApplicationInfoActionProcessor.js +0 -30
- package/lib/commonjs/actionProcessor/core/config/index.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/config/index.js +0 -17
- package/lib/commonjs/actionProcessor/core/context/getContextListActionProcessor.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/context/getContextListActionProcessor.js +0 -24
- package/lib/commonjs/actionProcessor/core/context/getContextReadActionProcessor.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/context/getContextReadActionProcessor.js +0 -27
- package/lib/commonjs/actionProcessor/core/context/index.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/context/index.js +0 -18
- package/lib/commonjs/actionProcessor/core/customActions/getCustomActionActionProcessor.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/customActions/getCustomActionActionProcessor.js +0 -58
- package/lib/commonjs/actionProcessor/core/customActions/index.d.ts +0 -1
- package/lib/commonjs/actionProcessor/core/customActions/index.js +0 -18
- package/lib/commonjs/actionProcessor/core/date/getDateNowActionProcessor.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/date/getDateNowActionProcessor.js +0 -24
- package/lib/commonjs/actionProcessor/core/date/index.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/date/index.js +0 -17
- package/lib/commonjs/actionProcessor/core/error/getErrorThrowErrorActionProcessor.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/error/getErrorThrowErrorActionProcessor.js +0 -24
- package/lib/commonjs/actionProcessor/core/error/index.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/error/index.js +0 -17
- package/lib/commonjs/actionProcessor/core/guid/getGuidNewActionProcessor.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/guid/getGuidNewActionProcessor.js +0 -25
- package/lib/commonjs/actionProcessor/core/guid/getGuidNewSortableActionProcessor.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/guid/getGuidNewSortableActionProcessor.js +0 -25
- package/lib/commonjs/actionProcessor/core/guid/index.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/guid/index.js +0 -18
- package/lib/commonjs/actionProcessor/core/log/getLogCreateActionProcessor.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/log/getLogCreateActionProcessor.js +0 -30
- package/lib/commonjs/actionProcessor/core/log/getLogDisableEventHistoryActionProcessor.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/log/getLogDisableEventHistoryActionProcessor.js +0 -25
- package/lib/commonjs/actionProcessor/core/log/getLogTemplateLiteralActionProcessor.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/log/getLogTemplateLiteralActionProcessor.js +0 -26
- package/lib/commonjs/actionProcessor/core/log/index.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/log/index.js +0 -19
- package/lib/commonjs/actionProcessor/core/math/getMathRandomNumberActionProcessor.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/math/getMathRandomNumberActionProcessor.js +0 -24
- package/lib/commonjs/actionProcessor/core/math/index.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/math/index.js +0 -17
- package/lib/commonjs/actionProcessor/core/network/getNetworkRequestActionProcessor.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/network/getNetworkRequestActionProcessor.js +0 -153
- package/lib/commonjs/actionProcessor/core/network/index.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/network/index.js +0 -17
- package/lib/commonjs/actionProcessor/core/platform/getPlatformDelayActionProcessor.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/platform/getPlatformDelayActionProcessor.js +0 -24
- package/lib/commonjs/actionProcessor/core/platform/index.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/platform/index.js +0 -17
- package/lib/commonjs/actionProcessor/core/system/getSystemBatchActionProcessor.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/system/getSystemBatchActionProcessor.js +0 -51
- package/lib/commonjs/actionProcessor/core/system/index.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/system/index.js +0 -17
- package/lib/commonjs/actionProcessor/webserver/dns/getDnsListActionProcessor.d.ts +0 -2
- package/lib/commonjs/actionProcessor/webserver/dns/getDnsListActionProcessor.js +0 -26
- package/lib/commonjs/actionProcessor/webserver/dns/index.d.ts +0 -2
- package/lib/commonjs/actionProcessor/webserver/dns/index.js +0 -17
- package/lib/esm/actionProcessor/core/claudeAi/getClaudeAiMessagesApiActionProcessor.d.ts +0 -2
- package/lib/esm/actionProcessor/core/claudeAi/getClaudeAiMessagesApiActionProcessor.js +0 -26
- package/lib/esm/actionProcessor/core/claudeAi/index.d.ts +0 -2
- package/lib/esm/actionProcessor/core/claudeAi/index.js +0 -4
- package/lib/esm/actionProcessor/core/config/getConfigGetApplicationInfoActionProcessor.d.ts +0 -2
- package/lib/esm/actionProcessor/core/config/getConfigGetApplicationInfoActionProcessor.js +0 -15
- package/lib/esm/actionProcessor/core/config/index.d.ts +0 -2
- package/lib/esm/actionProcessor/core/config/index.js +0 -4
- package/lib/esm/actionProcessor/core/context/getContextListActionProcessor.d.ts +0 -2
- package/lib/esm/actionProcessor/core/context/getContextListActionProcessor.js +0 -9
- package/lib/esm/actionProcessor/core/context/getContextReadActionProcessor.d.ts +0 -2
- package/lib/esm/actionProcessor/core/context/getContextReadActionProcessor.js +0 -12
- package/lib/esm/actionProcessor/core/context/index.d.ts +0 -2
- package/lib/esm/actionProcessor/core/context/index.js +0 -6
- package/lib/esm/actionProcessor/core/customActions/getCustomActionActionProcessor.d.ts +0 -2
- package/lib/esm/actionProcessor/core/customActions/getCustomActionActionProcessor.js +0 -43
- package/lib/esm/actionProcessor/core/customActions/index.d.ts +0 -1
- package/lib/esm/actionProcessor/core/customActions/index.js +0 -2
- package/lib/esm/actionProcessor/core/date/getDateNowActionProcessor.d.ts +0 -2
- package/lib/esm/actionProcessor/core/date/getDateNowActionProcessor.js +0 -9
- package/lib/esm/actionProcessor/core/date/index.d.ts +0 -2
- package/lib/esm/actionProcessor/core/date/index.js +0 -4
- package/lib/esm/actionProcessor/core/error/getErrorThrowErrorActionProcessor.d.ts +0 -2
- package/lib/esm/actionProcessor/core/error/getErrorThrowErrorActionProcessor.js +0 -9
- package/lib/esm/actionProcessor/core/error/index.d.ts +0 -2
- package/lib/esm/actionProcessor/core/error/index.js +0 -4
- package/lib/esm/actionProcessor/core/guid/getGuidNewActionProcessor.d.ts +0 -2
- package/lib/esm/actionProcessor/core/guid/getGuidNewActionProcessor.js +0 -10
- package/lib/esm/actionProcessor/core/guid/getGuidNewSortableActionProcessor.d.ts +0 -2
- package/lib/esm/actionProcessor/core/guid/getGuidNewSortableActionProcessor.js +0 -10
- package/lib/esm/actionProcessor/core/guid/index.d.ts +0 -2
- package/lib/esm/actionProcessor/core/guid/index.js +0 -6
- package/lib/esm/actionProcessor/core/log/getLogCreateActionProcessor.d.ts +0 -2
- package/lib/esm/actionProcessor/core/log/getLogCreateActionProcessor.js +0 -15
- package/lib/esm/actionProcessor/core/log/getLogDisableEventHistoryActionProcessor.d.ts +0 -2
- package/lib/esm/actionProcessor/core/log/getLogDisableEventHistoryActionProcessor.js +0 -10
- package/lib/esm/actionProcessor/core/log/getLogTemplateLiteralActionProcessor.d.ts +0 -2
- package/lib/esm/actionProcessor/core/log/getLogTemplateLiteralActionProcessor.js +0 -11
- package/lib/esm/actionProcessor/core/log/index.d.ts +0 -2
- package/lib/esm/actionProcessor/core/log/index.js +0 -8
- package/lib/esm/actionProcessor/core/math/getMathRandomNumberActionProcessor.d.ts +0 -2
- package/lib/esm/actionProcessor/core/math/getMathRandomNumberActionProcessor.js +0 -9
- package/lib/esm/actionProcessor/core/math/index.d.ts +0 -2
- package/lib/esm/actionProcessor/core/math/index.js +0 -4
- package/lib/esm/actionProcessor/core/network/getNetworkRequestActionProcessor.d.ts +0 -2
- package/lib/esm/actionProcessor/core/network/getNetworkRequestActionProcessor.js +0 -137
- package/lib/esm/actionProcessor/core/network/index.d.ts +0 -2
- package/lib/esm/actionProcessor/core/network/index.js +0 -4
- package/lib/esm/actionProcessor/core/platform/getPlatformDelayActionProcessor.d.ts +0 -2
- package/lib/esm/actionProcessor/core/platform/getPlatformDelayActionProcessor.js +0 -9
- package/lib/esm/actionProcessor/core/platform/index.d.ts +0 -2
- package/lib/esm/actionProcessor/core/platform/index.js +0 -4
- package/lib/esm/actionProcessor/core/system/getSystemBatchActionProcessor.d.ts +0 -2
- package/lib/esm/actionProcessor/core/system/getSystemBatchActionProcessor.js +0 -36
- package/lib/esm/actionProcessor/core/system/index.d.ts +0 -2
- package/lib/esm/actionProcessor/core/system/index.js +0 -4
- package/lib/esm/actionProcessor/webserver/dns/getDnsListActionProcessor.d.ts +0 -2
- package/lib/esm/actionProcessor/webserver/dns/getDnsListActionProcessor.js +0 -11
- package/lib/esm/actionProcessor/webserver/dns/index.d.ts +0 -2
- package/lib/esm/actionProcessor/webserver/dns/index.js +0 -4
|
@@ -1,137 +0,0 @@
|
|
|
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
|
-
if (responseType === 'text') {
|
|
9
|
-
return 'text';
|
|
10
|
-
}
|
|
11
|
-
return 'json';
|
|
12
|
-
};
|
|
13
|
-
const transformResponse = (payload, response) => {
|
|
14
|
-
if (payload.responseType === 'binary') {
|
|
15
|
-
const headers = response.headers || {};
|
|
16
|
-
const mimeType = headers['content-type'] || 'application/octet-stream';
|
|
17
|
-
const filename = headers['content-disposition']?.match(/filename="([^"]+)"/)?.[1] || `file.${extension(mimeType)}`;
|
|
18
|
-
return {
|
|
19
|
-
...response,
|
|
20
|
-
data: {
|
|
21
|
-
base64Data: Buffer.from(response.data).toString('base64'),
|
|
22
|
-
mimetype: mimeType,
|
|
23
|
-
filename,
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
return response;
|
|
28
|
-
};
|
|
29
|
-
const axiosInstance = axios.create({
|
|
30
|
-
timeout: 25000,
|
|
31
|
-
headers: {
|
|
32
|
-
// Fixes: https://github.com/axios/axios/issues/5346
|
|
33
|
-
'Accept-Encoding': 'gzip,deflate,compress',
|
|
34
|
-
},
|
|
35
|
-
validateStatus: () => true,
|
|
36
|
-
});
|
|
37
|
-
const processNetworkRequestGet = async (payload) => {
|
|
38
|
-
const response = await axiosInstance.get(payload.url, {
|
|
39
|
-
baseURL: payload.basePath,
|
|
40
|
-
headers: payload.headers,
|
|
41
|
-
params: payload.params,
|
|
42
|
-
responseType: getAxiosResponseType(payload.responseType),
|
|
43
|
-
});
|
|
44
|
-
return transformResponse(payload, response);
|
|
45
|
-
};
|
|
46
|
-
const processNetworkRequestPost = async (payload) => {
|
|
47
|
-
const response = await axiosInstance.post(payload.url, payload.body, {
|
|
48
|
-
baseURL: payload.basePath,
|
|
49
|
-
headers: payload.headers,
|
|
50
|
-
params: payload.params,
|
|
51
|
-
responseType: getAxiosResponseType(payload.responseType),
|
|
52
|
-
});
|
|
53
|
-
return transformResponse(payload, response);
|
|
54
|
-
};
|
|
55
|
-
const processNetworkRequestDelete = async (payload) => {
|
|
56
|
-
const response = await axiosInstance.delete(payload.url, {
|
|
57
|
-
baseURL: payload.basePath,
|
|
58
|
-
headers: payload.headers,
|
|
59
|
-
params: payload.params,
|
|
60
|
-
responseType: getAxiosResponseType(payload.responseType),
|
|
61
|
-
});
|
|
62
|
-
return transformResponse(payload, response);
|
|
63
|
-
};
|
|
64
|
-
const processNetworkRequestHead = async (payload) => {
|
|
65
|
-
const response = await axiosInstance.head(payload.url, {
|
|
66
|
-
baseURL: payload.basePath,
|
|
67
|
-
headers: payload.headers,
|
|
68
|
-
params: payload.params,
|
|
69
|
-
responseType: getAxiosResponseType(payload.responseType),
|
|
70
|
-
});
|
|
71
|
-
return transformResponse(payload, response);
|
|
72
|
-
};
|
|
73
|
-
const processNetworkRequestOptions = async (payload) => {
|
|
74
|
-
const response = await axiosInstance.options(payload.url, {
|
|
75
|
-
baseURL: payload.basePath,
|
|
76
|
-
headers: payload.headers,
|
|
77
|
-
params: payload.params,
|
|
78
|
-
responseType: getAxiosResponseType(payload.responseType),
|
|
79
|
-
});
|
|
80
|
-
return transformResponse(payload, response);
|
|
81
|
-
};
|
|
82
|
-
const processNetworkRequestPut = async (payload) => {
|
|
83
|
-
const response = await axiosInstance.put(payload.url, payload.body, {
|
|
84
|
-
baseURL: payload.basePath,
|
|
85
|
-
headers: payload.headers,
|
|
86
|
-
params: payload.params,
|
|
87
|
-
responseType: getAxiosResponseType(payload.responseType),
|
|
88
|
-
});
|
|
89
|
-
return transformResponse(payload, response);
|
|
90
|
-
};
|
|
91
|
-
const processNetworkRequestPatch = async (payload) => {
|
|
92
|
-
const response = await axiosInstance.patch(payload.url, payload.body, {
|
|
93
|
-
baseURL: payload.basePath,
|
|
94
|
-
headers: payload.headers,
|
|
95
|
-
params: payload.params,
|
|
96
|
-
responseType: getAxiosResponseType(payload.responseType),
|
|
97
|
-
});
|
|
98
|
-
return transformResponse(payload, response);
|
|
99
|
-
};
|
|
100
|
-
const processNetworkRequestConnect = async (payload) => {
|
|
101
|
-
throw new Error('Function not implemented.');
|
|
102
|
-
};
|
|
103
|
-
const requestMethodMap = {
|
|
104
|
-
GET: processNetworkRequestGet,
|
|
105
|
-
POST: processNetworkRequestPost,
|
|
106
|
-
DELETE: processNetworkRequestDelete,
|
|
107
|
-
HEAD: processNetworkRequestHead,
|
|
108
|
-
OPTIONS: processNetworkRequestOptions,
|
|
109
|
-
PUT: processNetworkRequestPut,
|
|
110
|
-
PATCH: processNetworkRequestPatch,
|
|
111
|
-
CONNECT: processNetworkRequestConnect,
|
|
112
|
-
};
|
|
113
|
-
const getProcessNetworkRequest = (qpqConfig) => {
|
|
114
|
-
return async (payload) => {
|
|
115
|
-
const requestMethod = requestMethodMap[payload.method];
|
|
116
|
-
if (!requestMethod) {
|
|
117
|
-
return actionResultError(ErrorTypeEnum.NotImplemented, `${payload.method}: Not implemented`);
|
|
118
|
-
}
|
|
119
|
-
console.log(payload.url);
|
|
120
|
-
try {
|
|
121
|
-
const response = await requestMethod(payload);
|
|
122
|
-
return actionResult({
|
|
123
|
-
headers: response.headers,
|
|
124
|
-
status: response.status,
|
|
125
|
-
statusText: response.statusText,
|
|
126
|
-
data: response.data,
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
catch (err) {
|
|
130
|
-
console.log(err);
|
|
131
|
-
return actionResultError(ErrorTypeEnum.GenericError, err.stack);
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
};
|
|
135
|
-
export const getNetworkRequestActionProcessor = async (qpqConfig) => ({
|
|
136
|
-
[NetworkActionType.Request]: getProcessNetworkRequest(qpqConfig),
|
|
137
|
-
});
|
|
@@ -1,9 +0,0 @@
|
|
|
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,36 +0,0 @@
|
|
|
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, streamRegistry) => {
|
|
4
|
-
// console.log('~~~~~~~~~~~ RUNNING BATCH ~~~~~~~~~: ', payload);
|
|
5
|
-
const batchRes = await Promise.all(payload.actions.map((a) => processAction(a, actionProcessors, session, logger, updateSession, dynamicModuleLoader, streamRegistry)));
|
|
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,11 +0,0 @@
|
|
|
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
|
-
});
|