@intuned/runtime-dev 1.3.18-interface.4 → 1.3.18-interface.9

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 (307) hide show
  1. package/dist/chunk-3AGSY4RT.mjs +1108 -0
  2. package/dist/chunk-3AGSY4RT.mjs.map +1 -0
  3. package/dist/chunk-6ZRJOUQS.mjs +16 -0
  4. package/dist/chunk-6ZRJOUQS.mjs.map +1 -0
  5. package/dist/chunk-7YL2JUTE.mjs +146 -0
  6. package/dist/chunk-7YL2JUTE.mjs.map +1 -0
  7. package/dist/chunk-BF45RZ32.mjs +13 -0
  8. package/dist/chunk-BF45RZ32.mjs.map +1 -0
  9. package/dist/chunk-FGV5T6SI.mjs +27 -0
  10. package/dist/chunk-FGV5T6SI.mjs.map +1 -0
  11. package/dist/chunk-G4PO5RIV.mjs +85 -0
  12. package/dist/chunk-G4PO5RIV.mjs.map +1 -0
  13. package/dist/chunk-LZOMFHX3.mjs +38 -0
  14. package/dist/chunk-LZOMFHX3.mjs.map +1 -0
  15. package/dist/{common/formatZodError.js → chunk-NDMVGENG.mjs} +9 -9
  16. package/dist/chunk-NDMVGENG.mjs.map +1 -0
  17. package/dist/chunk-UO2E7T7T.mjs +787 -0
  18. package/dist/chunk-UO2E7T7T.mjs.map +1 -0
  19. package/dist/chunk-W4UX6G4X.mjs +17 -0
  20. package/dist/chunk-W4UX6G4X.mjs.map +1 -0
  21. package/dist/chunk-XOAZ2MGA.mjs +59 -0
  22. package/dist/chunk-XOAZ2MGA.mjs.map +1 -0
  23. package/dist/commands/common/tsNodeImport.d.mts +5 -0
  24. package/dist/commands/common/tsNodeImport.d.ts +5 -2
  25. package/dist/commands/common/tsNodeImport.js +56 -16
  26. package/dist/commands/common/tsNodeImport.js.map +1 -0
  27. package/dist/commands/common/tsNodeImport.mjs +45 -0
  28. package/dist/commands/common/tsNodeImport.mjs.map +1 -0
  29. package/dist/commands/interface/run.d.mts +3 -0
  30. package/dist/commands/interface/run.d.ts +3 -1
  31. package/dist/commands/interface/run.js +2047 -140
  32. package/dist/commands/interface/run.js.map +1 -0
  33. package/dist/commands/interface/run.mjs +256 -0
  34. package/dist/commands/interface/run.mjs.map +1 -0
  35. package/dist/common/asyncLocalStorage/index.d.mts +17 -0
  36. package/dist/common/asyncLocalStorage/index.d.ts +9 -8
  37. package/dist/common/asyncLocalStorage/index.js +34 -9
  38. package/dist/common/asyncLocalStorage/index.js.map +1 -0
  39. package/dist/common/asyncLocalStorage/index.mjs +12 -0
  40. package/dist/common/asyncLocalStorage/index.mjs.map +1 -0
  41. package/dist/common/binStartupScript.d.mts +2 -0
  42. package/dist/common/binStartupScript.d.ts +2 -1
  43. package/dist/common/binStartupScript.js +127 -11
  44. package/dist/common/binStartupScript.js.map +1 -0
  45. package/dist/common/binStartupScript.mjs +135 -0
  46. package/dist/common/binStartupScript.mjs.map +1 -0
  47. package/dist/common/cleanEnvironmentVariables.d.mts +3 -0
  48. package/dist/common/cleanEnvironmentVariables.d.ts +3 -1
  49. package/dist/common/cleanEnvironmentVariables.js +30 -7
  50. package/dist/common/cleanEnvironmentVariables.js.map +1 -0
  51. package/dist/common/cleanEnvironmentVariables.mjs +8 -0
  52. package/dist/common/cleanEnvironmentVariables.mjs.map +1 -0
  53. package/dist/common/constants.d.mts +13 -0
  54. package/dist/common/constants.d.ts +13 -11
  55. package/dist/common/constants.js +58 -15
  56. package/dist/common/constants.js.map +1 -0
  57. package/dist/common/constants.mjs +28 -0
  58. package/dist/common/constants.mjs.map +1 -0
  59. package/dist/common/contextStorageStateHelpers.d.mts +24 -0
  60. package/dist/common/contextStorageStateHelpers.d.ts +8 -6
  61. package/dist/common/contextStorageStateHelpers.js +47 -22
  62. package/dist/common/contextStorageStateHelpers.js.map +1 -0
  63. package/dist/common/contextStorageStateHelpers.mjs +10 -0
  64. package/dist/common/contextStorageStateHelpers.mjs.map +1 -0
  65. package/dist/common/jwtTokenManager.d.mts +19 -0
  66. package/dist/common/jwtTokenManager.d.ts +6 -4
  67. package/dist/common/jwtTokenManager.js +108 -41
  68. package/dist/common/jwtTokenManager.js.map +1 -0
  69. package/dist/common/jwtTokenManager.mjs +11 -0
  70. package/dist/common/jwtTokenManager.mjs.map +1 -0
  71. package/dist/common/runApi/index.d.mts +11 -0
  72. package/dist/common/runApi/index.d.ts +9 -6
  73. package/dist/common/runApi/index.js +1774 -74
  74. package/dist/common/runApi/index.js.map +1 -0
  75. package/dist/common/runApi/index.mjs +19 -0
  76. package/dist/common/runApi/index.mjs.map +1 -0
  77. package/dist/common/settingsSchema.d.mts +540 -0
  78. package/dist/common/settingsSchema.d.ts +58 -51
  79. package/dist/common/settingsSchema.js +55 -20
  80. package/dist/common/settingsSchema.js.map +1 -0
  81. package/dist/common/settingsSchema.mjs +10 -0
  82. package/dist/common/settingsSchema.mjs.map +1 -0
  83. package/dist/common/telemetry.d.mts +6 -0
  84. package/dist/common/telemetry.d.ts +6 -3
  85. package/dist/common/telemetry.js +41 -9
  86. package/dist/common/telemetry.js.map +1 -0
  87. package/dist/common/telemetry.mjs +31 -0
  88. package/dist/common/telemetry.mjs.map +1 -0
  89. package/dist/export.d-BAUMB-lG.d.mts +140 -0
  90. package/dist/export.d-BAUMB-lG.d.ts +140 -0
  91. package/dist/index.d.mts +6 -0
  92. package/dist/index.d.ts +6 -4
  93. package/dist/index.js +784 -92
  94. package/dist/index.js.map +1 -0
  95. package/dist/index.mjs +48 -0
  96. package/dist/index.mjs.map +1 -0
  97. package/dist/runtime/index.d.mts +168 -0
  98. package/dist/runtime/index.d.ts +168 -10
  99. package/dist/runtime/index.js +779 -88
  100. package/dist/runtime/index.js.map +1 -0
  101. package/dist/runtime/index.mjs +43 -0
  102. package/dist/runtime/index.mjs.map +1 -0
  103. package/package.json +77 -16
  104. package/.babelrc +0 -21
  105. package/.eslintignore +0 -10
  106. package/.eslintrc.js +0 -39
  107. package/.turbo/turbo-build.log +0 -2
  108. package/InterfaceTemplate/__utils.ts +0 -61
  109. package/InterfaceTemplate/index.playwright.ts +0 -6
  110. package/WebTemplate.zip +0 -0
  111. package/dist/commands/api/run.d.ts +0 -6
  112. package/dist/commands/api/run.js +0 -120
  113. package/dist/commands/auth-sessions/load.d.ts +0 -2
  114. package/dist/commands/auth-sessions/load.js +0 -35
  115. package/dist/commands/auth-sessions/run-check.d.ts +0 -2
  116. package/dist/commands/auth-sessions/run-check.js +0 -75
  117. package/dist/commands/auth-sessions/run-create.d.ts +0 -2
  118. package/dist/commands/auth-sessions/run-create.js +0 -79
  119. package/dist/commands/browser/save-state.d.ts +0 -2
  120. package/dist/commands/browser/save-state.js +0 -17
  121. package/dist/commands/browser/start-browser.d.ts +0 -2
  122. package/dist/commands/browser/start-browser.js +0 -14
  123. package/dist/commands/build.d.ts +0 -1
  124. package/dist/commands/build.js +0 -84
  125. package/dist/commands/common/browserUtils.d.ts +0 -14
  126. package/dist/commands/common/browserUtils.js +0 -58
  127. package/dist/commands/common/getFirstLineNumber.d.ts +0 -9
  128. package/dist/commands/common/getFirstLineNumber.js +0 -101
  129. package/dist/commands/common/getFirstLineNumber.test.js +0 -228
  130. package/dist/commands/common/projectExclusions.d.ts +0 -2
  131. package/dist/commands/common/projectExclusions.js +0 -8
  132. package/dist/commands/common/sendMessageToClient.d.ts +0 -1
  133. package/dist/commands/common/sendMessageToClient.js +0 -10
  134. package/dist/commands/common/utils/fileUtils.d.ts +0 -6
  135. package/dist/commands/common/utils/fileUtils.js +0 -33
  136. package/dist/commands/common/utils/interfaceClient.d.ts +0 -31
  137. package/dist/commands/common/utils/interfaceClient.js +0 -99
  138. package/dist/commands/common/utils/settings.d.ts +0 -2
  139. package/dist/commands/common/utils/settings.js +0 -31
  140. package/dist/commands/common/utils/template.d.ts +0 -2
  141. package/dist/commands/common/utils/template.js +0 -31
  142. package/dist/commands/get-headless-user-agent.d.ts +0 -1
  143. package/dist/commands/get-headless-user-agent.js +0 -18
  144. package/dist/commands/interface/pingPong.d.ts +0 -2
  145. package/dist/commands/interface/pingPong.js +0 -11
  146. package/dist/commands/interface/runApi.d.ts +0 -1
  147. package/dist/commands/interface/runApi.js +0 -102
  148. package/dist/commands/intuned-cli/commands/attempt.command.d.ts +0 -1
  149. package/dist/commands/intuned-cli/commands/attempt.command.js +0 -8
  150. package/dist/commands/intuned-cli/commands/attempt_api.command.d.ts +0 -1
  151. package/dist/commands/intuned-cli/commands/attempt_api.command.js +0 -30
  152. package/dist/commands/intuned-cli/commands/attempt_authsession.command.d.ts +0 -1
  153. package/dist/commands/intuned-cli/commands/attempt_authsession.command.js +0 -8
  154. package/dist/commands/intuned-cli/commands/attempt_authsession_check.command.d.ts +0 -1
  155. package/dist/commands/intuned-cli/commands/attempt_authsession_check.command.js +0 -19
  156. package/dist/commands/intuned-cli/commands/attempt_authsession_create.command.d.ts +0 -1
  157. package/dist/commands/intuned-cli/commands/attempt_authsession_create.command.js +0 -24
  158. package/dist/commands/intuned-cli/commands/authsession.command.d.ts +0 -1
  159. package/dist/commands/intuned-cli/commands/authsession.command.js +0 -8
  160. package/dist/commands/intuned-cli/commands/authsession_record.command.d.ts +0 -1
  161. package/dist/commands/intuned-cli/commands/authsession_record.command.js +0 -32
  162. package/dist/commands/intuned-cli/commands/authsession_scaffold.command.d.ts +0 -1
  163. package/dist/commands/intuned-cli/commands/authsession_scaffold.command.js +0 -16
  164. package/dist/commands/intuned-cli/commands/build.command.d.ts +0 -1
  165. package/dist/commands/intuned-cli/commands/build.command.js +0 -12
  166. package/dist/commands/intuned-cli/commands/command.d.ts +0 -2
  167. package/dist/commands/intuned-cli/commands/command.js +0 -9
  168. package/dist/commands/intuned-cli/commands/deploy.command.d.ts +0 -1
  169. package/dist/commands/intuned-cli/commands/deploy.command.js +0 -42
  170. package/dist/commands/intuned-cli/commands/index.d.ts +0 -18
  171. package/dist/commands/intuned-cli/commands/index.js +0 -203
  172. package/dist/commands/intuned-cli/commands/provision.command.d.ts +0 -13
  173. package/dist/commands/intuned-cli/commands/provision.command.js +0 -50
  174. package/dist/commands/intuned-cli/commands/run.command.d.ts +0 -1
  175. package/dist/commands/intuned-cli/commands/run.command.js +0 -8
  176. package/dist/commands/intuned-cli/commands/run_api.command.d.ts +0 -1
  177. package/dist/commands/intuned-cli/commands/run_api.command.js +0 -46
  178. package/dist/commands/intuned-cli/commands/run_authsession.command.d.ts +0 -34
  179. package/dist/commands/intuned-cli/commands/run_authsession.command.js +0 -17
  180. package/dist/commands/intuned-cli/commands/run_authsession_create.command.d.ts +0 -1
  181. package/dist/commands/intuned-cli/commands/run_authsession_create.command.js +0 -35
  182. package/dist/commands/intuned-cli/commands/run_authsession_update.command.d.ts +0 -1
  183. package/dist/commands/intuned-cli/commands/run_authsession_update.command.js +0 -35
  184. package/dist/commands/intuned-cli/commands/run_authsession_validate.command.d.ts +0 -1
  185. package/dist/commands/intuned-cli/commands/run_authsession_validate.command.js +0 -33
  186. package/dist/commands/intuned-cli/commands/types.d.ts +0 -39
  187. package/dist/commands/intuned-cli/commands/types.js +0 -33
  188. package/dist/commands/intuned-cli/constants/index.d.ts +0 -17
  189. package/dist/commands/intuned-cli/constants/index.js +0 -25
  190. package/dist/commands/intuned-cli/controller/__test__/api.test.js +0 -398
  191. package/dist/commands/intuned-cli/controller/__test__/authSession.test.js +0 -1060
  192. package/dist/commands/intuned-cli/controller/api.d.ts +0 -42
  193. package/dist/commands/intuned-cli/controller/api.js +0 -195
  194. package/dist/commands/intuned-cli/controller/authSession.d.ts +0 -209
  195. package/dist/commands/intuned-cli/controller/authSession.js +0 -425
  196. package/dist/commands/intuned-cli/controller/build.d.ts +0 -1
  197. package/dist/commands/intuned-cli/controller/build.js +0 -36
  198. package/dist/commands/intuned-cli/controller/deploy.d.ts +0 -5
  199. package/dist/commands/intuned-cli/controller/deploy.js +0 -318
  200. package/dist/commands/intuned-cli/controller/index.d.ts +0 -1
  201. package/dist/commands/intuned-cli/controller/index.js +0 -46
  202. package/dist/commands/intuned-cli/controller/provision.d.ts +0 -21
  203. package/dist/commands/intuned-cli/controller/provision.js +0 -300
  204. package/dist/commands/intuned-cli/controller/scaffold.d.ts +0 -1
  205. package/dist/commands/intuned-cli/controller/scaffold.js +0 -77
  206. package/dist/commands/intuned-cli/helpers/__test__/browser.test.js +0 -152
  207. package/dist/commands/intuned-cli/helpers/__test__/tracing.test.js +0 -41
  208. package/dist/commands/intuned-cli/helpers/api.d.ts +0 -3
  209. package/dist/commands/intuned-cli/helpers/api.js +0 -16
  210. package/dist/commands/intuned-cli/helpers/auth.d.ts +0 -46
  211. package/dist/commands/intuned-cli/helpers/auth.js +0 -147
  212. package/dist/commands/intuned-cli/helpers/backend.d.ts +0 -8
  213. package/dist/commands/intuned-cli/helpers/backend.js +0 -35
  214. package/dist/commands/intuned-cli/helpers/browser.d.ts +0 -14
  215. package/dist/commands/intuned-cli/helpers/browser.js +0 -93
  216. package/dist/commands/intuned-cli/helpers/context.d.ts +0 -3
  217. package/dist/commands/intuned-cli/helpers/context.js +0 -33
  218. package/dist/commands/intuned-cli/helpers/errors.d.ts +0 -16
  219. package/dist/commands/intuned-cli/helpers/errors.js +0 -44
  220. package/dist/commands/intuned-cli/helpers/index.d.ts +0 -12
  221. package/dist/commands/intuned-cli/helpers/index.js +0 -137
  222. package/dist/commands/intuned-cli/helpers/intunedJson.d.ts +0 -39
  223. package/dist/commands/intuned-cli/helpers/intunedJson.js +0 -20
  224. package/dist/commands/intuned-cli/helpers/prompts.d.ts +0 -3
  225. package/dist/commands/intuned-cli/helpers/prompts.js +0 -71
  226. package/dist/commands/intuned-cli/helpers/proxy.d.ts +0 -5
  227. package/dist/commands/intuned-cli/helpers/proxy.js +0 -23
  228. package/dist/commands/intuned-cli/helpers/terminal.d.ts +0 -5
  229. package/dist/commands/intuned-cli/helpers/terminal.js +0 -13
  230. package/dist/commands/intuned-cli/helpers/timeout.d.ts +0 -1
  231. package/dist/commands/intuned-cli/helpers/timeout.js +0 -23
  232. package/dist/commands/intuned-cli/helpers/traces.d.ts +0 -2
  233. package/dist/commands/intuned-cli/helpers/traces.js +0 -32
  234. package/dist/commands/intuned-cli/helpers/validation.d.ts +0 -2
  235. package/dist/commands/intuned-cli/helpers/validation.js +0 -14
  236. package/dist/commands/intuned-cli/helpers/wrapper.d.ts +0 -2
  237. package/dist/commands/intuned-cli/helpers/wrapper.js +0 -76
  238. package/dist/commands/intuned-cli/index.d.ts +0 -1
  239. package/dist/commands/intuned-cli/index.js +0 -16
  240. package/dist/commands/intuned-cli/main.d.ts +0 -1
  241. package/dist/commands/intuned-cli/main.js +0 -36
  242. package/dist/commands/intuned-cli/types.d.ts +0 -70
  243. package/dist/commands/intuned-cli/types.js +0 -22
  244. package/dist/commands/ts-check.d.ts +0 -2
  245. package/dist/commands/ts-check.js +0 -56
  246. package/dist/common/Logger/Logger/index.d.ts +0 -12
  247. package/dist/common/Logger/Logger/index.js +0 -60
  248. package/dist/common/Logger/Logger/types.d.ts +0 -8
  249. package/dist/common/Logger/Logger/types.js +0 -5
  250. package/dist/common/Logger/index.d.ts +0 -12
  251. package/dist/common/Logger/index.js +0 -60
  252. package/dist/common/Logger/types.d.ts +0 -8
  253. package/dist/common/Logger/types.js +0 -5
  254. package/dist/common/backendFunctions/getAuthSessionParameters.d.ts +0 -1
  255. package/dist/common/backendFunctions/getAuthSessionParameters.js +0 -38
  256. package/dist/common/browserTabs.d.ts +0 -72
  257. package/dist/common/browserTabs.js +0 -74
  258. package/dist/common/extension/extensionsHelpers.d.ts +0 -11
  259. package/dist/common/extension/extensionsHelpers.js +0 -147
  260. package/dist/common/extension/intunedExtensionServer.d.ts +0 -24
  261. package/dist/common/extension/intunedExtensionServer.js +0 -178
  262. package/dist/common/extension/types.d.ts +0 -212
  263. package/dist/common/extension/types.js +0 -51
  264. package/dist/common/formatZodError.d.ts +0 -2
  265. package/dist/common/intunedJson.d.ts +0 -229
  266. package/dist/common/intunedJson.js +0 -133
  267. package/dist/common/launchBrowser.d.ts +0 -34
  268. package/dist/common/launchBrowser.js +0 -248
  269. package/dist/common/playwrightContext.d.ts +0 -30
  270. package/dist/common/playwrightContext.js +0 -153
  271. package/dist/common/runApi/importUsingImportFunction.d.ts +0 -7
  272. package/dist/common/runApi/importUsingImportFunction.js +0 -46
  273. package/dist/common/setupContextHook.d.ts +0 -16
  274. package/dist/common/setupContextHook.js +0 -22
  275. package/dist/runtime/RunError.d.ts +0 -5
  276. package/dist/runtime/RunError.js +0 -19
  277. package/dist/runtime/attemptStore.d.ts +0 -2
  278. package/dist/runtime/attemptStore.js +0 -23
  279. package/dist/runtime/captcha.d.ts +0 -15
  280. package/dist/runtime/captcha.js +0 -191
  281. package/dist/runtime/captcha.test.js +0 -821
  282. package/dist/runtime/downloadDirectory.d.ts +0 -1
  283. package/dist/runtime/downloadDirectory.js +0 -19
  284. package/dist/runtime/enums.d.js +0 -5
  285. package/dist/runtime/enums.d.ts +0 -11
  286. package/dist/runtime/enums.js +0 -18
  287. package/dist/runtime/executionHelpers.test.js +0 -52
  288. package/dist/runtime/export.d.js +0 -5
  289. package/dist/runtime/export.d.ts +0 -284
  290. package/dist/runtime/extendPayload.d.ts +0 -2
  291. package/dist/runtime/extendPayload.js +0 -21
  292. package/dist/runtime/extendTimeout.d.ts +0 -1
  293. package/dist/runtime/extendTimeout.js +0 -23
  294. package/dist/runtime/getAiGatewayConfig.d.ts +0 -10
  295. package/dist/runtime/getAiGatewayConfig.js +0 -16
  296. package/dist/runtime/getAuthSessionParameters.d.ts +0 -1
  297. package/dist/runtime/getAuthSessionParameters.js +0 -20
  298. package/dist/runtime/persistentStore.d.ts +0 -2
  299. package/dist/runtime/persistentStore.js +0 -37
  300. package/dist/runtime/persistentStore.test.js +0 -101
  301. package/dist/runtime/runInfo.d.ts +0 -2
  302. package/dist/runtime/runInfo.js +0 -21
  303. package/template.tsconfig.json +0 -11
  304. package/tsconfig.eslint.json +0 -5
  305. package/tsconfig.json +0 -25
  306. package/typedoc.json +0 -49
  307. /package/dist/common/assets/{browser_scripts.js → assets/browser_scripts.js} +0 -0
@@ -1,75 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
-
4
- var _commander = require("commander");
5
- var fs = _interopRequireWildcard(require("fs-extra"));
6
- var _fileUtils = require("../common/utils/fileUtils");
7
- var _settings = require("../common/utils/settings");
8
- var _dotenv = _interopRequireDefault(require("dotenv"));
9
- var _constants = require("../../common/constants");
10
- var _runApi = require("../../common/runApi");
11
- var _runtimeInterface = require("@intuned/runtime-interface");
12
- var _tsNodeImport = require("../common/tsNodeImport");
13
- var _enums = require("../../runtime/enums");
14
- var _nanoid = require("nanoid");
15
- var _asyncLocalStorage = require("../../common/asyncLocalStorage");
16
- var _isNil = _interopRequireDefault(require("lodash/isNil"));
17
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
- 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); }
19
- 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; }
20
- _dotenv.default.config({
21
- path: `.env`
22
- });
23
- _commander.program.description("run AuthSession check").option("--cdpAddress <cdpAddress>", "CDP address", "http://localhost:9222").option("--authSessionPath <authSession>", "AuthSession to use when executing the check").option("--authSessionParameters <authSessionParameters>", "parameters used to create the used AuthSession").allowUnknownOption().addArgument(new _commander.Argument("<mode>", "mode of execution").choices(["vanilla", "playwright", "playwright-standalone"]).default("playwright-standalone").argOptional()).action(async (mode, {
24
- cdpAddress,
25
- authSessionPath,
26
- authSessionParameters
27
- }) => {
28
- const setting = await (0, _settings.getSettings)();
29
- if (!setting.authSessions.enabled) {
30
- throw new Error("Authentication required but not configured.\n" + "Enable AuthSessions in Intuned.json to use this feature.\n" + "See https://docs.intunedhq.com/docs/cli/auth-sessions for more information.");
31
- }
32
- const checkFilePath = (0, _fileUtils.getFullPathInProject)(_constants.AUTH_SESSIONS_FOLDER_NAME, "check");
33
- if (!fs.exists(checkFilePath)) {
34
- throw new Error("AuthSession check file not found");
35
- }
36
- let authSessionParametersJson = undefined;
37
- if (!(0, _isNil.default)(authSessionParameters)) {
38
- authSessionParametersJson = JSON.parse(authSessionParameters);
39
- }
40
- const runApiResult = await (0, _asyncLocalStorage.runWithContext)({
41
- runEnvironment: _enums.RunEnvironment.IDE,
42
- extendedPayloads: [],
43
- runId: (0, _nanoid.nanoid)(),
44
- getAuthSessionParameters: authSessionParametersJson !== undefined ? async () => authSessionParametersJson : undefined
45
- }, async () => await (0, _runApi.runApi)({
46
- automationFunction: {
47
- name: `${_constants.AUTH_SESSIONS_FOLDER_NAME}/check`
48
- },
49
- runOptions: {
50
- environment: "cdp",
51
- cdpAddress
52
- },
53
- auth: {
54
- session: {
55
- type: "file",
56
- path: authSessionPath
57
- }
58
- },
59
- importFunction: _tsNodeImport.tsNodeImport
60
- }));
61
- if (runApiResult.isErr()) {
62
- if (runApiResult.error instanceof _runtimeInterface.AutomationError) {
63
- throw runApiResult.error.error;
64
- }
65
- console.error(runApiResult.error);
66
- throw new Error("Error running AuthSession check");
67
- }
68
- const result = runApiResult.value.result;
69
- console.log("check result", result);
70
- if (!result) {
71
- throw new Error("AuthSession check failed");
72
- }
73
- process.exit(0);
74
- });
75
- _commander.program.parse(process.argv);
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
@@ -1,79 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
-
4
- var _commander = require("commander");
5
- var fs = _interopRequireWildcard(require("fs-extra"));
6
- var _fileUtils = require("../common/utils/fileUtils");
7
- var _settings = require("../common/utils/settings");
8
- var _dotenv = _interopRequireDefault(require("dotenv"));
9
- var _constants = require("../../common/constants");
10
- var _runApi = require("../../common/runApi");
11
- var _runtimeInterface = require("@intuned/runtime-interface");
12
- var _asyncLocalStorage = require("../../common/asyncLocalStorage");
13
- var _nanoid = require("nanoid");
14
- var _enums = require("../../runtime/enums");
15
- var _tsNodeImport = require("../common/tsNodeImport");
16
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
- 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); }
18
- 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; }
19
- _dotenv.default.config({
20
- path: `.env`
21
- });
22
- _commander.program.description("run AuthSession create").option("--cdpAddress <cdpAddress>", "CDP address", "http://localhost:9222").option("-i, --input [file]", "input json file").option("-j, --json [json]", "input json string").option("--authSessionPath <authSession>", "AuthSession to use when executing the api").option("--pathToSave <pathToSave>", "path to save the AuthSession, if not provided, will discard the AuthSession").allowUnknownOption().addArgument(new _commander.Argument("<mode>", "mode of execution").choices(["vanilla", "playwright", "playwright-standalone"]).default("playwright-standalone").argOptional()).action(async (mode, {
23
- cdpAddress,
24
- pathToSave,
25
- input,
26
- json
27
- }) => {
28
- let inputData = null;
29
- if (input) {
30
- inputData = await fs.readJSON(input);
31
- } else if (json) {
32
- inputData = JSON.parse(json);
33
- } else {
34
- inputData = {};
35
- }
36
- const setting = await (0, _settings.getSettings)();
37
- if (!setting.authSessions.enabled) {
38
- throw new Error("Authentication required but not configured.\n" + "Enable AuthSessions in Intuned.json to use this feature.\n" + "See https://docs.intunedhq.com/docs/cli/auth-sessions for more information.");
39
- }
40
- const createFilePath = (0, _fileUtils.getFullPathInProject)(_constants.AUTH_SESSIONS_FOLDER_NAME, "create.ts");
41
- if (!fs.exists(createFilePath)) {
42
- throw new Error("AuthSession create file not found");
43
- }
44
- async function runCreate() {
45
- const result = await (0, _runApi.runApi)({
46
- automationFunction: {
47
- name: `${_constants.AUTH_SESSIONS_FOLDER_NAME}/create`,
48
- params: inputData
49
- },
50
- runOptions: {
51
- environment: "cdp",
52
- cdpAddress
53
- },
54
- retrieveSession: true,
55
- importFunction: _tsNodeImport.tsNodeImport
56
- });
57
- if (result.isErr()) {
58
- if (result.error instanceof _runtimeInterface.AutomationError) {
59
- throw result.error.error;
60
- }
61
- console.error(result.error);
62
- throw new Error("Error while running create");
63
- }
64
- const fullState = result.value.session;
65
- if (pathToSave) {
66
- const fullPath = (0, _fileUtils.getFullPathInProject)(pathToSave);
67
- fs.ensureFileSync(fullPath);
68
- await fs.writeJSON(fullPath, fullState);
69
- }
70
- }
71
- await (0, _asyncLocalStorage.runWithContext)({
72
- runEnvironment: _enums.RunEnvironment.IDE,
73
- extendedPayloads: [],
74
- runId: (0, _nanoid.nanoid)(),
75
- getAuthSessionParameters: async () => inputData
76
- }, runCreate);
77
- process.exit(0);
78
- });
79
- _commander.program.parse(process.argv);
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
@@ -1,17 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
-
4
- var _commander = require("commander");
5
- var _browserUtils = require("../common/browserUtils");
6
- var _dotenv = _interopRequireDefault(require("dotenv"));
7
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
8
- _dotenv.default.config({
9
- path: `.env`
10
- });
11
- _commander.program.description("save browser state to file storage.json").option("-p, --path [file]", "path for file", "./localSessions/default.json").allowUnknownOption().action(async ({
12
- path
13
- }) => {
14
- await (0, _browserUtils.saveSessionFromOpenedBrowser)(path);
15
- process.exit(0);
16
- });
17
- _commander.program.parse(process.argv);
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
-
4
- var _commander = require("commander");
5
- var _browserUtils = require("../common/browserUtils");
6
- var _dotenv = _interopRequireDefault(require("dotenv"));
7
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
8
- _dotenv.default.config({
9
- path: `.env`
10
- });
11
- _commander.program.description("start browser testing purposes").allowUnknownOption().action(async () => {
12
- await (0, _browserUtils.startOrRestartBrowser)();
13
- });
14
- _commander.program.parse(process.argv);
@@ -1 +0,0 @@
1
- export {};
@@ -1,84 +0,0 @@
1
- "use strict";
2
-
3
- var _commander = require("commander");
4
- var _rollup = require("rollup");
5
- var _pluginTypescript = _interopRequireDefault(require("@rollup/plugin-typescript"));
6
- var _pluginCommonjs = _interopRequireDefault(require("@rollup/plugin-commonjs"));
7
- var _pluginNodeResolve = require("@rollup/plugin-node-resolve");
8
- var _pluginDynamicImportVars = _interopRequireDefault(require("@rollup/plugin-dynamic-import-vars"));
9
- var _pluginJson = _interopRequireDefault(require("@rollup/plugin-json"));
10
- var fs = _interopRequireWildcard(require("fs-extra"));
11
- var path = _interopRequireWildcard(require("path"));
12
- var _template = require("./common/utils/template");
13
- var _dotenv = _interopRequireDefault(require("dotenv"));
14
- 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); }
15
- 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; }
16
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
- function isThirdPartyWarning(warning) {
18
- if (warning.id && /node_modules/.test(warning.id)) return true;
19
- if (warning.ids && warning.ids.every(id => /node_modules/.test(id))) return true;
20
- return false;
21
- }
22
- _dotenv.default.config();
23
- _commander.program.description("build the intuned server").option("-t, --template <type>", "template to use", "InterfaceTemplate").addArgument(new _commander.Argument("<mode>", "mode of execution").choices(["vanilla", "playwright"]).default("playwright").argOptional()).argument("[outfile]", "output bundle", "./output/bundle_v2.js").allowUnknownOption().action(async (mode, outfile, {
24
- template
25
- }) => {
26
- await (0, _template.moveTemplateFiles)(template);
27
- const currentTemplateTsConfig = path.resolve(path.dirname(__filename), "..", "..", "template.tsconfig.json");
28
- await fs.copy(currentTemplateTsConfig, `./intuned/${template}/tsconfig.json`);
29
- await build(outfile, mode, template);
30
- });
31
- async function build(outfile, mode, template) {
32
- let bundle = null;
33
- let buildFailed = false;
34
- try {
35
- bundle = await (0, _rollup.rollup)({
36
- input: `./intuned/${template}/index.${mode}.ts`,
37
- output: {
38
- globals: {
39
- crypto: "crypto"
40
- }
41
- },
42
- plugins: [(0, _pluginJson.default)(), (0, _pluginNodeResolve.nodeResolve)({
43
- exportConditions: ["node"],
44
- preferBuiltins: true
45
- }), (0, _pluginTypescript.default)({
46
- tsconfig: `./intuned/${template}/tsconfig.json`
47
- }), (0, _pluginCommonjs.default)({
48
- include: ["node_modules/**", `intuned/${template}/**`, "dist", "../typescript-runtime/**"],
49
- extensions: [".js"],
50
- ignoreGlobal: false,
51
- sourceMap: false,
52
- dynamicRequireTargets: ["api/**/*.js", "auth-sessions/**/*.js"],
53
- requireReturnsDefault: "auto",
54
- transformMixedEsModules: true
55
- }), (0, _pluginDynamicImportVars.default)({
56
- include: ["**/*.js", "**/*.ts"],
57
- exclude: ["**/*.d.ts", "**/*.js.map"]
58
- })],
59
- onwarn: (warning, warn) => {
60
- if (isThirdPartyWarning(warning)) return;
61
- warn(warning);
62
- },
63
- external: ["playwright", "playwright-core", "jsdom", "canvas", "pdfjs-dist", "pdf-to-png-converter", "crypto", "applicationinsights", "fingerprint-generator", "fingerprint-injector", "node-fetch"]
64
- });
65
- console.log(`📦 Building ${outfile}`);
66
- const outfileFolder = path.dirname(outfile);
67
- const assetsDir = path.resolve(path.dirname(__filename), "..", "common", "assets");
68
- await fs.copy(assetsDir, `${outfileFolder}/assets`);
69
- await bundle.write({
70
- format: "cjs",
71
- file: outfile,
72
- inlineDynamicImports: true
73
- });
74
- console.log(`✨ Build succeeded: ${outfile}`);
75
- } catch (error) {
76
- buildFailed = true;
77
- console.error("error", error);
78
- }
79
- if (buildFailed) {
80
- console.error("build failed");
81
- process.exit(1);
82
- }
83
- }
84
- _commander.program.parse(process.argv);
@@ -1,14 +0,0 @@
1
- import * as playwright from "playwright";
2
- export declare const REMOTE_DEBUGGING_PORT = 9222;
3
- export declare const getChromiumLaunchArgs: () => string[];
4
- export declare function startOrRestartBrowser(): Promise<void>;
5
- export interface SessionState {
6
- cookies: any[];
7
- storage: Record<string, {
8
- localStorage: any;
9
- sessionStorage: any;
10
- }>;
11
- }
12
- export declare function saveSessionFromOpenedBrowser(path: string): Promise<void>;
13
- export declare function loadState(path: string, context: playwright.BrowserContext): Promise<void>;
14
- export declare function saveSession(path: string, context: playwright.BrowserContext): Promise<void>;
@@ -1,58 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getChromiumLaunchArgs = exports.REMOTE_DEBUGGING_PORT = void 0;
7
- exports.loadState = loadState;
8
- exports.saveSession = saveSession;
9
- exports.saveSessionFromOpenedBrowser = saveSessionFromOpenedBrowser;
10
- exports.startOrRestartBrowser = startOrRestartBrowser;
11
- var _child_process = require("child_process");
12
- var fs = _interopRequireWildcard(require("fs-extra"));
13
- var _fileUtils = require("./utils/fileUtils");
14
- var _contextStorageStateHelpers = require("../../common/contextStorageStateHelpers");
15
- var playwright = _interopRequireWildcard(require("playwright"));
16
- 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); }
17
- 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; }
18
- const REMOTE_DEBUGGING_PORT = exports.REMOTE_DEBUGGING_PORT = 9222;
19
- const getChromiumLaunchArgs = () => ["--no-sandbox", `--remote-debugging-port=${REMOTE_DEBUGGING_PORT}`, `--user-data-dir=/tmp/${Date.now()}`, "--new-window", "--start-maximized", "--disable-popup-blocking"];
20
- exports.getChromiumLaunchArgs = getChromiumLaunchArgs;
21
- async function getBrowser() {
22
- let playwrightBrowser = null;
23
- try {
24
- playwrightBrowser = await playwright.chromium.connectOverCDP(`http://localhost:${REMOTE_DEBUGGING_PORT}`);
25
- } catch (e) {
26
- throw new Error("Browser is not running");
27
- }
28
- return playwrightBrowser;
29
- }
30
- async function startOrRestartBrowser() {
31
- const chromiumPath = playwright.chromium.executablePath();
32
- const chromeInstanceProcess = (0, _child_process.spawn)(chromiumPath, getChromiumLaunchArgs());
33
- chromeInstanceProcess.stdout.on("data", data => {
34
- console.log(`Chrome stdout: ${data}`);
35
- });
36
- chromeInstanceProcess.stderr.on("data", data => {
37
- console.error(`Chrome stderr: ${data}`);
38
- });
39
- }
40
- async function saveSessionFromOpenedBrowser(path) {
41
- const browser = await getBrowser();
42
- const context = await browser.contexts()[0];
43
- return saveSession(path, context);
44
- }
45
- async function loadState(path, context) {
46
- const fullPath = (0, _fileUtils.getFullPathInProject)(path);
47
- if (!(await fs.pathExists(fullPath))) {
48
- throw new Error("session file does not exist");
49
- }
50
- const data = await fs.readJson(fullPath);
51
- await context.addCookies(data.cookies);
52
- }
53
- async function saveSession(path, context) {
54
- const fullState = await (0, _contextStorageStateHelpers.getStorageState)(context);
55
- const fullPath = (0, _fileUtils.getFullPathInProject)(path);
56
- fs.ensureFileSync(fullPath);
57
- await fs.writeJSON(fullPath, fullState);
58
- }
@@ -1,9 +0,0 @@
1
- import { SourceFile } from "ts-morph";
2
- export declare function findFirstExecutableLine(sourceFile: SourceFile): -1 | {
3
- line: number;
4
- column: number;
5
- };
6
- export default function getFirstLineNumber(apiFilePath: string): Promise<{
7
- sourceFileName: string;
8
- lineNumber: number;
9
- }>;
@@ -1,101 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = getFirstLineNumber;
7
- exports.findFirstExecutableLine = findFirstExecutableLine;
8
- var _tsMorph = require("ts-morph");
9
- var _sourceMap = require("source-map");
10
- function compileTypeScript(apiFilePath) {
11
- const compilerOptions = {
12
- lib: ["dom", "es2020"],
13
- sourceMap: true,
14
- inlineSourceMap: true,
15
- inlineSources: true,
16
- declaration: false,
17
- noEmit: false,
18
- module: _tsMorph.ModuleKind.CommonJS,
19
- target: _tsMorph.ScriptTarget.ES2020
20
- };
21
- const project = new _tsMorph.Project({
22
- compilerOptions
23
- });
24
- const sourceFile = project.addSourceFileAtPath(apiFilePath);
25
- const outputJS = project.emitToMemory({
26
- targetSourceFile: sourceFile
27
- });
28
- const outputJSText = outputJS.getFiles()[0].text;
29
- return {
30
- sourceFile,
31
- outputJSText
32
- };
33
- }
34
- function findFirstExecutableLine(sourceFile) {
35
- let functionBody;
36
- const defaultExportSymbol = sourceFile.getDefaultExportSymbol();
37
- const defaultExportDeclaration = defaultExportSymbol?.getDeclarations()?.[0];
38
- if (defaultExportDeclaration) {
39
- if (defaultExportDeclaration.getKind() === _tsMorph.ts.SyntaxKind.FunctionDeclaration) {
40
- functionBody = defaultExportDeclaration.getBody();
41
- } else {
42
- const exportAssignments = sourceFile.getExportAssignments();
43
- for (const exportAssignment of exportAssignments) {
44
- const expression = exportAssignment.getExpression();
45
- if (!expression) continue;
46
- if (expression.getKind() === _tsMorph.ts.SyntaxKind.Identifier || expression.getKind() === _tsMorph.ts.SyntaxKind.FunctionExpression || expression.getKind() === _tsMorph.ts.SyntaxKind.ArrowFunction) {
47
- const identifier = expression.getText();
48
- const possiblyExportedFunction = sourceFile.getFunction(identifier) || sourceFile.getVariableStatement(identifier)?.getDescendants().find(node => node.getKind() === _tsMorph.ts.SyntaxKind.FunctionExpression || node.getKind() === _tsMorph.ts.SyntaxKind.ArrowFunction);
49
- if (possiblyExportedFunction) {
50
- functionBody = possiblyExportedFunction.getBody();
51
- break;
52
- }
53
- }
54
- if (_tsMorph.Node.hasBody(expression) && (expression.getKind() === _tsMorph.ts.SyntaxKind.FunctionExpression || expression.getKind() === _tsMorph.ts.SyntaxKind.ArrowFunction)) {
55
- functionBody = expression.getBody();
56
- break;
57
- }
58
- }
59
- }
60
- }
61
- if (!functionBody || !_tsMorph.Node.isStatemented(functionBody)) {
62
- return -1;
63
- }
64
- if (functionBody.getStatements().length === 0) {
65
- return -1;
66
- }
67
- const position = functionBody.getStatements()[0].getStart();
68
- return sourceFile.getLineAndColumnAtPos(position);
69
- }
70
- async function getSourceMap(jsCode) {
71
- const sourceMapBase64 = jsCode.substring(jsCode.lastIndexOf("//# sourceMappingURL=data:application/json;base64,") + "//# sourceMappingURL=data:application/json;base64,".length);
72
- const sourceMapText = Buffer.from(sourceMapBase64, "base64").toString("utf-8");
73
- const sourceMap = JSON.parse(sourceMapText);
74
- return new _sourceMap.SourceMapConsumer(sourceMap);
75
- }
76
- async function mapFirstLineNumberBySourceMap(sourceFileName, jsCode, line, column) {
77
- const sourceMap = await getSourceMap(jsCode);
78
- const generatedLineNumber = sourceMap.generatedPositionFor({
79
- source: sourceFileName,
80
- line,
81
- column
82
- }).line;
83
- if (!generatedLineNumber) return -1;
84
- return generatedLineNumber;
85
- }
86
- async function getFirstLineNumber(apiFilePath) {
87
- const sourceFileName = apiFilePath.split("/").pop() ?? apiFilePath;
88
- const {
89
- sourceFile,
90
- outputJSText
91
- } = compileTypeScript(apiFilePath);
92
- const result = findFirstExecutableLine(sourceFile);
93
- if (result === -1) return {
94
- sourceFileName,
95
- lineNumber: -1
96
- };
97
- return {
98
- sourceFileName,
99
- lineNumber: await mapFirstLineNumberBySourceMap(sourceFileName, outputJSText, result.line, result.column)
100
- };
101
- }