@intuned/runtime-dev 1.3.28-dev1 → 1.3.32
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/CHANGELOG.md +13 -0
- package/dist/commands/common/utils/settings.d.ts +5 -0
- package/dist/commands/common/utils/settings.js +5 -17
- package/dist/common/asyncLocalStorage/index.d.ts +11 -0
- package/dist/common/asyncLocalStorage/index.js +4 -0
- package/dist/common/extension/intunedExtensionServer.js +3 -0
- package/dist/common/extension/types.d.ts +49 -25
- package/dist/common/extension/types.js +3 -2
- package/dist/common/launchBrowser.d.ts +11 -4
- package/dist/common/launchBrowser.js +27 -55
- package/dist/common/playwrightContext.d.ts +7 -3
- package/dist/common/playwrightContext.js +11 -7
- package/dist/common/runApi/index.js +24 -6
- package/dist/common/settingsSchema.d.ts +431 -25
- package/dist/common/settingsSchema.js +18 -2
- package/dist/runtime/captcha.js +15 -13
- package/dist/vendor/runtime-interface.js +14 -6
- package/{dist → package/dist}/commands/api/run.js +11 -7
- package/{dist → package/dist}/commands/auth-sessions/load.js +2 -2
- package/{dist → package/dist}/commands/auth-sessions/run-check.js +8 -8
- package/{dist → package/dist}/commands/auth-sessions/run-create.js +6 -6
- package/package/dist/commands/browser/save-state.d.ts +2 -0
- package/package/dist/commands/browser/save-state.js +17 -0
- package/package/dist/commands/browser/start-browser.d.ts +2 -0
- package/package/dist/commands/browser/start-browser.js +14 -0
- package/package/dist/commands/build.d.ts +1 -0
- package/package/dist/commands/build.js +84 -0
- package/package/dist/commands/common/browserUtils.d.ts +14 -0
- package/package/dist/commands/common/browserUtils.js +58 -0
- package/package/dist/commands/common/getFirstLineNumber.d.ts +9 -0
- package/package/dist/commands/common/getFirstLineNumber.js +101 -0
- package/package/dist/commands/common/getFirstLineNumber.test.js +228 -0
- package/package/dist/commands/common/projectExclusions.d.ts +2 -0
- package/package/dist/commands/common/projectExclusions.js +8 -0
- package/package/dist/commands/common/sendMessageToClient.d.ts +1 -0
- package/package/dist/commands/common/sendMessageToClient.js +10 -0
- package/package/dist/commands/common/tsNodeImport.d.ts +2 -0
- package/package/dist/commands/common/tsNodeImport.js +34 -0
- package/package/dist/commands/common/utils/fileUtils.d.ts +6 -0
- package/package/dist/commands/common/utils/fileUtils.js +33 -0
- package/package/dist/commands/common/utils/settings.d.ts +2 -0
- package/package/dist/commands/common/utils/settings.js +31 -0
- package/package/dist/commands/common/utils/template.d.ts +2 -0
- package/package/dist/commands/common/utils/template.js +31 -0
- package/package/dist/commands/common/utils/unixSocket.d.ts +9 -0
- package/package/dist/commands/common/utils/unixSocket.js +44 -0
- package/package/dist/commands/interface/run.d.ts +1 -0
- package/package/dist/commands/interface/run.js +216 -0
- package/package/dist/commands/intuned-cli/commands/attempt.command.d.ts +1 -0
- package/package/dist/commands/intuned-cli/commands/attempt.command.js +8 -0
- package/package/dist/commands/intuned-cli/commands/attempt_api.command.d.ts +1 -0
- package/package/dist/commands/intuned-cli/commands/attempt_api.command.js +30 -0
- package/package/dist/commands/intuned-cli/commands/attempt_authsession.command.d.ts +1 -0
- package/package/dist/commands/intuned-cli/commands/attempt_authsession.command.js +8 -0
- package/package/dist/commands/intuned-cli/commands/attempt_authsession_check.command.d.ts +1 -0
- package/package/dist/commands/intuned-cli/commands/attempt_authsession_check.command.js +19 -0
- package/package/dist/commands/intuned-cli/commands/attempt_authsession_create.command.d.ts +1 -0
- package/package/dist/commands/intuned-cli/commands/attempt_authsession_create.command.js +24 -0
- package/package/dist/commands/intuned-cli/commands/authsession.command.d.ts +1 -0
- package/package/dist/commands/intuned-cli/commands/authsession.command.js +8 -0
- package/package/dist/commands/intuned-cli/commands/authsession_record.command.d.ts +1 -0
- package/package/dist/commands/intuned-cli/commands/authsession_record.command.js +31 -0
- package/package/dist/commands/intuned-cli/commands/build.command.d.ts +1 -0
- package/package/dist/commands/intuned-cli/commands/build.command.js +12 -0
- package/package/dist/commands/intuned-cli/commands/command.d.ts +2 -0
- package/package/dist/commands/intuned-cli/commands/command.js +9 -0
- package/package/dist/commands/intuned-cli/commands/deploy.command.d.ts +1 -0
- package/package/dist/commands/intuned-cli/commands/deploy.command.js +38 -0
- package/package/dist/commands/intuned-cli/commands/index.d.ts +18 -0
- package/package/dist/commands/intuned-cli/commands/index.js +203 -0
- package/package/dist/commands/intuned-cli/commands/init.command.d.ts +1 -0
- package/package/dist/commands/intuned-cli/commands/init.command.js +13 -0
- package/package/dist/commands/intuned-cli/commands/run.command.d.ts +1 -0
- package/package/dist/commands/intuned-cli/commands/run.command.js +8 -0
- package/package/dist/commands/intuned-cli/commands/run_api.command.d.ts +1 -0
- package/package/dist/commands/intuned-cli/commands/run_api.command.js +46 -0
- package/package/dist/commands/intuned-cli/commands/run_authsession.command.d.ts +28 -0
- package/package/dist/commands/intuned-cli/commands/run_authsession.command.js +17 -0
- package/package/dist/commands/intuned-cli/commands/run_authsession_create.command.d.ts +1 -0
- package/package/dist/commands/intuned-cli/commands/run_authsession_create.command.js +35 -0
- package/package/dist/commands/intuned-cli/commands/run_authsession_update.command.d.ts +1 -0
- package/package/dist/commands/intuned-cli/commands/run_authsession_update.command.js +35 -0
- package/package/dist/commands/intuned-cli/commands/run_authsession_validate.command.d.ts +1 -0
- package/package/dist/commands/intuned-cli/commands/run_authsession_validate.command.js +33 -0
- package/package/dist/commands/intuned-cli/commands/save.command.d.ts +13 -0
- package/package/dist/commands/intuned-cli/commands/save.command.js +42 -0
- package/package/dist/commands/intuned-cli/commands/types.d.ts +31 -0
- package/package/dist/commands/intuned-cli/commands/types.js +29 -0
- package/package/dist/commands/intuned-cli/constants/index.d.ts +17 -0
- package/package/dist/commands/intuned-cli/constants/index.js +25 -0
- package/package/dist/commands/intuned-cli/controller/__test__/api.test.js +397 -0
- package/package/dist/commands/intuned-cli/controller/__test__/authSession.test.js +1059 -0
- package/package/dist/commands/intuned-cli/controller/api.d.ts +42 -0
- package/package/dist/commands/intuned-cli/controller/api.js +189 -0
- package/package/dist/commands/intuned-cli/controller/authSession.d.ts +209 -0
- package/package/dist/commands/intuned-cli/controller/authSession.js +420 -0
- package/package/dist/commands/intuned-cli/controller/build.d.ts +1 -0
- package/package/dist/commands/intuned-cli/controller/build.js +36 -0
- package/package/dist/commands/intuned-cli/controller/deploy.d.ts +4 -0
- package/package/dist/commands/intuned-cli/controller/deploy.js +139 -0
- package/package/dist/commands/intuned-cli/controller/index.d.ts +1 -0
- package/package/dist/commands/intuned-cli/controller/index.js +46 -0
- package/package/dist/commands/intuned-cli/controller/save.d.ts +14 -0
- package/package/dist/commands/intuned-cli/controller/save.js +345 -0
- package/package/dist/commands/intuned-cli/helpers/__test__/browser.test.js +103 -0
- package/package/dist/commands/intuned-cli/helpers/__test__/tracing.test.js +40 -0
- package/package/dist/commands/intuned-cli/helpers/api.d.ts +3 -0
- package/package/dist/commands/intuned-cli/helpers/api.js +19 -0
- package/package/dist/commands/intuned-cli/helpers/auth.d.ts +46 -0
- package/package/dist/commands/intuned-cli/helpers/auth.js +144 -0
- package/package/dist/commands/intuned-cli/helpers/backend.d.ts +8 -0
- package/package/dist/commands/intuned-cli/helpers/backend.js +27 -0
- package/package/dist/commands/intuned-cli/helpers/browser.d.ts +14 -0
- package/package/dist/commands/intuned-cli/helpers/browser.js +57 -0
- package/package/dist/commands/intuned-cli/helpers/context.d.ts +3 -0
- package/package/dist/commands/intuned-cli/helpers/context.js +33 -0
- package/package/dist/commands/intuned-cli/helpers/errors.d.ts +13 -0
- package/package/dist/commands/intuned-cli/helpers/errors.js +37 -0
- package/package/dist/commands/intuned-cli/helpers/index.d.ts +12 -0
- package/package/dist/commands/intuned-cli/helpers/index.js +137 -0
- package/package/dist/commands/intuned-cli/helpers/intunedJson.d.ts +69 -0
- package/package/dist/commands/intuned-cli/helpers/intunedJson.js +71 -0
- package/package/dist/commands/intuned-cli/helpers/proxy.d.ts +5 -0
- package/package/dist/commands/intuned-cli/helpers/proxy.js +23 -0
- package/package/dist/commands/intuned-cli/helpers/terminal.d.ts +5 -0
- package/package/dist/commands/intuned-cli/helpers/terminal.js +13 -0
- package/package/dist/commands/intuned-cli/helpers/timeout.d.ts +1 -0
- package/package/dist/commands/intuned-cli/helpers/timeout.js +23 -0
- package/package/dist/commands/intuned-cli/helpers/traces.d.ts +2 -0
- package/package/dist/commands/intuned-cli/helpers/traces.js +32 -0
- package/package/dist/commands/intuned-cli/helpers/validation.d.ts +2 -0
- package/package/dist/commands/intuned-cli/helpers/validation.js +14 -0
- package/package/dist/commands/intuned-cli/helpers/wrapper.d.ts +2 -0
- package/package/dist/commands/intuned-cli/helpers/wrapper.js +60 -0
- package/package/dist/commands/intuned-cli/index.d.ts +1 -0
- package/package/dist/commands/intuned-cli/index.js +16 -0
- package/package/dist/commands/intuned-cli/main.d.ts +1 -0
- package/package/dist/commands/intuned-cli/main.js +22 -0
- package/package/dist/commands/intuned-cli/types.d.ts +41 -0
- package/package/dist/commands/intuned-cli/types.js +12 -0
- package/package/dist/commands/ts-check.d.ts +2 -0
- package/package/dist/commands/ts-check.js +56 -0
- package/package/dist/common/Logger/Logger/index.d.ts +12 -0
- package/package/dist/common/Logger/Logger/index.js +60 -0
- package/package/dist/common/Logger/Logger/types.d.ts +8 -0
- package/package/dist/common/Logger/Logger/types.js +5 -0
- package/package/dist/common/Logger/index.d.ts +12 -0
- package/package/dist/common/Logger/index.js +60 -0
- package/package/dist/common/Logger/types.d.ts +8 -0
- package/package/dist/common/Logger/types.js +5 -0
- package/package/dist/common/assets/browser_scripts.js +2580 -0
- package/package/dist/common/asyncLocalStorage/index.d.ts +16 -0
- package/package/dist/common/asyncLocalStorage/index.js +17 -0
- package/package/dist/common/backendFunctions/getAuthSessionParameters.d.ts +1 -0
- package/package/dist/common/backendFunctions/getAuthSessionParameters.js +38 -0
- package/package/dist/common/cleanEnvironmentVariables.d.ts +1 -0
- package/package/dist/common/cleanEnvironmentVariables.js +16 -0
- package/package/dist/common/constants.d.ts +10 -0
- package/package/dist/common/constants.js +16 -0
- package/package/dist/common/contextStorageStateHelpers.d.ts +21 -0
- package/package/dist/common/contextStorageStateHelpers.js +81 -0
- package/package/dist/common/extensionsHelpers.d.ts +8 -0
- package/package/dist/common/extensionsHelpers.js +80 -0
- package/package/dist/common/formatZodError.d.ts +2 -0
- package/package/dist/common/formatZodError.js +18 -0
- package/package/dist/common/jwtTokenManager.d.ts +17 -0
- package/package/dist/common/jwtTokenManager.js +109 -0
- package/package/dist/common/launchBrowser.d.ts +25 -0
- package/package/dist/common/launchBrowser.js +172 -0
- package/package/dist/common/playwrightContext.d.ts +31 -0
- package/package/dist/common/playwrightContext.js +144 -0
- package/package/dist/common/runApi/errors.d.ts +72 -0
- package/package/dist/common/runApi/errors.js +169 -0
- package/package/dist/common/runApi/importUsingImportFunction.d.ts +9 -0
- package/package/dist/common/runApi/importUsingImportFunction.js +46 -0
- package/package/dist/common/runApi/index.d.ts +11 -0
- package/package/dist/common/runApi/index.js +199 -0
- package/package/dist/common/runApi/types.d.ts +830 -0
- package/package/dist/common/runApi/types.js +73 -0
- package/package/dist/common/settingsSchema.d.ts +518 -0
- package/package/dist/common/settingsSchema.js +57 -0
- package/package/dist/common/setupContextHook.d.ts +17 -0
- package/package/dist/common/setupContextHook.js +22 -0
- package/package/dist/common/telemetry.d.ts +3 -0
- package/package/dist/common/telemetry.js +32 -0
- package/package/dist/index.d.ts +4 -0
- package/package/dist/index.js +69 -0
- package/package/dist/runtime/RunError.d.ts +5 -0
- package/package/dist/runtime/RunError.js +19 -0
- package/package/dist/runtime/attemptStore.d.ts +2 -0
- package/package/dist/runtime/attemptStore.js +23 -0
- package/package/dist/runtime/downloadDirectory.d.ts +1 -0
- package/package/dist/runtime/downloadDirectory.js +19 -0
- package/package/dist/runtime/enums.d.js +5 -0
- package/package/dist/runtime/enums.d.ts +11 -0
- package/package/dist/runtime/enums.js +18 -0
- package/package/dist/runtime/executionHelpers.test.js +52 -0
- package/package/dist/runtime/export.d.js +5 -0
- package/package/dist/runtime/export.d.ts +228 -0
- package/package/dist/runtime/extendPayload.d.ts +2 -0
- package/package/dist/runtime/extendPayload.js +21 -0
- package/package/dist/runtime/extendTimeout.d.ts +1 -0
- package/package/dist/runtime/extendTimeout.js +23 -0
- package/package/dist/runtime/getAuthSessionParameters.d.ts +1 -0
- package/package/dist/runtime/getAuthSessionParameters.js +20 -0
- package/package/dist/runtime/index.d.ts +7 -0
- package/package/dist/runtime/index.js +54 -0
- package/package/dist/runtime/runInfo.d.ts +2 -0
- package/package/dist/runtime/runInfo.js +21 -0
- package/package.json +2 -10
- package/bin/intuned-api-run +0 -4
- package/bin/intuned-auth-session-check +0 -4
- package/bin/intuned-auth-session-create +0 -4
- package/bin/intuned-auth-session-load +0 -4
- package/dist/common/intunedJson.d.ts +0 -252
- package/dist/common/intunedJson.js +0 -162
- /package/{dist → package/dist}/commands/api/run.d.ts +0 -0
- /package/{dist → package/dist}/commands/auth-sessions/load.d.ts +0 -0
- /package/{dist → package/dist}/commands/auth-sessions/run-check.d.ts +0 -0
- /package/{dist → package/dist}/commands/auth-sessions/run-create.d.ts +0 -0
|
@@ -25,6 +25,19 @@ function getObjectSizeInBytes(obj) {
|
|
|
25
25
|
return new TextEncoder().encode(String(obj)).length;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
+
const DEFAULT_MAX_RESULT_SIZE_BYTES = 2 * 1024 * 1024;
|
|
29
|
+
const MAX_RESULT_SIZE_BYTES_ENV_VAR = "__INTUNED__MAX_RESULT_SIZE_BYTES";
|
|
30
|
+
function getMaxResultSizeBytes() {
|
|
31
|
+
const raw = process.env[MAX_RESULT_SIZE_BYTES_ENV_VAR];
|
|
32
|
+
if (!raw) {
|
|
33
|
+
return DEFAULT_MAX_RESULT_SIZE_BYTES;
|
|
34
|
+
}
|
|
35
|
+
const parsed = Number(raw);
|
|
36
|
+
if (!Number.isFinite(parsed) || parsed <= 0) {
|
|
37
|
+
return DEFAULT_MAX_RESULT_SIZE_BYTES;
|
|
38
|
+
}
|
|
39
|
+
return Math.floor(parsed);
|
|
40
|
+
}
|
|
28
41
|
async function runApi({
|
|
29
42
|
abortSignal,
|
|
30
43
|
importFunction,
|
|
@@ -43,7 +56,8 @@ async function runApi({
|
|
|
43
56
|
},
|
|
44
57
|
runOptions,
|
|
45
58
|
tracing,
|
|
46
|
-
auth
|
|
59
|
+
auth,
|
|
60
|
+
captchaSolver
|
|
47
61
|
} = inputParseResult.data;
|
|
48
62
|
const abortSymbol = Symbol("abort");
|
|
49
63
|
const abortPromise = new Promise(resolve => {
|
|
@@ -73,6 +87,9 @@ async function runApi({
|
|
|
73
87
|
importFunction
|
|
74
88
|
};
|
|
75
89
|
const intunedContext = (0, _asyncLocalStorage.getExecutionContext)();
|
|
90
|
+
if (intunedContext) {
|
|
91
|
+
intunedContext.captchaSolver = captchaSolver;
|
|
92
|
+
}
|
|
76
93
|
const runAutomationWithContext = async (context, page) => {
|
|
77
94
|
async function saveTraceIfNeeded({
|
|
78
95
|
errorMessage
|
|
@@ -113,10 +130,10 @@ async function runApi({
|
|
|
113
130
|
if (automationFunctionResult === abortSymbol) {
|
|
114
131
|
return (0, _neverthrow.err)(new _runtimeInterface.AbortedError());
|
|
115
132
|
}
|
|
116
|
-
const
|
|
133
|
+
const maxResultSizeBytes = getMaxResultSizeBytes();
|
|
117
134
|
const resultSizeInBytes = getObjectSizeInBytes(automationFunctionResult);
|
|
118
|
-
if (resultSizeInBytes >
|
|
119
|
-
return (0, _neverthrow.err)(new _runtimeInterface.ResultTooBigError(resultSizeInBytes,
|
|
135
|
+
if (resultSizeInBytes > maxResultSizeBytes) {
|
|
136
|
+
return (0, _neverthrow.err)(new _runtimeInterface.ResultTooBigError(resultSizeInBytes, maxResultSizeBytes));
|
|
120
137
|
}
|
|
121
138
|
if (retrieveSession) {
|
|
122
139
|
return (0, _neverthrow.ok)({
|
|
@@ -150,7 +167,9 @@ async function runApi({
|
|
|
150
167
|
ignoreHttpErrors: runOptions.ignoreHttpErrors,
|
|
151
168
|
profileTemplatePath: runOptions.profileTemplatePath,
|
|
152
169
|
encryptedProfile: runOptions.encryptedProfile,
|
|
153
|
-
|
|
170
|
+
browserPath: runOptions.browserPath,
|
|
171
|
+
browserArgs: runOptions.browserArgs,
|
|
172
|
+
browserSize: runOptions.browserSize,
|
|
154
173
|
...playwrightContextParameters
|
|
155
174
|
}, runAutomationWithContext);
|
|
156
175
|
} finally {
|
|
@@ -162,7 +181,6 @@ async function runApi({
|
|
|
162
181
|
cdpTargetId: runOptions.cdpTargetId,
|
|
163
182
|
profileTemplatePath: runOptions.profileTemplatePath,
|
|
164
183
|
encryptedProfile: runOptions.encryptedProfile,
|
|
165
|
-
profileMode: runOptions.profileMode,
|
|
166
184
|
...playwrightContextParameters
|
|
167
185
|
}, runAutomationWithContext);
|
|
168
186
|
}
|