@intuned/runtime 1.3.1 → 1.3.2
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 automationFunctionResult = await automationFunction(...automationFunctionParameters);
|
|
142
143
|
const MAX_RESULT_SIZE_BYTES = 2 * 1024 * 1024;
|
|
143
|
-
const resultSizeInBytes = getObjectSizeInBytes(
|
|
144
|
+
const resultSizeInBytes = getObjectSizeInBytes(automationFunctionResult);
|
|
144
145
|
if (resultSizeInBytes > MAX_RESULT_SIZE_BYTES) {
|
|
145
146
|
return (0, _neverthrow.err)(new _errors.ResultTooBigError(resultSizeInBytes, MAX_RESULT_SIZE_BYTES));
|
|
146
147
|
}
|
|
147
148
|
try {
|
|
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
|
});
|