@intuned/runtime-dev 1.1.5-bot-detection → 1.1.5-fingerprint.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/.babelrc +2 -2
  2. package/dist/commands/api/run.js +8 -2
  3. package/dist/commands/auth-sessions/run-check.js +18 -4
  4. package/dist/commands/auth-sessions/run-create.js +2 -1
  5. package/dist/commands/cli-auth-sessions/create.js +1 -1
  6. package/dist/commands/cli-auth-sessions/utils.d.ts +1 -1
  7. package/dist/commands/cli-auth-sessions/utils.js +2 -3
  8. package/dist/commands/common/browserUtils.d.ts +1 -1
  9. package/dist/commands/common/browserUtils.js +1 -1
  10. package/dist/commands/common/getFirstLineNumber.js +2 -4
  11. package/dist/commands/deploy/utils.js +1 -2
  12. package/dist/commands/init/utils.js +1 -7
  13. package/dist/commands/interface/run.js +7 -6
  14. package/dist/commands/run-api-cli/utils.js +6 -6
  15. package/dist/common/assets/browser_scripts.js +2509 -2143
  16. package/dist/common/assets/nopecha-extension/background.js +1 -0
  17. package/dist/common/assets/nopecha-extension/captcha/awscaptcha.js +1 -0
  18. package/dist/common/assets/nopecha-extension/captcha/funcaptcha.js +1 -0
  19. package/dist/common/assets/nopecha-extension/captcha/geetest.js +1 -0
  20. package/dist/common/assets/nopecha-extension/captcha/lemincaptcha.js +1 -0
  21. package/dist/common/assets/nopecha-extension/captcha/perimeterx.js +1 -0
  22. package/dist/common/assets/nopecha-extension/captcha/recaptcha.js +2 -0
  23. package/dist/common/assets/nopecha-extension/captcha/textcaptcha.js +1 -0
  24. package/dist/common/assets/nopecha-extension/captcha/turnstile.js +1 -0
  25. package/dist/common/assets/nopecha-extension/eventhook/loader.js +1 -0
  26. package/dist/common/assets/nopecha-extension/eventhook.js +1 -0
  27. package/dist/common/assets/nopecha-extension/icon/128.png +0 -0
  28. package/dist/common/assets/nopecha-extension/icon/128g.png +0 -0
  29. package/dist/common/assets/nopecha-extension/icon/16.png +0 -0
  30. package/dist/common/assets/nopecha-extension/icon/16g.png +0 -0
  31. package/dist/common/assets/nopecha-extension/icon/32.png +0 -0
  32. package/dist/common/assets/nopecha-extension/icon/32g.png +0 -0
  33. package/dist/common/assets/nopecha-extension/icon/48.png +0 -0
  34. package/dist/common/assets/nopecha-extension/icon/48g.png +0 -0
  35. package/dist/common/assets/nopecha-extension/lib/selector.js +1 -0
  36. package/dist/common/assets/nopecha-extension/locate.js +76 -0
  37. package/dist/common/assets/nopecha-extension/manifest.json +59 -0
  38. package/dist/common/assets/nopecha-extension/pages/funcaptcha-demo.js +1 -0
  39. package/dist/common/assets/nopecha-extension/pages/integrate.js +1 -0
  40. package/dist/common/assets/nopecha-extension/pages/setup.js +1 -0
  41. package/dist/common/assets/nopecha-extension/popup.css +1 -0
  42. package/dist/common/assets/nopecha-extension/popup.html +19 -0
  43. package/dist/common/assets/nopecha-extension/popup.js +2 -0
  44. package/dist/common/assets/nopecha-extension/setup.html +18 -0
  45. package/dist/common/asyncLocalStorage/index.d.ts +1 -2
  46. package/dist/common/backendFunctions/getAuthSessionParameters.d.ts +1 -0
  47. package/dist/common/backendFunctions/getAuthSessionParameters.js +38 -0
  48. package/dist/common/cli/constants.d.ts +1 -0
  49. package/dist/common/cli/constants.js +2 -1
  50. package/dist/common/cli/types.d.ts +1 -1
  51. package/dist/common/contextStorageStateHelpers.d.ts +1 -1
  52. package/dist/common/contextStorageStateHelpers.js +56 -0
  53. package/dist/common/getPlaywrightConstructs.d.ts +1 -1
  54. package/dist/common/getPlaywrightConstructs.js +26 -12
  55. package/dist/common/jwtTokenManager.js +3 -5
  56. package/dist/common/runApi/errors.d.ts +1 -1
  57. package/dist/common/runApi/errors.js +5 -6
  58. package/dist/common/runApi/index.d.ts +1 -1
  59. package/dist/common/runApi/index.js +8 -11
  60. package/dist/common/runApi/types.d.ts +16 -16
  61. package/dist/index.d.ts +1 -1
  62. package/dist/index.js +6 -0
  63. package/dist/runtime/executionHelpers.test.js +3 -4
  64. package/dist/runtime/export.d.ts +16 -0
  65. package/dist/runtime/extendPayload.js +1 -1
  66. package/dist/runtime/extendTimeout.js +0 -7
  67. package/dist/runtime/getAuthSessionParameters.d.ts +1 -0
  68. package/dist/runtime/getAuthSessionParameters.js +20 -0
  69. package/dist/runtime/index.d.ts +1 -0
  70. package/dist/runtime/index.js +7 -0
  71. package/package.json +4 -4
  72. package/template.tsconfig.json +4 -7
@@ -47,18 +47,18 @@ 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
- path: string;
51
50
  value: string;
52
51
  name: string;
52
+ path: string;
53
53
  domain: string;
54
54
  expires: number;
55
55
  httpOnly: boolean;
56
56
  secure: boolean;
57
57
  sameSite: "Strict" | "Lax" | "None";
58
58
  }, {
59
- path: string;
60
59
  value: string;
61
60
  name: string;
61
+ path: string;
62
62
  domain: string;
63
63
  expires: number;
64
64
  httpOnly: boolean;
@@ -117,9 +117,9 @@ export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
117
117
  }>, "many">>;
118
118
  }, "strip", z.ZodTypeAny, {
119
119
  cookies: {
120
- path: string;
121
120
  value: string;
122
121
  name: string;
122
+ path: string;
123
123
  domain: string;
124
124
  expires: number;
125
125
  httpOnly: boolean;
@@ -142,9 +142,9 @@ export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
142
142
  }[] | undefined;
143
143
  }, {
144
144
  cookies: {
145
- path: string;
146
145
  value: string;
147
146
  name: string;
147
+ path: string;
148
148
  domain: string;
149
149
  expires: number;
150
150
  httpOnly: boolean;
@@ -170,9 +170,9 @@ export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
170
170
  type: "state";
171
171
  state?: {
172
172
  cookies: {
173
- path: string;
174
173
  value: string;
175
174
  name: string;
175
+ path: string;
176
176
  domain: string;
177
177
  expires: number;
178
178
  httpOnly: boolean;
@@ -198,9 +198,9 @@ export declare const runApiSessionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
198
198
  type: "state";
199
199
  state?: {
200
200
  cookies: {
201
- path: string;
202
201
  value: string;
203
202
  name: string;
203
+ path: string;
204
204
  domain: string;
205
205
  expires: number;
206
206
  httpOnly: boolean;
@@ -273,18 +273,18 @@ 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
- path: string;
277
276
  value: string;
278
277
  name: string;
278
+ path: string;
279
279
  domain: string;
280
280
  expires: number;
281
281
  httpOnly: boolean;
282
282
  secure: boolean;
283
283
  sameSite: "Strict" | "Lax" | "None";
284
284
  }, {
285
- path: string;
286
285
  value: string;
287
286
  name: string;
287
+ path: string;
288
288
  domain: string;
289
289
  expires: number;
290
290
  httpOnly: boolean;
@@ -343,9 +343,9 @@ export declare const runApiParametersSchema: z.ZodObject<{
343
343
  }>, "many">>;
344
344
  }, "strip", z.ZodTypeAny, {
345
345
  cookies: {
346
- path: string;
347
346
  value: string;
348
347
  name: string;
348
+ path: string;
349
349
  domain: string;
350
350
  expires: number;
351
351
  httpOnly: boolean;
@@ -368,9 +368,9 @@ export declare const runApiParametersSchema: z.ZodObject<{
368
368
  }[] | undefined;
369
369
  }, {
370
370
  cookies: {
371
- path: string;
372
371
  value: string;
373
372
  name: string;
373
+ path: string;
374
374
  domain: string;
375
375
  expires: number;
376
376
  httpOnly: boolean;
@@ -396,9 +396,9 @@ export declare const runApiParametersSchema: z.ZodObject<{
396
396
  type: "state";
397
397
  state?: {
398
398
  cookies: {
399
- path: string;
400
399
  value: string;
401
400
  name: string;
401
+ path: string;
402
402
  domain: string;
403
403
  expires: number;
404
404
  httpOnly: boolean;
@@ -424,9 +424,9 @@ export declare const runApiParametersSchema: z.ZodObject<{
424
424
  type: "state";
425
425
  state?: {
426
426
  cookies: {
427
- path: string;
428
427
  value: string;
429
428
  name: string;
429
+ path: string;
430
430
  domain: string;
431
431
  expires: number;
432
432
  httpOnly: boolean;
@@ -458,9 +458,9 @@ export declare const runApiParametersSchema: z.ZodObject<{
458
458
  type: "state";
459
459
  state?: {
460
460
  cookies: {
461
- path: string;
462
461
  value: string;
463
462
  name: string;
463
+ path: string;
464
464
  domain: string;
465
465
  expires: number;
466
466
  httpOnly: boolean;
@@ -492,9 +492,9 @@ export declare const runApiParametersSchema: z.ZodObject<{
492
492
  type: "state";
493
493
  state?: {
494
494
  cookies: {
495
- path: string;
496
495
  value: string;
497
496
  name: string;
497
+ path: string;
498
498
  domain: string;
499
499
  expires: number;
500
500
  httpOnly: boolean;
@@ -598,9 +598,9 @@ export declare const runApiParametersSchema: z.ZodObject<{
598
598
  type: "state";
599
599
  state?: {
600
600
  cookies: {
601
- path: string;
602
601
  value: string;
603
602
  name: string;
603
+ path: string;
604
604
  domain: string;
605
605
  expires: number;
606
606
  httpOnly: boolean;
@@ -644,9 +644,9 @@ export declare const runApiParametersSchema: z.ZodObject<{
644
644
  type: "state";
645
645
  state?: {
646
646
  cookies: {
647
- path: string;
648
647
  value: string;
649
648
  name: string;
649
+ path: string;
650
650
  domain: string;
651
651
  expires: number;
652
652
  httpOnly: boolean;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { extendPayload, extendTimeout, runInfo, RunError, requestMultipleChoice, requestOTP, } from "./runtime";
1
+ export { extendPayload, extendTimeout, runInfo, RunError, requestMultipleChoice, requestOTP, getAuthSessionParameters, } from "./runtime";
2
2
  export { runWithContext, getExecutionContext, } from "./common/asyncLocalStorage";
3
3
  export { getDownloadDirectoryPath } from "./runtime/downloadDirectory";
4
4
  export { getProductionPlaywrightConstructs } from "./common/getPlaywrightConstructs";
package/dist/index.js CHANGED
@@ -21,6 +21,12 @@ Object.defineProperty(exports, "extendTimeout", {
21
21
  return _runtime.extendTimeout;
22
22
  }
23
23
  });
24
+ Object.defineProperty(exports, "getAuthSessionParameters", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _runtime.getAuthSessionParameters;
28
+ }
29
+ });
24
30
  Object.defineProperty(exports, "getDownloadDirectoryPath", {
25
31
  enumerable: true,
26
32
  get: function () {
@@ -24,13 +24,12 @@ var _enums = require("./enums");
24
24
  runId: "test-run-id",
25
25
  extendedPayloads: []
26
26
  }, () => {
27
- var _getExecutionContext, _getExecutionContext2;
28
- (0, _vitest.expect)((_getExecutionContext = (0, _asyncLocalStorage.getExecutionContext)()) === null || _getExecutionContext === void 0 ? void 0 : _getExecutionContext.extendedPayloads).toEqual([]);
27
+ (0, _vitest.expect)((0, _asyncLocalStorage.getExecutionContext)()?.extendedPayloads).toEqual([]);
29
28
  (0, _.extendPayload)({
30
29
  api: "test-api",
31
30
  parameters: {}
32
31
  });
33
- (0, _vitest.expect)((_getExecutionContext2 = (0, _asyncLocalStorage.getExecutionContext)()) === null || _getExecutionContext2 === void 0 ? void 0 : _getExecutionContext2.extendedPayloads).toEqual([{
32
+ (0, _vitest.expect)((0, _asyncLocalStorage.getExecutionContext)()?.extendedPayloads).toEqual([{
34
33
  api: "test-api",
35
34
  parameters: {}
36
35
  }]);
@@ -47,7 +46,7 @@ var _enums = require("./enums");
47
46
  parameters: {}
48
47
  });
49
48
  const context = (0, _asyncLocalStorage.getExecutionContext)();
50
- (0, _vitest.expect)(context === null || context === void 0 ? void 0 : context.extendedPayloads).toHaveLength(4);
49
+ (0, _vitest.expect)(context?.extendedPayloads).toHaveLength(4);
51
50
  });
52
51
  });
53
52
  });
@@ -99,6 +99,7 @@ export interface RunInfo {
99
99
  jobRunId?: string;
100
100
  queueId?: string;
101
101
  proxy?: string;
102
+ authSessionId?: string;
102
103
  }
103
104
 
104
105
  /**
@@ -200,3 +201,18 @@ export declare function requestMultipleChoice(
200
201
  * ```
201
202
  */
202
203
  export declare function requestOTP(message: string): unknown;
204
+
205
+ /**
206
+ * Retrieves the parameters for the authentication session currently being used.
207
+ *
208
+ * @returns {AuthSessionParameters} An object containing the parameters for the current authentication session.
209
+ *
210
+ * @example
211
+ * ```typescript getAuthSessionParameters
212
+ * import { getAuthSessionParameters } from "@intuned/sdk/runtime"
213
+ *
214
+ * const authSessionParams = getAuthSessionParameters();
215
+ * console.log(authSessionParams);
216
+ * ```
217
+ */
218
+ export declare function getAuthSessionParameters(): Promise<any>;
@@ -16,6 +16,6 @@ function extendPayload(payload) {
16
16
  context.extendedPayloads = [...items];
17
17
  return;
18
18
  }
19
- context === null || context === void 0 || context.extendedPayloads.push(...items);
19
+ context?.extendedPayloads.push(...items);
20
20
  (0, _extendTimeout.extendTimeout)();
21
21
  }
@@ -17,13 +17,6 @@ function extendTimeout() {
17
17
  if (!timeoutInfo) {
18
18
  return;
19
19
  }
20
- if (timeoutInfo.timeoutTimestamp !== undefined && timeoutInfo.timeoutDuration !== undefined) {
21
- const newTimeoutStamp = Date.now() + timeoutInfo.timeoutDuration;
22
- if (newTimeoutStamp - timeoutInfo.timeoutTimestamp < _DEBOUNCE_TIME) {
23
- return;
24
- }
25
- timeoutInfo.timeoutTimestamp = newTimeoutStamp;
26
- }
27
20
  if (timeoutInfo.extendTimeoutCallback !== undefined) {
28
21
  void timeoutInfo.extendTimeoutCallback().catch(() => undefined);
29
22
  }
@@ -0,0 +1 @@
1
+ export declare function getAuthSessionParameters(): Promise<any>;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getAuthSessionParameters = getAuthSessionParameters;
7
+ var _asyncLocalStorage = require("../common/asyncLocalStorage");
8
+ async function getAuthSessionParameters() {
9
+ const context = (0, _asyncLocalStorage.getExecutionContext)();
10
+ if (!context) {
11
+ throw new Error("getAuthSessionParameters failed due to an internal error (context was not found).");
12
+ }
13
+ const {
14
+ getAuthSessionParameters
15
+ } = context;
16
+ if (!getAuthSessionParameters) {
17
+ throw new Error("getAuthSessionParameters failed due to an internal error (helper was not found on context).");
18
+ }
19
+ return await getAuthSessionParameters();
20
+ }
@@ -1,5 +1,6 @@
1
1
  export { extendPayload } from "./extendPayload";
2
2
  export { extendTimeout } from "./extendTimeout";
3
+ export { getAuthSessionParameters } from "./getAuthSessionParameters";
3
4
  export { runInfo } from "./runInfo";
4
5
  export { RunError } from "./RunError";
5
6
  export { requestMultipleChoice, requestOTP } from "./requestMoreInfo";
@@ -21,6 +21,12 @@ Object.defineProperty(exports, "extendTimeout", {
21
21
  return _extendTimeout.extendTimeout;
22
22
  }
23
23
  });
24
+ Object.defineProperty(exports, "getAuthSessionParameters", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _getAuthSessionParameters.getAuthSessionParameters;
28
+ }
29
+ });
24
30
  Object.defineProperty(exports, "getDownloadDirectoryPath", {
25
31
  enumerable: true,
26
32
  get: function () {
@@ -47,6 +53,7 @@ Object.defineProperty(exports, "runInfo", {
47
53
  });
48
54
  var _extendPayload = require("./extendPayload");
49
55
  var _extendTimeout = require("./extendTimeout");
56
+ var _getAuthSessionParameters = require("./getAuthSessionParameters");
50
57
  var _runInfo = require("./runInfo");
51
58
  var _RunError = require("./RunError");
52
59
  var _requestMoreInfo = require("./requestMoreInfo");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intuned/runtime-dev",
3
- "version": "1.1.5-bot-detection",
3
+ "version": "1.1.5-fingerprint.0",
4
4
  "description": "Intuned runtime",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",
@@ -69,11 +69,12 @@
69
69
  "@types/node": "20.4.1",
70
70
  "applicationinsights": "2.9.2",
71
71
  "babel-plugin-dynamic-import-node": "2.3.3",
72
- "boxen": "8.0.1",
73
72
  "chalk": "^4.1.2",
74
73
  "commander": "^11.0.0",
75
74
  "cross-fetch": "^4.0.0",
76
75
  "dotenv": "^16.3.1",
76
+ "fingerprint-generator": "^2.1.66",
77
+ "fingerprint-injector": "^2.1.66",
77
78
  "fs-extra": "^11.3.0",
78
79
  "image-size": "^1.1.1",
79
80
  "inquirer": "12.6.0",
@@ -83,7 +84,6 @@
83
84
  "minimatch": "10.0.1",
84
85
  "nanoid": "3",
85
86
  "neverthrow": "6.1.0",
86
- "patchright": "1.48.2",
87
87
  "playwright-extra": "4.3.6",
88
88
  "prettier": "2.8.0",
89
89
  "promptly": "3.2.0",
@@ -131,6 +131,6 @@
131
131
  "vitest": "^1.1.3"
132
132
  },
133
133
  "peerDependencies": {
134
- "@intuned/runtime": "*"
134
+ "playwright": "*"
135
135
  }
136
136
  }
@@ -1,14 +1,11 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "module": "ESNext",
4
3
  "target": "ES2021",
5
- "lib": [
6
- "dom",
7
- "es2021"
8
- ],
4
+ "lib": ["dom", "es2021"],
9
5
  "resolveJsonModule": true,
10
6
  "esModuleInterop": true,
11
- "moduleResolution": "node",
7
+ "moduleResolution": "bundler",
8
+ "module": "esnext",
12
9
  "skipLibCheck": true
13
10
  }
14
- }
11
+ }