@intuned/runtime-dev 1.3.8-jsonl.0 → 1.3.9-dev2

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 (208) hide show
  1. package/bin/common.js +24 -0
  2. package/bin/intuned +2 -0
  3. package/bin/intuned-api-run +2 -0
  4. package/dist/commands/common/utils/settings.js +3 -0
  5. package/dist/commands/intuned-cli/commands/authsession_record.command.d.ts +1 -1
  6. package/dist/commands/intuned-cli/commands/authsession_record.command.js +3 -2
  7. package/dist/commands/intuned-cli/controller/deploy.js +1 -1
  8. package/dist/commands/intuned-cli/controller/save.js +1 -1
  9. package/dist/common/settingsSchema.d.ts +13 -0
  10. package/dist/common/settingsSchema.js +6 -0
  11. package/package/dist/commands/api/run.d.ts +6 -0
  12. package/package/dist/commands/api/run.js +123 -0
  13. package/package/dist/commands/auth-sessions/load.d.ts +2 -0
  14. package/package/dist/commands/auth-sessions/load.js +35 -0
  15. package/package/dist/commands/auth-sessions/run-check.d.ts +2 -0
  16. package/package/dist/commands/auth-sessions/run-check.js +74 -0
  17. package/package/dist/commands/auth-sessions/run-create.d.ts +2 -0
  18. package/package/dist/commands/auth-sessions/run-create.js +78 -0
  19. package/package/dist/commands/browser/save-state.d.ts +2 -0
  20. package/package/dist/commands/browser/save-state.js +17 -0
  21. package/package/dist/commands/browser/start-browser.d.ts +2 -0
  22. package/package/dist/commands/browser/start-browser.js +14 -0
  23. package/package/dist/commands/build.d.ts +1 -0
  24. package/package/dist/commands/build.js +84 -0
  25. package/package/dist/commands/common/browserUtils.d.ts +14 -0
  26. package/package/dist/commands/common/browserUtils.js +58 -0
  27. package/package/dist/commands/common/getFirstLineNumber.d.ts +9 -0
  28. package/package/dist/commands/common/getFirstLineNumber.js +101 -0
  29. package/package/dist/commands/common/getFirstLineNumber.test.js +228 -0
  30. package/package/dist/commands/common/projectExclusions.d.ts +2 -0
  31. package/package/dist/commands/common/projectExclusions.js +8 -0
  32. package/package/dist/commands/common/sendMessageToClient.d.ts +1 -0
  33. package/package/dist/commands/common/sendMessageToClient.js +10 -0
  34. package/package/dist/commands/common/tsNodeImport.d.ts +2 -0
  35. package/package/dist/commands/common/tsNodeImport.js +34 -0
  36. package/package/dist/commands/common/utils/fileUtils.d.ts +6 -0
  37. package/package/dist/commands/common/utils/fileUtils.js +33 -0
  38. package/package/dist/commands/common/utils/settings.d.ts +2 -0
  39. package/package/dist/commands/common/utils/settings.js +31 -0
  40. package/package/dist/commands/common/utils/template.d.ts +2 -0
  41. package/package/dist/commands/common/utils/template.js +31 -0
  42. package/package/dist/commands/common/utils/unixSocket.d.ts +9 -0
  43. package/package/dist/commands/common/utils/unixSocket.js +44 -0
  44. package/package/dist/commands/interface/run.d.ts +1 -0
  45. package/package/dist/commands/interface/run.js +216 -0
  46. package/package/dist/commands/intuned-cli/commands/attempt.command.d.ts +1 -0
  47. package/package/dist/commands/intuned-cli/commands/attempt.command.js +8 -0
  48. package/package/dist/commands/intuned-cli/commands/attempt_api.command.d.ts +1 -0
  49. package/package/dist/commands/intuned-cli/commands/attempt_api.command.js +30 -0
  50. package/package/dist/commands/intuned-cli/commands/attempt_authsession.command.d.ts +1 -0
  51. package/package/dist/commands/intuned-cli/commands/attempt_authsession.command.js +8 -0
  52. package/package/dist/commands/intuned-cli/commands/attempt_authsession_check.command.d.ts +1 -0
  53. package/package/dist/commands/intuned-cli/commands/attempt_authsession_check.command.js +19 -0
  54. package/package/dist/commands/intuned-cli/commands/attempt_authsession_create.command.d.ts +1 -0
  55. package/package/dist/commands/intuned-cli/commands/attempt_authsession_create.command.js +24 -0
  56. package/package/dist/commands/intuned-cli/commands/authsession.command.d.ts +1 -0
  57. package/package/dist/commands/intuned-cli/commands/authsession.command.js +8 -0
  58. package/package/dist/commands/intuned-cli/commands/authsession_record.command.d.ts +1 -0
  59. package/package/dist/commands/intuned-cli/commands/authsession_record.command.js +31 -0
  60. package/package/dist/commands/intuned-cli/commands/build.command.d.ts +1 -0
  61. package/package/dist/commands/intuned-cli/commands/build.command.js +12 -0
  62. package/package/dist/commands/intuned-cli/commands/command.d.ts +2 -0
  63. package/package/dist/commands/intuned-cli/commands/command.js +9 -0
  64. package/package/dist/commands/intuned-cli/commands/deploy.command.d.ts +1 -0
  65. package/package/dist/commands/intuned-cli/commands/deploy.command.js +38 -0
  66. package/package/dist/commands/intuned-cli/commands/index.d.ts +18 -0
  67. package/package/dist/commands/intuned-cli/commands/index.js +203 -0
  68. package/package/dist/commands/intuned-cli/commands/init.command.d.ts +1 -0
  69. package/package/dist/commands/intuned-cli/commands/init.command.js +13 -0
  70. package/package/dist/commands/intuned-cli/commands/run.command.d.ts +1 -0
  71. package/package/dist/commands/intuned-cli/commands/run.command.js +8 -0
  72. package/package/dist/commands/intuned-cli/commands/run_api.command.d.ts +1 -0
  73. package/package/dist/commands/intuned-cli/commands/run_api.command.js +46 -0
  74. package/package/dist/commands/intuned-cli/commands/run_authsession.command.d.ts +28 -0
  75. package/package/dist/commands/intuned-cli/commands/run_authsession.command.js +17 -0
  76. package/package/dist/commands/intuned-cli/commands/run_authsession_create.command.d.ts +1 -0
  77. package/package/dist/commands/intuned-cli/commands/run_authsession_create.command.js +35 -0
  78. package/package/dist/commands/intuned-cli/commands/run_authsession_update.command.d.ts +1 -0
  79. package/package/dist/commands/intuned-cli/commands/run_authsession_update.command.js +35 -0
  80. package/package/dist/commands/intuned-cli/commands/run_authsession_validate.command.d.ts +1 -0
  81. package/package/dist/commands/intuned-cli/commands/run_authsession_validate.command.js +33 -0
  82. package/package/dist/commands/intuned-cli/commands/save.command.d.ts +13 -0
  83. package/package/dist/commands/intuned-cli/commands/save.command.js +42 -0
  84. package/package/dist/commands/intuned-cli/commands/types.d.ts +31 -0
  85. package/package/dist/commands/intuned-cli/commands/types.js +29 -0
  86. package/package/dist/commands/intuned-cli/constants/index.d.ts +17 -0
  87. package/package/dist/commands/intuned-cli/constants/index.js +25 -0
  88. package/package/dist/commands/intuned-cli/controller/__test__/api.test.js +397 -0
  89. package/package/dist/commands/intuned-cli/controller/__test__/authSession.test.js +1059 -0
  90. package/package/dist/commands/intuned-cli/controller/api.d.ts +42 -0
  91. package/package/dist/commands/intuned-cli/controller/api.js +189 -0
  92. package/package/dist/commands/intuned-cli/controller/authSession.d.ts +209 -0
  93. package/package/dist/commands/intuned-cli/controller/authSession.js +420 -0
  94. package/package/dist/commands/intuned-cli/controller/build.d.ts +1 -0
  95. package/package/dist/commands/intuned-cli/controller/build.js +36 -0
  96. package/package/dist/commands/intuned-cli/controller/deploy.d.ts +4 -0
  97. package/package/dist/commands/intuned-cli/controller/deploy.js +139 -0
  98. package/package/dist/commands/intuned-cli/controller/index.d.ts +1 -0
  99. package/package/dist/commands/intuned-cli/controller/index.js +46 -0
  100. package/package/dist/commands/intuned-cli/controller/save.d.ts +14 -0
  101. package/package/dist/commands/intuned-cli/controller/save.js +345 -0
  102. package/package/dist/commands/intuned-cli/helpers/__test__/browser.test.js +103 -0
  103. package/package/dist/commands/intuned-cli/helpers/__test__/tracing.test.js +40 -0
  104. package/package/dist/commands/intuned-cli/helpers/api.d.ts +3 -0
  105. package/package/dist/commands/intuned-cli/helpers/api.js +19 -0
  106. package/package/dist/commands/intuned-cli/helpers/auth.d.ts +46 -0
  107. package/package/dist/commands/intuned-cli/helpers/auth.js +144 -0
  108. package/package/dist/commands/intuned-cli/helpers/backend.d.ts +8 -0
  109. package/package/dist/commands/intuned-cli/helpers/backend.js +27 -0
  110. package/package/dist/commands/intuned-cli/helpers/browser.d.ts +14 -0
  111. package/package/dist/commands/intuned-cli/helpers/browser.js +57 -0
  112. package/package/dist/commands/intuned-cli/helpers/context.d.ts +3 -0
  113. package/package/dist/commands/intuned-cli/helpers/context.js +33 -0
  114. package/package/dist/commands/intuned-cli/helpers/errors.d.ts +13 -0
  115. package/package/dist/commands/intuned-cli/helpers/errors.js +37 -0
  116. package/package/dist/commands/intuned-cli/helpers/index.d.ts +12 -0
  117. package/package/dist/commands/intuned-cli/helpers/index.js +137 -0
  118. package/package/dist/commands/intuned-cli/helpers/intunedJson.d.ts +69 -0
  119. package/package/dist/commands/intuned-cli/helpers/intunedJson.js +71 -0
  120. package/package/dist/commands/intuned-cli/helpers/proxy.d.ts +5 -0
  121. package/package/dist/commands/intuned-cli/helpers/proxy.js +23 -0
  122. package/package/dist/commands/intuned-cli/helpers/terminal.d.ts +5 -0
  123. package/package/dist/commands/intuned-cli/helpers/terminal.js +13 -0
  124. package/package/dist/commands/intuned-cli/helpers/timeout.d.ts +1 -0
  125. package/package/dist/commands/intuned-cli/helpers/timeout.js +23 -0
  126. package/package/dist/commands/intuned-cli/helpers/traces.d.ts +2 -0
  127. package/package/dist/commands/intuned-cli/helpers/traces.js +32 -0
  128. package/package/dist/commands/intuned-cli/helpers/validation.d.ts +2 -0
  129. package/package/dist/commands/intuned-cli/helpers/validation.js +14 -0
  130. package/package/dist/commands/intuned-cli/helpers/wrapper.d.ts +2 -0
  131. package/package/dist/commands/intuned-cli/helpers/wrapper.js +60 -0
  132. package/package/dist/commands/intuned-cli/index.d.ts +1 -0
  133. package/package/dist/commands/intuned-cli/index.js +16 -0
  134. package/package/dist/commands/intuned-cli/main.d.ts +1 -0
  135. package/package/dist/commands/intuned-cli/main.js +22 -0
  136. package/package/dist/commands/intuned-cli/types.d.ts +41 -0
  137. package/package/dist/commands/intuned-cli/types.js +12 -0
  138. package/package/dist/commands/ts-check.d.ts +2 -0
  139. package/package/dist/commands/ts-check.js +56 -0
  140. package/package/dist/common/Logger/Logger/index.d.ts +12 -0
  141. package/package/dist/common/Logger/Logger/index.js +60 -0
  142. package/package/dist/common/Logger/Logger/types.d.ts +8 -0
  143. package/package/dist/common/Logger/Logger/types.js +5 -0
  144. package/package/dist/common/Logger/index.d.ts +12 -0
  145. package/package/dist/common/Logger/index.js +60 -0
  146. package/package/dist/common/Logger/types.d.ts +8 -0
  147. package/package/dist/common/Logger/types.js +5 -0
  148. package/package/dist/common/assets/browser_scripts.js +2580 -0
  149. package/package/dist/common/asyncLocalStorage/index.d.ts +16 -0
  150. package/package/dist/common/asyncLocalStorage/index.js +17 -0
  151. package/package/dist/common/backendFunctions/getAuthSessionParameters.d.ts +1 -0
  152. package/package/dist/common/backendFunctions/getAuthSessionParameters.js +38 -0
  153. package/package/dist/common/cleanEnvironmentVariables.d.ts +1 -0
  154. package/package/dist/common/cleanEnvironmentVariables.js +16 -0
  155. package/package/dist/common/constants.d.ts +10 -0
  156. package/package/dist/common/constants.js +16 -0
  157. package/package/dist/common/contextStorageStateHelpers.d.ts +21 -0
  158. package/package/dist/common/contextStorageStateHelpers.js +81 -0
  159. package/package/dist/common/extensionsHelpers.d.ts +8 -0
  160. package/package/dist/common/extensionsHelpers.js +80 -0
  161. package/package/dist/common/formatZodError.d.ts +2 -0
  162. package/package/dist/common/formatZodError.js +18 -0
  163. package/package/dist/common/jwtTokenManager.d.ts +17 -0
  164. package/package/dist/common/jwtTokenManager.js +109 -0
  165. package/package/dist/common/launchBrowser.d.ts +25 -0
  166. package/package/dist/common/launchBrowser.js +172 -0
  167. package/package/dist/common/playwrightContext.d.ts +31 -0
  168. package/package/dist/common/playwrightContext.js +144 -0
  169. package/package/dist/common/runApi/errors.d.ts +72 -0
  170. package/package/dist/common/runApi/errors.js +169 -0
  171. package/package/dist/common/runApi/importUsingImportFunction.d.ts +9 -0
  172. package/package/dist/common/runApi/importUsingImportFunction.js +46 -0
  173. package/package/dist/common/runApi/index.d.ts +11 -0
  174. package/package/dist/common/runApi/index.js +199 -0
  175. package/package/dist/common/runApi/types.d.ts +830 -0
  176. package/package/dist/common/runApi/types.js +73 -0
  177. package/package/dist/common/settingsSchema.d.ts +518 -0
  178. package/package/dist/common/settingsSchema.js +57 -0
  179. package/package/dist/common/setupContextHook.d.ts +17 -0
  180. package/package/dist/common/setupContextHook.js +22 -0
  181. package/package/dist/common/telemetry.d.ts +3 -0
  182. package/package/dist/common/telemetry.js +32 -0
  183. package/package/dist/index.d.ts +4 -0
  184. package/package/dist/index.js +69 -0
  185. package/package/dist/runtime/RunError.d.ts +5 -0
  186. package/package/dist/runtime/RunError.js +19 -0
  187. package/package/dist/runtime/attemptStore.d.ts +2 -0
  188. package/package/dist/runtime/attemptStore.js +23 -0
  189. package/package/dist/runtime/downloadDirectory.d.ts +1 -0
  190. package/package/dist/runtime/downloadDirectory.js +19 -0
  191. package/package/dist/runtime/enums.d.js +5 -0
  192. package/package/dist/runtime/enums.d.ts +11 -0
  193. package/package/dist/runtime/enums.js +18 -0
  194. package/package/dist/runtime/executionHelpers.test.js +52 -0
  195. package/package/dist/runtime/export.d.js +5 -0
  196. package/package/dist/runtime/export.d.ts +228 -0
  197. package/package/dist/runtime/extendPayload.d.ts +2 -0
  198. package/package/dist/runtime/extendPayload.js +21 -0
  199. package/package/dist/runtime/extendTimeout.d.ts +1 -0
  200. package/package/dist/runtime/extendTimeout.js +23 -0
  201. package/package/dist/runtime/getAuthSessionParameters.d.ts +1 -0
  202. package/package/dist/runtime/getAuthSessionParameters.js +20 -0
  203. package/package/dist/runtime/index.d.ts +7 -0
  204. package/package/dist/runtime/index.js +54 -0
  205. package/package/dist/runtime/runInfo.d.ts +2 -0
  206. package/package/dist/runtime/runInfo.js +21 -0
  207. package/package.json +1 -2
  208. package/WebTemplate.zip +0 -0
@@ -0,0 +1,830 @@
1
+ import type { StorageState } from "../contextStorageStateHelpers";
2
+ import type { Payload } from "../../runtime/export";
3
+ import type { Result } from "neverthrow";
4
+ import type { RunAutomationError } from "./errors";
5
+ import z from "zod";
6
+ export interface PayloadToAppend {
7
+ apiName: string;
8
+ parameters: Record<string, any>;
9
+ }
10
+ export interface RunAutomationSuccessResult {
11
+ result: any;
12
+ status: number;
13
+ payloadToAppend: PayloadToAppend[] | null;
14
+ session?: StorageState;
15
+ }
16
+ export interface RunAutomationErrorResult {
17
+ error: string;
18
+ message: string;
19
+ status?: number;
20
+ details?: any;
21
+ [key: string]: any;
22
+ }
23
+ export type RunAutomationResult = RunAutomationSuccessResult | RunAutomationErrorResult;
24
+ export interface RunAutomationResponse {
25
+ status: number;
26
+ body: RunAutomationResult;
27
+ }
28
+ export declare const runApiStorageStateSchema: z.ZodObject<{
29
+ cookies: z.ZodArray<z.ZodObject<{
30
+ name: z.ZodString;
31
+ value: z.ZodString;
32
+ domain: z.ZodString;
33
+ path: z.ZodString;
34
+ expires: z.ZodNumber;
35
+ httpOnly: z.ZodBoolean;
36
+ secure: z.ZodBoolean;
37
+ sameSite: z.ZodEnum<["Strict", "Lax", "None"]>;
38
+ }, "strip", z.ZodTypeAny, {
39
+ value: string;
40
+ name: string;
41
+ path: string;
42
+ domain: string;
43
+ expires: number;
44
+ httpOnly: boolean;
45
+ secure: boolean;
46
+ sameSite: "Strict" | "Lax" | "None";
47
+ }, {
48
+ value: string;
49
+ name: string;
50
+ path: string;
51
+ domain: string;
52
+ expires: number;
53
+ httpOnly: boolean;
54
+ secure: boolean;
55
+ sameSite: "Strict" | "Lax" | "None";
56
+ }>, "many">;
57
+ origins: z.ZodArray<z.ZodObject<{
58
+ origin: z.ZodString;
59
+ localStorage: z.ZodArray<z.ZodObject<{
60
+ name: z.ZodString;
61
+ value: z.ZodString;
62
+ }, "strip", z.ZodTypeAny, {
63
+ value: string;
64
+ name: string;
65
+ }, {
66
+ value: string;
67
+ name: string;
68
+ }>, "many">;
69
+ }, "strip", z.ZodTypeAny, {
70
+ origin: string;
71
+ localStorage: {
72
+ value: string;
73
+ name: string;
74
+ }[];
75
+ }, {
76
+ origin: string;
77
+ localStorage: {
78
+ value: string;
79
+ name: string;
80
+ }[];
81
+ }>, "many">;
82
+ sessionStorage: z.ZodOptional<z.ZodArray<z.ZodObject<{
83
+ origin: z.ZodString;
84
+ sessionStorage: z.ZodArray<z.ZodObject<{
85
+ name: z.ZodString;
86
+ value: z.ZodString;
87
+ }, "strip", z.ZodTypeAny, {
88
+ value: string;
89
+ name: string;
90
+ }, {
91
+ value: string;
92
+ name: string;
93
+ }>, "many">;
94
+ }, "strip", z.ZodTypeAny, {
95
+ sessionStorage: {
96
+ value: string;
97
+ name: string;
98
+ }[];
99
+ origin: string;
100
+ }, {
101
+ sessionStorage: {
102
+ value: string;
103
+ name: string;
104
+ }[];
105
+ origin: string;
106
+ }>, "many">>;
107
+ }, "strip", z.ZodTypeAny, {
108
+ cookies: {
109
+ value: string;
110
+ name: string;
111
+ path: string;
112
+ domain: string;
113
+ expires: number;
114
+ httpOnly: boolean;
115
+ secure: boolean;
116
+ sameSite: "Strict" | "Lax" | "None";
117
+ }[];
118
+ origins: {
119
+ origin: string;
120
+ localStorage: {
121
+ value: string;
122
+ name: string;
123
+ }[];
124
+ }[];
125
+ sessionStorage?: {
126
+ sessionStorage: {
127
+ value: string;
128
+ name: string;
129
+ }[];
130
+ origin: string;
131
+ }[] | undefined;
132
+ }, {
133
+ cookies: {
134
+ value: string;
135
+ name: string;
136
+ path: string;
137
+ domain: string;
138
+ expires: number;
139
+ httpOnly: boolean;
140
+ secure: boolean;
141
+ sameSite: "Strict" | "Lax" | "None";
142
+ }[];
143
+ origins: {
144
+ origin: string;
145
+ localStorage: {
146
+ value: string;
147
+ name: string;
148
+ }[];
149
+ }[];
150
+ sessionStorage?: {
151
+ sessionStorage: {
152
+ value: string;
153
+ name: string;
154
+ }[];
155
+ origin: string;
156
+ }[] | undefined;
157
+ }>;
158
+ export type RunApiStorageState = z.input<typeof runApiStorageStateSchema>;
159
+ export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
160
+ type: z.ZodLiteral<"file">;
161
+ path: z.ZodString;
162
+ }, "strip", z.ZodTypeAny, {
163
+ path: string;
164
+ type: "file";
165
+ }, {
166
+ path: string;
167
+ type: "file";
168
+ }>, z.ZodObject<{
169
+ type: z.ZodLiteral<"state">;
170
+ state: z.ZodOptional<z.ZodNullable<z.ZodObject<{
171
+ cookies: z.ZodArray<z.ZodObject<{
172
+ name: z.ZodString;
173
+ value: z.ZodString;
174
+ domain: z.ZodString;
175
+ path: z.ZodString;
176
+ expires: z.ZodNumber;
177
+ httpOnly: z.ZodBoolean;
178
+ secure: z.ZodBoolean;
179
+ sameSite: z.ZodEnum<["Strict", "Lax", "None"]>;
180
+ }, "strip", z.ZodTypeAny, {
181
+ value: string;
182
+ name: string;
183
+ path: string;
184
+ domain: string;
185
+ expires: number;
186
+ httpOnly: boolean;
187
+ secure: boolean;
188
+ sameSite: "Strict" | "Lax" | "None";
189
+ }, {
190
+ value: string;
191
+ name: string;
192
+ path: string;
193
+ domain: string;
194
+ expires: number;
195
+ httpOnly: boolean;
196
+ secure: boolean;
197
+ sameSite: "Strict" | "Lax" | "None";
198
+ }>, "many">;
199
+ origins: z.ZodArray<z.ZodObject<{
200
+ origin: z.ZodString;
201
+ localStorage: z.ZodArray<z.ZodObject<{
202
+ name: z.ZodString;
203
+ value: z.ZodString;
204
+ }, "strip", z.ZodTypeAny, {
205
+ value: string;
206
+ name: string;
207
+ }, {
208
+ value: string;
209
+ name: string;
210
+ }>, "many">;
211
+ }, "strip", z.ZodTypeAny, {
212
+ origin: string;
213
+ localStorage: {
214
+ value: string;
215
+ name: string;
216
+ }[];
217
+ }, {
218
+ origin: string;
219
+ localStorage: {
220
+ value: string;
221
+ name: string;
222
+ }[];
223
+ }>, "many">;
224
+ sessionStorage: z.ZodOptional<z.ZodArray<z.ZodObject<{
225
+ origin: z.ZodString;
226
+ sessionStorage: z.ZodArray<z.ZodObject<{
227
+ name: z.ZodString;
228
+ value: z.ZodString;
229
+ }, "strip", z.ZodTypeAny, {
230
+ value: string;
231
+ name: string;
232
+ }, {
233
+ value: string;
234
+ name: string;
235
+ }>, "many">;
236
+ }, "strip", z.ZodTypeAny, {
237
+ sessionStorage: {
238
+ value: string;
239
+ name: string;
240
+ }[];
241
+ origin: string;
242
+ }, {
243
+ sessionStorage: {
244
+ value: string;
245
+ name: string;
246
+ }[];
247
+ origin: string;
248
+ }>, "many">>;
249
+ }, "strip", z.ZodTypeAny, {
250
+ cookies: {
251
+ value: string;
252
+ name: string;
253
+ path: string;
254
+ domain: string;
255
+ expires: number;
256
+ httpOnly: boolean;
257
+ secure: boolean;
258
+ sameSite: "Strict" | "Lax" | "None";
259
+ }[];
260
+ origins: {
261
+ origin: string;
262
+ localStorage: {
263
+ value: string;
264
+ name: string;
265
+ }[];
266
+ }[];
267
+ sessionStorage?: {
268
+ sessionStorage: {
269
+ value: string;
270
+ name: string;
271
+ }[];
272
+ origin: string;
273
+ }[] | undefined;
274
+ }, {
275
+ cookies: {
276
+ value: string;
277
+ name: string;
278
+ path: string;
279
+ domain: string;
280
+ expires: number;
281
+ httpOnly: boolean;
282
+ secure: boolean;
283
+ sameSite: "Strict" | "Lax" | "None";
284
+ }[];
285
+ origins: {
286
+ origin: string;
287
+ localStorage: {
288
+ value: string;
289
+ name: string;
290
+ }[];
291
+ }[];
292
+ sessionStorage?: {
293
+ sessionStorage: {
294
+ value: string;
295
+ name: string;
296
+ }[];
297
+ origin: string;
298
+ }[] | undefined;
299
+ }>>>;
300
+ }, "strip", z.ZodTypeAny, {
301
+ type: "state";
302
+ state?: {
303
+ cookies: {
304
+ value: string;
305
+ name: string;
306
+ path: string;
307
+ domain: string;
308
+ expires: number;
309
+ httpOnly: boolean;
310
+ secure: boolean;
311
+ sameSite: "Strict" | "Lax" | "None";
312
+ }[];
313
+ origins: {
314
+ origin: string;
315
+ localStorage: {
316
+ value: string;
317
+ name: string;
318
+ }[];
319
+ }[];
320
+ sessionStorage?: {
321
+ sessionStorage: {
322
+ value: string;
323
+ name: string;
324
+ }[];
325
+ origin: string;
326
+ }[] | undefined;
327
+ } | null | undefined;
328
+ }, {
329
+ type: "state";
330
+ state?: {
331
+ cookies: {
332
+ value: string;
333
+ name: string;
334
+ path: string;
335
+ domain: string;
336
+ expires: number;
337
+ httpOnly: boolean;
338
+ secure: boolean;
339
+ sameSite: "Strict" | "Lax" | "None";
340
+ }[];
341
+ origins: {
342
+ origin: string;
343
+ localStorage: {
344
+ value: string;
345
+ name: string;
346
+ }[];
347
+ }[];
348
+ sessionStorage?: {
349
+ sessionStorage: {
350
+ value: string;
351
+ name: string;
352
+ }[];
353
+ origin: string;
354
+ }[] | undefined;
355
+ } | null | undefined;
356
+ }>]>;
357
+ export declare const runApiParametersSchema: z.ZodObject<{
358
+ automationFunction: z.ZodObject<{
359
+ name: z.ZodString;
360
+ params: z.ZodOptional<z.ZodAny>;
361
+ }, "strip", z.ZodTypeAny, {
362
+ name: string;
363
+ params?: any;
364
+ }, {
365
+ name: string;
366
+ params?: any;
367
+ }>;
368
+ tracing: z.ZodDefault<z.ZodOptional<z.ZodDiscriminatedUnion<"enabled", [z.ZodObject<{
369
+ enabled: z.ZodLiteral<false>;
370
+ }, "strip", z.ZodTypeAny, {
371
+ enabled: false;
372
+ }, {
373
+ enabled: false;
374
+ }>, z.ZodObject<{
375
+ enabled: z.ZodLiteral<true>;
376
+ filePath: z.ZodString;
377
+ }, "strip", z.ZodTypeAny, {
378
+ enabled: true;
379
+ filePath: string;
380
+ }, {
381
+ enabled: true;
382
+ filePath: string;
383
+ }>]>>>;
384
+ auth: z.ZodOptional<z.ZodObject<{
385
+ session: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
386
+ type: z.ZodLiteral<"file">;
387
+ path: z.ZodString;
388
+ }, "strip", z.ZodTypeAny, {
389
+ path: string;
390
+ type: "file";
391
+ }, {
392
+ path: string;
393
+ type: "file";
394
+ }>, z.ZodObject<{
395
+ type: z.ZodLiteral<"state">;
396
+ state: z.ZodOptional<z.ZodNullable<z.ZodObject<{
397
+ cookies: z.ZodArray<z.ZodObject<{
398
+ name: z.ZodString;
399
+ value: z.ZodString;
400
+ domain: z.ZodString;
401
+ path: z.ZodString;
402
+ expires: z.ZodNumber;
403
+ httpOnly: z.ZodBoolean;
404
+ secure: z.ZodBoolean;
405
+ sameSite: z.ZodEnum<["Strict", "Lax", "None"]>;
406
+ }, "strip", z.ZodTypeAny, {
407
+ value: string;
408
+ name: string;
409
+ path: string;
410
+ domain: string;
411
+ expires: number;
412
+ httpOnly: boolean;
413
+ secure: boolean;
414
+ sameSite: "Strict" | "Lax" | "None";
415
+ }, {
416
+ value: string;
417
+ name: string;
418
+ path: string;
419
+ domain: string;
420
+ expires: number;
421
+ httpOnly: boolean;
422
+ secure: boolean;
423
+ sameSite: "Strict" | "Lax" | "None";
424
+ }>, "many">;
425
+ origins: z.ZodArray<z.ZodObject<{
426
+ origin: z.ZodString;
427
+ localStorage: z.ZodArray<z.ZodObject<{
428
+ name: z.ZodString;
429
+ value: z.ZodString;
430
+ }, "strip", z.ZodTypeAny, {
431
+ value: string;
432
+ name: string;
433
+ }, {
434
+ value: string;
435
+ name: string;
436
+ }>, "many">;
437
+ }, "strip", z.ZodTypeAny, {
438
+ origin: string;
439
+ localStorage: {
440
+ value: string;
441
+ name: string;
442
+ }[];
443
+ }, {
444
+ origin: string;
445
+ localStorage: {
446
+ value: string;
447
+ name: string;
448
+ }[];
449
+ }>, "many">;
450
+ sessionStorage: z.ZodOptional<z.ZodArray<z.ZodObject<{
451
+ origin: z.ZodString;
452
+ sessionStorage: z.ZodArray<z.ZodObject<{
453
+ name: z.ZodString;
454
+ value: z.ZodString;
455
+ }, "strip", z.ZodTypeAny, {
456
+ value: string;
457
+ name: string;
458
+ }, {
459
+ value: string;
460
+ name: string;
461
+ }>, "many">;
462
+ }, "strip", z.ZodTypeAny, {
463
+ sessionStorage: {
464
+ value: string;
465
+ name: string;
466
+ }[];
467
+ origin: string;
468
+ }, {
469
+ sessionStorage: {
470
+ value: string;
471
+ name: string;
472
+ }[];
473
+ origin: string;
474
+ }>, "many">>;
475
+ }, "strip", z.ZodTypeAny, {
476
+ cookies: {
477
+ value: string;
478
+ name: string;
479
+ path: string;
480
+ domain: string;
481
+ expires: number;
482
+ httpOnly: boolean;
483
+ secure: boolean;
484
+ sameSite: "Strict" | "Lax" | "None";
485
+ }[];
486
+ origins: {
487
+ origin: string;
488
+ localStorage: {
489
+ value: string;
490
+ name: string;
491
+ }[];
492
+ }[];
493
+ sessionStorage?: {
494
+ sessionStorage: {
495
+ value: string;
496
+ name: string;
497
+ }[];
498
+ origin: string;
499
+ }[] | undefined;
500
+ }, {
501
+ cookies: {
502
+ value: string;
503
+ name: string;
504
+ path: string;
505
+ domain: string;
506
+ expires: number;
507
+ httpOnly: boolean;
508
+ secure: boolean;
509
+ sameSite: "Strict" | "Lax" | "None";
510
+ }[];
511
+ origins: {
512
+ origin: string;
513
+ localStorage: {
514
+ value: string;
515
+ name: string;
516
+ }[];
517
+ }[];
518
+ sessionStorage?: {
519
+ sessionStorage: {
520
+ value: string;
521
+ name: string;
522
+ }[];
523
+ origin: string;
524
+ }[] | undefined;
525
+ }>>>;
526
+ }, "strip", z.ZodTypeAny, {
527
+ type: "state";
528
+ state?: {
529
+ cookies: {
530
+ value: string;
531
+ name: string;
532
+ path: string;
533
+ domain: string;
534
+ expires: number;
535
+ httpOnly: boolean;
536
+ secure: boolean;
537
+ sameSite: "Strict" | "Lax" | "None";
538
+ }[];
539
+ origins: {
540
+ origin: string;
541
+ localStorage: {
542
+ value: string;
543
+ name: string;
544
+ }[];
545
+ }[];
546
+ sessionStorage?: {
547
+ sessionStorage: {
548
+ value: string;
549
+ name: string;
550
+ }[];
551
+ origin: string;
552
+ }[] | undefined;
553
+ } | null | undefined;
554
+ }, {
555
+ type: "state";
556
+ state?: {
557
+ cookies: {
558
+ value: string;
559
+ name: string;
560
+ path: string;
561
+ domain: string;
562
+ expires: number;
563
+ httpOnly: boolean;
564
+ secure: boolean;
565
+ sameSite: "Strict" | "Lax" | "None";
566
+ }[];
567
+ origins: {
568
+ origin: string;
569
+ localStorage: {
570
+ value: string;
571
+ name: string;
572
+ }[];
573
+ }[];
574
+ sessionStorage?: {
575
+ sessionStorage: {
576
+ value: string;
577
+ name: string;
578
+ }[];
579
+ origin: string;
580
+ }[] | undefined;
581
+ } | null | undefined;
582
+ }>]>;
583
+ }, "strip", z.ZodTypeAny, {
584
+ session: {
585
+ path: string;
586
+ type: "file";
587
+ } | {
588
+ type: "state";
589
+ state?: {
590
+ cookies: {
591
+ value: string;
592
+ name: string;
593
+ path: string;
594
+ domain: string;
595
+ expires: number;
596
+ httpOnly: boolean;
597
+ secure: boolean;
598
+ sameSite: "Strict" | "Lax" | "None";
599
+ }[];
600
+ origins: {
601
+ origin: string;
602
+ localStorage: {
603
+ value: string;
604
+ name: string;
605
+ }[];
606
+ }[];
607
+ sessionStorage?: {
608
+ sessionStorage: {
609
+ value: string;
610
+ name: string;
611
+ }[];
612
+ origin: string;
613
+ }[] | undefined;
614
+ } | null | undefined;
615
+ };
616
+ }, {
617
+ session: {
618
+ path: string;
619
+ type: "file";
620
+ } | {
621
+ type: "state";
622
+ state?: {
623
+ cookies: {
624
+ value: string;
625
+ name: string;
626
+ path: string;
627
+ domain: string;
628
+ expires: number;
629
+ httpOnly: boolean;
630
+ secure: boolean;
631
+ sameSite: "Strict" | "Lax" | "None";
632
+ }[];
633
+ origins: {
634
+ origin: string;
635
+ localStorage: {
636
+ value: string;
637
+ name: string;
638
+ }[];
639
+ }[];
640
+ sessionStorage?: {
641
+ sessionStorage: {
642
+ value: string;
643
+ name: string;
644
+ }[];
645
+ origin: string;
646
+ }[] | undefined;
647
+ } | null | undefined;
648
+ };
649
+ }>>;
650
+ runOptions: z.ZodDefault<z.ZodDiscriminatedUnion<"environment", [z.ZodObject<{
651
+ environment: z.ZodLiteral<"standalone">;
652
+ headless: z.ZodDefault<z.ZodBoolean>;
653
+ proxy: z.ZodOptional<z.ZodObject<{
654
+ server: z.ZodString;
655
+ username: z.ZodString;
656
+ password: z.ZodString;
657
+ }, "strip", z.ZodTypeAny, {
658
+ server: string;
659
+ username: string;
660
+ password: string;
661
+ }, {
662
+ server: string;
663
+ username: string;
664
+ password: string;
665
+ }>>;
666
+ }, "strip", z.ZodTypeAny, {
667
+ environment: "standalone";
668
+ headless: boolean;
669
+ proxy?: {
670
+ server: string;
671
+ username: string;
672
+ password: string;
673
+ } | undefined;
674
+ }, {
675
+ environment: "standalone";
676
+ headless?: boolean | undefined;
677
+ proxy?: {
678
+ server: string;
679
+ username: string;
680
+ password: string;
681
+ } | undefined;
682
+ }>, z.ZodObject<{
683
+ environment: z.ZodLiteral<"cdp">;
684
+ cdpAddress: z.ZodString;
685
+ }, "strip", z.ZodTypeAny, {
686
+ environment: "cdp";
687
+ cdpAddress: string;
688
+ }, {
689
+ environment: "cdp";
690
+ cdpAddress: string;
691
+ }>]>>;
692
+ retrieveSession: z.ZodDefault<z.ZodBoolean>;
693
+ }, "strip", z.ZodTypeAny, {
694
+ automationFunction: {
695
+ name: string;
696
+ params?: any;
697
+ };
698
+ tracing: {
699
+ enabled: false;
700
+ } | {
701
+ enabled: true;
702
+ filePath: string;
703
+ };
704
+ runOptions: {
705
+ environment: "standalone";
706
+ headless: boolean;
707
+ proxy?: {
708
+ server: string;
709
+ username: string;
710
+ password: string;
711
+ } | undefined;
712
+ } | {
713
+ environment: "cdp";
714
+ cdpAddress: string;
715
+ };
716
+ retrieveSession: boolean;
717
+ auth?: {
718
+ session: {
719
+ path: string;
720
+ type: "file";
721
+ } | {
722
+ type: "state";
723
+ state?: {
724
+ cookies: {
725
+ value: string;
726
+ name: string;
727
+ path: string;
728
+ domain: string;
729
+ expires: number;
730
+ httpOnly: boolean;
731
+ secure: boolean;
732
+ sameSite: "Strict" | "Lax" | "None";
733
+ }[];
734
+ origins: {
735
+ origin: string;
736
+ localStorage: {
737
+ value: string;
738
+ name: string;
739
+ }[];
740
+ }[];
741
+ sessionStorage?: {
742
+ sessionStorage: {
743
+ value: string;
744
+ name: string;
745
+ }[];
746
+ origin: string;
747
+ }[] | undefined;
748
+ } | null | undefined;
749
+ };
750
+ } | undefined;
751
+ }, {
752
+ automationFunction: {
753
+ name: string;
754
+ params?: any;
755
+ };
756
+ tracing?: {
757
+ enabled: false;
758
+ } | {
759
+ enabled: true;
760
+ filePath: string;
761
+ } | undefined;
762
+ auth?: {
763
+ session: {
764
+ path: string;
765
+ type: "file";
766
+ } | {
767
+ type: "state";
768
+ state?: {
769
+ cookies: {
770
+ value: string;
771
+ name: string;
772
+ path: string;
773
+ domain: string;
774
+ expires: number;
775
+ httpOnly: boolean;
776
+ secure: boolean;
777
+ sameSite: "Strict" | "Lax" | "None";
778
+ }[];
779
+ origins: {
780
+ origin: string;
781
+ localStorage: {
782
+ value: string;
783
+ name: string;
784
+ }[];
785
+ }[];
786
+ sessionStorage?: {
787
+ sessionStorage: {
788
+ value: string;
789
+ name: string;
790
+ }[];
791
+ origin: string;
792
+ }[] | undefined;
793
+ } | null | undefined;
794
+ };
795
+ } | undefined;
796
+ runOptions?: {
797
+ environment: "standalone";
798
+ headless?: boolean | undefined;
799
+ proxy?: {
800
+ server: string;
801
+ username: string;
802
+ password: string;
803
+ } | undefined;
804
+ } | {
805
+ environment: "cdp";
806
+ cdpAddress: string;
807
+ } | undefined;
808
+ retrieveSession?: boolean | undefined;
809
+ }>;
810
+ export type RunApiSession = z.infer<typeof runApiSessionSchema>;
811
+ export type RunApiParameters = z.input<typeof runApiParametersSchema>;
812
+ export type ImportFunctionError = {
813
+ type: "not_found";
814
+ } | {
815
+ type: "other";
816
+ error: any;
817
+ };
818
+ export type ExtendedRunApiParameters = RunApiParameters & {
819
+ abortSignal?: AbortSignal;
820
+ importFunction: (name: string) => Promise<Result<any, ImportFunctionError>>;
821
+ };
822
+ export type RunApiResultOk<R = any> = {
823
+ result: R;
824
+ extendedPayloads?: Payload[];
825
+ };
826
+ export type RunApiResultWithSessionOk<R = any> = RunApiResultOk<R> & {
827
+ session: RunApiStorageState;
828
+ };
829
+ export type RunApiResult<R = any, FullResult extends RunApiResultOk<R> = RunApiResultOk<R>> = Result<FullResult, RunAutomationError>;
830
+ export type { ImportFunction } from "./importUsingImportFunction";