@intuned/runtime-dev 1.3.9-deploy.0 → 1.3.9-dev10

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 (223) hide show
  1. package/InterfaceTemplate/index.playwright.ts +1 -0
  2. package/bin/intuned +2 -0
  3. package/bin/intuned-api-run +2 -0
  4. package/bin/intuned-auth-session-check +2 -0
  5. package/bin/intuned-auth-session-create +2 -0
  6. package/bin/intuned-auth-session-load +2 -0
  7. package/dist/commands/common/utils/settings.js +3 -0
  8. package/dist/commands/intuned-cli/commands/attempt_api.command.js +1 -1
  9. package/dist/commands/intuned-cli/commands/attempt_authsession_create.command.js +1 -1
  10. package/dist/commands/intuned-cli/commands/run_api.command.js +1 -1
  11. package/dist/commands/intuned-cli/controller/deploy.d.ts +0 -1
  12. package/dist/commands/intuned-cli/controller/deploy.js +6 -143
  13. package/dist/commands/intuned-cli/controller/save.d.ts +1 -4
  14. package/dist/commands/intuned-cli/controller/save.js +2 -8
  15. package/dist/commands/intuned-cli/helpers/backend.js +1 -1
  16. package/dist/commands/intuned-cli/helpers/errors.d.ts +0 -3
  17. package/dist/commands/intuned-cli/helpers/errors.js +1 -8
  18. package/dist/commands/intuned-cli/helpers/intunedJson.d.ts +11 -113
  19. package/dist/commands/intuned-cli/helpers/intunedJson.js +3 -19
  20. package/dist/commands/intuned-cli/helpers/wrapper.js +0 -5
  21. package/dist/common/binStartupScript.d.ts +1 -0
  22. package/dist/common/binStartupScript.js +34 -0
  23. package/dist/common/settingsSchema.d.ts +13 -0
  24. package/dist/common/settingsSchema.js +6 -0
  25. package/package/dist/commands/api/run.d.ts +6 -0
  26. package/package/dist/commands/api/run.js +123 -0
  27. package/package/dist/commands/auth-sessions/load.d.ts +2 -0
  28. package/package/dist/commands/auth-sessions/load.js +35 -0
  29. package/package/dist/commands/auth-sessions/run-check.d.ts +2 -0
  30. package/package/dist/commands/auth-sessions/run-check.js +74 -0
  31. package/package/dist/commands/auth-sessions/run-create.d.ts +2 -0
  32. package/package/dist/commands/auth-sessions/run-create.js +78 -0
  33. package/package/dist/commands/browser/save-state.d.ts +2 -0
  34. package/package/dist/commands/browser/save-state.js +17 -0
  35. package/package/dist/commands/browser/start-browser.d.ts +2 -0
  36. package/package/dist/commands/browser/start-browser.js +14 -0
  37. package/package/dist/commands/build.d.ts +1 -0
  38. package/package/dist/commands/build.js +84 -0
  39. package/package/dist/commands/common/browserUtils.d.ts +14 -0
  40. package/package/dist/commands/common/browserUtils.js +58 -0
  41. package/package/dist/commands/common/getFirstLineNumber.d.ts +9 -0
  42. package/package/dist/commands/common/getFirstLineNumber.js +101 -0
  43. package/package/dist/commands/common/getFirstLineNumber.test.js +228 -0
  44. package/package/dist/commands/common/projectExclusions.d.ts +2 -0
  45. package/package/dist/commands/common/projectExclusions.js +8 -0
  46. package/package/dist/commands/common/sendMessageToClient.d.ts +1 -0
  47. package/package/dist/commands/common/sendMessageToClient.js +10 -0
  48. package/package/dist/commands/common/tsNodeImport.d.ts +2 -0
  49. package/package/dist/commands/common/tsNodeImport.js +34 -0
  50. package/package/dist/commands/common/utils/fileUtils.d.ts +6 -0
  51. package/package/dist/commands/common/utils/fileUtils.js +33 -0
  52. package/package/dist/commands/common/utils/settings.d.ts +2 -0
  53. package/package/dist/commands/common/utils/settings.js +31 -0
  54. package/package/dist/commands/common/utils/template.d.ts +2 -0
  55. package/package/dist/commands/common/utils/template.js +31 -0
  56. package/package/dist/commands/common/utils/unixSocket.d.ts +9 -0
  57. package/package/dist/commands/common/utils/unixSocket.js +44 -0
  58. package/package/dist/commands/interface/run.d.ts +1 -0
  59. package/package/dist/commands/interface/run.js +216 -0
  60. package/package/dist/commands/intuned-cli/commands/attempt.command.d.ts +1 -0
  61. package/package/dist/commands/intuned-cli/commands/attempt.command.js +8 -0
  62. package/package/dist/commands/intuned-cli/commands/attempt_api.command.d.ts +1 -0
  63. package/package/dist/commands/intuned-cli/commands/attempt_api.command.js +30 -0
  64. package/package/dist/commands/intuned-cli/commands/attempt_authsession.command.d.ts +1 -0
  65. package/package/dist/commands/intuned-cli/commands/attempt_authsession.command.js +8 -0
  66. package/package/dist/commands/intuned-cli/commands/attempt_authsession_check.command.d.ts +1 -0
  67. package/package/dist/commands/intuned-cli/commands/attempt_authsession_check.command.js +19 -0
  68. package/package/dist/commands/intuned-cli/commands/attempt_authsession_create.command.d.ts +1 -0
  69. package/package/dist/commands/intuned-cli/commands/attempt_authsession_create.command.js +24 -0
  70. package/package/dist/commands/intuned-cli/commands/authsession.command.d.ts +1 -0
  71. package/package/dist/commands/intuned-cli/commands/authsession.command.js +8 -0
  72. package/package/dist/commands/intuned-cli/commands/authsession_record.command.d.ts +1 -0
  73. package/package/dist/commands/intuned-cli/commands/authsession_record.command.js +31 -0
  74. package/package/dist/commands/intuned-cli/commands/build.command.d.ts +1 -0
  75. package/package/dist/commands/intuned-cli/commands/build.command.js +12 -0
  76. package/package/dist/commands/intuned-cli/commands/command.d.ts +2 -0
  77. package/package/dist/commands/intuned-cli/commands/command.js +9 -0
  78. package/package/dist/commands/intuned-cli/commands/deploy.command.d.ts +1 -0
  79. package/package/dist/commands/intuned-cli/commands/deploy.command.js +38 -0
  80. package/package/dist/commands/intuned-cli/commands/index.d.ts +18 -0
  81. package/package/dist/commands/intuned-cli/commands/index.js +203 -0
  82. package/package/dist/commands/intuned-cli/commands/init.command.d.ts +1 -0
  83. package/package/dist/commands/intuned-cli/commands/init.command.js +13 -0
  84. package/package/dist/commands/intuned-cli/commands/run.command.d.ts +1 -0
  85. package/package/dist/commands/intuned-cli/commands/run.command.js +8 -0
  86. package/package/dist/commands/intuned-cli/commands/run_api.command.d.ts +1 -0
  87. package/package/dist/commands/intuned-cli/commands/run_api.command.js +46 -0
  88. package/package/dist/commands/intuned-cli/commands/run_authsession.command.d.ts +28 -0
  89. package/package/dist/commands/intuned-cli/commands/run_authsession.command.js +17 -0
  90. package/package/dist/commands/intuned-cli/commands/run_authsession_create.command.d.ts +1 -0
  91. package/package/dist/commands/intuned-cli/commands/run_authsession_create.command.js +35 -0
  92. package/package/dist/commands/intuned-cli/commands/run_authsession_update.command.d.ts +1 -0
  93. package/package/dist/commands/intuned-cli/commands/run_authsession_update.command.js +35 -0
  94. package/package/dist/commands/intuned-cli/commands/run_authsession_validate.command.d.ts +1 -0
  95. package/package/dist/commands/intuned-cli/commands/run_authsession_validate.command.js +33 -0
  96. package/package/dist/commands/intuned-cli/commands/save.command.d.ts +13 -0
  97. package/package/dist/commands/intuned-cli/commands/save.command.js +42 -0
  98. package/package/dist/commands/intuned-cli/commands/types.d.ts +31 -0
  99. package/package/dist/commands/intuned-cli/commands/types.js +29 -0
  100. package/package/dist/commands/intuned-cli/constants/index.d.ts +17 -0
  101. package/package/dist/commands/intuned-cli/constants/index.js +25 -0
  102. package/package/dist/commands/intuned-cli/controller/__test__/api.test.js +397 -0
  103. package/package/dist/commands/intuned-cli/controller/__test__/authSession.test.js +1059 -0
  104. package/package/dist/commands/intuned-cli/controller/api.d.ts +42 -0
  105. package/package/dist/commands/intuned-cli/controller/api.js +189 -0
  106. package/package/dist/commands/intuned-cli/controller/authSession.d.ts +209 -0
  107. package/package/dist/commands/intuned-cli/controller/authSession.js +420 -0
  108. package/package/dist/commands/intuned-cli/controller/build.d.ts +1 -0
  109. package/package/dist/commands/intuned-cli/controller/build.js +36 -0
  110. package/package/dist/commands/intuned-cli/controller/deploy.d.ts +4 -0
  111. package/package/dist/commands/intuned-cli/controller/deploy.js +139 -0
  112. package/package/dist/commands/intuned-cli/controller/index.d.ts +1 -0
  113. package/package/dist/commands/intuned-cli/controller/index.js +46 -0
  114. package/package/dist/commands/intuned-cli/controller/save.d.ts +14 -0
  115. package/package/dist/commands/intuned-cli/controller/save.js +345 -0
  116. package/package/dist/commands/intuned-cli/helpers/__test__/browser.test.js +103 -0
  117. package/package/dist/commands/intuned-cli/helpers/__test__/tracing.test.js +40 -0
  118. package/package/dist/commands/intuned-cli/helpers/api.d.ts +3 -0
  119. package/package/dist/commands/intuned-cli/helpers/api.js +19 -0
  120. package/package/dist/commands/intuned-cli/helpers/auth.d.ts +46 -0
  121. package/package/dist/commands/intuned-cli/helpers/auth.js +144 -0
  122. package/package/dist/commands/intuned-cli/helpers/backend.d.ts +8 -0
  123. package/package/dist/commands/intuned-cli/helpers/backend.js +27 -0
  124. package/package/dist/commands/intuned-cli/helpers/browser.d.ts +14 -0
  125. package/package/dist/commands/intuned-cli/helpers/browser.js +57 -0
  126. package/package/dist/commands/intuned-cli/helpers/context.d.ts +3 -0
  127. package/package/dist/commands/intuned-cli/helpers/context.js +33 -0
  128. package/package/dist/commands/intuned-cli/helpers/errors.d.ts +13 -0
  129. package/package/dist/commands/intuned-cli/helpers/errors.js +37 -0
  130. package/package/dist/commands/intuned-cli/helpers/index.d.ts +12 -0
  131. package/package/dist/commands/intuned-cli/helpers/index.js +137 -0
  132. package/package/dist/commands/intuned-cli/helpers/intunedJson.d.ts +69 -0
  133. package/package/dist/commands/intuned-cli/helpers/intunedJson.js +71 -0
  134. package/package/dist/commands/intuned-cli/helpers/proxy.d.ts +5 -0
  135. package/package/dist/commands/intuned-cli/helpers/proxy.js +23 -0
  136. package/package/dist/commands/intuned-cli/helpers/terminal.d.ts +5 -0
  137. package/package/dist/commands/intuned-cli/helpers/terminal.js +13 -0
  138. package/package/dist/commands/intuned-cli/helpers/timeout.d.ts +1 -0
  139. package/package/dist/commands/intuned-cli/helpers/timeout.js +23 -0
  140. package/package/dist/commands/intuned-cli/helpers/traces.d.ts +2 -0
  141. package/package/dist/commands/intuned-cli/helpers/traces.js +32 -0
  142. package/package/dist/commands/intuned-cli/helpers/validation.d.ts +2 -0
  143. package/package/dist/commands/intuned-cli/helpers/validation.js +14 -0
  144. package/package/dist/commands/intuned-cli/helpers/wrapper.d.ts +2 -0
  145. package/package/dist/commands/intuned-cli/helpers/wrapper.js +60 -0
  146. package/package/dist/commands/intuned-cli/index.d.ts +1 -0
  147. package/package/dist/commands/intuned-cli/index.js +16 -0
  148. package/package/dist/commands/intuned-cli/main.d.ts +1 -0
  149. package/package/dist/commands/intuned-cli/main.js +22 -0
  150. package/package/dist/commands/intuned-cli/types.d.ts +41 -0
  151. package/package/dist/commands/intuned-cli/types.js +12 -0
  152. package/package/dist/commands/ts-check.d.ts +2 -0
  153. package/package/dist/commands/ts-check.js +56 -0
  154. package/package/dist/common/Logger/Logger/index.d.ts +12 -0
  155. package/package/dist/common/Logger/Logger/index.js +60 -0
  156. package/package/dist/common/Logger/Logger/types.d.ts +8 -0
  157. package/package/dist/common/Logger/Logger/types.js +5 -0
  158. package/package/dist/common/Logger/index.d.ts +12 -0
  159. package/package/dist/common/Logger/index.js +60 -0
  160. package/package/dist/common/Logger/types.d.ts +8 -0
  161. package/package/dist/common/Logger/types.js +5 -0
  162. package/package/dist/common/assets/browser_scripts.js +2580 -0
  163. package/package/dist/common/asyncLocalStorage/index.d.ts +16 -0
  164. package/package/dist/common/asyncLocalStorage/index.js +17 -0
  165. package/package/dist/common/backendFunctions/getAuthSessionParameters.d.ts +1 -0
  166. package/package/dist/common/backendFunctions/getAuthSessionParameters.js +38 -0
  167. package/package/dist/common/cleanEnvironmentVariables.d.ts +1 -0
  168. package/package/dist/common/cleanEnvironmentVariables.js +16 -0
  169. package/package/dist/common/constants.d.ts +10 -0
  170. package/package/dist/common/constants.js +16 -0
  171. package/package/dist/common/contextStorageStateHelpers.d.ts +21 -0
  172. package/package/dist/common/contextStorageStateHelpers.js +81 -0
  173. package/package/dist/common/extensionsHelpers.d.ts +8 -0
  174. package/package/dist/common/extensionsHelpers.js +80 -0
  175. package/package/dist/common/formatZodError.d.ts +2 -0
  176. package/package/dist/common/formatZodError.js +18 -0
  177. package/package/dist/common/jwtTokenManager.d.ts +17 -0
  178. package/package/dist/common/jwtTokenManager.js +109 -0
  179. package/package/dist/common/launchBrowser.d.ts +25 -0
  180. package/package/dist/common/launchBrowser.js +172 -0
  181. package/package/dist/common/playwrightContext.d.ts +31 -0
  182. package/package/dist/common/playwrightContext.js +144 -0
  183. package/package/dist/common/runApi/errors.d.ts +72 -0
  184. package/package/dist/common/runApi/errors.js +169 -0
  185. package/package/dist/common/runApi/importUsingImportFunction.d.ts +9 -0
  186. package/package/dist/common/runApi/importUsingImportFunction.js +46 -0
  187. package/package/dist/common/runApi/index.d.ts +11 -0
  188. package/package/dist/common/runApi/index.js +199 -0
  189. package/package/dist/common/runApi/types.d.ts +830 -0
  190. package/package/dist/common/runApi/types.js +73 -0
  191. package/package/dist/common/settingsSchema.d.ts +518 -0
  192. package/package/dist/common/settingsSchema.js +57 -0
  193. package/package/dist/common/setupContextHook.d.ts +17 -0
  194. package/package/dist/common/setupContextHook.js +22 -0
  195. package/package/dist/common/telemetry.d.ts +3 -0
  196. package/package/dist/common/telemetry.js +32 -0
  197. package/package/dist/index.d.ts +4 -0
  198. package/package/dist/index.js +69 -0
  199. package/package/dist/runtime/RunError.d.ts +5 -0
  200. package/package/dist/runtime/RunError.js +19 -0
  201. package/package/dist/runtime/attemptStore.d.ts +2 -0
  202. package/package/dist/runtime/attemptStore.js +23 -0
  203. package/package/dist/runtime/downloadDirectory.d.ts +1 -0
  204. package/package/dist/runtime/downloadDirectory.js +19 -0
  205. package/package/dist/runtime/enums.d.js +5 -0
  206. package/package/dist/runtime/enums.d.ts +11 -0
  207. package/package/dist/runtime/enums.js +18 -0
  208. package/package/dist/runtime/executionHelpers.test.js +52 -0
  209. package/package/dist/runtime/export.d.js +5 -0
  210. package/package/dist/runtime/export.d.ts +228 -0
  211. package/package/dist/runtime/extendPayload.d.ts +2 -0
  212. package/package/dist/runtime/extendPayload.js +21 -0
  213. package/package/dist/runtime/extendTimeout.d.ts +1 -0
  214. package/package/dist/runtime/extendTimeout.js +23 -0
  215. package/package/dist/runtime/getAuthSessionParameters.d.ts +1 -0
  216. package/package/dist/runtime/getAuthSessionParameters.js +20 -0
  217. package/package/dist/runtime/index.d.ts +7 -0
  218. package/package/dist/runtime/index.js +54 -0
  219. package/package/dist/runtime/runInfo.d.ts +2 -0
  220. package/package/dist/runtime/runInfo.js +21 -0
  221. package/package.json +3 -5
  222. package/WebTemplate.zip +0 -0
  223. package/bin/intuned-auth-session-refresh +0 -2
@@ -1,3 +1,4 @@
1
+ require("@intuned/runtime/dist/common/binStartupScript");
1
2
  import { runAutomationCLI } from "@intuned/runtime/dist/commands/interface/run";
2
3
 
3
4
  import { importModule } from "./utils";
package/bin/intuned CHANGED
@@ -1,2 +1,4 @@
1
1
  #!/usr/bin/env node
2
+
3
+ require("../dist/common/binStartupScript.js");
2
4
  require("../dist/commands/intuned-cli/main.js");
@@ -1,2 +1,4 @@
1
1
  #!/usr/bin/env node
2
+
3
+ require("../dist/common/binStartupScript.js");
2
4
  require("../dist/commands/api/run.js");
@@ -1,2 +1,4 @@
1
1
  #!/usr/bin/env node
2
+
3
+ require("../dist/common/binStartupScript.js");
2
4
  require("../dist/commands/auth-sessions/run-check.js");
@@ -1,2 +1,4 @@
1
1
  #!/usr/bin/env node
2
+
3
+ require("../dist/common/binStartupScript.js");
2
4
  require("../dist/commands/auth-sessions/run-create.js");
@@ -1,2 +1,4 @@
1
1
  #!/usr/bin/env node
2
+
3
+ require("../dist/common/binStartupScript.js");
2
4
  require("../dist/commands/auth-sessions/load.js");
@@ -23,6 +23,9 @@ async function getSettings() {
23
23
  return {
24
24
  authSessions: {
25
25
  enabled: false
26
+ },
27
+ stealthMode: {
28
+ enabled: false
26
29
  }
27
30
  };
28
31
  }
@@ -15,7 +15,7 @@ const optionsSchema = _types.baseCommandOptionsSchema.extend({
15
15
  authSession: _zod.z.string().optional(),
16
16
  outputFile: _zod.z.string().optional()
17
17
  });
18
- const attemptApiCommand = exports.attemptApiCommand = (0, _types.withBaseOptions)(_attempt.attemptCommand.command("api").description("Execute an Intuned API attempt with parameters").argument("<api-name>", "Name of the API to run").argument("<parameters>", "Path to the JSON file containing API parameters OR the parameters as a JSON string").option("-a, --auth-session <id>", "ID of the auth session to use for the API. This is expected to be in ./auth-sessions-instances/<id>.json").option("-o, --output-file <path>", "output file path")).action((0, _helpers.cliCommandWrapper)(argsSchema, optionsSchema, async ([apiName, parameters], {
18
+ const attemptApiCommand = exports.attemptApiCommand = (0, _types.withBaseOptions)(_attempt.attemptCommand.command("api").description("Execute an Intuned API attempt with parameters").argument("<api-name>", "Name of the API to run").argument("<parameters>", "Path to the JSON file containing API parameters OR the parameters as a JSON string").option("-a, --auth-session <id>", "ID of the auth session to use for the API. This is expected to be in ./auth-session-instances/<id>.json").option("-o, --output-file <path>", "output file path")).action((0, _helpers.cliCommandWrapper)(argsSchema, optionsSchema, async ([apiName, parameters], {
19
19
  authSession,
20
20
  ...rest
21
21
  }) => {
@@ -14,7 +14,7 @@ const argsSchema = _zod.z.tuple([_zod.z.string().min(1, "Parameters are required
14
14
  const optionsSchema = _types.baseCommandOptionsSchema.extend({
15
15
  id: _zod.z.string().optional()
16
16
  });
17
- const attemptAuthSessionCreateCommand = exports.attemptAuthSessionCreateCommand = (0, _types.withBaseOptions)(_attempt_authsession.attemptAuthSessionCommand.command("create").description("Create a new auth session").argument("<parameters>", "Parameters for the auth session command").option("--id <id>", "ID of the auth session to use for the command. Defaults to ./auth-sessions-instances/[current timestamp].json")).action((0, _helpers.cliCommandWrapper)(argsSchema, optionsSchema, async ([parameters], options) => {
17
+ const attemptAuthSessionCreateCommand = exports.attemptAuthSessionCreateCommand = (0, _types.withBaseOptions)(_attempt_authsession.attemptAuthSessionCommand.command("create").description("Create a new auth session").argument("<parameters>", "Parameters for the auth session command").option("--id <id>", "ID of the auth session to use for the command. Defaults to ./auth-session-instances/[current timestamp].json")).action((0, _helpers.cliCommandWrapper)(argsSchema, optionsSchema, async ([parameters], options) => {
18
18
  await (0, _helpers.assertAuthEnabled)();
19
19
  const authSessionInput = (await (0, _controller.loadParameters)(parameters)) ?? {};
20
20
  await (0, _authSession.executeAttemptCreateAuthSessionCLI)({
@@ -19,7 +19,7 @@ const optionsSchema = _types.baseCommandOptionsSchema.extend({
19
19
  authSessionCheckAttempts: _types.authSessionCheckAttemptsSchema,
20
20
  authSessionCreateAttempts: _types.authSessionCreateAttemptsSchema
21
21
  });
22
- const runApiCommand = exports.runApiCommand = (0, _types.withBaseOptions)(_run.runCommand.command("api").description("Execute an Intuned API run with parameters").argument("<api-name>", "Name of the API to run").argument("<parameters>", "Path to the JSON file containing API parameters OR the parameters as a JSON string").option("-a, --auth-session <id>", "ID of the auth session to use for the API. This is expected to be in ./auth-sessions-instances/<id>").option("--retries <number>", "Number of retries for the API call", "1").option("--no-auth-session-auto-recreate", "disable auto recreate for auth session").option("--auth-session-check-attempts <number>", "auth session check attempts", "1").option("--auth-session-create-attempts <number>", "auth session create attempts", "1").option("-o, --output-file <path>", "output file path")).action((0, _helpers.cliCommandWrapper)(argsSchema, optionsSchema, async ([apiName, parameters], {
22
+ const runApiCommand = exports.runApiCommand = (0, _types.withBaseOptions)(_run.runCommand.command("api").description("Execute an Intuned API run with parameters").argument("<api-name>", "Name of the API to run").argument("<parameters>", "Path to the JSON file containing API parameters OR the parameters as a JSON string").option("-a, --auth-session <id>", "ID of the auth session to use for the API. This is expected to be in ./auth-session-instances/<id>").option("--retries <number>", "Number of retries for the API call", "1").option("--no-auth-session-auto-recreate", "disable auto recreate for auth session").option("--auth-session-check-attempts <number>", "auth session check attempts", "1").option("--auth-session-create-attempts <number>", "auth session create attempts", "1").option("-o, --output-file <path>", "output file path")).action((0, _helpers.cliCommandWrapper)(argsSchema, optionsSchema, async ([apiName, parameters], {
23
23
  retries,
24
24
  outputFile,
25
25
  authSession,
@@ -1,5 +1,4 @@
1
1
  import { z } from "zod";
2
2
  import type { AuthCredentials } from "../types";
3
- export declare const START_RUN_INPUT_QUERY_PARAM_KEY = "startRunInput";
4
3
  export declare function runDeployProject(projectName: string, auth: AuthCredentials): Promise<void>;
5
4
  export declare const projectNameSchema: z.ZodEffects<z.ZodString, string, string>;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.projectNameSchema = exports.START_RUN_INPUT_QUERY_PARAM_KEY = void 0;
6
+ exports.projectNameSchema = void 0;
7
7
  exports.runDeployProject = runDeployProject;
8
8
  var _zod = require("zod");
9
9
  var _constants = require("../constants");
@@ -13,22 +13,9 @@ var _promises = require("timers/promises");
13
13
  var _ms = _interopRequireDefault(require("ms"));
14
14
  var _save = require("./save");
15
15
  var _constants2 = require("../../../common/constants");
16
- var _path = _interopRequireDefault(require("path"));
17
- var fs = _interopRequireWildcard(require("fs-extra"));
18
- var _prompts = _interopRequireDefault(require("prompts"));
19
- var _terminalLink = _interopRequireDefault(require("terminal-link"));
20
- 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); }
21
- 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; }
22
16
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
23
- const START_RUN_INPUT_QUERY_PARAM_KEY = exports.START_RUN_INPUT_QUERY_PARAM_KEY = "startRunInput";
24
17
  async function runDeployProject(projectName, auth) {
25
- const result = await (0, _save.runSaveProject)(projectName, auth);
26
- const enableFirstRunExperience = result?.enableFirstRunExperience ?? false;
27
- let firstRunInfo = undefined;
28
- const settings = await (0, _helpers.loadIntunedJson)();
29
- if (enableFirstRunExperience) {
30
- firstRunInfo = await promptFirstRunExperience(settings);
31
- }
18
+ await (0, _save.runSaveProject)(projectName, auth);
32
19
  const {
33
20
  workspaceId,
34
21
  apiKey
@@ -41,10 +28,7 @@ async function runDeployProject(projectName, auth) {
41
28
  };
42
29
  const response = await fetch(url, {
43
30
  headers,
44
- method: "POST",
45
- body: JSON.stringify({
46
- firstRunInfo
47
- })
31
+ method: "POST"
48
32
  });
49
33
  if (!response.ok) {
50
34
  if (response.status === 401) {
@@ -101,39 +85,8 @@ async function runDeployProject(projectName, auth) {
101
85
  }
102
86
  if (status === "completed") {
103
87
  const url = (0, _helpers.getBaseUrl)();
104
- (0, _terminal.terminal)(`\n^g^+Project deployed successfully!^:\n\n`);
105
- const projectUrl = `${url}/projects/${projectId}`;
106
- const runsUrl = `${projectUrl}/runs`;
107
- const jobsUrl = `${projectUrl}/jobs`;
108
- const runsPlaygroundUrl = `${runsUrl}?${buildRunsPlaygroundQueryParams({
109
- enableFirstRunExperience,
110
- settings,
111
- testAuthSessionId: rest.testAuthSessionId
112
- })}`;
113
- const defaultJobTriggerUrl = rest.defaultJobId ? `${jobsUrl}/${rest.defaultJobId}?action=trigger` : undefined;
114
- const actions = [{
115
- label: "View Project",
116
- url: runsUrl
117
- }, ...(settings.apiAccess.enabled ? [{
118
- label: "Run Playground",
119
- url: runsPlaygroundUrl
120
- }] : []), {
121
- label: "Manage Jobs",
122
- url: jobsUrl
123
- }, ...(defaultJobTriggerUrl !== undefined ? [{
124
- label: "Trigger Default Job",
125
- url: defaultJobTriggerUrl
126
- }] : [])];
127
- if (_terminalLink.default.isSupported) {
128
- for (const action of actions) {
129
- (0, _terminal.terminal)(`^+${(0, _terminalLink.default)(`[ ${action.label} ]`, action.url)}^ `);
130
- }
131
- (0, _terminal.terminal)("\n");
132
- } else {
133
- for (const action of actions) {
134
- (0, _terminal.terminal)(`^+${action.label}:^ ^c^_${action.url}^:\n`);
135
- }
136
- }
88
+ (0, _terminal.terminal)(`\n^g^+Project deployed successfully!^:\n`);
89
+ (0, _terminal.terminal)(`^+You can check your project on the platform:^s ^c^_${url}/projects/${projectId}/details^:\n`);
137
90
  return;
138
91
  }
139
92
  let errorMessage = `^r^+An error occurred while deploying project:^:\n^R${message}^:\n`;
@@ -183,94 +136,4 @@ const checkIntunedProjectDeployStatus = async (workspaceId, projectName, apiKey)
183
136
  status: "failed",
184
137
  message: `Deployment failed, please try again: ${data.message}`
185
138
  };
186
- };
187
- async function promptFirstRunExperience(settings) {
188
- let testAuthSessionInput = undefined;
189
- const shouldPromptForTestAuthSession = settings.authSessions.enabled && settings.authSessions.type === "API";
190
- const defaultJobInput = settings.metadata?.defaultJobInput;
191
- const shouldPromptForDefaultJob = defaultJobInput !== undefined;
192
- if (shouldPromptForTestAuthSession) {
193
- testAuthSessionInput = await promptFirstRunExperienceTestAuthSessionParameters({
194
- shouldPromptForDefaultJob
195
- });
196
- if (!testAuthSessionInput) {
197
- return {};
198
- }
199
- }
200
- return {
201
- testAuthSessionInput,
202
- defaultJobInput: shouldPromptForDefaultJob ? await promptFirstRunExperienceDefaultJobParameters({
203
- defaultJobInput
204
- }) : undefined
205
- };
206
- }
207
- async function promptFirstRunExperienceTestAuthSessionParameters({
208
- shouldPromptForDefaultJob
209
- }) {
210
- const authSessionInstancesDirectory = _path.default.join(process.cwd(), _constants2.AUTH_SESSIONS_INSTANCES_FOLDER_NAME);
211
- if (!(await fs.exists(authSessionInstancesDirectory))) {
212
- return;
213
- }
214
- const authSessionId = (await fs.readdir(authSessionInstancesDirectory)).shift();
215
- if (!authSessionId) {
216
- return;
217
- }
218
- const {
219
- metadata
220
- } = await (0, _helpers.loadAuthSessionInstance)(authSessionId);
221
- if (!metadata.authSessionId) {
222
- return;
223
- }
224
- const message = shouldPromptForDefaultJob ? `^:^+Create a test auth session using^ ^c${authSessionId}^:^+ parameters?^ ^/(required for creating default job)^:` : `^:^+Create a test auth session using^ ^c${authSessionId}^:^+ parameters?^:`;
225
- const {
226
- value
227
- } = await (0, _prompts.default)({
228
- type: "confirm",
229
- name: "value",
230
- message: _terminal.terminal.str(message).toString(),
231
- initial: true
232
- });
233
- if (value === undefined) {
234
- throw new _helpers.AbortedCLIError();
235
- }
236
- if (value) {
237
- return metadata.authSessionInput;
238
- }
239
- }
240
- async function promptFirstRunExperienceDefaultJobParameters({
241
- defaultJobInput
242
- }) {
243
- const {
244
- value
245
- } = await (0, _prompts.default)({
246
- type: "confirm",
247
- name: "value",
248
- message: _terminal.terminal.str(`^:^+Create a default job with sample parameters?^:`).toString(),
249
- initial: true
250
- });
251
- if (value === undefined) {
252
- throw new _helpers.AbortedCLIError();
253
- }
254
- if (value) {
255
- return defaultJobInput;
256
- }
257
- }
258
- function buildRunsPlaygroundQueryParams({
259
- enableFirstRunExperience,
260
- settings,
261
- testAuthSessionId
262
- }) {
263
- const params = new URLSearchParams();
264
- if (!enableFirstRunExperience) return params.toString();
265
- const input = settings.metadata?.defaultRunPlaygroundInput ?? {};
266
- if (!input) return params.toString();
267
- if (testAuthSessionId) {
268
- input.authSession = {
269
- id: testAuthSessionId
270
- };
271
- }
272
- params.append(START_RUN_INPUT_QUERY_PARAM_KEY, JSON.stringify({
273
- ...input
274
- }));
275
- return params.toString();
276
- }
139
+ };
@@ -1,9 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import type { AuthCredentials } from "../types";
3
- export declare function runSaveProject(projectName: string, auth: AuthCredentials): Promise<{
4
- projectId: string;
5
- enableFirstRunExperience: boolean | undefined;
6
- } | undefined>;
3
+ export declare function runSaveProject(projectName: string, auth: AuthCredentials): Promise<void>;
7
4
  export declare const projectNameSchema: z.ZodEffects<z.ZodString, string, string>;
8
5
  export declare const validateProjectName: (projectName: string) => {
9
6
  isValid: true;
@@ -33,8 +33,7 @@ const saveProjectApiResponseSchema = _zod.z.string().transform((val, ctx) => {
33
33
  return _zod.z.NEVER;
34
34
  }
35
35
  }).pipe(_zod.z.object({
36
- id: _zod.z.string().uuid(),
37
- enableFirstRunExperience: _zod.z.boolean().optional()
36
+ id: _zod.z.string().uuid()
38
37
  }));
39
38
  async function runSaveProject(projectName, auth) {
40
39
  const {
@@ -87,8 +86,7 @@ async function runSaveProject(projectName, auth) {
87
86
  return;
88
87
  }
89
88
  const {
90
- id: projectId,
91
- enableFirstRunExperience
89
+ id: projectId
92
90
  } = parseResult.data;
93
91
  const dotEnvPath = path.join(projectPath, ".env");
94
92
  if (!(await fs.exists(dotEnvPath))) {
@@ -113,10 +111,6 @@ ${_constants2.API_KEY_ENV_VAR_KEY}=${apiKey}`);
113
111
  await fs.appendFile(dotEnvPath, contentToAppend + "\n");
114
112
  (0, _terminal.terminal)(`^g^+Updated .env file with project credentials.^:\n`);
115
113
  }
116
- return {
117
- projectId,
118
- enableFirstRunExperience
119
- };
120
114
  }
121
115
  const projectNameSchema = exports.projectNameSchema = _zod.z.string().min(1, "Project Name is required").max(200, "Name must be 200 characters or less").regex(/^[a-z0-9]+(?:[-_][a-z0-9]+)*$/, "Name can only contain lowercase letters, numbers, hyphens, and underscores in between").refine(value => !_zod.z.string().uuid().safeParse(value).success, {
122
116
  message: "Name cannot be a UUID"
@@ -23,5 +23,5 @@ async function getAuthCredentials(options) {
23
23
  };
24
24
  }
25
25
  function getBaseUrl() {
26
- return new URL(process.env[_constants.API_BASE_URL_ENV_VAR_KEY] || process.env.INTUNED_API_DOMAIN || `https://app.intuned.io`).origin;
26
+ return process.env[_constants.API_BASE_URL_ENV_VAR_KEY] || process.env.INTUNED_API_DOMAIN || `https://app.intuned.io`;
27
27
  }
@@ -5,9 +5,6 @@ export declare class CLIError extends Error {
5
5
  autoColor?: boolean;
6
6
  });
7
7
  }
8
- export declare class AbortedCLIError extends CLIError {
9
- constructor();
10
- }
11
8
  export declare class CLIAssertionError extends CLIError {
12
9
  constructor(message: string, options?: {
13
10
  autoColor?: boolean;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.CLIError = exports.CLIAssertionError = exports.AbortedCLIError = void 0;
6
+ exports.CLIError = exports.CLIAssertionError = void 0;
7
7
  exports.logAutomationError = logAutomationError;
8
8
  var _runApi = require("../../../common/runApi");
9
9
  var _terminal = require("./terminal");
@@ -15,13 +15,6 @@ class CLIError extends Error {
15
15
  }
16
16
  }
17
17
  exports.CLIError = CLIError;
18
- class AbortedCLIError extends CLIError {
19
- constructor() {
20
- super("Aborted");
21
- this.name = "AbortedCLIError";
22
- }
23
- }
24
- exports.AbortedCLIError = AbortedCLIError;
25
18
  class CLIAssertionError extends CLIError {
26
19
  constructor(message, options) {
27
20
  super(message, options);
@@ -1,82 +1,5 @@
1
1
  import { z } from "zod";
2
- export declare const intunedJsonSchema: z.ZodIntersection<z.ZodObject<{
3
- projectName: z.ZodOptional<z.ZodString>;
4
- workspaceId: z.ZodOptional<z.ZodString>;
5
- metadata: z.ZodOptional<z.ZodObject<{
6
- defaultJobInput: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
7
- defaultRunPlaygroundInput: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
8
- testAuthSessionInput: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
9
- }, "strip", z.ZodTypeAny, {
10
- defaultJobInput?: Record<string, any> | undefined;
11
- defaultRunPlaygroundInput?: Record<string, any> | undefined;
12
- testAuthSessionInput?: Record<string, any> | undefined;
13
- }, {
14
- defaultJobInput?: Record<string, any> | undefined;
15
- defaultRunPlaygroundInput?: Record<string, any> | undefined;
16
- testAuthSessionInput?: Record<string, any> | undefined;
17
- }>>;
18
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
19
- projectName: z.ZodOptional<z.ZodString>;
20
- workspaceId: z.ZodOptional<z.ZodString>;
21
- metadata: z.ZodOptional<z.ZodObject<{
22
- defaultJobInput: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
23
- defaultRunPlaygroundInput: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
24
- testAuthSessionInput: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
25
- }, "strip", z.ZodTypeAny, {
26
- defaultJobInput?: Record<string, any> | undefined;
27
- defaultRunPlaygroundInput?: Record<string, any> | undefined;
28
- testAuthSessionInput?: Record<string, any> | undefined;
29
- }, {
30
- defaultJobInput?: Record<string, any> | undefined;
31
- defaultRunPlaygroundInput?: Record<string, any> | undefined;
32
- testAuthSessionInput?: Record<string, any> | undefined;
33
- }>>;
34
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
35
- projectName: z.ZodOptional<z.ZodString>;
36
- workspaceId: z.ZodOptional<z.ZodString>;
37
- metadata: z.ZodOptional<z.ZodObject<{
38
- defaultJobInput: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
39
- defaultRunPlaygroundInput: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
40
- testAuthSessionInput: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
41
- }, "strip", z.ZodTypeAny, {
42
- defaultJobInput?: Record<string, any> | undefined;
43
- defaultRunPlaygroundInput?: Record<string, any> | undefined;
44
- testAuthSessionInput?: Record<string, any> | undefined;
45
- }, {
46
- defaultJobInput?: Record<string, any> | undefined;
47
- defaultRunPlaygroundInput?: Record<string, any> | undefined;
48
- testAuthSessionInput?: Record<string, any> | undefined;
49
- }>>;
50
- }, z.ZodTypeAny, "passthrough">>, z.ZodUnion<[z.ZodObject<{
51
- authSessions: z.ZodObject<{
52
- enabled: z.ZodLiteral<false>;
53
- }, "strip", z.ZodTypeAny, {
54
- enabled: false;
55
- }, {
56
- enabled: false;
57
- }>;
58
- apiAccess: z.ZodObject<{
59
- enabled: z.ZodLiteral<false>;
60
- }, "strip", z.ZodTypeAny, {
61
- enabled: false;
62
- }, {
63
- enabled: false;
64
- }>;
65
- }, "strip", z.ZodTypeAny, {
66
- authSessions: {
67
- enabled: false;
68
- };
69
- apiAccess: {
70
- enabled: false;
71
- };
72
- }, {
73
- authSessions: {
74
- enabled: false;
75
- };
76
- apiAccess: {
77
- enabled: false;
78
- };
79
- }>, z.ZodObject<{
2
+ export declare const intunedJsonSchema: z.ZodObject<{
80
3
  authSessions: z.ZodUnion<[z.ZodObject<{
81
4
  enabled: z.ZodLiteral<false>;
82
5
  }, "strip", z.ZodTypeAny, {
@@ -99,13 +22,8 @@ export declare const intunedJsonSchema: z.ZodIntersection<z.ZodObject<{
99
22
  startUrl?: string | undefined;
100
23
  finishUrl?: string | undefined;
101
24
  }>]>;
102
- apiAccess: z.ZodObject<{
103
- enabled: z.ZodLiteral<true>;
104
- }, "strip", z.ZodTypeAny, {
105
- enabled: true;
106
- }, {
107
- enabled: true;
108
- }>;
25
+ projectName: z.ZodOptional<z.ZodString>;
26
+ workspaceId: z.ZodOptional<z.ZodString>;
109
27
  }, "strip", z.ZodTypeAny, {
110
28
  authSessions: {
111
29
  enabled: false;
@@ -115,9 +33,8 @@ export declare const intunedJsonSchema: z.ZodIntersection<z.ZodObject<{
115
33
  startUrl?: string | undefined;
116
34
  finishUrl?: string | undefined;
117
35
  };
118
- apiAccess: {
119
- enabled: true;
120
- };
36
+ projectName?: string | undefined;
37
+ workspaceId?: string | undefined;
121
38
  }, {
122
39
  authSessions: {
123
40
  enabled: false;
@@ -127,30 +44,12 @@ export declare const intunedJsonSchema: z.ZodIntersection<z.ZodObject<{
127
44
  startUrl?: string | undefined;
128
45
  finishUrl?: string | undefined;
129
46
  };
130
- apiAccess: {
131
- enabled: true;
132
- };
133
- }>]>>;
47
+ projectName?: string | undefined;
48
+ workspaceId?: string | undefined;
49
+ }>;
134
50
  export type IntunedJson = z.infer<typeof intunedJsonSchema>;
135
51
  export declare const intunedSettingsFileNames: readonly ["Intuned.json", "Intuned.jsonc", "Intuned.yaml", "Intuned.yml", "Intuned.toml"];
136
52
  export declare function loadIntunedJson(): Promise<{
137
- projectName?: string | undefined;
138
- workspaceId?: string | undefined;
139
- metadata?: {
140
- defaultJobInput?: Record<string, any> | undefined;
141
- defaultRunPlaygroundInput?: Record<string, any> | undefined;
142
- testAuthSessionInput?: Record<string, any> | undefined;
143
- } | undefined;
144
- } & {
145
- [k: string]: unknown;
146
- } & ({
147
- authSessions: {
148
- enabled: false;
149
- };
150
- apiAccess: {
151
- enabled: false;
152
- };
153
- } | {
154
53
  authSessions: {
155
54
  enabled: false;
156
55
  } | {
@@ -159,10 +58,9 @@ export declare function loadIntunedJson(): Promise<{
159
58
  startUrl?: string | undefined;
160
59
  finishUrl?: string | undefined;
161
60
  };
162
- apiAccess: {
163
- enabled: true;
164
- };
165
- })>;
61
+ projectName?: string | undefined;
62
+ workspaceId?: string | undefined;
63
+ }>;
166
64
  export declare function getIntunedSettingsFile(): Promise<{
167
65
  name: typeof intunedSettingsFileNames[number];
168
66
  path: string;
@@ -18,21 +18,6 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
18
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
19
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
20
20
  const intunedJsonSchema = exports.intunedJsonSchema = _zod.z.object({
21
- projectName: _zod.z.string().optional(),
22
- workspaceId: _zod.z.string().optional(),
23
- metadata: _zod.z.object({
24
- defaultJobInput: _zod.z.record(_zod.z.any()).optional(),
25
- defaultRunPlaygroundInput: _zod.z.record(_zod.z.any()).optional(),
26
- testAuthSessionInput: _zod.z.record(_zod.z.any()).optional()
27
- }).optional()
28
- }).passthrough().and(_zod.z.union([_zod.z.object({
29
- authSessions: _zod.z.object({
30
- enabled: _zod.z.literal(false)
31
- }),
32
- apiAccess: _zod.z.object({
33
- enabled: _zod.z.literal(false)
34
- })
35
- }), _zod.z.object({
36
21
  authSessions: _zod.z.union([_zod.z.object({
37
22
  enabled: _zod.z.literal(false)
38
23
  }), _zod.z.object({
@@ -41,10 +26,9 @@ const intunedJsonSchema = exports.intunedJsonSchema = _zod.z.object({
41
26
  startUrl: _zod.z.string().optional(),
42
27
  finishUrl: _zod.z.string().optional()
43
28
  })]),
44
- apiAccess: _zod.z.object({
45
- enabled: _zod.z.literal(true)
46
- })
47
- })]));
29
+ projectName: _zod.z.string().optional(),
30
+ workspaceId: _zod.z.string().optional()
31
+ });
48
32
  const intunedSettingsFileNames = exports.intunedSettingsFileNames = ["Intuned.json", "Intuned.jsonc", "Intuned.yaml", "Intuned.yml", "Intuned.toml"];
49
33
  async function loadIntunedJson() {
50
34
  const settingsFile = await getIntunedSettingsFile();
@@ -33,11 +33,6 @@ function cliCommandWrapper(argsSchema, optionsSchema, fn) {
33
33
  await (0, _browser.closeCliBrowser)();
34
34
  process.exit(0);
35
35
  } catch (error) {
36
- if (error instanceof _errors.AbortedCLIError) {
37
- (0, _terminal.terminal)(`\n^r^+Aborted.^:\n`);
38
- await (0, _browser.closeCliBrowser)();
39
- process.exit(1);
40
- }
41
36
  if (error instanceof _errors.CLIError) {
42
37
  if (error.autoColor) {
43
38
  (0, _terminal.terminal)(`^r^+${error.message}^:\n`);
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+
3
+ var _dotenv = _interopRequireDefault(require("dotenv"));
4
+ var fs = _interopRequireWildcard(require("fs"));
5
+ var path = _interopRequireWildcard(require("path"));
6
+ 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); }
7
+ 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; }
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+ _dotenv.default.config({
10
+ path: `.env`
11
+ });
12
+ function isStealthModeEnabled() {
13
+ try {
14
+ const intunedConfigPath = path.resolve(process.cwd(), process.env.ROOT || "./", "Intuned.json");
15
+ const configContent = fs.readFileSync(intunedConfigPath, "utf8");
16
+ const config = JSON.parse(configContent);
17
+ return config.stealthMode?.enabled === true;
18
+ } catch (error) {
19
+ console.error("Error reading Intuned.json:", error.message);
20
+ return false;
21
+ }
22
+ }
23
+ try {
24
+ if (isStealthModeEnabled()) {
25
+ const currentNodeModules = path.resolve(process.cwd(), "node_modules");
26
+ process.env.NODE_PATH = process.env.NODE_PATH ? `${process.env.NODE_PATH}:${currentNodeModules}` : currentNodeModules;
27
+ require("module").Module._initPaths();
28
+ if (process.env.PLAYWRIGHT_PATCH_SCRIPT_PATH) {
29
+ require(process.env.PLAYWRIGHT_PATCH_SCRIPT_PATH);
30
+ }
31
+ }
32
+ } catch (e) {
33
+ console.error("Failed to apply stealth mode");
34
+ }
@@ -208,6 +208,13 @@ export declare const settingsSchema: z.ZodObject<{
208
208
  }, {
209
209
  enabled: boolean;
210
210
  }>>>;
211
+ stealthMode: z.ZodDefault<z.ZodOptional<z.ZodObject<{
212
+ enabled: z.ZodBoolean;
213
+ }, "strip", z.ZodTypeAny, {
214
+ enabled: boolean;
215
+ }, {
216
+ enabled: boolean;
217
+ }>>>;
211
218
  captchaSolver: z.ZodOptional<z.ZodDefault<z.ZodObject<{
212
219
  enabled: z.ZodDefault<z.ZodBoolean>;
213
220
  cloudflare: z.ZodOptional<z.ZodObject<{
@@ -407,6 +414,9 @@ export declare const settingsSchema: z.ZodObject<{
407
414
  authSessions: {
408
415
  enabled: boolean;
409
416
  };
417
+ stealthMode: {
418
+ enabled: boolean;
419
+ };
410
420
  captchaSolver?: {
411
421
  enabled: boolean;
412
422
  settings: {
@@ -456,6 +466,9 @@ export declare const settingsSchema: z.ZodObject<{
456
466
  authSessions?: {
457
467
  enabled: boolean;
458
468
  } | undefined;
469
+ stealthMode?: {
470
+ enabled: boolean;
471
+ } | undefined;
459
472
  captchaSolver?: {
460
473
  enabled?: boolean | undefined;
461
474
  cloudflare?: {
@@ -45,7 +45,13 @@ const authSessionsSchema = z.object({
45
45
  }).optional().default({
46
46
  enabled: false
47
47
  });
48
+ const stealthModeSchema = z.object({
49
+ enabled: z.boolean()
50
+ }).optional().default({
51
+ enabled: false
52
+ });
48
53
  const settingsSchema = exports.settingsSchema = z.object({
49
54
  authSessions: authSessionsSchema,
55
+ stealthMode: stealthModeSchema,
50
56
  captchaSolver: captchaSolverSettingsSchema.optional()
51
57
  });