@intuned/runtime-dev 1.3.17-source.0 → 1.3.18-dev.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.
- package/.babelrc +6 -0
- package/CHANGELOG.md +1 -1
- package/InterfaceTemplate/{utils.ts → __utils.ts} +3 -1
- package/InterfaceTemplate/index.playwright.ts +1 -1
- package/bin/intuned +0 -0
- package/bin/intuned-interface +7 -0
- package/dist/commands/api/run.js +3 -3
- package/dist/commands/auth-sessions/run-check.js +3 -3
- package/dist/commands/auth-sessions/run-create.js +3 -3
- package/dist/commands/build.js +1 -3
- package/dist/commands/common/browserUtils.d.ts +3 -3
- package/dist/commands/common/browserUtils.js +3 -4
- package/dist/commands/common/getFirstLineNumber.test.js +1 -2
- package/dist/commands/common/tsNodeImport.d.ts +1 -1
- package/dist/commands/common/tsNodeImport.js +1 -2
- package/dist/commands/common/utils/fileUtils.js +1 -2
- package/dist/commands/common/utils/{unixSocket.d.ts → interfaceClient.d.ts} +10 -2
- package/dist/commands/common/utils/{unixSocket.js → interfaceClient.js} +16 -5
- package/dist/commands/common/utils/template.js +1 -2
- package/dist/commands/interface/run.js +23 -49
- package/dist/commands/intuned-cli/commands/deploy.command.js +2 -2
- package/dist/commands/intuned-cli/commands/provision.command.d.ts +2 -2
- package/dist/commands/intuned-cli/commands/provision.command.js +1 -1
- package/dist/commands/intuned-cli/commands/run_authsession.command.d.ts +8 -1
- package/dist/commands/intuned-cli/commands/types.d.ts +9 -1
- package/dist/commands/intuned-cli/commands/types.js +7 -3
- package/dist/commands/intuned-cli/controller/__test__/api.test.js +24 -14
- package/dist/commands/intuned-cli/controller/__test__/authSession.test.js +128 -66
- package/dist/commands/intuned-cli/controller/api.d.ts +2 -2
- package/dist/commands/intuned-cli/controller/api.js +3 -3
- package/dist/commands/intuned-cli/controller/authSession.d.ts +16 -16
- package/dist/commands/intuned-cli/controller/authSession.js +22 -11
- package/dist/commands/intuned-cli/controller/build.js +1 -2
- package/dist/commands/intuned-cli/controller/deploy.js +1 -2
- package/dist/commands/intuned-cli/controller/index.js +1 -2
- package/dist/commands/intuned-cli/controller/provision.js +1 -2
- package/dist/commands/intuned-cli/helpers/__test__/browser.test.js +44 -5
- package/dist/commands/intuned-cli/helpers/__test__/tracing.test.js +3 -3
- package/dist/commands/intuned-cli/helpers/auth.d.ts +4 -4
- package/dist/commands/intuned-cli/helpers/auth.js +2 -2
- package/dist/commands/intuned-cli/helpers/browser.d.ts +4 -4
- package/dist/commands/intuned-cli/helpers/browser.js +40 -5
- package/dist/commands/intuned-cli/helpers/errors.d.ts +1 -1
- package/dist/commands/intuned-cli/helpers/errors.js +2 -2
- package/dist/commands/intuned-cli/helpers/intunedJson.d.ts +6 -5
- package/dist/commands/intuned-cli/helpers/timeout.js +2 -2
- package/dist/commands/intuned-cli/helpers/traces.d.ts +1 -1
- package/dist/commands/intuned-cli/helpers/wrapper.js +2 -2
- package/dist/commands/intuned-cli/main.js +1 -2
- package/dist/commands/intuned-cli/types.d.ts +8 -8
- package/dist/commands/ts-check.js +1 -2
- package/dist/common/binStartupScript.js +1 -2
- package/dist/common/browserTabs.d.ts +72 -0
- package/dist/common/browserTabs.js +74 -0
- package/dist/common/constants.d.ts +1 -0
- package/dist/common/constants.js +2 -1
- package/dist/common/contextStorageStateHelpers.d.ts +4 -3
- package/dist/common/contextStorageStateHelpers.js +4 -1
- package/dist/common/extension/extensionsHelpers.d.ts +1 -1
- package/dist/common/extension/types.d.ts +14 -7
- package/dist/common/formatZodError.d.ts +1 -1
- package/dist/common/intunedJson.d.ts +19 -14
- package/dist/common/intunedJson.js +2 -2
- package/dist/common/jwtTokenManager.js +10 -6
- package/dist/common/launchBrowser.d.ts +8 -0
- package/dist/common/launchBrowser.js +39 -7
- package/dist/common/playwrightContext.d.ts +5 -5
- package/dist/common/playwrightContext.js +17 -13
- package/dist/common/runApi/importUsingImportFunction.d.ts +1 -3
- package/dist/common/runApi/importUsingImportFunction.js +7 -7
- package/dist/common/runApi/index.d.ts +3 -6
- package/dist/common/runApi/index.js +27 -51
- package/dist/common/settingsSchema.d.ts +52 -45
- package/dist/common/settingsSchema.js +3 -3
- package/dist/common/setupContextHook.d.ts +1 -2
- package/dist/common/setupContextHook.js +2 -2
- package/dist/common/telemetry.js +1 -2
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -7
- package/dist/runtime/downloadDirectory.js +2 -2
- package/dist/vendor/runtime-interface.d.ts +1 -0
- package/dist/vendor/runtime-interface.js +493 -0
- package/package.json +17 -10
- package/tsup.config.ts +12 -0
- package/WebTemplate.zip +0 -0
- package/dist/common/runApi/errors.d.ts +0 -72
- package/dist/common/runApi/errors.js +0 -169
- package/dist/common/runApi/types.d.ts +0 -830
- package/dist/common/runApi/types.js +0 -73
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.runAutomationErrorCodes = exports.resultTooBigErrorCode = exports.maxLevelsExceededErrorCode = exports.invalidCheckErrorCode = exports.invalidApiErrorCode = exports.internalInvalidInputErrorCode = exports.automationError = exports.authRequiredErrorCode = exports.authCheckNotFoundErrorCode = exports.authCheckFailedErrorCode = exports.apiNotFoundErrorCode = exports.abortedErrorCode = exports.RunAutomationError = exports.ResultTooBigError = exports.MaxLevelsExceededError = exports.InvalidCheckError = exports.InvalidApiError = exports.InternalInvalidInputError = exports.AutomationError = exports.AuthRequiredError = exports.AuthCheckNotFoundError = exports.AuthCheckFailedError = exports.ApiNotFoundError = exports.AbortedError = void 0;
|
|
7
|
-
var _runtime = require("../../runtime");
|
|
8
|
-
var playwright = _interopRequireWildcard(require("playwright-core"));
|
|
9
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
10
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
|
-
const apiNotFoundErrorCode = exports.apiNotFoundErrorCode = "APINotFoundError";
|
|
12
|
-
const invalidApiErrorCode = exports.invalidApiErrorCode = "InvalidAPIError";
|
|
13
|
-
const invalidCheckErrorCode = exports.invalidCheckErrorCode = "InvalidCheckError";
|
|
14
|
-
const abortedErrorCode = exports.abortedErrorCode = "AbortedError";
|
|
15
|
-
const authRequiredErrorCode = exports.authRequiredErrorCode = "AuthRequiredError";
|
|
16
|
-
const authCheckNotFoundErrorCode = exports.authCheckNotFoundErrorCode = "AuthCheckNotFoundError";
|
|
17
|
-
const authCheckFailedErrorCode = exports.authCheckFailedErrorCode = "AuthCheckFailedError";
|
|
18
|
-
const maxLevelsExceededErrorCode = exports.maxLevelsExceededErrorCode = "MaxLevelsExceededError";
|
|
19
|
-
const automationError = exports.automationError = "AutomationError";
|
|
20
|
-
const internalInvalidInputErrorCode = exports.internalInvalidInputErrorCode = "InternalInvalidInputError";
|
|
21
|
-
const resultTooBigErrorCode = exports.resultTooBigErrorCode = "ResultTooBigError";
|
|
22
|
-
const runAutomationErrorCodes = exports.runAutomationErrorCodes = [apiNotFoundErrorCode, invalidApiErrorCode, invalidCheckErrorCode, abortedErrorCode, authRequiredErrorCode, authCheckNotFoundErrorCode, authCheckFailedErrorCode, maxLevelsExceededErrorCode, automationError, internalInvalidInputErrorCode, resultTooBigErrorCode];
|
|
23
|
-
class RunAutomationError {
|
|
24
|
-
wrapped = false;
|
|
25
|
-
get json() {
|
|
26
|
-
return {
|
|
27
|
-
code: this.code,
|
|
28
|
-
details: this.details,
|
|
29
|
-
cause: this.cause?.json
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.RunAutomationError = RunAutomationError;
|
|
34
|
-
class ApiNotFoundError extends RunAutomationError {
|
|
35
|
-
constructor(apiName) {
|
|
36
|
-
super();
|
|
37
|
-
this.code = apiNotFoundErrorCode;
|
|
38
|
-
this.statusCode = 404;
|
|
39
|
-
this.message = `API ${apiName} not found`;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
exports.ApiNotFoundError = ApiNotFoundError;
|
|
43
|
-
class InvalidApiError extends RunAutomationError {
|
|
44
|
-
constructor(message) {
|
|
45
|
-
super();
|
|
46
|
-
this.code = invalidApiErrorCode;
|
|
47
|
-
this.statusCode = 400;
|
|
48
|
-
this.message = `API is invalid: ${message}`;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
exports.InvalidApiError = InvalidApiError;
|
|
52
|
-
class InvalidCheckError extends RunAutomationError {
|
|
53
|
-
constructor(message, cause) {
|
|
54
|
-
super();
|
|
55
|
-
this.code = invalidCheckErrorCode;
|
|
56
|
-
this.statusCode = 400;
|
|
57
|
-
this.message = message;
|
|
58
|
-
this.cause = cause;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
exports.InvalidCheckError = InvalidCheckError;
|
|
62
|
-
class AbortedError extends RunAutomationError {
|
|
63
|
-
constructor() {
|
|
64
|
-
super();
|
|
65
|
-
this.code = abortedErrorCode;
|
|
66
|
-
this.statusCode = 200;
|
|
67
|
-
this.message = "Operation was aborted";
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
exports.AbortedError = AbortedError;
|
|
71
|
-
class AuthRequiredError extends RunAutomationError {
|
|
72
|
-
constructor() {
|
|
73
|
-
super();
|
|
74
|
-
this.code = authRequiredErrorCode;
|
|
75
|
-
this.statusCode = 401;
|
|
76
|
-
this.message = "Authentication is required";
|
|
77
|
-
this.wrapped = true;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
exports.AuthRequiredError = AuthRequiredError;
|
|
81
|
-
class AuthCheckNotFoundError extends RunAutomationError {
|
|
82
|
-
constructor() {
|
|
83
|
-
super();
|
|
84
|
-
this.code = authCheckNotFoundErrorCode;
|
|
85
|
-
this.statusCode = 404;
|
|
86
|
-
this.message = "Auth check not found";
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
exports.AuthCheckNotFoundError = AuthCheckNotFoundError;
|
|
90
|
-
class AuthCheckFailedError extends RunAutomationError {
|
|
91
|
-
constructor() {
|
|
92
|
-
super();
|
|
93
|
-
this.code = authCheckFailedErrorCode;
|
|
94
|
-
this.statusCode = 401;
|
|
95
|
-
this.message = "AuthSession check failed";
|
|
96
|
-
this.wrapped = true;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
exports.AuthCheckFailedError = AuthCheckFailedError;
|
|
100
|
-
class MaxLevelsExceededError extends RunAutomationError {
|
|
101
|
-
constructor(levels) {
|
|
102
|
-
super();
|
|
103
|
-
this.code = maxLevelsExceededErrorCode;
|
|
104
|
-
this.statusCode = 400;
|
|
105
|
-
this.message = `Max levels exceeded. Only ${levels} levels are supported`;
|
|
106
|
-
this.details = {
|
|
107
|
-
levels
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
exports.MaxLevelsExceededError = MaxLevelsExceededError;
|
|
112
|
-
class AutomationError extends RunAutomationError {
|
|
113
|
-
constructor(error) {
|
|
114
|
-
super();
|
|
115
|
-
this.error = error;
|
|
116
|
-
this.code = automationError;
|
|
117
|
-
if (error instanceof playwright.errors.TimeoutError) {
|
|
118
|
-
this.statusCode = 500;
|
|
119
|
-
this.message = `[${error.name}] ${error.message}`;
|
|
120
|
-
this.details = {
|
|
121
|
-
name: error.name,
|
|
122
|
-
message: error.message
|
|
123
|
-
};
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
if (error instanceof _runtime.RunError) {
|
|
127
|
-
this.wrapped = true;
|
|
128
|
-
this.statusCode = error.options.status_code ?? 500;
|
|
129
|
-
this.message = `[${error.options.error_code ?? error.name}] ${error.message}`;
|
|
130
|
-
this.details = {
|
|
131
|
-
name: error.name,
|
|
132
|
-
statusCode: error.options.status_code,
|
|
133
|
-
errorCode: error.options.error_code,
|
|
134
|
-
message: error.message,
|
|
135
|
-
options: error.options
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
this.statusCode = 500;
|
|
139
|
-
this.message = `[${error?.name ?? error}] ${error?.message}`;
|
|
140
|
-
this.details = {
|
|
141
|
-
name: error?.name,
|
|
142
|
-
message: error?.message
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
exports.AutomationError = AutomationError;
|
|
147
|
-
class InternalInvalidInputError extends RunAutomationError {
|
|
148
|
-
constructor(message, details) {
|
|
149
|
-
super();
|
|
150
|
-
this.code = internalInvalidInputErrorCode;
|
|
151
|
-
this.statusCode = 500;
|
|
152
|
-
this.message = message;
|
|
153
|
-
this.details = details;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
exports.InternalInvalidInputError = InternalInvalidInputError;
|
|
157
|
-
class ResultTooBigError extends RunAutomationError {
|
|
158
|
-
constructor(sizeInBytes, maxSizeInBytes) {
|
|
159
|
-
super();
|
|
160
|
-
this.code = resultTooBigErrorCode;
|
|
161
|
-
this.statusCode = 413;
|
|
162
|
-
this.message = `Automation result is too big. Size: ${Math.round(sizeInBytes / 1024 / 1024 * 100) / 100}MB, Max allowed: ${Math.round(maxSizeInBytes / 1024 / 1024 * 100) / 100}MB`;
|
|
163
|
-
this.details = {
|
|
164
|
-
sizeInBytes,
|
|
165
|
-
maxSizeInBytes
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
exports.ResultTooBigError = ResultTooBigError;
|