@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.
Files changed (220) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/commands/common/utils/settings.d.ts +5 -0
  3. package/dist/commands/common/utils/settings.js +5 -17
  4. package/dist/common/asyncLocalStorage/index.d.ts +11 -0
  5. package/dist/common/asyncLocalStorage/index.js +4 -0
  6. package/dist/common/extension/intunedExtensionServer.js +3 -0
  7. package/dist/common/extension/types.d.ts +49 -25
  8. package/dist/common/extension/types.js +3 -2
  9. package/dist/common/launchBrowser.d.ts +11 -4
  10. package/dist/common/launchBrowser.js +27 -55
  11. package/dist/common/playwrightContext.d.ts +7 -3
  12. package/dist/common/playwrightContext.js +11 -7
  13. package/dist/common/runApi/index.js +24 -6
  14. package/dist/common/settingsSchema.d.ts +431 -25
  15. package/dist/common/settingsSchema.js +18 -2
  16. package/dist/runtime/captcha.js +15 -13
  17. package/dist/vendor/runtime-interface.js +14 -6
  18. package/{dist → package/dist}/commands/api/run.js +11 -7
  19. package/{dist → package/dist}/commands/auth-sessions/load.js +2 -2
  20. package/{dist → package/dist}/commands/auth-sessions/run-check.js +8 -8
  21. package/{dist → package/dist}/commands/auth-sessions/run-create.js +6 -6
  22. package/package/dist/commands/browser/save-state.d.ts +2 -0
  23. package/package/dist/commands/browser/save-state.js +17 -0
  24. package/package/dist/commands/browser/start-browser.d.ts +2 -0
  25. package/package/dist/commands/browser/start-browser.js +14 -0
  26. package/package/dist/commands/build.d.ts +1 -0
  27. package/package/dist/commands/build.js +84 -0
  28. package/package/dist/commands/common/browserUtils.d.ts +14 -0
  29. package/package/dist/commands/common/browserUtils.js +58 -0
  30. package/package/dist/commands/common/getFirstLineNumber.d.ts +9 -0
  31. package/package/dist/commands/common/getFirstLineNumber.js +101 -0
  32. package/package/dist/commands/common/getFirstLineNumber.test.js +228 -0
  33. package/package/dist/commands/common/projectExclusions.d.ts +2 -0
  34. package/package/dist/commands/common/projectExclusions.js +8 -0
  35. package/package/dist/commands/common/sendMessageToClient.d.ts +1 -0
  36. package/package/dist/commands/common/sendMessageToClient.js +10 -0
  37. package/package/dist/commands/common/tsNodeImport.d.ts +2 -0
  38. package/package/dist/commands/common/tsNodeImport.js +34 -0
  39. package/package/dist/commands/common/utils/fileUtils.d.ts +6 -0
  40. package/package/dist/commands/common/utils/fileUtils.js +33 -0
  41. package/package/dist/commands/common/utils/settings.d.ts +2 -0
  42. package/package/dist/commands/common/utils/settings.js +31 -0
  43. package/package/dist/commands/common/utils/template.d.ts +2 -0
  44. package/package/dist/commands/common/utils/template.js +31 -0
  45. package/package/dist/commands/common/utils/unixSocket.d.ts +9 -0
  46. package/package/dist/commands/common/utils/unixSocket.js +44 -0
  47. package/package/dist/commands/interface/run.d.ts +1 -0
  48. package/package/dist/commands/interface/run.js +216 -0
  49. package/package/dist/commands/intuned-cli/commands/attempt.command.d.ts +1 -0
  50. package/package/dist/commands/intuned-cli/commands/attempt.command.js +8 -0
  51. package/package/dist/commands/intuned-cli/commands/attempt_api.command.d.ts +1 -0
  52. package/package/dist/commands/intuned-cli/commands/attempt_api.command.js +30 -0
  53. package/package/dist/commands/intuned-cli/commands/attempt_authsession.command.d.ts +1 -0
  54. package/package/dist/commands/intuned-cli/commands/attempt_authsession.command.js +8 -0
  55. package/package/dist/commands/intuned-cli/commands/attempt_authsession_check.command.d.ts +1 -0
  56. package/package/dist/commands/intuned-cli/commands/attempt_authsession_check.command.js +19 -0
  57. package/package/dist/commands/intuned-cli/commands/attempt_authsession_create.command.d.ts +1 -0
  58. package/package/dist/commands/intuned-cli/commands/attempt_authsession_create.command.js +24 -0
  59. package/package/dist/commands/intuned-cli/commands/authsession.command.d.ts +1 -0
  60. package/package/dist/commands/intuned-cli/commands/authsession.command.js +8 -0
  61. package/package/dist/commands/intuned-cli/commands/authsession_record.command.d.ts +1 -0
  62. package/package/dist/commands/intuned-cli/commands/authsession_record.command.js +31 -0
  63. package/package/dist/commands/intuned-cli/commands/build.command.d.ts +1 -0
  64. package/package/dist/commands/intuned-cli/commands/build.command.js +12 -0
  65. package/package/dist/commands/intuned-cli/commands/command.d.ts +2 -0
  66. package/package/dist/commands/intuned-cli/commands/command.js +9 -0
  67. package/package/dist/commands/intuned-cli/commands/deploy.command.d.ts +1 -0
  68. package/package/dist/commands/intuned-cli/commands/deploy.command.js +38 -0
  69. package/package/dist/commands/intuned-cli/commands/index.d.ts +18 -0
  70. package/package/dist/commands/intuned-cli/commands/index.js +203 -0
  71. package/package/dist/commands/intuned-cli/commands/init.command.d.ts +1 -0
  72. package/package/dist/commands/intuned-cli/commands/init.command.js +13 -0
  73. package/package/dist/commands/intuned-cli/commands/run.command.d.ts +1 -0
  74. package/package/dist/commands/intuned-cli/commands/run.command.js +8 -0
  75. package/package/dist/commands/intuned-cli/commands/run_api.command.d.ts +1 -0
  76. package/package/dist/commands/intuned-cli/commands/run_api.command.js +46 -0
  77. package/package/dist/commands/intuned-cli/commands/run_authsession.command.d.ts +28 -0
  78. package/package/dist/commands/intuned-cli/commands/run_authsession.command.js +17 -0
  79. package/package/dist/commands/intuned-cli/commands/run_authsession_create.command.d.ts +1 -0
  80. package/package/dist/commands/intuned-cli/commands/run_authsession_create.command.js +35 -0
  81. package/package/dist/commands/intuned-cli/commands/run_authsession_update.command.d.ts +1 -0
  82. package/package/dist/commands/intuned-cli/commands/run_authsession_update.command.js +35 -0
  83. package/package/dist/commands/intuned-cli/commands/run_authsession_validate.command.d.ts +1 -0
  84. package/package/dist/commands/intuned-cli/commands/run_authsession_validate.command.js +33 -0
  85. package/package/dist/commands/intuned-cli/commands/save.command.d.ts +13 -0
  86. package/package/dist/commands/intuned-cli/commands/save.command.js +42 -0
  87. package/package/dist/commands/intuned-cli/commands/types.d.ts +31 -0
  88. package/package/dist/commands/intuned-cli/commands/types.js +29 -0
  89. package/package/dist/commands/intuned-cli/constants/index.d.ts +17 -0
  90. package/package/dist/commands/intuned-cli/constants/index.js +25 -0
  91. package/package/dist/commands/intuned-cli/controller/__test__/api.test.js +397 -0
  92. package/package/dist/commands/intuned-cli/controller/__test__/authSession.test.js +1059 -0
  93. package/package/dist/commands/intuned-cli/controller/api.d.ts +42 -0
  94. package/package/dist/commands/intuned-cli/controller/api.js +189 -0
  95. package/package/dist/commands/intuned-cli/controller/authSession.d.ts +209 -0
  96. package/package/dist/commands/intuned-cli/controller/authSession.js +420 -0
  97. package/package/dist/commands/intuned-cli/controller/build.d.ts +1 -0
  98. package/package/dist/commands/intuned-cli/controller/build.js +36 -0
  99. package/package/dist/commands/intuned-cli/controller/deploy.d.ts +4 -0
  100. package/package/dist/commands/intuned-cli/controller/deploy.js +139 -0
  101. package/package/dist/commands/intuned-cli/controller/index.d.ts +1 -0
  102. package/package/dist/commands/intuned-cli/controller/index.js +46 -0
  103. package/package/dist/commands/intuned-cli/controller/save.d.ts +14 -0
  104. package/package/dist/commands/intuned-cli/controller/save.js +345 -0
  105. package/package/dist/commands/intuned-cli/helpers/__test__/browser.test.js +103 -0
  106. package/package/dist/commands/intuned-cli/helpers/__test__/tracing.test.js +40 -0
  107. package/package/dist/commands/intuned-cli/helpers/api.d.ts +3 -0
  108. package/package/dist/commands/intuned-cli/helpers/api.js +19 -0
  109. package/package/dist/commands/intuned-cli/helpers/auth.d.ts +46 -0
  110. package/package/dist/commands/intuned-cli/helpers/auth.js +144 -0
  111. package/package/dist/commands/intuned-cli/helpers/backend.d.ts +8 -0
  112. package/package/dist/commands/intuned-cli/helpers/backend.js +27 -0
  113. package/package/dist/commands/intuned-cli/helpers/browser.d.ts +14 -0
  114. package/package/dist/commands/intuned-cli/helpers/browser.js +57 -0
  115. package/package/dist/commands/intuned-cli/helpers/context.d.ts +3 -0
  116. package/package/dist/commands/intuned-cli/helpers/context.js +33 -0
  117. package/package/dist/commands/intuned-cli/helpers/errors.d.ts +13 -0
  118. package/package/dist/commands/intuned-cli/helpers/errors.js +37 -0
  119. package/package/dist/commands/intuned-cli/helpers/index.d.ts +12 -0
  120. package/package/dist/commands/intuned-cli/helpers/index.js +137 -0
  121. package/package/dist/commands/intuned-cli/helpers/intunedJson.d.ts +69 -0
  122. package/package/dist/commands/intuned-cli/helpers/intunedJson.js +71 -0
  123. package/package/dist/commands/intuned-cli/helpers/proxy.d.ts +5 -0
  124. package/package/dist/commands/intuned-cli/helpers/proxy.js +23 -0
  125. package/package/dist/commands/intuned-cli/helpers/terminal.d.ts +5 -0
  126. package/package/dist/commands/intuned-cli/helpers/terminal.js +13 -0
  127. package/package/dist/commands/intuned-cli/helpers/timeout.d.ts +1 -0
  128. package/package/dist/commands/intuned-cli/helpers/timeout.js +23 -0
  129. package/package/dist/commands/intuned-cli/helpers/traces.d.ts +2 -0
  130. package/package/dist/commands/intuned-cli/helpers/traces.js +32 -0
  131. package/package/dist/commands/intuned-cli/helpers/validation.d.ts +2 -0
  132. package/package/dist/commands/intuned-cli/helpers/validation.js +14 -0
  133. package/package/dist/commands/intuned-cli/helpers/wrapper.d.ts +2 -0
  134. package/package/dist/commands/intuned-cli/helpers/wrapper.js +60 -0
  135. package/package/dist/commands/intuned-cli/index.d.ts +1 -0
  136. package/package/dist/commands/intuned-cli/index.js +16 -0
  137. package/package/dist/commands/intuned-cli/main.d.ts +1 -0
  138. package/package/dist/commands/intuned-cli/main.js +22 -0
  139. package/package/dist/commands/intuned-cli/types.d.ts +41 -0
  140. package/package/dist/commands/intuned-cli/types.js +12 -0
  141. package/package/dist/commands/ts-check.d.ts +2 -0
  142. package/package/dist/commands/ts-check.js +56 -0
  143. package/package/dist/common/Logger/Logger/index.d.ts +12 -0
  144. package/package/dist/common/Logger/Logger/index.js +60 -0
  145. package/package/dist/common/Logger/Logger/types.d.ts +8 -0
  146. package/package/dist/common/Logger/Logger/types.js +5 -0
  147. package/package/dist/common/Logger/index.d.ts +12 -0
  148. package/package/dist/common/Logger/index.js +60 -0
  149. package/package/dist/common/Logger/types.d.ts +8 -0
  150. package/package/dist/common/Logger/types.js +5 -0
  151. package/package/dist/common/assets/browser_scripts.js +2580 -0
  152. package/package/dist/common/asyncLocalStorage/index.d.ts +16 -0
  153. package/package/dist/common/asyncLocalStorage/index.js +17 -0
  154. package/package/dist/common/backendFunctions/getAuthSessionParameters.d.ts +1 -0
  155. package/package/dist/common/backendFunctions/getAuthSessionParameters.js +38 -0
  156. package/package/dist/common/cleanEnvironmentVariables.d.ts +1 -0
  157. package/package/dist/common/cleanEnvironmentVariables.js +16 -0
  158. package/package/dist/common/constants.d.ts +10 -0
  159. package/package/dist/common/constants.js +16 -0
  160. package/package/dist/common/contextStorageStateHelpers.d.ts +21 -0
  161. package/package/dist/common/contextStorageStateHelpers.js +81 -0
  162. package/package/dist/common/extensionsHelpers.d.ts +8 -0
  163. package/package/dist/common/extensionsHelpers.js +80 -0
  164. package/package/dist/common/formatZodError.d.ts +2 -0
  165. package/package/dist/common/formatZodError.js +18 -0
  166. package/package/dist/common/jwtTokenManager.d.ts +17 -0
  167. package/package/dist/common/jwtTokenManager.js +109 -0
  168. package/package/dist/common/launchBrowser.d.ts +25 -0
  169. package/package/dist/common/launchBrowser.js +172 -0
  170. package/package/dist/common/playwrightContext.d.ts +31 -0
  171. package/package/dist/common/playwrightContext.js +144 -0
  172. package/package/dist/common/runApi/errors.d.ts +72 -0
  173. package/package/dist/common/runApi/errors.js +169 -0
  174. package/package/dist/common/runApi/importUsingImportFunction.d.ts +9 -0
  175. package/package/dist/common/runApi/importUsingImportFunction.js +46 -0
  176. package/package/dist/common/runApi/index.d.ts +11 -0
  177. package/package/dist/common/runApi/index.js +199 -0
  178. package/package/dist/common/runApi/types.d.ts +830 -0
  179. package/package/dist/common/runApi/types.js +73 -0
  180. package/package/dist/common/settingsSchema.d.ts +518 -0
  181. package/package/dist/common/settingsSchema.js +57 -0
  182. package/package/dist/common/setupContextHook.d.ts +17 -0
  183. package/package/dist/common/setupContextHook.js +22 -0
  184. package/package/dist/common/telemetry.d.ts +3 -0
  185. package/package/dist/common/telemetry.js +32 -0
  186. package/package/dist/index.d.ts +4 -0
  187. package/package/dist/index.js +69 -0
  188. package/package/dist/runtime/RunError.d.ts +5 -0
  189. package/package/dist/runtime/RunError.js +19 -0
  190. package/package/dist/runtime/attemptStore.d.ts +2 -0
  191. package/package/dist/runtime/attemptStore.js +23 -0
  192. package/package/dist/runtime/downloadDirectory.d.ts +1 -0
  193. package/package/dist/runtime/downloadDirectory.js +19 -0
  194. package/package/dist/runtime/enums.d.js +5 -0
  195. package/package/dist/runtime/enums.d.ts +11 -0
  196. package/package/dist/runtime/enums.js +18 -0
  197. package/package/dist/runtime/executionHelpers.test.js +52 -0
  198. package/package/dist/runtime/export.d.js +5 -0
  199. package/package/dist/runtime/export.d.ts +228 -0
  200. package/package/dist/runtime/extendPayload.d.ts +2 -0
  201. package/package/dist/runtime/extendPayload.js +21 -0
  202. package/package/dist/runtime/extendTimeout.d.ts +1 -0
  203. package/package/dist/runtime/extendTimeout.js +23 -0
  204. package/package/dist/runtime/getAuthSessionParameters.d.ts +1 -0
  205. package/package/dist/runtime/getAuthSessionParameters.js +20 -0
  206. package/package/dist/runtime/index.d.ts +7 -0
  207. package/package/dist/runtime/index.js +54 -0
  208. package/package/dist/runtime/runInfo.d.ts +2 -0
  209. package/package/dist/runtime/runInfo.js +21 -0
  210. package/package.json +2 -10
  211. package/bin/intuned-api-run +0 -4
  212. package/bin/intuned-auth-session-check +0 -4
  213. package/bin/intuned-auth-session-create +0 -4
  214. package/bin/intuned-auth-session-load +0 -4
  215. package/dist/common/intunedJson.d.ts +0 -252
  216. package/dist/common/intunedJson.js +0 -162
  217. /package/{dist → package/dist}/commands/api/run.d.ts +0 -0
  218. /package/{dist → package/dist}/commands/auth-sessions/load.d.ts +0 -0
  219. /package/{dist → package/dist}/commands/auth-sessions/run-check.d.ts +0 -0
  220. /package/{dist → package/dist}/commands/auth-sessions/run-create.d.ts +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intuned/runtime-dev",
3
- "version": "1.3.28-dev1",
3
+ "version": "1.3.32",
4
4
  "description": "Intuned runtime",
5
5
  "packageManager": "yarn@4.12.0",
6
6
  "main": "./dist/index.js",
@@ -25,13 +25,9 @@
25
25
  "author": "Intuned Team",
26
26
  "license": "Elastic-2.0",
27
27
  "scripts": {
28
- "intuned-api-run": "vite-node ./src/commands/api/run.ts",
29
28
  "intuned-browser-save-state": "vite-node ./src/commands/browser/save-state.ts",
30
29
  "intuned-browser-start": "vite-node ./src/commands/browser/start-browser.ts",
31
30
  "intuned-build": "yarn prepublishOnly && vite-node ./src/commands/build.ts",
32
- "intuned-auth-session-check": "vite-node ./src/commands/auth/run-check.ts",
33
- "intuned-auth-session-create": "vite-node ./src/commands/auth/run-create.ts",
34
- "intuned-auth-session-load": "vite-node ./src/commands/auth/load.ts",
35
31
  "intuned-ts-check": "yarn prepublishOnly && vite-node ./src/commands/ts-check.ts",
36
32
  "intuned-get-headless-user-agent": "vite-node ./src/commands/get-headless-user-agent.ts",
37
33
  "build": "rm -rf dist && tsc -p tsconfig.json && yarn copy-dts && babel src --out-dir dist --extensions '.ts' && tsup && cp -r ./src/common/assets dist/common/assets",
@@ -47,10 +43,6 @@
47
43
  },
48
44
  "bin": {
49
45
  "intuned": "bin/intuned",
50
- "intuned-api-run": "bin/intuned-api-run",
51
- "intuned-auth-session-check": "bin/intuned-auth-session-check",
52
- "intuned-auth-session-create": "bin/intuned-auth-session-create",
53
- "intuned-auth-session-load": "bin/intuned-auth-session-load",
54
46
  "intuned-browser-save-state": "bin/intuned-browser-save-state",
55
47
  "intuned-browser-start": "bin/intuned-browser-start",
56
48
  "intuned-build": "bin/intuned-build",
@@ -74,7 +66,7 @@
74
66
  "commander": "14.0.0",
75
67
  "cross-fetch": "^4.0.0",
76
68
  "dotenv": "^16.3.1",
77
- "fastify": "4.29.1",
69
+ "fastify": "5.8.5",
78
70
  "fs-extra": "^11.3.0",
79
71
  "ignore": "^7.0.5",
80
72
  "image-size": "^1.1.1",
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- require("../dist/common/binStartupScript.js");
4
- require("../dist/commands/api/run.js");
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- require("../dist/common/binStartupScript.js");
4
- require("../dist/commands/auth-sessions/run-check.js");
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- require("../dist/common/binStartupScript.js");
4
- require("../dist/commands/auth-sessions/run-create.js");
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- require("../dist/common/binStartupScript.js");
4
- require("../dist/commands/auth-sessions/load.js");
@@ -1,252 +0,0 @@
1
- import { z } from "zod";
2
- import { type Err, type Ok } from "neverthrow";
3
- export declare const intunedJsonSchema: z.ZodIntersection<z.ZodObject<{
4
- projectName: z.ZodOptional<z.ZodString>;
5
- workspaceId: z.ZodOptional<z.ZodString>;
6
- metadata: z.ZodCatch<z.ZodOptional<z.ZodObject<{
7
- defaultRunPlaygroundInput: z.ZodCatch<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
8
- }, "strip", z.ZodTypeAny, {
9
- defaultRunPlaygroundInput?: Record<string, any> | undefined;
10
- }, {
11
- defaultRunPlaygroundInput?: unknown;
12
- }>>>;
13
- browserSize: z.ZodCatch<z.ZodOptional<z.ZodObject<{
14
- width: z.ZodNumber;
15
- height: z.ZodNumber;
16
- }, "strip", z.ZodTypeAny, {
17
- width: number;
18
- height: number;
19
- }, {
20
- width: number;
21
- height: number;
22
- }>>>;
23
- stealthMode: z.ZodCatch<z.ZodOptional<z.ZodObject<{
24
- enabled: z.ZodBoolean;
25
- }, "strip", z.ZodTypeAny, {
26
- enabled: boolean;
27
- }, {
28
- enabled: boolean;
29
- }>>>;
30
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
31
- projectName: z.ZodOptional<z.ZodString>;
32
- workspaceId: z.ZodOptional<z.ZodString>;
33
- metadata: z.ZodCatch<z.ZodOptional<z.ZodObject<{
34
- defaultRunPlaygroundInput: z.ZodCatch<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
35
- }, "strip", z.ZodTypeAny, {
36
- defaultRunPlaygroundInput?: Record<string, any> | undefined;
37
- }, {
38
- defaultRunPlaygroundInput?: unknown;
39
- }>>>;
40
- browserSize: z.ZodCatch<z.ZodOptional<z.ZodObject<{
41
- width: z.ZodNumber;
42
- height: z.ZodNumber;
43
- }, "strip", z.ZodTypeAny, {
44
- width: number;
45
- height: number;
46
- }, {
47
- width: number;
48
- height: number;
49
- }>>>;
50
- stealthMode: z.ZodCatch<z.ZodOptional<z.ZodObject<{
51
- enabled: z.ZodBoolean;
52
- }, "strip", z.ZodTypeAny, {
53
- enabled: boolean;
54
- }, {
55
- enabled: boolean;
56
- }>>>;
57
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
58
- projectName: z.ZodOptional<z.ZodString>;
59
- workspaceId: z.ZodOptional<z.ZodString>;
60
- metadata: z.ZodCatch<z.ZodOptional<z.ZodObject<{
61
- defaultRunPlaygroundInput: z.ZodCatch<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
62
- }, "strip", z.ZodTypeAny, {
63
- defaultRunPlaygroundInput?: Record<string, any> | undefined;
64
- }, {
65
- defaultRunPlaygroundInput?: unknown;
66
- }>>>;
67
- browserSize: z.ZodCatch<z.ZodOptional<z.ZodObject<{
68
- width: z.ZodNumber;
69
- height: z.ZodNumber;
70
- }, "strip", z.ZodTypeAny, {
71
- width: number;
72
- height: number;
73
- }, {
74
- width: number;
75
- height: number;
76
- }>>>;
77
- stealthMode: z.ZodCatch<z.ZodOptional<z.ZodObject<{
78
- enabled: z.ZodBoolean;
79
- }, "strip", z.ZodTypeAny, {
80
- enabled: boolean;
81
- }, {
82
- enabled: boolean;
83
- }>>>;
84
- }, z.ZodTypeAny, "passthrough">>, z.ZodUnion<[z.ZodObject<{
85
- authSessions: z.ZodObject<{
86
- enabled: z.ZodLiteral<false>;
87
- }, "strip", z.ZodTypeAny, {
88
- enabled: false;
89
- }, {
90
- enabled: false;
91
- }>;
92
- apiAccess: z.ZodObject<{
93
- enabled: z.ZodLiteral<false>;
94
- }, "strip", z.ZodTypeAny, {
95
- enabled: false;
96
- }, {
97
- enabled: false;
98
- }>;
99
- }, "strip", z.ZodTypeAny, {
100
- authSessions: {
101
- enabled: false;
102
- };
103
- apiAccess: {
104
- enabled: false;
105
- };
106
- }, {
107
- authSessions: {
108
- enabled: false;
109
- };
110
- apiAccess: {
111
- enabled: false;
112
- };
113
- }>, z.ZodObject<{
114
- authSessions: z.ZodUnion<[z.ZodObject<{
115
- enabled: z.ZodLiteral<false>;
116
- }, "strip", z.ZodTypeAny, {
117
- enabled: false;
118
- }, {
119
- enabled: false;
120
- }>, z.ZodObject<{
121
- enabled: z.ZodLiteral<true>;
122
- type: z.ZodEnum<["MANUAL", "API"]>;
123
- startUrl: z.ZodOptional<z.ZodString>;
124
- finishUrl: z.ZodOptional<z.ZodString>;
125
- }, "strip", z.ZodTypeAny, {
126
- type: "MANUAL" | "API";
127
- enabled: true;
128
- startUrl?: string | undefined;
129
- finishUrl?: string | undefined;
130
- }, {
131
- type: "MANUAL" | "API";
132
- enabled: true;
133
- startUrl?: string | undefined;
134
- finishUrl?: string | undefined;
135
- }>]>;
136
- apiAccess: z.ZodObject<{
137
- enabled: z.ZodLiteral<true>;
138
- }, "strip", z.ZodTypeAny, {
139
- enabled: true;
140
- }, {
141
- enabled: true;
142
- }>;
143
- }, "strip", z.ZodTypeAny, {
144
- authSessions: {
145
- enabled: false;
146
- } | {
147
- type: "MANUAL" | "API";
148
- enabled: true;
149
- startUrl?: string | undefined;
150
- finishUrl?: string | undefined;
151
- };
152
- apiAccess: {
153
- enabled: true;
154
- };
155
- }, {
156
- authSessions: {
157
- enabled: false;
158
- } | {
159
- type: "MANUAL" | "API";
160
- enabled: true;
161
- startUrl?: string | undefined;
162
- finishUrl?: string | undefined;
163
- };
164
- apiAccess: {
165
- enabled: true;
166
- };
167
- }>]>>;
168
- export type IntunedJson = z.infer<typeof intunedJsonSchema>;
169
- export declare const intunedSettingsFileNames: readonly ["Intuned.json", "Intuned.jsonc", "Intuned.yaml", "Intuned.yml", "Intuned.toml"];
170
- export declare function loadIntunedJson(): Promise<Err<never, string> | Ok<{
171
- stealthMode?: {
172
- enabled: boolean;
173
- } | undefined;
174
- workspaceId?: string | undefined;
175
- projectName?: string | undefined;
176
- metadata?: {
177
- defaultRunPlaygroundInput?: Record<string, any> | undefined;
178
- } | undefined;
179
- browserSize?: {
180
- width: number;
181
- height: number;
182
- } | undefined;
183
- } & {
184
- [k: string]: unknown;
185
- } & ({
186
- authSessions: {
187
- enabled: false;
188
- };
189
- apiAccess: {
190
- enabled: false;
191
- };
192
- } | {
193
- authSessions: {
194
- enabled: false;
195
- } | {
196
- type: "MANUAL" | "API";
197
- enabled: true;
198
- startUrl?: string | undefined;
199
- finishUrl?: string | undefined;
200
- };
201
- apiAccess: {
202
- enabled: true;
203
- };
204
- }), never>>;
205
- export declare function getIntunedSettingsFile(): Promise<Ok<{
206
- name: typeof intunedSettingsFileNames[number];
207
- path: string;
208
- parse: (content: string) => any;
209
- }, never> | Err<never, string>>;
210
- export declare function getIntunedSettingsFileName(): Promise<Err<never, string> | Ok<"Intuned.json" | "Intuned.jsonc" | "Intuned.yaml" | "Intuned.yml" | "Intuned.toml", never>>;
211
- export declare function loadIntunedJsonSync(): Err<never, string> | Ok<{
212
- stealthMode?: {
213
- enabled: boolean;
214
- } | undefined;
215
- workspaceId?: string | undefined;
216
- projectName?: string | undefined;
217
- metadata?: {
218
- defaultRunPlaygroundInput?: Record<string, any> | undefined;
219
- } | undefined;
220
- browserSize?: {
221
- width: number;
222
- height: number;
223
- } | undefined;
224
- } & {
225
- [k: string]: unknown;
226
- } & ({
227
- authSessions: {
228
- enabled: false;
229
- };
230
- apiAccess: {
231
- enabled: false;
232
- };
233
- } | {
234
- authSessions: {
235
- enabled: false;
236
- } | {
237
- type: "MANUAL" | "API";
238
- enabled: true;
239
- startUrl?: string | undefined;
240
- finishUrl?: string | undefined;
241
- };
242
- apiAccess: {
243
- enabled: true;
244
- };
245
- }), never>;
246
- export declare function getBrowserSizeConfig(): Promise<{
247
- width: number;
248
- height: number;
249
- }>;
250
- export declare function getStealthModeConfig(): Promise<{
251
- enabled: boolean;
252
- }>;
@@ -1,162 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getBrowserSizeConfig = getBrowserSizeConfig;
7
- exports.getIntunedSettingsFile = getIntunedSettingsFile;
8
- exports.getIntunedSettingsFileName = getIntunedSettingsFileName;
9
- exports.getStealthModeConfig = getStealthModeConfig;
10
- exports.intunedSettingsFileNames = exports.intunedJsonSchema = void 0;
11
- exports.loadIntunedJson = loadIntunedJson;
12
- exports.loadIntunedJsonSync = loadIntunedJsonSync;
13
- var _path = _interopRequireDefault(require("path"));
14
- var fs = _interopRequireWildcard(require("fs-extra"));
15
- var _zod = require("zod");
16
- var JSONC = _interopRequireWildcard(require("jsonc-parser"));
17
- var YAML = _interopRequireWildcard(require("yaml"));
18
- var TOML = _interopRequireWildcard(require("smol-toml"));
19
- var _neverthrow = require("neverthrow");
20
- var _formatZodError = require("./formatZodError");
21
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
22
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
23
- const intunedJsonSchema = exports.intunedJsonSchema = _zod.z.object({
24
- projectName: _zod.z.string().optional(),
25
- workspaceId: _zod.z.string().optional(),
26
- metadata: _zod.z.object({
27
- defaultRunPlaygroundInput: _zod.z.record(_zod.z.any()).optional().catch(undefined)
28
- }).optional().catch(undefined),
29
- browserSize: _zod.z.object({
30
- width: _zod.z.number().int().min(200).max(3840),
31
- height: _zod.z.number().int().min(200).max(2160)
32
- }).optional().catch(undefined),
33
- stealthMode: _zod.z.object({
34
- enabled: _zod.z.boolean()
35
- }).optional().catch(undefined)
36
- }).passthrough().and(_zod.z.union([_zod.z.object({
37
- authSessions: _zod.z.object({
38
- enabled: _zod.z.literal(false)
39
- }),
40
- apiAccess: _zod.z.object({
41
- enabled: _zod.z.literal(false)
42
- })
43
- }), _zod.z.object({
44
- authSessions: _zod.z.union([_zod.z.object({
45
- enabled: _zod.z.literal(false)
46
- }), _zod.z.object({
47
- enabled: _zod.z.literal(true),
48
- type: _zod.z.enum(["MANUAL", "API"]),
49
- startUrl: _zod.z.string().optional(),
50
- finishUrl: _zod.z.string().optional()
51
- })]),
52
- apiAccess: _zod.z.object({
53
- enabled: _zod.z.literal(true)
54
- })
55
- })]));
56
- const intunedSettingsFileNames = exports.intunedSettingsFileNames = ["Intuned.json", "Intuned.jsonc", "Intuned.yaml", "Intuned.yml", "Intuned.toml"];
57
- async function loadIntunedJson() {
58
- const settingsFileResult = await getIntunedSettingsFile();
59
- if (!settingsFileResult.isOk()) {
60
- return settingsFileResult;
61
- }
62
- const settingsFile = settingsFileResult.value;
63
- const intunedJsonContent = await fs.readFile(settingsFile.path, "utf-8");
64
- let intunedJson;
65
- try {
66
- intunedJson = settingsFile.parse(intunedJsonContent);
67
- } catch (e) {
68
- return (0, _neverthrow.err)(`Failed to parse ${settingsFile.name}: ${e.message}`);
69
- }
70
- const parseResult = intunedJsonSchema.safeParse(intunedJson);
71
- if (!parseResult.success) {
72
- return (0, _neverthrow.err)(`${settingsFile.name} is not valid:\n${(0, _formatZodError.formatZodError)(parseResult.error)}\nPlease fix the errors and try again.`);
73
- }
74
- return (0, _neverthrow.ok)(parseResult.data);
75
- }
76
- const intunedSettingsParsers = {
77
- "Intuned.json": JSON.parse,
78
- "Intuned.jsonc": JSONC.parse,
79
- "Intuned.yaml": YAML.parse,
80
- "Intuned.yml": YAML.parse,
81
- "Intuned.toml": TOML.parse
82
- };
83
- async function getIntunedSettingsFile() {
84
- for (const fileName of intunedSettingsFileNames) {
85
- const filePath = _path.default.join(process.cwd(), fileName);
86
- if (await fs.exists(filePath)) {
87
- return (0, _neverthrow.ok)({
88
- name: fileName,
89
- path: filePath,
90
- parse: intunedSettingsParsers[fileName]
91
- });
92
- }
93
- }
94
- return (0, _neverthrow.err)("No Intuned settings file found.");
95
- }
96
- async function getIntunedSettingsFileName() {
97
- const settingsFileResult = await getIntunedSettingsFile();
98
- if (!settingsFileResult.isOk()) {
99
- return settingsFileResult;
100
- }
101
- return (0, _neverthrow.ok)(settingsFileResult.value.name);
102
- }
103
- function loadIntunedJsonSync() {
104
- const settingsFileResult = getIntunedSettingsFileSync();
105
- if (!settingsFileResult.isOk()) {
106
- return settingsFileResult;
107
- }
108
- const settingsFile = settingsFileResult.value;
109
- const intunedJsonContent = fs.readFileSync(settingsFile.path, "utf-8");
110
- let intunedJson;
111
- try {
112
- intunedJson = settingsFile.parse(intunedJsonContent);
113
- } catch (e) {
114
- return (0, _neverthrow.err)(`Failed to parse ${settingsFile.name}: ${e.message}`);
115
- }
116
- const parseResult = intunedJsonSchema.safeParse(intunedJson);
117
- if (!parseResult.success) {
118
- const formattedError = parseResult.error.errors.map(e => `- ${e.path.join(".")}: ${e.message}`).join("\n");
119
- return (0, _neverthrow.err)(`${settingsFile.name} is not valid:\n${formattedError}\nPlease fix the errors and try again.`);
120
- }
121
- return (0, _neverthrow.ok)(parseResult.data);
122
- }
123
- function getIntunedSettingsFileSync() {
124
- for (const fileName of intunedSettingsFileNames) {
125
- const filePath = _path.default.join(process.cwd(), fileName);
126
- if (fs.existsSync(filePath)) {
127
- return (0, _neverthrow.ok)({
128
- name: fileName,
129
- path: filePath,
130
- parse: intunedSettingsParsers[fileName]
131
- });
132
- }
133
- }
134
- return (0, _neverthrow.err)("No Intuned settings file found.");
135
- }
136
- async function getBrowserSizeConfig() {
137
- const settingsResult = await loadIntunedJson();
138
- if (settingsResult.isOk() && settingsResult.value.browserSize) {
139
- return settingsResult.value.browserSize;
140
- }
141
- return {
142
- width: 1280,
143
- height: 800
144
- };
145
- }
146
- async function getStealthModeConfig() {
147
- try {
148
- const settingsResult = await loadIntunedJson();
149
- if (settingsResult.isErr()) {
150
- return {
151
- enabled: false
152
- };
153
- }
154
- return {
155
- enabled: settingsResult.value.stealthMode?.enabled === true
156
- };
157
- } catch {
158
- return {
159
- enabled: false
160
- };
161
- }
162
- }
File without changes