@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.
Files changed (89) hide show
  1. package/.babelrc +6 -0
  2. package/CHANGELOG.md +1 -1
  3. package/InterfaceTemplate/{utils.ts → __utils.ts} +3 -1
  4. package/InterfaceTemplate/index.playwright.ts +1 -1
  5. package/bin/intuned +0 -0
  6. package/bin/intuned-interface +7 -0
  7. package/dist/commands/api/run.js +3 -3
  8. package/dist/commands/auth-sessions/run-check.js +3 -3
  9. package/dist/commands/auth-sessions/run-create.js +3 -3
  10. package/dist/commands/build.js +1 -3
  11. package/dist/commands/common/browserUtils.d.ts +3 -3
  12. package/dist/commands/common/browserUtils.js +3 -4
  13. package/dist/commands/common/getFirstLineNumber.test.js +1 -2
  14. package/dist/commands/common/tsNodeImport.d.ts +1 -1
  15. package/dist/commands/common/tsNodeImport.js +1 -2
  16. package/dist/commands/common/utils/fileUtils.js +1 -2
  17. package/dist/commands/common/utils/{unixSocket.d.ts → interfaceClient.d.ts} +10 -2
  18. package/dist/commands/common/utils/{unixSocket.js → interfaceClient.js} +16 -5
  19. package/dist/commands/common/utils/template.js +1 -2
  20. package/dist/commands/interface/run.js +23 -49
  21. package/dist/commands/intuned-cli/commands/deploy.command.js +2 -2
  22. package/dist/commands/intuned-cli/commands/provision.command.d.ts +2 -2
  23. package/dist/commands/intuned-cli/commands/provision.command.js +1 -1
  24. package/dist/commands/intuned-cli/commands/run_authsession.command.d.ts +8 -1
  25. package/dist/commands/intuned-cli/commands/types.d.ts +9 -1
  26. package/dist/commands/intuned-cli/commands/types.js +7 -3
  27. package/dist/commands/intuned-cli/controller/__test__/api.test.js +24 -14
  28. package/dist/commands/intuned-cli/controller/__test__/authSession.test.js +128 -66
  29. package/dist/commands/intuned-cli/controller/api.d.ts +2 -2
  30. package/dist/commands/intuned-cli/controller/api.js +3 -3
  31. package/dist/commands/intuned-cli/controller/authSession.d.ts +16 -16
  32. package/dist/commands/intuned-cli/controller/authSession.js +22 -11
  33. package/dist/commands/intuned-cli/controller/build.js +1 -2
  34. package/dist/commands/intuned-cli/controller/deploy.js +1 -2
  35. package/dist/commands/intuned-cli/controller/index.js +1 -2
  36. package/dist/commands/intuned-cli/controller/provision.js +1 -2
  37. package/dist/commands/intuned-cli/helpers/__test__/browser.test.js +44 -5
  38. package/dist/commands/intuned-cli/helpers/__test__/tracing.test.js +3 -3
  39. package/dist/commands/intuned-cli/helpers/auth.d.ts +4 -4
  40. package/dist/commands/intuned-cli/helpers/auth.js +2 -2
  41. package/dist/commands/intuned-cli/helpers/browser.d.ts +4 -4
  42. package/dist/commands/intuned-cli/helpers/browser.js +40 -5
  43. package/dist/commands/intuned-cli/helpers/errors.d.ts +1 -1
  44. package/dist/commands/intuned-cli/helpers/errors.js +2 -2
  45. package/dist/commands/intuned-cli/helpers/intunedJson.d.ts +6 -5
  46. package/dist/commands/intuned-cli/helpers/timeout.js +2 -2
  47. package/dist/commands/intuned-cli/helpers/traces.d.ts +1 -1
  48. package/dist/commands/intuned-cli/helpers/wrapper.js +2 -2
  49. package/dist/commands/intuned-cli/main.js +1 -2
  50. package/dist/commands/intuned-cli/types.d.ts +8 -8
  51. package/dist/commands/ts-check.js +1 -2
  52. package/dist/common/binStartupScript.js +1 -2
  53. package/dist/common/browserTabs.d.ts +72 -0
  54. package/dist/common/browserTabs.js +74 -0
  55. package/dist/common/constants.d.ts +1 -0
  56. package/dist/common/constants.js +2 -1
  57. package/dist/common/contextStorageStateHelpers.d.ts +4 -3
  58. package/dist/common/contextStorageStateHelpers.js +4 -1
  59. package/dist/common/extension/extensionsHelpers.d.ts +1 -1
  60. package/dist/common/extension/types.d.ts +14 -7
  61. package/dist/common/formatZodError.d.ts +1 -1
  62. package/dist/common/intunedJson.d.ts +19 -14
  63. package/dist/common/intunedJson.js +2 -2
  64. package/dist/common/jwtTokenManager.js +10 -6
  65. package/dist/common/launchBrowser.d.ts +8 -0
  66. package/dist/common/launchBrowser.js +39 -7
  67. package/dist/common/playwrightContext.d.ts +5 -5
  68. package/dist/common/playwrightContext.js +17 -13
  69. package/dist/common/runApi/importUsingImportFunction.d.ts +1 -3
  70. package/dist/common/runApi/importUsingImportFunction.js +7 -7
  71. package/dist/common/runApi/index.d.ts +3 -6
  72. package/dist/common/runApi/index.js +27 -51
  73. package/dist/common/settingsSchema.d.ts +52 -45
  74. package/dist/common/settingsSchema.js +3 -3
  75. package/dist/common/setupContextHook.d.ts +1 -2
  76. package/dist/common/setupContextHook.js +2 -2
  77. package/dist/common/telemetry.js +1 -2
  78. package/dist/index.d.ts +0 -1
  79. package/dist/index.js +0 -7
  80. package/dist/runtime/downloadDirectory.js +2 -2
  81. package/dist/vendor/runtime-interface.d.ts +1 -0
  82. package/dist/vendor/runtime-interface.js +493 -0
  83. package/package.json +17 -10
  84. package/tsup.config.ts +12 -0
  85. package/WebTemplate.zip +0 -0
  86. package/dist/common/runApi/errors.d.ts +0 -72
  87. package/dist/common/runApi/errors.js +0 -169
  88. package/dist/common/runApi/types.d.ts +0 -830
  89. 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 _runApi.AutomationError("runApi failed")));
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 _runApi.AutomationError("runApi failed"))).mockResolvedValue((0, _neverthrow.ok)({
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 _runApi.AutomationError("runApi failed"))).mockResolvedValue((0, _neverthrow.ok)({
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 _runApi.AutomationError("runApi failed")));
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(_runApi.AutomationError);
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 () => {