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

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 "@intuned/playwright-core";
1
+ import * as playwright from "playwright-core";
2
2
  import { Handler, Response } from "@tinyhttp/app";
3
3
  import * as path from "path";
4
4
  import { getExecutionContext } from "@intuned/runtime";
@@ -61,13 +61,18 @@ _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
+ }));
64
69
  if (done) {
65
70
  if (value.isErr()) {
66
71
  if (value.error instanceof _runApi.AutomationError) {
67
72
  throw value.error.error;
68
73
  }
69
- console.error(value.error);
70
- throw new Error("Error while running create");
74
+ console.error("testtttt", value.error);
75
+ throw new Error(`Error while running create ${JSON.stringify(value)}`);
71
76
  }
72
77
  const fullState = value.value.session;
73
78
  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: ["@intuned/playwright", "@intuned/playwright-core", "jsdom", "canvas", "pdfjs-dist", "pdf-to-png-converter", "crypto", "applicationinsights", "fingerprint-generator", "fingerprint-injector", "node-fetch"]
63
+ external: ["playwright", "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 "@intuned/playwright-core";
1
+ import { BrowserContext } from "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("@intuned/playwright-core"));
12
+ var playwright = _interopRequireWildcard(require("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.getContextStorageState)(context);
54
+ const fullState = await (0, _contextStorageStateHelpers.getStorageState)(context);
55
55
  const fullPath = (0, _fileUtils.getFullPathInProject)(path);
56
56
  fs.ensureFileSync(fullPath);
57
57
  await fs.writeJSON(fullPath, fullState);
@@ -1,14 +1,21 @@
1
- import { BrowserContext } from "@intuned/playwright";
2
- import * as playwright from "@intuned/playwright-core";
3
- export interface OriginSessionStorage {
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 {
4
11
  origin: string;
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>;
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 {};
@@ -3,52 +3,65 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
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
- });
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);
15
12
  }
16
- return result;
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();
17
37
  }
18
- async function getContextStorageState(context) {
19
- const cookiesAndLocalStorage = await context.storageState();
20
- const pages = context.pages();
21
- const pagesSessions = [];
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();
22
45
  for (const page of pages) {
46
+ if (page.isClosed()) continue;
23
47
  try {
24
- const [origin, session] = await page.evaluate(() => [location.origin, sessionStorage]);
25
- const transformed = sessionStorageToArray(session);
26
- pagesSessions.push({
27
- origin,
28
- sessionStorage: transformed
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
+ };
29
59
  });
30
- } catch (e) {}
31
- }
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
- }
60
+ sessionDataList.push(sessionData);
61
+ } catch (error) {
62
+ console.error("Error getting sessionStorage:", error);
52
63
  }
53
- }, sessionStorage);
64
+ }
65
+ result["sessionStorage"] = sessionDataList;
66
+ return result;
54
67
  }
@@ -1,4 +1,4 @@
1
- import * as playwright from "@intuned/playwright-core";
1
+ import * as playwright from "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("@intuned/playwright-core"));
10
+ var playwright = _interopRequireWildcard(require("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.setContextStorageState)(context, sessionToLoad);
163
+ await (0, _contextStorageStateHelpers.setStorageState)(context, sessionToLoad);
164
164
  }
165
165
  async function getRemotePlaywrightContext(cdpAddress) {
166
- const playwright = await Promise.resolve().then(() => _interopRequireWildcard(require("@intuned/playwright-core")));
166
+ const playwright = await Promise.resolve().then(() => _interopRequireWildcard(require("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("@intuned/playwright-core"));
8
+ var playwright = _interopRequireWildcard(require("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 "@intuned/playwright-core";
3
+ import { Page, BrowserContext } from "playwright-core";
4
4
  import { ExtendedRunApiParameters, RunApiResult, RunApiResultWithSessionOk } from "./types";
5
5
  export * from "./types";
6
6
  export * from "./errors";
@@ -94,6 +94,7 @@ 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);
97
98
  return (0, _neverthrow.err)(validatedModuleResult.error);
98
99
  }
99
100
  const importedModule = validatedModuleResult.value;
@@ -183,10 +184,12 @@ async function* runApiGenerator({
183
184
  } else {
184
185
  result = await importedModule.func(...automationFunctionParameters);
185
186
  }
187
+ const x = await (0, _contextStorageStateHelpers.getStorageState)(context);
188
+ console.log("storage state gggg", JSON.stringify(x));
186
189
  return (0, _neverthrow.ok)({
187
190
  result,
188
191
  extendedPayloads: (_getExecutionContext = (0, _asyncLocalStorage.getExecutionContext)()) === null || _getExecutionContext === void 0 ? void 0 : _getExecutionContext.extendedPayloads,
189
- session: retrieveSession ? await (0, _contextStorageStateHelpers.getContextStorageState)(context) : undefined
192
+ session: retrieveSession ? await (0, _contextStorageStateHelpers.getStorageState)(context) : undefined
190
193
  });
191
194
  }
192
195
  try {
@@ -243,6 +246,7 @@ async function checkAuthSessionWithRetries(page, context, checkFn, retries = 3)
243
246
  async function importUsingImportFunction(path, importFunction) {
244
247
  try {
245
248
  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);
246
250
  if (!imported || !imported.default || !imported.default.constructor) {
247
251
  return (0, _neverthrow.err)(new _errors.InvalidApiError("API file path does not have a default export"));
248
252
  }
@@ -1,4 +1,4 @@
1
- import type { IntunedStorageState } from "../contextStorageStateHelpers";
1
+ import type { StorageState } 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?: IntunedStorageState;
14
+ session?: StorageState;
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
- name: string;
51
50
  value: string;
51
+ name: 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
- name: string;
60
59
  value: string;
60
+ name: 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
- name: string;
75
74
  value: string;
76
- }, {
77
75
  name: string;
76
+ }, {
78
77
  value: string;
78
+ name: string;
79
79
  }>, "many">;
80
80
  }, "strip", z.ZodTypeAny, {
81
81
  origin: string;
82
82
  localStorage: {
83
- name: string;
84
83
  value: string;
84
+ name: string;
85
85
  }[];
86
86
  }, {
87
87
  origin: string;
88
88
  localStorage: {
89
- name: string;
90
89
  value: string;
90
+ name: 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
- name: string;
100
99
  value: string;
101
- }, {
102
100
  name: string;
101
+ }, {
103
102
  value: string;
103
+ name: string;
104
104
  }>, "many">;
105
105
  }, "strip", z.ZodTypeAny, {
106
- origin: string;
107
106
  sessionStorage: {
108
- name: string;
109
107
  value: string;
108
+ name: string;
110
109
  }[];
111
- }, {
112
110
  origin: string;
111
+ }, {
113
112
  sessionStorage: {
114
- name: string;
115
113
  value: string;
114
+ name: string;
116
115
  }[];
116
+ origin: string;
117
117
  }>, "many">>;
118
118
  }, "strip", z.ZodTypeAny, {
119
119
  cookies: {
120
- name: string;
121
120
  value: string;
121
+ name: 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
- name: string;
133
132
  value: string;
133
+ name: string;
134
134
  }[];
135
135
  }[];
136
136
  sessionStorage?: {
137
- origin: string;
138
137
  sessionStorage: {
139
- name: string;
140
138
  value: string;
139
+ name: string;
141
140
  }[];
141
+ origin: string;
142
142
  }[] | undefined;
143
143
  }, {
144
144
  cookies: {
145
- name: string;
146
145
  value: string;
146
+ name: 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
- name: string;
158
157
  value: string;
158
+ name: string;
159
159
  }[];
160
160
  }[];
161
161
  sessionStorage?: {
162
- origin: string;
163
162
  sessionStorage: {
164
- name: string;
165
163
  value: string;
164
+ name: string;
166
165
  }[];
166
+ origin: string;
167
167
  }[] | undefined;
168
168
  }>>>;
169
169
  }, "strip", z.ZodTypeAny, {
170
170
  type: "state";
171
171
  state?: {
172
172
  cookies: {
173
- name: string;
174
173
  value: string;
174
+ name: 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
- name: string;
186
185
  value: string;
186
+ name: string;
187
187
  }[];
188
188
  }[];
189
189
  sessionStorage?: {
190
- origin: string;
191
190
  sessionStorage: {
192
- name: string;
193
191
  value: string;
192
+ name: string;
194
193
  }[];
194
+ origin: string;
195
195
  }[] | undefined;
196
196
  } | null | undefined;
197
197
  }, {
198
198
  type: "state";
199
199
  state?: {
200
200
  cookies: {
201
- name: string;
202
201
  value: string;
202
+ name: 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
- name: string;
214
213
  value: string;
214
+ name: string;
215
215
  }[];
216
216
  }[];
217
217
  sessionStorage?: {
218
- origin: string;
219
218
  sessionStorage: {
220
- name: string;
221
219
  value: string;
220
+ name: string;
222
221
  }[];
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
- name: string;
277
276
  value: string;
277
+ name: 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
- name: string;
286
285
  value: string;
286
+ name: 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
- name: string;
301
300
  value: string;
302
- }, {
303
301
  name: string;
302
+ }, {
304
303
  value: string;
304
+ name: string;
305
305
  }>, "many">;
306
306
  }, "strip", z.ZodTypeAny, {
307
307
  origin: string;
308
308
  localStorage: {
309
- name: string;
310
309
  value: string;
310
+ name: string;
311
311
  }[];
312
312
  }, {
313
313
  origin: string;
314
314
  localStorage: {
315
- name: string;
316
315
  value: string;
316
+ name: 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
- name: string;
326
325
  value: string;
327
- }, {
328
326
  name: string;
327
+ }, {
329
328
  value: string;
329
+ name: string;
330
330
  }>, "many">;
331
331
  }, "strip", z.ZodTypeAny, {
332
- origin: string;
333
332
  sessionStorage: {
334
- name: string;
335
333
  value: string;
334
+ name: string;
336
335
  }[];
337
- }, {
338
336
  origin: string;
337
+ }, {
339
338
  sessionStorage: {
340
- name: string;
341
339
  value: string;
340
+ name: string;
342
341
  }[];
342
+ origin: string;
343
343
  }>, "many">>;
344
344
  }, "strip", z.ZodTypeAny, {
345
345
  cookies: {
346
- name: string;
347
346
  value: string;
347
+ name: 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
- name: string;
359
358
  value: string;
359
+ name: string;
360
360
  }[];
361
361
  }[];
362
362
  sessionStorage?: {
363
- origin: string;
364
363
  sessionStorage: {
365
- name: string;
366
364
  value: string;
365
+ name: string;
367
366
  }[];
367
+ origin: string;
368
368
  }[] | undefined;
369
369
  }, {
370
370
  cookies: {
371
- name: string;
372
371
  value: string;
372
+ name: 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
- name: string;
384
383
  value: string;
384
+ name: string;
385
385
  }[];
386
386
  }[];
387
387
  sessionStorage?: {
388
- origin: string;
389
388
  sessionStorage: {
390
- name: string;
391
389
  value: string;
390
+ name: string;
392
391
  }[];
392
+ origin: string;
393
393
  }[] | undefined;
394
394
  }>>>;
395
395
  }, "strip", z.ZodTypeAny, {
396
396
  type: "state";
397
397
  state?: {
398
398
  cookies: {
399
- name: string;
400
399
  value: string;
400
+ name: 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
- name: string;
412
411
  value: string;
412
+ name: string;
413
413
  }[];
414
414
  }[];
415
415
  sessionStorage?: {
416
- origin: string;
417
416
  sessionStorage: {
418
- name: string;
419
417
  value: string;
418
+ name: string;
420
419
  }[];
420
+ origin: string;
421
421
  }[] | undefined;
422
422
  } | null | undefined;
423
423
  }, {
424
424
  type: "state";
425
425
  state?: {
426
426
  cookies: {
427
- name: string;
428
427
  value: string;
428
+ name: 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
- name: string;
440
439
  value: string;
440
+ name: string;
441
441
  }[];
442
442
  }[];
443
443
  sessionStorage?: {
444
- origin: string;
445
444
  sessionStorage: {
446
- name: string;
447
445
  value: string;
446
+ name: string;
448
447
  }[];
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
- name: string;
462
461
  value: string;
462
+ name: 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
- name: string;
474
473
  value: string;
474
+ name: string;
475
475
  }[];
476
476
  }[];
477
477
  sessionStorage?: {
478
- origin: string;
479
478
  sessionStorage: {
480
- name: string;
481
479
  value: string;
480
+ name: string;
482
481
  }[];
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
- name: string;
496
495
  value: string;
496
+ name: 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
- name: string;
508
507
  value: string;
508
+ name: string;
509
509
  }[];
510
510
  }[];
511
511
  sessionStorage?: {
512
- origin: string;
513
512
  sessionStorage: {
514
- name: string;
515
513
  value: string;
514
+ name: string;
516
515
  }[];
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
- name: string;
602
601
  value: string;
602
+ name: 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
- name: string;
614
613
  value: string;
614
+ name: string;
615
615
  }[];
616
616
  }[];
617
617
  sessionStorage?: {
618
- origin: string;
619
618
  sessionStorage: {
620
- name: string;
621
619
  value: string;
620
+ name: string;
622
621
  }[];
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
- name: string;
648
647
  value: string;
648
+ name: 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
- name: string;
660
659
  value: string;
660
+ name: string;
661
661
  }[];
662
662
  }[];
663
663
  sessionStorage?: {
664
- origin: string;
665
664
  sessionStorage: {
666
- name: string;
667
665
  value: string;
666
+ name: string;
668
667
  }[];
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: IntunedStorageState;
700
+ session: StorageState;
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.20",
3
+ "version": "1.0.4-remove-playwright.22",
4
4
  "description": "Intuned runtime",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",
@@ -40,20 +40,18 @@
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",
57
55
  "@rollup/plugin-commonjs": "^25.0.2",
58
56
  "@rollup/plugin-dynamic-import-vars": "^2.0.4",
59
57
  "@rollup/plugin-json": "^6.0.0",
@@ -83,6 +81,7 @@
83
81
  "ms": "^2.1.3",
84
82
  "nanoid": "3",
85
83
  "neverthrow": "^6.1.0",
84
+ "playwright": "^1.51.0",
86
85
  "playwright-extra": "^4.3.6",
87
86
  "prettier": "^2.8.0",
88
87
  "promptly": "^3.2.0",