@intuned/runtime 1.3.1 → 1.3.3
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.
|
@@ -139,14 +139,15 @@ async function runApi({
|
|
|
139
139
|
}
|
|
140
140
|
(0, _cleanEnvironmentVariables.cleanEnvironmentVariables)();
|
|
141
141
|
const automationFunctionParameters = [...(params !== undefined ? [params] : []), page, context];
|
|
142
|
-
const MAX_RESULT_SIZE_BYTES = 2 * 1024 * 1024;
|
|
143
|
-
const resultSizeInBytes = getObjectSizeInBytes(result);
|
|
144
|
-
if (resultSizeInBytes > MAX_RESULT_SIZE_BYTES) {
|
|
145
|
-
return (0, _neverthrow.err)(new _errors.ResultTooBigError(resultSizeInBytes, MAX_RESULT_SIZE_BYTES));
|
|
146
|
-
}
|
|
147
142
|
try {
|
|
143
|
+
const automationFunctionResult = await automationFunction(...automationFunctionParameters);
|
|
144
|
+
const MAX_RESULT_SIZE_BYTES = 2 * 1024 * 1024;
|
|
145
|
+
const resultSizeInBytes = getObjectSizeInBytes(automationFunctionResult);
|
|
146
|
+
if (resultSizeInBytes > MAX_RESULT_SIZE_BYTES) {
|
|
147
|
+
return (0, _neverthrow.err)(new _errors.ResultTooBigError(resultSizeInBytes, MAX_RESULT_SIZE_BYTES));
|
|
148
|
+
}
|
|
148
149
|
return (0, _neverthrow.ok)({
|
|
149
|
-
result:
|
|
150
|
+
result: automationFunctionResult,
|
|
150
151
|
extendedPayloads: (0, _asyncLocalStorage.getExecutionContext)()?.extendedPayloads,
|
|
151
152
|
session: retrieveSession ? await (0, _contextStorageStateHelpers.getStorageState)(context) : undefined
|
|
152
153
|
});
|