@intuned/runtime-dev 1.2.0-dev-peer → 1.2.1-hooks.0

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 (148) hide show
  1. package/.babelrc +2 -2
  2. package/.npmrc.wtf +1 -0
  3. package/CHANGELOG.md +5 -1
  4. package/WebTemplate.zip +0 -0
  5. package/bin/intuned +2 -0
  6. package/dist/commands/api/run.js +10 -3
  7. package/dist/commands/auth-sessions/run-check.js +18 -4
  8. package/dist/commands/auth-sessions/run-create.js +2 -1
  9. package/dist/commands/common/browserUtils.d.ts +1 -1
  10. package/dist/commands/common/browserUtils.js +1 -1
  11. package/dist/commands/common/getFirstLineNumber.js +2 -4
  12. package/dist/commands/interface/run.js +7 -6
  13. package/dist/commands/intuned-cli/commands/attempt.command.d.ts +1 -0
  14. package/dist/commands/intuned-cli/commands/attempt.command.js +8 -0
  15. package/dist/commands/intuned-cli/commands/attempt_api.command.d.ts +1 -0
  16. package/dist/commands/intuned-cli/commands/attempt_api.command.js +40 -0
  17. package/dist/commands/intuned-cli/commands/attempt_authsession.command.d.ts +1 -0
  18. package/dist/commands/intuned-cli/commands/attempt_authsession.command.js +8 -0
  19. package/dist/commands/intuned-cli/commands/attempt_authsession_check.command.d.ts +1 -0
  20. package/dist/commands/intuned-cli/commands/attempt_authsession_check.command.js +24 -0
  21. package/dist/commands/intuned-cli/commands/attempt_authsession_create.command.d.ts +1 -0
  22. package/dist/commands/intuned-cli/commands/attempt_authsession_create.command.js +36 -0
  23. package/dist/commands/intuned-cli/commands/build.command.d.ts +1 -0
  24. package/dist/commands/intuned-cli/commands/build.command.js +12 -0
  25. package/dist/commands/intuned-cli/commands/command.d.ts +2 -0
  26. package/dist/commands/intuned-cli/commands/command.js +9 -0
  27. package/dist/commands/intuned-cli/commands/deploy.command.d.ts +1 -0
  28. package/dist/commands/intuned-cli/commands/deploy.command.js +46 -0
  29. package/dist/commands/intuned-cli/commands/index.d.ts +15 -0
  30. package/dist/commands/intuned-cli/commands/index.js +170 -0
  31. package/dist/commands/intuned-cli/commands/init.command.d.ts +1 -0
  32. package/dist/commands/intuned-cli/commands/init.command.js +13 -0
  33. package/dist/commands/intuned-cli/commands/run.command.d.ts +1 -0
  34. package/dist/commands/intuned-cli/commands/run.command.js +8 -0
  35. package/dist/commands/intuned-cli/commands/run_api.command.d.ts +1 -0
  36. package/dist/commands/intuned-cli/commands/run_api.command.js +54 -0
  37. package/dist/commands/intuned-cli/commands/run_authsession.command.d.ts +20 -0
  38. package/dist/commands/intuned-cli/commands/run_authsession.command.js +13 -0
  39. package/dist/commands/intuned-cli/commands/run_authsession_create.command.d.ts +1 -0
  40. package/dist/commands/intuned-cli/commands/run_authsession_create.command.js +39 -0
  41. package/dist/commands/intuned-cli/commands/run_authsession_update.command.d.ts +1 -0
  42. package/dist/commands/intuned-cli/commands/run_authsession_update.command.js +39 -0
  43. package/dist/commands/intuned-cli/commands/run_authsession_validate.command.d.ts +1 -0
  44. package/dist/commands/intuned-cli/commands/run_authsession_validate.command.js +37 -0
  45. package/dist/commands/intuned-cli/commands/types.d.ts +21 -0
  46. package/dist/commands/intuned-cli/commands/types.js +21 -0
  47. package/dist/commands/intuned-cli/constants/index.d.ts +17 -0
  48. package/dist/commands/intuned-cli/constants/index.js +25 -0
  49. package/dist/commands/intuned-cli/controller/__test__/api.test.js +280 -0
  50. package/dist/commands/intuned-cli/controller/__test__/authSession.test.js +676 -0
  51. package/dist/commands/intuned-cli/controller/api.d.ts +44 -0
  52. package/dist/commands/intuned-cli/controller/api.js +181 -0
  53. package/dist/commands/intuned-cli/controller/authSession.d.ts +198 -0
  54. package/dist/commands/intuned-cli/controller/authSession.js +292 -0
  55. package/dist/commands/intuned-cli/controller/build.d.ts +1 -0
  56. package/dist/commands/intuned-cli/controller/build.js +36 -0
  57. package/dist/commands/intuned-cli/controller/deploy.d.ts +15 -0
  58. package/dist/commands/{deploy/utils.js → intuned-cli/controller/deploy.js} +115 -109
  59. package/dist/commands/intuned-cli/controller/index.d.ts +1 -0
  60. package/dist/commands/intuned-cli/controller/index.js +46 -0
  61. package/dist/commands/intuned-cli/helpers/api.d.ts +3 -0
  62. package/dist/commands/intuned-cli/helpers/api.js +19 -0
  63. package/dist/commands/intuned-cli/helpers/auth.d.ts +41 -0
  64. package/dist/commands/intuned-cli/helpers/auth.js +129 -0
  65. package/dist/commands/intuned-cli/helpers/backend.d.ts +8 -0
  66. package/dist/commands/intuned-cli/helpers/backend.js +26 -0
  67. package/dist/commands/intuned-cli/helpers/context.d.ts +3 -0
  68. package/dist/commands/intuned-cli/helpers/context.js +33 -0
  69. package/dist/commands/intuned-cli/helpers/errors.d.ts +14 -0
  70. package/dist/commands/intuned-cli/helpers/errors.js +55 -0
  71. package/dist/commands/intuned-cli/helpers/index.d.ts +10 -0
  72. package/dist/commands/intuned-cli/helpers/index.js +115 -0
  73. package/dist/commands/intuned-cli/helpers/intunedJson.d.ts +1 -0
  74. package/dist/{common/cli/utils.js → commands/intuned-cli/helpers/intunedJson.js} +0 -16
  75. package/dist/commands/intuned-cli/helpers/proxy.d.ts +5 -0
  76. package/dist/commands/intuned-cli/helpers/proxy.js +23 -0
  77. package/dist/commands/intuned-cli/helpers/terminal.d.ts +5 -0
  78. package/dist/commands/intuned-cli/helpers/terminal.js +13 -0
  79. package/dist/commands/intuned-cli/helpers/timeout.d.ts +1 -0
  80. package/dist/commands/intuned-cli/helpers/timeout.js +23 -0
  81. package/dist/commands/intuned-cli/helpers/validation.d.ts +2 -0
  82. package/dist/commands/intuned-cli/helpers/validation.js +12 -0
  83. package/dist/commands/intuned-cli/index.d.ts +1 -0
  84. package/dist/commands/intuned-cli/index.js +16 -0
  85. package/dist/commands/intuned-cli/main.d.ts +1 -0
  86. package/dist/commands/intuned-cli/main.js +15 -0
  87. package/dist/{common/cli → commands/intuned-cli}/types.d.ts +1 -34
  88. package/dist/{common/cli → commands/intuned-cli}/types.js +1 -2
  89. package/dist/common/assets/browser_scripts.js +2509 -2143
  90. package/dist/common/asyncLocalStorage/index.d.ts +2 -2
  91. package/dist/common/backendFunctions/getAuthSessionParameters.d.ts +1 -0
  92. package/dist/common/backendFunctions/getAuthSessionParameters.js +38 -0
  93. package/dist/common/constants.d.ts +1 -0
  94. package/dist/common/constants.js +2 -1
  95. package/dist/common/getPlaywrightConstructs.d.ts +6 -5
  96. package/dist/common/getPlaywrightConstructs.js +73 -37
  97. package/dist/common/jwtTokenManager.js +3 -5
  98. package/dist/common/runApi/errors.d.ts +1 -1
  99. package/dist/common/runApi/errors.js +4 -5
  100. package/dist/common/runApi/index.d.ts +4 -1
  101. package/dist/common/runApi/index.js +22 -21
  102. package/dist/common/runApi/types.d.ts +144 -13
  103. package/dist/common/runApi/types.js +28 -27
  104. package/dist/index.d.ts +1 -1
  105. package/dist/index.js +6 -0
  106. package/dist/runtime/executionHelpers.test.js +3 -4
  107. package/dist/runtime/export.d.ts +18 -0
  108. package/dist/runtime/extendPayload.js +1 -1
  109. package/dist/runtime/extendTimeout.js +0 -7
  110. package/dist/runtime/getAuthSessionParameters.d.ts +1 -0
  111. package/dist/runtime/getAuthSessionParameters.js +20 -0
  112. package/dist/runtime/getCdpAddress.d.ts +1 -0
  113. package/dist/runtime/getCdpAddress.js +11 -0
  114. package/dist/runtime/index.d.ts +2 -0
  115. package/dist/runtime/index.js +15 -1
  116. package/package.json +11 -10
  117. package/template.tsconfig.json +4 -7
  118. package/tsconfig.json +2 -1
  119. package/bin/check-auth-session +0 -3
  120. package/bin/cli-build +0 -3
  121. package/bin/create-auth-session +0 -3
  122. package/bin/deploy +0 -3
  123. package/bin/init +0 -3
  124. package/bin/run-api +0 -3
  125. package/dist/commands/cli-auth-sessions/check.d.ts +0 -2
  126. package/dist/commands/cli-auth-sessions/check.js +0 -40
  127. package/dist/commands/cli-auth-sessions/create.d.ts +0 -2
  128. package/dist/commands/cli-auth-sessions/create.js +0 -53
  129. package/dist/commands/cli-auth-sessions/utils.d.ts +0 -28
  130. package/dist/commands/cli-auth-sessions/utils.js +0 -285
  131. package/dist/commands/cli-build/cli-build.d.ts +0 -2
  132. package/dist/commands/cli-build/cli-build.js +0 -20
  133. package/dist/commands/deploy/deploy.d.ts +0 -2
  134. package/dist/commands/deploy/deploy.js +0 -47
  135. package/dist/commands/deploy/utils.d.ts +0 -16
  136. package/dist/commands/init/init.d.ts +0 -2
  137. package/dist/commands/init/init.js +0 -22
  138. package/dist/commands/init/utils.d.ts +0 -11
  139. package/dist/commands/init/utils.js +0 -181
  140. package/dist/commands/run-api-cli/run-api.d.ts +0 -2
  141. package/dist/commands/run-api-cli/run-api.js +0 -57
  142. package/dist/commands/run-api-cli/utils.d.ts +0 -9
  143. package/dist/commands/run-api-cli/utils.js +0 -144
  144. package/dist/common/cli/cliReadme.d.ts +0 -1
  145. package/dist/common/cli/cliReadme.js +0 -92
  146. package/dist/common/cli/constants.d.ts +0 -33
  147. package/dist/common/cli/constants.js +0 -39
  148. package/dist/common/cli/utils.d.ts +0 -6
@@ -0,0 +1,170 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _command = require("./command");
7
+ Object.keys(_command).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _command[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _command[key];
14
+ }
15
+ });
16
+ });
17
+ var _build = require("./build.command");
18
+ Object.keys(_build).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _build[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _build[key];
25
+ }
26
+ });
27
+ });
28
+ var _deploy = require("./deploy.command");
29
+ Object.keys(_deploy).forEach(function (key) {
30
+ if (key === "default" || key === "__esModule") return;
31
+ if (key in exports && exports[key] === _deploy[key]) return;
32
+ Object.defineProperty(exports, key, {
33
+ enumerable: true,
34
+ get: function () {
35
+ return _deploy[key];
36
+ }
37
+ });
38
+ });
39
+ var _init = require("./init.command");
40
+ Object.keys(_init).forEach(function (key) {
41
+ if (key === "default" || key === "__esModule") return;
42
+ if (key in exports && exports[key] === _init[key]) return;
43
+ Object.defineProperty(exports, key, {
44
+ enumerable: true,
45
+ get: function () {
46
+ return _init[key];
47
+ }
48
+ });
49
+ });
50
+ var _run = require("./run.command");
51
+ Object.keys(_run).forEach(function (key) {
52
+ if (key === "default" || key === "__esModule") return;
53
+ if (key in exports && exports[key] === _run[key]) return;
54
+ Object.defineProperty(exports, key, {
55
+ enumerable: true,
56
+ get: function () {
57
+ return _run[key];
58
+ }
59
+ });
60
+ });
61
+ var _run_api = require("./run_api.command");
62
+ Object.keys(_run_api).forEach(function (key) {
63
+ if (key === "default" || key === "__esModule") return;
64
+ if (key in exports && exports[key] === _run_api[key]) return;
65
+ Object.defineProperty(exports, key, {
66
+ enumerable: true,
67
+ get: function () {
68
+ return _run_api[key];
69
+ }
70
+ });
71
+ });
72
+ var _run_authsession = require("./run_authsession.command");
73
+ Object.keys(_run_authsession).forEach(function (key) {
74
+ if (key === "default" || key === "__esModule") return;
75
+ if (key in exports && exports[key] === _run_authsession[key]) return;
76
+ Object.defineProperty(exports, key, {
77
+ enumerable: true,
78
+ get: function () {
79
+ return _run_authsession[key];
80
+ }
81
+ });
82
+ });
83
+ var _run_authsession_create = require("./run_authsession_create.command");
84
+ Object.keys(_run_authsession_create).forEach(function (key) {
85
+ if (key === "default" || key === "__esModule") return;
86
+ if (key in exports && exports[key] === _run_authsession_create[key]) return;
87
+ Object.defineProperty(exports, key, {
88
+ enumerable: true,
89
+ get: function () {
90
+ return _run_authsession_create[key];
91
+ }
92
+ });
93
+ });
94
+ var _run_authsession_update = require("./run_authsession_update.command");
95
+ Object.keys(_run_authsession_update).forEach(function (key) {
96
+ if (key === "default" || key === "__esModule") return;
97
+ if (key in exports && exports[key] === _run_authsession_update[key]) return;
98
+ Object.defineProperty(exports, key, {
99
+ enumerable: true,
100
+ get: function () {
101
+ return _run_authsession_update[key];
102
+ }
103
+ });
104
+ });
105
+ var _run_authsession_validate = require("./run_authsession_validate.command");
106
+ Object.keys(_run_authsession_validate).forEach(function (key) {
107
+ if (key === "default" || key === "__esModule") return;
108
+ if (key in exports && exports[key] === _run_authsession_validate[key]) return;
109
+ Object.defineProperty(exports, key, {
110
+ enumerable: true,
111
+ get: function () {
112
+ return _run_authsession_validate[key];
113
+ }
114
+ });
115
+ });
116
+ var _attempt = require("./attempt.command");
117
+ Object.keys(_attempt).forEach(function (key) {
118
+ if (key === "default" || key === "__esModule") return;
119
+ if (key in exports && exports[key] === _attempt[key]) return;
120
+ Object.defineProperty(exports, key, {
121
+ enumerable: true,
122
+ get: function () {
123
+ return _attempt[key];
124
+ }
125
+ });
126
+ });
127
+ var _attempt_api = require("./attempt_api.command");
128
+ Object.keys(_attempt_api).forEach(function (key) {
129
+ if (key === "default" || key === "__esModule") return;
130
+ if (key in exports && exports[key] === _attempt_api[key]) return;
131
+ Object.defineProperty(exports, key, {
132
+ enumerable: true,
133
+ get: function () {
134
+ return _attempt_api[key];
135
+ }
136
+ });
137
+ });
138
+ var _attempt_authsession = require("./attempt_authsession.command");
139
+ Object.keys(_attempt_authsession).forEach(function (key) {
140
+ if (key === "default" || key === "__esModule") return;
141
+ if (key in exports && exports[key] === _attempt_authsession[key]) return;
142
+ Object.defineProperty(exports, key, {
143
+ enumerable: true,
144
+ get: function () {
145
+ return _attempt_authsession[key];
146
+ }
147
+ });
148
+ });
149
+ var _attempt_authsession_create = require("./attempt_authsession_create.command");
150
+ Object.keys(_attempt_authsession_create).forEach(function (key) {
151
+ if (key === "default" || key === "__esModule") return;
152
+ if (key in exports && exports[key] === _attempt_authsession_create[key]) return;
153
+ Object.defineProperty(exports, key, {
154
+ enumerable: true,
155
+ get: function () {
156
+ return _attempt_authsession_create[key];
157
+ }
158
+ });
159
+ });
160
+ var _attempt_authsession_check = require("./attempt_authsession_check.command");
161
+ Object.keys(_attempt_authsession_check).forEach(function (key) {
162
+ if (key === "default" || key === "__esModule") return;
163
+ if (key in exports && exports[key] === _attempt_authsession_check[key]) return;
164
+ Object.defineProperty(exports, key, {
165
+ enumerable: true,
166
+ get: function () {
167
+ return _attempt_authsession_check[key];
168
+ }
169
+ });
170
+ });
@@ -0,0 +1 @@
1
+ export declare const initCommand: import("commander").Command;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.initCommand = void 0;
7
+ var _command = require("./command");
8
+ var _helpers = require("../helpers");
9
+ const initCommand = exports.initCommand = _command.program.command("init").description("Deprecated: Initialize a new Intuned project").allowExcessArguments(true).allowUnknownOption(true).action((0, _helpers.withErrorLogging)(async () => {
10
+ throw new _helpers.CLIError("^r^+The init command has been deprecated. Please use^ ^c^/npx create-intuned-project^ ^r^+instead.^:", {
11
+ autoColor: false
12
+ });
13
+ }));
@@ -0,0 +1 @@
1
+ export declare const runCommand: import("commander").Command;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.runCommand = void 0;
7
+ var _command = require("./command");
8
+ const runCommand = exports.runCommand = _command.program.command("run").description("Execute an Intuned run");
@@ -0,0 +1 @@
1
+ export declare const runApiCommand: import("commander").Command;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.runApiCommand = void 0;
7
+ var _run = require("./run.command");
8
+ var _api = require("../controller/api");
9
+ var _controller = require("../controller");
10
+ var _zod = require("zod");
11
+ var _types = require("./types");
12
+ var _helpers = require("../helpers");
13
+ const runApiCommandInputSchema = _zod.z.tuple([_zod.z.string().min(1, "API name is required"), _zod.z.string().min(1, "Parameters are required"), _types.baseCommandOptionsSchema.extend({
14
+ retries: _zod.z.coerce.number().default(1),
15
+ authSession: _zod.z.string().optional(),
16
+ authSessionAutoRecreate: _zod.z.boolean().default(true),
17
+ outputFile: _zod.z.string().optional(),
18
+ authSessionCheckAttempts: _types.authSessionCheckAttemptsSchema,
19
+ authSessionCreateAttempts: _types.authSessionCreateAttemptsSchema
20
+ })]);
21
+ const runApiCommand = exports.runApiCommand = _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("--proxy <url>", "proxy URL to use").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("--timeout <time>", "timeout - milliseconds or ms-formatted string", "10 mins").option("--headless", "Run the API in headless mode (default: false). This will not open a browser window.").option("-o, --output-file <path>", "output file path").action((0, _helpers.withErrorLogging)(async (inputApiName, inputParameters, inputOptions) => {
22
+ const parseResult = runApiCommandInputSchema.safeParse([inputApiName, inputParameters, inputOptions]);
23
+ if (!parseResult.success) {
24
+ return (0, _helpers.logInvalidInput)(parseResult);
25
+ }
26
+ const [apiName, parameters, {
27
+ retries,
28
+ headless,
29
+ timeout,
30
+ outputFile,
31
+ proxy,
32
+ authSession,
33
+ authSessionAutoRecreate,
34
+ authSessionCreateAttempts,
35
+ authSessionCheckAttempts
36
+ }] = parseResult.data;
37
+ await (0, _helpers.assertAuthConsistent)(authSession);
38
+ const inputData = await (0, _controller.loadParameters)(parameters);
39
+ await (0, _api.executeRunApiCLI)({
40
+ apiName,
41
+ inputData: inputData,
42
+ authSession: authSession ? {
43
+ id: authSession,
44
+ autoRecreate: authSessionAutoRecreate,
45
+ checkRetries: authSessionCheckAttempts,
46
+ createRetries: authSessionCreateAttempts
47
+ } : undefined,
48
+ retries,
49
+ outputFile,
50
+ proxy,
51
+ headless,
52
+ timeout
53
+ });
54
+ }));
@@ -0,0 +1,20 @@
1
+ export declare const baseRunAuthSessionCommandOptionsSchema: import("zod").ZodObject<{
2
+ proxy: import("zod").ZodOptional<import("zod").ZodString>;
3
+ headless: import("zod").ZodDefault<import("zod").ZodBoolean>;
4
+ timeout: import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodDefault<import("zod").ZodString>, import("ms").StringValue, string | undefined>, number, string | undefined>;
5
+ checkAttempts: import("zod").ZodDefault<import("zod").ZodNumber>;
6
+ createAttempts: import("zod").ZodDefault<import("zod").ZodNumber>;
7
+ }, "strip", import("zod").ZodTypeAny, {
8
+ headless: boolean;
9
+ timeout: number;
10
+ checkAttempts: number;
11
+ createAttempts: number;
12
+ proxy?: string | undefined;
13
+ }, {
14
+ proxy?: string | undefined;
15
+ headless?: boolean | undefined;
16
+ timeout?: string | undefined;
17
+ checkAttempts?: number | undefined;
18
+ createAttempts?: number | undefined;
19
+ }>;
20
+ export declare const runAuthSessionCommand: import("commander").Command;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.runAuthSessionCommand = exports.baseRunAuthSessionCommandOptionsSchema = void 0;
7
+ var _types = require("./types");
8
+ var _run = require("./run.command");
9
+ const baseRunAuthSessionCommandOptionsSchema = exports.baseRunAuthSessionCommandOptionsSchema = _types.baseCommandOptionsSchema.extend({
10
+ checkAttempts: _types.authSessionCheckAttemptsSchema,
11
+ createAttempts: _types.authSessionCreateAttemptsSchema
12
+ });
13
+ const runAuthSessionCommand = exports.runAuthSessionCommand = _run.runCommand.command("authsession").description("Manage authentication sessions");
@@ -0,0 +1 @@
1
+ export declare const runAuthSessionCreateCommand: import("commander").Command;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.runAuthSessionCreateCommand = void 0;
7
+ var _controller = require("../controller");
8
+ var _zod = require("zod");
9
+ var _authSession = require("../controller/authSession");
10
+ var _run_authsession = require("./run_authsession.command");
11
+ var _helpers = require("../helpers");
12
+ const runAuthSessionCreateInputSchema = _zod.z.tuple([_zod.z.string().min(1, "Parameters are required"), _run_authsession.baseRunAuthSessionCommandOptionsSchema.extend({
13
+ id: _zod.z.string().optional()
14
+ })]);
15
+ const runAuthSessionCreateCommand = exports.runAuthSessionCreateCommand = _run_authsession.runAuthSessionCommand.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-[current timestamp]").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").option("--proxy <url>", "Proxy URL to use for the auth session command").option("--timeout <time>", "Timeout for the auth session command - milliseconds or ms-formatted string", "10 mins").option("--headless", "Run the API in headless mode (default: false). This will not open a browser window.").action((0, _helpers.withErrorLogging)(async (inputParameters, inputOptions) => {
16
+ const parseResult = runAuthSessionCreateInputSchema.safeParse([inputParameters, inputOptions]);
17
+ if (!parseResult.success) {
18
+ return (0, _helpers.logInvalidInput)(parseResult);
19
+ }
20
+ const [parameters, {
21
+ checkAttempts,
22
+ createAttempts,
23
+ id,
24
+ proxy,
25
+ timeout,
26
+ headless
27
+ }] = parseResult.data;
28
+ await (0, _helpers.assertAuthEnabled)();
29
+ const authSessionInput = (await (0, _controller.loadParameters)(parameters)) ?? {};
30
+ await (0, _authSession.executeRunCreateAuthSessionCLI)({
31
+ id,
32
+ checkRetries: checkAttempts,
33
+ createRetries: createAttempts,
34
+ input: authSessionInput,
35
+ headless,
36
+ proxy,
37
+ timeout
38
+ });
39
+ }));
@@ -0,0 +1 @@
1
+ export declare const runAuthSessionUpdateCommand: import("commander").Command;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.runAuthSessionUpdateCommand = void 0;
7
+ var _controller = require("../controller");
8
+ var _zod = require("zod");
9
+ var _authSession = require("../controller/authSession");
10
+ var _run_authsession = require("./run_authsession.command");
11
+ var _helpers = require("../helpers");
12
+ const runAuthSessionUpdateSchema = _zod.z.tuple([_zod.z.string().min(1, "ID of the auth session is required"), _run_authsession.baseRunAuthSessionCommandOptionsSchema.extend({
13
+ parameters: _zod.z.string().optional()
14
+ })]);
15
+ const runAuthSessionUpdateCommand = exports.runAuthSessionUpdateCommand = _run_authsession.runAuthSessionCommand.command("update").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").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").option("--proxy <url>", "Proxy URL to use for the auth session command").option("--timeout <time>", "Timeout for the auth session command - milliseconds or ms-formatted string", "10 mins").option("--headless", "Run the API in headless mode (default: false). This will not open a browser window.").action((0, _helpers.withErrorLogging)(async (inputId, inputOptions) => {
16
+ const parseResult = runAuthSessionUpdateSchema.safeParse([inputId, inputOptions]);
17
+ if (!parseResult.success) {
18
+ return (0, _helpers.logInvalidInput)(parseResult);
19
+ }
20
+ const [id, {
21
+ checkAttempts,
22
+ createAttempts,
23
+ parameters,
24
+ proxy,
25
+ timeout,
26
+ headless
27
+ }] = parseResult.data;
28
+ await (0, _helpers.assertAuthEnabled)();
29
+ const authSessionInput = parameters ? await (0, _controller.loadParameters)(parameters) : undefined;
30
+ await (0, _authSession.executeRunUpdateAuthSessionCLI)({
31
+ id,
32
+ input: authSessionInput,
33
+ checkRetries: checkAttempts,
34
+ createRetries: createAttempts,
35
+ headless,
36
+ proxy,
37
+ timeout
38
+ });
39
+ }));
@@ -0,0 +1 @@
1
+ export declare const runAuthSessionValidateCommand: import("commander").Command;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.runAuthSessionValidateCommand = void 0;
7
+ var _zod = require("zod");
8
+ var _authSession = require("../controller/authSession");
9
+ var _run_authsession = require("./run_authsession.command");
10
+ var _helpers = require("../helpers");
11
+ const runAuthSessionValidateSchema = _zod.z.tuple([_zod.z.string().min(1, "ID of the auth session is required"), _run_authsession.baseRunAuthSessionCommandOptionsSchema.extend({
12
+ autoRecreate: _zod.z.boolean().default(true)
13
+ })]);
14
+ const runAuthSessionValidateCommand = exports.runAuthSessionValidateCommand = _run_authsession.runAuthSessionCommand.command("validate").description("Validate an existing auth session").argument("<id>", "ID of the auth session to validate").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").option("--proxy <url>", "Proxy URL to use for the auth session command").option("--timeout <time>", "Timeout for the auth session command - milliseconds or ms-formatted string", "10 mins").option("--no-auto-recreate", "Disable auto recreation of the auth session if it is invalid").option("--headless", "Run the API in headless mode (default: false). This will not open a browser window.").action((0, _helpers.withErrorLogging)(async (inputId, inputOptions) => {
15
+ const parseResult = runAuthSessionValidateSchema.safeParse([inputId, inputOptions]);
16
+ if (!parseResult.success) {
17
+ return (0, _helpers.logInvalidInput)(parseResult);
18
+ }
19
+ const [id, {
20
+ autoRecreate,
21
+ checkAttempts,
22
+ createAttempts,
23
+ headless,
24
+ proxy,
25
+ timeout
26
+ }] = parseResult.data;
27
+ await (0, _helpers.assertAuthEnabled)();
28
+ await (0, _authSession.executeRunValidateAuthSessionCLI)({
29
+ id,
30
+ autoRecreate,
31
+ checkRetries: checkAttempts,
32
+ createRetries: createAttempts,
33
+ headless,
34
+ proxy,
35
+ timeout
36
+ });
37
+ }));
@@ -0,0 +1,21 @@
1
+ import ms from "ms";
2
+ import { z } from "zod";
3
+ export declare const authSessionCheckAttemptsSchema: z.ZodDefault<z.ZodNumber>;
4
+ export declare const authSessionCreateAttemptsSchema: z.ZodDefault<z.ZodNumber>;
5
+ export declare const proxySchema: z.ZodOptional<z.ZodString>;
6
+ export declare const timeoutSchema: z.ZodEffects<z.ZodEffects<z.ZodDefault<z.ZodString>, ms.StringValue, string | undefined>, number, string | undefined>;
7
+ export declare const headlessSchema: z.ZodDefault<z.ZodBoolean>;
8
+ export declare const baseCommandOptionsSchema: z.ZodObject<{
9
+ proxy: z.ZodOptional<z.ZodString>;
10
+ timeout: z.ZodEffects<z.ZodEffects<z.ZodDefault<z.ZodString>, ms.StringValue, string | undefined>, number, string | undefined>;
11
+ headless: z.ZodDefault<z.ZodBoolean>;
12
+ }, "strip", z.ZodTypeAny, {
13
+ headless: boolean;
14
+ timeout: number;
15
+ proxy?: string | undefined;
16
+ }, {
17
+ proxy?: string | undefined;
18
+ timeout?: string | undefined;
19
+ headless?: boolean | undefined;
20
+ }>;
21
+ export type BaseCommandOptions = z.infer<typeof baseCommandOptionsSchema>;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.timeoutSchema = exports.proxySchema = exports.headlessSchema = exports.baseCommandOptionsSchema = exports.authSessionCreateAttemptsSchema = exports.authSessionCheckAttemptsSchema = void 0;
7
+ var _ms = _interopRequireDefault(require("ms"));
8
+ var _zod = require("zod");
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ const authSessionCheckAttemptsSchema = exports.authSessionCheckAttemptsSchema = _zod.z.coerce.number().int().min(1, "Auth session check attempts must be at least 1").default(1);
11
+ const authSessionCreateAttemptsSchema = exports.authSessionCreateAttemptsSchema = _zod.z.coerce.number().int().min(1, "Auth session create attempts must be at least 1").default(1);
12
+ const proxySchema = exports.proxySchema = _zod.z.string().url("--proxy must be a valid URL").optional();
13
+ const timeoutSchema = exports.timeoutSchema = _zod.z.string().default("10 mins").refine(val => {
14
+ return (0, _ms.default)(val) !== undefined;
15
+ }, "--timeout must be a valid integer or ms-formatted string").transform(val => (0, _ms.default)(val));
16
+ const headlessSchema = exports.headlessSchema = _zod.z.boolean().default(false);
17
+ const baseCommandOptionsSchema = exports.baseCommandOptionsSchema = _zod.z.object({
18
+ proxy: proxySchema,
19
+ timeout: timeoutSchema,
20
+ headless: headlessSchema
21
+ });
@@ -0,0 +1,17 @@
1
+ export declare const CURRENT_PLAYWRIGHT_VERSION = "1.44.1";
2
+ export declare const ProjectDeploymentStatus: readonly ["completed", "failed", "pending", "not_found"];
3
+ export declare const PROJECT_DEPLOY_TIMEOUT: number;
4
+ export declare const PROJECT_DEPLOY_CHECK_PERIOD: number;
5
+ export declare const tsConfigCli: {
6
+ compilerOptions: {
7
+ moduleResolution: string;
8
+ module: string;
9
+ target: string;
10
+ outDir: string;
11
+ sourceMap: boolean;
12
+ declaration: boolean;
13
+ esModuleInterop: boolean;
14
+ };
15
+ include: string[];
16
+ exclude: string[];
17
+ };
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.tsConfigCli = exports.ProjectDeploymentStatus = exports.PROJECT_DEPLOY_TIMEOUT = exports.PROJECT_DEPLOY_CHECK_PERIOD = exports.CURRENT_PLAYWRIGHT_VERSION = void 0;
7
+ var _ms = _interopRequireDefault(require("ms"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+ const CURRENT_PLAYWRIGHT_VERSION = exports.CURRENT_PLAYWRIGHT_VERSION = "1.44.1";
10
+ const ProjectDeploymentStatus = exports.ProjectDeploymentStatus = ["completed", "failed", "pending", "not_found"];
11
+ const PROJECT_DEPLOY_TIMEOUT = exports.PROJECT_DEPLOY_TIMEOUT = (0, _ms.default)("10 minutes");
12
+ const PROJECT_DEPLOY_CHECK_PERIOD = exports.PROJECT_DEPLOY_CHECK_PERIOD = (0, _ms.default)("5 seconds");
13
+ const tsConfigCli = exports.tsConfigCli = {
14
+ compilerOptions: {
15
+ moduleResolution: "NodeNext",
16
+ module: "NodeNext",
17
+ target: "ES2021",
18
+ outDir: "./dist",
19
+ sourceMap: false,
20
+ declaration: true,
21
+ esModuleInterop: true
22
+ },
23
+ include: ["**/*.ts"],
24
+ exclude: ["node_modules", "dist"]
25
+ };