@intuned/runtime-dev 1.0.4-remove-playwright.22 → 1.0.4-stuck.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import * as playwright from "playwright-core";
1
+ import * as playwright from "@intuned/playwright-core";
2
2
  import { Handler, Response } from "@tinyhttp/app";
3
3
  import * as path from "path";
4
4
  import { getExecutionContext } from "@intuned/runtime";
Binary file
@@ -61,18 +61,13 @@ _commander.program.description("run auth session create").option("--cdpAddress <
61
61
  value,
62
62
  done
63
63
  } = await generator.next(...(nextGeneratorParam ? [nextGeneratorParam] : []));
64
- console.log("running create gggg", JSON.stringify({
65
- nextGeneratorParam,
66
- value,
67
- done
68
- }));
69
64
  if (done) {
70
65
  if (value.isErr()) {
71
66
  if (value.error instanceof _runApi.AutomationError) {
72
67
  throw value.error.error;
73
68
  }
74
- console.error("testtttt", value.error);
75
- throw new Error(`Error while running create ${JSON.stringify(value)}`);
69
+ console.error(value.error);
70
+ throw new Error("Error while running create");
76
71
  }
77
72
  const fullState = value.value.session;
78
73
  if (pathToSave) {
@@ -60,7 +60,7 @@ async function build(outfile, mode, template) {
60
60
  if (isThirdPartyWarning(warning)) return;
61
61
  warn(warning);
62
62
  },
63
- external: ["playwright", "playwright-core", "jsdom", "canvas", "pdfjs-dist", "pdf-to-png-converter", "crypto", "applicationinsights", "fingerprint-generator", "fingerprint-injector", "node-fetch"]
63
+ external: ["@intuned/playwright", "@intuned/playwright-core", "jsdom", "canvas", "pdfjs-dist", "pdf-to-png-converter", "crypto", "applicationinsights", "fingerprint-generator", "fingerprint-injector", "node-fetch"]
64
64
  });
65
65
  console.log(`📦 Building ${outfile}`);
66
66
  const outfileFolder = path.dirname(outfile);
@@ -1,4 +1,4 @@
1
- import { BrowserContext } from "playwright-core";
1
+ import { BrowserContext } from "@intuned/playwright-core";
2
2
  export declare const REMOTE_DEBUGGING_PORT = 9222;
3
3
  export declare const getChromiumLaunchArgs: () => string[];
4
4
  export declare function startOrRestartBrowser(): Promise<void>;
@@ -9,7 +9,7 @@ exports.saveSession = saveSession;
9
9
  exports.saveSessionFromOpenedBrowser = saveSessionFromOpenedBrowser;
10
10
  exports.startOrRestartBrowser = startOrRestartBrowser;
11
11
  var _child_process = require("child_process");
12
- var playwright = _interopRequireWildcard(require("playwright-core"));
12
+ var playwright = _interopRequireWildcard(require("@intuned/playwright-core"));
13
13
  var fs = _interopRequireWildcard(require("fs-extra"));
14
14
  var _fileUtils = require("./utils/fileUtils");
15
15
  var _contextStorageStateHelpers = require("../../common/contextStorageStateHelpers");
@@ -51,7 +51,7 @@ async function loadState(path, context) {
51
51
  await context.addCookies(data.cookies);
52
52
  }
53
53
  async function saveSession(path, context) {
54
- const fullState = await (0, _contextStorageStateHelpers.getStorageState)(context);
54
+ const fullState = await (0, _contextStorageStateHelpers.getContextStorageState)(context);
55
55
  const fullPath = (0, _fileUtils.getFullPathInProject)(path);
56
56
  fs.ensureFileSync(fullPath);
57
57
  await fs.writeJSON(fullPath, fullState);
@@ -15,7 +15,6 @@ async function tsNodeImport(apiName) {
15
15
  }
16
16
  });
17
17
  const path = (0, _fileUtils.getFullPathInProject)(...apiName.split("/"));
18
- console.log("path", path);
19
18
  const imported = await (specifier => new Promise(r => r(`${specifier}`)).then(s => _interopRequireWildcard(require(s))))(path);
20
19
  return imported;
21
20
  }
@@ -1,21 +1,14 @@
1
- import * as playwright from "playwright-core";
2
- interface StorageEntry {
3
- name: string;
4
- value: string;
5
- }
6
- interface LocalStorageState {
7
- origin: string;
8
- localStorage: StorageEntry[];
9
- }
10
- interface SessionStorageState {
1
+ import { BrowserContext } from "@intuned/playwright";
2
+ import * as playwright from "@intuned/playwright-core";
3
+ export interface OriginSessionStorage {
11
4
  origin: string;
12
- sessionStorage: StorageEntry[];
13
- }
14
- export interface StorageState {
15
- cookies?: playwright.Cookie[] | null;
16
- origins?: LocalStorageState[] | null;
17
- sessionStorage?: SessionStorageState[] | null;
18
- }
19
- export declare function setStorageState(context: playwright.BrowserContext, state: StorageState): Promise<void>;
20
- export declare function getStorageState(context: playwright.BrowserContext): Promise<StorageState>;
21
- export {};
5
+ sessionStorage: Array<{
6
+ name: string;
7
+ value: string;
8
+ }>;
9
+ }
10
+ export type IntunedStorageState = Exclude<playwright.BrowserContextOptions["storageState"], string> & {
11
+ sessionStorage?: OriginSessionStorage[];
12
+ };
13
+ export declare function getContextStorageState(context: BrowserContext): Promise<IntunedStorageState>;
14
+ export declare function setContextStorageState(context: BrowserContext, storage: IntunedStorageState): Promise<void>;
@@ -3,65 +3,52 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getStorageState = getStorageState;
7
- exports.setStorageState = setStorageState;
8
- async function setStorageState(context, state) {
9
- console.log("asdasdasd setStorageState", state);
10
- if ("cookies" in state && state.cookies) {
11
- await context.addCookies(state.cookies);
6
+ exports.getContextStorageState = getContextStorageState;
7
+ exports.setContextStorageState = setContextStorageState;
8
+ function sessionStorageToArray(storage) {
9
+ const result = [];
10
+ for (const key in storage) {
11
+ result.push({
12
+ name: key,
13
+ value: storage[key]
14
+ });
12
15
  }
13
- const page = await context.newPage();
14
- if ("origins" in state && state.origins) {
15
- for (const originData of state.origins || []) {
16
- const origin = originData.origin;
17
- await page.goto(origin);
18
- for (const item of originData.localStorage) {
19
- await page.evaluate(([key, value]) => {
20
- window.localStorage.setItem(key, value);
21
- }, [item.name, item.value]);
22
- }
23
- }
24
- }
25
- if ("sessionStorage" in state && state.sessionStorage) {
26
- await context.addInitScript(`
27
- const storage = ${JSON.stringify(state.sessionStorage)};
28
- for (const { origin, sessionStorage } of storage) {
29
- if (window.location.origin === origin) {
30
- for (const item of sessionStorage)
31
- window.sessionStorage.setItem(item.name, item.value);
32
- }
33
- }
34
- `);
35
- }
36
- await page.close();
16
+ return result;
37
17
  }
38
- async function getStorageState(context) {
39
- const result = {};
40
- const storageState = await context.storageState();
41
- result["cookies"] = storageState["cookies"];
42
- result["origins"] = storageState["origins"];
43
- const sessionDataList = [];
44
- const pages = await context.pages();
18
+ async function getContextStorageState(context) {
19
+ const cookiesAndLocalStorage = await context.storageState();
20
+ const pages = context.pages();
21
+ const pagesSessions = [];
45
22
  for (const page of pages) {
46
- if (page.isClosed()) continue;
47
23
  try {
48
- const sessionData = await page.evaluate(() => {
49
- const items = {
50
- ...window.sessionStorage
51
- };
52
- return {
53
- origin: window.location.origin,
54
- sessionStorage: Object.entries(items).map(([name, value]) => ({
55
- name,
56
- value
57
- }))
58
- };
24
+ const [origin, session] = await page.evaluate(() => [location.origin, sessionStorage]);
25
+ const transformed = sessionStorageToArray(session);
26
+ pagesSessions.push({
27
+ origin,
28
+ sessionStorage: transformed
59
29
  });
60
- sessionDataList.push(sessionData);
61
- } catch (error) {
62
- console.error("Error getting sessionStorage:", error);
63
- }
30
+ } catch (e) {}
64
31
  }
65
- result["sessionStorage"] = sessionDataList;
66
- return result;
32
+ return {
33
+ ...cookiesAndLocalStorage,
34
+ sessionStorage: pagesSessions
35
+ };
36
+ }
37
+ async function setContextStorageState(context, storage) {
38
+ await context.intunedSetStorageState(storage);
39
+ const sessionStorage = storage.sessionStorage;
40
+ await context.addInitScript(storage => {
41
+ for (const {
42
+ origin,
43
+ sessionStorage
44
+ } of storage) {
45
+ if (window.location.origin === origin) {
46
+ for (const item of sessionStorage) {
47
+ const existingValue = window.sessionStorage.getItem(item.name);
48
+ if (existingValue !== null) continue;
49
+ window.sessionStorage.setItem(item.name, item.value);
50
+ }
51
+ }
52
+ }
53
+ }, sessionStorage);
67
54
  }
@@ -1,4 +1,4 @@
1
- import * as playwright from "playwright-core";
1
+ import * as playwright from "@intuned/playwright-core";
2
2
  import type { RunApiSession } from "./runApi";
3
3
  interface Proxy {
4
4
  server: string;
@@ -7,7 +7,7 @@ exports.getPlaywrightConstructsForMode = getPlaywrightConstructsForMode;
7
7
  exports.getProductionPlaywrightConstructs = getProductionPlaywrightConstructs;
8
8
  exports.getRemotePlaywrightContext = getRemotePlaywrightContext;
9
9
  exports.loadSessionToContext = loadSessionToContext;
10
- var playwright = _interopRequireWildcard(require("playwright-core"));
10
+ var playwright = _interopRequireWildcard(require("@intuned/playwright-core"));
11
11
  var _fsExtra = _interopRequireWildcard(require("fs-extra"));
12
12
  var fs = _fsExtra;
13
13
  var _contextStorageStateHelpers = require("./contextStorageStateHelpers");
@@ -160,10 +160,10 @@ async function loadSessionToContext({
160
160
  const fullPath = (0, _fileUtils.getFullPathInProject)(session.path);
161
161
  sessionToLoad = await fs.readJson(fullPath);
162
162
  }
163
- await (0, _contextStorageStateHelpers.setStorageState)(context, sessionToLoad);
163
+ await (0, _contextStorageStateHelpers.setContextStorageState)(context, sessionToLoad);
164
164
  }
165
165
  async function getRemotePlaywrightContext(cdpAddress) {
166
- const playwright = await Promise.resolve().then(() => _interopRequireWildcard(require("playwright-core")));
166
+ const playwright = await Promise.resolve().then(() => _interopRequireWildcard(require("@intuned/playwright-core")));
167
167
  let browser = null;
168
168
  if (!cdpAddress) {
169
169
  throw new Error("cdpAddress is required");
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
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
- var playwright = _interopRequireWildcard(require("playwright-core"));
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); }
10
10
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && 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; }
11
11
  const apiNotFoundErrorCode = exports.apiNotFoundErrorCode = "APINotFoundError";
@@ -1,6 +1,6 @@
1
1
  import { Result } from "neverthrow";
2
2
  import { RunAutomationError } from "./errors";
3
- import { Page, BrowserContext } from "playwright-core";
3
+ import { Page, BrowserContext } from "@intuned/playwright-core";
4
4
  import { ExtendedRunApiParameters, RunApiResult, RunApiResultWithSessionOk } from "./types";
5
5
  export * from "./types";
6
6
  export * from "./errors";
@@ -94,7 +94,6 @@ async function* runApiGenerator({
94
94
  let page;
95
95
  const validatedModuleResult = await importUsingImportFunction(automationFunction.name, importFunction);
96
96
  if (validatedModuleResult.isErr()) {
97
- console.log("validatedModuleResult", validatedModuleResult);
98
97
  return (0, _neverthrow.err)(validatedModuleResult.error);
99
98
  }
100
99
  const importedModule = validatedModuleResult.value;
@@ -184,12 +183,10 @@ async function* runApiGenerator({
184
183
  } else {
185
184
  result = await importedModule.func(...automationFunctionParameters);
186
185
  }
187
- const x = await (0, _contextStorageStateHelpers.getStorageState)(context);
188
- console.log("storage state gggg", JSON.stringify(x));
189
186
  return (0, _neverthrow.ok)({
190
187
  result,
191
188
  extendedPayloads: (_getExecutionContext = (0, _asyncLocalStorage.getExecutionContext)()) === null || _getExecutionContext === void 0 ? void 0 : _getExecutionContext.extendedPayloads,
192
- session: retrieveSession ? await (0, _contextStorageStateHelpers.getStorageState)(context) : undefined
189
+ session: retrieveSession ? await (0, _contextStorageStateHelpers.getContextStorageState)(context) : undefined
193
190
  });
194
191
  }
195
192
  try {
@@ -246,7 +243,6 @@ async function checkAuthSessionWithRetries(page, context, checkFn, retries = 3)
246
243
  async function importUsingImportFunction(path, importFunction) {
247
244
  try {
248
245
  const imported = importFunction ? await importFunction(path) : await (specifier => new Promise(r => r(specifier)).then(s => _interopRequireWildcard(require(s))))(`../../../${path}.ts`);
249
- console.log("imported importedimported", imported);
250
246
  if (!imported || !imported.default || !imported.default.constructor) {
251
247
  return (0, _neverthrow.err)(new _errors.InvalidApiError("API file path does not have a default export"));
252
248
  }
@@ -1,4 +1,4 @@
1
- import type { StorageState } from "../contextStorageStateHelpers";
1
+ import type { IntunedStorageState } from "../contextStorageStateHelpers";
2
2
  import type { Payload } from "../../runtime/export";
3
3
  import type { Result } from "neverthrow";
4
4
  import type { RunAutomationError } from "./errors";
@@ -11,7 +11,7 @@ export interface RunAutomationSuccessResult {
11
11
  result: any;
12
12
  status: number;
13
13
  payloadToAppend: PayloadToAppend[] | null;
14
- session?: StorageState;
14
+ session?: IntunedStorageState;
15
15
  }
16
16
  export interface RunAutomationErrorResult {
17
17
  error: string;
@@ -47,8 +47,8 @@ export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
47
47
  secure: z.ZodBoolean;
48
48
  sameSite: z.ZodEnum<["Strict", "Lax", "None"]>;
49
49
  }, "strip", z.ZodTypeAny, {
50
- value: string;
51
50
  name: string;
51
+ value: string;
52
52
  path: string;
53
53
  domain: string;
54
54
  expires: number;
@@ -56,8 +56,8 @@ export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
56
56
  secure: boolean;
57
57
  sameSite: "Strict" | "Lax" | "None";
58
58
  }, {
59
- value: string;
60
59
  name: string;
60
+ value: string;
61
61
  path: string;
62
62
  domain: string;
63
63
  expires: number;
@@ -71,23 +71,23 @@ export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
71
71
  name: z.ZodString;
72
72
  value: z.ZodString;
73
73
  }, "strip", z.ZodTypeAny, {
74
- value: string;
75
74
  name: string;
76
- }, {
77
75
  value: string;
76
+ }, {
78
77
  name: string;
78
+ value: string;
79
79
  }>, "many">;
80
80
  }, "strip", z.ZodTypeAny, {
81
81
  origin: string;
82
82
  localStorage: {
83
- value: string;
84
83
  name: string;
84
+ value: string;
85
85
  }[];
86
86
  }, {
87
87
  origin: string;
88
88
  localStorage: {
89
- value: string;
90
89
  name: string;
90
+ value: string;
91
91
  }[];
92
92
  }>, "many">;
93
93
  sessionStorage: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -96,29 +96,29 @@ export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
96
96
  name: z.ZodString;
97
97
  value: z.ZodString;
98
98
  }, "strip", z.ZodTypeAny, {
99
- value: string;
100
99
  name: string;
101
- }, {
102
100
  value: string;
101
+ }, {
103
102
  name: string;
103
+ value: string;
104
104
  }>, "many">;
105
105
  }, "strip", z.ZodTypeAny, {
106
+ origin: string;
106
107
  sessionStorage: {
107
- value: string;
108
108
  name: string;
109
+ value: string;
109
110
  }[];
110
- origin: string;
111
111
  }, {
112
+ origin: string;
112
113
  sessionStorage: {
113
- value: string;
114
114
  name: string;
115
+ value: string;
115
116
  }[];
116
- origin: string;
117
117
  }>, "many">>;
118
118
  }, "strip", z.ZodTypeAny, {
119
119
  cookies: {
120
- value: string;
121
120
  name: string;
121
+ value: string;
122
122
  path: string;
123
123
  domain: string;
124
124
  expires: number;
@@ -129,21 +129,21 @@ export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
129
129
  origins: {
130
130
  origin: string;
131
131
  localStorage: {
132
- value: string;
133
132
  name: string;
133
+ value: string;
134
134
  }[];
135
135
  }[];
136
136
  sessionStorage?: {
137
+ origin: string;
137
138
  sessionStorage: {
138
- value: string;
139
139
  name: string;
140
+ value: string;
140
141
  }[];
141
- origin: string;
142
142
  }[] | undefined;
143
143
  }, {
144
144
  cookies: {
145
- value: string;
146
145
  name: string;
146
+ value: string;
147
147
  path: string;
148
148
  domain: string;
149
149
  expires: number;
@@ -154,24 +154,24 @@ export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
154
154
  origins: {
155
155
  origin: string;
156
156
  localStorage: {
157
- value: string;
158
157
  name: string;
158
+ value: string;
159
159
  }[];
160
160
  }[];
161
161
  sessionStorage?: {
162
+ origin: string;
162
163
  sessionStorage: {
163
- value: string;
164
164
  name: string;
165
+ value: string;
165
166
  }[];
166
- origin: string;
167
167
  }[] | undefined;
168
168
  }>>>;
169
169
  }, "strip", z.ZodTypeAny, {
170
170
  type: "state";
171
171
  state?: {
172
172
  cookies: {
173
- value: string;
174
173
  name: string;
174
+ value: string;
175
175
  path: string;
176
176
  domain: string;
177
177
  expires: number;
@@ -182,24 +182,24 @@ export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
182
182
  origins: {
183
183
  origin: string;
184
184
  localStorage: {
185
- value: string;
186
185
  name: string;
186
+ value: string;
187
187
  }[];
188
188
  }[];
189
189
  sessionStorage?: {
190
+ origin: string;
190
191
  sessionStorage: {
191
- value: string;
192
192
  name: string;
193
+ value: string;
193
194
  }[];
194
- origin: string;
195
195
  }[] | undefined;
196
196
  } | null | undefined;
197
197
  }, {
198
198
  type: "state";
199
199
  state?: {
200
200
  cookies: {
201
- value: string;
202
201
  name: string;
202
+ value: string;
203
203
  path: string;
204
204
  domain: string;
205
205
  expires: number;
@@ -210,16 +210,16 @@ export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
210
210
  origins: {
211
211
  origin: string;
212
212
  localStorage: {
213
- value: string;
214
213
  name: string;
214
+ value: string;
215
215
  }[];
216
216
  }[];
217
217
  sessionStorage?: {
218
+ origin: string;
218
219
  sessionStorage: {
219
- value: string;
220
220
  name: string;
221
+ value: string;
221
222
  }[];
222
- origin: string;
223
223
  }[] | undefined;
224
224
  } | null | undefined;
225
225
  }>]>;
@@ -273,8 +273,8 @@ export declare const runApiParametersSchema: z.ZodObject<{
273
273
  secure: z.ZodBoolean;
274
274
  sameSite: z.ZodEnum<["Strict", "Lax", "None"]>;
275
275
  }, "strip", z.ZodTypeAny, {
276
- value: string;
277
276
  name: string;
277
+ value: string;
278
278
  path: string;
279
279
  domain: string;
280
280
  expires: number;
@@ -282,8 +282,8 @@ export declare const runApiParametersSchema: z.ZodObject<{
282
282
  secure: boolean;
283
283
  sameSite: "Strict" | "Lax" | "None";
284
284
  }, {
285
- value: string;
286
285
  name: string;
286
+ value: string;
287
287
  path: string;
288
288
  domain: string;
289
289
  expires: number;
@@ -297,23 +297,23 @@ export declare const runApiParametersSchema: z.ZodObject<{
297
297
  name: z.ZodString;
298
298
  value: z.ZodString;
299
299
  }, "strip", z.ZodTypeAny, {
300
- value: string;
301
300
  name: string;
302
- }, {
303
301
  value: string;
302
+ }, {
304
303
  name: string;
304
+ value: string;
305
305
  }>, "many">;
306
306
  }, "strip", z.ZodTypeAny, {
307
307
  origin: string;
308
308
  localStorage: {
309
- value: string;
310
309
  name: string;
310
+ value: string;
311
311
  }[];
312
312
  }, {
313
313
  origin: string;
314
314
  localStorage: {
315
- value: string;
316
315
  name: string;
316
+ value: string;
317
317
  }[];
318
318
  }>, "many">;
319
319
  sessionStorage: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -322,29 +322,29 @@ export declare const runApiParametersSchema: z.ZodObject<{
322
322
  name: z.ZodString;
323
323
  value: z.ZodString;
324
324
  }, "strip", z.ZodTypeAny, {
325
- value: string;
326
325
  name: string;
327
- }, {
328
326
  value: string;
327
+ }, {
329
328
  name: string;
329
+ value: string;
330
330
  }>, "many">;
331
331
  }, "strip", z.ZodTypeAny, {
332
+ origin: string;
332
333
  sessionStorage: {
333
- value: string;
334
334
  name: string;
335
+ value: string;
335
336
  }[];
336
- origin: string;
337
337
  }, {
338
+ origin: string;
338
339
  sessionStorage: {
339
- value: string;
340
340
  name: string;
341
+ value: string;
341
342
  }[];
342
- origin: string;
343
343
  }>, "many">>;
344
344
  }, "strip", z.ZodTypeAny, {
345
345
  cookies: {
346
- value: string;
347
346
  name: string;
347
+ value: string;
348
348
  path: string;
349
349
  domain: string;
350
350
  expires: number;
@@ -355,21 +355,21 @@ export declare const runApiParametersSchema: z.ZodObject<{
355
355
  origins: {
356
356
  origin: string;
357
357
  localStorage: {
358
- value: string;
359
358
  name: string;
359
+ value: string;
360
360
  }[];
361
361
  }[];
362
362
  sessionStorage?: {
363
+ origin: string;
363
364
  sessionStorage: {
364
- value: string;
365
365
  name: string;
366
+ value: string;
366
367
  }[];
367
- origin: string;
368
368
  }[] | undefined;
369
369
  }, {
370
370
  cookies: {
371
- value: string;
372
371
  name: string;
372
+ value: string;
373
373
  path: string;
374
374
  domain: string;
375
375
  expires: number;
@@ -380,24 +380,24 @@ export declare const runApiParametersSchema: z.ZodObject<{
380
380
  origins: {
381
381
  origin: string;
382
382
  localStorage: {
383
- value: string;
384
383
  name: string;
384
+ value: string;
385
385
  }[];
386
386
  }[];
387
387
  sessionStorage?: {
388
+ origin: string;
388
389
  sessionStorage: {
389
- value: string;
390
390
  name: string;
391
+ value: string;
391
392
  }[];
392
- origin: string;
393
393
  }[] | undefined;
394
394
  }>>>;
395
395
  }, "strip", z.ZodTypeAny, {
396
396
  type: "state";
397
397
  state?: {
398
398
  cookies: {
399
- value: string;
400
399
  name: string;
400
+ value: string;
401
401
  path: string;
402
402
  domain: string;
403
403
  expires: number;
@@ -408,24 +408,24 @@ export declare const runApiParametersSchema: z.ZodObject<{
408
408
  origins: {
409
409
  origin: string;
410
410
  localStorage: {
411
- value: string;
412
411
  name: string;
412
+ value: string;
413
413
  }[];
414
414
  }[];
415
415
  sessionStorage?: {
416
+ origin: string;
416
417
  sessionStorage: {
417
- value: string;
418
418
  name: string;
419
+ value: string;
419
420
  }[];
420
- origin: string;
421
421
  }[] | undefined;
422
422
  } | null | undefined;
423
423
  }, {
424
424
  type: "state";
425
425
  state?: {
426
426
  cookies: {
427
- value: string;
428
427
  name: string;
428
+ value: string;
429
429
  path: string;
430
430
  domain: string;
431
431
  expires: number;
@@ -436,16 +436,16 @@ export declare const runApiParametersSchema: z.ZodObject<{
436
436
  origins: {
437
437
  origin: string;
438
438
  localStorage: {
439
- value: string;
440
439
  name: string;
440
+ value: string;
441
441
  }[];
442
442
  }[];
443
443
  sessionStorage?: {
444
+ origin: string;
444
445
  sessionStorage: {
445
- value: string;
446
446
  name: string;
447
+ value: string;
447
448
  }[];
448
- origin: string;
449
449
  }[] | undefined;
450
450
  } | null | undefined;
451
451
  }>]>;
@@ -458,8 +458,8 @@ export declare const runApiParametersSchema: z.ZodObject<{
458
458
  type: "state";
459
459
  state?: {
460
460
  cookies: {
461
- value: string;
462
461
  name: string;
462
+ value: string;
463
463
  path: string;
464
464
  domain: string;
465
465
  expires: number;
@@ -470,16 +470,16 @@ export declare const runApiParametersSchema: z.ZodObject<{
470
470
  origins: {
471
471
  origin: string;
472
472
  localStorage: {
473
- value: string;
474
473
  name: string;
474
+ value: string;
475
475
  }[];
476
476
  }[];
477
477
  sessionStorage?: {
478
+ origin: string;
478
479
  sessionStorage: {
479
- value: string;
480
480
  name: string;
481
+ value: string;
481
482
  }[];
482
- origin: string;
483
483
  }[] | undefined;
484
484
  } | null | undefined;
485
485
  };
@@ -492,8 +492,8 @@ export declare const runApiParametersSchema: z.ZodObject<{
492
492
  type: "state";
493
493
  state?: {
494
494
  cookies: {
495
- value: string;
496
495
  name: string;
496
+ value: string;
497
497
  path: string;
498
498
  domain: string;
499
499
  expires: number;
@@ -504,16 +504,16 @@ export declare const runApiParametersSchema: z.ZodObject<{
504
504
  origins: {
505
505
  origin: string;
506
506
  localStorage: {
507
- value: string;
508
507
  name: string;
508
+ value: string;
509
509
  }[];
510
510
  }[];
511
511
  sessionStorage?: {
512
+ origin: string;
512
513
  sessionStorage: {
513
- value: string;
514
514
  name: string;
515
+ value: string;
515
516
  }[];
516
- origin: string;
517
517
  }[] | undefined;
518
518
  } | null | undefined;
519
519
  };
@@ -598,8 +598,8 @@ export declare const runApiParametersSchema: z.ZodObject<{
598
598
  type: "state";
599
599
  state?: {
600
600
  cookies: {
601
- value: string;
602
601
  name: string;
602
+ value: string;
603
603
  path: string;
604
604
  domain: string;
605
605
  expires: number;
@@ -610,16 +610,16 @@ export declare const runApiParametersSchema: z.ZodObject<{
610
610
  origins: {
611
611
  origin: string;
612
612
  localStorage: {
613
- value: string;
614
613
  name: string;
614
+ value: string;
615
615
  }[];
616
616
  }[];
617
617
  sessionStorage?: {
618
+ origin: string;
618
619
  sessionStorage: {
619
- value: string;
620
620
  name: string;
621
+ value: string;
621
622
  }[];
622
- origin: string;
623
623
  }[] | undefined;
624
624
  } | null | undefined;
625
625
  };
@@ -644,8 +644,8 @@ export declare const runApiParametersSchema: z.ZodObject<{
644
644
  type: "state";
645
645
  state?: {
646
646
  cookies: {
647
- value: string;
648
647
  name: string;
648
+ value: string;
649
649
  path: string;
650
650
  domain: string;
651
651
  expires: number;
@@ -656,16 +656,16 @@ export declare const runApiParametersSchema: z.ZodObject<{
656
656
  origins: {
657
657
  origin: string;
658
658
  localStorage: {
659
- value: string;
660
659
  name: string;
660
+ value: string;
661
661
  }[];
662
662
  }[];
663
663
  sessionStorage?: {
664
+ origin: string;
664
665
  sessionStorage: {
665
- value: string;
666
666
  name: string;
667
+ value: string;
667
668
  }[];
668
- origin: string;
669
669
  }[] | undefined;
670
670
  } | null | undefined;
671
671
  };
@@ -697,6 +697,6 @@ export type RunApiResultOk<R = any> = {
697
697
  extendedPayloads?: Payload[];
698
698
  };
699
699
  export type RunApiResultWithSessionOk<R = any> = RunApiResultOk<R> & {
700
- session: StorageState;
700
+ session: IntunedStorageState;
701
701
  };
702
702
  export type RunApiResult<R = any, FullResult extends RunApiResultOk<R> = RunApiResultOk<R>> = Result<FullResult, RunAutomationError>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intuned/runtime-dev",
3
- "version": "1.0.4-remove-playwright.22",
3
+ "version": "1.0.4-stuck.1",
4
4
  "description": "Intuned runtime",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",
@@ -40,18 +40,20 @@
40
40
  "copy-dts": "copyfiles -u 1 \"src/**/*.d.ts\" dist"
41
41
  },
42
42
  "bin": {
43
- "intuned-api-run": "bin/intuned-api-run",
44
- "intuned-auth-session-create": "bin/intuned-auth-session-create",
45
- "intuned-auth-session-refresh": "bin/intuned-auth-session-refresh",
46
- "intuned-auth-session-load": "bin/intuned-auth-session-load",
47
- "intuned-auth-session-check": "bin/intuned-auth-session-check",
48
- "intuned-build": "bin/intuned-build",
49
- "intuned-browser-start": "bin/intuned-browser-start",
50
- "intuned-browser-save-state": "bin/intuned-browser-save-state",
51
- "intuned-ts-check": "bin/intuned-ts-check"
43
+ "intuned-api-run": "./bin/intuned-api-run",
44
+ "intuned-auth-session-create": "./bin/intuned-auth-session-create",
45
+ "intuned-auth-session-refresh": "./bin/intuned-auth-session-refresh",
46
+ "intuned-auth-session-load": "./bin/intuned-auth-session-load",
47
+ "intuned-auth-session-check": "./bin/intuned-auth-session-check",
48
+ "intuned-build": "./bin/intuned-build",
49
+ "intuned-browser-start": "./bin/intuned-browser-start",
50
+ "intuned-browser-save-state": "./bin/intuned-browser-save-state",
51
+ "intuned-ts-check": "./bin/intuned-ts-check"
52
52
  },
53
53
  "dependencies": {
54
54
  "@babel/plugin-syntax-dynamic-import": "^7.8.3",
55
+ "@intuned/playwright": "^1.44.1-4",
56
+ "@intuned/playwright-core": "^1.44.1-4",
55
57
  "@rollup/plugin-commonjs": "^25.0.2",
56
58
  "@rollup/plugin-dynamic-import-vars": "^2.0.4",
57
59
  "@rollup/plugin-json": "^6.0.0",
@@ -81,7 +83,6 @@
81
83
  "ms": "^2.1.3",
82
84
  "nanoid": "3",
83
85
  "neverthrow": "^6.1.0",
84
- "playwright": "^1.51.0",
85
86
  "playwright-extra": "^4.3.6",
86
87
  "prettier": "^2.8.0",
87
88
  "promptly": "^3.2.0",