@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
|
@@ -6,6 +6,7 @@ var _authSession = require("../authSession");
|
|
|
6
6
|
var _helpers = require("../../helpers");
|
|
7
7
|
var _neverthrow = require("neverthrow");
|
|
8
8
|
var _runApi = require("../../../../common/runApi");
|
|
9
|
+
var _runtimeInterface = require("../../../../vendor/runtime-interface");
|
|
9
10
|
var _fsExtra = require("fs-extra");
|
|
10
11
|
var _browser = require("../../helpers/browser");
|
|
11
12
|
function getTerminal() {
|
|
@@ -76,7 +77,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
76
77
|
inputData: {},
|
|
77
78
|
headless: false,
|
|
78
79
|
timeout: 6000,
|
|
79
|
-
keepBrowserOpen: false
|
|
80
|
+
keepBrowserOpen: false,
|
|
81
|
+
ignoreHttpErrors: false
|
|
80
82
|
});
|
|
81
83
|
(0, _vitest.expect)(_helpers.withTimeout).toHaveBeenCalledWith(_vitest.expect.any(Function), 6000);
|
|
82
84
|
});
|
|
@@ -86,7 +88,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
86
88
|
inputData: {},
|
|
87
89
|
headless: false,
|
|
88
90
|
timeout: 6000,
|
|
89
|
-
keepBrowserOpen: false
|
|
91
|
+
keepBrowserOpen: false,
|
|
92
|
+
ignoreHttpErrors: false
|
|
90
93
|
});
|
|
91
94
|
(0, _vitest.expect)(_helpers.withCLITrace).toHaveBeenCalledWith(_vitest.expect.any(Function), undefined);
|
|
92
95
|
_vitest.vi.mocked(_helpers.withCLITrace).mockClear();
|
|
@@ -97,7 +100,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
97
100
|
headless: false,
|
|
98
101
|
timeout: 6000,
|
|
99
102
|
keepBrowserOpen: false,
|
|
100
|
-
traceId: "trace-id"
|
|
103
|
+
traceId: "trace-id",
|
|
104
|
+
ignoreHttpErrors: false
|
|
101
105
|
});
|
|
102
106
|
(0, _vitest.expect)(_helpers.withCLITrace).toHaveBeenCalledWith(_vitest.expect.any(Function), "trace-id");
|
|
103
107
|
});
|
|
@@ -107,7 +111,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
107
111
|
inputData: {},
|
|
108
112
|
headless: false,
|
|
109
113
|
timeout: 6000,
|
|
110
|
-
keepBrowserOpen: false
|
|
114
|
+
keepBrowserOpen: false,
|
|
115
|
+
ignoreHttpErrors: false
|
|
111
116
|
});
|
|
112
117
|
(0, _vitest.expect)(_browser.getCLIRunOptions).toHaveBeenCalledWith(_vitest.expect.objectContaining({
|
|
113
118
|
headless: false,
|
|
@@ -120,7 +125,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
120
125
|
inputData: {},
|
|
121
126
|
headless: true,
|
|
122
127
|
timeout: 6000,
|
|
123
|
-
keepBrowserOpen: true
|
|
128
|
+
keepBrowserOpen: true,
|
|
129
|
+
ignoreHttpErrors: false
|
|
124
130
|
});
|
|
125
131
|
(0, _vitest.expect)(_browser.getCLIRunOptions).toHaveBeenCalledWith(_vitest.expect.objectContaining({
|
|
126
132
|
headless: true,
|
|
@@ -136,7 +142,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
136
142
|
auth: "auth",
|
|
137
143
|
proxy: "proxy",
|
|
138
144
|
timeout: 999999999,
|
|
139
|
-
keepBrowserOpen: false
|
|
145
|
+
keepBrowserOpen: false,
|
|
146
|
+
ignoreHttpErrors: false
|
|
140
147
|
});
|
|
141
148
|
(0, _vitest.expect)(_helpers.parseUrlProxy).toHaveBeenCalledWith("proxy");
|
|
142
149
|
(0, _vitest.expect)(_runApi.runApi).toHaveBeenCalledWith(_vitest.expect.objectContaining({
|
|
@@ -147,7 +154,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
147
154
|
runOptions: {
|
|
148
155
|
headless: "headless",
|
|
149
156
|
environment: "standalone",
|
|
150
|
-
proxy: "parsed-proxy"
|
|
157
|
+
proxy: "parsed-proxy",
|
|
158
|
+
ignoreHttpErrors: false
|
|
151
159
|
},
|
|
152
160
|
auth: {
|
|
153
161
|
session: {
|
|
@@ -169,7 +177,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
169
177
|
headless: "headless",
|
|
170
178
|
auth: "auth",
|
|
171
179
|
timeout: 999999999,
|
|
172
|
-
keepBrowserOpen: false
|
|
180
|
+
keepBrowserOpen: false,
|
|
181
|
+
ignoreHttpErrors: false
|
|
173
182
|
});
|
|
174
183
|
(0, _vitest.expect)(result).toEqual({
|
|
175
184
|
result: "result",
|
|
@@ -185,7 +194,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
185
194
|
headless: "headless",
|
|
186
195
|
auth: "auth",
|
|
187
196
|
timeout: 999999999,
|
|
188
|
-
keepBrowserOpen: false
|
|
197
|
+
keepBrowserOpen: false,
|
|
198
|
+
ignoreHttpErrors: false
|
|
189
199
|
})).rejects.toThrow(error);
|
|
190
200
|
});
|
|
191
201
|
});
|
|
@@ -224,7 +234,7 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
224
234
|
(0, _vitest.expect)(_runApi.runApi).toHaveBeenCalledTimes(1);
|
|
225
235
|
});
|
|
226
236
|
(0, _vitest.it)("stops retrying after max retries", async () => {
|
|
227
|
-
_vitest.vi.mocked(_runApi.runApi).mockResolvedValue((0, _neverthrow.err)(new
|
|
237
|
+
_vitest.vi.mocked(_runApi.runApi).mockResolvedValue((0, _neverthrow.err)(new _runtimeInterface.AutomationError("runApi failed")));
|
|
228
238
|
await (0, _vitest.expect)((0, _api.executeRunApiCLI)({
|
|
229
239
|
apiName: "testApi",
|
|
230
240
|
inputData: {},
|
|
@@ -242,7 +252,7 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
242
252
|
(0, _vitest.expect)(_runApi.runApi).toHaveBeenCalledTimes(1);
|
|
243
253
|
});
|
|
244
254
|
(0, _vitest.it)("stops retrying on success", async () => {
|
|
245
|
-
_vitest.vi.mocked(_runApi.runApi).mockResolvedValueOnce((0, _neverthrow.err)(new
|
|
255
|
+
_vitest.vi.mocked(_runApi.runApi).mockResolvedValueOnce((0, _neverthrow.err)(new _runtimeInterface.AutomationError("runApi failed"))).mockResolvedValue((0, _neverthrow.ok)({
|
|
246
256
|
result: "success"
|
|
247
257
|
}));
|
|
248
258
|
await (0, _api.executeRunApiCLI)({
|
|
@@ -253,7 +263,7 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
253
263
|
(0, _vitest.expect)(_runApi.runApi).toHaveBeenCalledTimes(2);
|
|
254
264
|
});
|
|
255
265
|
(0, _vitest.it)("validates AuthSession before each attempt if provided", async () => {
|
|
256
|
-
_vitest.vi.mocked(_runApi.runApi).mockResolvedValueOnce((0, _neverthrow.err)(new
|
|
266
|
+
_vitest.vi.mocked(_runApi.runApi).mockResolvedValueOnce((0, _neverthrow.err)(new _runtimeInterface.AutomationError("runApi failed"))).mockResolvedValue((0, _neverthrow.ok)({
|
|
257
267
|
result: "success"
|
|
258
268
|
}));
|
|
259
269
|
await (0, _api.executeRunApiCLI)({
|
|
@@ -364,11 +374,11 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
|
|
|
364
374
|
});
|
|
365
375
|
(0, _vitest.expect)(_runApi.runApi).toHaveBeenCalledTimes(1);
|
|
366
376
|
_vitest.vi.mocked(_runApi.runApi).mockReset();
|
|
367
|
-
_vitest.vi.mocked(_runApi.runApi).mockResolvedValue((0, _neverthrow.err)(new
|
|
377
|
+
_vitest.vi.mocked(_runApi.runApi).mockResolvedValue((0, _neverthrow.err)(new _runtimeInterface.AutomationError("runApi failed")));
|
|
368
378
|
await (0, _vitest.expect)((0, _api.executeAttemptApiCLI)({
|
|
369
379
|
apiName: "testApi",
|
|
370
380
|
inputData: {}
|
|
371
|
-
})).rejects.toThrow(
|
|
381
|
+
})).rejects.toThrow(_runtimeInterface.AutomationError);
|
|
372
382
|
(0, _vitest.expect)(_runApi.runApi).toHaveBeenCalledTimes(1);
|
|
373
383
|
});
|
|
374
384
|
(0, _vitest.it)("writes result to file if outputFile is provided", async () => {
|