@intuned/runtime-dev 1.2.8-dev-peer-script → 1.3.0-responseLimits.1

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 (144) hide show
  1. package/.babelrc +2 -2
  2. package/CHANGELOG.md +5 -1
  3. package/bin/intuned +2 -0
  4. package/dist/commands/api/run.js +10 -3
  5. package/dist/commands/auth-sessions/run-check.js +18 -4
  6. package/dist/commands/auth-sessions/run-create.js +2 -1
  7. package/dist/commands/common/browserUtils.d.ts +1 -1
  8. package/dist/commands/common/browserUtils.js +1 -1
  9. package/dist/commands/common/getFirstLineNumber.js +2 -4
  10. package/dist/commands/interface/run.js +7 -6
  11. package/dist/commands/intuned-cli/commands/attempt.command.d.ts +1 -0
  12. package/dist/commands/intuned-cli/commands/attempt.command.js +8 -0
  13. package/dist/commands/intuned-cli/commands/attempt_api.command.d.ts +1 -0
  14. package/dist/commands/intuned-cli/commands/attempt_api.command.js +40 -0
  15. package/dist/commands/intuned-cli/commands/attempt_authsession.command.d.ts +1 -0
  16. package/dist/commands/intuned-cli/commands/attempt_authsession.command.js +8 -0
  17. package/dist/commands/intuned-cli/commands/attempt_authsession_check.command.d.ts +1 -0
  18. package/dist/commands/intuned-cli/commands/attempt_authsession_check.command.js +24 -0
  19. package/dist/commands/intuned-cli/commands/attempt_authsession_create.command.d.ts +1 -0
  20. package/dist/commands/intuned-cli/commands/attempt_authsession_create.command.js +36 -0
  21. package/dist/commands/intuned-cli/commands/build.command.d.ts +1 -0
  22. package/dist/commands/intuned-cli/commands/build.command.js +12 -0
  23. package/dist/commands/intuned-cli/commands/command.d.ts +2 -0
  24. package/dist/commands/intuned-cli/commands/command.js +9 -0
  25. package/dist/commands/intuned-cli/commands/deploy.command.d.ts +1 -0
  26. package/dist/commands/intuned-cli/commands/deploy.command.js +46 -0
  27. package/dist/commands/intuned-cli/commands/index.d.ts +15 -0
  28. package/dist/commands/intuned-cli/commands/index.js +170 -0
  29. package/dist/commands/intuned-cli/commands/init.command.d.ts +1 -0
  30. package/dist/commands/intuned-cli/commands/init.command.js +13 -0
  31. package/dist/commands/intuned-cli/commands/run.command.d.ts +1 -0
  32. package/dist/commands/intuned-cli/commands/run.command.js +8 -0
  33. package/dist/commands/intuned-cli/commands/run_api.command.d.ts +1 -0
  34. package/dist/commands/intuned-cli/commands/run_api.command.js +54 -0
  35. package/dist/commands/intuned-cli/commands/run_authsession.command.d.ts +20 -0
  36. package/dist/commands/intuned-cli/commands/run_authsession.command.js +13 -0
  37. package/dist/commands/intuned-cli/commands/run_authsession_create.command.d.ts +1 -0
  38. package/dist/commands/intuned-cli/commands/run_authsession_create.command.js +39 -0
  39. package/dist/commands/intuned-cli/commands/run_authsession_update.command.d.ts +1 -0
  40. package/dist/commands/intuned-cli/commands/run_authsession_update.command.js +39 -0
  41. package/dist/commands/intuned-cli/commands/run_authsession_validate.command.d.ts +1 -0
  42. package/dist/commands/intuned-cli/commands/run_authsession_validate.command.js +37 -0
  43. package/dist/commands/intuned-cli/commands/types.d.ts +21 -0
  44. package/dist/commands/intuned-cli/commands/types.js +21 -0
  45. package/dist/commands/intuned-cli/constants/index.d.ts +17 -0
  46. package/dist/commands/intuned-cli/constants/index.js +25 -0
  47. package/dist/commands/intuned-cli/controller/__test__/api.test.js +280 -0
  48. package/dist/commands/intuned-cli/controller/__test__/authSession.test.js +676 -0
  49. package/dist/commands/intuned-cli/controller/api.d.ts +44 -0
  50. package/dist/commands/intuned-cli/controller/api.js +181 -0
  51. package/dist/commands/intuned-cli/controller/authSession.d.ts +198 -0
  52. package/dist/commands/intuned-cli/controller/authSession.js +292 -0
  53. package/dist/commands/intuned-cli/controller/build.d.ts +1 -0
  54. package/dist/commands/intuned-cli/controller/build.js +36 -0
  55. package/dist/commands/intuned-cli/controller/deploy.d.ts +15 -0
  56. package/dist/commands/{deploy/utils.js → intuned-cli/controller/deploy.js} +115 -109
  57. package/dist/commands/intuned-cli/controller/index.d.ts +1 -0
  58. package/dist/commands/intuned-cli/controller/index.js +46 -0
  59. package/dist/commands/intuned-cli/helpers/api.d.ts +3 -0
  60. package/dist/commands/intuned-cli/helpers/api.js +19 -0
  61. package/dist/commands/intuned-cli/helpers/auth.d.ts +41 -0
  62. package/dist/commands/intuned-cli/helpers/auth.js +129 -0
  63. package/dist/commands/intuned-cli/helpers/backend.d.ts +8 -0
  64. package/dist/commands/intuned-cli/helpers/backend.js +26 -0
  65. package/dist/commands/intuned-cli/helpers/context.d.ts +3 -0
  66. package/dist/commands/intuned-cli/helpers/context.js +33 -0
  67. package/dist/commands/intuned-cli/helpers/errors.d.ts +14 -0
  68. package/dist/commands/intuned-cli/helpers/errors.js +55 -0
  69. package/dist/commands/intuned-cli/helpers/index.d.ts +10 -0
  70. package/dist/commands/intuned-cli/helpers/index.js +115 -0
  71. package/dist/commands/intuned-cli/helpers/intunedJson.d.ts +1 -0
  72. package/dist/{common/cli/utils.js → commands/intuned-cli/helpers/intunedJson.js} +0 -16
  73. package/dist/commands/intuned-cli/helpers/proxy.d.ts +5 -0
  74. package/dist/commands/intuned-cli/helpers/proxy.js +23 -0
  75. package/dist/commands/intuned-cli/helpers/terminal.d.ts +5 -0
  76. package/dist/commands/intuned-cli/helpers/terminal.js +13 -0
  77. package/dist/commands/intuned-cli/helpers/timeout.d.ts +1 -0
  78. package/dist/commands/intuned-cli/helpers/timeout.js +23 -0
  79. package/dist/commands/intuned-cli/helpers/validation.d.ts +2 -0
  80. package/dist/commands/intuned-cli/helpers/validation.js +12 -0
  81. package/dist/commands/intuned-cli/index.d.ts +1 -0
  82. package/dist/commands/intuned-cli/index.js +16 -0
  83. package/dist/commands/intuned-cli/main.d.ts +1 -0
  84. package/dist/commands/intuned-cli/main.js +15 -0
  85. package/dist/{common/cli → commands/intuned-cli}/types.d.ts +1 -34
  86. package/dist/{common/cli → commands/intuned-cli}/types.js +1 -2
  87. package/dist/common/assets/browser_scripts.js +2509 -2143
  88. package/dist/common/asyncLocalStorage/index.d.ts +1 -2
  89. package/dist/common/backendFunctions/getAuthSessionParameters.d.ts +1 -0
  90. package/dist/common/backendFunctions/getAuthSessionParameters.js +38 -0
  91. package/dist/common/constants.d.ts +1 -0
  92. package/dist/common/constants.js +2 -1
  93. package/dist/common/getPlaywrightConstructs.d.ts +1 -1
  94. package/dist/common/getPlaywrightConstructs.js +4 -12
  95. package/dist/common/jwtTokenManager.js +3 -5
  96. package/dist/common/runApi/errors.d.ts +10 -3
  97. package/dist/common/runApi/errors.js +21 -8
  98. package/dist/common/runApi/index.d.ts +4 -1
  99. package/dist/common/runApi/index.js +33 -21
  100. package/dist/common/runApi/types.d.ts +140 -9
  101. package/dist/common/runApi/types.js +28 -27
  102. package/dist/index.d.ts +1 -1
  103. package/dist/index.js +6 -0
  104. package/dist/runtime/executionHelpers.test.js +3 -4
  105. package/dist/runtime/export.d.ts +16 -0
  106. package/dist/runtime/extendPayload.js +1 -1
  107. package/dist/runtime/extendTimeout.js +0 -7
  108. package/dist/runtime/getAuthSessionParameters.d.ts +1 -0
  109. package/dist/runtime/getAuthSessionParameters.js +20 -0
  110. package/dist/runtime/index.d.ts +1 -0
  111. package/dist/runtime/index.js +7 -0
  112. package/package.json +12 -11
  113. package/template.tsconfig.json +4 -7
  114. package/tsconfig.json +2 -1
  115. package/bin/check-auth-session +0 -3
  116. package/bin/cli-build +0 -3
  117. package/bin/create-auth-session +0 -3
  118. package/bin/deploy +0 -3
  119. package/bin/init +0 -3
  120. package/bin/run-api +0 -3
  121. package/dist/commands/cli-auth-sessions/check.d.ts +0 -2
  122. package/dist/commands/cli-auth-sessions/check.js +0 -40
  123. package/dist/commands/cli-auth-sessions/create.d.ts +0 -2
  124. package/dist/commands/cli-auth-sessions/create.js +0 -53
  125. package/dist/commands/cli-auth-sessions/utils.d.ts +0 -28
  126. package/dist/commands/cli-auth-sessions/utils.js +0 -285
  127. package/dist/commands/cli-build/cli-build.d.ts +0 -2
  128. package/dist/commands/cli-build/cli-build.js +0 -20
  129. package/dist/commands/deploy/deploy.d.ts +0 -2
  130. package/dist/commands/deploy/deploy.js +0 -47
  131. package/dist/commands/deploy/utils.d.ts +0 -16
  132. package/dist/commands/init/init.d.ts +0 -2
  133. package/dist/commands/init/init.js +0 -22
  134. package/dist/commands/init/utils.d.ts +0 -11
  135. package/dist/commands/init/utils.js +0 -181
  136. package/dist/commands/run-api-cli/run-api.d.ts +0 -2
  137. package/dist/commands/run-api-cli/run-api.js +0 -57
  138. package/dist/commands/run-api-cli/utils.d.ts +0 -9
  139. package/dist/commands/run-api-cli/utils.js +0 -144
  140. package/dist/common/cli/cliReadme.d.ts +0 -1
  141. package/dist/common/cli/cliReadme.js +0 -92
  142. package/dist/common/cli/constants.d.ts +0 -33
  143. package/dist/common/cli/constants.js +0 -39
  144. package/dist/common/cli/utils.d.ts +0 -6
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getAuthCredentials = getAuthCredentials;
7
+ exports.getBaseUrl = getBaseUrl;
8
+ var _errors = require("./errors");
9
+ var _intunedJson = require("./intunedJson");
10
+ async function getAuthCredentials(options) {
11
+ const workspaceId = options.workspaceId || (await (0, _intunedJson.getSettingIntunedJSON)("workspaceId"));
12
+ const apiKey = options.apiKey || process.env.INTUNED_API_KEY;
13
+ if (!workspaceId) {
14
+ throw new _errors.CLIError("Workspace ID is required. Please provide it via command line options or Intuned.json");
15
+ }
16
+ if (!apiKey) {
17
+ throw new _errors.CLIError("API key is required. Please provide it via command line options or INTUNED_API_KEY environment variable.");
18
+ }
19
+ return {
20
+ workspaceId,
21
+ apiKey
22
+ };
23
+ }
24
+ function getBaseUrl() {
25
+ return process.env.INTUNED_API_BASE_URL || process.env.INTUNED_API_DOMAIN || `https://app.intuned.io`;
26
+ }
@@ -0,0 +1,3 @@
1
+ export declare function withCLIContext<R>(fn: () => Promise<R>, options?: {
2
+ authSessionId?: string;
3
+ }): Promise<R>;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.withCLIContext = withCLIContext;
7
+ var _nanoid = require("nanoid");
8
+ var _asyncLocalStorage = require("../../../common/asyncLocalStorage");
9
+ var _enums = require("../../../runtime/enums");
10
+ var _auth = require("./auth");
11
+ async function withCLIContext(fn, options) {
12
+ const runId = (0, _nanoid.nanoid)();
13
+ async function getAuthSessionParameters() {
14
+ const id = options?.authSessionId;
15
+ if (!id) {
16
+ throw new Error("getAuthSessionParameters cannot be called without using an auth session");
17
+ }
18
+ const {
19
+ metadata
20
+ } = await (0, _auth.loadAuthSessionInstance)(id);
21
+ if (metadata?.authSessionType === "MANUAL") {
22
+ throw new Error("Auth session is recorder-based, it does not have parameters.");
23
+ }
24
+ return metadata?.authSessionInput ?? {};
25
+ }
26
+ return await (0, _asyncLocalStorage.runWithContext)({
27
+ runEnvironment: _enums.RunEnvironment.IDE,
28
+ runId,
29
+ extendedPayloads: [],
30
+ timeoutInfo: {},
31
+ getAuthSessionParameters
32
+ }, fn);
33
+ }
@@ -0,0 +1,14 @@
1
+ import { AutomationError } from "../../../common/runApi";
2
+ export declare class CLIError extends Error {
3
+ autoColor: boolean;
4
+ constructor(message: string, options?: {
5
+ autoColor?: boolean;
6
+ });
7
+ }
8
+ export declare class CLIAssertionError extends CLIError {
9
+ constructor(message: string, options?: {
10
+ autoColor?: boolean;
11
+ });
12
+ }
13
+ export declare function logAutomationError(error: AutomationError): void;
14
+ export declare function withErrorLogging<T extends any[]>(fn: (...args: T) => Promise<unknown>): (...args: T) => Promise<never>;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.CLIError = exports.CLIAssertionError = void 0;
7
+ exports.logAutomationError = logAutomationError;
8
+ exports.withErrorLogging = withErrorLogging;
9
+ var _runApi = require("../../../common/runApi");
10
+ var _terminal = require("./terminal");
11
+ class CLIError extends Error {
12
+ constructor(message, options) {
13
+ super(message);
14
+ this.name = "CLIError";
15
+ this.autoColor = options?.autoColor ?? true;
16
+ }
17
+ }
18
+ exports.CLIError = CLIError;
19
+ class CLIAssertionError extends CLIError {
20
+ constructor(message, options) {
21
+ super(message, options);
22
+ this.name = "CLIAssertionError";
23
+ }
24
+ }
25
+ exports.CLIAssertionError = CLIAssertionError;
26
+ function logAutomationError(error) {
27
+ (0, _terminal.terminal)(`^r^+An error occurred while running the API:^:\n`);
28
+ if (error.error.stack) {
29
+ const stackLines = error.error.stack.split("\n").filter(line => !line.includes("@intuned/runtime") && !line.includes("node:"));
30
+ (0, _terminal.terminal)(`^r${stackLines.join("\n")}^:\n`);
31
+ } else {
32
+ (0, _terminal.terminal)(`^r${error.error.message}^:\n`);
33
+ }
34
+ }
35
+ function withErrorLogging(fn) {
36
+ return async (...args) => {
37
+ try {
38
+ await fn(...args);
39
+ process.exit(0);
40
+ } catch (error) {
41
+ if (error instanceof CLIError) {
42
+ if (error.autoColor) {
43
+ (0, _terminal.terminal)(`^r^+${error.message}^:\n`);
44
+ } else {
45
+ (0, _terminal.terminal)(`${error.message}\n`);
46
+ }
47
+ } else if (error instanceof _runApi.AutomationError) {
48
+ logAutomationError(error);
49
+ } else {
50
+ (0, _terminal.terminal)(`^r^+An error occurred:^: ^R${error.message}^:\n^r^+Please report this issue to the Intuned team.^:\n`);
51
+ }
52
+ process.exit(1);
53
+ }
54
+ };
55
+ }
@@ -0,0 +1,10 @@
1
+ export * from "./api";
2
+ export * from "./auth";
3
+ export * from "./context";
4
+ export * from "./errors";
5
+ export * from "./proxy";
6
+ export * from "./terminal";
7
+ export * from "./timeout";
8
+ export * from "./validation";
9
+ export * from "./intunedJson";
10
+ export * from "./backend";
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _api = require("./api");
7
+ Object.keys(_api).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _api[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _api[key];
14
+ }
15
+ });
16
+ });
17
+ var _auth = require("./auth");
18
+ Object.keys(_auth).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _auth[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _auth[key];
25
+ }
26
+ });
27
+ });
28
+ var _context = require("./context");
29
+ Object.keys(_context).forEach(function (key) {
30
+ if (key === "default" || key === "__esModule") return;
31
+ if (key in exports && exports[key] === _context[key]) return;
32
+ Object.defineProperty(exports, key, {
33
+ enumerable: true,
34
+ get: function () {
35
+ return _context[key];
36
+ }
37
+ });
38
+ });
39
+ var _errors = require("./errors");
40
+ Object.keys(_errors).forEach(function (key) {
41
+ if (key === "default" || key === "__esModule") return;
42
+ if (key in exports && exports[key] === _errors[key]) return;
43
+ Object.defineProperty(exports, key, {
44
+ enumerable: true,
45
+ get: function () {
46
+ return _errors[key];
47
+ }
48
+ });
49
+ });
50
+ var _proxy = require("./proxy");
51
+ Object.keys(_proxy).forEach(function (key) {
52
+ if (key === "default" || key === "__esModule") return;
53
+ if (key in exports && exports[key] === _proxy[key]) return;
54
+ Object.defineProperty(exports, key, {
55
+ enumerable: true,
56
+ get: function () {
57
+ return _proxy[key];
58
+ }
59
+ });
60
+ });
61
+ var _terminal = require("./terminal");
62
+ Object.keys(_terminal).forEach(function (key) {
63
+ if (key === "default" || key === "__esModule") return;
64
+ if (key in exports && exports[key] === _terminal[key]) return;
65
+ Object.defineProperty(exports, key, {
66
+ enumerable: true,
67
+ get: function () {
68
+ return _terminal[key];
69
+ }
70
+ });
71
+ });
72
+ var _timeout = require("./timeout");
73
+ Object.keys(_timeout).forEach(function (key) {
74
+ if (key === "default" || key === "__esModule") return;
75
+ if (key in exports && exports[key] === _timeout[key]) return;
76
+ Object.defineProperty(exports, key, {
77
+ enumerable: true,
78
+ get: function () {
79
+ return _timeout[key];
80
+ }
81
+ });
82
+ });
83
+ var _validation = require("./validation");
84
+ Object.keys(_validation).forEach(function (key) {
85
+ if (key === "default" || key === "__esModule") return;
86
+ if (key in exports && exports[key] === _validation[key]) return;
87
+ Object.defineProperty(exports, key, {
88
+ enumerable: true,
89
+ get: function () {
90
+ return _validation[key];
91
+ }
92
+ });
93
+ });
94
+ var _intunedJson = require("./intunedJson");
95
+ Object.keys(_intunedJson).forEach(function (key) {
96
+ if (key === "default" || key === "__esModule") return;
97
+ if (key in exports && exports[key] === _intunedJson[key]) return;
98
+ Object.defineProperty(exports, key, {
99
+ enumerable: true,
100
+ get: function () {
101
+ return _intunedJson[key];
102
+ }
103
+ });
104
+ });
105
+ var _backend = require("./backend");
106
+ Object.keys(_backend).forEach(function (key) {
107
+ if (key === "default" || key === "__esModule") return;
108
+ if (key in exports && exports[key] === _backend[key]) return;
109
+ Object.defineProperty(exports, key, {
110
+ enumerable: true,
111
+ get: function () {
112
+ return _backend[key];
113
+ }
114
+ });
115
+ });
@@ -0,0 +1 @@
1
+ export declare function getSettingIntunedJSON(key: string): Promise<any>;
@@ -3,28 +3,12 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getAuthCredentials = getAuthCredentials;
7
- exports.getBaseUrl = getBaseUrl;
8
6
  exports.getSettingIntunedJSON = getSettingIntunedJSON;
9
7
  var _path = _interopRequireDefault(require("path"));
10
8
  var fs = _interopRequireWildcard(require("fs-extra"));
11
9
  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); }
12
10
  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; }
13
11
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
- async function getAuthCredentials(options) {
15
- const workspaceId = options.workspaceId || (await getSettingIntunedJSON("workspaceId"));
16
- const apiKey = options.apiKey || process.env.INTUNED_API_KEY;
17
- if (!workspaceId || !apiKey) {
18
- throw new Error("Authentication details are required. Please provide them via command line options(api key, workspace id), intuned.json(workspace id) or environment variables(api key).");
19
- }
20
- return {
21
- workspaceId,
22
- apiKey
23
- };
24
- }
25
- function getBaseUrl() {
26
- return process.env.INTUNED_API_DOMAIN || `https://app.intuned.io`;
27
- }
28
12
  async function getSettingIntunedJSON(key) {
29
13
  const intunedJsonPath = _path.default.join(process.cwd(), "Intuned.json");
30
14
  const intunedJson = await fs.readJSON(intunedJsonPath);
@@ -0,0 +1,5 @@
1
+ export declare function parseUrlProxy(proxyUrl: string): {
2
+ password: string;
3
+ username: string;
4
+ server: string;
5
+ } | undefined;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.parseUrlProxy = parseUrlProxy;
7
+ function parseUrlProxy(proxyUrl) {
8
+ try {
9
+ const url = new URL(proxyUrl);
10
+ const username = url.username;
11
+ const password = url.password;
12
+ const proxy = url.hostname;
13
+ const port = url.port ? `:${url.port}` : "";
14
+ const domain = `${url.protocol}//${proxy}${port}`;
15
+ return {
16
+ password,
17
+ username,
18
+ server: domain
19
+ };
20
+ } catch (error) {
21
+ return;
22
+ }
23
+ }
@@ -0,0 +1,5 @@
1
+ /// <reference types="node" />
2
+ export declare const terminalStdout: NodeJS.WriteStream & {
3
+ fd: 2;
4
+ };
5
+ export declare const terminal: import("terminal-kit/Terminal");
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.terminalStdout = exports.terminal = void 0;
7
+ var _terminalKit = require("terminal-kit");
8
+ const terminalStdout = exports.terminalStdout = process.stderr;
9
+ const terminal = exports.terminal = (0, _terminalKit.createTerminal)({
10
+ appId: "Intuned CLI",
11
+ appName: "Intuned CLI",
12
+ stdout: terminalStdout
13
+ });
@@ -0,0 +1 @@
1
+ export declare function withTimeout<R>(fn: (abortSignal: AbortSignal) => Promise<R>, timeout: number): Promise<Awaited<R>>;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.withTimeout = withTimeout;
7
+ var _asyncLocalStorage = require("../../../common/asyncLocalStorage");
8
+ var _runApi = require("../../../common/runApi");
9
+ function withTimeout(fn, timeout) {
10
+ let reject;
11
+ const abortController = new AbortController();
12
+ const timeoutPromise = new Promise((_, _reject) => {
13
+ reject = _reject;
14
+ });
15
+ const timeoutId = setTimeout(() => {
16
+ abortController.abort();
17
+ reject(new _runApi.AutomationError(new Error("Timed out")));
18
+ }, timeout);
19
+ (0, _asyncLocalStorage.getExecutionContext)().timeoutInfo.extendTimeoutCallback = async () => {
20
+ timeoutId.refresh();
21
+ };
22
+ return Promise.race([fn(abortController.signal), timeoutPromise]);
23
+ }
@@ -0,0 +1,2 @@
1
+ import { z } from "zod";
2
+ export declare function logInvalidInput(result: z.SafeParseError<unknown>): void;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.logInvalidInput = logInvalidInput;
7
+ var _terminal = require("./terminal");
8
+ function logInvalidInput(result) {
9
+ (0, _terminal.terminal)("^r^+Invalid input parameters:^: ^R" + result.error.errors.map(({
10
+ message
11
+ }) => `^R${message}^:`).join(", ") + "\n");
12
+ }
@@ -0,0 +1 @@
1
+ export * from "./commands";
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _commands = require("./commands");
7
+ Object.keys(_commands).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _commands[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _commands[key];
14
+ }
15
+ });
16
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ var _dotenv = _interopRequireDefault(require("dotenv"));
4
+ var _commands = require("./commands");
5
+ var _helpers = require("./helpers");
6
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
7
+ _dotenv.default.config({
8
+ path: `.env`
9
+ });
10
+ _commands.program.configureHelp({
11
+ sortSubcommands: true
12
+ });
13
+ void (0, _helpers.withCLIContext)(async () => {
14
+ _commands.program.parse(process.argv);
15
+ });
@@ -1,43 +1,9 @@
1
- export declare const templateIds: string[];
2
- export type TemplateId = (typeof templateIds)[number];
3
- /**
4
- * A simple, tree-like structure to describe the contents of a folder to be mounted.
5
- *
6
- * @example
7
- * ```
8
- * const tree = {
9
- * myproject: {
10
- * directory: {
11
- * 'foo.js': {
12
- * file: {
13
- * contents: 'const x = 1;',
14
- * },
15
- * },
16
- * .envrc: {
17
- * file: {
18
- * contents: 'ENVIRONMENT=staging'
19
- * }
20
- * },
21
- * },
22
- * },
23
- * emptyFolder: {
24
- * directory: {}
25
- * },
26
- * };
27
- * ```
28
- */
29
1
  export interface FileSystemTree {
30
2
  [name: string]: DirectoryNode | FileNode;
31
3
  }
32
- /**
33
- * Represents a directory, see {@link FileSystemTree}.
34
- */
35
4
  export interface DirectoryNode {
36
5
  directory: FileSystemTree;
37
6
  }
38
- /**
39
- * Represents a file, see {@link FileSystemTree}.
40
- */
41
7
  export interface FileNode {
42
8
  file: {
43
9
  /**
@@ -62,6 +28,7 @@ export type AuthSessionMetadata = {
62
28
  authSessionId: string;
63
29
  authSessionType: AuthSessionType;
64
30
  authSessionInput?: Record<string, any>;
31
+ authSessionProxy?: string;
65
32
  recorderStartUrl?: string;
66
33
  recorderEndUrl?: string;
67
34
  };
@@ -3,8 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.templateIds = exports.CHECK_FAILED_ERROR_MESSAGE = exports.ApiAuthSessionBehavior = void 0;
7
- const templateIds = exports.templateIds = ["default", "empty", "linkedin-recorder", "api-auth-sessions", "nested-scheduling", "ai-extractors", "npm-auth-sessions"];
6
+ exports.CHECK_FAILED_ERROR_MESSAGE = exports.ApiAuthSessionBehavior = void 0;
8
7
  let ApiAuthSessionBehavior = exports.ApiAuthSessionBehavior = function (ApiAuthSessionBehavior) {
9
8
  ApiAuthSessionBehavior["PERFORM_CHECK_AND_REFRESH"] = "PERFORM_CHECK_AND_REFRESH";
10
9
  ApiAuthSessionBehavior["SKIP_CHECK_AND_REFRESH"] = "SKIP_CHECK_AND_REFRESH";