@intuned/runtime-dev 0.1.0-test.31 → 0.1.0-test.33

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.
@@ -1 +1 @@
1
- import * as _ from "@intuned/runtime/dist/commands/interface/run";
1
+ import { runAutomationCLI } from "@intuned/runtime/dist/commands/interface/run";
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- export {};
2
+ export declare function runAutomationCLI(importFunction?: (path: string) => Promise<any>): void;
@@ -1,6 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
3
 
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.runAutomationCLI = runAutomationCLI;
4
8
  var _commander = require("commander");
5
9
  var _dotenv = _interopRequireDefault(require("dotenv"));
6
10
  var _asyncLocalStorage = require("../../common/asyncLocalStorage");
@@ -11,6 +15,7 @@ var _enums = require("src/runtime/enums");
11
15
  var _unixSocket = require("../common/utils/unixSocket");
12
16
  var _promises = require("timers/promises");
13
17
  var _jwtTokenManager = require("src/common/jwtTokenManager");
18
+ var _formatZodError = require("src/common/formatZodError");
14
19
  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); }
15
20
  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 && Object.prototype.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; }
16
21
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -47,7 +52,7 @@ const inputSchema = _zod.default.union([startRunApiSchema, nextRunApiSchema, abo
47
52
  _dotenv.default.config({
48
53
  path: `.env`
49
54
  });
50
- function main(importFunction) {
55
+ function runAutomationCLI(importFunction) {
51
56
  _commander.program.description("run user automation and communicate using unix socket").argument("<socket-path>", "path to unix socket").action(async socketPath => {
52
57
  let context;
53
58
  const throttleTime = 1_000;
@@ -99,16 +104,10 @@ function main(importFunction) {
99
104
  for await (const data of jsonUnixSocket.receiveJSON()) {
100
105
  const inputParseResult = inputSchema.safeParse(data);
101
106
  if (!inputParseResult.success) {
102
- console.error(inputParseResult.error.errors);
107
+ console.error("Validation error:", (0, _formatZodError.formatZodError)(inputParseResult.error));
103
108
  jsonUnixSocket.sendJSON({
104
109
  type: "done",
105
- result: {
106
- error: "InternalInvalidInputError",
107
- message: "Invalid input",
108
- details: {
109
- errors: inputParseResult.error.errors
110
- }
111
- },
110
+ result: new _runApi.InternalInvalidInputError("Invalid input", (0, _formatZodError.formatZodError)(inputParseResult.error)).json,
112
111
  success: false
113
112
  });
114
113
  break;
@@ -183,5 +182,5 @@ function getProxyUrlFromRunOptions(runOptions) {
183
182
  return url.toString();
184
183
  }
185
184
  if (require.main === module) {
186
- main();
185
+ runAutomationCLI();
187
186
  }
@@ -0,0 +1,2 @@
1
+ import { ZodError } from "zod";
2
+ export declare function formatZodError(zodError: ZodError): string[];
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.formatZodError = formatZodError;
7
+ function formatZodError(zodError) {
8
+ const formattedErrors = zodError.errors.map(error => {
9
+ const path = error.path.map(segment => {
10
+ return typeof segment === "number" ? `[${segment}]` : segment;
11
+ }).join(".");
12
+ if (path) {
13
+ return `${path} is invalid - ${error.message}`;
14
+ }
15
+ return error.message;
16
+ });
17
+ return formattedErrors;
18
+ }
@@ -151,7 +151,11 @@ async function loadSessionToContext({
151
151
  }) {
152
152
  let sessionToLoad;
153
153
  if (session.type === "state") {
154
- sessionToLoad = session.state;
154
+ const state = session.state;
155
+ if (state === undefined || state === null) {
156
+ return;
157
+ }
158
+ sessionToLoad = state;
155
159
  } else {
156
160
  const fullPath = (0, _fileUtils.getFullPathInProject)(session.path);
157
161
  sessionToLoad = await fs.readJson(fullPath);
@@ -9,7 +9,8 @@ export declare const authCheckNotFoundErrorCode = "AuthCheckNotFoundError";
9
9
  export declare const authCheckFailedErrorCode = "AuthCheckFailedError";
10
10
  export declare const maxLevelsExceededErrorCode = "MaxLevelsExceededError";
11
11
  export declare const automationError = "AutomationError";
12
- export declare const runAutomationErrorCodes: readonly ["APINotFoundError", "InvalidAPIError", "InvalidCheckError", "AbortedError", "AuthRequiredError", "AuthCheckNotFoundError", "AuthCheckFailedError", "MaxLevelsExceededError", "AutomationError"];
12
+ export declare const internalInvalidInputErrorCode = "InternalInvalidInputError";
13
+ export declare const runAutomationErrorCodes: readonly ["APINotFoundError", "InvalidAPIError", "InvalidCheckError", "AbortedError", "AuthRequiredError", "AuthCheckNotFoundError", "AuthCheckFailedError", "MaxLevelsExceededError", "AutomationError", "InternalInvalidInputError"];
13
14
  export type RunAutomationErrorCode = (typeof runAutomationErrorCodes)[number];
14
15
  export declare abstract class RunAutomationError<T = any> {
15
16
  code: RunAutomationErrorCode;
@@ -20,7 +21,7 @@ export declare abstract class RunAutomationError<T = any> {
20
21
  details?: T;
21
22
  get apiResponse(): RunAutomationResponse;
22
23
  get json(): {
23
- code: "APINotFoundError" | "InvalidAPIError" | "InvalidCheckError" | "AbortedError" | "AuthRequiredError" | "AuthCheckNotFoundError" | "AuthCheckFailedError" | "MaxLevelsExceededError" | "AutomationError";
24
+ code: "APINotFoundError" | "InvalidAPIError" | "InvalidCheckError" | "AbortedError" | "AuthRequiredError" | "AuthCheckNotFoundError" | "AuthCheckFailedError" | "MaxLevelsExceededError" | "AutomationError" | "InternalInvalidInputError";
24
25
  details: T | undefined;
25
26
  cause: any;
26
27
  };
@@ -69,3 +70,7 @@ export declare class AutomationError extends RunAutomationError<{
69
70
  error: any;
70
71
  constructor(error: any);
71
72
  }
73
+ export declare class InternalInvalidInputError extends RunAutomationError {
74
+ constructor(message: string, details?: any);
75
+ get apiResponse(): RunAutomationResponse;
76
+ }
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.runAutomationErrorCodes = exports.maxLevelsExceededErrorCode = exports.invalidCheckErrorCode = exports.invalidApiErrorCode = exports.automationError = exports.authRequiredErrorCode = exports.authCheckNotFoundErrorCode = exports.authCheckFailedErrorCode = exports.apiNotFoundErrorCode = exports.abortedErrorCode = exports.RunAutomationError = exports.MaxLevelsExceededError = exports.InvalidCheckError = exports.InvalidApiError = exports.AutomationError = exports.AuthRequiredError = exports.AuthCheckNotFoundError = exports.AuthCheckFailedError = exports.ApiNotFoundError = exports.AbortedError = void 0;
6
+ exports.runAutomationErrorCodes = exports.maxLevelsExceededErrorCode = exports.invalidCheckErrorCode = exports.invalidApiErrorCode = exports.internalInvalidInputErrorCode = exports.automationError = exports.authRequiredErrorCode = exports.authCheckNotFoundErrorCode = exports.authCheckFailedErrorCode = exports.apiNotFoundErrorCode = exports.abortedErrorCode = exports.RunAutomationError = exports.MaxLevelsExceededError = exports.InvalidCheckError = exports.InvalidApiError = exports.InternalInvalidInputError = exports.AutomationError = exports.AuthRequiredError = exports.AuthCheckNotFoundError = exports.AuthCheckFailedError = exports.ApiNotFoundError = exports.AbortedError = void 0;
7
7
  var _runtime = require("../../runtime");
8
8
  var playwright = _interopRequireWildcard(require("@intuned/playwright-core"));
9
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); }
@@ -17,7 +17,8 @@ const authCheckNotFoundErrorCode = exports.authCheckNotFoundErrorCode = "AuthChe
17
17
  const authCheckFailedErrorCode = exports.authCheckFailedErrorCode = "AuthCheckFailedError";
18
18
  const maxLevelsExceededErrorCode = exports.maxLevelsExceededErrorCode = "MaxLevelsExceededError";
19
19
  const automationError = exports.automationError = "AutomationError";
20
- const runAutomationErrorCodes = exports.runAutomationErrorCodes = [apiNotFoundErrorCode, invalidApiErrorCode, invalidCheckErrorCode, abortedErrorCode, authRequiredErrorCode, authCheckNotFoundErrorCode, authCheckFailedErrorCode, maxLevelsExceededErrorCode, automationError];
20
+ const internalInvalidInputErrorCode = exports.internalInvalidInputErrorCode = "InternalInvalidInputError";
21
+ const runAutomationErrorCodes = exports.runAutomationErrorCodes = [apiNotFoundErrorCode, invalidApiErrorCode, invalidCheckErrorCode, abortedErrorCode, authRequiredErrorCode, authCheckNotFoundErrorCode, authCheckFailedErrorCode, maxLevelsExceededErrorCode, automationError, internalInvalidInputErrorCode];
21
22
  class RunAutomationError {
22
23
  wrapped = false;
23
24
  get apiResponse() {
@@ -169,4 +170,24 @@ class AutomationError extends RunAutomationError {
169
170
  };
170
171
  }
171
172
  }
172
- exports.AutomationError = AutomationError;
173
+ exports.AutomationError = AutomationError;
174
+ class InternalInvalidInputError extends RunAutomationError {
175
+ constructor(message, details) {
176
+ super();
177
+ this.code = internalInvalidInputErrorCode;
178
+ this.statusCode = 500;
179
+ this.message = message;
180
+ this.details = details;
181
+ }
182
+ get apiResponse() {
183
+ return {
184
+ status: 500,
185
+ body: {
186
+ error: "InternalServerError",
187
+ message: `Internal error: ${this.message}. Please report this issue to the Intuned team.`,
188
+ details: this.details
189
+ }
190
+ };
191
+ }
192
+ }
193
+ exports.InternalInvalidInputError = InternalInvalidInputError;
@@ -43,6 +43,7 @@ Object.keys(_types).forEach(function (key) {
43
43
  }
44
44
  });
45
45
  });
46
+ var _formatZodError = require("../formatZodError");
46
47
  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); }
47
48
  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 && Object.prototype.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; }
48
49
  async function* runApiGenerator({
@@ -52,6 +53,10 @@ async function* runApiGenerator({
52
53
  ...input
53
54
  }) {
54
55
  let traceStarted = false;
56
+ const inputParseResult = _types.runApiParametersSchema.safeParse(input);
57
+ if (!inputParseResult.success) {
58
+ return (0, _neverthrow.err)(new _errors.InternalInvalidInputError("Input validation failed", (0, _formatZodError.formatZodError)(inputParseResult.error)));
59
+ }
55
60
  const {
56
61
  automationFunction,
57
62
  runOptions,
@@ -117,7 +122,11 @@ async function* runApiGenerator({
117
122
  });
118
123
  });
119
124
  if (auth && auth.session.type === "state") {
120
- await (0, _contextStorageStateHelpers.setContextStorageState)(context, auth.session.state);
125
+ const state = auth.session.state;
126
+ if (state === undefined || state === null) {
127
+ return (0, _neverthrow.err)(new _errors.AuthRequiredError());
128
+ }
129
+ await (0, _contextStorageStateHelpers.setContextStorageState)(context, state);
121
130
  }
122
131
  async function* runAutomation() {
123
132
  var _getExecutionContext;
@@ -36,12 +36,91 @@ export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
36
36
  path: string;
37
37
  }>, z.ZodObject<{
38
38
  type: z.ZodLiteral<"state">;
39
- state: z.ZodType<{
40
- cookies: {
39
+ state: z.ZodOptional<z.ZodNullable<z.ZodObject<{
40
+ cookies: z.ZodArray<z.ZodObject<{
41
+ name: z.ZodString;
42
+ value: z.ZodString;
43
+ domain: z.ZodString;
44
+ path: z.ZodString;
45
+ expires: z.ZodNumber;
46
+ httpOnly: z.ZodBoolean;
47
+ secure: z.ZodBoolean;
48
+ sameSite: z.ZodEnum<["Strict", "Lax", "None"]>;
49
+ }, "strip", z.ZodTypeAny, {
41
50
  name: string;
42
51
  value: string;
52
+ path: string;
43
53
  domain: string;
54
+ expires: number;
55
+ httpOnly: boolean;
56
+ secure: boolean;
57
+ sameSite: "Strict" | "Lax" | "None";
58
+ }, {
59
+ name: string;
60
+ value: string;
61
+ path: string;
62
+ domain: string;
63
+ expires: number;
64
+ httpOnly: boolean;
65
+ secure: boolean;
66
+ sameSite: "Strict" | "Lax" | "None";
67
+ }>, "many">;
68
+ origins: z.ZodArray<z.ZodObject<{
69
+ origin: z.ZodString;
70
+ localStorage: z.ZodArray<z.ZodObject<{
71
+ name: z.ZodString;
72
+ value: z.ZodString;
73
+ }, "strip", z.ZodTypeAny, {
74
+ name: string;
75
+ value: string;
76
+ }, {
77
+ name: string;
78
+ value: string;
79
+ }>, "many">;
80
+ }, "strip", z.ZodTypeAny, {
81
+ origin: string;
82
+ localStorage: {
83
+ name: string;
84
+ value: string;
85
+ }[];
86
+ }, {
87
+ origin: string;
88
+ localStorage: {
89
+ name: string;
90
+ value: string;
91
+ }[];
92
+ }>, "many">;
93
+ sessionStorage: z.ZodOptional<z.ZodArray<z.ZodObject<{
94
+ origin: z.ZodString;
95
+ sessionStorage: z.ZodArray<z.ZodObject<{
96
+ name: z.ZodString;
97
+ value: z.ZodString;
98
+ }, "strip", z.ZodTypeAny, {
99
+ name: string;
100
+ value: string;
101
+ }, {
102
+ name: string;
103
+ value: string;
104
+ }>, "many">;
105
+ }, "strip", z.ZodTypeAny, {
106
+ origin: string;
107
+ sessionStorage: {
108
+ name: string;
109
+ value: string;
110
+ }[];
111
+ }, {
112
+ origin: string;
113
+ sessionStorage: {
114
+ name: string;
115
+ value: string;
116
+ }[];
117
+ }>, "many">>;
118
+ }, "strip", z.ZodTypeAny, {
119
+ cookies: {
120
+ name: string;
121
+ value: string;
44
122
  path: string;
123
+ domain: string;
45
124
  expires: number;
46
125
  httpOnly: boolean;
47
126
  secure: boolean;
@@ -54,14 +133,19 @@ export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
54
133
  value: string;
55
134
  }[];
56
135
  }[];
57
- } & {
58
- sessionStorage?: import("../contextStorageStateHelpers").OriginSessionStorage[] | undefined;
59
- }, z.ZodTypeDef, {
136
+ sessionStorage?: {
137
+ origin: string;
138
+ sessionStorage: {
139
+ name: string;
140
+ value: string;
141
+ }[];
142
+ }[] | undefined;
143
+ }, {
60
144
  cookies: {
61
145
  name: string;
62
146
  value: string;
63
- domain: string;
64
147
  path: string;
148
+ domain: string;
65
149
  expires: number;
66
150
  httpOnly: boolean;
67
151
  secure: boolean;
@@ -74,17 +158,22 @@ export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
74
158
  value: string;
75
159
  }[];
76
160
  }[];
77
- } & {
78
- sessionStorage?: import("../contextStorageStateHelpers").OriginSessionStorage[] | undefined;
79
- }>;
161
+ sessionStorage?: {
162
+ origin: string;
163
+ sessionStorage: {
164
+ name: string;
165
+ value: string;
166
+ }[];
167
+ }[] | undefined;
168
+ }>>>;
80
169
  }, "strip", z.ZodTypeAny, {
81
170
  type: "state";
82
- state: {
171
+ state?: {
83
172
  cookies: {
84
173
  name: string;
85
174
  value: string;
86
- domain: string;
87
175
  path: string;
176
+ domain: string;
88
177
  expires: number;
89
178
  httpOnly: boolean;
90
179
  secure: boolean;
@@ -97,17 +186,22 @@ export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
97
186
  value: string;
98
187
  }[];
99
188
  }[];
100
- } & {
101
- sessionStorage?: import("../contextStorageStateHelpers").OriginSessionStorage[] | undefined;
102
- };
189
+ sessionStorage?: {
190
+ origin: string;
191
+ sessionStorage: {
192
+ name: string;
193
+ value: string;
194
+ }[];
195
+ }[] | undefined;
196
+ } | null | undefined;
103
197
  }, {
104
198
  type: "state";
105
- state: {
199
+ state?: {
106
200
  cookies: {
107
201
  name: string;
108
202
  value: string;
109
- domain: string;
110
203
  path: string;
204
+ domain: string;
111
205
  expires: number;
112
206
  httpOnly: boolean;
113
207
  secure: boolean;
@@ -120,9 +214,14 @@ export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
120
214
  value: string;
121
215
  }[];
122
216
  }[];
123
- } & {
124
- sessionStorage?: import("../contextStorageStateHelpers").OriginSessionStorage[] | undefined;
125
- };
217
+ sessionStorage?: {
218
+ origin: string;
219
+ sessionStorage: {
220
+ name: string;
221
+ value: string;
222
+ }[];
223
+ }[] | undefined;
224
+ } | null | undefined;
126
225
  }>]>;
127
226
  export declare const runApiParametersSchema: z.ZodObject<{
128
227
  automationFunction: z.ZodObject<{
@@ -163,12 +262,91 @@ export declare const runApiParametersSchema: z.ZodObject<{
163
262
  path: string;
164
263
  }>, z.ZodObject<{
165
264
  type: z.ZodLiteral<"state">;
166
- state: z.ZodType<{
167
- cookies: {
265
+ state: z.ZodOptional<z.ZodNullable<z.ZodObject<{
266
+ cookies: z.ZodArray<z.ZodObject<{
267
+ name: z.ZodString;
268
+ value: z.ZodString;
269
+ domain: z.ZodString;
270
+ path: z.ZodString;
271
+ expires: z.ZodNumber;
272
+ httpOnly: z.ZodBoolean;
273
+ secure: z.ZodBoolean;
274
+ sameSite: z.ZodEnum<["Strict", "Lax", "None"]>;
275
+ }, "strip", z.ZodTypeAny, {
276
+ name: string;
277
+ value: string;
278
+ path: string;
279
+ domain: string;
280
+ expires: number;
281
+ httpOnly: boolean;
282
+ secure: boolean;
283
+ sameSite: "Strict" | "Lax" | "None";
284
+ }, {
168
285
  name: string;
169
286
  value: string;
287
+ path: string;
170
288
  domain: string;
289
+ expires: number;
290
+ httpOnly: boolean;
291
+ secure: boolean;
292
+ sameSite: "Strict" | "Lax" | "None";
293
+ }>, "many">;
294
+ origins: z.ZodArray<z.ZodObject<{
295
+ origin: z.ZodString;
296
+ localStorage: z.ZodArray<z.ZodObject<{
297
+ name: z.ZodString;
298
+ value: z.ZodString;
299
+ }, "strip", z.ZodTypeAny, {
300
+ name: string;
301
+ value: string;
302
+ }, {
303
+ name: string;
304
+ value: string;
305
+ }>, "many">;
306
+ }, "strip", z.ZodTypeAny, {
307
+ origin: string;
308
+ localStorage: {
309
+ name: string;
310
+ value: string;
311
+ }[];
312
+ }, {
313
+ origin: string;
314
+ localStorage: {
315
+ name: string;
316
+ value: string;
317
+ }[];
318
+ }>, "many">;
319
+ sessionStorage: z.ZodOptional<z.ZodArray<z.ZodObject<{
320
+ origin: z.ZodString;
321
+ sessionStorage: z.ZodArray<z.ZodObject<{
322
+ name: z.ZodString;
323
+ value: z.ZodString;
324
+ }, "strip", z.ZodTypeAny, {
325
+ name: string;
326
+ value: string;
327
+ }, {
328
+ name: string;
329
+ value: string;
330
+ }>, "many">;
331
+ }, "strip", z.ZodTypeAny, {
332
+ origin: string;
333
+ sessionStorage: {
334
+ name: string;
335
+ value: string;
336
+ }[];
337
+ }, {
338
+ origin: string;
339
+ sessionStorage: {
340
+ name: string;
341
+ value: string;
342
+ }[];
343
+ }>, "many">>;
344
+ }, "strip", z.ZodTypeAny, {
345
+ cookies: {
346
+ name: string;
347
+ value: string;
171
348
  path: string;
349
+ domain: string;
172
350
  expires: number;
173
351
  httpOnly: boolean;
174
352
  secure: boolean;
@@ -181,14 +359,19 @@ export declare const runApiParametersSchema: z.ZodObject<{
181
359
  value: string;
182
360
  }[];
183
361
  }[];
184
- } & {
185
- sessionStorage?: import("../contextStorageStateHelpers").OriginSessionStorage[] | undefined;
186
- }, z.ZodTypeDef, {
362
+ sessionStorage?: {
363
+ origin: string;
364
+ sessionStorage: {
365
+ name: string;
366
+ value: string;
367
+ }[];
368
+ }[] | undefined;
369
+ }, {
187
370
  cookies: {
188
371
  name: string;
189
372
  value: string;
190
- domain: string;
191
373
  path: string;
374
+ domain: string;
192
375
  expires: number;
193
376
  httpOnly: boolean;
194
377
  secure: boolean;
@@ -201,17 +384,22 @@ export declare const runApiParametersSchema: z.ZodObject<{
201
384
  value: string;
202
385
  }[];
203
386
  }[];
204
- } & {
205
- sessionStorage?: import("../contextStorageStateHelpers").OriginSessionStorage[] | undefined;
206
- }>;
387
+ sessionStorage?: {
388
+ origin: string;
389
+ sessionStorage: {
390
+ name: string;
391
+ value: string;
392
+ }[];
393
+ }[] | undefined;
394
+ }>>>;
207
395
  }, "strip", z.ZodTypeAny, {
208
396
  type: "state";
209
- state: {
397
+ state?: {
210
398
  cookies: {
211
399
  name: string;
212
400
  value: string;
213
- domain: string;
214
401
  path: string;
402
+ domain: string;
215
403
  expires: number;
216
404
  httpOnly: boolean;
217
405
  secure: boolean;
@@ -224,17 +412,22 @@ export declare const runApiParametersSchema: z.ZodObject<{
224
412
  value: string;
225
413
  }[];
226
414
  }[];
227
- } & {
228
- sessionStorage?: import("../contextStorageStateHelpers").OriginSessionStorage[] | undefined;
229
- };
415
+ sessionStorage?: {
416
+ origin: string;
417
+ sessionStorage: {
418
+ name: string;
419
+ value: string;
420
+ }[];
421
+ }[] | undefined;
422
+ } | null | undefined;
230
423
  }, {
231
424
  type: "state";
232
- state: {
425
+ state?: {
233
426
  cookies: {
234
427
  name: string;
235
428
  value: string;
236
- domain: string;
237
429
  path: string;
430
+ domain: string;
238
431
  expires: number;
239
432
  httpOnly: boolean;
240
433
  secure: boolean;
@@ -247,9 +440,14 @@ export declare const runApiParametersSchema: z.ZodObject<{
247
440
  value: string;
248
441
  }[];
249
442
  }[];
250
- } & {
251
- sessionStorage?: import("../contextStorageStateHelpers").OriginSessionStorage[] | undefined;
252
- };
443
+ sessionStorage?: {
444
+ origin: string;
445
+ sessionStorage: {
446
+ name: string;
447
+ value: string;
448
+ }[];
449
+ }[] | undefined;
450
+ } | null | undefined;
253
451
  }>]>;
254
452
  runCheck: z.ZodDefault<z.ZodBoolean>;
255
453
  }, "strip", z.ZodTypeAny, {
@@ -258,12 +456,12 @@ export declare const runApiParametersSchema: z.ZodObject<{
258
456
  path: string;
259
457
  } | {
260
458
  type: "state";
261
- state: {
459
+ state?: {
262
460
  cookies: {
263
461
  name: string;
264
462
  value: string;
265
- domain: string;
266
463
  path: string;
464
+ domain: string;
267
465
  expires: number;
268
466
  httpOnly: boolean;
269
467
  secure: boolean;
@@ -276,9 +474,14 @@ export declare const runApiParametersSchema: z.ZodObject<{
276
474
  value: string;
277
475
  }[];
278
476
  }[];
279
- } & {
280
- sessionStorage?: import("../contextStorageStateHelpers").OriginSessionStorage[] | undefined;
281
- };
477
+ sessionStorage?: {
478
+ origin: string;
479
+ sessionStorage: {
480
+ name: string;
481
+ value: string;
482
+ }[];
483
+ }[] | undefined;
484
+ } | null | undefined;
282
485
  };
283
486
  runCheck: boolean;
284
487
  }, {
@@ -287,12 +490,12 @@ export declare const runApiParametersSchema: z.ZodObject<{
287
490
  path: string;
288
491
  } | {
289
492
  type: "state";
290
- state: {
493
+ state?: {
291
494
  cookies: {
292
495
  name: string;
293
496
  value: string;
294
- domain: string;
295
497
  path: string;
498
+ domain: string;
296
499
  expires: number;
297
500
  httpOnly: boolean;
298
501
  secure: boolean;
@@ -305,9 +508,14 @@ export declare const runApiParametersSchema: z.ZodObject<{
305
508
  value: string;
306
509
  }[];
307
510
  }[];
308
- } & {
309
- sessionStorage?: import("../contextStorageStateHelpers").OriginSessionStorage[] | undefined;
310
- };
511
+ sessionStorage?: {
512
+ origin: string;
513
+ sessionStorage: {
514
+ name: string;
515
+ value: string;
516
+ }[];
517
+ }[] | undefined;
518
+ } | null | undefined;
311
519
  };
312
520
  runCheck?: boolean | undefined;
313
521
  }>>;
@@ -388,12 +596,12 @@ export declare const runApiParametersSchema: z.ZodObject<{
388
596
  path: string;
389
597
  } | {
390
598
  type: "state";
391
- state: {
599
+ state?: {
392
600
  cookies: {
393
601
  name: string;
394
602
  value: string;
395
- domain: string;
396
603
  path: string;
604
+ domain: string;
397
605
  expires: number;
398
606
  httpOnly: boolean;
399
607
  secure: boolean;
@@ -406,9 +614,14 @@ export declare const runApiParametersSchema: z.ZodObject<{
406
614
  value: string;
407
615
  }[];
408
616
  }[];
409
- } & {
410
- sessionStorage?: import("../contextStorageStateHelpers").OriginSessionStorage[] | undefined;
411
- };
617
+ sessionStorage?: {
618
+ origin: string;
619
+ sessionStorage: {
620
+ name: string;
621
+ value: string;
622
+ }[];
623
+ }[] | undefined;
624
+ } | null | undefined;
412
625
  };
413
626
  runCheck: boolean;
414
627
  } | undefined;
@@ -429,12 +642,12 @@ export declare const runApiParametersSchema: z.ZodObject<{
429
642
  path: string;
430
643
  } | {
431
644
  type: "state";
432
- state: {
645
+ state?: {
433
646
  cookies: {
434
647
  name: string;
435
648
  value: string;
436
- domain: string;
437
649
  path: string;
650
+ domain: string;
438
651
  expires: number;
439
652
  httpOnly: boolean;
440
653
  secure: boolean;
@@ -447,9 +660,14 @@ export declare const runApiParametersSchema: z.ZodObject<{
447
660
  value: string;
448
661
  }[];
449
662
  }[];
450
- } & {
451
- sessionStorage?: import("../contextStorageStateHelpers").OriginSessionStorage[] | undefined;
452
- };
663
+ sessionStorage?: {
664
+ origin: string;
665
+ sessionStorage: {
666
+ name: string;
667
+ value: string;
668
+ }[];
669
+ }[] | undefined;
670
+ } | null | undefined;
453
671
  };
454
672
  runCheck?: boolean | undefined;
455
673
  } | undefined;
@@ -11,7 +11,32 @@ const runApiSessionSchema = exports.runApiSessionSchema = _zod.default.discrimin
11
11
  path: _zod.default.string()
12
12
  }), _zod.default.object({
13
13
  type: _zod.default.literal("state"),
14
- state: _zod.default.custom(v => v)
14
+ state: _zod.default.object({
15
+ cookies: _zod.default.array(_zod.default.object({
16
+ name: _zod.default.string(),
17
+ value: _zod.default.string(),
18
+ domain: _zod.default.string(),
19
+ path: _zod.default.string(),
20
+ expires: _zod.default.number(),
21
+ httpOnly: _zod.default.boolean(),
22
+ secure: _zod.default.boolean(),
23
+ sameSite: _zod.default.enum(["Strict", "Lax", "None"])
24
+ })),
25
+ origins: _zod.default.array(_zod.default.object({
26
+ origin: _zod.default.string(),
27
+ localStorage: _zod.default.array(_zod.default.object({
28
+ name: _zod.default.string(),
29
+ value: _zod.default.string()
30
+ }))
31
+ })),
32
+ sessionStorage: _zod.default.array(_zod.default.object({
33
+ origin: _zod.default.string(),
34
+ sessionStorage: _zod.default.array(_zod.default.object({
35
+ name: _zod.default.string(),
36
+ value: _zod.default.string()
37
+ }))
38
+ })).optional()
39
+ }).nullable().optional()
15
40
  })]);
16
41
  const runApiParametersSchema = exports.runApiParametersSchema = _zod.default.object({
17
42
  automationFunction: _zod.default.object({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intuned/runtime-dev",
3
- "version": "0.1.0-test.31",
3
+ "version": "0.1.0-test.33",
4
4
  "description": "Intuned runtime",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",