@intuned/runtime 1.3.15 → 1.3.17

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 (73) hide show
  1. package/InterfaceTemplate/index.playwright.ts +1 -1
  2. package/WebTemplate.zip +0 -0
  3. package/dist/commands/api/run.js +4 -8
  4. package/dist/commands/auth-sessions/load.js +2 -2
  5. package/dist/commands/auth-sessions/run-check.js +5 -5
  6. package/dist/commands/auth-sessions/run-create.js +3 -3
  7. package/dist/commands/build.js +1 -1
  8. package/dist/commands/common/projectExclusions.js +1 -1
  9. package/dist/commands/common/tsNodeImport.js +9 -0
  10. package/dist/commands/interface/run.js +1 -1
  11. package/dist/commands/intuned-cli/commands/attempt_api.command.js +1 -1
  12. package/dist/commands/intuned-cli/commands/attempt_authsession.command.js +1 -1
  13. package/dist/commands/intuned-cli/commands/attempt_authsession_check.command.js +2 -2
  14. package/dist/commands/intuned-cli/commands/attempt_authsession_create.command.js +1 -1
  15. package/dist/commands/intuned-cli/commands/authsession.command.js +1 -1
  16. package/dist/commands/intuned-cli/commands/authsession_record.command.js +1 -1
  17. package/dist/commands/intuned-cli/commands/authsession_scaffold.command.d.ts +1 -0
  18. package/dist/commands/intuned-cli/commands/authsession_scaffold.command.js +16 -0
  19. package/dist/commands/intuned-cli/commands/deploy.command.js +13 -9
  20. package/dist/commands/intuned-cli/commands/index.d.ts +2 -2
  21. package/dist/commands/intuned-cli/commands/index.js +15 -15
  22. package/dist/commands/intuned-cli/commands/{save.command.d.ts → provision.command.d.ts} +1 -1
  23. package/dist/commands/intuned-cli/commands/provision.command.js +50 -0
  24. package/dist/commands/intuned-cli/commands/run_api.command.js +1 -1
  25. package/dist/commands/intuned-cli/commands/run_authsession.command.d.ts +3 -3
  26. package/dist/commands/intuned-cli/commands/run_authsession.command.js +2 -2
  27. package/dist/commands/intuned-cli/commands/run_authsession_create.command.js +1 -1
  28. package/dist/commands/intuned-cli/commands/run_authsession_update.command.js +2 -2
  29. package/dist/commands/intuned-cli/commands/run_authsession_validate.command.js +2 -2
  30. package/dist/commands/intuned-cli/commands/types.d.ts +1 -1
  31. package/dist/commands/intuned-cli/commands/types.js +2 -2
  32. package/dist/commands/intuned-cli/controller/__test__/api.test.js +6 -5
  33. package/dist/commands/intuned-cli/controller/__test__/authSession.test.js +12 -11
  34. package/dist/commands/intuned-cli/controller/api.js +4 -1
  35. package/dist/commands/intuned-cli/controller/authSession.js +28 -28
  36. package/dist/commands/intuned-cli/controller/deploy.js +52 -10
  37. package/dist/commands/intuned-cli/controller/index.js +1 -1
  38. package/dist/commands/intuned-cli/controller/{save.d.ts → provision.d.ts} +5 -1
  39. package/dist/commands/intuned-cli/controller/provision.js +300 -0
  40. package/dist/commands/intuned-cli/controller/scaffold.d.ts +1 -0
  41. package/dist/commands/intuned-cli/controller/scaffold.js +77 -0
  42. package/dist/commands/intuned-cli/helpers/__test__/browser.test.js +1 -0
  43. package/dist/commands/intuned-cli/helpers/__test__/tracing.test.js +1 -0
  44. package/dist/commands/intuned-cli/helpers/api.js +4 -7
  45. package/dist/commands/intuned-cli/helpers/auth.js +22 -19
  46. package/dist/commands/intuned-cli/helpers/backend.js +12 -4
  47. package/dist/commands/intuned-cli/helpers/context.js +2 -2
  48. package/dist/commands/intuned-cli/helpers/prompts.d.ts +3 -0
  49. package/dist/commands/intuned-cli/helpers/prompts.js +71 -0
  50. package/dist/commands/intuned-cli/helpers/wrapper.js +12 -2
  51. package/dist/commands/intuned-cli/main.js +21 -8
  52. package/dist/commands/intuned-cli/types.d.ts +42 -13
  53. package/dist/commands/intuned-cli/types.js +12 -2
  54. package/dist/common/backendFunctions/getAuthSessionParameters.js +1 -1
  55. package/dist/common/extension/extensionsHelpers.d.ts +6 -3
  56. package/dist/common/extension/extensionsHelpers.js +45 -19
  57. package/dist/common/extension/intunedExtensionServer.d.ts +2 -5
  58. package/dist/common/extension/intunedExtensionServer.js +6 -9
  59. package/dist/common/intunedJson.js +2 -2
  60. package/dist/common/jwtTokenManager.js +2 -2
  61. package/dist/common/launchBrowser.d.ts +2 -0
  62. package/dist/common/launchBrowser.js +41 -3
  63. package/dist/common/playwrightContext.js +7 -1
  64. package/dist/common/runApi/errors.js +1 -1
  65. package/dist/common/runApi/index.js +2 -2
  66. package/dist/common/settingsSchema.d.ts +2 -1
  67. package/dist/runtime/captcha.js +25 -11
  68. package/package.json +5 -3
  69. package/dist/commands/intuned-cli/commands/init.command.d.ts +0 -1
  70. package/dist/commands/intuned-cli/commands/init.command.js +0 -13
  71. package/dist/commands/intuned-cli/commands/save.command.js +0 -42
  72. package/dist/commands/intuned-cli/controller/save.js +0 -351
  73. /package/InterfaceTemplate/{utils.ts → __utils.ts} +0 -0
@@ -1,6 +1,6 @@
1
1
  require("@intuned/runtime/dist/common/binStartupScript");
2
2
  import { runAutomationCLI } from "@intuned/runtime/dist/commands/interface/run";
3
3
 
4
- import { importModule } from "./utils";
4
+ import { importModule } from "./__utils";
5
5
 
6
6
  runAutomationCLI(importModule);
Binary file
@@ -31,12 +31,12 @@ async function executeCLI(apiName, mode, inputData, options) {
31
31
  const settings = await (0, _settings.getSettings)();
32
32
  if (settings.authSessions.enabled) {
33
33
  if (!options.authSessionPath) {
34
- throw new Error("Auth session is enabled but no auth session provided");
34
+ throw new Error("AuthSessions are enabled but no AuthSession provided.\n" + "Please provide --auth-session-path option.\n" + "See https://docs.intunedhq.com/docs/cli/auth-sessions for more information.");
35
35
  }
36
36
  authSessionPathToUse = options.authSessionPath;
37
37
  } else {
38
38
  if (options.authSessionPath) {
39
- throw new Error("Auth session is not enabled but auth session provided. To use auth session please enable it in Intuned.json");
39
+ throw new Error("Authentication is not enabled but AuthSession was provided.\n" + "Enable AuthSessions in Intuned.json to use this feature.\n" + "See https://docs.intunedhq.com/docs/cli/auth-sessions for more information.");
40
40
  }
41
41
  }
42
42
  const runApiResult = await (0, _runApi.runApi)({
@@ -67,12 +67,8 @@ async function executeCLI(apiName, mode, inputData, options) {
67
67
  result,
68
68
  extendedPayloads: payloadToAppend
69
69
  } = runApiResult.value;
70
- const isResponseObject = typeof result === "object" && result !== null;
71
- const hasMoreThank5Keys = isResponseObject && Object.keys(result).length > 5;
72
- const hasNestedObjects = isResponseObject && Object.values(result).some(value => typeof value === "object");
73
- const shouldWriteToFile = isResponseObject && (hasMoreThank5Keys || hasNestedObjects);
74
70
  const resultsDir = "/tmp/run-results";
75
- if (options.outputFileId && shouldWriteToFile) {
71
+ if (options.outputFileId) {
76
72
  _Logger.logger.info(_chalk.default.underline.bgBlue.white(`Click to Open: Results saved (Run: ${options.outputFileId})`));
77
73
  fs.ensureDirSync(resultsDir);
78
74
  const path = `${resultsDir}/${options.outputFileId}.json`;
@@ -98,7 +94,7 @@ async function executeCLI(apiName, mode, inputData, options) {
98
94
  _Logger.logger.info("This will only take an effect if this API run was part of a job.");
99
95
  }
100
96
  }
101
- _commander.program.description("run the user function in the cli for testing purposes").option("-i, --input [file]", "input json file").option("-j, --json [json]", "input json string").option("--cdpAddress <cdpAddress>", "CDP address", "http://localhost:9222").option("--authSessionPath <authSession>", "auth session to use when executing the api").option("--outputFileId <outputFileId>", "the output file id to save the result in").option("--proxy <proxy>", "proxy to use").option("--authSessionParameters <authSessionParameters>", "parameters used to create the used auth session").argument("[apiName]", "name of the api", "default").allowUnknownOption().addArgument(new _commander.Argument("<mode>", "mode of execution").choices(["vanilla", "playwright", "playwright-standalone", "playwright-headless"]).default("playwright-standalone").argOptional()).action(async (apiName, mode, options) => {
97
+ _commander.program.description("run the user function in the cli for testing purposes").option("-i, --input [file]", "input json file").option("-j, --json [json]", "input json string").option("--cdpAddress <cdpAddress>", "CDP address", "http://localhost:9222").option("--authSessionPath <authSession>", "AuthSession to use when executing the api").option("--outputFileId <outputFileId>", "the output file id to save the result in").option("--proxy <proxy>", "proxy to use").option("--authSessionParameters <authSessionParameters>", "parameters used to create the used AuthSession").argument("[apiName]", "name of the api", "default").allowUnknownOption().addArgument(new _commander.Argument("<mode>", "mode of execution").choices(["vanilla", "playwright", "playwright-standalone", "playwright-headless"]).default("playwright-standalone").argOptional()).action(async (apiName, mode, options) => {
102
98
  let inputData = null;
103
99
  if (options.input) {
104
100
  inputData = await fs.readJSON(options.input);
@@ -10,13 +10,13 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
10
10
  _dotenv.default.config({
11
11
  path: `.env`
12
12
  });
13
- _commander.program.description("load auth session to browser").option("--cdpAddress <cdpAddress>", "CDP address", "http://localhost:9222").option("--authSessionPath <authSession>", "auth session to use when executing the api").allowUnknownOption().action(async ({
13
+ _commander.program.description("load AuthSession to browser").option("--cdpAddress <cdpAddress>", "CDP address", "http://localhost:9222").option("--authSessionPath <authSession>", "AuthSession to use when executing the api").allowUnknownOption().action(async ({
14
14
  cdpAddress,
15
15
  authSessionPath
16
16
  }) => {
17
17
  const setting = await (0, _settings.getSettings)();
18
18
  if (!setting.authSessions.enabled) {
19
- throw new Error("Auth session is not enabled");
19
+ 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.");
20
20
  }
21
21
  await (0, _playwrightContext.withPlaywrightContext)({
22
22
  cdpAddress
@@ -19,18 +19,18 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
19
19
  _dotenv.default.config({
20
20
  path: `.env`
21
21
  });
22
- _commander.program.description("run auth session check").option("--cdpAddress <cdpAddress>", "CDP address", "http://localhost:9222").option("--authSessionPath <authSession>", "auth session to use when executing the check").option("--authSessionParameters <authSessionParameters>", "parameters used to create the used auth session").allowUnknownOption().addArgument(new _commander.Argument("<mode>", "mode of execution").choices(["vanilla", "playwright", "playwright-standalone"]).default("playwright-standalone").argOptional()).action(async (mode, {
22
+ _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, {
23
23
  cdpAddress,
24
24
  authSessionPath,
25
25
  authSessionParameters
26
26
  }) => {
27
27
  const setting = await (0, _settings.getSettings)();
28
28
  if (!setting.authSessions.enabled) {
29
- throw new Error("auth session is not enabled");
29
+ 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.");
30
30
  }
31
31
  const checkFilePath = (0, _fileUtils.getFullPathInProject)(_constants.AUTH_SESSIONS_FOLDER_NAME, "check");
32
32
  if (!fs.exists(checkFilePath)) {
33
- throw new Error("auth session check file not found");
33
+ throw new Error("AuthSession check file not found");
34
34
  }
35
35
  let authSessionParametersJson = undefined;
36
36
  if (!(0, _isNil.default)(authSessionParameters)) {
@@ -62,12 +62,12 @@ _commander.program.description("run auth session check").option("--cdpAddress <c
62
62
  throw runApiResult.error.error;
63
63
  }
64
64
  console.error(runApiResult.error);
65
- throw new Error("Error running auth session check");
65
+ throw new Error("Error running AuthSession check");
66
66
  }
67
67
  const result = runApiResult.value.result;
68
68
  console.log("check result", result);
69
69
  if (!result) {
70
- throw new Error("auth session check failed");
70
+ throw new Error("AuthSession check failed");
71
71
  }
72
72
  process.exit(0);
73
73
  });
@@ -18,7 +18,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
18
18
  _dotenv.default.config({
19
19
  path: `.env`
20
20
  });
21
- _commander.program.description("run auth session 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>", "auth session to use when executing the api").option("--pathToSave <pathToSave>", "path to save the auth session, if not provided, will discard the auth session").allowUnknownOption().addArgument(new _commander.Argument("<mode>", "mode of execution").choices(["vanilla", "playwright", "playwright-standalone"]).default("playwright-standalone").argOptional()).action(async (mode, {
21
+ _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, {
22
22
  cdpAddress,
23
23
  pathToSave,
24
24
  input,
@@ -34,11 +34,11 @@ _commander.program.description("run auth session create").option("--cdpAddress <
34
34
  }
35
35
  const setting = await (0, _settings.getSettings)();
36
36
  if (!setting.authSessions.enabled) {
37
- throw new Error("auth sessions feature is not enabled");
37
+ 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.");
38
38
  }
39
39
  const createFilePath = (0, _fileUtils.getFullPathInProject)(_constants.AUTH_SESSIONS_FOLDER_NAME, "create.ts");
40
40
  if (!fs.exists(createFilePath)) {
41
- throw new Error("auth session create file not found");
41
+ throw new Error("AuthSession create file not found");
42
42
  }
43
43
  async function runCreate() {
44
44
  const result = await (0, _runApi.runApi)({
@@ -45,7 +45,7 @@ async function build(outfile, mode, template) {
45
45
  }), (0, _pluginTypescript.default)({
46
46
  tsconfig: `./intuned/${template}/tsconfig.json`
47
47
  }), (0, _pluginCommonjs.default)({
48
- include: ["node_modules/**", `intuned/${template}/**`, "dist", "../typescript-sdk/**", "../typescript-runtime/**"],
48
+ include: ["node_modules/**", `intuned/${template}/**`, "dist", "../typescript-runtime/**"],
49
49
  extensions: [".js"],
50
50
  ignoreGlobal: false,
51
51
  sourceMap: false,
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- const exclusions = ["node_modules/**", ".git/**", "dist/**", "build/**", "coverage/**", ".next/**", ".cache/**", "out/**", "tmp/**", ".DS_Store", "npm-debug.log*", "yarn-debug.log*", "yarn-error.log*", ".env", ".env.*", "**/*.map", "**/*.tsbuildinfo", "tsconfig.json", "output/**", "auth-sessions-instances/**", "README.md", "traces/**"];
7
+ const exclusions = ["node_modules/**", ".vscode/**", ".idea/**", ".git/**", "dist/**", "build/**", "coverage/**", ".next/**", ".cache/**", "out/**", "tmp/**", ".DS_Store", "npm-debug.log*", "yarn-debug.log*", "yarn-error.log*", ".env", ".env.*", "**/*.map", "**/*.tsbuildinfo", "tsconfig.json", "output/**", "auth-sessions-instances/**", "README.md", "traces/**"];
8
8
  var _default = exports.default = exclusions;
@@ -21,6 +21,15 @@ const tsNodeImport = async apiName => {
21
21
  return (0, _neverthrow.ok)(imported);
22
22
  } catch (e) {
23
23
  if ("code" in e && e.code.includes("MODULE_NOT_FOUND")) {
24
+ if ("requireStack" in e && Array.isArray(e.requireStack)) {
25
+ const isStackTopThisFile = e.requireStack[0] === __filename;
26
+ if (!isStackTopThisFile) {
27
+ return (0, _neverthrow.err)({
28
+ type: "other",
29
+ error: e
30
+ });
31
+ }
32
+ }
24
33
  return (0, _neverthrow.err)({
25
34
  type: "not_found"
26
35
  });
@@ -196,7 +196,7 @@ function getProxyUrlFromRunOptions(runOptions) {
196
196
  }
197
197
  const _defaultImport = async path => {
198
198
  try {
199
- const imported = await (specifier => new Promise(r => r(specifier)).then(s => _interopRequireWildcard(require(s))))(`../../../${path}.ts`);
199
+ const imported = await (specifier => new Promise(r => r(specifier)).then(s => _interopRequireWildcard(require(s))))(`../../../${path}`);
200
200
  return (0, _neverthrow.ok)(imported);
201
201
  } catch (e) {
202
202
  if ("code" in e && e.code === "MODULE_NOT_FOUND") {
@@ -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 AuthSession 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], {
19
19
  authSession,
20
20
  ...rest
21
21
  }) => {
@@ -5,4 +5,4 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.attemptAuthSessionCommand = void 0;
7
7
  var _attempt = require("./attempt.command");
8
- const attemptAuthSessionCommand = exports.attemptAuthSessionCommand = _attempt.attemptCommand.command("authsession").description("Manage authentication sessions");
8
+ const attemptAuthSessionCommand = exports.attemptAuthSessionCommand = _attempt.attemptCommand.command("authsession").description("Manage AuthSessions");
@@ -9,8 +9,8 @@ var _authSession = require("../controller/authSession");
9
9
  var _attempt_authsession = require("./attempt_authsession.command");
10
10
  var _helpers = require("../helpers");
11
11
  var _types = require("./types");
12
- const argsSchema = _zod.z.tuple([_zod.z.string().min(1, "ID of the auth session is required")]);
13
- const attemptAuthSessionCheckCommand = exports.attemptAuthSessionCheckCommand = (0, _types.withBaseOptions)(_attempt_authsession.attemptAuthSessionCommand.command("check").description("Check an existing auth session").argument("<id>", "ID of the auth session to check")).action((0, _helpers.cliCommandWrapper)(argsSchema, _types.baseCommandOptionsSchema, async ([id], options) => {
12
+ const argsSchema = _zod.z.tuple([_zod.z.string().min(1, "ID of the AuthSession is required")]);
13
+ const attemptAuthSessionCheckCommand = exports.attemptAuthSessionCheckCommand = (0, _types.withBaseOptions)(_attempt_authsession.attemptAuthSessionCommand.command("check").description("Check an existing AuthSession").argument("<id>", "ID of the AuthSession to check")).action((0, _helpers.cliCommandWrapper)(argsSchema, _types.baseCommandOptionsSchema, async ([id], options) => {
14
14
  await (0, _helpers.assertAuthEnabled)();
15
15
  await (0, _authSession.executeAttemptCheckAuthSessionCLI)({
16
16
  id,
@@ -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 AuthSession").argument("<parameters>", "Parameters for the AuthSession command").option("--id <id>", "ID of the AuthSession to use for the command. Defaults to ./auth-sessions-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)({
@@ -5,4 +5,4 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.authSessionCommand = void 0;
7
7
  var _command = require("./command");
8
- const authSessionCommand = exports.authSessionCommand = _command.program.command("authsession").description("Manage Auth Sessions");
8
+ const authSessionCommand = exports.authSessionCommand = _command.program.command("authsession").description("Manage AuthSessions");
@@ -14,7 +14,7 @@ const optionsSchema = _run_authsession.baseRunAuthSessionCommandOptionsSchema.ex
14
14
  id: _zod.z.string().optional()
15
15
  });
16
16
  const isAuthSessionRecorderEnabled = process.env.INTUNED_AUTH_SESSION_RECORDER_ENABLED === "true";
17
- const authSessionRecordCommand = exports.authSessionRecordCommand = isAuthSessionRecorderEnabled ? (0, _types.withBaseOptions)(_authsession.authSessionCommand.command("record").description("Record a new auth session").option("--id <id>", "ID of the auth session to use for the command. Defaults to auth-session-[current timestamp]").option("--check-attempts <number>", "Number of attempts to check the auth session validity", "1")).action((0, _helpers.cliCommandWrapper)(undefined, optionsSchema, async (_, {
17
+ const authSessionRecordCommand = exports.authSessionRecordCommand = isAuthSessionRecorderEnabled ? (0, _types.withBaseOptions)(_authsession.authSessionCommand.command("record").description("Record a new AuthSession").option("--id <id>", "ID of the AuthSession to use for the command. Defaults to auth-session-[current timestamp]").option("--check-attempts <number>", "Number of attempts to check the AuthSession validity", "1")).action((0, _helpers.cliCommandWrapper)(undefined, optionsSchema, async (_, {
18
18
  checkAttempts,
19
19
  ...rest
20
20
  }) => {
@@ -0,0 +1 @@
1
+ export declare const authSessionScaffoldCommand: import("commander").Command;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.authSessionScaffoldCommand = void 0;
7
+ var _zod = require("zod");
8
+ var _helpers = require("../helpers");
9
+ var _authsession = require("./authsession.command");
10
+ var _types = require("./types");
11
+ var _scaffold = require("../controller/scaffold");
12
+ const optionsSchema = _zod.z.object({});
13
+ const authSessionScaffoldCommand = exports.authSessionScaffoldCommand = (0, _types.withBaseOptions)(_authsession.authSessionCommand.command("scaffold").description("Scaffold AuthSession files")).action((0, _helpers.cliCommandWrapper)(undefined, optionsSchema, async _ => {
14
+ await (0, _helpers.assertAuthEnabled)();
15
+ await (0, _scaffold.scaffoldAuthSessionFiles)();
16
+ }));
@@ -6,32 +6,36 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.deployCommand = void 0;
7
7
  var _command = require("./command");
8
8
  var _dotenv = _interopRequireDefault(require("dotenv"));
9
- var _save = require("../controller/save");
9
+ var _provision = require("../controller/provision");
10
10
  var _deploy = require("../controller/deploy");
11
11
  var _helpers = require("../helpers");
12
- var _save2 = require("./save.command");
12
+ var _provision2 = require("./provision.command");
13
+ var _prompts = require("../helpers/prompts");
13
14
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
15
  _dotenv.default.config({
15
16
  path: `.env`
16
17
  });
17
- const deployCommand = exports.deployCommand = _command.program.command("deploy").description("Save and deploy an Intuned project to the platform").argument("[project-name]", "Name of the project to deploy").option("-w, --workspace-id <id>", "Your Intuned workspace ID").option("-k, --api-key <key>", "Your Intuned API key").action((0, _helpers.cliCommandWrapper)(_save2.saveOrDeployArgsSchema, _save2.saveOrDeployOptionsSchema, async ([projectName], options) => {
18
+ const deployCommand = exports.deployCommand = _command.program.command("deploy").description("Deploy an Intuned project to the platform").argument("[project-name]", "Name of the project to deploy").option("-w, --workspace-id <id>", "Your Intuned workspace ID").option("-k, --api-key <key>", "Your Intuned API key").action((0, _helpers.cliCommandWrapper)(_provision2.saveOrDeployArgsSchema, _provision2.saveOrDeployOptionsSchema, async ([projectName], options) => {
18
19
  const {
19
20
  isValid,
20
21
  errorMessage
21
- } = await (0, _save.validateIntunedProject)();
22
+ } = await (0, _provision.validateIntunedProject)();
22
23
  if (!isValid) {
23
- const message = `^r^+Project to be deployed is not a valid Intuned project:^:^R ${errorMessage}:\n`;
24
+ const message = `^r^+Project to be deployed is not valid:^:^R ${errorMessage}:\n`;
24
25
  throw new _helpers.CLIError(message, {
25
26
  autoColor: false
26
27
  });
27
28
  }
28
- const _projectName = projectName || (await (0, _helpers.loadIntunedJson)()).projectName;
29
+ const _projectName = projectName || (await (0, _helpers.loadIntunedJson)()).projectName || (await (0, _prompts.promptForProjectName)(name => {
30
+ const result = (0, _provision.validateProjectName)(name);
31
+ return result.isValid || result.errorMessage;
32
+ }));
29
33
  if (!_projectName) {
30
- throw new _helpers.CLIError("Project name is required");
34
+ throw new _helpers.CLIError(`Project name is required. Set it in ${await (0, _helpers.getIntunedSettingsFile)()} or provide it as an argument by running 'intuned deploy <project-name>'.`);
31
35
  }
32
- const projectNameValidation = (0, _save.validateProjectName)(_projectName);
36
+ const projectNameValidation = (0, _provision.validateProjectName)(_projectName);
33
37
  if (!projectNameValidation.isValid) {
34
- throw new _helpers.CLIError(projectNameValidation.errorMessage);
38
+ throw new _helpers.CLIError(`Invalid project name: ${projectNameValidation.errorMessage}`);
35
39
  }
36
40
  const auth = await (0, _helpers.getAuthCredentials)(options);
37
41
  await (0, _deploy.runDeployProject)(_projectName, auth);
@@ -1,8 +1,7 @@
1
1
  export * from "./command";
2
2
  export * from "./build.command";
3
3
  export * from "./deploy.command";
4
- export * from "./save.command";
5
- export * from "./init.command";
4
+ export * from "./provision.command";
6
5
  export * from "./run.command";
7
6
  export * from "./run_api.command";
8
7
  export * from "./run_authsession.command";
@@ -16,3 +15,4 @@ export * from "./attempt_authsession_create.command";
16
15
  export * from "./attempt_authsession_check.command";
17
16
  export * from "./authsession.command";
18
17
  export * from "./authsession_record.command";
18
+ export * from "./authsession_scaffold.command";
@@ -36,25 +36,14 @@ Object.keys(_deploy).forEach(function (key) {
36
36
  }
37
37
  });
38
38
  });
39
- var _save = require("./save.command");
40
- Object.keys(_save).forEach(function (key) {
39
+ var _provision = require("./provision.command");
40
+ Object.keys(_provision).forEach(function (key) {
41
41
  if (key === "default" || key === "__esModule") return;
42
- if (key in exports && exports[key] === _save[key]) return;
42
+ if (key in exports && exports[key] === _provision[key]) return;
43
43
  Object.defineProperty(exports, key, {
44
44
  enumerable: true,
45
45
  get: function () {
46
- return _save[key];
47
- }
48
- });
49
- });
50
- var _init = require("./init.command");
51
- Object.keys(_init).forEach(function (key) {
52
- if (key === "default" || key === "__esModule") return;
53
- if (key in exports && exports[key] === _init[key]) return;
54
- Object.defineProperty(exports, key, {
55
- enumerable: true,
56
- get: function () {
57
- return _init[key];
46
+ return _provision[key];
58
47
  }
59
48
  });
60
49
  });
@@ -200,4 +189,15 @@ Object.keys(_authsession_record).forEach(function (key) {
200
189
  return _authsession_record[key];
201
190
  }
202
191
  });
192
+ });
193
+ var _authsession_scaffold = require("./authsession_scaffold.command");
194
+ Object.keys(_authsession_scaffold).forEach(function (key) {
195
+ if (key === "default" || key === "__esModule") return;
196
+ if (key in exports && exports[key] === _authsession_scaffold[key]) return;
197
+ Object.defineProperty(exports, key, {
198
+ enumerable: true,
199
+ get: function () {
200
+ return _authsession_scaffold[key];
201
+ }
202
+ });
203
203
  });
@@ -10,4 +10,4 @@ export declare const saveOrDeployOptionsSchema: z.ZodObject<{
10
10
  workspaceId?: string | undefined;
11
11
  apiKey?: string | undefined;
12
12
  }>;
13
- export declare const saveCommand: import("commander").Command;
13
+ export declare const provisionCommand: import("commander").Command, saveCommand: import("commander").Command;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.saveOrDeployOptionsSchema = exports.saveOrDeployArgsSchema = exports.saveCommand = exports.provisionCommand = void 0;
7
+ var _command = require("./command");
8
+ var _dotenv = _interopRequireDefault(require("dotenv"));
9
+ var _provision = require("../controller/provision");
10
+ var _helpers = require("../helpers");
11
+ var _zod = require("zod");
12
+ var _prompts = require("../helpers/prompts");
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ _dotenv.default.config({
15
+ path: `.env`
16
+ });
17
+ const saveOrDeployArgsSchema = exports.saveOrDeployArgsSchema = _zod.z.tuple([_zod.z.union([_zod.z.string(), _zod.z.undefined()])]);
18
+ const saveOrDeployOptionsSchema = exports.saveOrDeployOptionsSchema = _zod.z.object({
19
+ workspaceId: _zod.z.string().optional(),
20
+ apiKey: _zod.z.string().optional()
21
+ });
22
+ const description = "Provision an Intuned project to the platform";
23
+ const commands = [_command.program.command("save").description(`${description}. (Deprecated, use 'provision' instead)`), _command.program.command("provision").description(description)];
24
+ const [provisionCommand, saveCommand] = commands.map(command => command.argument("[project-name]", "Project name").option("-w, --workspace-id <id>", "Intuned Workspace ID").option("-k, --api-key <key>", "Intuned API key").action((0, _helpers.cliCommandWrapper)(saveOrDeployArgsSchema, saveOrDeployOptionsSchema, async ([projectName], options) => {
25
+ const {
26
+ isValid,
27
+ errorMessage
28
+ } = await (0, _provision.validateIntunedProject)();
29
+ if (!isValid) {
30
+ const message = `^r^+Project to be provisioned is not a valid Intuned project:^:^R ${errorMessage}:\n`;
31
+ throw new _helpers.CLIError(message, {
32
+ autoColor: false
33
+ });
34
+ }
35
+ const _projectName = projectName || (await (0, _helpers.loadIntunedJson)()).projectName || (await (0, _prompts.promptForProjectName)(name => {
36
+ const result = (0, _provision.validateProjectName)(name);
37
+ return result.isValid || result.errorMessage;
38
+ }));
39
+ if (!_projectName) {
40
+ throw new _helpers.CLIError(`Project name is required. Set it in ${await (0, _helpers.getIntunedSettingsFile)()} or provide it as an argument by running 'intuned provision <project-name>'.`);
41
+ }
42
+ const projectNameValidation = (0, _provision.validateProjectName)(_projectName);
43
+ if (!projectNameValidation.isValid) {
44
+ throw new _helpers.CLIError(`Invalid project name: ${projectNameValidation.errorMessage}`);
45
+ }
46
+ const auth = await (0, _helpers.getAuthCredentials)(options);
47
+ await (0, _provision.runProvisionProject)(_projectName, auth);
48
+ })));
49
+ exports.saveCommand = saveCommand;
50
+ exports.provisionCommand = provisionCommand;
@@ -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 AuthSession 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 AuthSession").option("--auth-session-check-attempts <number>", "AuthSession check attempts", "1").option("--auth-session-create-attempts <number>", "AuthSession 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,16 +1,16 @@
1
1
  import { Command } from "commander";
2
2
  export declare const baseRunAuthSessionCommandOptionsSchema: import("zod").ZodObject<{
3
3
  proxy: import("zod").ZodOptional<import("zod").ZodString>;
4
- trace: import("zod").ZodDefault<import("zod").ZodBoolean>;
5
4
  timeout: import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodDefault<import("zod").ZodString>, import("ms").StringValue, string | undefined>, number, string | undefined>;
5
+ trace: import("zod").ZodDefault<import("zod").ZodBoolean>;
6
6
  headless: import("zod").ZodDefault<import("zod").ZodBoolean>;
7
7
  keepBrowserOpen: import("zod").ZodDefault<import("zod").ZodBoolean>;
8
8
  cdpUrl: import("zod").ZodOptional<import("zod").ZodString>;
9
9
  checkAttempts: import("zod").ZodDefault<import("zod").ZodNumber>;
10
10
  createAttempts: import("zod").ZodDefault<import("zod").ZodNumber>;
11
11
  }, "strip", import("zod").ZodTypeAny, {
12
- trace: boolean;
13
12
  timeout: number;
13
+ trace: boolean;
14
14
  headless: boolean;
15
15
  keepBrowserOpen: boolean;
16
16
  checkAttempts: number;
@@ -19,8 +19,8 @@ export declare const baseRunAuthSessionCommandOptionsSchema: import("zod").ZodOb
19
19
  cdpUrl?: string | undefined;
20
20
  }, {
21
21
  proxy?: string | undefined;
22
- trace?: boolean | undefined;
23
22
  timeout?: string | undefined;
23
+ trace?: boolean | undefined;
24
24
  headless?: boolean | undefined;
25
25
  keepBrowserOpen?: boolean | undefined;
26
26
  cdpUrl?: string | undefined;
@@ -11,7 +11,7 @@ const baseRunAuthSessionCommandOptionsSchema = exports.baseRunAuthSessionCommand
11
11
  checkAttempts: _types.authSessionCheckAttemptsSchema,
12
12
  createAttempts: _types.authSessionCreateAttemptsSchema
13
13
  });
14
- const runAuthSessionCommand = exports.runAuthSessionCommand = _run.runCommand.command("authsession").description("Manage authentication sessions");
14
+ const runAuthSessionCommand = exports.runAuthSessionCommand = _run.runCommand.command("authsession").description("Execute AuthSession Runs");
15
15
  function withAuthSessionBaseOptions(command) {
16
- return (0, _types.withBaseOptions)(command.option("--check-attempts <number>", "Number of attempts to check the auth session validity", "1").option("--create-attempts <number>", "Number of attempts to create a new auth session if it is invalid", "1"));
16
+ return (0, _types.withBaseOptions)(command.option("--check-attempts <number>", "Number of attempts to check the AuthSession validity", "1").option("--create-attempts <number>", "Number of attempts to create a new AuthSession if it is invalid", "1"));
17
17
  }
@@ -15,7 +15,7 @@ const optionsSchema = _run_authsession.baseRunAuthSessionCommandOptionsSchema.ex
15
15
  id: _zod.z.string().optional()
16
16
  });
17
17
  const commands = [_run_authsession.runAuthSessionCommand.command("create"), _authsession.authSessionCommand.command("create")];
18
- const [runAuthSessionCreateCommand, authSessionCreateCommand] = commands.map(command => (0, _run_authsession.withAuthSessionBaseOptions)(command.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-[current timestamp]")).action((0, _helpers.cliCommandWrapper)(argsSchema, optionsSchema, async ([parameters], {
18
+ const [runAuthSessionCreateCommand, authSessionCreateCommand] = commands.map(command => (0, _run_authsession.withAuthSessionBaseOptions)(command.description("Create a new AuthSession").argument("<parameters>", "Parameters for the AuthSession command").option("--id <id>", "ID of the AuthSession to use for the command. Defaults to auth-session-[current timestamp]")).action((0, _helpers.cliCommandWrapper)(argsSchema, optionsSchema, async ([parameters], {
19
19
  checkAttempts,
20
20
  createAttempts,
21
21
  id,
@@ -10,12 +10,12 @@ var _authSession = require("../controller/authSession");
10
10
  var _run_authsession = require("./run_authsession.command");
11
11
  var _helpers = require("../helpers");
12
12
  var _authsession = require("./authsession.command");
13
- const argsSchema = _zod.z.tuple([_zod.z.string().min(1, "ID of the auth session is required")]);
13
+ const argsSchema = _zod.z.tuple([_zod.z.string().min(1, "ID of the AuthSession is required")]);
14
14
  const optionsSchema = _run_authsession.baseRunAuthSessionCommandOptionsSchema.extend({
15
15
  parameters: _zod.z.string().optional()
16
16
  });
17
17
  const commands = [_run_authsession.runAuthSessionCommand.command("update"), _authsession.authSessionCommand.command("update")];
18
- const [runAuthSessionUpdateCommand, authSessionUpdateCommand] = commands.map(command => (0, _run_authsession.withAuthSessionBaseOptions)(command.description("Update an existing auth session").argument("<id>", "ID of the auth session to update").option("--parameters <parameters>", "Parameters for the auth session command. If not provided, it will use the existing parameters")).action((0, _helpers.cliCommandWrapper)(argsSchema, optionsSchema, async ([id], {
18
+ const [runAuthSessionUpdateCommand, authSessionUpdateCommand] = commands.map(command => (0, _run_authsession.withAuthSessionBaseOptions)(command.description("Update an existing AuthSession").argument("<id>", "ID of the AuthSession to update").option("--parameters <parameters>", "Parameters for the AuthSession command. If not provided, it will use the existing parameters")).action((0, _helpers.cliCommandWrapper)(argsSchema, optionsSchema, async ([id], {
19
19
  checkAttempts,
20
20
  createAttempts,
21
21
  parameters,
@@ -9,12 +9,12 @@ var _authSession = require("../controller/authSession");
9
9
  var _run_authsession = require("./run_authsession.command");
10
10
  var _helpers = require("../helpers");
11
11
  var _authsession = require("./authsession.command");
12
- const argsSchema = _zod.z.tuple([_zod.z.string().min(1, "ID of the auth session is required")]);
12
+ const argsSchema = _zod.z.tuple([_zod.z.string().min(1, "ID of the AuthSession is required")]);
13
13
  const optionsSchema = _run_authsession.baseRunAuthSessionCommandOptionsSchema.extend({
14
14
  autoRecreate: _zod.z.boolean().default(true)
15
15
  });
16
16
  const commands = [_run_authsession.runAuthSessionCommand.command("validate"), _authsession.authSessionCommand.command("validate")];
17
- const [runAuthSessionValidateCommand, authSessionValidateCommand] = commands.map(command => (0, _run_authsession.withAuthSessionBaseOptions)(command.description("Validate an existing auth session").argument("<id>", "ID of the auth session to validate").option("--no-auto-recreate", "Disable auto recreation of the auth session if it is invalid")).action((0, _helpers.cliCommandWrapper)(argsSchema, optionsSchema, async ([id], {
17
+ const [runAuthSessionValidateCommand, authSessionValidateCommand] = commands.map(command => (0, _run_authsession.withAuthSessionBaseOptions)(command.description("Validate an existing AuthSession").argument("<id>", "ID of the AuthSession to validate").option("--no-auto-recreate", "Disable auto recreation of the AuthSession if it is invalid")).action((0, _helpers.cliCommandWrapper)(argsSchema, optionsSchema, async ([id], {
18
18
  autoRecreate,
19
19
  checkAttempts,
20
20
  createAttempts,
@@ -17,8 +17,8 @@ export declare const baseCommandOptionsSchema: z.ZodObject<{
17
17
  keepBrowserOpen: z.ZodDefault<z.ZodBoolean>;
18
18
  cdpUrl: z.ZodOptional<z.ZodString>;
19
19
  }, "strip", z.ZodTypeAny, {
20
- trace: boolean;
21
20
  timeout: number;
21
+ trace: boolean;
22
22
  headless: boolean;
23
23
  keepBrowserOpen: boolean;
24
24
  proxy?: string | undefined;
@@ -8,8 +8,8 @@ exports.withBaseOptions = withBaseOptions;
8
8
  var _ms = _interopRequireDefault(require("ms"));
9
9
  var _zod = require("zod");
10
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
- const authSessionCheckAttemptsSchema = exports.authSessionCheckAttemptsSchema = _zod.z.coerce.number().int().min(1, "Auth session check attempts must be at least 1").default(1);
12
- const authSessionCreateAttemptsSchema = exports.authSessionCreateAttemptsSchema = _zod.z.coerce.number().int().min(1, "Auth session create attempts must be at least 1").default(1);
11
+ const authSessionCheckAttemptsSchema = exports.authSessionCheckAttemptsSchema = _zod.z.coerce.number().int().min(1, "AuthSession check attempts must be at least 1").default(1);
12
+ const authSessionCreateAttemptsSchema = exports.authSessionCreateAttemptsSchema = _zod.z.coerce.number().int().min(1, "AuthSession create attempts must be at least 1").default(1);
13
13
  const proxySchema = exports.proxySchema = _zod.z.string().url("--proxy must be a valid URL").optional();
14
14
  const timeoutSchema = exports.timeoutSchema = _zod.z.string().default("10 mins").refine(val => {
15
15
  return (0, _ms.default)(val) !== undefined;
@@ -15,6 +15,7 @@ function getTerminal() {
15
15
  });
16
16
  }
17
17
  _vitest.vi.mock("fs-extra", () => ({
18
+ ensureDir: _vitest.vi.fn(),
18
19
  writeJSON: _vitest.vi.fn(),
19
20
  exists: _vitest.vi.fn().mockResolvedValue(true)
20
21
  }));
@@ -251,7 +252,7 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
251
252
  });
252
253
  (0, _vitest.expect)(_runApi.runApi).toHaveBeenCalledTimes(2);
253
254
  });
254
- (0, _vitest.it)("validates auth session before each attempt if provided", async () => {
255
+ (0, _vitest.it)("validates AuthSession before each attempt if provided", async () => {
255
256
  _vitest.vi.mocked(_runApi.runApi).mockResolvedValueOnce((0, _neverthrow.err)(new _runApi.AutomationError("runApi failed"))).mockResolvedValue((0, _neverthrow.ok)({
256
257
  result: "success"
257
258
  }));
@@ -274,7 +275,7 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
274
275
  createRetries: 2
275
276
  }));
276
277
  });
277
- (0, _vitest.it)("doesn't validate auth session if not provided", async () => {
278
+ (0, _vitest.it)("doesn't validate AuthSession if not provided", async () => {
278
279
  _vitest.vi.mocked(_runApi.runApi).mockResolvedValue((0, _neverthrow.ok)({
279
280
  result: "success"
280
281
  }));
@@ -285,8 +286,8 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
285
286
  });
286
287
  (0, _vitest.expect)(_authSession.executeRunValidateAuthSessionCLI).not.toHaveBeenCalled();
287
288
  });
288
- (0, _vitest.it)("fails if auth session is provided but not valid", async () => {
289
- _vitest.vi.mocked(_authSession.executeRunValidateAuthSessionCLI).mockRejectedValue(new _helpers.CLIError("Auth session validation failed"));
289
+ (0, _vitest.it)("fails if AuthSession is provided but not valid", async () => {
290
+ _vitest.vi.mocked(_authSession.executeRunValidateAuthSessionCLI).mockRejectedValue(new _helpers.CLIError("AuthSession validation failed"));
290
291
  await (0, _vitest.expect)((0, _api.executeRunApiCLI)({
291
292
  apiName: "testApi",
292
293
  inputData: {},
@@ -297,7 +298,7 @@ _vitest.vi.mock("../../helpers", async importOriginal => {
297
298
  createRetries: 2
298
299
  },
299
300
  retries: 10
300
- })).rejects.toThrow("Auth session validation failed");
301
+ })).rejects.toThrow("AuthSession validation failed");
301
302
  (0, _vitest.expect)(_authSession.executeRunValidateAuthSessionCLI).toHaveBeenCalledWith(_vitest.expect.objectContaining({
302
303
  id: "authSessionId",
303
304
  autoRecreate: false,